aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/lgl/gc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/lgl/gc.h')
-rw-r--r--src/daemon/https/lgl/gc.h54
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 *);
105typedef void *(*MHD_gc_realloc_t) (void *p, size_t n); 105typedef void *(*MHD_gc_realloc_t) (void *p, size_t n);
106typedef void (*MHD_gc_free_t) (void *); 106typedef void (*MHD_gc_free_t) (void *);
107void MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc, 107void 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. */
113Gc_rc MHD_gc_nonce (char *data, size_t datalen); 114Gc_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. */
118Gc_rc MHD_gc_cipher_open (Gc_cipher cipher, 119Gc_rc MHD_gc_cipher_open (Gc_cipher cipher,
119 Gc_cipher_mode mode, MHD_gc_cipher_handle * outhandle); 120 Gc_cipher_mode mode,
120Gc_rc MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, 121 MHD_gc_cipher_handle * outhandle);
121 size_t keylen, const char *key); 122Gc_rc MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, size_t keylen,
122Gc_rc MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen, const char *iv); 123 const char *key);
123Gc_rc MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, 124Gc_rc MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen,
124 size_t len, char *data); 125 const char *iv);
125Gc_rc MHD_gc_cipher_decrypt_inline (MHD_gc_cipher_handle handle, 126Gc_rc MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, size_t len,
126 size_t len, char *data); 127 char *data);
128Gc_rc MHD_gc_cipher_decrypt_inline (MHD_gc_cipher_handle handle, size_t len,
129 char *data);
127Gc_rc MHD_gc_cipher_close (MHD_gc_cipher_handle handle); 130Gc_rc MHD_gc_cipher_close (MHD_gc_cipher_handle handle);
128 131
129/* Hashes. */ 132/* Hashes. */
130 133
131Gc_rc MHD_gc_hash_open (Gc_hash hash, 134Gc_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);
133Gc_rc MHD_gc_hash_clone (MHD_gc_hash_handle handle, MHD_gc_hash_handle * outhandle); 136Gc_rc MHD_gc_hash_clone (MHD_gc_hash_handle handle,
137 MHD_gc_hash_handle * outhandle);
134size_t MHD_gc_hash_digest_length (Gc_hash hash); 138size_t MHD_gc_hash_digest_length (Gc_hash hash);
135void MHD_gc_hash_MHD_hmac_setkey (MHD_gc_hash_handle handle, size_t len, const char *key); 139void MHD_gc_hash_MHD_hmac_setkey (MHD_gc_hash_handle handle, size_t len,
136void MHD_gc_hash_write (MHD_gc_hash_handle handle, size_t len, const char *data); 140 const char *key);
141void MHD_gc_hash_write (MHD_gc_hash_handle handle, size_t len,
142 const char *data);
137const char *MHD_gc_hash_read (MHD_gc_hash_handle handle); 143const char *MHD_gc_hash_read (MHD_gc_hash_handle handle);
138void MHD_gc_hash_close (MHD_gc_hash_handle handle); 144void 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. */
146Gc_rc MHD_gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *out); 152Gc_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. */
149Gc_rc MHD_gc_md2 (const void *in, size_t inlen, void *resbuf); 156Gc_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);
151Gc_rc MHD_gc_md5 (const void *in, size_t inlen, void *resbuf); 158Gc_rc MHD_gc_md5 (const void *in, size_t inlen, void *resbuf);
152Gc_rc MHD_gc_sha1 (const void *in, size_t inlen, void *resbuf); 159Gc_rc MHD_gc_sha1 (const void *in, size_t inlen, void *resbuf);
153Gc_rc MHD_gc_MHD_hmac_md5 (const void *key, 160Gc_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,
155Gc_rc MHD_gc_MHD_hmac_sha1 (const void *key, 162 char *resbuf);
156 size_t keylen, 163Gc_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. */
166Gc_rc MHD_gc_pbkdf2_sha1 (const char *P, 173Gc_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: