From ef4627a6a618b460cbbea109e3e0522c891be72c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 13 Sep 2024 10:13:12 +0200 Subject: More bindings (function missing in php) - add crypt_gensalt(?string $salt = null, int $count = 0): ?string {} - add crypt_preferred_method(): ?string {} - add crypt_checksalt(string $salt): int {} and bump version to 1.1.0-dev (new functions) --- xpass_arginfo.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 xpass_arginfo.h (limited to 'xpass_arginfo.h') diff --git a/xpass_arginfo.h b/xpass_arginfo.h new file mode 100644 index 0000000..dcd9a50 --- /dev/null +++ b/xpass_arginfo.h @@ -0,0 +1,45 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 6a2b53f488db292839749c125a6d81f89316e9c9 */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt_gensalt, 0, 0, IS_STRING, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, count, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt_preferred_method, 0, 0, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt_checksalt, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0) +ZEND_END_ARG_INFO() + + +ZEND_FUNCTION(crypt_gensalt); +ZEND_FUNCTION(crypt_preferred_method); +ZEND_FUNCTION(crypt_checksalt); + + +static const zend_function_entry ext_functions[] = { + ZEND_FE(crypt_gensalt, arginfo_crypt_gensalt) + ZEND_FE(crypt_preferred_method, arginfo_crypt_preferred_method) + ZEND_FE(crypt_checksalt, arginfo_crypt_checksalt) + ZEND_FE_END +}; + +static void register_xpass_symbols(int module_number) +{ + REGISTER_STRING_CONSTANT("XPASS_CRYPT_STD_DES", "", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_EXT_DES", "_", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_MD5", "$1$", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_BLOWFISH", "$2y$", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_SHA256", "$5$", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_SHA512", "$6$", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_SCRYPT", "$7$", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_GOST_YESCRYPT", "$gy$", CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XPASS_CRYPT_YESCRYPT", "$y$", CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SALT_OK", CRYPT_SALT_OK, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SALT_INVALID", CRYPT_SALT_INVALID, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SALT_METHOD_DISABLED", CRYPT_SALT_METHOD_DISABLED, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SALT_METHOD_LEGACY", CRYPT_SALT_METHOD_LEGACY, CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SALT_TOO_CHEAP", CRYPT_SALT_TOO_CHEAP, CONST_PERSISTENT); +} -- cgit