diff --git a/src/modules/_Crypto/crypto.doc b/src/modules/_Crypto/crypto.doc index 457a408ad87441e5b61a8739a8b7cb0a2fd724c9..8c8ea4770a2286817f7094db0576901c4b169adf 100644 --- a/src/modules/_Crypto/crypto.doc +++ b/src/modules/_Crypto/crypto.doc @@ -14,5 +14,8 @@ string pad(void); /* Perform the needed padding */ string unpad(string); /* Unpad the string */ string name(void); /* Name of the algorithm */ +string asn1_identifier(void); /* ASN.1 object identifier, if + * one is assigned. */ + The padding method follows SSL, appending n random bytes, followed by n itself, where 0 <= n < block_size . diff --git a/src/modules/_Crypto/md5.c b/src/modules/_Crypto/md5.c index f21b5c02e5b59241531113d52cd73ad7adf0c6c7..f28c88bfa901585e823422571e1cdbdbeebb4100 100644 --- a/src/modules/_Crypto/md5.c +++ b/src/modules/_Crypto/md5.c @@ -1,5 +1,5 @@ /* - * $Id: md5.c,v 1.4 1997/04/18 20:05:58 nisse Exp $ + * $Id: md5.c,v 1.5 1997/08/26 08:19:16 nisse Exp $ * * A pike module for getting access to some common cryptos. * @@ -7,7 +7,7 @@ * * Henrik Grubbstr�m 1996-10-24 * - * SSL dependencies purged, 1997-0227. /Niels M�ller + * SSL dependencies purged, 1997-02-27. /Niels M�ller */ @@ -61,6 +61,13 @@ static void f_update(INT32 args) push_object(this_object()); } +static void f_identifier(INT32 args) +{ + pop_n_elems(args); + push_string(make_shared_binary_string( + "\x2a\x86\x48\x86\xf7\x0d\x02\x05", 8)); +} + static void f_digest(INT32 args) { struct pike_string *s; @@ -87,5 +94,6 @@ void MOD_INIT(md5)(void) add_function("create", f_create, "function(void|object:void)", 0); add_function("update", f_update, "function(string:object)", 0); add_function("digest", f_digest, "function(void:string)", 0); + add_function("identifier", f_identifier, "function(void:string)", 0); end_class(MODULE_PREFIX "md5", 0); }