Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

removeObjectForKey: gives "Could not store(Delete) string. Error was:-25300" #26

@evgeniyd

Description

@evgeniyd

Calling

[[PDKeychainBindings sharedKeychainBindings] removeObjectForKey:@"myKey"];

returns

Could not store(Delete) string. Error was:-25300

While investigating it, I've found that this is a custom NSLog string, logged when the following operation fails:

OSStatus result=SecItemDelete((__bridge CFDictionaryRef)spec);
if (result!=0) {
    NSLog(@"Could not store(Delete) string. Error was:%i",(int)result);
}

The error code from OSStatus enum declared in <Security/SecBase.h>has this description:

errSecItemNotFound = -25300,  /* The specified item could not be found in the keychain. */

...which points out, that it's just the value being not found for respective key upon deleting.

Question

I wonder, what option here would be more preferable?

  1. I have to check for key existence, before attempting to delete it?
  2. The PDKeychainBindingsController has to have a fix to check the key, before deleting
  3. The PDKeychainBindingsController has to have a fix to make error codes processing and logging more accurate
  4. Ignore everything here (which was the way, it worked before this bug report was submitted)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions