diff options
author | jsing <> | 2017-03-07 12:29:31 +0000 |
---|---|---|
committer | jsing <> | 2017-03-07 12:29:31 +0000 |
commit | dd68f290ab0f303298d5c65c7e4dde3ccbf56d11 (patch) | |
tree | e85f588d44c623bad4d36aa27260d0beceb890b1 | |
parent | 3c4f58bea7403d47518cc64d65cd733d3c607f8b (diff) | |
download | openbsd-dd68f290ab0f303298d5c65c7e4dde3ccbf56d11.tar.gz openbsd-dd68f290ab0f303298d5c65c7e4dde3ccbf56d11.tar.bz2 openbsd-dd68f290ab0f303298d5c65c7e4dde3ccbf56d11.zip |
We no longer need to keep pointers following tls_config_set_*() calls.
-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. |