Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4086)

Unified Diff: chrome/browser/mac/keychain_reauthorize.mm

Issue 10503009: Merge trunk r140081 to the 19.0.1084 branch. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mac/keychain_reauthorize.mm
===================================================================
--- chrome/browser/mac/keychain_reauthorize.mm (revision 140247)
+++ chrome/browser/mac/keychain_reauthorize.mm (working copy)
@@ -455,6 +455,23 @@
return;
}
+ // CrSKeychainItemCreateFromContent (SecKeychainItemCreateFromContent)
+ // returns errKCNoSuchAttr (errSecNoSuchAttr) when asked to add an item of
+ // type kSecPrivateKeyItemClass. This would happen after the original
+ // private key was deleted, resulting in data loss. I can't figure out how
+ // SecKeychainItemCreateFromContent wants private keys added. Skip them,
+ // only doing the reauthorization for Keychain item types known to work,
+ // the item types expected to be used by most users and those that are
+ // synced. See http://crbug.com/130738 and
+ // http://lists.apple.com/archives/apple-cdsa/2006/Jan/msg00025.html .
+ switch (old_attributes_and_data.item_class()) {
+ case kSecInternetPasswordItemClass:
+ case kSecGenericPasswordItemClass:
+ break;
+ default:
+ return;
+ }
+
// SecKeychainItemCreateFromContent fails if any attribute is zero-length,
// but old_attributes_and_data can contain zero-length attributes. Create
// a new attribute list devoid of zero-length attributes.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698