aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_abe.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-24 19:13:00 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-24 19:13:00 +0100
commitd17a17ea785f91c18b5694eab3372c4e4564d95e (patch)
treea7ee983fb1c0fa5a9210938024357cd9498ee344 /src/util/crypto_abe.c
parent5f38569fce2e77afeed58cbd3429c67bf8ab9109 (diff)
downloadgnunet-d17a17ea785f91c18b5694eab3372c4e4564d95e.tar.gz
gnunet-d17a17ea785f91c18b5694eab3372c4e4564d95e.zip
fix pointer indentation
Diffstat (limited to 'src/util/crypto_abe.c')
-rw-r--r--src/util/crypto_abe.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/util/crypto_abe.c b/src/util/crypto_abe.c
index 97ff01680..c089b29db 100644
--- a/src/util/crypto_abe.c
+++ b/src/util/crypto_abe.c
@@ -55,7 +55,7 @@ init_aes (element_t k, int enc,
55 unsigned char*key_buf; 55 unsigned char*key_buf;
56 56
57 key_len = element_length_in_bytes (k) < 33 ? 3 : element_length_in_bytes (k); 57 key_len = element_length_in_bytes (k) < 33 ? 3 : element_length_in_bytes (k);
58 key_buf = (unsigned char*) malloc (key_len); 58 key_buf = (unsigned char *) malloc (key_len);
59 element_to_bytes (key_buf, k); 59 element_to_bytes (key_buf, k);
60 60
61 GNUNET_memcpy (key->aes_key, 61 GNUNET_memcpy (key->aes_key,
@@ -219,15 +219,15 @@ write_cpabe (void **result,
219 219
220 *result = GNUNET_malloc (12 + cph_buf_len + aes_buf_len); 220 *result = GNUNET_malloc (12 + cph_buf_len + aes_buf_len);
221 ptr = *result; 221 ptr = *result;
222 len = (uint32_t*) ptr; 222 len = (uint32_t *) ptr;
223 *len = htonl (file_len); 223 *len = htonl (file_len);
224 ptr += 4; 224 ptr += 4;
225 len = (uint32_t*) ptr; 225 len = (uint32_t *) ptr;
226 *len = htonl (aes_buf_len); 226 *len = htonl (aes_buf_len);
227 ptr += 4; 227 ptr += 4;
228 GNUNET_memcpy (ptr, aes_buf, aes_buf_len); 228 GNUNET_memcpy (ptr, aes_buf, aes_buf_len);
229 ptr += aes_buf_len; 229 ptr += aes_buf_len;
230 len = (uint32_t*) ptr; 230 len = (uint32_t *) ptr;
231 *len = htonl (cph_buf_len); 231 *len = htonl (cph_buf_len);
232 ptr += 4; 232 ptr += 4;
233 GNUNET_memcpy (ptr, cph_buf, cph_buf_len); 233 GNUNET_memcpy (ptr, cph_buf, cph_buf_len);
@@ -246,17 +246,17 @@ read_cpabe (const void *data,
246 char *ptr; 246 char *ptr;
247 uint32_t *len; 247 uint32_t *len;
248 248
249 ptr = (char*) data; 249 ptr = (char *) data;
250 len = (uint32_t*) ptr; 250 len = (uint32_t *) ptr;
251 buf_len = ntohl (*len); 251 buf_len = ntohl (*len);
252 ptr += 4; 252 ptr += 4;
253 len = (uint32_t*) ptr; 253 len = (uint32_t *) ptr;
254 *aes_buf_len = ntohl (*len); 254 *aes_buf_len = ntohl (*len);
255 ptr += 4; 255 ptr += 4;
256 *aes_buf = GNUNET_malloc (*aes_buf_len); 256 *aes_buf = GNUNET_malloc (*aes_buf_len);
257 GNUNET_memcpy (*aes_buf, ptr, *aes_buf_len); 257 GNUNET_memcpy (*aes_buf, ptr, *aes_buf_len);
258 ptr += *aes_buf_len; 258 ptr += *aes_buf_len;
259 len = (uint32_t*) ptr; 259 len = (uint32_t *) ptr;
260 *cph_buf_len = ntohl (*len); 260 *cph_buf_len = ntohl (*len);
261 ptr += 4; 261 ptr += 4;
262 *cph_buf = GNUNET_malloc (*cph_buf_len); 262 *cph_buf = GNUNET_malloc (*cph_buf_len);
@@ -282,7 +282,7 @@ GNUNET_CRYPTO_cpabe_encrypt (const void *block,
282 int aes_buf_len; 282 int aes_buf_len;
283 ssize_t result_len; 283 ssize_t result_len;
284 284
285 if (! (cph = gabe_enc (key->pub, m, (char*) policy))) 285 if (! (cph = gabe_enc (key->pub, m, (char *) policy)))
286 return GNUNET_SYSERR; 286 return GNUNET_SYSERR;
287 cph_buf_len = gabe_cph_serialize (cph, 287 cph_buf_len = gabe_cph_serialize (cph,
288 &cph_buf); 288 &cph_buf);
@@ -329,7 +329,7 @@ GNUNET_CRYPTO_cpabe_decrypt (const void *block,
329 } 329 }
330 gabe_cph_free (cph); 330 gabe_cph_free (cph);
331 GNUNET_free (cph); 331 GNUNET_free (cph);
332 plt_len = aes_128_cbc_decrypt (aes_buf, aes_buf_size, m, (char**) result); 332 plt_len = aes_128_cbc_decrypt (aes_buf, aes_buf_size, m, (char **) result);
333 GNUNET_free (cph_buf); 333 GNUNET_free (cph_buf);
334 GNUNET_free (aes_buf); 334 GNUNET_free (aes_buf);
335 element_clear (m); 335 element_clear (m);