diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2015-12-29 03:12:37 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-12-29 03:12:37 +0000 |
commit | 5d2f923e1665842f3fdf1f3d4dbfb2596c0ca4a0 (patch) | |
tree | 9ec5f7b841db3f49dc0878c41e1f7c9bc3365a4e | |
parent | 5f297eae34598d1be5c3ca1383502f8733dc051e (diff) | |
download | edk2-platforms-5d2f923e1665842f3fdf1f3d4dbfb2596c0ca4a0.tar.xz |
CryptoPkg/BaseCryptLib: Use accessor functions for ASN1_OBJECT
OpenSSL 1.1 introduces new OBJ_get0_data() and OBJ_length() accessor
functions and makes ASN1_OBJECT an opaque type.
Unlike the accessors in previous commits which *did* actually exist
already but just weren't mandatory, these don't exist in older versions
of OpenSSL. So introduce macros which do the right thing, for
compatibility.
(Sync patch r18701 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19558 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h | 9 | ||||
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h b/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h index 35a8eb1cbc..0ce2591bb4 100644 --- a/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h +++ b/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h @@ -1,7 +1,7 @@ /** @file
Internal include file for BaseCryptLib.
-Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -23,6 +23,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "OpenSslSupport.h"
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#define OBJ_get0_data(o) ((o)->data)
+#define OBJ_length(o) ((o)->length)
+#endif
+
//
// Environment Setting for OpenSSL-based UEFI Crypto Library.
//
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c index f01bbb243b..efb40b8234 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c @@ -700,8 +700,8 @@ ImageTimestampVerify ( if (XaObj == NULL) {
continue;
}
- if ((XaObj->length != sizeof (mSpcRFC3161OidValue)) ||
- (CompareMem (XaObj->data, mSpcRFC3161OidValue, sizeof (mSpcRFC3161OidValue)) != 0)) {
+ if ((OBJ_length(XaObj) != sizeof (mSpcRFC3161OidValue)) ||
+ (CompareMem (OBJ_get0_data(XaObj), mSpcRFC3161OidValue, sizeof (mSpcRFC3161OidValue)) != 0)) {
continue;
}
Asn1Type = X509_ATTRIBUTE_get0_type(Xa, 0);
|