diff options
author | 2003-05-12 02:18:34 +0000 | |
---|---|---|
committer | 2003-05-12 02:18:34 +0000 | |
commit | 767fe2ff93c41790f9195ca310f4dfd4596a3448 (patch) | |
tree | 1a41fed2bee42d987049c11dfe3193ec916bd858 /lib/libssl/src/crypto/dsa/dsa_lib.c | |
parent | Adaptive timeout value scaling. Allows to reduce timeout values as the (diff) | |
download | wireguard-openbsd-767fe2ff93c41790f9195ca310f4dfd4596a3448.tar.xz wireguard-openbsd-767fe2ff93c41790f9195ca310f4dfd4596a3448.zip |
merge 0.9.7b with local changes; crank majors for libssl/libcrypto
Diffstat (limited to 'lib/libssl/src/crypto/dsa/dsa_lib.c')
-rw-r--r-- | lib/libssl/src/crypto/dsa/dsa_lib.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/dsa/dsa_lib.c b/lib/libssl/src/crypto/dsa/dsa_lib.c index da2cdfa3d64..4171af24c6c 100644 --- a/lib/libssl/src/crypto/dsa/dsa_lib.c +++ b/lib/libssl/src/crypto/dsa/dsa_lib.c @@ -63,7 +63,9 @@ #include <openssl/bn.h> #include <openssl/dsa.h> #include <openssl/asn1.h> +#ifndef OPENSSL_NO_ENGINE #include <openssl/engine.h> +#endif const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT; @@ -93,11 +95,13 @@ int DSA_set_method(DSA *dsa, const DSA_METHOD *meth) const DSA_METHOD *mtmp; mtmp = dsa->meth; if (mtmp->finish) mtmp->finish(dsa); +#ifndef OPENSSL_NO_ENGINE if (dsa->engine) { ENGINE_finish(dsa->engine); dsa->engine = NULL; } +#endif dsa->meth = meth; if (meth->init) meth->init(dsa); return 1; @@ -114,6 +118,7 @@ DSA *DSA_new_method(ENGINE *engine) return(NULL); } ret->meth = DSA_get_default_method(); +#ifndef OPENSSL_NO_ENGINE if (engine) { if (!ENGINE_init(engine)) @@ -138,6 +143,7 @@ DSA *DSA_new_method(ENGINE *engine) return NULL; } } +#endif ret->pad=0; ret->version=0; @@ -158,8 +164,10 @@ DSA *DSA_new_method(ENGINE *engine) CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); if ((ret->meth->init != NULL) && !ret->meth->init(ret)) { +#ifndef OPENSSL_NO_ENGINE if (ret->engine) ENGINE_finish(ret->engine); +#endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); OPENSSL_free(ret); ret=NULL; @@ -189,8 +197,10 @@ void DSA_free(DSA *r) if(r->meth->finish) r->meth->finish(r); +#ifndef OPENSSL_NO_ENGINE if(r->engine) ENGINE_finish(r->engine); +#endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data); @@ -224,7 +234,10 @@ int DSA_size(const DSA *r) { int ret,i; ASN1_INTEGER bs; - unsigned char buf[4]; + unsigned char buf[4]; /* 4 bytes looks really small. + However, i2d_ASN1_INTEGER() will not look + beyond the first byte, as long as the second + parameter is NULL. */ i=BN_num_bits(r->q); bs.length=(i+7)/8; |