Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/sendmail/src/tls.c
Show First 20 Lines • Show All 739 Lines • ▼ Show 20 Lines | |||||
# if !TLS_NO_RSA | # if !TLS_NO_RSA | ||||
static RSA * | static RSA * | ||||
sm_RSA_generate_key(num, e) | sm_RSA_generate_key(num, e) | ||||
int num; | int num; | ||||
unsigned long e; | unsigned long e; | ||||
{ | { | ||||
RSA *rsa = NULL; | RSA *rsa = NULL; | ||||
BIGNUM *bn_rsa_r4; | BIGNUM *bn_rsa_r4; | ||||
int rc; | |||||
bn_rsa_r4 = BN_new(); | bn_rsa_r4 = BN_new(); | ||||
rc = BN_set_word(bn_rsa_r4, RSA_F4); | if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, e) && (rsa = RSA_new()) != NULL) | ||||
if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, RSA_F4) && (rsa = RSA_new()) != NULL) | |||||
{ | { | ||||
if (!RSA_generate_key_ex(rsa, RSA_KEYLENGTH, bn_rsa_r4, NULL)) | if (!RSA_generate_key_ex(rsa, num, bn_rsa_r4, NULL)) | ||||
{ | { | ||||
RSA_free(rsa); | RSA_free(rsa); | ||||
rsa = NULL; | rsa = NULL; | ||||
} | } | ||||
return NULL; | |||||
} | } | ||||
BN_free(bn_rsa_r4); | BN_free(bn_rsa_r4); | ||||
return rsa; | return rsa; | ||||
} | } | ||||
# endif /* !TLS_NO_RSA */ | # endif /* !TLS_NO_RSA */ | ||||
/* 0.9.8a and b have a problem with SSL_OP_TLS_BLOCK_PADDING_BUG */ | /* 0.9.8a and b have a problem with SSL_OP_TLS_BLOCK_PADDING_BUG */ | ||||
#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) | #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) | ||||
▲ Show 20 Lines • Show All 1,271 Lines • Show Last 20 Lines |