+ case GNUNET_GNSRECORD_TYPE_ATTRIBUTE:
+ {
+ struct GNUNET_CREDENTIAL_AttributeRecordData *attr;
+ char attr_str[253 + 1];
+ char subject_pkey[52 + 1];
+ int matches = 0;
+ matches = SSCANF (s,
+ "%s %s",
+ subject_pkey,
+ attr_str);
+ if (0 == matches)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Unable to parse ATTR record string `%s'\n"),
+ s);
+ return GNUNET_SYSERR;
+
+ }
+ if (1 == matches) {
+ *data_size = sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData);
+ } else if (2 == matches) {
+ *data_size = sizeof (struct GNUNET_CREDENTIAL_AttributeRecordData) + strlen (attr_str) + 1;
+ }
+ *data = attr = GNUNET_malloc (*data_size);
+ GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pkey,
+ strlen (subject_pkey),
+ &attr->subject_key);
+ if (NULL != attr_str)
+ GNUNET_memcpy (&attr[1],
+ attr_str,
+ strlen (attr_str));
+
+
+ return GNUNET_OK;
+ }