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

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:75: Inside #if constant(Crypto.SHA512)
  #if constant(Crypto.SHA512)    Identifiers.rsa_sha512_id->get_der() : Crypto.SHA512,   #endif       Identifiers.dsa_sha_id->get_der() : Crypto.SHA1,   #if constant(Crypto.SHA224)    Identifiers.dsa_sha224_id->get_der() : Crypto.SHA224,   #endif    Identifiers.dsa_sha256_id->get_der() : Crypto.SHA256,    +  Identifiers.ecdsa_sha1_id->get_der() : Crypto.SHA1,   #if constant(Crypto.SHA224)    Identifiers.ecdsa_sha224_id->get_der() : Crypto.SHA224,   #endif    Identifiers.ecdsa_sha256_id->get_der() : Crypto.SHA256,   #if constant(Crypto.SHA384)    Identifiers.ecdsa_sha384_id->get_der() : Crypto.SHA384,   #endif   #if constant(Crypto.SHA512)    Identifiers.ecdsa_sha512_id->get_der() : Crypto.SHA512,   #endif
pike.git/lib/modules/Standards.pmod/X509.pmod:101:    optional Crypto.RSA rsa;    optional Crypto.DSA dsa;   #if constant(Crypto.ECC.Curve)    optional Crypto.ECC.SECP_521R1.ECDSA ecdsa;   #endif       //! Verifies the @[signature] of the certificate @[msg] using the    //! indicated hash @[algorithm].    int(0..1) verify(Sequence algorithm, string msg, string signature)    { +  DBG("Verify hash %O\n", algorithm[0]);    Crypto.Hash hash = algorithms[algorithm[0]->get_der()];    if (!hash) return 0;    return pkc && pkc->pkcs_verify(msg, hash, signature);    } -  +  +  protected string _sprintf(int t) +  { +  return t=='O' && sprintf("%O(%O)", this_program, pkc);    } -  + }      protected class RSAVerifier   {    inherit Verifier;    constant type = "rsa";       protected void create(string key) {    pkc = RSA.parse_public_key(key);    }   
pike.git/lib/modules/Standards.pmod/X509.pmod:981:   {    object cert = Standards.ASN1.Decode.simple_der_decode(s);       TBSCertificate tbs = decode_certificate(cert);    if (!tbs) return 0;       object v;       if (tbs->issuer->get_der() == tbs->subject->get_der())    { -  DBG("Self signed certificate\n"); +  DBG("Self signed certificate: %O\n", tbs->public_key);    v = tbs->public_key;    }    else    v = authorities[tbs->issuer->get_der()];       return v && v->verify(cert[1],    cert[0]->get_der(),    cert[2]->value)    && tbs;   }