[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 13/171: - add signatures to creds, add converter
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 13/171: - add signatures to creds, add converter |
Date: |
Thu, 04 Jan 2018 16:08:41 +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 113150fb91211dc0cc0901c2373f148b8486d9c9
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Fri Dec 2 14:20:08 2016 +0100
- add signatures to creds, add converter
---
src/credential/plugin_gnsrecord_credential.c | 20 ++++++++++++++++++++
src/include/gnunet_credential_service.h | 22 ++++++++++++++--------
src/include/gnunet_signatures.h | 5 +++++
3 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/src/credential/plugin_gnsrecord_credential.c
b/src/credential/plugin_gnsrecord_credential.c
index 480dc4c62..d321a43a4 100644
--- a/src/credential/plugin_gnsrecord_credential.c
+++ b/src/credential/plugin_gnsrecord_credential.c
@@ -51,6 +51,26 @@ credential_value_to_string (void *cls,
switch (type)
{
+ case GNUNET_GNSRECORD_TYPE_ATTRIBUTE:
+ {
+ struct GNUNET_CREDENTIAL_AttributeRecordData attr;
+ char *attr_str;
+ char *subject_pkey;
+
+ if (data_size < sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData))
+ return NULL; /* malformed */
+ memcpy (&attr,
+ data,
+ sizeof (attr));
+ cdata = data;
+ subject_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string
(&attr.subject_key);
+ GNUNET_asprintf (&attr_str,
+ "%s.%s",
+ subject_pkey,
+ &cdata[sizeof (attr)]);
+ GNUNET_free (subject_pkey);
+ return attr_str;
+ }
case GNUNET_GNSRECORD_TYPE_CREDENTIAL:
{
struct GNUNET_CREDENTIAL_CredentialRecordData cred;
diff --git a/src/include/gnunet_credential_service.h
b/src/include/gnunet_credential_service.h
index 5675cd990..b996b77db 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -79,16 +79,27 @@ GNUNET_NETWORK_STRUCT_BEGIN
struct GNUNET_CREDENTIAL_CredentialRecordData {
/**
- * Public key of the subject this credential was issued to
+ * The signature for this credential by the issuer
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+ struct GNUNET_CRYPTO_EcdsaSignature sig;
+
/**
* Public key of the issuer
*/
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;
+
+ /**
* Flags for this credential
*/
uint32_t credential_flags GNUNET_PACKED;
@@ -98,12 +109,7 @@ struct GNUNET_CREDENTIAL_CredentialRecordData {
*/
uint64_t expiration GNUNET_PACKED;
- /**
- * The signature for this credential by the issuer
- */
- struct GNUNET_CRYPTO_EcdsaSignature sig;
-
- /**
+ /**
* Followed by the attribute string
*/
};
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h
index 1e372bbea..353287cbf 100644
--- a/src/include/gnunet_signatures.h
+++ b/src/include/gnunet_signatures.h
@@ -190,6 +190,11 @@ extern "C"
*/
#define GNUNET_SIGNATURE_PURPOSE_GNUID_TICKET 27
+/**
+ * Signature for a GNUnet credential
+ */
+#define GNUNET_SIGNATURE_PURPOSE_CREDENTIAL 28
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 06/171: Merge remote-tracking branch 'origin/master' into credentials, (continued)
- [GNUnet-SVN] [gnunet] 06/171: Merge remote-tracking branch 'origin/master' into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 09/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 08/171: - Test commit - adding author, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 01/171: add credential, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 11/171: -add todos, gnunet, 2018/01/04
- [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 <=
- [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, 2018/01/04
- [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