We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bff4080 commit 3992b6fCopy full SHA for 3992b6f
ext/openssl/ossl_pkey.c
@@ -99,17 +99,20 @@ ossl_pkey_read_generic(BIO *bio, VALUE pass)
99
/* First check DER */
100
if (OSSL_DECODER_from_bio(dctx, bio) == 1)
101
goto out;
102
+ OSSL_BIO_reset(bio);
103
104
/* Then check PEM; multiple OSSL_DECODER_from_bio() calls may be needed */
- OSSL_BIO_reset(bio);
105
if (OSSL_DECODER_CTX_set_input_type(dctx, "PEM") != 1)
106
107
- while (OSSL_DECODER_from_bio(dctx, bio) != 1) {
108
- if (BIO_eof(bio))
+ while (1) {
+ if (OSSL_DECODER_from_bio(dctx, bio) == 1)
109
110
+ if (BIO_eof(bio))
111
+ break;
112
pos2 = BIO_tell(bio);
113
if (pos2 < 0 || pos2 <= pos)
- goto out;
114
115
+ ossl_clear_error();
116
pos = pos2;
117
}
118
0 commit comments