diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-11-06 22:38:13 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-11-06 22:38:13 +0900 |
commit | a117a9eb8926dd5b566bcf8a5c605939490f851f (patch) | |
tree | a2c967b3c27dfab4501314d13c614ce1ac8da267 /src/reclaim/reclaim_credential.c | |
parent | bc3d776dd38651fae221a06a198d427d28693673 (diff) | |
download | gnunet-a117a9eb8926dd5b566bcf8a5c605939490f851f.tar.gz gnunet-a117a9eb8926dd5b566bcf8a5c605939490f851f.zip |
-more size
Diffstat (limited to 'src/reclaim/reclaim_credential.c')
-rw-r--r-- | src/reclaim/reclaim_credential.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/reclaim/reclaim_credential.c b/src/reclaim/reclaim_credential.c index c7eefc916..1aad261a1 100644 --- a/src/reclaim/reclaim_credential.c +++ b/src/reclaim/reclaim_credential.c | |||
@@ -441,7 +441,7 @@ GNUNET_RECLAIM_credential_serialize ( | |||
441 | atts->credential_flag = htonl (credential->flag); | 441 | atts->credential_flag = htonl (credential->flag); |
442 | atts->credential_id = credential->id; | 442 | atts->credential_id = credential->id; |
443 | name_len = strlen (credential->name); | 443 | name_len = strlen (credential->name); |
444 | atts->name_len = htonl (name_len); | 444 | atts->name_len = htons (name_len); |
445 | write_ptr = (char *) &atts[1]; | 445 | write_ptr = (char *) &atts[1]; |
446 | GNUNET_memcpy (write_ptr, credential->name, name_len); | 446 | GNUNET_memcpy (write_ptr, credential->name, name_len); |
447 | write_ptr += name_len; | 447 | write_ptr += name_len; |
@@ -450,7 +450,7 @@ GNUNET_RECLAIM_credential_serialize ( | |||
450 | // &attr_ser[1]); | 450 | // &attr_ser[1]); |
451 | data_len_ser = credential->data_size; | 451 | data_len_ser = credential->data_size; |
452 | GNUNET_memcpy (write_ptr, credential->data, credential->data_size); | 452 | GNUNET_memcpy (write_ptr, credential->data, credential->data_size); |
453 | atts->data_size = htonl (data_len_ser); | 453 | atts->data_size = htons (data_len_ser); |
454 | 454 | ||
455 | return sizeof(struct Credential) + strlen (credential->name) | 455 | return sizeof(struct Credential) + strlen (credential->name) |
456 | + credential->data_size; | 456 | + credential->data_size; |
@@ -478,8 +478,8 @@ GNUNET_RECLAIM_credential_deserialize (const char *data, size_t data_size) | |||
478 | return NULL; | 478 | return NULL; |
479 | 479 | ||
480 | atts = (struct Credential *) data; | 480 | atts = (struct Credential *) data; |
481 | data_len = ntohl (atts->data_size); | 481 | data_len = ntohs (atts->data_size); |
482 | name_len = ntohl (atts->name_len); | 482 | name_len = ntohs (atts->name_len); |
483 | if (data_size < sizeof(struct Credential) + data_len + name_len) | 483 | if (data_size < sizeof(struct Credential) + data_len + name_len) |
484 | { | 484 | { |
485 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 485 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -860,7 +860,7 @@ GNUNET_RECLAIM_presentation_serialize ( | |||
860 | atts->credential_id = presentation->credential_id; | 860 | atts->credential_id = presentation->credential_id; |
861 | write_ptr = (char *) &atts[1]; | 861 | write_ptr = (char *) &atts[1]; |
862 | GNUNET_memcpy (write_ptr, presentation->data, presentation->data_size); | 862 | GNUNET_memcpy (write_ptr, presentation->data, presentation->data_size); |
863 | atts->data_size = htonl (presentation->data_size); | 863 | atts->data_size = htons (presentation->data_size); |
864 | 864 | ||
865 | return sizeof(struct Presentation) + presentation->data_size; | 865 | return sizeof(struct Presentation) + presentation->data_size; |
866 | } | 866 | } |
@@ -886,7 +886,7 @@ GNUNET_RECLAIM_presentation_deserialize (const char *data, size_t data_size) | |||
886 | return NULL; | 886 | return NULL; |
887 | 887 | ||
888 | atts = (struct Presentation *) data; | 888 | atts = (struct Presentation *) data; |
889 | data_len = ntohl (atts->data_size); | 889 | data_len = ntohs (atts->data_size); |
890 | if (data_size < sizeof(struct Presentation) + data_len) | 890 | if (data_size < sizeof(struct Presentation) + data_len) |
891 | { | 891 | { |
892 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 892 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |