Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chrono1081

macrumors G3
Original poster
Jan 26, 2008
8,919
6,637
Isla Nublar
Hi guys,

I've been searching over an hour and cannot find anywhere online (and yes I checked StackOverflow) or in the Xcode docs what OSStatus -9809 means and I'm ready to rip my hair out.

Does anyone have any idea how to find this or what it means?

I'm trying to use this example: https://developer.apple.com/library/ios/documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208-SW9

For encrypting and decrypting data and run into this error on decrypt and can't figure out what it means to try and fix it.

This line of code is what causes the error to return:

//Decrypt the data
status = SecKeyDecrypt( privateKey,
kSecPaddingPKCS1,
cipherBuffer,
cipherBufferSize,
plainBuffer,
&plainBufferSize
);
 
Last edited:
That error is in Security/SecureTransport.h but its meaning seems not very informative.

errSSLCrypto = -9809, /* underlying cryptographic error */
 
Thanks guys! It gave me enough info to get started searching.

I can't tell you how much I hate trying to figure out RSA Encryption :mad:

That error is in Security/SecureTransport.h but its meaning seems not very informative.

errSSLCrypto = -9809, /* underlying cryptographic error */

PhoneyDeveloper can I ask how you discovered where that error message was so I know how to find them in the future?
 
Usually I just search in Frameworks in my project in Xcode. That gave no results however.

You mentioned encryption and I guessed this comes from Security.framework. I opened Security.h in Xcode. In the breadcrumb at the top of the editor window I saw Security.framework and could choose each of the header files one by one and I searched in each one till I found the match.

Probably if I had Security.framework in my project it would have found the result.

Almost all the errors are in a header somewhere. Because Xcode hides all the headers inside its own package they're not available from a spotlight search.
 

Attachments

  • Screen Shot 2015-05-06 at 8.20.13 PM.png
    Screen Shot 2015-05-06 at 8.20.13 PM.png
    137.9 KB · Views: 204
Usually I just search in Frameworks in my project in Xcode. That gave no results however.

You mentioned encryption and I guessed this comes from Security.framework. I opened Security.h in Xcode. In the breadcrumb at the top of the editor window I saw Security.framework and could choose each of the header files one by one and I searched in each one till I found the match.

Probably if I had Security.framework in my project it would have found the result.

Almost all the errors are in a header somewhere. Because Xcode hides all the headers inside its own package they're not available from a spotlight search.

Thanks! That's why I couldn't find it originally I was only including the #include <Security/Security.h> header but after adding it to my project then I was able to find the error through searching.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.