php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61421
Patch openssl-add-sig-algs.txt revision 2012-06-18 20:47 UTC by mark at zedwood dot com
Patch openssl-add-rmd160-sha2-sig-alg.patch revision 2012-04-05 22:08 UTC by mark at zedwood dot com
revision 2012-04-05 22:04 UTC by mark at zedwood dot com
Patch openssl-add-ripemd160-sha2-sig-algs revision 2012-04-02 18:19 UTC by mark at zedwood dot com
Patch add_openssl_signature_algorithms.txt revision 2012-03-16 19:35 UTC by zedwoodnoreply at gmail dot com

Patch add_openssl_signature_algorithms.txt for OpenSSL related Bug #61421

Patch version 2012-03-16 19:35 UTC

Return to Bug #61421 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: zedwoodnoreply@gmail.com

--- ext/openssl/openssl.c	2012-02-22 18:26:46.000000000 -0700
+++ ext/openssl/openssl.c	2012-03-16 13:13:30.507548108 -0600
@@ -69,6 +69,17 @@
 #define OPENSSL_ALGO_MD2	4
 #endif
 #define OPENSSL_ALGO_DSS1	5
+#ifndef OPENSSL_NO_SHA256
+#define OPENSSL_ALGO_SHA224 6
+#define OPENSSL_ALGO_SHA256 7
+#endif
+#ifndef OPENSSL_NO_SHA512
+#define OPENSSL_ALGO_SHA384 8
+#define OPENSSL_ALGO_SHA512 9
+#endif
+#ifndef OPENSSL_NO_RIPEMD160
+#define OPENSSL_ALGO_RIPEMD160 10
+#endif
 
 #define DEBUG_SMIME	0
 
@@ -954,6 +965,27 @@
 		case OPENSSL_ALGO_DSS1:
 			mdtype = (EVP_MD *) EVP_dss1();
 			break;
+#ifndef OPENSSL_NO_SHA256 // OR OPENSSL_VERSION_NUMBER >= 0x0090708fL
+		case OPENSSL_ALGO_SHA224:
+			mdtype = (EVP_MD *) EVP_sha224();
+			break;
+		case OPENSSL_ALGO_SHA256:
+			mdtype = (EVP_MD *) EVP_sha256();
+			break;
+#endif
+#ifndef OPENSSL_NO_SHA512 // OR OPENSSL_VERSION_NUMBER >= 0x0090708fL
+		case OPENSSL_ALGO_SHA384:
+			mdtype = (EVP_MD *) EVP_sha384();
+			break;
+		case OPENSSL_ALGO_SHA512:
+			mdtype = (EVP_MD *) EVP_sha512();
+			break;
+#endif
+#ifndef OPENSSL_NO_RIPEMD160 // OR OPENSSL_VERSION_NUMBER >= 0x0090701fL
+		case OPENSSL_ALGO_RIPEMD160:
+			mdtype = (EVP_MD *) EVP_ripemd160();
+			break;
+#endif
 		default:
 			return NULL;
 			break;
@@ -1049,6 +1081,18 @@
 #endif
 	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
 
+#ifndef OPENSSL_NO_SHA256
+	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifndef OPENSSL_NO_SHA512
+	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA384", OPENSSL_ALGO_SHA384, CONST_CS|CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA512", OPENSSL_ALGO_SHA512, CONST_CS|CONST_PERSISTENT);
+#endif
+#ifndef OPENSSL_NO_RIPEMD160
+	REGISTER_LONG_CONSTANT("OPENSSL_ALGO_RIPEMD160", OPENSSL_ALGO_RIPEMD160, CONST_CS|CONST_PERSISTENT);
+#endif
+
 	/* flags for S/MIME */
 	REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("PKCS7_TEXT", PKCS7_TEXT, CONST_CS|CONST_PERSISTENT);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 16:01:29 2024 UTC