6 #ifndef SecProtocolPriv_h
7 #define SecProtocolPriv_h
9 #include <Security/SecProtocolOptions.h>
10 #include <Security/SecProtocolMetadata.h>
11 #include <Security/SecProtocolConfiguration.h>
12 #include <Security/SecureTransportPriv.h>
13 #include <Security/SecCertificatePriv.h>
19 /* See: https://tools.ietf.org/html/rfc8446#section-4.2.7 */
20 typedef CF_ENUM(uint16_t, tls_key_exchange_group_t
) {
21 tls_key_exchange_group_Secp256r1
= 0x0017,
22 tls_key_exchange_group_Secp384r1
= 0x0018,
23 tls_key_exchange_group_Secp521r1
= 0x0019,
24 tls_key_exchange_group_X25519
= 0x001D,
25 tls_key_exchange_group_X448
= 0x001E,
26 tls_key_exchange_group_FFDHE2048
= 0x0100,
27 tls_key_exchange_group_FFDHE3072
= 0x0101,
28 tls_key_exchange_group_FFDHE4096
= 0x0102,
29 tls_key_exchange_group_FFDHE6144
= 0x0103,
30 tls_key_exchange_group_FFDHE8192
= 0x0104,
34 * Convenience key exchange groups that collate group identifiers of
35 * comparable security into a single alias.
37 typedef CF_ENUM(uint16_t, tls_key_exchange_group_set_t
) {
38 tls_key_exchange_group_set_default
,
39 tls_key_exchange_group_set_compatibility
,
40 tls_key_exchange_group_set_legacy
,
43 SEC_ASSUME_NONNULL_BEGIN
45 #ifndef SEC_OBJECT_IMPL
46 SEC_OBJECT_DECL(sec_array
);
47 #endif // !SEC_OBJECT_IMPL
49 struct sec_protocol_options_content
;
50 typedef struct sec_protocol_options_content
*sec_protocol_options_content_t
;
52 struct sec_protocol_metadata_content
;
53 typedef struct sec_protocol_metadata_content
*sec_protocol_metadata_content_t
;
55 typedef void (^sec_protocol_tls_handshake_message_handler_t
)(uint8_t type
, dispatch_data_t message
);
57 typedef dispatch_data_t
_Nullable (*sec_protocol_metadata_exporter
)(void * handle
, size_t label_len
, const char *label
,
58 size_t context_len
, const uint8_t * __nullable context
, size_t exporter_len
);
60 typedef dispatch_data_t
_Nullable (*sec_protocol_metadata_session_exporter
)(void *handle
);
62 typedef bool (^sec_access_block_t
)(void *handle
);
64 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
65 SEC_RETURNS_RETAINED sec_array_t
66 sec_array_create(void);
68 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
70 sec_array_append(sec_array_t array
, sec_object_t object
);
72 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
74 sec_array_get_count(sec_array_t array
);
76 typedef bool (^sec_array_applier_t
) (size_t index
, sec_object_t object
);
78 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
80 sec_array_apply(sec_array_t array
, sec_array_applier_t applier
);
83 * @function sec_protocol_options_access_handle
86 * Access the internal handle of a `sec_protocol_options` object.
89 * A `sec_protocol_options_t` instance.
92 * A block to invoke with access to the internal handle.
94 * @return True if the access was successful
96 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
98 sec_protocol_options_access_handle(sec_protocol_options_t options
, sec_access_block_t access_block
);
101 * @function sec_protocol_options_contents_are_equal
104 * Compare two `sec_protocol_options_content_t` structs for equality.
107 * A `sec_protocol_options_t` instance.
110 * A `sec_protocol_options_t` instance.
112 * @return True if equal, and false otherwise.
114 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
116 sec_protocol_options_contents_are_equal(sec_protocol_options_content_t contentA
, sec_protocol_options_content_t contentB
);
119 * @function sec_protocol_options_set_tls_early_data_enabled
122 * Enable or disable early (0-RTT) data for TLS.
125 * A `sec_protocol_options_t` instance.
127 * @param early_data_enabled
128 * Flag to enable or disable early (0-RTT) data.
130 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
132 sec_protocol_options_set_tls_early_data_enabled(sec_protocol_options_t options
, bool early_data_enabled
);
135 * @function sec_protocol_options_set_tls_sni_disabled
138 * Enable or disable the TLS SNI extension. This defaults to `false`.
141 * A `sec_protocol_options_t` instance.
143 * @param sni_disabled
144 * Flag to enable or disable use of the TLS SNI extension.
146 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
148 sec_protocol_options_set_tls_sni_disabled(sec_protocol_options_t options
, bool sni_disabled
);
151 * @function sec_protocol_options_set_enforce_ev
154 * Enable or disable EV enforcement.
157 * A `sec_protocol_options_t` instance.
160 * Flag to determine if EV is enforced.
162 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
164 sec_protocol_options_set_enforce_ev(sec_protocol_options_t options
, bool enforce_ev
);
167 * @block sec_protocol_session_update_t
170 * Block to be invoked when a new session is established and ready.
173 * A `sec_protocol_metadata_t` instance.
175 typedef void (^sec_protocol_session_update_t
)(sec_protocol_metadata_t metadata
);
178 * @function sec_protocol_options_set_session_update_block
181 * Set the session update block. This is fired whenever a new session is
182 * created an inserted into the cache.
185 * A `sec_protocol_options_t` instance.
187 * @param update_block
188 * A `sec_protocol_session_update_t` instance.
190 * @params update_queue
191 * A `dispatch_queue_t` on which the update block should be called.
193 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
195 sec_protocol_options_set_session_update_block(sec_protocol_options_t options
,
196 sec_protocol_session_update_t update_block
,
197 dispatch_queue_t update_queue
);
200 * @function sec_protocol_options_set_session_state
203 * Set the session state using a serialized session blob.
205 * If the session state is invalid or otherwise corrupt, the state is ignored and
206 * the connection will proceed as if no state was provided.
209 * A `sec_protocol_options_t` instance.
211 * @param session_state
212 * A `dispatch_data_t` carrying serialized session state from a previous.
214 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
216 sec_protocol_options_set_session_state(sec_protocol_options_t options
, dispatch_data_t session_state
);
219 * @function sec_protocol_options_set_quic_transport_parameters
222 * Set the opaque QUIC transport parameters to be used for this connection.
225 * A `sec_protocol_options_t` instance.
227 * @param transport_parameters
228 * A `dispatch_data_t` carrying opqaue QUIC transport parameters.
230 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
232 sec_protocol_options_set_quic_transport_parameters(sec_protocol_options_t options
, dispatch_data_t transport_parameters
);
235 * @enum sec_protocol_transport_t
237 * @abstract An enumeration of the different transport protocols that can have specific security options.
240 sec_protocol_transport_any
= 0,
241 sec_protocol_transport_tcp
,
242 sec_protocol_transport_quic
,
243 } sec_protocol_transport_t
;
245 #define SEC_PROTOCOL_HAS_TRANSPORT_SPECIFIC_ALPN 1
248 * @function sec_protocol_options_add_transport_specific_application_protocol
251 * Add an application protocol supported by clients of this protocol instance, specific
252 * to a transport protocol.
255 * A `sec_protocol_options_t` instance.
257 * @param application_protocol
258 * A NULL-terminated string defining the application protocol.
260 * @param specific_transport
261 * A specific transport to which to bind the application protocol.
263 API_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
265 sec_protocol_options_add_transport_specific_application_protocol(sec_protocol_options_t options
, const char *application_protocol
, sec_protocol_transport_t specific_transport
);
268 * @function sec_protocol_options_copy_transport_specific_application_protocol
271 * Return the application protocols configured by clients of this protocol instance, specific
272 * to a transport protocol if applicable.
275 * A `sec_protocol_options_t` instance.
277 * @param specific_transport
278 * A specific transport to which to bind the application protocol.
280 * @return An `xpc_object_t` instance carrying an array of application protocol strings, or nil.
282 #define SEC_PROTOCOL_HAS_TRANSPORT_SPECIFIC_ALPN_GETTER 1 /* rdar://problem/63987477 */
283 SPI_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
284 SEC_RETURNS_RETAINED __nullable xpc_object_t
285 sec_protocol_options_copy_transport_specific_application_protocol(sec_protocol_options_t options
, sec_protocol_transport_t specific_transport
);
288 * @enum sec_protocol_tls_encryption_level_t
290 * @abstract An enumeration of the different TLS encryption levels.
293 sec_protocol_tls_encryption_level_initial
= 0,
294 sec_protocol_tls_encryption_level_early_data
,
295 sec_protocol_tls_encryption_level_handshake
,
296 sec_protocol_tls_encryption_level_application
,
297 } sec_protocol_tls_encryption_level_t
;
300 * @block sec_protocol_tls_encryption_secret_update_t
303 * Block to be invoked when a new session is established and ready.
306 * The `sec_protocol_tls_encryption_level_t` for this secret.
309 * True if this secret is for writing, and false if it's for reading.
312 * Secret wrapped in a `dispatch_data_t`
314 typedef void (^sec_protocol_tls_encryption_secret_update_t
)(sec_protocol_tls_encryption_level_t level
, bool is_write
, dispatch_data_t secret
);
317 * @function sec_protocol_options_set_tls_encryption_secret_update_block
320 * Set the TLS secret update block. This is fired whenever a new TLS secret is
324 * A `sec_protocol_options_t` instance.
326 * @param update_block
327 * A `sec_protocol_tls_encryption_secret_update_t` instance.
329 * @params update_queue
330 * A `dispatch_queue_t` on which the update block should be called.
332 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
334 sec_protocol_options_set_tls_encryption_secret_update_block(sec_protocol_options_t options
,
335 sec_protocol_tls_encryption_secret_update_t update_block
,
336 dispatch_queue_t update_queue
);
339 * @block sec_protocol_tls_encryption_level_update_t
342 * Block to be invoked when the encryption level is updated.
345 * The new `sec_protocol_tls_encryption_level_t`.
348 * True if this is a write level and false if it's a read.
351 typedef void (^sec_protocol_tls_encryption_level_update_t
)(sec_protocol_tls_encryption_level_t level
, bool is_write
);
354 * @function sec_protocol_options_set_tls_encryption_level_update_block
357 * Set the TLS encryption level update block. It is invoked whenever the encryption level is updated.
360 * A `sec_protocol_options_t` instance.
362 * @param update_block
363 * A `sec_protocol_tls_encryption_level_update_t` instance.
365 * @params update_queue
366 * A `dispatch_queue_t` on which the update block should be called.
368 #define SEC_PROTOCOL_HAS_TLS_ENCRYPTION_LEVEL_UPDATE_BLOCK 1 /* rdar://problem/63986462 */
369 SPI_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
371 sec_protocol_options_set_tls_encryption_level_update_block(sec_protocol_options_t options
,
372 sec_protocol_tls_encryption_level_update_t update_block
,
373 dispatch_queue_t update_queue
);
376 * @block sec_protocol_private_key_complete_t
379 * Block to be invoked when a private key operation is complete.
382 * A `dispatch_data_t` object containing the private key result.
384 typedef void (^sec_protocol_private_key_complete_t
)(dispatch_data_t result
);
387 * @block sec_protocol_private_key_sign_t
390 * Block to be invoked when a private key signature operation is required.
393 * The signature algorithm to use for the signature.
396 * The input to be signed.
399 * The `sec_protocol_private_key_complete_t` block to invoke when the operation is complete.
401 typedef void (^sec_protocol_private_key_sign_t
)(uint16_t algorithm
, dispatch_data_t input
, sec_protocol_private_key_complete_t complete
);
404 * @block sec_protocol_private_key_decrypt_t
407 * Block to be invoked when a private key decryption operation is required.
410 * The input to be decrypted.
413 * The `sec_protocol_private_key_complete_t` block to invoke when the operation is complete.
415 typedef void (^sec_protocol_private_key_decrypt_t
)(dispatch_data_t input
, sec_protocol_private_key_complete_t complete
);
418 * @block sec_protocol_options_set_private_key_blocks
421 * Set the private key operation blocks for this connection.
424 * A `sec_protocol_options_t` instance.
427 * A `sec_protocol_private_key_sign_t` block.
429 * @param decrypt_block
430 * A `sec_protocol_private_key_decrypt_t` block.
432 * @param operation_queue
433 * The `dispatch_queue_t` queue on which each private key operation is invoked.
435 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
437 sec_protocol_options_set_private_key_blocks(sec_protocol_options_t options
,
438 sec_protocol_private_key_sign_t sign_block
,
439 sec_protocol_private_key_decrypt_t decrypt_block
,
440 dispatch_queue_t operation_queue
);
443 * @block sec_protocol_options_set_local_certificates
446 * Set the local certificates to be used for this protocol instance.
449 * A `sec_protocol_options_t` instance.
451 * @param certificates
452 * A `sec_array_t` instance of `sec_certifiate_t` instances.
454 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
456 sec_protocol_options_set_local_certificates(sec_protocol_options_t options
, sec_array_t certificates
);
459 * @block sec_protocol_options_set_tls_certificate_compression_enabled
462 * Enable or disable TLS 1.3 certificate compression.
464 * See: https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-04
467 * A `sec_protocol_options_t` instance.
469 * @param certificate_compression_enabled
470 * Flag to determine if certificate compression is enabled.
472 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
474 sec_protocol_options_set_tls_certificate_compression_enabled(sec_protocol_options_t options
, bool certificate_compression_enabled
);
477 * @block sec_protocol_options_tls_handshake_message_callback
480 * Set a callback to process each TLS handshake message. This function may be invoked at any point during
481 * the TLS handshake, if at all. Clients MUST NOT rely on any behavior aspect of this function as they
485 * A `sec_protocol_options_t` instance.
488 * A `sec_protocol_tls_handshake_message_handler_t`.
491 * The queue upon which to invoke the callback.
493 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
495 sec_protocol_options_tls_handshake_message_callback(sec_protocol_options_t options
, sec_protocol_tls_handshake_message_handler_t handler
, dispatch_queue_t queue
);
498 * @block sec_protocol_options_append_tls_key_exchange_group
501 * Append a TLS key exchange group to the set of enabled groups.
504 * A `sec_protocol_options_t` instance.
507 * A `tls_key_exchange_group_t` value.
509 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
511 sec_protocol_options_append_tls_key_exchange_group(sec_protocol_options_t options
, tls_key_exchange_group_t group
);
514 * @block sec_protocol_options_add_tls_key_exchange_group
517 * Add a TLS key exchange group to the set of enabled groups.
520 * A `sec_protocol_options_t` instance.
523 * A SSLKeyExchangeGroup value.
525 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
527 sec_protocol_options_add_tls_key_exchange_group(sec_protocol_options_t options
, SSLKeyExchangeGroup group
);
530 * @block sec_protocol_options_append_tls_key_exchange_group_set
533 * Append a TLS key exchange group set to the set of enabled groups.
536 * A `sec_protocol_options_t` instance.
539 * A `tls_key_exchange_group_set_t` value.
541 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
543 sec_protocol_options_append_tls_key_exchange_group_set(sec_protocol_options_t options
, tls_key_exchange_group_set_t set
);
546 * @block sec_protocol_options_tls_key_exchange_group_set
549 * Add a TLS key exchange group set to the set of enabled groups.
552 * A `sec_protocol_options_t` instance.
555 * A SSLKeyExchangeGroupSet value.
557 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
559 sec_protocol_options_add_tls_key_exchange_group_set(sec_protocol_options_t options
, SSLKeyExchangeGroupSet set
);
562 * @function sec_protocol_options_set_eddsa_enabled
565 * Enable EDDSA support (for TLS 1.3).
568 * A `sec_protocol_options_t` instance.
570 * @param eddsa_enabled
571 * Flag to enable EDDSA.
573 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
575 sec_protocol_options_set_eddsa_enabled(sec_protocol_options_t options
, bool eddsa_enabled
);
578 * @function sec_protocol_options_set_tls_delegated_credentials_enabled
581 * Enable TLS delegated credentials support. See https://tools.ietf.org/html/draft-ietf-tls-subcerts-02.
583 * DO NOT DEPEND ON THIS SPI. IT IS FOR EXPERIMENTAL PURPOSES AND SUBJECT TO REMOVAL WITHOUT ADVANCE NOTICE.
584 * BUILD BREAKAGE ISSUES WILL BE SENT TO THE CALLING PROJECT.
587 * A `sec_protocol_options_t` instance.
589 * @param tls_delegated_credentials_enabled
590 * Flag to enable TLS delegated credentials.
592 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
594 sec_protocol_options_set_tls_delegated_credentials_enabled(sec_protocol_options_t options
, bool tls_delegated_credentials_enabled
);
597 * @function sec_protocol_options_set_tls_ticket_request_count
600 * Enable TLS ticket request support, and specify the count of tickets. Ticket support
601 * must also be explicitly enabled by `sec_protocol_options_set_tls_tickets_enabled`.
603 * DO NOT DEPEND ON THIS SPI. IT IS FOR EXPERIMENTAL PURPOSES AND SUBJECT TO REMOVAL WITHOUT ADVANCE NOTICE.
604 * BUILD BREAKAGE ISSUES WILL BE SENT TO THE CALLING PROJECT.
607 * A `sec_protocol_options_t` instance.
609 * @param tls_ticket_request_count
610 * Set the amount of tickets to request from the server.
612 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
614 sec_protocol_options_set_tls_ticket_request_count(sec_protocol_options_t options
, uint8_t tls_ticket_request_count
);
617 * @function sec_protocol_options_set_tls_grease_enabled
620 * Enable TLS GREASE support. See https://tools.ietf.org/html/draft-ietf-tls-grease-02.
622 * DO NOT DEPEND ON THIS SPI. IT IS FOR EXPERIMENTAL PURPOSES AND SUBJECT TO REMOVAL WITHOUT ADVANCE NOTICE.
623 * BUILD BREAKAGE ISSUES WILL BE SENT TO THE CALLING PROJECT.
626 * A `sec_protocol_options_t` instance.
628 * @param tls_grease_enabled
629 * Flag to enable TLS GREASE.
631 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
633 sec_protocol_options_set_tls_grease_enabled(sec_protocol_options_t options
, bool tls_grease_enabled
);
636 * @function sec_protocol_options_set_allow_unknown_alpn_protos
639 * Configure clients to accept server ALPN values they did not advertise.
642 * A `sec_protocol_options_t` instance.
644 * @param allow_unknown_alpn_protos
645 * Flag to enable or disable the use of unknown ALPN values.
647 #define SEC_PROTOCOL_HAS_ALLOW_UNKNOWN_ALPN_PROTOS_SETTER 1 /* rdar://problem/64449512 */
648 SPI_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
650 sec_protocol_options_set_allow_unknown_alpn_protos(sec_protocol_options_t options
, bool allow_unknown_alpn_protos
);
653 * @function sec_protocol_options_set_experiment_identifier
656 * Set the SecExperiment identifier for a given connection.
658 * Note: this SPI is meant to be called by libnetcore. It should not be called in any other circumstances.
661 * A `sec_protocol_options_t` instance.
663 * @param experiment_identifier
664 * The identifier for a secure connection experiment.
666 #define SEC_PROTOCOL_HAS_EXPERIMENT_IDENTIFIER 1
667 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
669 sec_protocol_options_set_experiment_identifier(sec_protocol_options_t options
, const char *experiment_identifier
);
672 * @function sec_protocol_options_set_connection_id
675 * Set the explciit connection identifier. If not set, one will be populated internally.
678 * A `sec_protocol_options_t` instance.
680 * @param connection_id
681 * The `uuid_t`` connection identifier.
683 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
685 sec_protocol_options_set_connection_id(sec_protocol_options_t options
, uuid_t _Nonnull connection_id
);
688 * @function sec_protocol_options_create_config
691 * Create a `xpc_object_t` instance carrying a configuration for the given `sec_protocol_options_t` instance.
694 * A `sec_protocol_options_t` instance.
696 * @return A `xpc_object_t` instance carrying a configuration, or nil on failure.
698 #define SEC_PROTOCOL_HAS_EXPERIMENT_HOOKS 1
699 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
700 SEC_RETURNS_RETAINED __nullable xpc_object_t
701 sec_protocol_options_create_config(sec_protocol_options_t options
);
704 * @function sec_protocol_options_matches_config
707 * Determine if a `sec_protocol_options_t` instance matches a given configuration.
710 * A `sec_protocol_options_t` instance.
713 * A `xpc_object_t` instance carrying a SecExperiment config.
715 * @return True if the parameters in `config` match that of `options`, and false otherwise.
717 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
719 sec_protocol_options_matches_config(sec_protocol_options_t options
, xpc_object_t config
);
722 * @function sec_protocol_options_apply_config
725 * Transform the given `sec_protocol_options_t` instance using the provided config.
728 * A `sec_protocol_options_t` instance.
731 * A `xpc_object_t` instance carrying a SecExperiment config.
733 * @return True if the options were applied successfully, and false otherwise.
736 sec_protocol_options_apply_config(sec_protocol_options_t options
, xpc_object_t config
);
739 * @function sec_protocol_metadata_get_tls_negotiated_group
742 * Get a human readable representation of the negotiated key exchange group.
745 * A `sec_protocol_metadata_t` instance.
747 * @return A string representation of the negotiated group, or NULL if it does not exist.
749 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
750 const char * __nullable
751 sec_protocol_metadata_get_tls_negotiated_group(sec_protocol_metadata_t metadata
);
754 * @function sec_protocol_metadata_get_experiment_identifier
757 * Get the SecExperiment identifier for a given connection.
759 * Note: this SPI is meant to be called by libnetcore. It should not be called in any other circumstances.
762 * A `sec_protocol_metadata_t` instance.
764 * @return The identifier for a secure connection experiment, or NULL if none was specified.
766 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
767 const char * __nullable
768 sec_protocol_metadata_get_experiment_identifier(sec_protocol_metadata_t metadata
);
771 * @function sec_protocol_metadata_copy_connection_id
774 * Copy the secure connection identifier.
777 * A `sec_protocol_metadata_t` instance.
780 * A `uuid_t` into which the connection identifier is written.
782 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
784 sec_protocol_metadata_copy_connection_id(sec_protocol_metadata_t metadata
, uuid_t _Nonnull output_uuid
);
787 * @function sec_protocol_metadata_get_tls_false_start_used
790 * Determine if False Start was used.
793 * A `sec_protocol_metadata_t` instance.
795 * @return True if False Start was used, and false otherwise.
797 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
799 sec_protocol_metadata_get_tls_false_start_used(sec_protocol_metadata_t metadata
);
802 * @function sec_protocol_metadata_get_ticket_offered
805 * Determine if a ticket was offered for session resumption.
808 * A `sec_protocol_metadata_t` instance.
810 * @return True if a ticket was offered for resumption, and false otherwise.
812 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
814 sec_protocol_metadata_get_ticket_offered(sec_protocol_metadata_t metadata
);
817 * @function sec_protocol_metadata_get_ticket_received
820 * Determine if a ticket was received upon completing the new connection.
823 * A `sec_protocol_metadata_t` instance.
825 * @return True if a ticket was received from the peer (server), and false otherwise.
827 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
829 sec_protocol_metadata_get_ticket_received(sec_protocol_metadata_t metadata
);
832 * @function sec_protocol_metadata_get_session_resumed
835 * Determine if this new connection was a session resumption.
838 * A `sec_protocol_metadata_t` instance.
840 * @return True if this new connection was resumed, and false otherwise.
842 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
844 sec_protocol_metadata_get_session_resumed(sec_protocol_metadata_t metadata
);
847 * @function sec_protocol_metadata_get_session_renewed
850 * Determine if this resumed connection was renewed with a new ticket.
853 * A `sec_protocol_metadata_t` instance.
855 * @return True if this resumed connection was renewed with a new ticket, and false otherwise.
857 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
859 sec_protocol_metadata_get_session_renewed(sec_protocol_metadata_t metadata
);
862 * @function sec_protocol_metadata_get_connection_strength
865 * Determine the TLS connection strength.
868 * A `sec_protocol_metadata_t` instance.
870 * @return An `SSLConnectionStrength` enum.
872 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
873 SSLConnectionStrength
874 sec_protocol_metadata_get_connection_strength(sec_protocol_metadata_t metadata
);
877 * @function sec_protocol_metadata_copy_serialized_session
880 * Copy a serialized representation of a session.
883 * A `sec_protocol_metadata_t` instance.
885 * @return A `dispatch_data_t` object containing a serialized session.
887 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
888 SEC_RETURNS_RETAINED __nullable dispatch_data_t
889 sec_protocol_metadata_copy_serialized_session(sec_protocol_metadata_t metadata
);
892 * @function sec_protocol_metadata_access_handle
895 * Access the internal handle of a `sec_protocol_metadata` object.
898 * A `sec_protocol_metadata_t` instance.
900 * @param access_block
901 * A block to invoke with access to the internal handle.
903 * @return True if the access was successful
905 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
907 sec_protocol_metadata_access_handle(sec_protocol_metadata_t metadata
, sec_access_block_t access_block
);
910 * @function sec_protocol_metadata_serialize_with_options
913 * Serialize a `sec_protocol_metadata_t` to an `xpc_object_t` dictionary using information
914 * contained in the `metadata` and `options` objects.
917 * A `sec_protocol_metadata_t` instance.
919 * @return A xpc_object_t carrying the serialized metadata.
921 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
922 SEC_RETURNS_RETAINED __nullable xpc_object_t
923 sec_protocol_metadata_serialize_with_options(sec_protocol_metadata_t metadata
, sec_protocol_options_t options
);
926 * @function sec_protocol_metadata_get_tls_certificate_compression_used
929 * Determine if certificate compression was used for a given connection.
931 * See: https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-04
934 * A `sec_protocol_metadata_t` instance.
936 * @return True if certificate compression was negotiated and used.
938 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
940 sec_protocol_metadata_get_tls_certificate_compression_used(sec_protocol_metadata_t metadata
);
943 * @function sec_protocol_metadata_get_tls_certificate_compression_algorithm
946 * Return the certificate compression algorithm used. This will return 0
947 * if `sec_protocol_metadata_get_tls_certificate_compression_used` is false.
949 * See: https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-04
952 * A `sec_protocol_metadata_t` instance.
954 * @return IANA codepoint for the certificate compression algorithm.
956 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
958 sec_protocol_metadata_get_tls_certificate_compression_algorithm(sec_protocol_metadata_t metadata
);
961 * @function sec_protocol_metadata_copy_quic_transport_parameters
964 * Copy the peer's QUIC transport parameters.
967 * A `sec_protocol_metadata_t` instance.
969 * @return A dispatch_data_t carrying the connection peer's opaque QUIC tranport parameters.
971 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
972 SEC_RETURNS_RETAINED __nullable dispatch_data_t
973 sec_protocol_metadata_copy_quic_transport_parameters(sec_protocol_metadata_t metadata
);
976 * @function sec_protocol_metadata_get_handshake_time_ms
979 * Get the TLS handshake time in miliseconds. The result is undefined
980 * for connections not yet connected.
983 * A `sec_protocol_metadata_t` instance.
985 * @return A millisecond measurement of the TLS handshake time from start to finish.
987 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
988 #define SEC_PROTOCOL_HAS_METRIC_SPI_V1
990 sec_protocol_metadata_get_handshake_time_ms(sec_protocol_metadata_t metadata
);
993 * @function sec_protocol_metadata_get_handshake_rtt
996 * Get the observed TLS handshake RTT. This function must only be
997 * called after the connection is established. Calling this before
998 * the connection completes will yields an undefined result.
1000 * This is computed as the average RTT across all 1-RTT exchanges.
1001 * For TLS 1.3, this will be the time for the normal exchange. For prior
1002 * versions, or TLS 1.3 with HRR, this will be the average RTT across
1003 * multiple message flights.
1006 * A `sec_protocol_metadata_t` instance.
1008 * @return A millisecond measurement of the TLS handshake RTT.
1010 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1012 sec_protocol_metadata_get_handshake_rtt(sec_protocol_metadata_t metadata
);
1015 * @function sec_protocol_metadata_get_handshake_byte_count
1018 * Get the total number of bytes sent and received for the handshake.
1021 * A `sec_protocol_metadata_t` instance.
1023 * @return Number of bytes sent and received for the handshake.
1025 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1027 sec_protocol_metadata_get_handshake_byte_count(sec_protocol_metadata_t metadata
);
1030 * @function sec_protocol_metadata_get_handshake_sent_byte_count
1033 * Get the total number of bytes sent for the handshake.
1036 * A `sec_protocol_metadata_t` instance.
1038 * @return Number of bytes sent for the handshake.
1040 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1042 sec_protocol_metadata_get_handshake_sent_byte_count(sec_protocol_metadata_t metadata
);
1045 * @function sec_protocol_metadata_get_handshake_received_byte_count
1048 * Get the total number of bytes received for the handshake.
1051 * A `sec_protocol_metadata_t` instance.
1053 * @return Number of bytes received for the handshake.
1055 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1057 sec_protocol_metadata_get_handshake_received_byte_count(sec_protocol_metadata_t metadata
);
1060 * @function sec_protocol_metadata_get_handshake_read_stall_count
1063 * Get the total number of read stalls during the handshake.
1066 * A `sec_protocol_metadata_t` instance.
1068 * @return Number of read stalls.
1070 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1072 sec_protocol_metadata_get_handshake_read_stall_count(sec_protocol_metadata_t metadata
);
1075 * @function sec_protocol_metadata_get_handshake_write_stall_count
1078 * Get the total number of write stalls during the handshake.
1081 * A `sec_protocol_metadata_t` instance.
1083 * @return Number of write stalls.
1085 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1087 sec_protocol_metadata_get_handshake_write_stall_count(sec_protocol_metadata_t metadata
);
1090 * @function sec_protocol_metadata_get_handshake_async_call_count
1093 * Get the total number of asynchronous callbacks invoked during the handshake.
1096 * A `sec_protocol_metadata_t` instance.
1098 * @return Number of asynchronous callbacks.
1100 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1102 sec_protocol_metadata_get_handshake_async_call_count(sec_protocol_metadata_t metadata
);
1105 * @function sec_protocol_metadata_copy_sec_trust
1108 * Copy the `sec_trust_t` associated with a connection.
1111 * A `sec_protocol_metadata_t` instance.
1113 * @return A `sec_trust_t` instance.
1115 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1116 SEC_RETURNS_RETAINED __nullable sec_trust_t
1117 sec_protocol_metadata_copy_sec_trust(sec_protocol_metadata_t metadata
);
1120 * @function sec_protocol_metadata_copy_sec_identity
1123 * Copy the `sec_identity_t` associated with a connection.
1126 * A `sec_protocol_metadata_t` instance.
1128 * @return A `sec_identity_t` instance.
1130 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1131 SEC_RETURNS_RETAINED __nullable sec_identity_t
1132 sec_protocol_metadata_copy_sec_identity(sec_protocol_metadata_t metadata
);
1135 * @function sec_protocol_metadata_access_sent_certificates
1138 * Access the certificates which were sent to the peer on this connection.
1141 * A `sec_protocol_metadata_t` instance.
1144 * A block to invoke one or more times with `sec_certificate_t` instances.
1146 * @return Returns true if the peer certificates were accessible, false otherwise.
1148 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1150 sec_protocol_metadata_access_sent_certificates(sec_protocol_metadata_t metadata
,
1151 void (^handler
)(sec_certificate_t certificate
));
1154 * @function sec_protocol_metadata_get_tls_negotiated_group
1157 * Get a human readable representation of the negotiated key exchange group.
1160 * A `sec_protocol_metadata_t` instance.
1162 * @return A string representation of the negotiated group, or NULL if it does not exist.
1164 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1165 const char * __nullable
1166 sec_protocol_metadata_get_tls_negotiated_group(sec_protocol_metadata_t metadata
);
1169 * @function sec_protocol_configuration_copy_singleton
1172 * Copy the per-process `sec_protocol_configuration_t` object.
1174 * @return A non-nil `sec_protocol_configuration_t` instance.
1176 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1177 SEC_RETURNS_RETAINED sec_protocol_configuration_t
1178 sec_protocol_configuration_copy_singleton(void);
1180 #ifndef SEC_OBJECT_IMPL
1181 SEC_OBJECT_DECL(sec_protocol_configuration_builder
);
1182 #endif // !SEC_OBJECT_IMPL
1185 * @function sec_protocol_configuration_builder_create
1188 * This function is exposed for testing purposes only. It MUST NOT be called by clients.
1190 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1191 SEC_RETURNS_RETAINED sec_protocol_configuration_builder_t
1192 sec_protocol_configuration_builder_create(CFDictionaryRef dictionary
, bool is_apple
);
1195 * @function sec_protocol_configuration_create_with_builder
1198 * This function is exposed for testing purposes only. It MUST NOT be called by clients.
1200 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1201 SEC_RETURNS_RETAINED __nullable sec_protocol_configuration_t
1202 sec_protocol_configuration_create_with_builder(sec_protocol_configuration_builder_t builder
);
1205 * @block sec_protocol_output_handler_access_block_t
1208 * Block to be invoked to obtain the output handler for a given encryption level.
1210 typedef void *_Nullable(^sec_protocol_output_handler_access_block_t
)(sec_protocol_tls_encryption_level_t level
);
1213 * @function sec_protocol_options_set_output_handler_access_block
1216 * Set a block used to access output handler instances identified by encryption level.
1218 #define SEC_PROTOCOL_HAS_QUIC_OUTPUT_HANDLER_ACCESS_BLOCK 1
1219 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1221 sec_protocol_options_set_output_handler_access_block(sec_protocol_options_t options
,
1222 sec_protocol_output_handler_access_block_t access_block
);
1225 * @function sec_protocol_helper_ciphersuite_group_to_ciphersuite_list
1228 * Return a pointer to a statically allocated list of ciphersuites corresponding to `group`.
1231 * A `tls_ciphersuite_group_t` instance.
1234 * Pointer to storage for the ciphersuite list length.
1236 * @return Pointer to a statically allocated list, or NULL if an error occurred.
1238 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1239 const tls_ciphersuite_t
* __nullable
1240 sec_protocol_helper_ciphersuite_group_to_ciphersuite_list(tls_ciphersuite_group_t group
, size_t *list_count
);
1242 typedef CF_ENUM(uint16_t, sec_protocol_block_length_padding_t
) {
1243 SEC_PROTOCOL_BLOCK_LENGTH_PADDING_NONE
= 0,
1244 SEC_PROTOCOL_BLOCK_LENGTH_PADDING_DEFAULT
= 16,
1248 * @function sec_protocol_options_set_tls_block_length_padding
1251 * Pad TLS messages to a multiple of the specified block length. By default, padding is disabled.
1254 * A `sec_protocol_options_t` instance.
1256 * @param block_length_padding
1257 * A sec_protocol_block_length_padding_t variable specifying the block length padding. Setting the block length padding to 0 disables padding.
1259 * @return True if the padding policy has been successfully set, false otherwise.
1261 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
1263 sec_protocol_options_set_tls_block_length_padding(sec_protocol_options_t options
, sec_protocol_block_length_padding_t block_length_padding
);
1266 * @function sec_protocol_helper_ciphersuite_group_contains_ciphersuite
1269 * This function is exposed for testing purposes only. It MUST NOT be called by clients.
1272 * A `tls_ciphersuite_group_t` instance.
1275 * A `tls_ciphersuite_t` instance.
1277 * @return True if the ciphersuite group contains the given ciphersuite, false otherwise.
1279 API_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
1281 sec_protocol_helper_ciphersuite_group_contains_ciphersuite(tls_ciphersuite_group_t group
, tls_ciphersuite_t suite
);
1284 * @function sec_protocol_helper_ciphersuite_minimum_TLS_version
1287 * This function is exposed for testing purposes only. It MUST NOT be called by clients.
1289 * @param ciphersuite
1290 * A `tls_ciphersuite_t` instance.
1292 * @return The `tls_protocol_version_t` pertaining to the minimum TLS version designated for the given ciphersuite.
1294 API_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
1295 tls_protocol_version_t
1296 sec_protocol_helper_ciphersuite_minimum_TLS_version(tls_ciphersuite_t ciphersuite
);
1299 * @function sec_protocol_helper_ciphersuite_maximum_TLS_version
1302 * This function is exposed for testing purposes only. It MUST NOT be called by clients.
1304 * @param ciphersuite
1305 * A `tls_ciphersuite_t` instance.
1307 * @return The `tls_protocol_version_t` pertaining to the maximum TLS version designated for the given ciphersuite.
1309 API_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
1310 tls_protocol_version_t
1311 sec_protocol_helper_ciphersuite_maximum_TLS_version(tls_ciphersuite_t ciphersuite
);
1314 * @function sec_protocol_helper_get_ciphersuite_name
1317 * This function is exposed for testing purposes only. It MUST NOT be called by clients.
1319 * @param ciphersuite
1320 * A `tls_ciphersuite_t` instance.
1322 * @return A string representation of the given ciphersuite, or NULL if it does not exist.
1324 API_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0))
1325 const char * __nullable
1326 sec_protocol_helper_get_ciphersuite_name(tls_ciphersuite_t ciphersuite
);
1328 #define SEC_PROTOCOL_HAS_MULTI_PSK_SUPPORT 1
1330 #define SEC_PROTOCOL_HAS_PEER_AUTHENTICATION_OPTIONAL 1
1332 struct sec_protocol_options_content
{
1333 SSLProtocol min_version
;
1334 SSLProtocol max_version
;
1337 char *experiment_identifier
;
1338 uuid_t connection_id
;
1339 __nullable xpc_object_t ciphersuites
;
1340 xpc_object_t application_protocols
;
1341 sec_identity_t identity
;
1342 sec_array_t certificates
;
1343 xpc_object_t pre_shared_keys
;
1344 dispatch_data_t psk_identity_hint
;
1345 sec_protocol_key_update_t key_update_block
;
1346 dispatch_queue_t key_update_queue
;
1347 sec_protocol_challenge_t challenge_block
;
1348 dispatch_queue_t challenge_queue
;
1349 sec_protocol_verify_t verify_block
;
1350 dispatch_queue_t verify_queue
;
1351 dispatch_data_t quic_transport_parameters
;
1352 sec_protocol_tls_encryption_secret_update_t tls_secret_update_block
;
1353 dispatch_queue_t tls_secret_update_queue
;
1354 sec_protocol_tls_encryption_level_update_t tls_encryption_level_update_block
;
1355 dispatch_queue_t tls_encryption_level_update_queue
;
1356 sec_protocol_session_update_t session_update_block
;
1357 dispatch_queue_t session_update_queue
;
1358 dispatch_data_t session_state
;
1359 sec_protocol_private_key_sign_t private_key_sign_block
;
1360 sec_protocol_private_key_decrypt_t private_key_decrypt_block
;
1361 dispatch_queue_t private_key_queue
;
1362 dispatch_data_t dh_params
;
1363 xpc_object_t key_exchange_groups
;
1364 sec_protocol_tls_handshake_message_handler_t handshake_message_callback
;
1365 dispatch_queue_t handshake_message_callback_queue
;
1366 sec_protocol_pre_shared_key_selection_t psk_selection_block
;
1367 dispatch_queue_t psk_selection_queue
;
1370 size_t minimum_rsa_key_size
;
1371 size_t minimum_ecdsa_key_size
;
1372 SecSignatureHashAlgorithm minimum_signature_algorithm
;
1374 // Non-boolean options
1375 uint8_t tls_ticket_request_count
;
1377 // QUIC-specific access block
1378 sec_protocol_output_handler_access_block_t output_handler_access_block
;
1381 unsigned ats_required
: 1;
1382 unsigned ats_minimum_tls_version_allowed
: 1;
1383 unsigned ats_non_pfs_ciphersuite_allowed
: 1;
1384 unsigned trusted_peer_certificate
: 1;
1385 unsigned trusted_peer_certificate_override
: 1;
1386 unsigned disable_sni
: 1;
1387 unsigned disable_sni_override
: 1;
1388 unsigned enable_fallback_attempt
: 1;
1389 unsigned enable_fallback_attempt_override
: 1;
1390 unsigned enable_false_start
: 1;
1391 unsigned enable_false_start_override
: 1;
1392 unsigned enable_tickets
: 1;
1393 unsigned enable_tickets_override
: 1;
1394 unsigned enable_sct
: 1;
1395 unsigned enable_sct_override
: 1;
1396 unsigned enable_ocsp
: 1;
1397 unsigned enable_ocsp_override
: 1;
1398 unsigned enforce_ev
: 1;
1399 unsigned enforce_ev_override
: 1;
1400 unsigned enable_resumption
: 1;
1401 unsigned enable_resumption_override
: 1;
1402 unsigned enable_renegotiation
: 1;
1403 unsigned enable_renegotiation_override
: 1;
1404 unsigned enable_early_data
: 1;
1405 unsigned enable_early_data_override
: 1;
1406 unsigned peer_authentication_required
: 1;
1407 unsigned peer_authentication_optional
: 1;
1408 unsigned peer_authentication_override
: 1;
1409 unsigned certificate_compression_enabled
: 1;
1410 unsigned eddsa_enabled
: 1;
1411 unsigned tls_delegated_credentials_enabled
: 1;
1412 unsigned tls_grease_enabled
: 1;
1413 unsigned allow_unknown_alpn_protos
: 1;
1414 unsigned allow_unknown_alpn_protos_override
: 1;
1416 sec_protocol_block_length_padding_t tls_block_length_padding
;
1419 struct sec_protocol_metadata_content
{
1420 void *exporter_context
; // Opaque context for the exporter function
1421 sec_protocol_metadata_exporter exporter_function
; // Exporter function pointer. This MUST be set by the metadata allocator.
1422 void *session_exporter_context
; // Opaque context for the session exporter function
1423 sec_protocol_metadata_session_exporter session_exporter_function
;
1425 SSLProtocol negotiated_protocol_version
;
1426 SSLCipherSuite negotiated_ciphersuite
;
1427 const char *negotiated_protocol
;
1428 const char *server_name
;
1429 const char *experiment_identifier
;
1430 uuid_t connection_id
;
1432 sec_array_t sent_certificate_chain
;
1433 sec_array_t peer_certificate_chain
;
1434 xpc_object_t pre_shared_keys
;
1435 dispatch_data_t peer_public_key
;
1436 xpc_object_t supported_signature_algorithms
;
1437 dispatch_data_t request_certificate_types
;
1438 sec_array_t signed_certificate_timestamps
;
1439 sec_array_t ocsp_response
;
1440 sec_array_t distinguished_names
;
1441 dispatch_data_t quic_transport_parameters
;
1442 sec_identity_t identity
;
1443 sec_trust_t trust_ref
;
1444 const char *negotiated_curve
;
1445 const char *peer_public_key_type
;
1446 const char *certificate_request_type
;
1447 uint64_t ticket_lifetime
;
1448 uint64_t max_early_data_supported
;
1449 uint64_t alert_type
;
1450 uint64_t alert_code
;
1451 uint64_t handshake_state
;
1452 uint64_t stack_error
;
1453 uint64_t handshake_rtt
;
1454 uint16_t certificate_compression_algorithm
;
1455 uint64_t handshake_time
;
1456 uint64_t total_byte_count
;
1457 uint64_t sent_byte_count
;
1458 uint64_t received_byte_count
;
1459 size_t read_stall_count
;
1460 size_t write_stall_count
;
1461 size_t async_call_count
;
1463 unsigned failure
: 1;
1464 unsigned sct_enabled
: 1;
1465 unsigned ocsp_enabled
: 1;
1466 unsigned early_data_accepted
: 1;
1467 unsigned false_start_used
: 1;
1468 unsigned ticket_offered
: 1;
1469 unsigned ticket_received
: 1;
1470 unsigned session_resumed
: 1;
1471 unsigned session_renewed
: 1;
1472 unsigned resumption_attempted
: 1;
1473 unsigned alpn_used
: 1;
1474 unsigned npn_used
: 1;
1475 unsigned early_data_sent
: 1;
1476 unsigned certificate_compression_used
: 1;
1479 SEC_ASSUME_NONNULL_END
1483 #endif /* SecProtocolPriv_h */