diff options
Diffstat (limited to 'src/daemon/https/lgl/gc.h')
-rw-r--r-- | src/daemon/https/lgl/gc.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/src/daemon/https/lgl/gc.h b/src/daemon/https/lgl/gc.h index ecc506fc..4d6b2c93 100644 --- a/src/daemon/https/lgl/gc.h +++ b/src/daemon/https/lgl/gc.h | |||
@@ -105,9 +105,10 @@ typedef int (*MHD_gc_secure_check_t) (const void *); | |||
105 | typedef void *(*MHD_gc_realloc_t) (void *p, size_t n); | 105 | typedef void *(*MHD_gc_realloc_t) (void *p, size_t n); |
106 | typedef void (*MHD_gc_free_t) (void *); | 106 | typedef void (*MHD_gc_free_t) (void *); |
107 | void MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc, | 107 | void MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc, |
108 | MHD_gc_malloc_t secure_malloc, | 108 | MHD_gc_malloc_t secure_malloc, |
109 | MHD_gc_secure_check_t secure_check, | 109 | MHD_gc_secure_check_t secure_check, |
110 | MHD_gc_realloc_t func_realloc, MHD_gc_free_t func_free); | 110 | MHD_gc_realloc_t func_realloc, |
111 | MHD_gc_free_t func_free); | ||
111 | 112 | ||
112 | /* Randomness. */ | 113 | /* Randomness. */ |
113 | Gc_rc MHD_gc_nonce (char *data, size_t datalen); | 114 | Gc_rc MHD_gc_nonce (char *data, size_t datalen); |
@@ -116,24 +117,29 @@ Gc_rc MHD_gc_random (char *data, size_t datalen); | |||
116 | 117 | ||
117 | /* Ciphers. */ | 118 | /* Ciphers. */ |
118 | Gc_rc MHD_gc_cipher_open (Gc_cipher cipher, | 119 | Gc_rc MHD_gc_cipher_open (Gc_cipher cipher, |
119 | Gc_cipher_mode mode, MHD_gc_cipher_handle * outhandle); | 120 | Gc_cipher_mode mode, |
120 | Gc_rc MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, | 121 | MHD_gc_cipher_handle * outhandle); |
121 | size_t keylen, const char *key); | 122 | Gc_rc MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, size_t keylen, |
122 | Gc_rc MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen, const char *iv); | 123 | const char *key); |
123 | Gc_rc MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, | 124 | Gc_rc MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen, |
124 | size_t len, char *data); | 125 | const char *iv); |
125 | Gc_rc MHD_gc_cipher_decrypt_inline (MHD_gc_cipher_handle handle, | 126 | Gc_rc MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, size_t len, |
126 | size_t len, char *data); | 127 | char *data); |
128 | Gc_rc MHD_gc_cipher_decrypt_inline (MHD_gc_cipher_handle handle, size_t len, | ||
129 | char *data); | ||
127 | Gc_rc MHD_gc_cipher_close (MHD_gc_cipher_handle handle); | 130 | Gc_rc MHD_gc_cipher_close (MHD_gc_cipher_handle handle); |
128 | 131 | ||
129 | /* Hashes. */ | 132 | /* Hashes. */ |
130 | 133 | ||
131 | Gc_rc MHD_gc_hash_open (Gc_hash hash, | 134 | Gc_rc MHD_gc_hash_open (Gc_hash hash, |
132 | Gc_hash_mode mode, MHD_gc_hash_handle * outhandle); | 135 | Gc_hash_mode mode, MHD_gc_hash_handle * outhandle); |
133 | Gc_rc MHD_gc_hash_clone (MHD_gc_hash_handle handle, MHD_gc_hash_handle * outhandle); | 136 | Gc_rc MHD_gc_hash_clone (MHD_gc_hash_handle handle, |
137 | MHD_gc_hash_handle * outhandle); | ||
134 | size_t MHD_gc_hash_digest_length (Gc_hash hash); | 138 | size_t MHD_gc_hash_digest_length (Gc_hash hash); |
135 | void MHD_gc_hash_MHD_hmac_setkey (MHD_gc_hash_handle handle, size_t len, const char *key); | 139 | void MHD_gc_hash_MHD_hmac_setkey (MHD_gc_hash_handle handle, size_t len, |
136 | void MHD_gc_hash_write (MHD_gc_hash_handle handle, size_t len, const char *data); | 140 | const char *key); |
141 | void MHD_gc_hash_write (MHD_gc_hash_handle handle, size_t len, | ||
142 | const char *data); | ||
137 | const char *MHD_gc_hash_read (MHD_gc_hash_handle handle); | 143 | const char *MHD_gc_hash_read (MHD_gc_hash_handle handle); |
138 | void MHD_gc_hash_close (MHD_gc_hash_handle handle); | 144 | void MHD_gc_hash_close (MHD_gc_hash_handle handle); |
139 | 145 | ||
@@ -143,7 +149,8 @@ void MHD_gc_hash_close (MHD_gc_hash_handle handle); | |||
143 | GC_<HASH>_DIGEST_SIZE. For example, for GC_MD5 the output buffer | 149 | GC_<HASH>_DIGEST_SIZE. For example, for GC_MD5 the output buffer |
144 | must be 16 bytes. The return value is 0 (GC_OK) on success, or | 150 | must be 16 bytes. The return value is 0 (GC_OK) on success, or |
145 | another Gc_rc error code. */ | 151 | another Gc_rc error code. */ |
146 | Gc_rc MHD_gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *out); | 152 | Gc_rc MHD_gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, |
153 | char *out); | ||
147 | 154 | ||
148 | /* One-call interface. */ | 155 | /* One-call interface. */ |
149 | Gc_rc MHD_gc_md2 (const void *in, size_t inlen, void *resbuf); | 156 | Gc_rc MHD_gc_md2 (const void *in, size_t inlen, void *resbuf); |
@@ -151,10 +158,10 @@ Gc_rc MHD_gc_md4 (const void *in, size_t inlen, void *resbuf); | |||
151 | Gc_rc MHD_gc_md5 (const void *in, size_t inlen, void *resbuf); | 158 | Gc_rc MHD_gc_md5 (const void *in, size_t inlen, void *resbuf); |
152 | Gc_rc MHD_gc_sha1 (const void *in, size_t inlen, void *resbuf); | 159 | Gc_rc MHD_gc_sha1 (const void *in, size_t inlen, void *resbuf); |
153 | Gc_rc MHD_gc_MHD_hmac_md5 (const void *key, | 160 | Gc_rc MHD_gc_MHD_hmac_md5 (const void *key, |
154 | size_t keylen, const void *in, size_t inlen, char *resbuf); | 161 | size_t keylen, const void *in, size_t inlen, |
155 | Gc_rc MHD_gc_MHD_hmac_sha1 (const void *key, | 162 | char *resbuf); |
156 | size_t keylen, | 163 | Gc_rc MHD_gc_MHD_hmac_sha1 (const void *key, size_t keylen, const void *in, |
157 | const void *in, size_t inlen, char *resbuf); | 164 | size_t inlen, char *resbuf); |
158 | 165 | ||
159 | /* Derive cryptographic keys from a password P of length PLEN, with | 166 | /* Derive cryptographic keys from a password P of length PLEN, with |
160 | salt S of length SLEN, placing the result in pre-allocated buffer | 167 | salt S of length SLEN, placing the result in pre-allocated buffer |
@@ -164,9 +171,10 @@ Gc_rc MHD_gc_MHD_hmac_sha1 (const void *key, | |||
164 | exactly dkLen bytes long. GC_OK is returned on success, otherwise | 171 | exactly dkLen bytes long. GC_OK is returned on success, otherwise |
165 | an Gc_rc error code is returned. */ | 172 | an Gc_rc error code is returned. */ |
166 | Gc_rc MHD_gc_pbkdf2_sha1 (const char *P, | 173 | Gc_rc MHD_gc_pbkdf2_sha1 (const char *P, |
167 | size_t Plen, | 174 | size_t Plen, |
168 | const char *S, | 175 | const char *S, |
169 | size_t Slen, unsigned int c, char *DK, size_t dkLen); | 176 | size_t Slen, unsigned int c, char *DK, |
177 | size_t dkLen); | ||
170 | 178 | ||
171 | /* | 179 | /* |
172 | TODO: | 180 | TODO: |