[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 36/171: -fix
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 36/171: -fix |
Date: |
Thu, 04 Jan 2018 16:09:04 +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 14045cba92ab8167e1371f2e2447a5bcdd71f12a
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Tue Dec 6 10:58:37 2016 +0100
-fix
---
src/credential/plugin_gnsrecord_credential.c | 23 ++++++++++++++---------
src/credential/test_credential_issue.sh | 12 ++++++++++--
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/credential/plugin_gnsrecord_credential.c
b/src/credential/plugin_gnsrecord_credential.c
index 60b677a4e..93d8b8e83 100644
--- a/src/credential/plugin_gnsrecord_credential.c
+++ b/src/credential/plugin_gnsrecord_credential.c
@@ -29,6 +29,7 @@
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_credential_service.h"
#include "gnunet_gnsrecord_plugin.h"
+#include "gnunet_signatures.h"
/**
@@ -96,12 +97,12 @@ credential_value_to_string (void *cls,
sizeof (struct
GNUNET_CRYPTO_EcdsaSignature),
&signature);
GNUNET_asprintf (&cred_str,
- "%s.%s -> %s exp:%s sig:%s",
+ "%s.%s -> %s | %s | %s",
issuer_pkey,
&cdata[sizeof (cred)],
subject_pkey,
- expiration,
- signature);
+ signature,
+ expiration);
GNUNET_free (subject_pkey);
GNUNET_free (issuer_pkey);
GNUNET_free (signature);
@@ -153,18 +154,21 @@ credential_string_to_value (void *cls,
struct GNUNET_TIME_Absolute etime_abs;
if (5 != SSCANF (s,
- "%52s.%253s -> %52s exp:%255s sig:%127s",
+ "%52s.%253s -> %52s | %s | %255[0-9a-zA-Z: ]",
issuer_pkey,
name,
subject_pkey,
- expiration,
- signature))
+ signature,
+ expiration))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Unable to parse CRED record string `%s'\n"),
s);
return GNUNET_SYSERR;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Found %s, %s, %s, %s, %s\n",
+ issuer_pkey, name, subject_pkey, signature, expiration);
*data_size = sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData) +
strlen (name) + 1;
*data = cred = GNUNET_malloc (*data_size);
GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pkey,
@@ -179,15 +183,16 @@ credential_string_to_value (void *cls,
strlen (signature),
(char**)&sig);
cred->sig = *sig;
- cred->expiration = htonl (etime_abs.abs_value_us);
+ cred->expiration = GNUNET_htonll (etime_abs.abs_value_us);
+ cred->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_CREDENTIAL);
+ cred->purpose.size = strlen (name) + 1 + sizeof (struct
GNUNET_CRYPTO_EccSignaturePurpose) +
+ sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
sizeof (uint64_t);
GNUNET_free (sig);
GNUNET_memcpy (&cred[1],
name,
strlen (name));
- *data = GNUNET_strdup (s);
- *data_size = strlen (s);
return GNUNET_OK;
}
default:
diff --git a/src/credential/test_credential_issue.sh
b/src/credential/test_credential_issue.sh
index 4d1ba67c7..b2ced204a 100755
--- a/src/credential/test_credential_issue.sh
+++ b/src/credential/test_credential_issue.sh
@@ -29,8 +29,16 @@ gnunet-identity -C testsubject -c test_credential_lookup.conf
SUBJECT_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep
testsubject | awk '{print $3}')
ISSUER_KEY=$(gnunet-identity -d -c test_credential_lookup.conf | grep
testissuer | awk '{print $3}')
#TODO1 Get credential and store it with subject (3)
-$DO_TIMEOUT valgrind gnunet-credential --issue --ego=testissuer
--subject=$SUBJECT_KEY --attribute=$TEST_ATTR --ttl=5m -c
test_credential_lookup.conf
+CRED=`$DO_TIMEOUT gnunet-credential --issue --ego=testissuer
--subject=$SUBJECT_KEY --attribute=$TEST_ATTR --ttl=5m -c
test_credential_lookup.conf`
STATUS=$?
+if test $? != 0
+then
+ echo "Error issuing..."
+ exit 1
+fi
+#Try import
+$DO_TIMEOUT gnunet-namestore -a -z testsubject -n c1 -t CRED -V "$CRED" -e 5m
-c test_credential_lookup.conf
+
gnunet-arm -e -c test_credential_lookup.conf
-exit $STATUS
+exit $?
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 18/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, (continued)
- [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
- [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 <=
- [GNUnet-SVN] [gnunet] 26/171: - add signature to cred, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 28/171: - starting backward resolution, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 31/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 41/171: - fix test, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 34/171: - minor fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 33/171: -fix, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 32/171: -add expiration to cred, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 42/171: -add confs, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 35/171: Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 38/171: - add signature check, gnunet, 2018/01/04