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

version» Context lines:

pike.git/lib/modules/Tools.pmod/X509.pmod:54:   }      string make_selfsigned_dsa_certificate(object dsa, int ttl, array name,    array|void extensions)   {    object serial = asn1_integer(1); /* Hard coded serial number */    int now = time();    object validity = asn1_sequence( ({ make_time(now),    make_time(now + ttl) }) );    -  object signature_algorithm = Identifiers.dsa_sha_id; +  object signature_algorithm = asn1_sequence( ({ Identifiers.dsa_sha_id }) );       object keyinfo = asn1_sequence(    ({ /* Use an identifier with parameters */    DSA.algorithm_identifier(dsa),    asn1_bit_string(DSA.public_key(dsa)) }) );       object dn = Certificate.build_distinguished_name(@name);       object tbs = make_tbs(dn, signature_algorithm,    dn, keyinfo,    serial, ttl, extensions);       return asn1_sequence(    ({ tbs, -  asn1_sequence( ({ signature_algorithm }) ), +  signature_algorithm,    asn1_bit_string(dsa    ->sign_ssl(tbs->get_der())) }))->get_der();   }      string rsa_sign_digest(object rsa, object digest_id, string digest)   {    object digest_info = asn1_sequence( ({ asn1_sequence( ({ digest_id,    asn1_null() }) ),    asn1_octet_string(digest) }) );    return rsa->raw_sign(digest_info->get_der())->digits(256);