version 1.1.1.2, 2012/05/29 12:34:36
|
version 1.1.1.3, 2013/07/22 01:31:57
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 69
|
Line 69
|
#define OPENSSL_ALGO_MD2 4 |
#define OPENSSL_ALGO_MD2 4 |
#endif |
#endif |
#define OPENSSL_ALGO_DSS1 5 |
#define OPENSSL_ALGO_DSS1 5 |
| #if OPENSSL_VERSION_NUMBER >= 0x0090708fL |
| #define OPENSSL_ALGO_SHA224 6 |
| #define OPENSSL_ALGO_SHA256 7 |
| #define OPENSSL_ALGO_SHA384 8 |
| #define OPENSSL_ALGO_SHA512 9 |
| #define OPENSSL_ALGO_RMD160 10 |
| #endif |
#define DEBUG_SMIME 0 |
#define DEBUG_SMIME 0 |
|
|
/* FIXME: Use the openssl constants instead of |
/* FIXME: Use the openssl constants instead of |
Line 954 static EVP_MD * php_openssl_get_evp_md_from_algo(long
|
Line 960 static EVP_MD * php_openssl_get_evp_md_from_algo(long
|
case OPENSSL_ALGO_DSS1: |
case OPENSSL_ALGO_DSS1: |
mdtype = (EVP_MD *) EVP_dss1(); |
mdtype = (EVP_MD *) EVP_dss1(); |
break; |
break; |
|
#if OPENSSL_VERSION_NUMBER >= 0x0090708fL |
|
case OPENSSL_ALGO_SHA224: |
|
mdtype = (EVP_MD *) EVP_sha224(); |
|
break; |
|
case OPENSSL_ALGO_SHA256: |
|
mdtype = (EVP_MD *) EVP_sha256(); |
|
break; |
|
case OPENSSL_ALGO_SHA384: |
|
mdtype = (EVP_MD *) EVP_sha384(); |
|
break; |
|
case OPENSSL_ALGO_SHA512: |
|
mdtype = (EVP_MD *) EVP_sha512(); |
|
break; |
|
case OPENSSL_ALGO_RMD160: |
|
mdtype = (EVP_MD *) EVP_ripemd160(); |
|
break; |
|
#endif |
default: |
default: |
return NULL; |
return NULL; |
break; |
break; |
Line 1048 PHP_MINIT_FUNCTION(openssl)
|
Line 1071 PHP_MINIT_FUNCTION(openssl)
|
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); |
#endif |
#endif |
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); |
|
#if OPENSSL_VERSION_NUMBER >= 0x0090708fL |
|
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); |
|
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); |
|
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_RMD160", OPENSSL_ALGO_RMD160, CONST_CS|CONST_PERSISTENT); |
|
#endif |
|
|
/* flags for S/MIME */ |
/* flags for S/MIME */ |
REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT); |
Line 3174 PHP_FUNCTION(openssl_pkey_get_public)
|
Line 3204 PHP_FUNCTION(openssl_pkey_get_public)
|
if (pkey == NULL) { |
if (pkey == NULL) { |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
zend_list_addref(Z_LVAL_P(return_value)); |
} |
} |
/* }}} */ |
/* }}} */ |
|
|
Line 3210 PHP_FUNCTION(openssl_pkey_get_private)
|
Line 3241 PHP_FUNCTION(openssl_pkey_get_private)
|
if (pkey == NULL) { |
if (pkey == NULL) { |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
zend_list_addref(Z_LVAL_P(return_value)); |
} |
} |
|
|
/* }}} */ |
/* }}} */ |