|
|
| version 1.69, 2013/08/21 14:41:24 | version 1.71, 2013/08/22 14:35:30 |
|---|---|
| Line 164 static void _crypt(Request& r, MethodPar | Line 164 static void _crypt(Request& r, MethodPar |
| } | } |
| static void _md5(Request& r, MethodParams& params) { | static void _md5(Request& r, MethodParams& params) { |
| const char *string=params.as_string(0, PARAMETER_MUST_BE_STRING).cstr(); | const char *string=params.as_string(0, PARAMETER_MUST_BE_STRING).cstr_to_string_body_untaint(String::L_AS_IS).cstr(); |
| PA_MD5_CTX context; | PA_MD5_CTX context; |
| unsigned char digest[16]; | unsigned char digest[16]; |
| Line 316 void SHA1ReadDigest(void *buf, SHA1Conte | Line 316 void SHA1ReadDigest(void *buf, SHA1Conte |
| } | } |
| static void _sha1(Request& r, MethodParams& params) { | static void _sha1(Request& r, MethodParams& params) { |
| const char *string = params.as_string(0, PARAMETER_MUST_BE_STRING).cstr(); | const char *string = params.as_string(0, PARAMETER_MUST_BE_STRING).cstr_to_string_body_untaint(String::L_AS_IS).cstr(); |
| SHA1Context c; | SHA1Context c; |
| unsigned char digest[20]; | unsigned char digest[20]; |
| Line 574 MMath::MMath(): Methoded("math") { | Line 574 MMath::MMath(): Methoded("math") { |
| // ^math:sha1[string] | // ^math:sha1[string] |
| ADD1(sha1); | ADD1(sha1); |
| // ^math:digest[method;string;options] | // ^math:digest[method;string|file;options] |
| add_native_method("digest", Method::CT_STATIC, _digest, 2, 3); | add_native_method("digest", Method::CT_STATIC, _digest, 2, 3); |
| // ^math:crc32[string] | // ^math:crc32[string] |