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

version» Context lines:

pike.git/lib/modules/Tools.pmod/X509.pmod:1:   #pike __REAL_VERSION__      /* -  * $Id: X509.pmod,v 1.20 2003/12/03 10:03:29 nilsson Exp $ +  * $Id: X509.pmod,v 1.21 2004/01/11 00:40:49 nilsson Exp $    *    * Some random functions for creating RFC-2459 style X.509 certificates.    *    */      #if constant(Standards.ASN1.Types.Sequence)      import Standards.ASN1.Types;   import Standards.PKCS;   
pike.git/lib/modules/Tools.pmod/X509.pmod:215:   class rsa_verifier   {    object rsa;       constant type = "rsa";       //!    object init(string key)    {    rsa = RSA.parse_public_key(key); -  return rsa && this_object(); +  return rsa && this;    }       //!    int verify(object algorithm, string msg, string signature)    {    if (algorithm->get_der() == rsa_md5_algorithm->get_der())    return rsa_verify_digest(rsa, Identifiers.md5_id,   #if constant(Crypto.MD5.name)    Crypto.MD5.hash(msg),   #else
pike.git/lib/modules/Tools.pmod/X509.pmod:398:    public_key = make_verifier(a[5]);       if (!public_key)    return 0;       X509_WERR("TBSCertificate: parsed public key. type = %s\n",    public_key->type);       int i = 6;    if (i == sizeof(a)) -  return this_object(); +  return this;       if (version < 2)    return 0;       if (! a[i]->constructed    && (a[i]->combined_tag == make_combined_tag(2, 1)))    {    issuer_id = BitString()->decode_primitive(a[i]->raw);    i++;    if (i == sizeof(a)) -  return this_object(); +  return this;    }    if (! a[i]->constructed    && (a[i]->combined_tag == make_combined_tag(2, 2)))    {    subject_id = BitString()->decode_primitive(a[i]->raw);    i++;    if (i == sizeof(a)) -  return this_object(); +  return this;    }    if (a[i]->constructed    && (a[i]->combined_tag == make_combined_tag(2, 3)))    {    extensions = a[i];    i++;    if (i == sizeof(a)) -  return this_object(); +  return this;    }    /* Too many fields */    return 0;    }   }      //!   TBSCertificate decode_certificate(string|object cert)   {    if (stringp (cert)) cert = Standards.ASN1.Decode.simple_der_decode(cert);