Expose SecKeyEncrypt/SecKeyRawVerify/SecKeyRawSign on OS X as said in the header for iOS.

Originator:steipete
Number:rdar://22067843 Date Originated:30-Jul-2015 09:36 AM
Status:Open Resolved:
Product:OS X SDK Product Version:10.10
Classification:Enhancement Reproducible:Always
 
Summary:
We’re using SecKeyEncrypt, SecKeyRawVerify and SecKeyRawVerify/SecKeyRawSign on both iOS and OS X. They are all declared to be available on OS X starting with 10.7 - yet I can’t find them in any of the Mac headers.

OSStatus SecKeyEncrypt(
    SecKeyRef           key,
	SecPadding          padding,
	const uint8_t		*plainText,
	size_t              plainTextLen,
	uint8_t             *cipherText,
	size_t              *cipherTextLen)
    __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);

OSStatus SecKeyRawVerify(
    SecKeyRef           key,
	SecPadding          padding,
	const uint8_t       *signedData,
	size_t              signedDataLen,
	const uint8_t       *sig,
	size_t              sigLen)
    __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);

OSStatus SecKeyRawSign(
    SecKeyRef           key,
	SecPadding          padding,
	const uint8_t       *dataToSign,
	size_t              dataToSignLen,
	uint8_t             *sig,
	size_t              *sigLen)
    __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);

Right now we just manually declare them as we assume this is an oversight int he headers. If this is not the case, then it’s a bug in the iOS documentation. I checked with 8.4 and 9.0b4 - both have the same headers declaring this as available since 10.7. It also works; we use it for (internal) code on both iOS and the Mac.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!