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

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:35:   //!   constant CERT_BAD_SIGNATURE = 6;      //!   constant CERT_UNAUTHORIZED_CA = 7;      //! Creates a @[Standards.ASN1.Types.UTC] object from the posix   //! time @[t].   UTC make_time(int t)   { -  object /*Calendar.Second*/ second = Calendar["Second"](t)->set_timezone("UTC"); +  Calendar.ISO.Second second = Calendar.ISO.Second(t)->set_timezone("UTC");       if (second->year_no() >= 2050)    error( "Times later than 2049 not supported yet\n" );       return UTC(sprintf("%02d%02d%02d%02d%02d%02dZ",    second->year_no() % 100,    second->month_no(),    second->month_day(),    second->hour_no(),    second->minute_no(),
pike.git/lib/modules/Standards.pmod/X509.pmod:81:    mapping(string:int) m = mkmapping( ({ "year", "mon", "mday",    "hour", "min", "sec" }),    (array(int)) (s/2));       if (m->year < 50)    m->year += 100;    if ( (m->mon <= 0 ) || (m->mon > 12) )    return 0;    m->mon--;    -  if ( (m->mday <= 0) || (m->mday > Calendar["ISO"]["Year"](m->year + 1900) +  if ( (m->mday <= 0) || (m->mday > Calendar.ISO.Year(m->year + 1900)    ->month(m->mon + 1)->number_of_days()))    return 0;       if ( (m->hour < 0) || (m->hour > 23))    return 0;       if ( (m->min < 0) || (m->min > 59))    return 0;       /* NOTE: Allows for leap seconds */
pike.git/lib/modules/Standards.pmod/X509.pmod:345: Inside #if 0
   {    }   }   #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->elements) != 2)    || (keyinfo->elements[0]->type_name != "SEQUENCE")    || !sizeof(([object(Sequence)]keyinfo->elements[0])->elements)    || (keyinfo->elements[1]->type_name != "BIT STRING")    || keyinfo->elements[1]->unused)    return 0; -  +  Sequence seq = [object(Sequence)]keyinfo->elements[0]; +  String str = [object(String)]keyinfo->elements[1];    -  if (([object(Sequence)]keyinfo->elements[0])->elements[0]->get_der() -  == Identifiers.rsa_id->get_der()) +  if (seq->elements[0]->get_der() == Identifiers.rsa_id->get_der())    { -  if ( (sizeof(([object(Sequence)]keyinfo->elements[0])->elements) != 2) -  || (([object(Sequence)]keyinfo->elements[0])->elements[1]->get_der() -  != Null()->get_der())) +  if ( (sizeof(seq->elements) != 2) +  || (seq->elements[1]->get_der() != Null()->get_der()) )    return 0;    -  return rsa_verifier()->init(([object(Sequence)]keyinfo->elements[1]) -  ->value); +  return rsa_verifier()->init(str->value);    }    -  if(([object(Sequence)]keyinfo->elements[0])->elements[0]->get_der() -  == Identifiers.dsa_sha_id->get_der()) +  if(seq->elements[0]->get_der() == Identifiers.dsa_sha_id->get_der())    {    /* FIXME: Not implemented */    return 0;    }   }      //! Represents a TBSCertificate.   class TBSCertificate   {    //!