]> git.saurik.com Git - apple/security.git/blobdiff - SecureTransport/privateInc/SecureTransportPriv.h
Security-163.tar.gz
[apple/security.git] / SecureTransport / privateInc / SecureTransportPriv.h
index 0d9e0d4c081c5074b245557a136168e6655e1bee..2c5f2dd22e3419a5fbb154855d9ffaf5b598d610 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <Security/SecureTransport.h>
 
+#include <Security/Security.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -72,6 +74,34 @@ OSStatus SSLInternal_PRF(
    void *out,                  // mallocd by caller, length >= outLen
    size_t outLen);
 
+/*
+ * Obtain a SecTrustRef representing peer certificates. Valid anytime,
+ * subsequent to a handshake attempt. The returned SecTrustRef is valid
+ * only as long as the SSLContextRef is. 
+ */
+OSStatus
+SSLGetPeerSecTrust                     (SSLContextRef          context,
+                                                        SecTrustRef            *secTrust);     /* RETURNED */
+                                                       
+/*
+ * Obtain resumable session info. Can be called anytime subsequent to 
+ * handshake attempt. 
+ * 
+ * if sessionWasResumed is True on return, the session is indeed a
+ * resumed session; the sessionID (an opaque blob generated by the 
+ * server) is returned in *sessionID. The length of the sessionID
+ * is returned in *sessionIDLength. Caller must allocate the 
+ * sessionID buffer; it max size is MAX_SESSION_ID_LENGTH bytes. 
+ */
+#define MAX_SESSION_ID_LENGTH  32
+
+OSStatus 
+SSLGetResumableSessionInfo     (
+       SSLContextRef   context,
+       Boolean                 *sessionWasResumed,             // RETURNED
+       void                    *sessionID,                             // RETURNED, mallocd by caller
+       size_t                  *sessionIDLength);              // IN/OUT
+                                                        
 #ifdef __cplusplus
 }
 #endif