diff options
| author | jsing <> | 2019-11-02 13:56:17 +0000 |
|---|---|---|
| committer | jsing <> | 2019-11-02 13:56:17 +0000 |
| commit | d92505c71f123a8d3b82dbac2cde08b9de1d02e8 (patch) | |
| tree | e0597fc1fb4e5b269c4843efb8152e6e601a5eaa /src/regress/lib/libtls/gotls/tls.go | |
| parent | fe3c9dd220ea0b44c7bdd7e323437b1a60e827d7 (diff) | |
| download | openbsd-d92505c71f123a8d3b82dbac2cde08b9de1d02e8.tar.gz openbsd-d92505c71f123a8d3b82dbac2cde08b9de1d02e8.tar.bz2 openbsd-d92505c71f123a8d3b82dbac2cde08b9de1d02e8.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. |
