mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Thu May 12 08:18:45 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* ext/openssl/ossl_pkey_dsa.c: Use generic X.509 SubjectPublicKeyInfo format for PEM-encoding DSA public keys. [ruby-core:35328] [Bug #4422] Previous revision: 31520 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
adaab0f922
commit
bc75259b69
2 changed files with 12 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Thu May 12 08:18:45 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_pkey_dsa.c: Use generic X.509 SubjectPublicKeyInfo
|
||||||
|
format for PEM-encoding DSA public keys.
|
||||||
|
[ruby-core:35328] [Bug #4422]
|
||||||
|
|
||||||
Thu May 12 07:27:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
|
Thu May 12 07:27:31 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
|
||||||
|
|
||||||
* ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo
|
* ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo
|
||||||
|
|
|
@ -160,11 +160,6 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
arg = ossl_to_der_if_possible(arg);
|
arg = ossl_to_der_if_possible(arg);
|
||||||
in = ossl_obj2bio(arg);
|
in = ossl_obj2bio(arg);
|
||||||
dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
|
dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
|
||||||
if (!dsa) {
|
|
||||||
(void)BIO_reset(in);
|
|
||||||
(void)ERR_get_error();
|
|
||||||
dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
if (!dsa) {
|
if (!dsa) {
|
||||||
(void)BIO_reset(in);
|
(void)BIO_reset(in);
|
||||||
(void)ERR_get_error();
|
(void)ERR_get_error();
|
||||||
|
@ -180,6 +175,11 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
(void)ERR_get_error();
|
(void)ERR_get_error();
|
||||||
dsa = d2i_DSA_PUBKEY_bio(in, NULL);
|
dsa = d2i_DSA_PUBKEY_bio(in, NULL);
|
||||||
}
|
}
|
||||||
|
if (!dsa) {
|
||||||
|
(void)BIO_reset(in);
|
||||||
|
(void)ERR_get_error();
|
||||||
|
dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
if (!dsa) {
|
if (!dsa) {
|
||||||
(void)ERR_get_error();
|
(void)ERR_get_error();
|
||||||
|
@ -264,7 +264,7 @@ ossl_dsa_export(int argc, VALUE *argv, VALUE self)
|
||||||
ossl_raise(eDSAError, NULL);
|
ossl_raise(eDSAError, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!PEM_write_bio_DSAPublicKey(out, pkey->pkey.dsa)) {
|
if (!PEM_write_bio_DSA_PUBKEY(out, pkey->pkey.dsa)) {
|
||||||
BIO_free(out);
|
BIO_free(out);
|
||||||
ossl_raise(eDSAError, NULL);
|
ossl_raise(eDSAError, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue