Skip to content

Commit

Permalink
Merge pull request #6 from square/federman/fix_mac_canAccessKeychain
Browse files Browse the repository at this point in the history
Make canAccessKeychain not crash on Mac
  • Loading branch information
EricMuller22 committed Jun 5, 2015
2 parents 7e54005 + eb9f949 commit d713023
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Valet.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Valet'
s.version = '1.1.0'
s.version = '1.1.1'
s.license = 'Apache'
s.summary = 'Valet lets you securely store data in the iOS or OS X Keychain without knowing a thing about how the Keychain works. It\'s easy. We promise.'
s.homepage = 'https://github.com/square/Valet'
Expand Down
2 changes: 1 addition & 1 deletion Valet/VALValet.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ - (BOOL)canAccessKeychain;

NSMutableDictionary *query = [self.baseQuery mutableCopy];
[query addEntriesFromDictionary:[self _secItemFormatDictionaryWithKey:canaryKey]];
[query addEntriesFromDictionary:@{ (__bridge id)kSecValueData : canaryValue }];
[query addEntriesFromDictionary:@{ (__bridge id)kSecValueData : [canaryValue dataUsingEncoding:NSUTF8StringEncoding] }];

OSStatus status = VALAtomicSecItemAdd((__bridge CFDictionaryRef)query, NULL);
return (status != errSecInteractionNotAllowed && status != errSecNotAvailable);
Expand Down

0 comments on commit d713023

Please sign in to comment.