diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-28 20:50:33 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-28 20:50:33 +0100 |
commit | d833a55288cc8e5dc8a028b85f1ec4d4803f1e6b (patch) | |
tree | 70a59abbe149ddb61b8a138f7ffbab1720878e49 /src/credential/gnunet-service-credential.c | |
parent | a84624407eedd5418d36de590571da47d2f47015 (diff) | |
download | gnunet-d833a55288cc8e5dc8a028b85f1ec4d4803f1e6b.tar.gz gnunet-d833a55288cc8e5dc8a028b85f1ec4d4803f1e6b.zip |
-update rest
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r-- | src/credential/gnunet-service-credential.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 4841370b3..ec89da323 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -880,19 +880,22 @@ static void | |||
880 | handle_verify (void *cls, | 880 | handle_verify (void *cls, |
881 | const struct VerifyMessage *v_msg) | 881 | const struct VerifyMessage *v_msg) |
882 | { | 882 | { |
883 | char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; | ||
884 | char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; | ||
885 | struct VerifyRequestHandle *vrh; | 883 | struct VerifyRequestHandle *vrh; |
886 | struct GNUNET_SERVICE_Client *client = cls; | 884 | struct GNUNET_SERVICE_Client *client = cls; |
885 | struct CredentialRecordEntry *cr_entry; | ||
886 | uint32_t credentials_count; | ||
887 | uint32_t credential_data_size; | ||
888 | int i; | ||
889 | char attr[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; | ||
890 | char issuer_attribute[GNUNET_CREDENTIAL_MAX_LENGTH + 1]; | ||
887 | char *attrptr = attr; | 891 | char *attrptr = attr; |
892 | char *credential_data; | ||
888 | const char *utf_in; | 893 | const char *utf_in; |
889 | 894 | ||
890 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 895 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
891 | "Received VERIFY message\n"); | 896 | "Received VERIFY message\n"); |
892 | |||
893 | utf_in = (const char *) &v_msg[1]; | 897 | utf_in = (const char *) &v_msg[1]; |
894 | GNUNET_STRINGS_utf8_tolower (utf_in, attrptr); | 898 | GNUNET_STRINGS_utf8_tolower (utf_in, attrptr); |
895 | |||
896 | GNUNET_memcpy (issuer_attribute, attr, ntohs (v_msg->issuer_attribute_len)); | 899 | GNUNET_memcpy (issuer_attribute, attr, ntohs (v_msg->issuer_attribute_len)); |
897 | issuer_attribute[ntohs (v_msg->issuer_attribute_len)] = '\0'; | 900 | issuer_attribute[ntohs (v_msg->issuer_attribute_len)] = '\0'; |
898 | vrh = GNUNET_new (struct VerifyRequestHandle); | 901 | vrh = GNUNET_new (struct VerifyRequestHandle); |
@@ -913,15 +916,13 @@ handle_verify (void *cls, | |||
913 | * First, collect credentials | 916 | * First, collect credentials |
914 | * TODO: cleanup! | 917 | * TODO: cleanup! |
915 | */ | 918 | */ |
916 | uint32_t credentials_count = ntohl(v_msg->c_count); | 919 | credentials_count = ntohl(v_msg->c_count); |
917 | int i; | 920 | credential_data_size = ntohs (v_msg->header.size) |
918 | uint32_t credential_data_size = ntohs (v_msg->header.size) | ||
919 | - sizeof (struct VerifyMessage) | 921 | - sizeof (struct VerifyMessage) |
920 | - ntohs (v_msg->issuer_attribute_len) | 922 | - ntohs (v_msg->issuer_attribute_len) |
921 | - 1; | 923 | - 1; |
922 | struct GNUNET_CREDENTIAL_Credential credentials[credentials_count]; | 924 | struct GNUNET_CREDENTIAL_Credential credentials[credentials_count]; |
923 | char *credential_data = (char*)&v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1; | 925 | credential_data = (char*)&v_msg[1] + ntohs (v_msg->issuer_attribute_len) + 1; |
924 | struct CredentialRecordEntry *cr_entry; | ||
925 | if (GNUNET_OK != GNUNET_CREDENTIAL_credentials_deserialize (credential_data_size, | 926 | if (GNUNET_OK != GNUNET_CREDENTIAL_credentials_deserialize (credential_data_size, |
926 | credential_data, | 927 | credential_data, |
927 | credentials_count, | 928 | credentials_count, |