Home | History | Annotate | Download | only in evp

Lines Matching refs:rsa

65 #include <openssl/rsa.h>
68 #include "../rsa/internal.h"
75 if (!RSA_public_key_to_bytes(&encoded, &encoded_len, pkey->pkey.rsa)) {
103 RSA *rsa = RSA_parse_public_key_buggy(&cbs);
104 if (rsa == NULL || CBS_len(&cbs) != 0) {
106 RSA_free(rsa);
110 EVP_PKEY_assign_RSA(pkey, rsa);
115 return BN_cmp(b->pkey.rsa->n, a->pkey.rsa->n) == 0 &&
116 BN_cmp(b->pkey.rsa->e, a->pkey.rsa->e) == 0;
122 if (!RSA_private_key_to_bytes(&encoded, &encoded_len, pkey->pkey.rsa)) {
145 RSA *rsa = RSA_private_key_from_bytes(p, pklen);
146 if (rsa == NULL) {
151 EVP_PKEY_assign_RSA(pkey, rsa);
156 return RSA_is_opaque(pkey->pkey.rsa);
160 return RSA_supports_digest(pkey->pkey.rsa, md);
164 return RSA_size(pkey->pkey.rsa);
168 return BN_num_bits(pkey->pkey.rsa->n);
171 static void int_rsa_free(EVP_PKEY *pkey) { RSA_free(pkey->pkey.rsa); }
186 static int do_rsa_print(BIO *out, const RSA *rsa, int off,
194 update_buflen(rsa->n, &buf_len);
195 update_buflen(rsa->e, &buf_len);
198 update_buflen(rsa->d, &buf_len);
199 update_buflen(rsa->p, &buf_len);
200 update_buflen(rsa->q, &buf_len);
201 update_buflen(rsa->dmp1, &buf_len);
202 update_buflen(rsa->dmq1, &buf_len);
203 update_buflen(rsa->iqmp, &buf_len);
205 if (rsa->additional_primes != NULL) {
208 for (i = 0; i < sk_RSA_additional_prime_num(rsa->additional_primes);
211 sk_RSA_additional_prime_value(rsa->additional_primes, i);
225 if (rsa->n != NULL) {
226 mod_len = BN_num_bits(rsa->n);
233 if (include_private && rsa->d) {
246 if (!ASN1_bn_print(out, str, rsa->n, m, off) ||
247 !ASN1_bn_print(out, s, rsa->e, m, off)) {
252 if (!ASN1_bn_print(out, "privateExponent:", rsa->d, m, off) ||
253 !ASN1_bn_print(out, "prime1:", rsa->p, m, off) ||
254 !ASN1_bn_print(out, "prime2:", rsa->q, m, off) ||
255 !ASN1_bn_print(out, "exponent1:", rsa->dmp1, m, off) ||
256 !ASN1_bn_print(out, "exponent2:", rsa->dmq1, m, off) ||
257 !ASN1_bn_print(out, "coefficient:", rsa->iqmp, m, off)) {
261 if (rsa->additional_primes != NULL &&
262 sk_RSA_additional_prime_num(rsa->additional_primes) > 0) {
268 for (i = 0; i < sk_RSA_additional_prime_num(rsa->additional_primes);
271 sk_RSA_additional_prime_value(rsa->additional_primes, i);
292 return do_rsa_print(bp, pkey->pkey.rsa, indent, 0);
298 return do_rsa_print(bp, pkey->pkey.rsa, indent, 1);
450 RSA *rsa = d2i_RSAPrivateKey(NULL, pder, derlen);
451 if (rsa == NULL) {
455 EVP_PKEY_assign_RSA(pkey, rsa);
460 return i2d_RSAPrivateKey(pkey->pkey.rsa, pder);
641 * RSA routines will trap other invalid values anyway. */
672 /* Customised RSA AlgorithmIdentifier handling. This is called when a signature
710 "RSA",