Created
December 4, 2018 00:51
-
-
Save fishsoupisgood/52b1c9724a97ad8ded1c4cf770374266 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- libglobalplatform6-6.0.0.orig/src/globalplatform.c | |
+++ libglobalplatform6-6.0.0/src/globalplatform.c | |
@@ -1304,10 +1304,36 @@ OPGP_ERROR_STATUS GP211_get_secure_chann | |
TLV tlv1, tlv2, _73tlv; | |
OPGP_LOG_START(_T("GP211_get_secure_channel_protocol_details")); | |
+#if 0 | |
status = GP211_get_data(cardContext, cardInfo, NULL, (PBYTE)GP211_GET_DATA_CARD_DATA, recvBuffer, &recvBufferLength); | |
if (OPGP_ERROR_CHECK(status)) { | |
goto end; | |
} | |
+#else | |
+ { | |
+ static unsigned char * protocol_details; | |
+ static size_t protocol_details_len; | |
+ | |
+ if (protocol_details_len) { | |
+ recvBufferLength = protocol_details_len; | |
+ memcpy(recvBuffer, protocol_details, protocol_details_len); | |
+ } else { | |
+ status = GP211_get_data(cardContext, cardInfo, NULL, (PBYTE)GP211_GET_DATA_CARD_DATA, recvBuffer, &recvBufferLength); | |
+ if (OPGP_ERROR_CHECK(status)) { | |
+ goto end; | |
+ } | |
+ | |
+ protocol_details = malloc(recvBufferLength); | |
+ | |
+ if ( protocol_details) { | |
+ protocol_details_len = recvBufferLength; | |
+ memcpy(protocol_details, recvBuffer, protocol_details_len); | |
+ } | |
+ } | |
+ | |
+ } | |
+#endif | |
+ | |
// read outer tag, should be one 0x66 | |
result = read_TLV(recvBuffer, recvBufferLength, &tlv1); | |
if (result == -1) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment