/external/boringssl/src/crypto/evp/ |
evp.c | 90 static void free_it(EVP_PKEY *pkey) { 91 if (pkey->ameth && pkey->ameth->pkey_free) { 92 pkey->ameth->pkey_free(pkey); 93 pkey->pkey.ptr = NULL; 94 pkey->type = EVP_PKEY_NONE; 98 void EVP_PKEY_free(EVP_PKEY *pkey) { 99 if (pkey == NULL) [all...] |
p_ed25519_asn1.c | 26 static void ed25519_free(EVP_PKEY *pkey) { 27 OPENSSL_free(pkey->pkey.ptr); 28 pkey->pkey.ptr = NULL; 31 static int set_pubkey(EVP_PKEY *pkey, const uint8_t pubkey[32]) { 40 ed25519_free(pkey); 41 pkey->pkey.ptr = key; 45 static int set_privkey(EVP_PKEY *pkey, const uint8_t privkey[64]) [all...] |
p_rsa_asn1.c | 79 !RSA_marshal_public_key(&key_bitstring, key->pkey.rsa) || 112 return BN_cmp(b->pkey.rsa->n, a->pkey.rsa->n) == 0 && 113 BN_cmp(b->pkey.rsa->e, a->pkey.rsa->e) == 0; 125 !RSA_marshal_private_key(&private_key, key->pkey.rsa) || 155 static int rsa_opaque(const EVP_PKEY *pkey) { 156 return RSA_is_opaque(pkey->pkey.rsa); 159 static int int_rsa_size(const EVP_PKEY *pkey) { [all...] |
p_dsa_asn1.c | 105 const DSA *dsa = key->pkey.dsa; 170 const DSA *dsa = key->pkey.dsa; 194 static int int_dsa_size(const EVP_PKEY *pkey) { 195 return DSA_size(pkey->pkey.dsa); 198 static int dsa_bits(const EVP_PKEY *pkey) { 199 return BN_num_bits(pkey->pkey.dsa->p); 202 static int dsa_missing_parameters(const EVP_PKEY *pkey) { 204 dsa = pkey->pkey.dsa [all...] |
p_ec_asn1.c | 69 const EC_KEY *ec_key = key->pkey.ec; 130 const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec); 131 const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec), 132 *pb = EC_KEY_get0_public_key(b->pkey.ec); 165 const EC_KEY *ec_key = key->pkey.ec; 191 static int int_ec_size(const EVP_PKEY *pkey) { 192 return ECDSA_size(pkey->pkey.ec); 195 static int ec_bits(const EVP_PKEY *pkey) { 196 const EC_GROUP *group = EC_KEY_get0_group(pkey->pkey.ec) [all...] |
print.c | 204 static int rsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, 206 return do_rsa_print(bp, pkey->pkey.rsa, indent, 0); 209 static int rsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, 211 return do_rsa_print(bp, pkey->pkey.rsa, indent, 1); 275 static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent, 277 return do_dsa_print(bp, pkey->pkey.dsa, indent, 0); 280 static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent [all...] |
p_ec.c | 120 EC_KEY *ec = ctx->pkey->pkey.ec; 139 return ECDSA_verify(0, tbs, tbslen, sig, siglen, ctx->pkey->pkey.ec); 149 if (!ctx->pkey || !ctx->peerkey) { 154 eckey = ctx->pkey->pkey.ec; 162 pubkey = EC_KEY_get0_public_key(ctx->peerkey->pkey.ec); 208 static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { 209 if (ctx->pkey == NULL) [all...] |
/system/keymaster/km_openssl/ |
ec_key.cpp | 27 bool EcKey::EvpToInternal(const EVP_PKEY* pkey) { 28 ec_key_.reset(EVP_PKEY_get1_EC_KEY(const_cast<EVP_PKEY*>(pkey))); 32 bool EcKey::InternalToEvp(EVP_PKEY* pkey) const { 33 return EVP_PKEY_set1_EC_KEY(pkey, ec_key_.get()) == 1;
|
rsa_key.cpp | 26 bool RsaKey::EvpToInternal(const EVP_PKEY* pkey) { 27 rsa_key_.reset(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(pkey))); 31 bool RsaKey::InternalToEvp(EVP_PKEY* pkey) const { 32 return EVP_PKEY_set1_RSA(pkey, rsa_key_.get()) == 1;
|
openssl_utils.cpp | 79 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) { 88 pkey->reset(EVP_PKCS82PKEY(pkcs8.get())); 89 if (!pkey->get()) 92 if (EVP_PKEY_type((*pkey)->type) != convert_to_evp(expected_algorithm)) { 93 LOG_E("EVP key algorithm was %d, not the expected %d", EVP_PKEY_type((*pkey)->type), 104 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) { 109 expected_algorithm, pkey); 112 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { 113 int key_data_size = i2d_PrivateKey(pkey, NULL /* key_data*/); 121 i2d_PrivateKey(pkey, &tmp) [all...] |
/external/google-tv-pairing-protocol/cpp/tests/polo/util/ |
certificateutiltest.cc | 54 EVP_PKEY* pkey = EVP_PKEY_new(); local 76 EVP_PKEY_assign_RSA(pkey, rsa); 82 X509_set_pubkey(x509, pkey); 92 X509_sign(x509, pkey, EVP_sha256()); 97 EVP_PKEY_free(pkey); 135 EVP_PKEY* pkey = CertificateUtil::PKEYFromPEM(pem, "testing"); local 137 ASSERT_TRUE(pkey); 139 RSA* rsa = EVP_PKEY_get1_RSA(pkey); 142 EVP_PKEY_free(pkey); 147 EVP_PKEY* pkey = EVP_PKEY_new() local 166 EVP_PKEY* pkey = CertificateUtil::GeneratePrivateKey(); local 173 EVP_PKEY* pkey = CertificateUtil::GeneratePrivateKey(); local [all...] |
/external/vboot_reference/firmware/lib21/ |
packed_key.c | 49 const struct vb2_packed_key *pkey = local 56 if (pkey->c.magic != VB2_MAGIC_PACKED_KEY) 64 rv = vb2_verify_common_member(pkey, &min_offset, 65 pkey->key_offset, pkey->key_size); 74 if (pkey->c.struct_version_major != VB2_PACKED_KEY_VERSION_MAJOR) 78 key->hash_alg = pkey->hash_alg; 82 key->sig_alg = pkey->sig_alg; 89 (const uint8_t *)pkey + pkey->key_offset [all...] |
/system/iot/attestation/partner-tools/ |
ec_helper_native.c | 41 EC_KEY* pkey = EC_KEY_new(); local 48 if (!d2i_ECPrivateKey(&pkey, &private_key, private_key_len)) { 52 EC_KEY_set_group(pkey, group); 54 pkey, NULL); 65 EC_KEY_free(pkey); 79 EC_KEY* pkey = NULL; local 86 pkey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); 87 if (!EC_KEY_generate_key(pkey)) { 91 pkey_len = i2d_ECPrivateKey(pkey, NULL); 99 if (!i2d_ECPrivateKey(pkey, &tmp)) [all...] |
/external/boringssl/src/crypto/x509/ |
algorithm.c | 69 EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx); local 70 if (pkey == NULL) { 75 if (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) { 86 if (EVP_PKEY_id(pkey) == EVP_PKEY_ED25519) { 100 EVP_PKEY_id(pkey))) { 108 (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) ? V_ASN1_NULL : V_ASN1_UNDEF; 114 EVP_PKEY *pkey) { 124 if (pkey_nid != EVP_PKEY_id(pkey)) { 132 return x509_rsa_pss_to_ctx(ctx, sigalg, pkey); 139 return EVP_DigestVerifyInit(ctx, NULL, NULL, NULL, pkey); [all...] |
i2d_pr.c | 70 return i2d_RSAPrivateKey(a->pkey.rsa, pp); 72 return i2d_ECPrivateKey(a->pkey.ec, pp); 74 return i2d_DSAPrivateKey(a->pkey.dsa, pp);
|
x_pubkey.c | 78 EVP_PKEY_free(pubkey->pkey); 90 int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) 101 !EVP_marshal_public_key(&cbb, pkey) || 127 /* g_pubkey_lock is used to protect the initialisation of the |pkey| member of 142 if (key->pkey != NULL) { 144 EVP_PKEY_up_ref(key->pkey); 145 return key->pkey; 162 /* Check to see if another thread set key->pkey first */ 164 if (key->pkey) { 167 ret = key->pkey; 224 EVP_PKEY *pkey; local 263 EVP_PKEY *pkey; local 302 EVP_PKEY *pkey; local [all...] |
x509.c | 93 ASN1_TYPE_set(priv->pkey, pmtype, oct); 113 if (p8->pkey->type == V_ASN1_OCTET_STRING) { 116 *pk = p8->pkey->value.octet_string->data; 117 *ppklen = p8->pkey->value.octet_string->length; 119 } else if (p8->pkey->type == V_ASN1_SEQUENCE) { 122 *pk = p8->pkey->value.sequence->data; 123 *ppklen = p8->pkey->value.sequence->length;
|
internal.h | 31 * |NID_rsassaPss|) and key |pkey|. It returns one on success and zero on 33 int x509_rsa_pss_to_ctx(EVP_MD_CTX *ctx, X509_ALGOR *sigalg, EVP_PKEY *pkey); 55 * with public key |pkey| and parameters from |algor|. The |ctx| argument must 59 EVP_PKEY *pkey);
|
/external/linux-kselftest/tools/testing/selftests/x86/ |
protection_keys.c | 8 * * how to handle SEGV_PKRU signals and extract pkey-relevant 17 * look for pkey "leaks" where it is still set on a VMA but "freed" back to the kernel 18 * do a plain mprotect() to a mprotect_pkey() area and make sure the pkey sticks 46 #include "pkey-helpers.h" 309 dprintf1("pkey from siginfo: %jx\n", siginfo_pkey); 427 u32 pkey_get(int pkey, unsigned long flags) 434 dprintf1("%s(pkey=%d, flags=%lx) = %x / %d\n", 435 __func__, pkey, flags, 0, 0); 438 shifted_pkru = (pkru >> (pkey * PKRU_BITS_PER_PKEY)); 449 int pkey_set(int pkey, unsigned long rights, unsigned long flags 1345 int pkey; local [all...] |
/system/extras/verity/ |
generate_verity_key.c | 65 EVP_PKEY *pkey = NULL; local 85 pkey = X509_get_pubkey(cert); 86 if (!pkey) { 91 rsa = EVP_PKEY_get1_RSA(pkey); 111 if (pkey) { 112 EVP_PKEY_free(pkey); 127 EVP_PKEY* pkey = EVP_PKEY_new(); local 129 if (!pkey || !exponent || !rsa) { 136 EVP_PKEY_set1_RSA(pkey, rsa); 144 if (!PEM_write_PrivateKey(f, pkey, NULL, NULL, 0, NULL, NULL)) [all...] |
/system/keymaster/include/keymaster/km_openssl/ |
asymmetric_key.h | 37 virtual bool InternalToEvp(EVP_PKEY* pkey) const = 0; 38 virtual bool EvpToInternal(const EVP_PKEY* pkey) = 0;
|
/external/google-tv-pairing-protocol/cpp/src/polo/util/ |
certificateutil.cc | 57 EVP_PKEY* pkey = PEM_read_bio_PrivateKey(bio, NULL, 0, &passphrase[0]); local 60 return pkey; 63 std::string CertificateUtil::PKEYToPEM(EVP_PKEY* pkey, 66 PEM_write_bio_PrivateKey(bio, pkey, EVP_des_ede3_cbc(), NULL, 0, 0, 80 EVP_PKEY* pkey = EVP_PKEY_new(); local 82 EVP_PKEY_assign_RSA(pkey, rsa); 83 return pkey; 86 X509* CertificateUtil::GenerateSelfSignedCert(EVP_PKEY* pkey, 94 X509_set_pubkey(x509, pkey); 101 X509_sign(x509, pkey, EVP_sha256()) [all...] |
/external/vboot_reference/tests/ |
vb21_host_key_tests.c | 38 struct vb2_packed_private_key *pkey; local 94 pkey = (struct vb2_packed_private_key *)buf; 105 pkey->c.magic = VB2_MAGIC_PACKED_KEY; 112 pkey->c.desc_size++; 118 pkey->key_size += pkey->c.total_size; 124 pkey->c.struct_version_major++; 130 pkey->c.struct_version_minor++; 136 pkey->key_size -= 32; 142 pkey->sig_alg = VB2_SIG_NONE 172 struct vb2_packed_key *pkey; local [all...] |
/external/vboot_reference/host/lib21/ |
host_key.c | 90 const struct vb2_packed_private_key *pkey = local 103 if (pkey->c.magic != VB2_MAGIC_PACKED_PRIVATE_KEY) 110 if (vb2_verify_common_member(pkey, &min_offset, 111 pkey->key_offset, pkey->key_size)) 119 if (pkey->c.struct_version_major != 129 key->sig_alg = pkey->sig_alg; 130 key->hash_alg = pkey->hash_alg; 131 key->guid = pkey->guid; 134 if (pkey->sig_alg == VB2_SIG_NONE) 233 struct vb2_packed_private_key pkey = { local 567 struct vb2_packed_key *pkey; local [all...] |
/external/boringssl/src/ssl/ |
ssl_privkey.cc | 79 static int ssl_set_pkey(CERT *cert, EVP_PKEY *pkey) { 80 if (!ssl_is_key_type_supported(pkey->type)) { 88 !ssl_cert_check_private_key(cert, pkey)) { 93 EVP_PKEY_up_ref(pkey); 94 cert->privatekey = pkey; 142 static int pkey_supports_algorithm(const SSL *ssl, EVP_PKEY *pkey, 146 EVP_PKEY_id(pkey) != alg->pkey_type) { 160 EC_KEY_get0_group(EVP_PKEY_get0_EC_KEY(pkey))) != alg->curve)) { 168 static int setup_ctx(SSL *ssl, EVP_MD_CTX *ctx, EVP_PKEY *pkey, uint16_t sigalg, 170 if (!pkey_supports_algorithm(ssl, pkey, sigalg)) [all...] |