Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
CrptoPkg/BaseCryptLib: Fix type mismatch when calling OpenSSL function
Browse files Browse the repository at this point in the history
Type definition in UEFI & OpeenSSL is different. Sometime it could cause
write overflow. Should use same data type when accessing the same region

Cc: Long Qin <[email protected]>
Cc: Chen Chen <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chao Zhang <[email protected]>
Reviewed-by: Long Qin <[email protected]>
  • Loading branch information
zhangchaointel committed Jan 15, 2018
1 parent 57d1afc commit 2067d9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ X509GetTBSCert (
)
{
CONST UINT8 *Temp;
INTN Asn1Tag;
INTN ObjClass;
UINT32 Asn1Tag;
UINT32 ObjClass;
UINTN Length;

//
Expand Down Expand Up @@ -673,7 +673,8 @@ X509GetTBSCert (
// So we can just ASN1-parse the x.509 DER-encoded data. If we strip
// the first SEQUENCE, the second SEQUENCE is the TBSCertificate.
//
Temp = Cert;
Temp = Cert;
Length = 0;
ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)CertSize);

if (Asn1Tag != V_ASN1_SEQUENCE) {
Expand Down

0 comments on commit 2067d9f

Please sign in to comment.