summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in4
-rw-r--r--src/openssl/hmac.c5
-rw-r--r--src/openssl/signatures.c29
3 files changed, 36 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 929f729b..db416d0c 100644
--- a/configure.in
+++ b/configure.in
@@ -150,8 +150,8 @@ XMLSEC_CRYPTO_LDADDS=""
dnl ==========================================================================
dnl OpenSSL
dnl ==========================================================================
-ac_openssl_lib_dir="/usr/lib /usr/local/lib /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg"
-ac_openssl_inc_dir="/usr/include /usr/local/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include"
+ac_openssl_lib_dir="/usr/local/lib /usr/lib /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg"
+ac_openssl_inc_dir="/usr/local/include /usr/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include"
XMLSEC_OPENSSL_DEFINES=""
OPENSSL_WITHOUT="yes"
diff --git a/src/openssl/hmac.c b/src/openssl/hmac.c
index 87f5b55b..bf8b300a 100644
--- a/src/openssl/hmac.c
+++ b/src/openssl/hmac.c
@@ -103,7 +103,10 @@ xmlSecOpenSSLHmacInitialize(xmlSecTransformPtr transform) {
XMLSEC_ERRORS_NO_MESSAGE);
return(-1);
}
+
+#ifndef XMLSEC_OPENSSL_096
HMAC_CTX_init(&(ctx->hmacCtx));
+#endif /* XMLSEC_OPENSSL_096 */
return(0);
}
@@ -117,7 +120,9 @@ xmlSecOpenSSLHmacFinalize(xmlSecTransformPtr transform) {
ctx = xmlSecOpenSSLHmacGetCtx(transform);
xmlSecAssert(ctx != NULL);
+#ifndef XMLSEC_OPENSSL_096
HMAC_CTX_cleanup(&(ctx->hmacCtx));
+#endif /* XMLSEC_OPENSSL_096 */
memset(ctx, 0, sizeof(xmlSecOpenSSLHmacCtx));
}
diff --git a/src/openssl/signatures.c b/src/openssl/signatures.c
index efc107f9..67a23649 100644
--- a/src/openssl/signatures.c
+++ b/src/openssl/signatures.c
@@ -119,7 +119,9 @@ xmlSecOpenSSLEvpSignatureInitialize(xmlSecTransformPtr transform) {
return(-1);
}
+#ifndef XMLSEC_OPENSSL_096
EVP_MD_CTX_init(&(ctx->digestCtx));
+#endif /* XMLSEC_OPENSSL_096 */
return(0);
}
@@ -136,7 +138,10 @@ xmlSecOpenSSLEvpSignatureFinalize(xmlSecTransformPtr transform) {
if(ctx->pKey != NULL) {
EVP_PKEY_free(ctx->pKey);
}
+
+#ifndef XMLSEC_OPENSSL_096
EVP_MD_CTX_cleanup(&(ctx->digestCtx));
+#endif /* XMLSEC_OPENSSL_096 */
memset(ctx, 0, sizeof(xmlSecOpenSSLEvpSignatureCtx));
}
@@ -274,6 +279,7 @@ xmlSecOpenSSLEvpSignatureExecute(xmlSecTransformPtr transform, int last, xmlSecT
if(transform->status == xmlSecTransformStatusNone) {
if(transform->encode) {
+#ifndef XMLSEC_OPENSSL_096
ret = EVP_SignInit(&(ctx->digestCtx), ctx->digest);
if(ret != 1) {
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -283,7 +289,11 @@ xmlSecOpenSSLEvpSignatureExecute(xmlSecTransformPtr transform, int last, xmlSecT
XMLSEC_ERRORS_NO_MESSAGE);
return(-1);
}
+#else /* XMLSEC_OPENSSL_096 */
+ EVP_SignInit(&(ctx->digestCtx), ctx->digest);
+#endif /* XMLSEC_OPENSSL_096 */
} else {
+#ifndef XMLSEC_OPENSSL_096
ret = EVP_VerifyInit(&(ctx->digestCtx), ctx->digest);
if(ret != 1) {
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -293,12 +303,16 @@ xmlSecOpenSSLEvpSignatureExecute(xmlSecTransformPtr transform, int last, xmlSecT
XMLSEC_ERRORS_NO_MESSAGE);
return(-1);
}
+#else /* XMLSEC_OPENSSL_096 */
+ EVP_VerifyInit(&(ctx->digestCtx), ctx->digest);
+#endif /* XMLSEC_OPENSSL_096 */
}
transform->status = xmlSecTransformStatusWorking;
}
if((transform->status == xmlSecTransformStatusWorking) && (inSize > 0)) {
if(transform->encode) {
+#ifndef XMLSEC_OPENSSL_096
ret = EVP_SignUpdate(&(ctx->digestCtx), xmlSecBufferGetData(in), inSize);
if(ret != 1) {
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -308,7 +322,11 @@ xmlSecOpenSSLEvpSignatureExecute(xmlSecTransformPtr transform, int last, xmlSecT
XMLSEC_ERRORS_NO_MESSAGE);
return(-1);
}
+#else /* XMLSEC_OPENSSL_096 */
+ EVP_SignUpdate(&(ctx->digestCtx), xmlSecBufferGetData(in), inSize);
+#endif /* XMLSEC_OPENSSL_096 */
} else {
+#ifndef XMLSEC_OPENSSL_096
ret = EVP_VerifyUpdate(&(ctx->digestCtx), xmlSecBufferGetData(in), inSize);
if(ret != 1) {
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -318,6 +336,9 @@ xmlSecOpenSSLEvpSignatureExecute(xmlSecTransformPtr transform, int last, xmlSecT
XMLSEC_ERRORS_NO_MESSAGE);
return(-1);
}
+#else /* XMLSEC_OPENSSL_096 */
+ EVP_VerifyUpdate(&(ctx->digestCtx), xmlSecBufferGetData(in), inSize);
+#endif /* XMLSEC_OPENSSL_096 */
}
ret = xmlSecBufferRemoveHead(in, inSize);
@@ -454,6 +475,7 @@ xmlSecOpenSSLTransformDsaSha1GetKlass(void) {
* <SignatureValue>i6watmQQQ1y3GB+VsWq5fJKzQcBB4jRfH1bfJFj0JtFVtLotttzYyA==</SignatureValue>
*
***************************************************************************/
+#ifndef XMLSEC_OPENSSL_096
static int
xmlSecOpenSSLDsaEvpInit(EVP_MD_CTX *ctx)
{
@@ -471,6 +493,7 @@ xmlSecOpenSSLDsaEvpFinal(EVP_MD_CTX *ctx,unsigned char *md)
{
return SHA1_Final(md,ctx->md_data);
}
+#endif /* XMLSEC_OPENSSL_096 */
static int
xmlSecOpenSSLDsaEvpSign(int type ATTRIBUTE_UNUSED,
@@ -554,12 +577,18 @@ static const EVP_MD xmlSecOpenSSLDsaMdEvp = {
NID_dsaWithSHA,
NID_dsaWithSHA,
SHA_DIGEST_LENGTH,
+#ifndef XMLSEC_OPENSSL_096
0,
xmlSecOpenSSLDsaEvpInit,
xmlSecOpenSSLDsaEvpUpdate,
xmlSecOpenSSLDsaEvpFinal,
NULL,
NULL,
+#else /* XMLSEC_OPENSSL_096 */
+ SHA1_Init,
+ SHA1_Update,
+ SHA1_Final,
+#endif /* XMLSEC_OPENSSL_096 */
xmlSecOpenSSLDsaEvpSign,
xmlSecOpenSSLDsaEvpVerify,
{EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3,EVP_PKEY_DSA4,0},