mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
CryptoPkg: Fix wrong logic in X509GetTBSCert
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4509 Both return 0x80 value and Asn1Tag != V_ASN1_SEQUENCE are wrong return. Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
This commit is contained in:
parent
90cb1ec332
commit
71606314f8
@ -839,7 +839,7 @@ X509GetTBSCert (
|
|||||||
Length = 0;
|
Length = 0;
|
||||||
Inf = ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)CertSize);
|
Inf = ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)CertSize);
|
||||||
|
|
||||||
if (((Inf & 0x80) == 0x80) && (Asn1Tag != V_ASN1_SEQUENCE)) {
|
if (((Inf & 0x80) == 0x80) || (Asn1Tag != V_ASN1_SEQUENCE)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -849,7 +849,7 @@ X509GetTBSCert (
|
|||||||
//
|
//
|
||||||
// Verify the parsed TBSCertificate is one correct SEQUENCE data.
|
// Verify the parsed TBSCertificate is one correct SEQUENCE data.
|
||||||
//
|
//
|
||||||
if (((Inf & 0x80) == 0x80) && (Asn1Tag != V_ASN1_SEQUENCE)) {
|
if (((Inf & 0x80) == 0x80) || (Asn1Tag != V_ASN1_SEQUENCE)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user