diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-02 17:29:08 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-02 17:29:08 +0100 |
commit | 646723dd495657a184d1f7e439f4958a72bee1df (patch) | |
tree | 77df41a043da4fd8cf1ad5449d11362c427df619 /src/credential/plugin_gnsrecord_credential.c | |
parent | 59f9630b8be3dcde087a4ef6956217704d0dacb4 (diff) | |
download | gnunet-646723dd495657a184d1f7e439f4958a72bee1df.tar.gz gnunet-646723dd495657a184d1f7e439f4958a72bee1df.zip |
- add verify and issue to cli
Diffstat (limited to 'src/credential/plugin_gnsrecord_credential.c')
-rw-r--r-- | src/credential/plugin_gnsrecord_credential.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/credential/plugin_gnsrecord_credential.c b/src/credential/plugin_gnsrecord_credential.c index d321a43a4..c7cbb8bdd 100644 --- a/src/credential/plugin_gnsrecord_credential.c +++ b/src/credential/plugin_gnsrecord_credential.c | |||
@@ -77,7 +77,6 @@ credential_value_to_string (void *cls, | |||
77 | char *cred_str; | 77 | char *cred_str; |
78 | char *subject_pkey; | 78 | char *subject_pkey; |
79 | char *issuer_pkey; | 79 | char *issuer_pkey; |
80 | uint32_t cf; // Credential flags | ||
81 | if (data_size < sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData)) | 80 | if (data_size < sizeof (struct GNUNET_CREDENTIAL_CredentialRecordData)) |
82 | return NULL; /* malformed */ | 81 | return NULL; /* malformed */ |
83 | memcpy (&cred, | 82 | memcpy (&cred, |
@@ -86,13 +85,11 @@ credential_value_to_string (void *cls, | |||
86 | cdata = data; | 85 | cdata = data; |
87 | subject_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.subject_key); | 86 | subject_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.subject_key); |
88 | issuer_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.issuer_key); | 87 | issuer_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred.issuer_key); |
89 | cf = ntohl (cred.credential_flags); | ||
90 | 88 | ||
91 | GNUNET_asprintf (&cred_str, | 89 | GNUNET_asprintf (&cred_str, |
92 | "%s %s %u %s", | 90 | "%s %s %s", |
93 | subject_pkey, | 91 | subject_pkey, |
94 | issuer_pkey, | 92 | issuer_pkey, |
95 | (unsigned int) cf, | ||
96 | &cdata[sizeof (cred)]); | 93 | &cdata[sizeof (cred)]); |
97 | GNUNET_free (subject_pkey); | 94 | GNUNET_free (subject_pkey); |
98 | GNUNET_free (issuer_pkey); | 95 | GNUNET_free (issuer_pkey); |
@@ -132,7 +129,6 @@ credential_string_to_value (void *cls, | |||
132 | case GNUNET_GNSRECORD_TYPE_CREDENTIAL: | 129 | case GNUNET_GNSRECORD_TYPE_CREDENTIAL: |
133 | { | 130 | { |
134 | struct GNUNET_CREDENTIAL_CredentialRecordData *cred; | 131 | struct GNUNET_CREDENTIAL_CredentialRecordData *cred; |
135 | unsigned int cf; // credential flags | ||
136 | 132 | ||
137 | size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8; | 133 | size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8; |
138 | if (enclen % 5 > 0) | 134 | if (enclen % 5 > 0) |
@@ -143,10 +139,9 @@ credential_string_to_value (void *cls, | |||
143 | char name[253 + 1]; | 139 | char name[253 + 1]; |
144 | 140 | ||
145 | if (5 != SSCANF (s, | 141 | if (5 != SSCANF (s, |
146 | "%52s %52s %u %253s", | 142 | "%52s %52s %253s", |
147 | subject_pkey, | 143 | subject_pkey, |
148 | issuer_pkey, | 144 | issuer_pkey, |
149 | &cf, | ||
150 | name)) | 145 | name)) |
151 | { | 146 | { |
152 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 147 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -162,7 +157,6 @@ credential_string_to_value (void *cls, | |||
162 | GNUNET_CRYPTO_ecdsa_public_key_from_string (issuer_pkey, | 157 | GNUNET_CRYPTO_ecdsa_public_key_from_string (issuer_pkey, |
163 | strlen (issuer_pkey), | 158 | strlen (issuer_pkey), |
164 | &cred->issuer_key); | 159 | &cred->issuer_key); |
165 | cred->credential_flags = htonl (cf); | ||
166 | GNUNET_memcpy (&cred[1], | 160 | GNUNET_memcpy (&cred[1], |
167 | name, | 161 | name, |
168 | strlen (name)); | 162 | strlen (name)); |