8136425: KeystoreImpl.m using wrong type for cert format
Reviewed-by: vinnie
This commit is contained in:
parent
9969836a33
commit
20b057fc29
@ -508,7 +508,7 @@ JNF_COCOA_ENTER(env);
|
|||||||
SecKeychainRef defaultKeychain = NULL;
|
SecKeychainRef defaultKeychain = NULL;
|
||||||
SecKeychainCopyDefault(&defaultKeychain);
|
SecKeychainCopyDefault(&defaultKeychain);
|
||||||
|
|
||||||
SecExternalItemType dataType = (isCertificate == JNI_TRUE ? kSecFormatX509Cert : kSecFormatWrappedPKCS8);
|
SecExternalFormat dataFormat = (isCertificate == JNI_TRUE ? kSecFormatX509Cert : kSecFormatWrappedPKCS8);
|
||||||
|
|
||||||
// Convert the password obj into a CFStringRef that the keychain importer can use for encryption.
|
// Convert the password obj into a CFStringRef that the keychain importer can use for encryption.
|
||||||
SecKeyImportExportParameters paramBlock;
|
SecKeyImportExportParameters paramBlock;
|
||||||
@ -533,7 +533,7 @@ JNF_COCOA_ENTER(env);
|
|||||||
paramBlock.keyUsage = CSSM_KEYUSE_ANY;
|
paramBlock.keyUsage = CSSM_KEYUSE_ANY;
|
||||||
paramBlock.keyAttributes = CSSM_KEYATTR_RETURN_DEFAULT;
|
paramBlock.keyAttributes = CSSM_KEYATTR_RETURN_DEFAULT;
|
||||||
|
|
||||||
err = SecKeychainItemImport(cfDataToImport, NULL, &dataType, NULL,
|
err = SecKeychainItemImport(cfDataToImport, NULL, &dataFormat, NULL,
|
||||||
0, ¶mBlock, defaultKeychain, &createdItems);
|
0, ¶mBlock, defaultKeychain, &createdItems);
|
||||||
|
|
||||||
if (err == noErr) {
|
if (err == noErr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user