MCPcopy Create free account
hub / github.com/apache/httpd / md_pkey_get_rsa_n64

Function md_pkey_get_rsa_n64

modules/md/md_crypt.c:1044–1073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1042}
1043
1044const char *md_pkey_get_rsa_n64(md_pkey_t *pkey, apr_pool_t *p)
1045{
1046 const char *n64 = NULL;
1047
1048#if OPENSSL_VERSION_NUMBER < 0x30000000L
1049
1050#if OPENSSL_VERSION_NUMBER < 0x10101000L
1051 RSA *rsa = EVP_PKEY_get1_RSA(pkey->pkey);
1052#else
1053 const RSA *rsa = EVP_PKEY_get0_RSA(pkey->pkey);
1054#endif
1055 if (rsa) {
1056 const BIGNUM *n;
1057 RSA_get0_key(rsa, &n, NULL, NULL);
1058 n64 = bn64(n, p);
1059#if OPENSSL_VERSION_NUMBER < 0x10101000L
1060 RSA_free(rsa);
1061#endif
1062 }
1063
1064#else /* OPENSSL_VERSION_NUMBER >= 0x30000000L */
1065 BIGNUM *n = NULL;
1066 if (EVP_PKEY_get_bn_param(pkey->pkey, OSSL_PKEY_PARAM_RSA_N, &n)) {
1067 n64 = bn64(n, p);
1068 BN_free(n);
1069 }
1070#endif
1071
1072 return n64;
1073}
1074
1075apr_status_t md_crypt_sign64(const char **psign64, md_pkey_t *pkey, apr_pool_t *p,
1076 const char *d, size_t dlen)

Callers 2

md_jws_get_jwkFunction · 0.85
md_jws_pkey_thumbFunction · 0.85

Calls 2

RSA_get0_keyFunction · 0.85
bn64Function · 0.85

Tested by

no test coverage detected