Run clang-format on ssl.h This removes noise from the SPAKE2+ CL. Change-Id: I6038bf02e80295f58ad955db47e4687547de8dbe Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/73807 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> Auto-Submit: Adam Langley <agl@google.com>
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index bb7b257..1ddc903 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h
@@ -1151,9 +1151,8 @@ // The behavior of this function is undefined except during the callbacks set by // by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the // handshake is paused because of them. -OPENSSL_EXPORT size_t -SSL_get0_peer_delegation_algorithms(const SSL *ssl, - const uint16_t **out_sigalgs); +OPENSSL_EXPORT size_t SSL_get0_peer_delegation_algorithms( + const SSL *ssl, const uint16_t **out_sigalgs); // SSL_CTX_get0_certificate returns |ctx|'s leaf certificate. OPENSSL_EXPORT X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); @@ -1211,8 +1210,7 @@ // SSL_set_ocsp_response sets the OCSP response that is sent to clients which // request it. It returns one on success and zero on error. The caller retains // ownership of |response|. -OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, - const uint8_t *response, +OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, const uint8_t *response, size_t response_len); // SSL_SIGN_* are signature algorithm values as defined in TLS 1.3. @@ -1372,8 +1370,7 @@ #define SSL_FILETYPE_ASN1 2 OPENSSL_EXPORT int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, - const char *file, - int type); + const char *file, int type); OPENSSL_EXPORT int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); @@ -1532,8 +1529,7 @@ // that this credential should be considered only when it matches a peer request // for a particular issuer via a negotiation mechanism (such as the // certificate_authorities extension). -OPENSSL_EXPORT int SSL_CREDENTIAL_must_match_issuer( - const SSL_CREDENTIAL *cred); +OPENSSL_EXPORT int SSL_CREDENTIAL_must_match_issuer(const SSL_CREDENTIAL *cred); // SSL_can_release_private_key returns one if |ssl| will no longer call into the // private key and zero otherwise. If the function returns one, the caller can @@ -1854,8 +1850,8 @@ // verification. The caller does not take ownership of the result. // // This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. -OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * - SSL_get0_peer_certificates(const SSL *ssl); +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) *SSL_get0_peer_certificates( + const SSL *ssl); // SSL_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to point to // |*out_len| bytes of SCT information from the server. This is only valid if @@ -1969,8 +1965,9 @@ // SSL_SESSION_from_bytes parses |in_len| bytes from |in| as an SSL_SESSION. It // returns a newly-allocated |SSL_SESSION| on success or NULL on error. -OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_from_bytes( - const uint8_t *in, size_t in_len, const SSL_CTX *ctx); +OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_from_bytes(const uint8_t *in, + size_t in_len, + const SSL_CTX *ctx); // SSL_SESSION_get_version returns a string describing the TLS or DTLS version // |session| was established at. For example, "TLSv1.2" or "DTLSv1". @@ -2032,7 +2029,7 @@ // unverified list of certificates as sent by the peer, not the final chain // built during verification. The caller does not take ownership of the result. OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * - SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session); +SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session); // SSL_SESSION_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to // point to |*out_len| bytes of SCT information stored in |session|. This is @@ -2220,7 +2217,7 @@ // SSL_SESS_CACHE_NO_INTERNAL, on a server, disables the internal session // cache. #define SSL_SESS_CACHE_NO_INTERNAL \ - (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE) + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE) // SSL_CTX_set_session_cache_mode sets the session cache mode bits for |ctx| to // |mode|. It returns the previous value. @@ -2478,9 +2475,9 @@ // WARNING: |callback| wildly breaks the usual return value convention and is // called in two different modes. OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_key_cb( - SSL_CTX *ctx, int (*callback)(SSL *ssl, uint8_t *key_name, uint8_t *iv, - EVP_CIPHER_CTX *ctx, HMAC_CTX *hmac_ctx, - int encrypt)); + SSL_CTX *ctx, + int (*callback)(SSL *ssl, uint8_t *key_name, uint8_t *iv, + EVP_CIPHER_CTX *ctx, HMAC_CTX *hmac_ctx, int encrypt)); // ssl_ticket_aead_result_t enumerates the possible results from decrypting a // ticket with an |SSL_TICKET_AEAD_METHOD|. @@ -2844,8 +2841,7 @@ // SSL_set1_param sets verification parameters from |param|. It returns one on // success and zero on failure. The caller retains ownership of |param|. -OPENSSL_EXPORT int SSL_set1_param(SSL *ssl, - const X509_VERIFY_PARAM *param); +OPENSSL_EXPORT int SSL_set1_param(SSL *ssl, const X509_VERIFY_PARAM *param); // SSL_CTX_get0_param returns |ctx|'s |X509_VERIFY_PARAM| for certificate // verification. The caller must not release the returned pointer but may call @@ -3014,10 +3010,10 @@ STACK_OF(CRYPTO_BUFFER) *name_list); // SSL_set0_CA_names sets |ssl|'s CA name list for the certificate authorities -// extension to |name_list|, which should contain DER-encoded distinguished names -// (RFC 5280). It takes ownership of |name_list|. +// extension to |name_list|, which should contain DER-encoded distinguished +// names (RFC 5280). It takes ownership of |name_list|. OPENSSL_EXPORT void SSL_set0_CA_names(SSL *ssl, - STACK_OF(CRYPTO_BUFFER) *name_list); + STACK_OF(CRYPTO_BUFFER) *name_list); // SSL_CTX_set0_client_CAs sets |ctx|'s client certificate CA list to // |name_list|, which should contain DER-encoded distinguished names (RFC 5280). @@ -3042,12 +3038,12 @@ // // The returned stack is owned by |ssl|, as are its contents. It should not be // used past the point where the handshake is restarted after the callback. -OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * - SSL_get0_server_requested_CAs(const SSL *ssl); +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs( + const SSL *ssl); // SSL_CTX_get_client_CA_list returns |ctx|'s client certificate CA list. -OPENSSL_EXPORT STACK_OF(X509_NAME) * - SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); +OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list( + const SSL_CTX *ctx); // SSL_add_client_CA appends |x509|'s subject to the client certificate CA list. // It returns one on success or zero on error. The caller retains ownership of @@ -3202,8 +3198,9 @@ // |SSL_get_pending_cipher| to query the cipher suite. This may be used to // implement HTTP/2's cipher suite constraints. OPENSSL_EXPORT void SSL_CTX_set_alpn_select_cb( - SSL_CTX *ctx, int (*cb)(SSL *ssl, const uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg), + SSL_CTX *ctx, + int (*cb)(SSL *ssl, const uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, void *arg), void *arg); // SSL_get0_alpn_selected gets the selected ALPN protocol (if any) from |ssl|. @@ -3368,8 +3365,9 @@ // the client to offer NPN in the ClientHello. Callers thus should not configure // this callback in TLS client contexts that are not intended to use NPN. OPENSSL_EXPORT void SSL_CTX_set_next_proto_select_cb( - SSL_CTX *ctx, int (*cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg), + SSL_CTX *ctx, + int (*cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, const uint8_t *in, + unsigned in_len, void *arg), void *arg); // SSL_get0_next_proto_negotiated sets |*out_data| and |*out_len| to point to @@ -3485,10 +3483,10 @@ #define SRTP_AES128_CM_SHA1_32 0x0002 #define SRTP_AES128_F8_SHA1_80 0x0003 #define SRTP_AES128_F8_SHA1_32 0x0004 -#define SRTP_NULL_SHA1_80 0x0005 -#define SRTP_NULL_SHA1_32 0x0006 -#define SRTP_AEAD_AES_128_GCM 0x0007 -#define SRTP_AEAD_AES_256_GCM 0x0008 +#define SRTP_NULL_SHA1_80 0x0005 +#define SRTP_NULL_SHA1_32 0x0006 +#define SRTP_AEAD_AES_128_GCM 0x0007 +#define SRTP_AEAD_AES_256_GCM 0x0008 // SSL_CTX_set_srtp_profiles enables SRTP for all SSL objects created from // |ctx|. |profile| contains a colon-separated list of profile names. It returns @@ -4801,8 +4799,9 @@ // a server (respectively, client) handshake completes, fails, or is paused. // The |value| argument is one if the handshake succeeded and <= 0 // otherwise. -OPENSSL_EXPORT void SSL_CTX_set_info_callback( - SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)); +OPENSSL_EXPORT void SSL_CTX_set_info_callback(SSL_CTX *ctx, + void (*cb)(const SSL *ssl, + int type, int value)); // SSL_CTX_get_info_callback returns the callback set by // |SSL_CTX_set_info_callback|. @@ -4812,8 +4811,9 @@ // SSL_set_info_callback configures a callback to be run at various events // during a connection's lifetime. See |SSL_CTX_set_info_callback|. -OPENSSL_EXPORT void SSL_set_info_callback( - SSL *ssl, void (*cb)(const SSL *ssl, int type, int value)); +OPENSSL_EXPORT void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl, int type, + int value)); // SSL_get_info_callback returns the callback set by |SSL_set_info_callback|. OPENSSL_EXPORT void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, @@ -5218,16 +5218,16 @@ #define SSL_get_cipher(ssl) SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) #define SSL_get_cipher_bits(ssl, out_alg_bits) \ - SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), out_alg_bits) + SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), out_alg_bits) #define SSL_get_cipher_version(ssl) \ - SSL_CIPHER_get_version(SSL_get_current_cipher(ssl)) + SSL_CIPHER_get_version(SSL_get_current_cipher(ssl)) #define SSL_get_cipher_name(ssl) \ - SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) + SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)) #define SSL_get_time(session) SSL_SESSION_get_time(session) #define SSL_set_time(session, time) SSL_SESSION_set_time((session), (time)) #define SSL_get_timeout(session) SSL_SESSION_get_timeout(session) #define SSL_set_timeout(session, timeout) \ - SSL_SESSION_set_timeout((session), (timeout)) + SSL_SESSION_set_timeout((session), (timeout)) struct ssl_comp_st { int id; @@ -5328,19 +5328,19 @@ #define SSL_want_read(ssl) (SSL_want(ssl) == SSL_READING) #define SSL_want_write(ssl) (SSL_want(ssl) == SSL_WRITING) - // SSL_get_finished writes up to |count| bytes of the Finished message sent by - // |ssl| to |buf|. It returns the total untruncated length or zero if none has - // been sent yet. At TLS 1.3 and later, it returns zero. - // - // Use |SSL_get_tls_unique| instead. +// SSL_get_finished writes up to |count| bytes of the Finished message sent by +// |ssl| to |buf|. It returns the total untruncated length or zero if none has +// been sent yet. At TLS 1.3 and later, it returns zero. +// +// Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count); - // SSL_get_peer_finished writes up to |count| bytes of the Finished message - // received from |ssl|'s peer to |buf|. It returns the total untruncated length - // or zero if none has been received yet. At TLS 1.3 and later, it returns - // zero. - // - // Use |SSL_get_tls_unique| instead. +// SSL_get_peer_finished writes up to |count| bytes of the Finished message +// received from |ssl|'s peer to |buf|. It returns the total untruncated length +// or zero if none has been received yet. At TLS 1.3 and later, it returns +// zero. +// +// Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count); @@ -5816,7 +5816,7 @@ #define SSL_CTX_set_session_cache_mode SSL_CTX_set_session_cache_mode #define SSL_CTX_set_tlsext_servername_arg SSL_CTX_set_tlsext_servername_arg #define SSL_CTX_set_tlsext_servername_callback \ - SSL_CTX_set_tlsext_servername_callback + SSL_CTX_set_tlsext_servername_callback #define SSL_CTX_set_tlsext_ticket_key_cb SSL_CTX_set_tlsext_ticket_key_cb #define SSL_CTX_set_tlsext_ticket_keys SSL_CTX_set_tlsext_ticket_keys #define SSL_CTX_set_tmp_dh SSL_CTX_set_tmp_dh @@ -5834,7 +5834,7 @@ #define SSL_get_negotiated_group SSL_get_negotiated_group #define SSL_get_options SSL_get_options #define SSL_get_secure_renegotiation_support \ - SSL_get_secure_renegotiation_support + SSL_get_secure_renegotiation_support #define SSL_need_tmp_RSA SSL_need_tmp_RSA #define SSL_num_renegotiations SSL_num_renegotiations #define SSL_session_reused SSL_session_reused @@ -5854,7 +5854,7 @@ #define SSL_set_tmp_rsa SSL_set_tmp_rsa #define SSL_total_renegotiations SSL_total_renegotiations -#endif // !defined(BORINGSSL_PREFIX) +#endif // !defined(BORINGSSL_PREFIX) #if defined(__cplusplus)