Skip to content
Snippets Groups Projects
Commit 220ea192 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Improved Crypto compat with Pike 7.4.

Rev: lib/7.4/modules/Crypto.pmod/module.pmod:1.15
Rev: lib/7.4/modules/_Crypto.pmod:1.1
parent 4e5f7480
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ testfont binary ...@@ -64,6 +64,7 @@ testfont binary
/lib/7.4/modules/SSL.pmod/sslfile.pike foreign_ident /lib/7.4/modules/SSL.pmod/sslfile.pike foreign_ident
/lib/7.4/modules/Stdio.pmod/module.pmod 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/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.4/modules/__default.pmod foreign_ident
/lib/7.6/modules/Debug.pmod/module.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 /lib/7.6/modules/Protocols.pmod/LDAP.pmod/client.pike foreign_ident
......
#pike 7.6 #pike 7.6
#if constant(Crypto.crypt_md5) #if constant(Nettle.crypt_md5)
//! From Pike 7.5 @[pw] and @[salt] are binary strings, so //! From Pike 7.5 an in Nettle @[pw] and @[salt] are binary strings, so
//! the result is different if any of these includes @expr{"\0"@}. //! the result is different if any of these contains @expr{"\0"@}.
//! //!
//! The return type is also changed from string to int|string. If //! The return type is also changed from string to int|string. If
//! the second argument is a hash, @[pw] will be hashed with the //! the second argument is a hash, @[pw] will be hashed with the
...@@ -13,7 +13,7 @@ string crypt_md5(string pw, void|string salt) { ...@@ -13,7 +13,7 @@ string crypt_md5(string pw, void|string salt) {
sscanf(salt, "%s\0", salt); sscanf(salt, "%s\0", salt);
sscanf(salt, "$1$%s", salt); sscanf(salt, "$1$%s", salt);
} }
return Crypto.crypt_md5(pw,salt); return Nettle.crypt_md5(pw,salt);
} }
#endif #endif
......
/*
* $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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment