fix_dsa_pub_encoding.diff

Martin Bosslet, 02/22/2011 08:25 AM

Download (1.05 KB)

View differences:

ruby/ext/openssl/ossl_pkey_dsa.c (working copy)
162 164
	dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
163 165
	if (!dsa) {
164 166
	    (void)BIO_reset(in);
165
	    dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
166
	}
167
	if (!dsa) {
168
	    (void)BIO_reset(in);
169 167
	    dsa = PEM_read_bio_DSA_PUBKEY(in, NULL, NULL, NULL);
170 168
	}
171 169
	if (!dsa) {
......
176 174
	    (void)BIO_reset(in);
177 175
	    dsa = d2i_DSA_PUBKEY_bio(in, NULL);
178 176
	}
177
	if (!dsa) {
178
	    (void)BIO_reset(in);
179
	    dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
180
	}
179 181
	BIO_free(in);
180 182
	if (!dsa) ossl_raise(eDSAError, "Neither PUB key nor PRIV key:");
181 183
    }
......
257 259
	    ossl_raise(eDSAError, NULL);
258 260
	}
259 261
    } else {
260
	if (!PEM_write_bio_DSAPublicKey(out, pkey->pkey.dsa)) {
262
	if (!PEM_write_bio_DSA_PUBKEY(out, pkey->pkey.dsa)) {
261 263
	    BIO_free(out);
262 264
	    ossl_raise(eDSAError, NULL);
263 265
	}