diff --git a/.gitattributes b/.gitattributes index 2b488fc65e1ae383cedfdfaad42dbb67c966bd98..4da1c5a8d571aab6872eb7bc81fb3227f4c2b01b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -64,6 +64,7 @@ testfont binary /lib/7.4/modules/SSL.pmod/sslfile.pike foreign_ident /lib/7.4/modules/Stdio.pmod/module.pmod foreign_ident /lib/7.4/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike foreign_ident +/lib/7.4/modules/_Crypto.pmod foreign_ident /lib/7.4/modules/__default.pmod foreign_ident /lib/7.6/modules/Debug.pmod/module.pmod foreign_ident /lib/7.6/modules/Protocols.pmod/LDAP.pmod/client.pike foreign_ident diff --git a/lib/7.4/modules/Crypto.pmod/module.pmod b/lib/7.4/modules/Crypto.pmod/module.pmod index 6e1ca54191e219dd74609a3fbca33c1c2da05731..507f2467e021426e39c9291e8a2cfbfa46017604 100644 --- a/lib/7.4/modules/Crypto.pmod/module.pmod +++ b/lib/7.4/modules/Crypto.pmod/module.pmod @@ -1,8 +1,8 @@ #pike 7.6 -#if constant(Crypto.crypt_md5) -//! From Pike 7.5 @[pw] and @[salt] are binary strings, so -//! the result is different if any of these includes @expr{"\0"@}. +#if constant(Nettle.crypt_md5) +//! From Pike 7.5 an in Nettle @[pw] and @[salt] are binary strings, so +//! the result is different if any of these contains @expr{"\0"@}. //! //! The return type is also changed from string to int|string. If //! the second argument is a hash, @[pw] will be hashed with the @@ -13,7 +13,7 @@ string crypt_md5(string pw, void|string salt) { sscanf(salt, "%s\0", salt); sscanf(salt, "$1$%s", salt); } - return Crypto.crypt_md5(pw,salt); + return Nettle.crypt_md5(pw,salt); } #endif diff --git a/lib/7.4/modules/_Crypto.pmod b/lib/7.4/modules/_Crypto.pmod new file mode 100644 index 0000000000000000000000000000000000000000..9dd796c93d9012c51dbf3b9857abffc2dd905bcd --- /dev/null +++ b/lib/7.4/modules/_Crypto.pmod @@ -0,0 +1,32 @@ +/* + * $Id: _Crypto.pmod,v 1.1 2005/05/22 11:57:26 grubba Exp $ + * + * Compat for _Crypto. + * + * 2005-05-22 Henrik Grubbstr�m + */ + +/* Note: We base this module on Crypto, which is the reverse of + * the way a true Pike 7.4 did. + */ +#pike 7.4 +#if constant(Crypto) + +constant cast = Crypto.cast; +constant pipe = Crypto.pipe; +constant invert = Crypto.invert; +constant arcfour = Crypto.arcfour; +constant des = Crypto.des; +constant cbc = Crypto.cbc; +constant crypto = Crypto.crypto; +constant sha = Crypto.sha; +constant md4 = Crypto.md4; +constant md5 = Crypto.md5; +constant crypt_md5 = Crypto.crypt_md5; +constant string_to_hex = Crypto.string_to_hex; +constant des_parity = Crypto.des_parity; +constant hex_to_string = Crypto.hex_to_string; +constant md2 = Crypto.md2; +constant rijndael = Crypto.rijndael; + +#endif /* constant(Crypto) */ \ No newline at end of file