cURL / Mailing Lists / curl-library / Single Mail

curl-library

darwin-ssl relies upon Apple documentation error

From: <myriachan_at_cox.net>
Date: Tue, 12 Nov 2013 17:18:42 -0800

The following code will not start on Mac OS X 10.6 due to a symbol not existing in Security.framework:

#if CURL_BUILD_MAC_10_6 || CURL_BUILD_IOS
  if(CFURLCreateDataAndPropertiesFromResource(NULL, pkcs_url, &pkcs_data,
    NULL, NULL, &status)) {
    const void *cKeys[] = {kSecImportExportPassphrase};
    const void *cValues[] = {password};
    CFDictionaryRef options = CFDictionaryCreate(NULL, cKeys, cValues,
      password ? 1L : 0L, NULL, NULL);

Specifically, kSecImportExportPassphrase does not exist in 10.6. It was added in 10.7, even though Apple's documentation says otherwise: https://developer.apple.com/library/mac/DOCUMENTATION/Security/Reference/keychainservices/Reference/reference.html

This results in libcurl-based projects being unable to run on Mac OS 10.6, even if they don't use client-side certificates. A closely-related Stack Overflow post is here: http://stackoverflow.com/questions/1780884/secpkcs12import-from-security-framework-fails-on-os-x-10-6

computer:~ myria$ uname -a
Darwin computer.domain.com 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
computer:~ myria$ nm -arch i386 /System/Library/Frameworks/Security.framework/Versions/A/Security | grep kSecImportExportPassphrase
computer:~ myria$

(Note that Darwin 10.8.0 is Mac OS X 10.6.x.)
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-13