diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-08-27 01:32:30 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-08-27 01:32:30 +0100 |
commit | 921818bca208f0c70e85ec670074cb3905cbbc82 (patch) | |
tree | 4aa67ad2bb2083bd486db3f99680d6d08a2c36b3 /vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go | |
parent | 7f1c9358805302344a89c1fed4eab1342931b061 (diff) |
Update dependencies
Diffstat (limited to 'vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go')
-rw-r--r-- | vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go b/vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go index 3302cfe..d8ec001 100644 --- a/vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go +++ b/vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.go @@ -101,6 +101,8 @@ func (ss *saslSession) Step(serverData []byte) (clientData []byte, done bool, er } var buffer C.PVOID var bufferLength C.ULONG + var outBuffer C.PVOID + var outBufferLength C.ULONG if len(serverData) > 0 { buffer = (C.PVOID)(unsafe.Pointer(&serverData[0])) bufferLength = C.ULONG(len(serverData)) @@ -108,20 +110,20 @@ func (ss *saslSession) Step(serverData []byte) (clientData []byte, done bool, er var status C.int if ss.authComplete { // Step 3: last bit of magic to use the correct server credentials - status = C.sspi_send_client_authz_id(&ss.context, &buffer, &bufferLength, ss.cstr(ss.userPlusRealm)) + status = C.sspi_send_client_authz_id(&ss.context, &outBuffer, &outBufferLength, ss.cstr(ss.userPlusRealm)) } else { // Step 1 + Step 2: set up security context with the server and TGT - status = C.sspi_step(&ss.credHandle, ss.hasContext, &ss.context, &buffer, &bufferLength, ss.cstr(ss.target)) + status = C.sspi_step(&ss.credHandle, ss.hasContext, &ss.context, buffer, bufferLength, &outBuffer, &outBufferLength, ss.cstr(ss.target)) } - if buffer != C.PVOID(nil) { - defer C.free(unsafe.Pointer(buffer)) + if outBuffer != C.PVOID(nil) { + defer C.free(unsafe.Pointer(outBuffer)) } if status != C.SEC_E_OK && status != C.SEC_I_CONTINUE_NEEDED { ss.errored = true return nil, false, ss.handleSSPIErrorCode(status) } - clientData = C.GoBytes(unsafe.Pointer(buffer), C.int(bufferLength)) + clientData = C.GoBytes(unsafe.Pointer(outBuffer), C.int(outBufferLength)) if status == C.SEC_E_OK { ss.authComplete = true return clientData, true, nil |