aboutsummaryrefslogtreecommitdiff
path: root/pow/POW-0.7/POW.c
diff options
context:
space:
mode:
Diffstat (limited to 'pow/POW-0.7/POW.c')
-rw-r--r--pow/POW-0.7/POW.c30
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);