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

Function md_pkey_get_rsa_e64

modules/md/md_crypt.c:1013–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011}
1012
1013const char *md_pkey_get_rsa_e64(md_pkey_t *pkey, apr_pool_t *p)
1014{
1015 const char *e64 = NULL;
1016
1017#if OPENSSL_VERSION_NUMBER < 0x30000000L
1018
1019#if OPENSSL_VERSION_NUMBER < 0x10101000L
1020 RSA *rsa = EVP_PKEY_get1_RSA(pkey->pkey);
1021#else
1022 const RSA *rsa = EVP_PKEY_get0_RSA(pkey->pkey);
1023#endif
1024 if (rsa) {
1025 const BIGNUM *e;
1026 RSA_get0_key(rsa, NULL, &e, NULL);
1027 e64 = bn64(e, p);
1028#if OPENSSL_VERSION_NUMBER < 0x10101000L
1029 RSA_free(rsa);
1030#endif
1031 }
1032
1033#else /* OPENSSL_VERSION_NUMBER >= 0x30000000L */
1034 BIGNUM *e = NULL;
1035 if (EVP_PKEY_get_bn_param(pkey->pkey, OSSL_PKEY_PARAM_RSA_E, &e)) {
1036 e64 = bn64(e, p);
1037 BN_free(e);
1038 }
1039#endif
1040
1041 return e64;
1042}
1043
1044const char *md_pkey_get_rsa_n64(md_pkey_t *pkey, apr_pool_t *p)
1045{

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