aboutsummaryrefslogtreecommitdiff
path: root/src/abd/delegate_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/abd/delegate_misc.c')
-rw-r--r--src/abd/delegate_misc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/abd/delegate_misc.c b/src/abd/delegate_misc.c
index cc45cde04..446c0b8d2 100644
--- a/src/abd/delegate_misc.c
+++ b/src/abd/delegate_misc.c
@@ -42,10 +42,10 @@ GNUNET_ABD_delegate_to_string (
42 char *issuer_pkey; 42 char *issuer_pkey;
43 char *signature; 43 char *signature;
44 44
45 subject_pkey = GNUNET_IDENTITY_public_key_to_string (&cred->subject_key); 45 subject_pkey = GNUNET_CRYPTO_public_key_to_string (&cred->subject_key);
46 issuer_pkey = GNUNET_IDENTITY_public_key_to_string (&cred->issuer_key); 46 issuer_pkey = GNUNET_CRYPTO_public_key_to_string (&cred->issuer_key);
47 GNUNET_STRINGS_base64_encode ((char *) &cred->signature, 47 GNUNET_STRINGS_base64_encode ((char *) &cred->signature,
48 sizeof (struct GNUNET_IDENTITY_Signature), 48 sizeof (struct GNUNET_CRYPTO_Signature),
49 &signature); 49 &signature);
50 if (0 == cred->subject_attribute_len) 50 if (0 == cred->subject_attribute_len)
51 { 51 {
@@ -80,7 +80,7 @@ struct GNUNET_ABD_Delegate *
80GNUNET_ABD_delegate_from_string (const char *s) 80GNUNET_ABD_delegate_from_string (const char *s)
81{ 81{
82 struct GNUNET_ABD_Delegate *dele; 82 struct GNUNET_ABD_Delegate *dele;
83 size_t enclen = (sizeof (struct GNUNET_IDENTITY_PublicKey)) * 8; 83 size_t enclen = (sizeof (struct GNUNET_CRYPTO_PublicKey)) * 8;
84 if (enclen % 5 > 0) 84 if (enclen % 5 > 0)
85 enclen += 5 - enclen % 5; 85 enclen += 5 - enclen % 5;
86 enclen /= 5; /* 260/5 = 52 */ 86 enclen /= 5; /* 260/5 = 52 */
@@ -91,7 +91,7 @@ GNUNET_ABD_delegate_from_string (const char *s)
91 char sub_attr[253 + 1] = ""; 91 char sub_attr[253 + 1] = "";
92 char signature[256]; // TODO max payload size 92 char signature[256]; // TODO max payload size
93 93
94 struct GNUNET_IDENTITY_Signature *sig; 94 struct GNUNET_CRYPTO_Signature *sig;
95 struct GNUNET_TIME_Absolute etime_abs; 95 struct GNUNET_TIME_Absolute etime_abs;
96 96
97 // If it's A.a <- B.b... 97 // If it's A.a <- B.b...
@@ -144,20 +144,20 @@ GNUNET_ABD_delegate_from_string (const char *s)
144 tmp_str[attr_len - 1] = '\0'; 144 tmp_str[attr_len - 1] = '\0';
145 145
146 if (GNUNET_SYSERR == 146 if (GNUNET_SYSERR ==
147 GNUNET_IDENTITY_public_key_from_string (subject_pkey, 147 GNUNET_CRYPTO_public_key_from_string (subject_pkey,
148 &dele->subject_key)) 148 &dele->subject_key))
149 { 149 {
150 GNUNET_free (dele); 150 GNUNET_free (dele);
151 return NULL; 151 return NULL;
152 } 152 }
153 if (GNUNET_SYSERR == 153 if (GNUNET_SYSERR ==
154 GNUNET_IDENTITY_public_key_from_string (issuer_pkey, 154 GNUNET_CRYPTO_public_key_from_string (issuer_pkey,
155 &dele->issuer_key)) 155 &dele->issuer_key))
156 { 156 {
157 GNUNET_free (dele); 157 GNUNET_free (dele);
158 return NULL; 158 return NULL;
159 } 159 }
160 GNUNET_assert (sizeof (struct GNUNET_IDENTITY_Signature) == 160 GNUNET_assert (sizeof (struct GNUNET_CRYPTO_Signature) ==
161 GNUNET_STRINGS_base64_decode (signature, 161 GNUNET_STRINGS_base64_decode (signature,
162 strlen (signature), 162 strlen (signature),
163 (void **) &sig)); 163 (void **) &sig));
@@ -196,8 +196,8 @@ GNUNET_ABD_delegate_from_string (const char *s)
196 196
197struct GNUNET_ABD_Delegate * 197struct GNUNET_ABD_Delegate *
198GNUNET_ABD_delegate_issue ( 198GNUNET_ABD_delegate_issue (
199 const struct GNUNET_IDENTITY_PrivateKey *issuer, 199 const struct GNUNET_CRYPTO_PrivateKey *issuer,
200 struct GNUNET_IDENTITY_PublicKey *subject, 200 struct GNUNET_CRYPTO_PublicKey *subject,
201 const char *iss_attr, 201 const char *iss_attr,
202 const char *sub_attr, 202 const char *sub_attr,
203 struct GNUNET_TIME_Absolute *expiration) 203 struct GNUNET_TIME_Absolute *expiration)
@@ -232,9 +232,9 @@ GNUNET_ABD_delegate_issue (
232 232
233 del = GNUNET_malloc (size); 233 del = GNUNET_malloc (size);
234 del->purpose.size = 234 del->purpose.size =
235 htonl (size - sizeof (struct GNUNET_IDENTITY_Signature)); 235 htonl (size - sizeof (struct GNUNET_CRYPTO_Signature));
236 del->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE); 236 del->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE);
237 GNUNET_IDENTITY_key_get_public (issuer, &del->issuer_key); 237 GNUNET_CRYPTO_key_get_public (issuer, &del->issuer_key);
238 del->subject_key = *subject; 238 del->subject_key = *subject;
239 del->expiration = GNUNET_htonll (expiration->abs_value_us); 239 del->expiration = GNUNET_htonll (expiration->abs_value_us);
240 del->issuer_attribute_len = htonl (strlen (iss_attr) + 1); 240 del->issuer_attribute_len = htonl (strlen (iss_attr) + 1);
@@ -249,12 +249,12 @@ GNUNET_ABD_delegate_issue (
249 249
250 GNUNET_memcpy (&del[1], tmp_str, attr_len); 250 GNUNET_memcpy (&del[1], tmp_str, attr_len);
251 251
252 GNUNET_IDENTITY_sign_ (issuer, &del->purpose, &del->signature); 252 GNUNET_CRYPTO_sign_ (issuer, &del->purpose, &del->signature);
253 253
254 dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len); 254 dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len);
255 dele->signature = del->signature; 255 dele->signature = del->signature;
256 dele->expiration = *expiration; 256 dele->expiration = *expiration;
257 GNUNET_IDENTITY_key_get_public (issuer, &dele->issuer_key); 257 GNUNET_CRYPTO_key_get_public (issuer, &dele->issuer_key);
258 258
259 dele->subject_key = *subject; 259 dele->subject_key = *subject;
260 260