diff options
| author | jsing <> | 2017-03-07 12:29:31 +0000 |
|---|---|---|
| committer | jsing <> | 2017-03-07 12:29:31 +0000 |
| commit | 038da82731f723f3c2d799485f99c5c330d7832a (patch) | |
| tree | e85f588d44c623bad4d36aa27260d0beceb890b1 /src | |
| parent | cfcfab851673299bea759c10bc1fac9d1cc1c204 (diff) | |
| download | openbsd-038da82731f723f3c2d799485f99c5c330d7832a.tar.gz openbsd-038da82731f723f3c2d799485f99c5c330d7832a.tar.bz2 openbsd-038da82731f723f3c2d799485f99c5c330d7832a.zip | |
We no longer need to keep pointers following tls_config_set_*() calls.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libtls/gotls/tls.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/regress/lib/libtls/gotls/tls.go b/src/regress/lib/libtls/gotls/tls.go index 74c34b4064..88d58ab33b 100644 --- a/src/regress/lib/libtls/gotls/tls.go +++ b/src/regress/lib/libtls/gotls/tls.go | |||
| @@ -26,7 +26,6 @@ var ( | |||
| 26 | 26 | ||
| 27 | // TLSConfig provides configuration options for a TLS context. | 27 | // TLSConfig provides configuration options for a TLS context. |
| 28 | type TLSConfig struct { | 28 | type TLSConfig struct { |
| 29 | caFile *C.char | ||
| 30 | tlsCfg *C.struct_tls_config | 29 | tlsCfg *C.struct_tls_config |
| 31 | } | 30 | } |
| 32 | 31 | ||
| @@ -57,11 +56,9 @@ func NewConfig() (*TLSConfig, error) { | |||
| 57 | 56 | ||
| 58 | // SetCAFile sets the CA file to be used for connections. | 57 | // SetCAFile sets the CA file to be used for connections. |
| 59 | func (c *TLSConfig) SetCAFile(filename string) { | 58 | func (c *TLSConfig) SetCAFile(filename string) { |
| 60 | if c.caFile != nil { | 59 | caFile := C.CString(filename) |
| 61 | C.free(unsafe.Pointer(c.caFile)) | 60 | defer C.free(unsafe.Pointer(caFile)) |
| 62 | } | 61 | C.tls_config_set_ca_file(c.tlsCfg, caFile) |
| 63 | c.caFile = C.CString(filename) | ||
| 64 | C.tls_config_set_ca_file(c.tlsCfg, c.caFile) | ||
| 65 | } | 62 | } |
| 66 | 63 | ||
| 67 | // InsecureNoVerifyCert disables certificate verification for the connection. | 64 | // InsecureNoVerifyCert disables certificate verification for the connection. |
