aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/lgl/gc-libgcrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/lgl/gc-libgcrypt.c')
-rw-r--r--src/daemon/https/lgl/gc-libgcrypt.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/daemon/https/lgl/gc-libgcrypt.c b/src/daemon/https/lgl/gc-libgcrypt.c
index a51a7bb4..e4429bd2 100644
--- a/src/daemon/https/lgl/gc-libgcrypt.c
+++ b/src/daemon/https/lgl/gc-libgcrypt.c
@@ -90,9 +90,9 @@ MHD_gc_random (char *data, size_t datalen)
90 90
91void 91void
92MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc, 92MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc,
93 MHD_gc_malloc_t secure_malloc, 93 MHD_gc_malloc_t secure_malloc,
94 MHD_gc_secure_check_t secure_check, 94 MHD_gc_secure_check_t secure_check,
95 MHD_gc_realloc_t func_realloc, MHD_gc_free_t func_free) 95 MHD_gc_realloc_t func_realloc, MHD_gc_free_t func_free)
96{ 96{
97 gcry_set_allocation_handler (func_malloc, secure_malloc, secure_check, 97 gcry_set_allocation_handler (func_malloc, secure_malloc, secure_check,
98 func_realloc, func_free); 98 func_realloc, func_free);
@@ -102,7 +102,7 @@ MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc,
102 102
103Gc_rc 103Gc_rc
104MHD_gc_cipher_open (Gc_cipher alg, 104MHD_gc_cipher_open (Gc_cipher alg,
105 Gc_cipher_mode mode, MHD_gc_cipher_handle * outhandle) 105 Gc_cipher_mode mode, MHD_gc_cipher_handle * outhandle)
106{ 106{
107 int gcryalg, gcrymode; 107 int gcryalg, gcrymode;
108 gcry_error_t err; 108 gcry_error_t err;
@@ -179,7 +179,8 @@ MHD_gc_cipher_open (Gc_cipher alg,
179} 179}
180 180
181Gc_rc 181Gc_rc
182MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, size_t keylen, const char *key) 182MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, size_t keylen,
183 const char *key)
183{ 184{
184 gcry_error_t err; 185 gcry_error_t err;
185 186
@@ -191,7 +192,8 @@ MHD_gc_cipher_setkey (MHD_gc_cipher_handle handle, size_t keylen, const char *ke
191} 192}
192 193
193Gc_rc 194Gc_rc
194MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen, const char *iv) 195MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen,
196 const char *iv)
195{ 197{
196 gcry_error_t err; 198 gcry_error_t err;
197 199
@@ -203,7 +205,8 @@ MHD_gc_cipher_setiv (MHD_gc_cipher_handle handle, size_t ivlen, const char *iv)
203} 205}
204 206
205Gc_rc 207Gc_rc
206MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, size_t len, char *data) 208MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, size_t len,
209 char *data)
207{ 210{
208 if (gcry_cipher_encrypt ((gcry_cipher_hd_t) handle, data, len, NULL, len) != 211 if (gcry_cipher_encrypt ((gcry_cipher_hd_t) handle, data, len, NULL, len) !=
209 0) 212 0)
@@ -213,7 +216,8 @@ MHD_gc_cipher_encrypt_inline (MHD_gc_cipher_handle handle, size_t len, char *dat
213} 216}
214 217
215Gc_rc 218Gc_rc
216MHD_gc_cipher_decrypt_inline (MHD_gc_cipher_handle handle, size_t len, char *data) 219MHD_gc_cipher_decrypt_inline (MHD_gc_cipher_handle handle, size_t len,
220 char *data)
217{ 221{
218 if (gcry_cipher_decrypt ((gcry_cipher_hd_t) handle, data, len, NULL, len) != 222 if (gcry_cipher_decrypt ((gcry_cipher_hd_t) handle, data, len, NULL, len) !=
219 0) 223 0)
@@ -240,7 +244,8 @@ typedef struct _MHD_gc_hash_ctx
240} _MHD_gc_hash_ctx; 244} _MHD_gc_hash_ctx;
241 245
242Gc_rc 246Gc_rc
243MHD_gc_hash_open (Gc_hash hash, Gc_hash_mode mode, MHD_gc_hash_handle * outhandle) 247MHD_gc_hash_open (Gc_hash hash, Gc_hash_mode mode,
248 MHD_gc_hash_handle * outhandle)
244{ 249{
245 _MHD_gc_hash_ctx *ctx; 250 _MHD_gc_hash_ctx *ctx;
246 int gcryalg = 0, gcrymode = 0; 251 int gcryalg = 0, gcrymode = 0;
@@ -391,7 +396,8 @@ MHD_gc_hash_digest_length (Gc_hash hash)
391} 396}
392 397
393void 398void
394MHD_gc_hash_MHD_hmac_setkey (MHD_gc_hash_handle handle, size_t len, const char *key) 399MHD_gc_hash_MHD_hmac_setkey (MHD_gc_hash_handle handle, size_t len,
400 const char *key)
395{ 401{
396 _MHD_gc_hash_ctx *ctx = handle; 402 _MHD_gc_hash_ctx *ctx = handle;
397 gcry_md_setkey (ctx->gch, key, len); 403 gcry_md_setkey (ctx->gch, key, len);
@@ -411,7 +417,7 @@ MHD_gc_hash_read (MHD_gc_hash_handle handle)
411 const char *digest; 417 const char *digest;
412 { 418 {
413 gcry_md_final (ctx->gch); 419 gcry_md_final (ctx->gch);
414 digest = (const char*) gcry_md_read (ctx->gch, 0); 420 digest = (const char *) gcry_md_read (ctx->gch, 0);
415 } 421 }
416 422
417 return digest; 423 return digest;
@@ -547,7 +553,7 @@ MHD_gc_sha1 (const void *in, size_t inlen, void *resbuf)
547#ifdef GNULIB_GC_HMAC_MD5 553#ifdef GNULIB_GC_HMAC_MD5
548Gc_rc 554Gc_rc
549MHD_gc_MHD_hmac_md5 (const void *key, size_t keylen, 555MHD_gc_MHD_hmac_md5 (const void *key, size_t keylen,
550 const void *in, size_t inlen, char *resbuf) 556 const void *in, size_t inlen, char *resbuf)
551{ 557{
552 size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_MD5); 558 size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_MD5);
553 gcry_md_hd_t mdh; 559 gcry_md_hd_t mdh;
@@ -587,7 +593,8 @@ MHD_gc_MHD_hmac_md5 (const void *key, size_t keylen,
587#ifdef GNULIB_GC_HMAC_SHA1 593#ifdef GNULIB_GC_HMAC_SHA1
588Gc_rc 594Gc_rc
589MHD_gc_MHD_hmac_sha1 (const void *key, 595MHD_gc_MHD_hmac_sha1 (const void *key,
590 size_t keylen, const void *in, size_t inlen, char *resbuf) 596 size_t keylen, const void *in, size_t inlen,
597 char *resbuf)
591{ 598{
592 size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_SHA1); 599 size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_SHA1);
593 gcry_md_hd_t mdh; 600 gcry_md_hd_t mdh;