diff options
author | David Benjamin <davidben@chromium.org> | 2016-01-03 13:52:40 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2016-02-27 01:41:17 +0300 |
commit | 3f4f7ee08fe0e36c87519befcaff073dc5a90e95 (patch) | |
tree | ab97a024b117b6aadc0ba15763b02ddd50f9f5ff /crypto/pem | |
parent | 8c07ad3e3be810663d2fe5f94de8cfb256285851 (diff) |
PEM_write_bio_PrivateKey is always PKCS#8.
Every key type which has a legacy PEM encoding also has a PKCS#8
encoding. The fallback codepath is never reached.
This removes the only consumer of pem_str, so that may be removed from
EVP_PKEY_ASN1_METHOD.
Change-Id: Ic680bfc162e1dc76db8b8016f6c10f669b24f5aa
Reviewed-on: https://boringssl-review.googlesource.com/6870
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pem_pkey.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 4cac7c28..c1467f7c 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -150,14 +150,7 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { - char pem_str[80]; - if (!x->ameth || x->ameth->priv_encode) - return PEM_write_bio_PKCS8PrivateKey(bp, x, enc, - (char *)kstr, klen, cb, u); - - BIO_snprintf(pem_str, 80, "%s PRIVATE KEY", x->ameth->pem_str); - return PEM_ASN1_write_bio((i2d_of_void *)i2d_PrivateKey, - pem_str, bp, x, enc, kstr, klen, cb, u); + return PEM_write_bio_PKCS8PrivateKey(bp, x, enc, (char *)kstr, klen, cb, u); } #ifndef OPENSSL_NO_FP_API |