• Home
  • Raw
  • Download

Lines Matching refs:response

81 pack_key_ecdsa(struct sk_enroll_response *response)  in pack_key_ecdsa()  argument
92 response->public_key = NULL; in pack_key_ecdsa()
93 response->public_key_len = 0; in pack_key_ecdsa()
94 response->key_handle = NULL; in pack_key_ecdsa()
95 response->key_handle_len = 0; in pack_key_ecdsa()
112 response->public_key_len = EC_POINT_point2oct(g, q, in pack_key_ecdsa()
114 if (response->public_key_len == 0 || response->public_key_len > 2048) { in pack_key_ecdsa()
116 response->public_key_len); in pack_key_ecdsa()
119 if ((response->public_key = malloc(response->public_key_len)) == NULL) { in pack_key_ecdsa()
124 response->public_key, response->public_key_len, NULL) == 0) { in pack_key_ecdsa()
137 if ((response->key_handle = malloc(privlen)) == NULL) { in pack_key_ecdsa()
141 response->key_handle_len = (size_t)privlen; in pack_key_ecdsa()
142 memcpy(response->key_handle, privptr, response->key_handle_len); in pack_key_ecdsa()
147 if (response->public_key != NULL) { in pack_key_ecdsa()
148 memset(response->public_key, 0, in pack_key_ecdsa()
149 response->public_key_len); in pack_key_ecdsa()
150 free(response->public_key); in pack_key_ecdsa()
151 response->public_key = NULL; in pack_key_ecdsa()
153 if (response->key_handle != NULL) { in pack_key_ecdsa()
154 memset(response->key_handle, 0, in pack_key_ecdsa()
155 response->key_handle_len); in pack_key_ecdsa()
156 free(response->key_handle); in pack_key_ecdsa()
157 response->key_handle = NULL; in pack_key_ecdsa()
169 pack_key_ed25519(struct sk_enroll_response *response) in pack_key_ed25519() argument
175 response->public_key = NULL; in pack_key_ed25519()
176 response->public_key_len = 0; in pack_key_ed25519()
177 response->key_handle = NULL; in pack_key_ed25519()
178 response->key_handle_len = 0; in pack_key_ed25519()
184 response->public_key_len = sizeof(pk); in pack_key_ed25519()
185 if ((response->public_key = malloc(response->public_key_len)) == NULL) { in pack_key_ed25519()
189 memcpy(response->public_key, pk, sizeof(pk)); in pack_key_ed25519()
191 response->key_handle_len = sizeof(sk); in pack_key_ed25519()
192 if ((response->key_handle = malloc(response->key_handle_len)) == NULL) { in pack_key_ed25519()
196 memcpy(response->key_handle, sk, sizeof(sk)); in pack_key_ed25519()
201 free(response->public_key); in pack_key_ed25519()
228 struct sk_enroll_response *response = NULL; in sk_enroll() local
240 if ((response = calloc(1, sizeof(*response))) == NULL) { in sk_enroll()
246 if (pack_key_ecdsa(response) != 0) in sk_enroll()
250 if (pack_key_ed25519(response) != 0) in sk_enroll()
258 if ((response->signature = calloc(1, 1)) == NULL) { in sk_enroll()
262 response->signature_len = 0; in sk_enroll()
264 *enroll_response = response; in sk_enroll()
265 response = NULL; in sk_enroll()
268 if (response != NULL) { in sk_enroll()
269 free(response->public_key); in sk_enroll()
270 free(response->key_handle); in sk_enroll()
271 free(response->signature); in sk_enroll()
272 free(response->attestation_cert); in sk_enroll()
273 free(response); in sk_enroll()
300 struct sk_sign_response *response) in sig_ecdsa() argument
362 response->sig_r_len = BN_num_bytes(sig_r); in sig_ecdsa()
363 response->sig_s_len = BN_num_bytes(sig_s); in sig_ecdsa()
364 if ((response->sig_r = calloc(1, response->sig_r_len)) == NULL || in sig_ecdsa()
365 (response->sig_s = calloc(1, response->sig_s_len)) == NULL) { in sig_ecdsa()
369 BN_bn2bin(sig_r, response->sig_r); in sig_ecdsa()
370 BN_bn2bin(sig_s, response->sig_s); in sig_ecdsa()
378 free(response->sig_r); in sig_ecdsa()
379 free(response->sig_s); in sig_ecdsa()
380 response->sig_r = NULL; in sig_ecdsa()
381 response->sig_s = NULL; in sig_ecdsa()
396 struct sk_sign_response *response) in sig_ed25519() argument
450 response->sig_r_len = (size_t)(smlen - sizeof(signbuf)); in sig_ed25519()
451 if ((response->sig_r = calloc(1, response->sig_r_len)) == NULL) { in sig_ed25519()
455 memcpy(response->sig_r, sig, response->sig_r_len); in sig_ed25519()
456 dump("sig_r", response->sig_r, response->sig_r_len); in sig_ed25519()
464 free(response->sig_r); in sig_ed25519()
465 response->sig_r = NULL; in sig_ed25519()
476 struct sk_sign_response *response = NULL; in sk_sign() local
488 if ((response = calloc(1, sizeof(*response))) == NULL) { in sk_sign()
495 response->flags = flags; in sk_sign()
496 response->counter = 0x12345678; in sk_sign()
500 response->counter, flags, key_handle, key_handle_len, in sk_sign()
501 response) != 0) in sk_sign()
506 response->counter, flags, key_handle, key_handle_len, in sk_sign()
507 response) != 0) in sk_sign()
514 *sign_response = response; in sk_sign()
515 response = NULL; in sk_sign()
519 if (response != NULL) { in sk_sign()
520 free(response->sig_r); in sk_sign()
521 free(response->sig_s); in sk_sign()
522 free(response); in sk_sign()