diff options
author | Rob Austein <sra@hactrn.net> | 2009-11-18 06:28:01 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-11-18 06:28:01 +0000 |
commit | 1fcd03f22bd481b4fffec2e8ad8efa3bb31051a5 (patch) | |
tree | 2a963e7769a97b2b3d98f63d9a65f3140f1f5581 /pow | |
parent | fe329373adc4fe0a8045dd6d32eaf90a68fd7260 (diff) |
Update to new OpenSSL snapshot, to track TLS negotiation protocol
bugfixes. While we're at this, switch to 1.0.0-stable snapshot
series, with goal of eventually converging on OpenSSL 1.0.0.
This included a few changes to track OpenSSL:
- The "STRING" type used in the OpenSSL stack macros became
"OPENSSL_STRING".
- OpenSSL has deprecated the MD2 digest algorithm, so POW code can't
refer to it unconditionally (perhaps I should remove support for it
from POW entirely, but for now I just honor the compile-time
conditional).
- OpenSSL's configuration script was whining that I should run "make
depend", so I do that now as part of the OpenSSL library build.
svn path=/openssl/Makefile; revision=2883
Diffstat (limited to 'pow')
-rw-r--r-- | pow/POW-0.7/POW.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pow/POW-0.7/POW.c b/pow/POW-0.7/POW.c index a4be59f3..e4e8cc2e 100644 --- a/pow/POW-0.7/POW.c +++ b/pow/POW-0.7/POW.c @@ -47,7 +47,9 @@ #include <openssl/evp.h> #include <openssl/err.h> #include <openssl/md5.h> +#ifndef OPENSSL_NO_MD2 #include <openssl/md2.h> +#endif #include <openssl/sha.h> #include <openssl/hmac.h> #include <openssl/ripemd.h> @@ -128,7 +130,9 @@ //#define NO_DH // Digests +#ifndef OPENSSL_NO_MD2 #define MD2_DIGEST 1 +#endif #define MD5_DIGEST 2 #define SHA_DIGEST 3 #define SHA1_DIGEST 4 @@ -1032,7 +1036,9 @@ static char X509_object_sign__doc__[] = " signed, it should be one of the following:\n" " </para>\n" " <simplelist>\n" +#ifndef OPENSSL_NO_MD2 " <member><constant>MD2_DIGEST</constant></member>\n" +#endif " <member><constant>MD5_DIGEST</constant></member>\n" " <member><constant>SHA_DIGEST</constant></member>\n" " <member><constant>SHA1_DIGEST</constant></member>\n" @@ -1071,10 +1077,12 @@ X509_object_sign(x509_object *self, PyObject *args) lose("could not sign certificate"); break; +#ifndef OPENSSL_NO_MD2 case MD2_DIGEST: if (!X509_sign(self->x509, pkey, EVP_md2())) lose("could not sign certificate"); break; +#endif case SHA_DIGEST: if (!X509_sign(self->x509, pkey, EVP_sha())) @@ -3112,7 +3120,9 @@ static char x509_crl_object_sign__doc__[] = " signed, it should be one of the following:\n" " </para>\n" " <simplelist>\n" +#ifndef OPENSSL_NO_MD2 " <member><constant>MD2_DIGEST</constant></member>\n" +#endif " <member><constant>MD5_DIGEST</constant></member>\n" " <member><constant>SHA_DIGEST</constant></member>\n" " <member><constant>SHA1_DIGEST</constant></member>\n" @@ -3150,10 +3160,12 @@ x509_crl_object_sign(x509_crl_object *self, PyObject *args) lose("could not sign CRL"); break; +#ifndef OPENSSL_NO_MD2 case MD2_DIGEST: if (!X509_CRL_sign(self->crl, pkey, EVP_md2())) lose("could not sign CRL"); break; +#endif case SHA_DIGEST: if (!X509_CRL_sign(self->crl, pkey, EVP_sha())) @@ -5511,7 +5523,9 @@ static char asymmetric_object_sign__doc__[] = " following:\n" " </para>\n" " <simplelist>\n" +#ifndef OPENSSL_NO_MD2 " <member><constant>MD2_DIGEST</constant></member>\n" +#endif " <member><constant>MD5_DIGEST</constant></member>\n" " <member><constant>SHA_DIGEST</constant></member>\n" " <member><constant>SHA1_DIGEST</constant></member>\n" @@ -5545,10 +5559,12 @@ asymmetric_object_sign(asymmetric_object *self, PyObject *args) lose("could not allocate memory"); switch(digest_type) { +#ifndef OPENSSL_NO_MD2 case MD2_DIGEST: digest_nid = NID_md2; digest_len = MD2_DIGEST_LENGTH; break; +#endif case MD5_DIGEST: digest_nid = NID_md5; digest_len = MD5_DIGEST_LENGTH; @@ -5646,7 +5662,9 @@ static char asymmetric_object_verify__doc__[] = " following:\n" " </para>\n" " <simplelist>\n" +#ifndef OPENSSL_NO_MD2 " <member><constant>MD2_DIGEST</constant></member>\n" +#endif " <member><constant>MD5_DIGEST</constant></member>\n" " <member><constant>SHA_DIGEST</constant></member>\n" " <member><constant>SHA1_DIGEST</constant></member>\n" @@ -5673,10 +5691,12 @@ asymmetric_object_verify(asymmetric_object *self, PyObject *args) goto error; switch (digest_type) { +#ifndef OPENSSL_NO_MD2 case MD2_DIGEST: digest_len = MD2_DIGEST_LENGTH; digest_nid = NID_md2; break; +#endif case MD5_DIGEST: digest_len = MD5_DIGEST_LENGTH; digest_nid = NID_md5; @@ -6090,10 +6110,12 @@ digest_object_new(int digest_type) goto error; switch(digest_type) { +#ifndef OPENSSL_NO_MD2 case MD2_DIGEST: self->digest_type = MD2_DIGEST; EVP_DigestInit(&self->digest_ctx, EVP_md2()); break; +#endif case MD5_DIGEST: self->digest_type = MD5_DIGEST; EVP_DigestInit(&self->digest_ctx, EVP_md5()); @@ -6334,9 +6356,11 @@ hmac_object_new(int digest_type, char *key, int key_len) goto error; switch (digest_type) { +#ifndef OPENSSL_NO_MD2 case MD2_DIGEST: md = EVP_md2(); break; +#endif case MD5_DIGEST: md = EVP_md5(); break; @@ -7379,7 +7403,9 @@ static char pow_module_new_digest__doc__[] = " of digest to create and should be one of the following:\n" " </para>\n" " <simplelist>\n" +#ifndef OPENSSL_NO_MD2 " <member><constant>MD2_DIGEST</constant></member>\n" +#endif " <member><constant>MD5_DIGEST</constant></member>\n" " <member><constant>SHA_DIGEST</constant></member>\n" " <member><constant>SHA1_DIGEST</constant></member>\n" @@ -7421,7 +7447,9 @@ static char pow_module_new_hmac__doc__[] = " string and <parameter>type</parameter> should be one of the following:\n" " </para>\n" " <simplelist>\n" +#ifndef OPENSSL_NO_MD2 " <member><constant>MD2_DIGEST</constant></member>\n" +#endif " <member><constant>MD5_DIGEST</constant></member>\n" " <member><constant>SHA_DIGEST</constant></member>\n" " <member><constant>SHA1_DIGEST</constant></member>\n" @@ -8407,7 +8435,9 @@ init_POW(void) #endif // message digests +#ifndef OPENSSL_NO_MD2 Define_Integer_Constant(MD2_DIGEST); +#endif Define_Integer_Constant(MD5_DIGEST); Define_Integer_Constant(SHA_DIGEST); Define_Integer_Constant(SHA1_DIGEST); |