CrptoPkg/BaseCryptLib: Fix type mismatch when calling OpenSSL function
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 <qin.long@intel.com> Cc: Chen Chen <chen.a.chen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
This commit is contained in:
		| @@ -644,8 +644,8 @@ X509GetTBSCert ( | ||||
|   ) | ||||
| { | ||||
|   CONST UINT8  *Temp; | ||||
|   INTN         Asn1Tag; | ||||
|   INTN         ObjClass; | ||||
|   UINT32       Asn1Tag; | ||||
|   UINT32       ObjClass; | ||||
|   UINTN        Length; | ||||
|  | ||||
|   // | ||||
| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user