diff options
author | David Benjamin <davidben@chromium.org> | 2016-01-31 03:33:52 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2016-02-27 02:33:50 +0300 |
commit | 921d906bb640e105b852c849edb8f0a115cc1a6c (patch) | |
tree | 746d5c0b7565cd1fbbb9e33dafb7f2b5cae3659f /include/openssl/evp.h | |
parent | 6d3387d9c1cc184c7d9ca29d726ab478cdfc1023 (diff) |
Reimplement d2i_PrivateKey.
Functions which lose object reuse and need auditing:
- d2i_PrivateKey
This removes evp_asn1.c's dependency on the old stack. (Aside from
obj/.) It also takes old_priv_decode out of EVP_ASN1_METHOD in favor of
calling out to the new-style function. EVP_ASN1_METHOD no longer has any
old-style type-specific serialization hooks, only the PKCS#8 and SPKI
ones.
BUG=499653
Change-Id: Ic142dc05a5505b50e4717c260d3893b20e680194
Reviewed-on: https://boringssl-review.googlesource.com/7027
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'include/openssl/evp.h')
-rw-r--r-- | include/openssl/evp.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/openssl/evp.h b/include/openssl/evp.h index f9b9496a..595672c7 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -698,11 +698,10 @@ OPENSSL_EXPORT int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp); /* d2i_PrivateKey parses an ASN.1, DER-encoded, private key from |len| bytes at * |*inp|. If |out| is not NULL then, on exit, a pointer to the result is in - * |*out|. If |*out| is already non-NULL on entry then the result is written - * directly into |*out|, otherwise a fresh |EVP_PKEY| is allocated. However, - * one should not depend on writing into |*out| because this behaviour is - * likely to change in the future. On successful exit, |*inp| is advanced past - * the DER structure. It returns the result or NULL on error. + * |*out|. Note that, even if |*out| is already non-NULL on entry, it will not + * be written to. Rather, a fresh |EVP_PKEY| is allocated and the previous one + * is freed. On successful exit, |*inp| is advanced past the DER structure. It + * returns the result or NULL on error. * * This function tries to detect one of several formats. Instead, use * |EVP_parse_private_key| for a PrivateKeyInfo, |RSA_parse_private_key| for an |