Branch: Tag:

2003-11-30

2003-11-30 17:17:24 by Martin Nilsson <mani@lysator.liu.se>

Prefer nettle crypto.

Rev: lib/modules/Tools.pmod/X509.pmod:1.19

1:   #pike __REAL_VERSION__      /* -  * $Id: X509.pmod,v 1.18 2003/01/26 17:23:54 nilsson Exp $ +  * $Id: X509.pmod,v 1.19 2003/11/30 17:17:24 nilsson Exp $    *    * Some random functions for creating RFC-2459 style X.509 certificates.    *
203:    ({ tbs,    rsa_sha1_algorithm,    BitString(rsa_sign_digest(rsa, Identifiers.sha1_id, -  Crypto.sha()->update(tbs->get_der()) -  ->digest())) }) )->get_der(); + #if constant(Crypto.SHA) +  Crypto.SHA.hash(tbs->get_der()) + #else +  Crypto.sha()->update(tbs->get_der())->digest() + #endif +  )) }) )->get_der();   }      //!
226:    {    if (algorithm->get_der() == rsa_md5_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.md5_id, + #if constant(Crypto.MD5) +  Crypto.MD5.hash(msg), + #else    Crypto.md5()->update(msg)->digest(), -  + #endif    signature);    if (algorithm->get_der() == rsa_sha1_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.sha1_id, -  + #if constant(Crypto.SHA) +  Crypto.SHA.hash(msg), + #else    Crypto.sha()->update(msg)->digest(), -  + #endif    signature);    if (algorithm->get_der() == rsa_md2_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.md2_id, -  + #if constant(Crypto.MD2) +  Crypto.MD2.hash(msg), + #else    Crypto.md2()->update(msg)->digest(), -  + #endif    signature);    return 0;    }