kaoh / globalplatform

C library + command-line for Open- / GlobalPlatform smart cards
https://kaoh.github.io/globalplatform/
Other
72 stars 30 forks source link

fix key data for put key for AES key type #74

Closed yp25 closed 1 year ago

yp25 commented 1 year ago

please modify line 1427 --> || keyType == GP211_KEY_TYPE_AES

if (encrypted_key_length != keyDataLength || secInfo->secureChannelProtocol == GP211_SCP03 || keyType == GP211_KEY_TYPE_AES) {
            // + 1 byte key component length field
            keyDataField[i++] = encrypted_key_length + 1;
            keyDataField[i++] = keyDataLength;
        }