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;
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;
*/
uint64_t expiration GNUNET_PACKED;
- /**
- * The signature for this credential by the issuer
- */
- struct GNUNET_CRYPTO_EcdsaSignature sig;
-
- /**
+ /**
* Followed by the attribute string
*/
};
*/
#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