]> granicus.if.org Git - curl/commitdiff
openssl: VMS support for SHA256
authorJohn Malmberg <wb8tyw@qsl.net>
Thu, 2 Jul 2015 01:54:09 +0000 (20:54 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 14 Jul 2015 05:25:36 +0000 (01:25 -0400)
setup-vms.h: More symbols for SHA256, hacks for older VAX

openssl.h: Use OpenSSL OPENSSL_NO_SHA256 macro to allow building on VAX.

openssl.c: Use OpenSSL version checks and OPENSSL_NO_SHA256 macro to
allow building on VAX and 64 bit VMS.

lib/setup-vms.h
lib/vtls/openssl.c
lib/vtls/openssl.h

index 79844daa49c7754f81fde27fc0528c2b8c0fa48d..520a35daac7feeb95b0508ed0d634b4d967de6c2 100644 (file)
@@ -249,7 +249,9 @@ char * unix_path;
 #define MD5_Init MD5_INIT
 #define MD5_Update MD5_UPDATE
 #define OPENSSL_add_all_algo_noconf OPENSSL_ADD_ALL_ALGO_NOCONF
+#ifndef __VAX
 #define OPENSSL_load_builtin_modules OPENSSL_LOAD_BUILTIN_MODULES
+#endif
 #define PEM_read_X509 PEM_READ_X509
 #define PEM_write_bio_X509 PEM_WRITE_BIO_X509
 #define PKCS12_PBE_add PKCS12_PBE_ADD
@@ -353,6 +355,12 @@ char * unix_path;
 #define sk_pop SK_POP
 #define sk_pop_free SK_POP_FREE
 #define sk_value SK_VALUE
+#ifdef __VAX
+#define OPENSSL_NO_SHA256
+#endif
+#define SHA256_Final SHA256_FINAL
+#define SHA256_Init SHA256_INIT
+#define SHA256_Update SHA256_UPDATE
 
 #define USE_UPPERCASE_GSSAPI 1
 #define gss_seal GSS_SEAL
index e41499f90845cd5c8beca0b3b0cb448c436fe431..beebdc1b72f8d6c75b6f7cfef94e01f5f1f191f4 100644 (file)
@@ -68,7 +68,7 @@
 #include <openssl/pkcs12.h>
 #endif
 
-#ifndef HAVE_BORINGSSL
+#if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_IS_BORINGSSL)
 #include <openssl/ocsp.h>
 #endif
 
 #define CONF_modules_load_file(a,b,c)
 #endif
 
-#ifdef OPENSSL_IS_BORINGSSL
-/* not present in BoringSSL */
+#if (OPENSSL_VERSION_NUMBER < 0x0090808fL) || defined(OPENSSL_IS_BORINGSSL)
+/* not present in BoringSSL  or older OpenSSL */
 #define OPENSSL_load_builtin_modules(x)
 #endif
 
@@ -3183,6 +3183,7 @@ void Curl_ossl_md5sum(unsigned char *tmp, /* input */
   MD5_Final(md5sum, &MD5pw);
 }
 
+#ifndef OPENSSL_NO_SHA256
 void Curl_ossl_sha256sum(const unsigned char *tmp, /* input */
                       size_t tmplen,
                       unsigned char *sha256sum /* output */,
@@ -3194,6 +3195,7 @@ void Curl_ossl_sha256sum(const unsigned char *tmp, /* input */
   SHA256_Update(&SHA256pw, tmp, tmplen);
   SHA256_Final(sha256sum, &SHA256pw);
 }
+#endif
 
 bool Curl_ossl_cert_status_request(void)
 {
index ebac542b7088e0c3ee1fa1ec36603ccb119a0952..a1f347a0597467b46a0f8564533bf571eaf2a7b3 100644 (file)
@@ -108,7 +108,9 @@ bool Curl_ossl_cert_status_request(void);
 #define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y)
 #define curlssl_random(x,y,z) Curl_ossl_random(x,y,z)
 #define curlssl_md5sum(a,b,c,d) Curl_ossl_md5sum(a,b,c,d)
+#ifndef OPENSSL_NO_SHA256
 #define curlssl_sha256sum(a,b,c,d) Curl_ossl_sha256sum(a,b,c,d)
+#endif
 #define curlssl_cert_status_request() Curl_ossl_cert_status_request()
 
 #define DEFAULT_CIPHER_SELECTION \