diff options
author | jsing <> | 2019-11-02 13:56:17 +0000 |
---|---|---|
committer | jsing <> | 2019-11-02 13:56:17 +0000 |
commit | 760ebfaeaec25b212c2db98a19207c3d8bb86389 (patch) | |
tree | e0597fc1fb4e5b269c4843efb8152e6e601a5eaa /src/regress/lib/libtls/gotls/tls.go | |
parent | 719154ccb7bebf2723783eca89365034db24821f (diff) | |
download | openbsd-760ebfaeaec25b212c2db98a19207c3d8bb86389.tar.gz openbsd-760ebfaeaec25b212c2db98a19207c3d8bb86389.tar.bz2 openbsd-760ebfaeaec25b212c2db98a19207c3d8bb86389.zip |
Add tls_conn_cipher_strength() to gotls regress.
Diffstat (limited to 'src/regress/lib/libtls/gotls/tls.go')
-rw-r--r-- | src/regress/lib/libtls/gotls/tls.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/regress/lib/libtls/gotls/tls.go b/src/regress/lib/libtls/gotls/tls.go index be75e71f4f..dbd3b717b0 100644 --- a/src/regress/lib/libtls/gotls/tls.go +++ b/src/regress/lib/libtls/gotls/tls.go | |||
@@ -256,6 +256,16 @@ func (t *TLS) ConnCipher() (string, error) { | |||
256 | return C.GoString(cipher), nil | 256 | return C.GoString(cipher), nil |
257 | } | 257 | } |
258 | 258 | ||
259 | // ConnCipherStrength returns the strength in bits for the symmetric | ||
260 | // cipher that is used for the connection. | ||
261 | func (t *TLS) ConnCipherStrength() (int, error) { | ||
262 | strength := C.tls_conn_cipher_strength(t.ctx) | ||
263 | if strength == 0 { | ||
264 | return 0, errors.New("no connection cipher strength") | ||
265 | } | ||
266 | return int(strength), nil | ||
267 | } | ||
268 | |||
259 | // Connect attempts to establish an TLS connection to the specified host on | 269 | // Connect attempts to establish an TLS connection to the specified host on |
260 | // the given port. The host may optionally contain a colon separated port | 270 | // the given port. The host may optionally contain a colon separated port |
261 | // value if the port string is specified as an empty string. | 271 | // value if the port string is specified as an empty string. |