[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 27/171: - remove purpose from cred
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 27/171: - remove purpose from cred |
Date: |
Thu, 04 Jan 2018 16:08:55 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 01fcfd11a5e4c170e0b31c60157fb9748c0d3277
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Mon Dec 5 22:09:11 2016 +0100
- remove purpose from cred
---
src/credential/credential_api.c | 21 +++++++++++++++------
src/credential/gnunet-service-credential.c | 21 ++++++++++++++++-----
src/include/gnunet_credential_service.h | 5 -----
3 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c
index b6c585c72..3be2d8bbb 100644
--- a/src/credential/credential_api.c
+++ b/src/credential/credential_api.c
@@ -428,23 +428,32 @@ GNUNET_CREDENTIAL_issue (struct GNUNET_CREDENTIAL_Handle
*handle,
const char *attribute)
{
struct GNUNET_CREDENTIAL_CredentialRecordData *crd;
+ struct GNUNET_CRYPTO_EccSignaturePurpose *purp;
crd = GNUNET_malloc (sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData)
+ strlen (attribute) + 1);
- crd->purpose.size = htonl (strlen (attribute) + 1 +
- sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
- sizeof (struct
GNUNET_CRYPTO_EccSignaturePurpose) +
- sizeof (struct
GNUNET_TIME_AbsoluteNBO));
- crd->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CREDENTIAL);
+ purp = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+ strlen (attribute) + 1);
+ purp->size = htonl (strlen (attribute) + 1 +
+ sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
+ sizeof (struct
GNUNET_CRYPTO_EccSignaturePurpose));
+
+ purp->purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CREDENTIAL);
GNUNET_CRYPTO_ecdsa_key_get_public (issuer,
&crd->issuer_key);
crd->subject_key = *subject;
GNUNET_memcpy (&crd[1],
attribute,
strlen (attribute));
+ GNUNET_memcpy (&purp[1],
+ subject,
+ sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+ GNUNET_memcpy (&purp[1] + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
+ attribute,
+ strlen (attribute));
if (GNUNET_OK !=
GNUNET_CRYPTO_ecdsa_sign (issuer,
- &crd->purpose,
+ purp,
&crd->sig))
{
GNUNET_break (0);
diff --git a/src/credential/gnunet-service-credential.c
b/src/credential/gnunet-service-credential.c
index 117156379..20f6fe4e0 100644
--- a/src/credential/gnunet-service-credential.c
+++ b/src/credential/gnunet-service-credential.c
@@ -262,6 +262,7 @@ 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;
cred_record_count = 0;
@@ -284,16 +285,26 @@ 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,
- &crd->purpose,
- &crd->sig, &crd->issuer_key))
- {
+ purp,
+ &crd->sig,
+ &crd->issuer_key))
+ {
+ GNUNET_free (purp);
break;
}
+ GNUNET_free (purp);
}
-
+
/**
diff --git a/src/include/gnunet_credential_service.h
b/src/include/gnunet_credential_service.h
index 088d0c75e..151587768 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -90,11 +90,6 @@ struct GNUNET_CREDENTIAL_CredentialRecordData {
struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
/**
- * Signature purpose (data to sign, kind of signature)
- */
- struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
-
- /**
* Public key of the subject this credential was issued to
*/
struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 10/171: - fix call, (continued)
- [GNUnet-SVN] [gnunet] 10/171: - fix call, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 15/171: Merge remote-tracking branch 'origin/master' into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 12/171: - change record data name, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 17/171: - added DLL and some checks, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 04/171: - add missing API; no impl, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 13/171: - add signatures to creds, add converter, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 23/171: -add simple test, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 19/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 20/171: -fix compile, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 18/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 27/171: - remove purpose from cred,
gnunet <=
- [GNUnet-SVN] [gnunet] 25/171: -fix verifymessage, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 16/171: -update test, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 21/171: - add verify and issue to cli, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 03/171: - move towards verification, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 14/171: -cleanup cli tool, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 22/171: -add issue test, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 24/171: -add tests, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 29/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 36/171: -fix, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 26/171: - add signature to cred, gnunet, 2018/01/04