summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2020-06-03 04:00:09 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2020-06-03 06:52:25 -0500
commit3f6bef6371b2e286471e2ada6048c6e5670fef53 (patch)
tree355a30f1afbf92b58591e5cc1ca40e70802cf788
parent9931a73e962fe468f83dc50897a54f3ccff4c0a9 (diff)
downloadtdelibs-3f6bef6371b2e286471e2ada6048c6e5670fef53.tar.gz
tdelibs-3f6bef6371b2e286471e2ada6048c6e5670fef53.zip
Update for OpenSSL >= 1.1.0
Signed-off-by: Timothy Pearson <kb9vqf@pearsoncomputing.net>
-rw-r--r--CMakeLists.txt5
-rw-r--r--tdecore/tdehw/tdecryptographiccarddevice.cpp6
2 files changed, 5 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91cf38c55..fb0b1617b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -732,11 +732,8 @@ if( WITH_PKCS )
tde_message_fatal( "PKCS is requested, but no OpenSC PKCS11 provider was found on your system" )
endif( NOT OPENSC_PKCS11_PROVIDER_FOUND )
pkg_search_module( SSL openssl )
- if( NOT SSL_FOUND OR SSL_VERSION VERSION_LESS "1.1" )
+ if( SSL_FOUND )
set( HAVE_PKCS 1 )
- else( )
- set( WITH_PKCS OFF CACHE INTERNAL "PKCS support is not ready for OpenSSL >= 1.1" FORCE )
- message( WARNING "\nPKCS support is not ready for OpenSSL >= 1.1" )
endif( )
endif( )
diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp
index 808b54000..1b8f9c4a6 100644
--- a/tdecore/tdehw/tdecryptographiccarddevice.cpp
+++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp
@@ -643,9 +643,10 @@ TQString TDECryptographicCardDevice::autoPIN() {
int asn1SeqValueObjectTag;
int asn1SeqValueObjectClass;
int returnCode;
+ const uint8_t* asnSeqValueString = ASN1_STRING_get0_data(asnValue->value.sequence);
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);
if (asnSeqValue) {
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 == (V_ASN1_CONSTRUCTED + index)) {
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);
}
}
}