summaryrefslogtreecommitdiffstats
path: root/freebsd/crypto/openssl/crypto/asn1/d2i_pu.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/crypto/openssl/crypto/asn1/d2i_pu.c')
-rw-r--r--freebsd/crypto/openssl/crypto/asn1/d2i_pu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/freebsd/crypto/openssl/crypto/asn1/d2i_pu.c b/freebsd/crypto/openssl/crypto/asn1/d2i_pu.c
index 9f0e572a..9dd61980 100644
--- a/freebsd/crypto/openssl/crypto/asn1/d2i_pu.c
+++ b/freebsd/crypto/openssl/crypto/asn1/d2i_pu.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -34,7 +34,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
} else
ret = *a;
- if (!EVP_PKEY_set_type(ret, type)) {
+ if (type != EVP_PKEY_id(ret) && !EVP_PKEY_set_type(ret, type)) {
ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_EVP_LIB);
goto err;
}