@@ -16,7 +16,10 @@ int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, S
1616
1717 if (itemType == SecKeyGetTypeID () || itemType == SecIdentityGetTypeID () || itemType == SecCertificateGetTypeID ())
1818 {
19+ #pragma clang diagnostic push
20+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
1921 OSStatus status = SecKeychainItemCopyKeychain (item , pKeychainOut );
22+ #pragma clang diagnostic pop
2023
2124 if (status == noErr )
2225 {
@@ -40,20 +43,29 @@ int32_t AppleCryptoNative_SecKeychainCreate(const char* pathName,
4043 const uint8_t * passphraseUtf8 ,
4144 SecKeychainRef * pKeychainOut )
4245{
46+ #pragma clang diagnostic push
47+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
4348 return SecKeychainCreate (pathName , passphraseLength , passphraseUtf8 , false, NULL , pKeychainOut );
49+ #pragma clang diagnostic pop
4450}
4551
4652int32_t AppleCryptoNative_SecKeychainDelete (SecKeychainRef keychain )
4753{
54+ #pragma clang diagnostic push
55+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
4856 return SecKeychainDelete (keychain );
57+ #pragma clang diagnostic pop
4958}
5059
5160int32_t AppleCryptoNative_SecKeychainCopyDefault (SecKeychainRef * pKeychainOut )
5261{
5362 if (pKeychainOut != NULL )
5463 * pKeychainOut = NULL ;
5564
65+ #pragma clang diagnostic push
66+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
5667 return SecKeychainCopyDefault (pKeychainOut );
68+ #pragma clang diagnostic pop
5769}
5870
5971int32_t AppleCryptoNative_SecKeychainOpen (const char * pszKeychainPath , SecKeychainRef * pKeychainOut )
@@ -64,12 +76,18 @@ int32_t AppleCryptoNative_SecKeychainOpen(const char* pszKeychainPath, SecKeycha
6476 if (pszKeychainPath == NULL )
6577 return errSecParam ;
6678
79+ #pragma clang diagnostic push
80+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
6781 return SecKeychainOpen (pszKeychainPath , pKeychainOut );
82+ #pragma clang diagnostic pop
6883}
6984
7085int32_t AppleCryptoNative_SecKeychainUnlock (SecKeychainRef keychain , uint32_t passphraseLength , const uint8_t * passphraseUtf8 )
7186{
87+ #pragma clang diagnostic push
88+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
7289 return SecKeychainUnlock (keychain , passphraseLength , passphraseUtf8 , true);
90+ #pragma clang diagnostic pop
7391}
7492
7593int32_t AppleCryptoNative_SetKeychainNeverLock (SecKeychainRef keychain )
@@ -81,7 +99,10 @@ int32_t AppleCryptoNative_SetKeychainNeverLock(SecKeychainRef keychain)
8199 .lockInterval = INT_MAX ,
82100 };
83101
102+ #pragma clang diagnostic push
103+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
84104 return SecKeychainSetSettings (keychain , & settings );
105+ #pragma clang diagnostic pop
85106}
86107
87108static int32_t
@@ -262,7 +283,7 @@ static bool IsCertInKeychain(CFTypeRef needle, SecKeychainRef haystack)
262283 {
263284 ret = false;
264285 }
265-
286+
266287 if (result != NULL )
267288 {
268289 CFRelease (result );
@@ -355,7 +376,10 @@ int32_t AppleCryptoNative_X509StoreAddCertificate(CFTypeRef certOrIdentity, SecK
355376 // keychain back to disk.
356377 if (status == noErr && privateKey != NULL )
357378 {
379+ #pragma clang diagnostic push
380+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
358381 status = SecKeychainItemCreateCopy ((SecKeychainItemRef )privateKey , keychain , NULL , & itemCopy );
382+ #pragma clang diagnostic pop
359383 }
360384
361385 if (status == errSecDuplicateItem )
@@ -374,7 +398,10 @@ int32_t AppleCryptoNative_X509StoreAddCertificate(CFTypeRef certOrIdentity, SecK
374398
375399 if (status == noErr && cert != NULL )
376400 {
401+ #pragma clang diagnostic push
402+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
377403 status = SecKeychainItemCreateCopy ((SecKeychainItemRef )cert , keychain , NULL , & itemCopy );
404+ #pragma clang diagnostic pop
378405 }
379406
380407 if (status == errSecDuplicateItem )
0 commit comments