• Home
  • Raw
  • Download

Lines Matching refs:get

129     if (derData.get() == NULL) {  in wrap_key()
133 unsigned char* p = derData.get(); in wrap_key()
212 if (pkey.get() == NULL) { in unwrap_key()
216 EVP_PKEY* tmp = pkey.get(); in unwrap_key()
237 if (DSA_generate_parameters_ex(dsa.get(), dsa_params->key_size, NULL, 0, NULL, NULL, in generate_dsa_keypair()
262 if (DSA_generate_key(dsa.get()) != 1) { in generate_dsa_keypair()
267 if (EVP_PKEY_assign_DSA(pkey, dsa.get()) == 0) { in generate_dsa_keypair()
295 if (group.get() == NULL) { in generate_ec_keypair()
301 EC_GROUP_set_point_conversion_form(group.get(), POINT_CONVERSION_UNCOMPRESSED); in generate_ec_keypair()
302 EC_GROUP_set_asn1_flag(group.get(), OPENSSL_EC_NAMED_CURVE); in generate_ec_keypair()
307 if (eckey.get() == NULL) { in generate_ec_keypair()
312 if (EC_KEY_set_group(eckey.get(), group.get()) != 1) { in generate_ec_keypair()
317 if (EC_KEY_generate_key(eckey.get()) != 1 || EC_KEY_check_key(eckey.get()) < 0) { in generate_ec_keypair()
322 if (EVP_PKEY_assign_EC_KEY(pkey, eckey.get()) == 0) { in generate_ec_keypair()
333 if (bn.get() == NULL) { in generate_rsa_keypair()
338 if (BN_set_word(bn.get(), rsa_params->public_exponent) == 0) { in generate_rsa_keypair()
345 if (rsa.get() == NULL) { in generate_rsa_keypair()
350 if (!RSA_generate_key_ex(rsa.get(), rsa_params->modulus_size, bn.get(), NULL) || in generate_rsa_keypair()
351 RSA_check_key(rsa.get()) < 0) { in generate_rsa_keypair()
356 if (EVP_PKEY_assign_RSA(pkey, rsa.get()) == 0) { in generate_rsa_keypair()
369 if (pkey.get() == NULL) { in openssl_generate_keypair()
380 generate_dsa_keypair(pkey.get(), dsa_params); in openssl_generate_keypair()
384 generate_ec_keypair(pkey.get(), ec_params); in openssl_generate_keypair()
388 generate_rsa_keypair(pkey.get(), rsa_params); in openssl_generate_keypair()
394 if (wrap_key(pkey.get(), EVP_PKEY_type(pkey->type), keyBlob, keyBlobLength)) { in openssl_generate_keypair()
415 if (pkcs8.get() == NULL) { in openssl_import_keypair()
421 Unique_EVP_PKEY pkey(EVP_PKCS82PKEY(pkcs8.get())); in openssl_import_keypair()
422 if (pkey.get() == NULL) { in openssl_import_keypair()
427 if (wrap_key(pkey.get(), EVP_PKEY_type(pkey->type), key_blob, key_blob_length)) { in openssl_import_keypair()
445 if (pkey.get() == NULL) { in openssl_get_keypair_public()
449 int len = i2d_PUBKEY(pkey.get(), NULL); in openssl_get_keypair_public()
456 if (key.get() == NULL) { in openssl_get_keypair_public()
461 unsigned char* tmp = reinterpret_cast<unsigned char*>(key.get()); in openssl_get_keypair_public()
462 if (i2d_PUBKEY(pkey.get(), &tmp) != len) { in openssl_get_keypair_public()
482 if (dsa.get() == NULL) { in sign_dsa()
487 unsigned int dsaSize = DSA_size(dsa.get()); in sign_dsa()
489 if (signedDataPtr.get() == NULL) { in sign_dsa()
494 unsigned char* tmp = reinterpret_cast<unsigned char*>(signedDataPtr.get()); in sign_dsa()
495 if (DSA_sign(0, data, dataLength, tmp, &dsaSize, dsa.get()) <= 0) { in sign_dsa()
514 if (eckey.get() == NULL) { in sign_ec()
519 unsigned int ecdsaSize = ECDSA_size(eckey.get()); in sign_ec()
521 if (signedDataPtr.get() == NULL) { in sign_ec()
526 unsigned char* tmp = reinterpret_cast<unsigned char*>(signedDataPtr.get()); in sign_ec()
527 if (ECDSA_sign(0, data, dataLength, tmp, &ecdsaSize, eckey.get()) <= 0) { in sign_ec()
549 if (rsa.get() == NULL) { in sign_rsa()
555 if (signedDataPtr.get() == NULL) { in sign_rsa()
560 unsigned char* tmp = reinterpret_cast<unsigned char*>(signedDataPtr.get()); in sign_rsa()
561 if (RSA_private_encrypt(dataLength, data, tmp, rsa.get(), RSA_NO_PADDING) <= 0) { in sign_rsa()
585 if (pkey.get() == NULL) { in openssl_sign_data()
593 return sign_dsa(pkey.get(), const_cast<keymaster_dsa_sign_params_t*>(sign_params), data, in openssl_sign_data()
598 return sign_ec(pkey.get(), const_cast<keymaster_ec_sign_params_t*>(sign_params), data, in openssl_sign_data()
603 return sign_rsa(pkey.get(), const_cast<keymaster_rsa_sign_params_t*>(sign_params), data, in openssl_sign_data()
620 if (dsa.get() == NULL) { in verify_dsa()
625 if (DSA_verify(0, signedData, signedDataLength, signature, signatureLength, dsa.get()) <= 0) { in verify_dsa()
642 if (eckey.get() == NULL) { in verify_ec()
647 if (ECDSA_verify(0, signedData, signedDataLength, signature, signatureLength, eckey.get()) <= in verify_ec()
671 if (rsa.get() == NULL) { in verify_rsa()
677 if (dataPtr.get() == NULL) { in verify_rsa()
682 unsigned char* tmp = reinterpret_cast<unsigned char*>(dataPtr.get()); in verify_rsa()
683 if (!RSA_public_decrypt(signatureLength, signature, tmp, rsa.get(), RSA_NO_PADDING)) { in verify_rsa()
706 if (pkey.get() == NULL) { in openssl_verify_data()
714 return verify_dsa(pkey.get(), const_cast<keymaster_dsa_sign_params_t*>(sign_params), in openssl_verify_data()
719 return verify_rsa(pkey.get(), const_cast<keymaster_rsa_sign_params_t*>(sign_params), in openssl_verify_data()
724 return verify_ec(pkey.get(), const_cast<keymaster_ec_sign_params_t*>(sign_params), in openssl_verify_data()
747 if (dev.get() == NULL) in openssl_open()