Project

General

Profile

Bug #4422 ยป fix_dsa_pub_encoding.diff

MartinBosslet (Martin Bosslet), 02/22/2011 08:25 AM

View differences:

ruby/ext/openssl/ossl_pkey_dsa.c (working copy)
dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
if (!dsa) {
(void)BIO_reset(in);
dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
}
if (!dsa) {
(void)BIO_reset(in);
dsa = PEM_read_bio_DSA_PUBKEY(in, NULL, NULL, NULL);
}
if (!dsa) {
......
(void)BIO_reset(in);
dsa = d2i_DSA_PUBKEY_bio(in, NULL);
}
if (!dsa) {
(void)BIO_reset(in);
dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
}
BIO_free(in);
if (!dsa) ossl_raise(eDSAError, "Neither PUB key nor PRIV key:");
}
......
ossl_raise(eDSAError, NULL);
}
} else {
if (!PEM_write_bio_DSAPublicKey(out, pkey->pkey.dsa)) {
if (!PEM_write_bio_DSA_PUBKEY(out, pkey->pkey.dsa)) {
BIO_free(out);
ossl_raise(eDSAError, NULL);
}
    (1-1/1)