diff options
| author | beck <> | 2000-04-15 06:18:51 +0000 | 
|---|---|---|
| committer | beck <> | 2000-04-15 06:18:51 +0000 | 
| commit | b608c7f2b175e121f2c22d53341a317153afdc8e (patch) | |
| tree | e94b160b3fcd8180df79e4251d68d24d665f0195 /src/lib/libssl/ssl_cert.c | |
| parent | c8d6701c396cebdcd0d45eac73b762e9498f6b01 (diff) | |
| download | openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.tar.gz openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.tar.bz2 openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.zip | |
OpenSSL 0.9.5a merge
Diffstat (limited to 'src/lib/libssl/ssl_cert.c')
| -rw-r--r-- | src/lib/libssl/ssl_cert.c | 27 | 
1 files changed, 22 insertions, 5 deletions
| diff --git a/src/lib/libssl/ssl_cert.c b/src/lib/libssl/ssl_cert.c index 48f247ceac..0596b7c5b8 100644 --- a/src/lib/libssl/ssl_cert.c +++ b/src/lib/libssl/ssl_cert.c | |||
| @@ -191,16 +191,33 @@ CERT *ssl_cert_dup(CERT *cert) | |||
| 191 | #ifndef NO_DH | 191 | #ifndef NO_DH | 
| 192 | if (cert->dh_tmp != NULL) | 192 | if (cert->dh_tmp != NULL) | 
| 193 | { | 193 | { | 
| 194 | /* DH parameters don't have a reference count (and cannot | 194 | /* DH parameters don't have a reference count */ | 
| 195 | * reasonably be shared anyway, as the secret exponent may | ||
| 196 | * be created just when it is needed -- earlier library | ||
| 197 | * versions did not pay attention to this) */ | ||
| 198 | ret->dh_tmp = DHparams_dup(cert->dh_tmp); | 195 | ret->dh_tmp = DHparams_dup(cert->dh_tmp); | 
| 199 | if (ret->dh_tmp == NULL) | 196 | if (ret->dh_tmp == NULL) | 
| 200 | { | 197 | { | 
| 201 | SSLerr(SSL_F_SSL_CERT_NEW, ERR_R_DH_LIB); | 198 | SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_DH_LIB); | 
| 202 | goto err; | 199 | goto err; | 
| 203 | } | 200 | } | 
| 201 | if (cert->dh_tmp->priv_key) | ||
| 202 | { | ||
| 203 | BIGNUM *b = BN_dup(cert->dh_tmp->priv_key); | ||
| 204 | if (!b) | ||
| 205 | { | ||
| 206 | SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_BN_LIB); | ||
| 207 | goto err; | ||
| 208 | } | ||
| 209 | ret->dh_tmp->priv_key = b; | ||
| 210 | } | ||
| 211 | if (cert->dh_tmp->pub_key) | ||
| 212 | { | ||
| 213 | BIGNUM *b = BN_dup(cert->dh_tmp->pub_key); | ||
| 214 | if (!b) | ||
| 215 | { | ||
| 216 | SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_BN_LIB); | ||
| 217 | goto err; | ||
| 218 | } | ||
| 219 | ret->dh_tmp->pub_key = b; | ||
| 220 | } | ||
| 204 | } | 221 | } | 
| 205 | ret->dh_tmp_cb = cert->dh_tmp_cb; | 222 | ret->dh_tmp_cb = cert->dh_tmp_cb; | 
| 206 | #endif | 223 | #endif | 
