Skip to content

Commit

Permalink
IOS-8883: Add support for TLV value masking
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Fedorov <[email protected]>
  • Loading branch information
Andrey Fedorov committed Dec 27, 2024
1 parent f09ed00 commit 21db363
Showing 1 changed file with 118 additions and 0 deletions.
118 changes: 118 additions & 0 deletions TangemSdk/TangemSdk/Common/TLV/TlvTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,122 @@ public enum TlvTag: Byte {
return .data
}
}

var shouldMask: Bool {
switch self {
case .pin,
.pin2,
.newPin,
.newPin2,
.newPin3,
.walletPublicKey,
.walletPrivateKey:
return true
case .unknown,
.cardId,
.pin,
.pin2,
.transactionOutHash,
.transactionOutHashSize,
.walletSignature,
.walletRemainingSignatures,
.walletSignedHashes,
.pause,
.flash,
.issuerTxSignature,
.status,
.cardPublicKey,
.cardSignature,
.curveId,
.hashAlgId,
.signingMethod,
.maxSignatures,
.pauseBeforePin2,
.settingsMask,
.userSettingsMask,
.cardData,
.ndefData,
.createWalletAtPersonalize,
.health,
.crExKey,
.publicKeyChallenge,
.publicKeySalt,
.challenge,
.salt,
.validationCounter,
.cvc,
.sessionKeyA,
.sessionKeyB,
.uid,
.manufacturerName,
.manufacturerSignature,
.issuerPublicKey,
.issuerTransactionPublicKey,
.issuerData,
.issuerDataSignature,
.issuerDataCounter,
.isActivated,
.activationSeed,
.paymentFlowVersion,
.userData,
.userProtectedData,
.userCounter,
.userProtectedCounter,
.resetPin,
.codePageAddress,
.codePageCount,
.codeHash,
.trOutRaw,
.firmwareVersion,
.batchId,
.manufactureDateTime,
.issuerName,
.blockchainName,
.manufacturerPublicKey,
.cardIDManufacturerSignature,
.tokenSymbol,
.tokenContractAddress,
.tokenDecimal,
.tokenName,
.denomination,
.validatedBalance,
.lastSignDate,
.denominationText,
.checkWalletCounter,
.productMask,
.isLinked,
.terminalPublicKey,
.terminalTransactionSignature,
.legacyMode,
.interactionMode,
.offset,
.size,
.acquirerPublicKey,
.pin2IsDefault,
.pinIsDefault,
.walletIndex,
.walletsCount,
.walletData,
.cardWallet,
.fileIndex,
.fileSettings,
.fileTypeName,
.fileData,
.fileSignature,
.fileCounter,
.fileOwnerIndex,
.walletHDPath,
.walletHDChain,
.certificate,
.backupStatus,
.backupCount,
.primaryCardLinkingKey,
.backupCardLinkingKey,
.backupCardLink,
.backupAttestSignature,
.backupCardPublicKey,
.proof:
return false
}
}
}

0 comments on commit 21db363

Please sign in to comment.