Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use string catalogs #33

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 0 additions & 241 deletions EstEIDToken/Localizable.xcstrings

This file was deleted.

16 changes: 1 addition & 15 deletions EstEIDToken/TokenSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ - (BOOL)tokenSession:(TKTokenSession *)session supportsOperation:(TKTokenOperati
switch (operation) {
case TKTokenOperationSignData:
supports = keyItem.canSign && (
[algorithm isAlgorithm:kSecKeyAlgorithmRSASignatureRaw] ||
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureRFC4754] ||
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureDigestX962] ||
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureDigestX962SHA1] ||
Expand All @@ -253,9 +252,6 @@ - (BOOL)tokenSession:(TKTokenSession *)session supportsOperation:(TKTokenOperati
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureDigestX962SHA384] ||
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureDigestX962SHA512]);
break;
case TKTokenOperationDecryptData:
//supports = keyItem.canDecrypt && [algorithm isAlgorithm:kSecKeyAlgorithmRSAEncryptionRaw]; // FIXME: implement decryption
break;
case TKTokenOperationPerformKeyExchange:
//supports = keyItem.canPerformKeyExchange && [algorithm isAlgorithm:kSecKeyAlgorithmECDHKeyExchangeStandard]; // FIXME: implement derive
break;
Expand Down Expand Up @@ -283,18 +279,8 @@ - (NSData *)tokenSession:(TKTokenSession *)session signData:(NSData *)dataToSign
return nil;
}

NSData *sign = dataToSign;
if ([algorithm isAlgorithm:kSecKeyAlgorithmRSASignatureRaw]) {
NSLog(@"TokenSession Remove PKCS1 1.5 padding");
// 00 01 FF FF 00 ....
const char *string = dataToSign.bytes;
char *e = strchr(&string[3], '\0'); // Start at pos 3
NSUInteger pos = (NSUInteger)(e - string) + 1;
sign = [dataToSign subdataWithRange:NSMakeRange(pos, dataToSign.length - pos)];
}

UInt16 sw = 0;
NSData *response = [self.smartCard sendIns:0x88 p1:0x00 p2:0x00 data:sign le:@0 sw:&sw error:error];
NSData *response = [self.smartCard sendIns:0x88 p1:0x00 p2:0x00 data:dataToSign le:@0 sw:&sw error:error];
// Deauth and release session
[self closeSession];
switch (sw)
Expand Down
12 changes: 12 additions & 0 deletions EstEIDToken/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Localizable.strings
CryptoTokenKit
*/

"AUTH_CERT" = "Certificate For Card Authentication";
"SIGN_CERT" = "Certificate For Digital Signature";
"AUTH_KEY" = "Key For Card Authentication";
"SIGN_KEY" = "Key For Digital Signature";
"WRONG_CONSTR" = "Unexpected constraint";
"ENTER_PINPAD" = "Please enter PIN code on PinPAD";
"INVALID_PIN" = "Invalid PIN entered";
27 changes: 27 additions & 0 deletions EstEIDToken/en.lproj/Localizable.stringsdict
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>VERIFY_TRY_LEFT</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%1$#@tries@</string>
<key>tries</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>zero</key>
<string>PIN locked.
Unblock to reuse PIN.</string>
<key>one</key>
<string>PIN Incorrect.
PIN will be locked next failed attempt.</string>
<key>other</key>
<string>PIN Incorrect.
%d tries left</string>
</dict>
</dict>
</dict>
</plist>
12 changes: 12 additions & 0 deletions EstEIDToken/et.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Localizable.strings
CryptoTokenKit
*/

"AUTH_CERT" = "Certificate For Card Authentication";
"SIGN_CERT" = "Certificate For Digital Signature";
"AUTH_KEY" = "Key For Card Authentication";
"SIGN_KEY" = "Key For Digital Signature";
"WRONG_CONSTR" = "Unexpected constraint";
"ENTER_PINPAD" = "Palun sisestada PIN kaardilugeja sõrmistikult";
"INVALID_PIN" = "Sisestati ebakorrektne PIN";
27 changes: 27 additions & 0 deletions EstEIDToken/et.lproj/Localizable.stringsdict
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>VERIFY_TRY_LEFT</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%1$#@tries@</string>
<key>tries</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>zero</key>
<string>PIN on lukus.
Tühista blokeering, et PIN-i taas kasutada.</string>
<key>one</key>
<string>Vale PIN.
Järgmise vale koodi sisestamisel PIN lukustub.</string>
<key>other</key>
<string>Vale PIN.
%d katset jäänud</string>
</dict>
</dict>
</dict>
</plist>
12 changes: 12 additions & 0 deletions EstEIDToken/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Localizable.strings
CryptoTokenKit
*/

"AUTH_CERT" = "Certificate For Card Authentication";
"SIGN_CERT" = "Certificate For Digital Signature";
"AUTH_KEY" = "Key For Card Authentication";
"SIGN_KEY" = "Key For Digital Signature";
"WRONG_CONSTR" = "Unexpected constraint";
"ENTER_PINPAD" = "Please enter PIN code on PinPAD";
"INVALID_PIN" = "Invalid PIN entered";
Loading