Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1074e56

Browse files
committed
Specify kSecUseDataProtectionKeychain when generating RSA/ECC keys
1 parent4e4b8bf commit1074e56

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ int32_t AppleCryptoNative_EccGenerateKey(int32_t keySizeBits,
2424
{
2525
CFDictionaryAddValue(attributes,kSecAttrKeyType,kSecAttrKeyTypeEC);
2626
CFDictionaryAddValue(attributes,kSecAttrKeySizeInBits,cfKeySizeValue);
27+
if (__builtin_available(macOS10.15,iOS13,tvOS13,*))
28+
{
29+
CFDictionaryAddValue(attributes,kSecUseDataProtectionKeychain,kCFBooleanTrue);
30+
}
2731

2832
*pPrivateKey=SecKeyCreateRandomKey(attributes,pErrorOut);
2933
if (*pPrivateKey!=NULL)

‎src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ int32_t AppleCryptoNative_RsaGenerateKey(int32_t keySizeBits,
2626
{
2727
CFDictionaryAddValue(attributes,kSecAttrKeyType,kSecAttrKeyTypeRSA);
2828
CFDictionaryAddValue(attributes,kSecAttrKeySizeInBits,cfKeySizeValue);
29+
if (__builtin_available(macOS10.15,iOS13,tvOS13,*))
30+
{
31+
CFDictionaryAddValue(attributes,kSecUseDataProtectionKeychain,kCFBooleanTrue);
32+
}
2933

3034
*pPrivateKey=SecKeyCreateRandomKey(attributes,pErrorOut);
3135
if (*pPrivateKey!=NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp