Scrambled Keychain and Missing Certificates

I have been having a big problems with my iMac for about a day. Mail is asking for my administrator password every time it checks my E-mail server. I can't log on to the AppStore because the connection fails. I can't upload a new App to the AppStore because my developer certificates have disappeared. I can't log on to this forum with Safari because it says a certificate named "no name" can't be trusted. Lots of apps are asking for certificates that aren't there. Strangely a whole page of expired certificates has appeared that say that they are from the Department of Defense!? I use Time Machine to backup my hard drive to an external drive. I'm hoping that I can replace the databases used by my keychain from this drive. Have I finally been hacked?

iMac (21.5-inch Mid 2011), OS X Yosemite (10.10), 10.10.1

Posted on Sep 18, 2015 2:02 PM

Reply
9 replies

Sep 18, 2015 2:44 PM in response to Warrren Anderson

Back up all data, then take each of the following steps that you haven't already taken. Stop when the problem is resolved.

Step 1

From the menu bar, select

 ▹ System Preferences... ▹ Date & Time

Select the Time Zone tab in the preference pane that opens and check that the time zone matches your location. Then select the Date & Time tab. Check that the data and time shown (including the year) are correct, and correct them if not.

Check the box marked

Set date and time automatically

if it's not already checked, and select one of the Apple time servers from the menu next to it.

Step 2

Start up in safe mode and log in to the account with the problem.

Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.

Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.

The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.

If the problem is not reproducible in safe mode, then it's caused by third-party "anti-virus" or "security" software. If you know what that software is, remove it as directed by the developer after backing up all data. If you don't know what it is, ask for instructions.

Step 3

Triple-click anywhere in the line below on this page to select it:

/System/Library/Keychains/SystemCACertificates.keychain

Right-click or control-click the highlighted line and select

Services Show Info

from the contextual menu.* An Info dialog should open. The dialog should show "You can only read" in the Sharing & Permissions section.

Repeat with this line:

/System/Library/Keychains/SystemRootCertificates.keychain

If instead of the Info dialog, you get a message that either file can't be found, reinstall OS X.

*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. Open a TextEdit window and paste into it by pressing command-V. Select the line you just pasted and continue as above.

Step 4

Launch the Keychain Access application in any of the following ways:

☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)

☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.

☞ Open LaunchPad and start typing the name.

In the upper left corner of the window, you should see a list headed Keychains. If not, click the button in the lower left corner that looks like a triangle inside a square.

In the Keychains list, there should be items named System and System Roots. If not, select

File Add Keychain

from the menu bar and add the following items:

/Library/Keychains/System.keychain

/System/Library/Keychains/SystemRootCertificates.keychain

Open the View menu in the menu bar. If one of the items in the menu is

Show Expired Certificates

select it. Otherwise it will show

Hide Expired Certificates

which is what you want.

From the Category list in the lower left corner of the window, select Certificates. Look carefully at the list of certificates in the right side of the window. If any of them has a blue-and-white plus sign or a red "X" in the icon, double-click it. An inspection window will open. Click the disclosure triangle labeled Trust to disclose the trust settings for the certificate. From the menu labeled

Secure Sockets Layer (SSL)

select

no value specified

Close the inspection window. You'll be prompted for your administrator password to update the settings.

Now open the same inspection window again, and select

When using this certificate: Use System Defaults

Save the change in the same way as before.

Revert all the certificates with non-default trust settings. Never again change any of those settings.

Step 5

Select My Certificates from the Category list. From the list of certificates shown, delete any that are marked with a red X as expired or invalid.

Export all remaining certificates (even if valid), delete them from the keychain, and test. For example, there might be a certificate with a name beginning in "Symantec" or "Verisign."

For instructions, select

Help Keychain Access Help

from the menu bar and search for the term "export" in the help window. Export each certificate as an individual file; don't combine them into one big file.

If there's no change, you can reimport the certificates that you exported in this step (if any) by double-clicking them.

Step 6

From the menu bar, select

Keychain Access Preferences... Certificates

There are three menus in the window. Change the selection in the top two to Best attempt, and in the bottom one to CRL.

Step 7

Triple-click anywhere in the line of text below on this page to select it:

/var/db/crls

Copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder...

from the menu bar and paste into the box that opens by pressing command-V. You may not see what you pasted because a line break is included. Press return.

A folder named "crls" should open. Move all the files in that folder to the Trash. You’ll be prompted for your administrator login password.

Restart the computer, empty the Trash, and test.

Sep 19, 2015 4:59 PM in response to Warrren Anderson

Thanks. This fixed most of my problems for a few hours but now I can't code sign my projects in XCode. When I open Keychain Access all the keychains are gone, like the login, system certificates and system keychains. Keychain First Aid fails and logs this:


Repair started

Checking keychain configuration for Warren (user ID=501)

Home directory is /Users/Warren

Checked login keychain

Error: login keychain not found

Repair terminated unexpectedly


It looks like Keychain Access has died and all of my Keychains have been deleted. Is there any way to restore this from Time Machine or do I have to reinstall OSX?

Sep 20, 2015 7:45 AM in response to Warrren Anderson

I worked on this and have found the problem:


If I make any changes to my keychains with Keychain Access, for example delete an expired developer certificate, or delete any of the duplicate passwords created by Mail, Keychain Access crashes:


Force Quit Applications: Keychain Access (not responding)


and all of my keychains are gone.


My Mail is semi-broken and I can't build any projects with XCode because my developer certificates are missing. Obviously this is a big disaster. Can I restore anything with Time Machine or do I have to reinstall OSX?

Sep 20, 2015 12:14 PM in response to Warrren Anderson

I booted in safe mode again and used Key Access First Aid. Key Access reported a missing folder and replaced it. Then I booted in regular mode. My computer ran but my passwords and developer certificates are gone. Mail and two other things keep asking me to enter my administrator password to allow them to use my Local Items keychain. Now when I launch Keychain Access it immediately crashes. I guess I have to re-install OSX. !@#$%^&. so much for the OS that just works.

Sep 21, 2015 1:02 PM in response to Warrren Anderson

I booted in repair mode and tried to install a clean OSX. It took about three hours to download OSX 10.10 from the App Store. Then my mac restarted. EIGHT HOURS later the restart was stalled with the progress bar halfway across with a spinning beach ball. I did this again and this time it appears to have worked, although mail still asks me for my administrator password every time it checks to see if I have mail and Keychain Access locks up when I launch it: Force Quit Applications-> Keychain Access (not responding).


In other words a clean installation of OSX 10.10 from the store is just as completely broken as the one on my Mac. No XCode and broken mail, etc.

Sep 21, 2015 1:20 PM in response to Warrren Anderson

Computer won't shut down without force quitting Mail.


Restoring from Time Machine is an option in repair mode, but it will only allow me to recreate the whole disk, not just a functioning OS. This would mean that I would lose a few weeks of E-mails, source code, web pages I'm working on, etc. etc. Probably after restoring I can get these from Time Machine backup.


If someone can tell me where Mail's database is, I can get this from Time Machine and rebuild my E-mail. Since Mail is FUBAR, can anyone tell me where to get a new copy of Mail?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Scrambled Keychain and Missing Certificates

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.