From f3653b08a475372a0849cd9a3387a5997ce121c9 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 12 May 2015 13:51:02 -0400 Subject: Update Cryptlib and openssl Update Cryptlib to r16559 and openssl to 0.9.8zf Signed-off-by: Gary Ching-Pang Lin --- Cryptlib/Pk/CryptAuthenticode.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Cryptlib/Pk/CryptAuthenticode.c') diff --git a/Cryptlib/Pk/CryptAuthenticode.c b/Cryptlib/Pk/CryptAuthenticode.c index 7b8bca53..4ce2b06b 100644 --- a/Cryptlib/Pk/CryptAuthenticode.c +++ b/Cryptlib/Pk/CryptAuthenticode.c @@ -9,7 +9,7 @@ AuthenticodeVerify() will get PE/COFF Authenticode and will do basic check for data structure. -Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
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 @@ -123,7 +123,7 @@ AuthenticodeVerify ( // Un-matched SPC_INDIRECT_DATA_OBJID. // goto _Exit; - } + } SpcIndirectDataContent = (UINT8 *)(Pkcs7->d.sign->contents->d.other->value.asn1_string->data); @@ -135,16 +135,27 @@ AuthenticodeVerify ( if ((Asn1Byte & 0x80) == 0) { // - // Short Form of Length Encoding + // Short Form of Length Encoding (Length < 128) // ContentSize = (UINTN) (Asn1Byte & 0x7F); // // Skip the SEQUENCE Tag; // SpcIndirectDataContent += 2; + + } else if ((Asn1Byte & 0x81) == 0x81) { + // + // Long Form of Length Encoding (128 <= Length < 255, Single Octet) + // + ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2)); + // + // Skip the SEQUENCE Tag; + // + SpcIndirectDataContent += 3; + } else if ((Asn1Byte & 0x82) == 0x82) { // - // Long Form of Length Encoding, only support two bytes. + // Long Form of Length Encoding (Length > 255, Two Octet) // ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2)); ContentSize = (ContentSize << 8) + (UINTN)(*(UINT8 *)(SpcIndirectDataContent + 3)); @@ -152,6 +163,7 @@ AuthenticodeVerify ( // Skip the SEQUENCE Tag; // SpcIndirectDataContent += 4; + } else { goto _Exit; } -- cgit v1.2.3