diff options
Diffstat (limited to 'src/identity-provider/identity_token.c')
-rw-r--r-- | src/identity-provider/identity_token.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/identity-provider/identity_token.c b/src/identity-provider/identity_token.c index 8f35170fb..dc94145d3 100644 --- a/src/identity-provider/identity_token.c +++ b/src/identity-provider/identity_token.c | |||
@@ -109,7 +109,7 @@ decrypt_str_ecdhe (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key, | |||
109 | return GNUNET_SYSERR; | 109 | return GNUNET_SYSERR; |
110 | } | 110 | } |
111 | *result_str = GNUNET_malloc (str_size+1); | 111 | *result_str = GNUNET_malloc (str_size+1); |
112 | memcpy (*result_str, str_buf, str_size); | 112 | GNUNET_memcpy (*result_str, str_buf, str_size); |
113 | (*result_str)[str_size] = '\0'; | 113 | (*result_str)[str_size] = '\0'; |
114 | GNUNET_free (str_buf); | 114 | GNUNET_free (str_buf); |
115 | return GNUNET_OK; | 115 | return GNUNET_OK; |
@@ -542,7 +542,7 @@ token_to_string (const struct IdentityToken *token, | |||
542 | purpose->size = | 542 | purpose->size = |
543 | htonl (strlen (signature_target) + sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); | 543 | htonl (strlen (signature_target) + sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); |
544 | purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TOKEN); | 544 | purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TOKEN); |
545 | memcpy (&purpose[1], signature_target, strlen (signature_target)); | 545 | GNUNET_memcpy (&purpose[1], signature_target, strlen (signature_target)); |
546 | if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign (priv_key, | 546 | if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_sign (priv_key, |
547 | purpose, | 547 | purpose, |
548 | (struct GNUNET_CRYPTO_EcdsaSignature *)&token->signature)) | 548 | (struct GNUNET_CRYPTO_EcdsaSignature *)&token->signature)) |
@@ -714,11 +714,11 @@ ticket_serialize (struct TokenTicket *ticket, | |||
714 | strlen (code_payload_str)); | 714 | strlen (code_payload_str)); |
715 | purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET); | 715 | purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET); |
716 | write_ptr = (char*) &purpose[1]; | 716 | write_ptr = (char*) &purpose[1]; |
717 | memcpy (write_ptr, | 717 | GNUNET_memcpy (write_ptr, |
718 | &ticket->ecdh_pubkey, | 718 | &ticket->ecdh_pubkey, |
719 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); | 719 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); |
720 | write_ptr += sizeof (struct GNUNET_CRYPTO_EcdhePublicKey); | 720 | write_ptr += sizeof (struct GNUNET_CRYPTO_EcdhePublicKey); |
721 | memcpy (write_ptr, enc_ticket_payload, strlen (code_payload_str)); | 721 | GNUNET_memcpy (write_ptr, enc_ticket_payload, strlen (code_payload_str)); |
722 | GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecdsa_sign (priv_key, | 722 | GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecdsa_sign (priv_key, |
723 | purpose, | 723 | purpose, |
724 | &ticket->signature)); | 724 | &ticket->signature)); |
@@ -932,9 +932,9 @@ ticket_parse (const char *raw_data, | |||
932 | enc_data_len); | 932 | enc_data_len); |
933 | purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET); | 933 | purpose->purpose = htonl(GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET); |
934 | write_ptr = (char*) &purpose[1]; | 934 | write_ptr = (char*) &purpose[1]; |
935 | memcpy (write_ptr, &ticket->ecdh_pubkey, sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); | 935 | GNUNET_memcpy (write_ptr, &ticket->ecdh_pubkey, sizeof (struct GNUNET_CRYPTO_EcdhePublicKey)); |
936 | write_ptr += sizeof (struct GNUNET_CRYPTO_EcdhePublicKey); | 936 | write_ptr += sizeof (struct GNUNET_CRYPTO_EcdhePublicKey); |
937 | memcpy (write_ptr, enc_data, enc_data_len); | 937 | GNUNET_memcpy (write_ptr, enc_data, enc_data_len); |
938 | 938 | ||
939 | if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET, | 939 | if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET, |
940 | purpose, | 940 | purpose, |