Skip to content

Commit

Permalink
RSA support is by default now enabled (#15)
Browse files Browse the repository at this point in the history
IB-5479

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored and iannaska committed Sep 18, 2018
1 parent 8f36515 commit b73443c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
7 changes: 0 additions & 7 deletions EstEIDToken/Token.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ - (BOOL)populateIdentity:(NSMutableArray<TKTokenKeychainItem *> *)items smartcar
}
[keyItem setName:keyName];

#if ENABLE_RSA == 0
if ([keyItem.keyType isEqual:(id)kSecAttrKeyTypeRSA]) {
NSLog(@"EstEIDToken populateIdentityFromSmartCard: RSA support is disabled");
return NO;
}
#endif

keyItem.canSign = YES;
keyItem.canDecrypt = NO; //auth; FIXME: implement decryption
keyItem.suitableForLogin = NO; //auth; FIXME: implement login
Expand Down
4 changes: 0 additions & 4 deletions EstEIDToken/TokenSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ - (BOOL)tokenSession:(TKTokenSession *)session supportsOperation:(TKTokenOperati
switch (operation) {
case TKTokenOperationSignData:
supports = keyItem.canSign && (
#if ENABLE_RSA
[algorithm isAlgorithm:kSecKeyAlgorithmRSASignatureRaw] ||
#endif
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureRFC4754] ||
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureDigestX962] ||
[algorithm isAlgorithm:kSecKeyAlgorithmECDSASignatureDigestX962SHA1] ||
Expand Down Expand Up @@ -223,7 +221,6 @@ - (NSData *)tokenSession:(TKTokenSession *)session signData:(NSData *)dataToSign
}

NSData *sign = dataToSign;
#if ENABLE_RSA
if ([algorithm isAlgorithm:kSecKeyAlgorithmRSASignatureRaw]) {
NSLog(@"EstEIDToken Remove PKCS1 1.5 padding");
// 00 01 FF FF 00 ....
Expand All @@ -232,7 +229,6 @@ - (NSData *)tokenSession:(TKTokenSession *)session signData:(NSData *)dataToSign
NSUInteger pos = (NSUInteger)(e - string) + 1;
sign = [dataToSign subdataWithRange:NSMakeRange(pos, dataToSign.length - pos)];
}
#endif

NSData *response = [self.smartCard sendIns:0x88 p1:0x00 p2:0x00 data:sign le:@0 sw:&sw error:error];
// Deauth and release session
Expand Down
10 changes: 0 additions & 10 deletions EstEIDTokenApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,6 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = EstEIDToken/EstEIDToken.entitlements;
COMBINE_HIDPI_IMAGES = YES;
ENABLE_RSA = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"ENABLE_RSA=$(ENABLE_RSA)",
);
INFOPLIST_FILE = EstEIDToken/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -623,11 +618,6 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = EstEIDToken/EstEIDToken.entitlements;
COMBINE_HIDPI_IMAGES = YES;
ENABLE_RSA = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"ENABLE_RSA=$(ENABLE_RSA)",
);
INFOPLIST_FILE = EstEIDToken/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down

0 comments on commit b73443c

Please sign in to comment.