Lines Matching full:response
605 struct sk_enroll_response *response) in pack_public_key_ecdsa() argument
613 response->public_key = NULL; in pack_public_key_ecdsa()
614 response->public_key_len = 0; in pack_public_key_ecdsa()
642 response->public_key_len = EC_POINT_point2oct(g, q, in pack_public_key_ecdsa()
644 if (response->public_key_len == 0 || response->public_key_len > 2048) { in pack_public_key_ecdsa()
646 response->public_key_len); in pack_public_key_ecdsa()
649 if ((response->public_key = malloc(response->public_key_len)) == NULL) { in pack_public_key_ecdsa()
654 response->public_key, response->public_key_len, NULL) == 0) { in pack_public_key_ecdsa()
661 if (ret != 0 && response->public_key != NULL) { in pack_public_key_ecdsa()
662 memset(response->public_key, 0, response->public_key_len); in pack_public_key_ecdsa()
663 free(response->public_key); in pack_public_key_ecdsa()
664 response->public_key = NULL; in pack_public_key_ecdsa()
676 struct sk_enroll_response *response) in pack_public_key_ed25519() argument
682 response->public_key = NULL; in pack_public_key_ed25519()
683 response->public_key_len = 0; in pack_public_key_ed25519()
693 response->public_key_len = len; in pack_public_key_ed25519()
694 if ((response->public_key = malloc(response->public_key_len)) == NULL) { in pack_public_key_ed25519()
698 memcpy(response->public_key, ptr, len); in pack_public_key_ed25519()
702 free(response->public_key); in pack_public_key_ed25519()
708 struct sk_enroll_response *response) in pack_public_key() argument
713 return pack_public_key_ecdsa(cred, response); in pack_public_key()
716 return pack_public_key_ed25519(cred, response); in pack_public_key()
841 struct sk_enroll_response *response = NULL; in sk_enroll() local
971 if ((response = calloc(1, sizeof(*response))) == NULL) { in sk_enroll()
972 skdebug(__func__, "calloc response failed"); in sk_enroll()
975 response->flags = flags; in sk_enroll()
976 if (pack_public_key(alg, cred, response) != 0) { in sk_enroll()
982 if ((response->key_handle = calloc(1, len)) == NULL) { in sk_enroll()
986 memcpy(response->key_handle, ptr, len); in sk_enroll()
987 response->key_handle_len = len; in sk_enroll()
991 if ((response->signature = calloc(1, len)) == NULL) { in sk_enroll()
995 memcpy(response->signature, ptr, len); in sk_enroll()
996 response->signature_len = len; in sk_enroll()
1001 if ((response->attestation_cert = calloc(1, len)) == NULL) { in sk_enroll()
1005 memcpy(response->attestation_cert, ptr, len); in sk_enroll()
1006 response->attestation_cert_len = len; in sk_enroll()
1011 if ((response->authdata = calloc(1, len)) == NULL) { in sk_enroll()
1015 memcpy(response->authdata, ptr, len); in sk_enroll()
1016 response->authdata_len = len; in sk_enroll()
1018 *enroll_response = response; in sk_enroll()
1019 response = NULL; in sk_enroll()
1023 if (response != NULL) { in sk_enroll()
1024 free(response->public_key); in sk_enroll()
1025 free(response->key_handle); in sk_enroll()
1026 free(response->signature); in sk_enroll()
1027 free(response->attestation_cert); in sk_enroll()
1028 free(response->authdata); in sk_enroll()
1029 free(response); in sk_enroll()
1038 pack_sig_ecdsa(fido_assert_t *assert, struct sk_sign_response *response) in pack_sig_ecdsa() argument
1053 response->sig_r_len = BN_num_bytes(sig_r); in pack_sig_ecdsa()
1054 response->sig_s_len = BN_num_bytes(sig_s); in pack_sig_ecdsa()
1055 if ((response->sig_r = calloc(1, response->sig_r_len)) == NULL || in pack_sig_ecdsa()
1056 (response->sig_s = calloc(1, response->sig_s_len)) == NULL) { in pack_sig_ecdsa()
1060 BN_bn2bin(sig_r, response->sig_r); in pack_sig_ecdsa()
1061 BN_bn2bin(sig_s, response->sig_s); in pack_sig_ecdsa()
1066 free(response->sig_r); in pack_sig_ecdsa()
1067 free(response->sig_s); in pack_sig_ecdsa()
1068 response->sig_r = NULL; in pack_sig_ecdsa()
1069 response->sig_s = NULL; in pack_sig_ecdsa()
1076 pack_sig_ed25519(fido_assert_t *assert, struct sk_sign_response *response) in pack_sig_ed25519() argument
1088 response->sig_r_len = len; in pack_sig_ed25519()
1089 if ((response->sig_r = calloc(1, response->sig_r_len)) == NULL) { in pack_sig_ed25519()
1093 memcpy(response->sig_r, ptr, len); in pack_sig_ed25519()
1097 free(response->sig_r); in pack_sig_ed25519()
1098 response->sig_r = NULL; in pack_sig_ed25519()
1105 struct sk_sign_response *response) in pack_sig() argument
1110 return pack_sig_ecdsa(assert, response); in pack_sig()
1113 return pack_sig_ed25519(assert, response); in pack_sig()
1156 struct sk_sign_response *response = NULL; in sk_sign() local
1233 if ((response = calloc(1, sizeof(*response))) == NULL) { in sk_sign()
1234 skdebug(__func__, "calloc response failed"); in sk_sign()
1237 response->flags = fido_assert_flags(assert, 0); in sk_sign()
1238 response->counter = fido_assert_sigcount(assert, 0); in sk_sign()
1239 if (pack_sig(alg, assert, response) != 0) { in sk_sign()
1243 *sign_response = response; in sk_sign()
1244 response = NULL; in sk_sign()
1248 if (response != NULL) { in sk_sign()
1249 free(response->sig_r); in sk_sign()
1250 free(response->sig_s); in sk_sign()
1251 free(response); in sk_sign()
1359 /* build response entry */ in read_rks()