Revision: 18701
          http://sourceforge.net/p/edk2/code/18701
Author:   qlong
Date:     2015-10-29 14:16:30 +0000 (Thu, 29 Oct 2015)
Log Message:
-----------
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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <[email protected]>
Tested-by: Laszlo Ersek <[email protected]>
Reviewed-by: Qin Long <[email protected]>

Modified Paths:
--------------
    trunk/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h
    trunk/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c

Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h        
2015-10-29 14:16:22 UTC (rev 18700)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h        
2015-10-29 14:16:30 UTC (rev 18701)
@@ -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 @@
 
 #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.
 //

Modified: trunk/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c
===================================================================
--- trunk/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c      2015-10-29 
14:16:22 UTC (rev 18700)
+++ trunk/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c      2015-10-29 
14:16:30 UTC (rev 18701)
@@ -700,8 +700,8 @@
     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);


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to