[CalendarServer-changes] [15224] OSXFrameworks/trunk/osx

source_changes at macosforge.org source_changes at macosforge.org
Sat Oct 24 08:59:10 PDT 2015


Revision: 15224
          http://trac.calendarserver.org//changeset/15224
Author:   cdaboo at apple.com
Date:     2015-10-24 08:59:10 -0700 (Sat, 24 Oct 2015)
Log Message:
-----------
Fix CFError reporting. Add security APIs for signing.

Modified Paths:
--------------
    OSXFrameworks/trunk/osx/corefoundation.py
    OSXFrameworks/trunk/osx/frameworks/_corefoundation_cffi.py
    OSXFrameworks/trunk/osx/frameworks/_security_cffi.py

Modified: OSXFrameworks/trunk/osx/corefoundation.py
===================================================================
--- OSXFrameworks/trunk/osx/corefoundation.py	2015-10-24 14:45:00 UTC (rev 15223)
+++ OSXFrameworks/trunk/osx/corefoundation.py	2015-10-24 15:59:10 UTC (rev 15224)
@@ -121,14 +121,25 @@
         return cf.CFErrorGetTypeID()
 
 
-    def error(self):
+    def code(self):
         """
         Return the error description.
 
         @return: error description
         @rtype: L{str}
         """
-        desc = CFStringRef(cf)
+        code = cf.CFErrorGetCode(self.ref())
+        return code
+
+
+    def description(self):
+        """
+        Return the error description.
+
+        @return: error description
+        @rtype: L{str}
+        """
+        desc = CFStringRef(cf.CFErrorCopyDescription(self.ref()))
         return desc.toString()
 
 

Modified: OSXFrameworks/trunk/osx/frameworks/_corefoundation_cffi.py
===================================================================
--- OSXFrameworks/trunk/osx/frameworks/_corefoundation_cffi.py	2015-10-24 14:45:00 UTC (rev 15223)
+++ OSXFrameworks/trunk/osx/frameworks/_corefoundation_cffi.py	2015-10-24 15:59:10 UTC (rev 15224)
@@ -77,6 +77,8 @@
 CFStringRef CFCopyDescription ( CFTypeRef cf );
 
 CFTypeID CFErrorGetTypeID ( void );
+CFIndex CFErrorGetCode ( CFErrorRef err );
+CFStringRef CFErrorCopyDescription ( CFErrorRef err );
 
 CFTypeID CFBooleanGetTypeID ( void );
 Boolean CFBooleanGetValue( CFBooleanRef );

Modified: OSXFrameworks/trunk/osx/frameworks/_security_cffi.py
===================================================================
--- OSXFrameworks/trunk/osx/frameworks/_security_cffi.py	2015-10-24 14:45:00 UTC (rev 15223)
+++ OSXFrameworks/trunk/osx/frameworks/_security_cffi.py	2015-10-24 15:59:10 UTC (rev 15224)
@@ -66,6 +66,9 @@
 struct _SecItemImportExportKeyParameters;
 typedef struct _SecItemImportExportKeyParameters SecItemImportExportKeyParameters;
 
+// SecTransform.h
+typedef CFTypeRef SecTransformRef;
+
 // SecureTransport.h
 typedef enum
 {
@@ -303,6 +306,14 @@
 const CFStringRef kSecValueRef;
 const CFStringRef kSecValuePersistentRef;
 
+// SecTransform.h
+const CFStringRef kSecTransformInputAttributeName;
+const CFStringRef kSecTransformOutputAttributeName;
+const CFStringRef kSecTransformDebugAttributeName;
+const CFStringRef kSecTransformTransformName;
+const CFStringRef kSecTransformAbortAttributeName;
+
+// SecureTransport.h
 enum {
     errSSLProtocol                = -9800,
     errSSLNegotiation            = -9801,
@@ -372,6 +383,7 @@
 
 // SecIdentity.h
 OSStatus SecIdentityCopyCertificate ( SecIdentityRef identityRef, SecCertificateRef *certificateRef );
+OSStatus SecIdentityCopyPrivateKey ( SecIdentityRef identityRef, SecKeyRef *privateKeyRef );
 SecIdentityRef SecIdentityCopyPreferred ( CFStringRef name, CFArrayRef keyUsage, CFArrayRef validIssuers );
 
 // SecImportExport.h
@@ -394,6 +406,15 @@
 // SecKeychain.h
 OSStatus SecKeychainSetUserInteractionAllowed ( Boolean state );
 
+// SecTransform.h
+SecTransformRef SecSignTransformCreate( SecKeyRef key, CFErrorRef *error ) ;
+Boolean SecTransformSetAttribute(SecTransformRef transformRef,
+                                CFStringRef key,
+                                CFTypeRef value,
+                                CFErrorRef *error);
+CFTypeRef SecTransformExecute(SecTransformRef transformRef, CFErrorRef* errorRef);
+
+
 // SecureTransport.h
 SSLContextRef
 SSLCreateContext(CFAllocatorRef alloc, SSLProtocolSide protocolSide, SSLConnectionType connectionType);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151024/0382e9c3/attachment-0001.html>


More information about the calendarserver-changes mailing list