Branch: Tag:

2013-11-21

2013-11-21 14:40:36 by Martin Nilsson <nilsson@opera.com>

Fixed DSA certificate generation.

223:    if( object_program(c) == Crypto.RSA )    {    sign = lambda(string d) { -  return rsa_sign_digest(c, Identifiers.sha1_id, d); +  return rsa_sign_digest(c, Identifiers.sha1_id, Crypto.SHA1.hash(d));    };    }    else if( object_program(c) == Crypto.DSA )
236:    Sequence tbs = make_tbs(issuer, c->pkcs_algorithm_id(Crypto.SHA1),    subject, c->pkcs_public_key(),    Integer(serial), ttl, extensions); -  string digest = Crypto.SHA1.hash(tbs->get_der()); +        return Sequence(({ tbs, c->pkcs_algorithm_id(Crypto.SHA1), -  BitString(sign(digest)) }))->get_der(); +  BitString(sign(tbs->get_der())) }))->get_der();   }      //! Creates a selfsigned certificate, i.e. where issuer and subject
280:   class Verifier {    constant type = "none";    int(0..1) verify(object,string,string); +  optional Crypto.RSA rsa; +  optional Crypto.DSA dsa;   }      protected class RSAVerifier