|
|
@ -643,9 +643,10 @@ TQString TDECryptographicCardDevice::autoPIN() {
|
|
|
|
int asn1SeqValueObjectTag;
|
|
|
|
int asn1SeqValueObjectTag;
|
|
|
|
int asn1SeqValueObjectClass;
|
|
|
|
int asn1SeqValueObjectClass;
|
|
|
|
int returnCode;
|
|
|
|
int returnCode;
|
|
|
|
|
|
|
|
const uint8_t* asnSeqValueString = ASN1_STRING_get0_data(asnValue->value.sequence);
|
|
|
|
|
|
|
|
|
|
|
|
index = 0; // Search for the PIN field
|
|
|
|
index = 0; // Search for the PIN field
|
|
|
|
asnSeqValueStack = ASN1_seq_unpack_ASN1_TYPE(ASN1_STRING_data(asnValue->value.sequence), ASN1_STRING_length(asnValue->value.sequence), d2i_ASN1_TYPE, ASN1_TYPE_free);
|
|
|
|
asnSeqValueStack = d2i_ASN1_SEQUENCE_ANY(NULL, &asnSeqValueString, ASN1_STRING_length(asnValue->value.sequence));
|
|
|
|
asnSeqValue = sk_ASN1_TYPE_value(asnSeqValueStack, index);
|
|
|
|
asnSeqValue = sk_ASN1_TYPE_value(asnSeqValueStack, index);
|
|
|
|
if (asnSeqValue) {
|
|
|
|
if (asnSeqValue) {
|
|
|
|
if (asnSeqValue->value.octet_string->data[0] == ((V_ASN1_CONSTRUCTED | V_ASN1_CONTEXT_SPECIFIC) + index)) {
|
|
|
|
if (asnSeqValue->value.octet_string->data[0] == ((V_ASN1_CONSTRUCTED | V_ASN1_CONTEXT_SPECIFIC) + index)) {
|
|
|
@ -654,12 +655,13 @@ TQString TDECryptographicCardDevice::autoPIN() {
|
|
|
|
if (!(returnCode & 0x80)) {
|
|
|
|
if (!(returnCode & 0x80)) {
|
|
|
|
if (returnCode == (V_ASN1_CONSTRUCTED + index)) {
|
|
|
|
if (returnCode == (V_ASN1_CONSTRUCTED + index)) {
|
|
|
|
if (d2i_ASN1_GENERALSTRING(&asnGeneralString, &asn1SeqValueObjectData, asn1SeqValueObjectLength) != NULL) {
|
|
|
|
if (d2i_ASN1_GENERALSTRING(&asnGeneralString, &asn1SeqValueObjectData, asn1SeqValueObjectLength) != NULL) {
|
|
|
|
retString = TQString((const char *)ASN1_STRING_data(asnGeneralString));
|
|
|
|
retString = TQString((const char *)ASN1_STRING_get0_data(asnGeneralString));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sk_ASN1_TYPE_pop_free(asnSeqValueStack, ASN1_TYPE_free);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|