aboutsummaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/asn1/x_pkey.c
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@ohtsu.org>2017-11-03 00:22:35 +0900
committerMyles Borins <mylesborins@google.com>2017-11-03 12:22:29 -0500
commite7fff9c4435f9f5ef8069217d2a0093c81a8c78b (patch)
tree45fbbf4aae64902b831501231d16b7a0af2aeb53 /deps/openssl/openssl/crypto/asn1/x_pkey.c
parent3d4d5e0c60f00693947c940b09249f3952bb0cdc (diff)
downloadandroid-node-v8-e7fff9c4435f9f5ef8069217d2a0093c81a8c78b.tar.gz
android-node-v8-e7fff9c4435f9f5ef8069217d2a0093c81a8c78b.tar.bz2
android-node-v8-e7fff9c4435f9f5ef8069217d2a0093c81a8c78b.zip
deps: upgrade openssl sources to 1.0.2m
This replaces all sources of openssl-1.0.2m.tar.gz into deps/openssl/openssl PR-URL: https://github.com/nodejs/node/pull/16691 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/openssl/openssl/crypto/asn1/x_pkey.c')
-rw-r--r--deps/openssl/openssl/crypto/asn1/x_pkey.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/deps/openssl/openssl/crypto/asn1/x_pkey.c b/deps/openssl/openssl/crypto/asn1/x_pkey.c
index 2da23e4756..59f8553928 100644
--- a/deps/openssl/openssl/crypto/asn1/x_pkey.c
+++ b/deps/openssl/openssl/crypto/asn1/x_pkey.c
@@ -106,10 +106,14 @@ X509_PKEY *X509_PKEY_new(void)
X509_PKEY *ret = NULL;
ASN1_CTX c;
- M_ASN1_New_Malloc(ret, X509_PKEY);
+ ret = OPENSSL_malloc(sizeof(X509_PKEY));
+ if (ret == NULL) {
+ c.line = __LINE__;
+ goto err;
+ }
ret->version = 0;
- M_ASN1_New(ret->enc_algor, X509_ALGOR_new);
- M_ASN1_New(ret->enc_pkey, M_ASN1_OCTET_STRING_new);
+ ret->enc_algor = X509_ALGOR_new();
+ ret->enc_pkey = M_ASN1_OCTET_STRING_new();
ret->dec_pkey = NULL;
ret->key_length = 0;
ret->key_data = NULL;
@@ -117,8 +121,15 @@ X509_PKEY *X509_PKEY_new(void)
ret->cipher.cipher = NULL;
memset(ret->cipher.iv, 0, EVP_MAX_IV_LENGTH);
ret->references = 1;
- return (ret);
- M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW);
+ if (ret->enc_algor == NULL || ret->enc_pkey == NULL) {
+ c.line = __LINE__;
+ goto err;
+ }
+ return ret;
+err:
+ X509_PKEY_free(ret);
+ ASN1_MAC_H_err(ASN1_F_X509_PKEY_NEW, ERR_R_MALLOC_FAILURE, c.line);
+ return NULL;
}
void X509_PKEY_free(X509_PKEY *x)