pike.git / lib / modules / Tools.pmod / X509.pmod

version» Context lines:

pike.git/lib/modules/Tools.pmod/X509.pmod:1:   #pike __REAL_VERSION__   //#pragma strict_types      /* -  * $Id: X509.pmod,v 1.32 2004/03/17 15:11:25 nilsson Exp $ +  * $Id: X509.pmod,v 1.33 2004/03/19 22:39:30 nilsson Exp $    *    * Some random functions for creating RFC-2459 style X.509 certificates.    *    */      constant dont_dump_module = 1;      #if constant(Standards.ASN1.Types.Sequence) && constant(Crypto.Hash)      import Standards.ASN1.Types;
pike.git/lib/modules/Tools.pmod/X509.pmod:256:    int(0..1) verify(Sequence algorithm, string msg, string signature)    {    if (algorithm->get_der() == rsa_md5_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.md5_id,    Crypto.MD5.hash(msg),    signature);    if (algorithm->get_der() == rsa_sha1_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.sha1_id,    Crypto.SHA1.hash(msg),    signature); + #if constant(Crypto.MD2.hash)    if (algorithm->get_der() == rsa_md2_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.md2_id,    Crypto.MD2.hash(msg),    signature); -  + #endif    return 0;    }   }      #if 0   /* FIXME: This is a little more difficult, as the dsa-parameters are    * sometimes taken from the CA, and not present in the keyinfo. */   class dsa_verifier   {    inherit Verifier;