Lines Matching refs:rsa
32 const RSA *rsa = pkey->pkey.rsa; in rsa_param_encode() local
36 if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != RSA_FLAG_TYPE_RSASSAPSS) { in rsa_param_encode()
41 if (rsa->pss == NULL) { in rsa_param_encode()
46 if (ASN1_item_pack(rsa->pss, ASN1_ITEM_rptr(RSA_PSS_PARAMS), pstr) == NULL) in rsa_param_encode()
62 penclen = i2d_RSAPublicKey(pkey->pkey.rsa, &penc); in rsa_pub_encode()
81 RSA *rsa = NULL; in rsa_pub_decode() local
85 if ((rsa = d2i_RSAPublicKey(NULL, &p, pklen)) == NULL) in rsa_pub_decode()
87 if (!ossl_rsa_param_decode(rsa, alg)) { in rsa_pub_decode()
88 RSA_free(rsa); in rsa_pub_decode()
92 RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK); in rsa_pub_decode()
95 RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA); in rsa_pub_decode()
98 RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS); in rsa_pub_decode()
105 if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) { in rsa_pub_decode()
106 RSA_free(rsa); in rsa_pub_decode()
118 if (((RSA_flags(a->pkey.rsa) & RSA_METHOD_FLAG_NO_CHECK)) in rsa_pub_cmp()
119 || (RSA_flags(b->pkey.rsa) & RSA_METHOD_FLAG_NO_CHECK)) { in rsa_pub_cmp()
123 if (BN_cmp(b->pkey.rsa->n, a->pkey.rsa->n) != 0 in rsa_pub_cmp()
124 || BN_cmp(b->pkey.rsa->e, a->pkey.rsa->e) != 0) in rsa_pub_cmp()
132 RSA *rsa; in old_rsa_priv_decode() local
134 if ((rsa = d2i_RSAPrivateKey(NULL, pder, derlen)) == NULL) in old_rsa_priv_decode()
136 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa); in old_rsa_priv_decode()
142 return i2d_RSAPrivateKey(pkey->pkey.rsa, pder); in old_rsa_priv_encode()
154 rklen = i2d_RSAPrivateKey(pkey->pkey.rsa, &rk); in rsa_priv_encode()
176 RSA *rsa = ossl_rsa_key_from_pkcs8(p8, NULL, NULL); in rsa_priv_decode() local
178 if (rsa != NULL) { in rsa_priv_decode()
180 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa); in rsa_priv_decode()
187 return RSA_size(pkey->pkey.rsa); in int_rsa_size()
192 return BN_num_bits(pkey->pkey.rsa->n); in rsa_bits()
197 return RSA_security_bits(pkey->pkey.rsa); in rsa_security_bits()
202 RSA_free(pkey->pkey.rsa); in int_rsa_free()
302 const RSA *x = pkey->pkey.rsa; in pkey_rsa_print()
428 if (pkey->pkey.rsa->pss != NULL) { in rsa_pkey_ctrl()
429 if (!ossl_rsa_pss_get_param(pkey->pkey.rsa->pss, &md, &mgf1md, in rsa_pkey_ctrl()
781 return RSA_check_key_ex(pkey->pkey.rsa, NULL); in rsa_pkey_check()
786 return pkey->pkey.rsa->dirty_cnt; in rsa_pkey_dirty_cnt()
798 RSA *rsa = from->pkey.rsa; in rsa_int_export_to() local
807 if (RSA_get0_n(rsa) == NULL || RSA_get0_e(rsa) == NULL) in rsa_int_export_to()
810 if (!ossl_rsa_todata(rsa, tmpl, NULL, 1)) in rsa_int_export_to()
814 if (RSA_get0_d(rsa) != NULL) in rsa_int_export_to()
817 if (rsa->pss != NULL) { in rsa_int_export_to()
822 if (!ossl_rsa_pss_get_param_unverified(rsa->pss, &md, &mgf1md, in rsa_int_export_to()
854 RSA *rsa = ossl_rsa_new_with_ctx(pctx->libctx); in rsa_int_import_from() local
859 if (rsa == NULL) { in rsa_int_import_from()
864 RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK); in rsa_int_import_from()
865 RSA_set_flags(rsa, rsa_type); in rsa_int_import_from()
893 if ((rsa->pss = ossl_rsa_pss_params_create(md, mgf1md, in rsa_int_import_from()
903 if (!ossl_rsa_fromdata(rsa, params, 1)) in rsa_int_import_from()
908 ok = EVP_PKEY_assign_RSA(pkey, rsa); in rsa_int_import_from()
911 ok = EVP_PKEY_assign(pkey, EVP_PKEY_RSA_PSS, rsa); in rsa_int_import_from()
917 RSA_free(rsa); in rsa_int_import_from()
949 RSA *rsa = from->pkey.rsa; in rsa_pkey_copy() local
953 if (rsa != NULL) { in rsa_pkey_copy()
954 dupkey = ossl_rsa_dup(rsa, OSSL_KEYMGMT_SELECT_ALL); in rsa_pkey_copy()