Skip to content
Snippets Groups Projects
Commit 7015eff3 authored by Niels Möller's avatar Niels Möller
Browse files

Added identifier() method, that should return a DER-encoded ANS.1

object identifier for the algorithm.

Rev: src/modules/_Crypto/crypto.doc:1.5
Rev: src/modules/_Crypto/md5.c:1.5
parent 69307b9f
No related branches found
No related tags found
No related merge requests found
...@@ -14,5 +14,8 @@ string pad(void); /* Perform the needed padding */ ...@@ -14,5 +14,8 @@ string pad(void); /* Perform the needed padding */
string unpad(string); /* Unpad the string */ string unpad(string); /* Unpad the string */
string name(void); /* Name of the algorithm */ 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, The padding method follows SSL, appending n random bytes,
followed by n itself, where 0 <= n < block_size . followed by n itself, where 0 <= n < block_size .
/* /*
* $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. * A pike module for getting access to some common cryptos.
* *
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* Henrik Grubbstrm 1996-10-24 * Henrik Grubbstrm 1996-10-24
* *
* SSL dependencies purged, 1997-0227. /Niels Mller * SSL dependencies purged, 1997-02-27. /Niels Mller
*/ */
...@@ -61,6 +61,13 @@ static void f_update(INT32 args) ...@@ -61,6 +61,13 @@ static void f_update(INT32 args)
push_object(this_object()); 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) static void f_digest(INT32 args)
{ {
struct pike_string *s; struct pike_string *s;
...@@ -87,5 +94,6 @@ void MOD_INIT(md5)(void) ...@@ -87,5 +94,6 @@ void MOD_INIT(md5)(void)
add_function("create", f_create, "function(void|object:void)", 0); add_function("create", f_create, "function(void|object:void)", 0);
add_function("update", f_update, "function(string:object)", 0); add_function("update", f_update, "function(string:object)", 0);
add_function("digest", f_digest, "function(void:string)", 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); end_class(MODULE_PREFIX "md5", 0);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment