Giter Club home page Giter Club logo

uickeychainstore's People

Contributors

beepscore avatar bitdeli-chef avatar cderito avatar chikamim avatar chocochipset avatar coeur avatar danielphillips avatar gfx avatar hironytic avatar igrandav avatar jeffreyjackson avatar jegnux avatar jgiola avatar jverdi avatar karvelasx avatar kishikawakatsumi avatar mittsh avatar orthographic-pedant avatar sirnacnud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uickeychainstore's Issues

UICKeyChainStore doesn't work in iOS 8

Just tried with Xcode 6.0 and the iOS 8 preview SDK and SecItemCopyMatching() in setData:forKey:service:accessGroup returns -34018

Can you please have a look?

Thanks!

Missing ARC compatible

Do you have UICKeyChainStore with ARC compatible? That would be nice to have it.

Thanks!

-remove method(s) on OSX not working

Using any of the -remove methods on OSX seem to have /no/ effect.

Example code:

UICKeyChainStore *store = [UICKeyChainStore keychainStore];
[store removeAllItems];
[store synchronize];

After relaunching the application, key's still exist. Any ideas?..

OSX 10.9.5

Method accepting NSError** should have a non-void return value

The following methods all return analysis warnings 'Method accepting NSError** should have a non-void return value to indicate whether an error occurred'

- (void)setString:(NSString *)string forKey:(NSString *)key error:(NSError *__autoreleasing *)error;
- (void)setData:(NSData *)data forKey:(NSString *)key error:(NSError *__autoreleasing *)error;
- (void)removeItemForKey:(NSString *)key error:(NSError *__autoreleasing *)error;
- (void)removeAllItemsWithError:(NSError *__autoreleasing *)error;
- (void)synchronizeWithError:(NSError *__autoreleasing *)error;

Can not ger private RSA key

Sometimes I got:

Error getting RSA private key: Error Domain=com.kishikawakatsumi.uickeychainstore Code=-34018 "The operation couldn’t be completed. (com.kishikawakatsumi.uickeychainstore error -34018.)"

for this code:

NSError *error = nil;
NSData *key = [UICKeyChainStore dataForKey:self.privateKeyTag error:&error];
if (key == nil) {
    NSLog(@"Error getting RSA private key: %@", error);
    return nil;
}

remove keyChainStoreWithServer

Hi, i have used this function :

keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:myUrl] protocolType:UICKeyChainStoreProtocolTypeHTTPS];
keychain[user] = password;

how to remove next a user with his password ?
and how to remove all keyChainStoreWithServer ?

thanks

Configurable logging

I'm using this library in a banking app and it would be great if there was a way to turn of the NSLogs for release builds. Reasoning behind this is that we want to make sure that we don't log sensitive information.

dyld: Symbol not found: _kSecAttrAccessControl

kSecAttrAccessControl has been introduced in iOS8 but is used without any availability checks inUICKeyChainStore.m:1183.

This causes any pre iOS8 app to crash due to an unknown symbol.

XXX autoreleased with no pool in place - just leaking

I'm getting these errors while using UICKeyChainStore (btw, great little library; very nice to use).

objc[66000]: Object 0x6871fe0 of class NSPathStore2 autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[66000]: Object 0x6872200 of class NSPathStore2 autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[66000]: Object 0x6d5efc0 of class NSConcreteData autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[66000]: Object 0x6d5efc0 of class NSConcreteData autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[66000]: Object 0x6d5efc0 of class NSConcreteData autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug

These occur when I interact with the library inside of:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

At least some of the exceptions are raised inside of:

+ (void)initialize
{
    defaultService = [[NSBundle mainBundle] bundleIdentifier];
}

in UICKeyChainStore.m.

I'm not familiar enough with Objective C yet to know if the initialize can just be wrapped in an auto release pool and if there would be other side effects of that.

Crash when removing an item

My app hangs and eventually errors in

  • (BOOL)removeItemForKey:(NSString *)key error:(NSError *__autoreleasing *)error

crashing on this line
OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query);

EXE_BAD_ACCESS

BTW, I'm switching over to your framework from PDKeychainBindings as a test because I was getting a similar error there. I'm on ios10 and crashes on both simulator and device.

Feature Request: Add support for iCloud keychain?

Sent an e-mail on this, but in retrospect probably better to post this here.

I Believe in iOS7.01, Apple allowed us to store the keychain in iCloud if the user has it enabled. I think all you need to do is add kSecAttrSynchronizable in certain areas. Possible this could be added to this? (not comfortable with the keychain code, so don't feel comfortable making the addition as I'm not sure exactly where I should add it).

keychain access during lock screen

Hi There,

I've been using UICkeyChainStore for quite a while now, and find it really great.
However, I added a new feature to my app that allows connecting to devices in the background. When i try to access a password when the device is locked, UICKeyChainStore cannot retrieve the password due to some security settings.

I did some searching, and i found that i need to set the key kSecAttrAccessible to have value kSecAttrAccessibleAlways. However I'm not sure where to stick this in your library.

I tried putting it in the setData method with the other queries:
[query setObject:(__bridge id)kSecAttrAccessibleAlways forKey:(__bridge id)kSecAttrAccessible];

But I still couldn't get it to work.

Could you advise me how to properly set this attribute?

Thank you,

-Mark

Unable to access password (access-token) in another app

Unable to access password (access-token) in another app when second app is launched first time. Here is my flow:

  1. I install my App1 and login inside app. Add access-token for my service and i close this app.
  2. Then i install App2 and open the app. UICKeyChainStore return the access-token as NIL.

It only works when:
After installing App2 I open App1 again and close it then open App2. This time it return the access-token of my defined service.

Please let me know how to fix this? I only want to auto login in new apps when a previous app having same keychain access group and logged in.

iOS10 UICKeyChainStore is null

Hello, just spent a whole day trying to debug why keychain was null on my app on iOS10, and realised it has a simple 2 minute fix: change the library to the new version (I got the one from Example-iOS project). I hope this saves someones time in the future.

cant save numbers

when adding numbers like user id it will give
[__NSCFNumber dataUsingEncoding:]: unrecognized selector sent to instance 0xce7be90

sometime return nil

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:KKEYCHAINServiceName];
NSString *currentPassport = [keychain stringForKey:KOPENUDIDKEY];

sometime return nil and sometime return right value.

Unexpected crash

This line:

[UICKeyChainStore setData:self.state forKey:@"state"];

crashes if:
self.state == nil && [UICKeyChainStore dataForKey:@"state"] == nil
and works fine when:
self.state == nil && [UICKeyChainStore dataForKey:@"state"] != nil

So I need to wrap it like this myself:

if (self.state)
    [UICKeyChainStore setData:self.state forKey:@"state"];
else
    [UICKeyChainStore removeItemForKey:@"state"];

keychain returns nil

Hi, I got this weird problem, When i wanna retrieve from keychain it works fine, but just after that when i wanna do it again in another class i get nil.

this is how i call it:
keyChain = [UICKeyChainStore keyChainStoreWithService:@"myapp.Login"];

Touch ID Remove/Add does not trigger Authentication Dialog

When a Touch ID protected item is added after it has been removed, the authentication dialog does not display.

Following the instructions for Adding/Removal of a Touch ID protected item, should an Add operation always result in the system to display the authentication dialog?

I'm seeing that ordinarily, the system dialog will display. However, when an item is added after it has been removed, the authentication dialog does not display.

Specifically, I see the following when adding, reading, and removing an item:

  • Add, Read, Remove => OK -- dialog shows for the Add and the Read
  • Read, Add, Remove => OK -- dialog shows for the Read and the Add
  • Remove, Add => NG -- dialog not displayed for the Add
  • Remove, Add, Add => NG -- dialog is only displayed for the 2nd Add
  • Add, Add, Read => OK -- dialog is displayed for both Adds and the Read

So it would seem that the first Add following the Remove of an item is not resulting in the dialog being displayed. (The value is however being written even though the dialog is not displayed)

Tested on iPhone 6s 10.1.1 and iPhone 6 Plus 10.2 using version 2.1 (where all operations are using the same key @"kishikawakatsumi" and Adds are using the value @"01234567-89ab-cdef-0123-456789abcdef")

Its possible I'm doing something wrong in testing but I haven't been able to identify the cause yet so wanted to ask for clarification of expected behavior.

TouchID dialog everytime

Not sure if it's an issue or not, but I am getting the dialog for Touch ID on every save. Which is reasonable but I am saving more than one object in a single call which again requests the dialog twice.

Can it not display just the once per call?

v2.1 crash on ios7 iphone5c

Looking up address: 0x000000000007bdfb in .debug_info... found!

0x00185749: Compile Unit: length = 0x0000429b version = 0x0002 abbr_offset = 0x00000000 addr_size = 0x04 (next CU at 0x001899e8)

0x00185754: TAG_compile_unit [133] *
AT_producer( "Apple LLVM version 7.3.0 (clang-703.0.29)" )
AT_language( DW_LANG_ObjC )
AT_name( "/Users/zhuguangwen/Work/IOS/SnakeGameSingle/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.m" )
AT_stmt_list( 0x0004e2e4 )
AT_comp_dir( "/Users/zhuguangwen/Work/IOS/SnakeGameSingle/Pods" )
AT_APPLE_optimized( 0x01 )
AT_APPLE_major_runtime_vers( 0x02 )
AT_low_pc( 0x00077780 )
AT_high_pc( 0x0007c9f4 )

0x00188ea9: TAG_subprogram [212] *
AT_low_pc( 0x0007bdc0 )
AT_high_pc( 0x0007c190 )
AT_frame_base( r7 )
AT_object_pointer( {0x00188ec7} )
AT_name( "-[UICKeyChainStore attributesWithKey:value:error:]" )
AT_decl_file( "/Users/zhuguangwen/Work/IOS/SnakeGameSingle/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.m" )
AT_decl_line( 1155 )
AT_prototyped( 0x01 )
AT_type( {0x00189535} ( NSMutableDictionary* ) )
AT_APPLE_optimized( 0x01 )
AT_APPLE_isa( 0x01 )
Line table dir : '/Users/zhuguangwen/Work/IOS/SnakeGameSingle/Pods/UICKeyChainStore/Lib/UICKeyChainStore'
Line table file: 'UICKeyChainStore.m' line 1160, column 20 with start address 0x000000000007bdf8

Looking up address: 0x000000000007bdfb in .debug_frame... found!

0x0000d090: FDE
length: 0x0000000c
CIE_pointer: 0x00000000
start_addr: 0x0007bdc0 -[UICKeyChainStore attributesWithKey:value:error:]
range_size: 0x000003d0 (end_addr = 0x0007c190)
Instructions: 0x0007bdc0: CFA=sp

Please update to swift

I need the wrapper in swift. Although I can use objective-c file in swift project, I want to make it in complete swift.

2.0.0 no longer compatible with ios < 7

Even though webpage and cocoapods claim compatibility with ios 4.3 and later, the use of kSecAttrSynchronizable in UIKeychainStore.m means that it's only compatible with ios 7 and later, as that constant is not available before.

Great project though - thank you!

NSUbiquitousKeyValueStore error: no valid com.apple.developer.ubiquity-kvstore-identifier entitlement

Hi,

At startup, I have this "error":

NSUbiquitousKeyValueStore error:  no valid com.apple.developer.ubiquity-kvstore-identifier entitlement

I don't wanna enable the iCloud entitlement because it's an In-House distributed one, and also for privacy reason, required by my client ;-)
I would like to know if I can safely ignore that error... Or is there a way to disable the iCloud Keychain feature in UICKeyChainStore ?

Note: I am using your project because it is a FCUUID's dependency.

Accessing "Cancel" on touch ID request

When I display the Touch ID prompt if the user taps cancel, it continues running the code. Is their any blocks or delegates to check when a user taps cancel?

        // Post the Touch ID dialog
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
            [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly
                  authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence];
            keychain.authenticationPrompt = [NSString stringWithFormat:@"%@ %@ %@", user.title, user.firstName, user.lastName];

            [self login];
        });

App Store

Hi!
First of all, thank you!
I'm using your classes in my proyect, but i have a question!

Is there any problem submitting my app to the appstore if I use your classes?

I mean, I want to know if my app could be rejected by apple if I use the UICKeyChainStore
class.

I just want to be sure of it!

Thank you!!

Crash in SecItmeCopyMatching in v 1.1.0

I'm currently using v.1.1.0. I get a crash every once in a while from the wild that has this stack trace:

0   
libdispatch.dylib 0x3504d158 _dispatch_queue_wakeup_with_qos_slow + 328
1   
libdispatch.dylib 0x35050f55 _dispatch_mach_msg_send + 1054
2   
libdispatch.dylib 0x35047293 dispatch_mach_send + 296
3   
libxpc.dylib 0x351be867 _xpc_connection_send_message_with_reply_f + 96
4   
libxpc.dylib 0x351be7af xpc_connection_send_message_with_reply_sync + 140
5   
Security 0x2a2ae01d securityd_message_with_reply_sync + 70
6   
Security 0x2a2ae1d1 securityd_send_sync_and_do + 46
7   
Security 0x2a2bb197 __SecItemCopyMatching_block_invoke + 168
8   
Security 0x2a2ba439 SecOSStatusWith + 14
9   
Security 0x2a2bb0b3 SecItemCopyMatching + 176
10  
MStarGame 0x00ee0afd +[UICKeyChainStore dataForKey:service:accessGroup:error:] (UICKeyChainStore.mm:200)
11  
MStarGame 0x00ee1207 -[UICKeyChainStore dataForKey:error:] (UICKeyChainStore.mm:376)
12  
MStarGame 0x00ee104f -[UICKeyChainStore stringForKey:error:] (UICKeyChainStore.mm:337)

Since I can't reproduce this crash locally, I'm curious to know if you think updating to the latest version might fix this crash. I don't know what the data being passed in is. My crash reporting software says the application was resigning active when it crashed. BTW, this is an iOS app.

Thanks!

Cannot get keychain sharing betwen Mac app and iOS app to work

I have enabled keychain sharing in Xcode for both projects (Mac and iOS apps) using the same "Keychain groups" string.

I try to access a keychain item that I write in my iOS app from within my Mac app.

Writing:

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"SendSecretToMac"];
                                                                keychain.synchronizable = YES;
                                                                keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef";

Reading:

UICKeyChainStore *keychain2 = [UICKeyChainStore keyChainStoreWithService:@"SendSecretToMac"];
keychain2.synchronizable = YES;
NSString *secret = keychain2[@"kishikawakatsumi"];

However, the string "secret" is always nil. What can I do about this?

2.0.4 compatibility issue with iOS7

I'm starting out with AWS and following their getting started guide. The 'AWSCore' pod pulls in UICKeyChainStore pod with a 2.0.0 dependency, but I'm seeing some compile time issues in the .h and .m, for example:

__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0);

typedef NS_ENUM(NSInteger, UICKeyChainStoreAuthenticationPolicy) {
UICKeyChainStoreAuthenticationPolicyUserPresence = kSecAccessControlUserPresence,
};
gives a 'use of undeclared identifier kSecAccessControlUserPresence'

I'm also seeing many lines with:

__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);

and from what I can tell the error is something to do with 8_0 because changing that to 7_0 seems to 'hide' the problem.

I'm using XCode 5.1.1 (base SDK 7.1) and OSX 10.8.5

OSStatus error: [-25243] Security error has occurred.

I am trying to write to the keychain in iOS with accessGroup while testing on my device, I am getting the error OSStatus error: [-25243] Security error has occurred.

UICKeyChainStore *store = [UICKeyChainStore keyChainStoreWithService:@"xspyhack" accessGroup:@"39V4U5AVXX.com.company.xxx"];
 store[@"Host"] = @"text"

Crash on iOS 5.1.1

On iOS 5.1.1, when i try to store a key/value into the keychain it crashes (on latest commit 75187b5)

  • thread #1: tid = 0x1c03, 0x000e5444 AppName`-[UICKeyChainStore attributesWithKey:value:error:](self=0x00659520, _cmd=0x0020cb2b, key=0x00235cbc, value=0x006f9570, error=0x2fe32644) + 1268 at UICKeyChainStore.m:1205, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    • frame #0: 0x000e5444 AppName-[UICKeyChainStore attributesWithKey:value:error:](self=0x00659520, _cmd=0x0020cb2b, key=0x00235cbc, value=0x006f9570, error=0x2fe32644) + 1268 at UICKeyChainStore.m:1205 frame #1: 0x000e1894 AppName-[UICKeyChainStore setData:forKey:genericAttribute:label:comment:error:](self=0x00659520, _cmd=0x0020cac8, data=0x006f9570, key=0x00235cbc, genericAttribute=0x00000000, label=0x00000000, comment=0x00000000, error=0x00000000) + 1620 at UICKeyChainStore.m:578
      frame #2: 0x000e0c2a AppName-[UICKeyChainStore setString:forKey:genericAttribute:label:comment:error:](self=0x00659520, _cmd=0x0020ca79, string=0x0069e430, key=0x00235cbc, genericAttribute=0x00000000, label=0x00000000, comment=0x00000000, error=0x00000000) + 218 at UICKeyChainStore.m:432 frame #3: 0x000e094a AppName-[UICKeyChainStore setString:forKey:](self=0x00659520, _cmd=0x3800b699, string=0x0069e430, key=0x00235cbc) + 70 at UICKeyChainStore.m:397

broken on iOS8

Saving/retrieving values no longer works on iOS8. Haven't debugged yet.

screenshot 2014-06-06 09 19 54

Requested key from UICKeyChainStore is nil in app extension

I'm using an embedded framework to share code with my main app and app extension. In the main app I use UICKeyChainStore to set a key and it successfully returns The key when requested but in my extension when I request the key it always returns nil. What could cause this behaviour?

Documentation error

The README doc says:

UICKeyChainStore *store = [UICKeyChainStore keyChain];

However, that class method does not exists.

I think it should be:

UICKeyChainStore *store = [UICKeyChainStore keyChainStore ];

Memory Leak

There is a memory leak on initWithService:

OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result);

analyze warning

UICKeyChainStore.m:201:2: Value argument to 'setObject:forKey:' cannot be nil

anyone can help me

        UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"xh.english.brush"
                                                                    accessGroup:@"test.hello"];

        keychain[@"user_name"]    = loginView.userNameField.text;
        keychain[@"pass_word"]    = @"123456";
        keychain[@"downDataFlag"] = [returnValue.D ObjectForKey:@"downDataFlag"];
        keychain[@"usFlag"]       = [returnValue.D ObjectForKey:@"usFlag"];
        keychain[@"usGroupid"]    = [returnValue.D ObjectForKey:@"usGroupid"];
        keychain[@"usId"]         = [returnValue.D ObjectForKey:@"usId"];
        keychain[@"usName"]       = [returnValue.D ObjectForKey:@"usName"];
        keychain[@"usSessionId"]  = [returnValue.D ObjectForKey:@"usSessionId"];
        keychain[@"usType"]       = [returnValue.D ObjectForKey:@"usType"];
        keychain[@"usUid"]        = [returnValue.D ObjectForKey:@"usUid"];

        NSLog(@"keychainpass_word=%@",keychain[@"pass_word"]);

keychainpass_word is nil

Build error when using CocoaPods

When I add the new 2.0.0 release to my Podfile and update then I get a error when building:
Cat: /Users/Username/Desktop/AppName/pods/buildheaders/UICKeyChainStore/UICKeyChainStore.h: No such file or directory

iOS10 issues

Are there any reported issues with new release of XCode8, iOS10 and UICKeyChainStore?

My code runs normally with XCode7.3.1 but on XCode8Beta it started breaking. UICKeychainStore doesn't seem to return anything.

I used UICKeyChainStore 1.0.5 and then 2.1.0 but it didn't help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.