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

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:92: Inside #if constant(Crypto.SHA512)
  #endif   #if constant(Crypto.SHA512)    Identifiers.ecdsa_sha512_id->get_der() : Crypto.SHA512,   #endif    ]);   }      class Verifier {    constant type = "none";    Crypto.Sign pkc; -  optional Crypto.RSA rsa; -  optional Crypto.DSA dsa; - #if constant(Crypto.ECC.Curve) -  optional Crypto.ECC.SECP_521R1.ECDSA ecdsa; - #endif +  optional /* __deprecated__ */ Crypto.RSA rsa; +  optional /* __deprecated__ */ Crypto.DSA dsa;       //! 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);    }
pike.git/lib/modules/Standards.pmod/X509.pmod:123:      protected class RSAVerifier   {    inherit Verifier;    constant type = "rsa";       protected void create(string key) {    pkc = RSA.parse_public_key(key);    }    -  Crypto.RSA `rsa() { return [object(Crypto.RSA)]pkc; } +  __deprecated__ Crypto.RSA `rsa() { return [object(Crypto.RSA)]pkc; }   }      protected class DSAVerifier   {    inherit Verifier;    constant type = "dsa";       protected void create(string key, Gmp.mpz p, Gmp.mpz q, Gmp.mpz g)    {    pkc = DSA.parse_public_key(key, p, q, g);    }    -  Crypto.DSA `dsa() { return [object(Crypto.DSA)]pkc; } +  __deprecated__ Crypto.DSA `dsa() { return [object(Crypto.DSA)]pkc; }   }      #if constant(Crypto.ECC.Curve)   protected class ECDSAVerifier   {    inherit Verifier;    constant type = "ecdsa";       protected void create(string(8bit) key, string(8bit) curve_der)    {
pike.git/lib/modules/Standards.pmod/X509.pmod:158: Inside #if constant(Crypto.ECC.Curve)
   foreach(values(Crypto.ECC), mixed c) {    if (objectp(c) && c->pkcs_named_curve_id &&    (c->pkcs_named_curve_id()->get_der() == curve_der)) {    curve = [object(Crypto.ECC.Curve)]c;    break;    }    }    DBG("ECC Curve: %O (DER: %O)\n", curve, curve_der);    pkc = curve->ECDSA()->set_public_key(key);    } -  -  Crypto.ECC.SECP_521R1.ECDSA `ecdsa() -  { -  return [object(Crypto.ECC.SECP_521R1.ECDSA)]pkc; +    } - } +    #endif      protected Verifier make_verifier(Object _keyinfo)   {    if( _keyinfo->type_name != "SEQUENCE" )    return 0;    Sequence keyinfo = [object(Sequence)]_keyinfo;       if ( (keyinfo->type_name != "SEQUENCE")    || (sizeof(keyinfo) != 2)