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

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:219: Inside #if constant(Crypto.ECC.Curve)
   protected void create(string(8bit) key, Identifier curve_id)    {    Crypto.ECC.Curve curve;    foreach(values(Crypto.ECC), mixed c) {    if (objectp(c) && c->pkcs_named_curve_id &&    (c->pkcs_named_curve_id() == curve_id)) {    curve = [object(Crypto.ECC.Curve)]c;    break;    }    } +  if(!curve) return;    DBG("ECC Curve: %O (%O)\n", curve, curve_id);    pkc = curve->ECDSA()->set_public_key(key);    }   }   #endif      protected Verifier make_verifier(Object _keyinfo)   {    if( _keyinfo->type_name != "SEQUENCE" )    return NULL("keyinfo isn't a SEQUENCE.\n");
pike.git/lib/modules/Standards.pmod/X509.pmod:275:    params[1]->value, params[2]->value);    }      #if constant(Crypto.ECC.Curve)    if(seq[0]->get_der() == Identifiers.ec_id->get_der())    {    if( sizeof(seq)!=2 || seq[1]->type_name!="OBJECT IDENTIFIER" )    return NULL("Illegal ECDSA ASN.1\n");       Identifier params = seq[1]; -  return ECDSAVerifier(str->value, params); +  Verifier ver = ECDSAVerifier(str->value, params); +  if(ver->pkc) return ver; +  return NULL("make_verifier: Unsupported ECDSA curve.\n");    }   #endif       return NULL("make_verifier: Unknown algorithm identifier: %O\n", seq[0]);   }      protected mapping(int:program(Object)) x509_types = ([    make_combined_tag(2, 1):IssuerId,    make_combined_tag(2, 2):SubjectId,    ]);