Added some changes to fix some issues causing a stackoverflow

This commit is contained in:
Cyrus 2024-01-12 14:42:14 -05:00
parent f7103517d2
commit 577f3c7035

View File

@ -353,21 +353,21 @@ public class EndorsementCredential extends DeviceAssociatedCertificate {
obj = (ASN1TaggedObject) seq.getObjectAt(i);
tag = obj.getTagNo();
if (tag == EK_TYPE_TAG) {
int ekGenTypeVal = ((ASN1Enumerated) obj.getBaseUniversal(true, tag)).getValue().intValue();
int ekGenTypeVal = ((ASN1Enumerated) obj.getBaseObject()).getValue().intValue();
if (ekGenTypeVal >= EK_TYPE_VAL_MIN && ekGenTypeVal <= EK_TYPE_VAL_MAX) {
TPMSecurityAssertions.EkGenerationType ekGenType
= TPMSecurityAssertions.EkGenerationType.values()[ekGenTypeVal];
tpmSecurityAssertions.setEkGenType(ekGenType);
}
} else if (tag == EK_LOC_TAG) {
int ekGenLocVal = ((ASN1Enumerated) obj.getBaseUniversal(true, tag)).getValue().intValue();
int ekGenLocVal = ((ASN1Enumerated) obj.getBaseObject()).getValue().intValue();
if (ekGenLocVal >= EK_LOC_VAL_MIN && ekGenLocVal <= EK_LOC_VAL_MAX) {
TPMSecurityAssertions.EkGenerationLocation ekGenLocation
= TPMSecurityAssertions.EkGenerationLocation.values()[ekGenLocVal];
tpmSecurityAssertions.setEkGenerationLocation(ekGenLocation);
}
} else if (tag == EK_CERT_LOC_TAG) {
int ekCertGenLocVal = ((ASN1Enumerated) obj.getBaseUniversal(true, tag))
int ekCertGenLocVal = ((ASN1Enumerated) obj.getBaseObject())
.getValue().intValue();
if (ekCertGenLocVal >= EK_LOC_VAL_MIN
&& ekCertGenLocVal <= EK_LOC_VAL_MAX) {