MYKeychainItem.m
changeset 14 3af1d1c0ceb5
parent 13 6fd9177eb6da
child 23 39fec79de6e8
     1.1 --- a/MYKeychainItem.m	Sun Apr 19 00:01:41 2009 -0700
     1.2 +++ b/MYKeychainItem.m	Sun Apr 19 21:19:35 2009 -0700
     1.3 @@ -97,8 +97,10 @@
     1.4      err = SecItemDelete(self.asQuery);
     1.5  #else
     1.6      err = SecKeychainItemDelete((SecKeychainItemRef)_itemRef);
     1.7 +    if (err==errSecInvalidItemRef)
     1.8 +        return YES;     // result for an item that's not in a keychain
     1.9  #endif
    1.10 -    return err==errSecItemNotFound || err==errSecInvalidItemRef || check(err, @"SecKeychainItemDelete");
    1.11 +    return err==errSecItemNotFound || check(err, @"SecKeychainItemDelete");
    1.12  }
    1.13  
    1.14  
    1.15 @@ -225,3 +227,27 @@
    1.16          return YES;
    1.17  }
    1.18  #endif
    1.19 +
    1.20 +
    1.21 +
    1.22 +/*
    1.23 + Copyright (c) 2009, Jens Alfke <jens@mooseyard.com>. All rights reserved.
    1.24 + 
    1.25 + Redistribution and use in source and binary forms, with or without modification, are permitted
    1.26 + provided that the following conditions are met:
    1.27 + 
    1.28 + * Redistributions of source code must retain the above copyright notice, this list of conditions
    1.29 + and the following disclaimer.
    1.30 + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
    1.31 + and the following disclaimer in the documentation and/or other materials provided with the
    1.32 + distribution.
    1.33 + 
    1.34 + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
    1.35 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
    1.36 + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRI-
    1.37 + BUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    1.38 + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
    1.39 +  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
    1.40 + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
    1.41 + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.42 + */