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

Function gen_rsa

modules/md/md_crypt.c:801–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801static apr_status_t gen_rsa(md_pkey_t **ppkey, apr_pool_t *p, unsigned int bits)
802{
803 EVP_PKEY_CTX *ctx = NULL;
804 apr_status_t rv;
805
806 *ppkey = make_pkey(p);
807 ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
808 if (ctx
809 && EVP_PKEY_keygen_init(ctx) >= 0
810 && EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, (int)bits) >= 0
811 && EVP_PKEY_keygen(ctx, &(*ppkey)->pkey) >= 0) {
812 rv = APR_SUCCESS;
813 }
814 else {
815 md_log_perror(MD_LOG_MARK, MD_LOG_WARNING, 0, p, "error generate pkey RSA %d", bits);
816 *ppkey = NULL;
817 rv = APR_EGENERAL;
818 }
819
820 if (ctx != NULL) {
821 EVP_PKEY_CTX_free(ctx);
822 }
823 return rv;
824}
825
826static apr_status_t check_EC_curve(int nid, apr_pool_t *p) {
827 EC_builtin_curve *curves = NULL;

Callers 1

md_pkey_genFunction · 0.85

Calls 2

make_pkeyFunction · 0.85
md_log_perrorFunction · 0.85

Tested by

no test coverage detected