mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 09:50:28 +00:00
clang-format
This commit is contained in:
parent
975c6c8c0a
commit
d9be18413a
1 changed files with 24 additions and 21 deletions
|
@ -5073,8 +5073,10 @@ typedef struct TlsConnection_s {
|
|||
*
|
||||
* If setup fails, the socket will be closed.
|
||||
*
|
||||
* @param conn A TLS connection struct. Caller is responsible for managing this memory.
|
||||
* @param sock The file descriptor number for an open socket on which to negotiate TLS.
|
||||
* @param conn A TLS connection struct. Caller is responsible for managing this
|
||||
* memory.
|
||||
* @param sock The file descriptor number for an open socket on which to
|
||||
* negotiate TLS.
|
||||
* @param hostname The hostname of the remote server, for certificate checks.
|
||||
* @return 1 on success, 0 on failure.
|
||||
*/
|
||||
|
@ -5128,17 +5130,18 @@ int TlsConnectionSetup(TlsConnection *conn, int sock, const char *hostname) {
|
|||
*
|
||||
* @param C A TlsConnection that has alreday been setup.
|
||||
* @param B A buffer into which to write the received data.
|
||||
* @param L The maximum number of bytes to read. `buf` must be at least this big.
|
||||
* @return >0 if the read was successful, 0 or less if the read failed. Values greater
|
||||
* than 0 indicate the number of bytes read.
|
||||
* @param L The maximum number of bytes to read. `buf` must be at least this
|
||||
* big.
|
||||
* @return >0 if the read was successful, 0 or less if the read failed. Values
|
||||
* greater than 0 indicate the number of bytes read.
|
||||
*/
|
||||
#define TlsConnectionRead(C, B, L) mbedtls_ssl_read(&(C->ctx), B, L)
|
||||
|
||||
/**
|
||||
* Close a TLS connection.
|
||||
*
|
||||
* @param conn A TlsConnection that should be closed. Note that the caller is responsible
|
||||
* for cleaning up the memory occupied by the TlsConnection.
|
||||
* @param conn A TlsConnection that should be closed. Note that the caller is
|
||||
* responsible for cleaning up the memory occupied by the TlsConnection.
|
||||
* @return 1
|
||||
*/
|
||||
int TlsConnectionClose(TlsConnection *conn) {
|
||||
|
@ -5231,8 +5234,8 @@ int LuaCryptoTlsWrap(lua_State *L) {
|
|||
} else if (rc == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED) {
|
||||
lua_pop(L, 1);
|
||||
return LuaNilTlsError(
|
||||
L, DescribeSslVerifyFailure(conn->ctx.session_negotiate->verify_result), rc
|
||||
);
|
||||
L, DescribeSslVerifyFailure(conn->ctx.session_negotiate->verify_result),
|
||||
rc);
|
||||
} else {
|
||||
lua_pop(L, 1);
|
||||
return LuaNilTlsError(L, "handshake", rc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue