-fix
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Tue, 6 Dec 2016 09:13:30 +0000 (10:13 +0100)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Tue, 6 Dec 2016 09:13:30 +0000 (10:13 +0100)
src/credential/gnunet-service-credential.c

index 7f18c77f609e32ee31a821e3ed6e494f8c466689..ec84d18a677d0fb8d1837374f2156d29355e79cb 100644 (file)
@@ -325,7 +325,6 @@ send_lookup_response (void* cls,
   struct GNUNET_MQ_Envelope *env;
   struct VerifyResultMessage *rmsg;
   const struct GNUNET_CREDENTIAL_CredentialRecordData *crd;
-  struct GNUNET_CRYPTO_EccSignaturePurpose *purp;
   struct CredentialRecordEntry *cr_entry;
   uint32_t cred_verified;
 
@@ -359,23 +358,13 @@ send_lookup_response (void* cls,
     GNUNET_CONTAINER_DLL_insert_tail (vrh->cred_chain_head,
                                       vrh->cred_chain_tail,
                                       cr_entry);
-    purp = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
-                          sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
-                          strlen ((char*)&crd[1]) +1 );
-    purp->size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
-                        sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
-                        strlen ((char*)&crd[1]) +1 );
-
-    purp->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CREDENTIAL);
     if(GNUNET_OK == GNUNET_CRYPTO_ecdsa_verify(GNUNET_SIGNATURE_PURPOSE_CREDENTIAL, 
-                                               purp,
+                                               &crd->purpose,
                                                &crd->sig,
                                                &crd->issuer_key))
     {
-      GNUNET_free (purp);
       break;
     }
-    GNUNET_free (purp);
 
   }