|
@@ -4,11 +4,13 @@ import (
|
|
|
"bytes"
|
|
"bytes"
|
|
|
"encoding/binary"
|
|
"encoding/binary"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
- "gopkg.in/jcmturner/gokrb5.v2/iana/errorcode"
|
|
|
|
|
- "gopkg.in/jcmturner/gokrb5.v2/messages"
|
|
|
|
|
|
|
+ "io"
|
|
|
"math/rand"
|
|
"math/rand"
|
|
|
"net"
|
|
"net"
|
|
|
"time"
|
|
"time"
|
|
|
|
|
+
|
|
|
|
|
+ "gopkg.in/jcmturner/gokrb5.v2/iana/errorcode"
|
|
|
|
|
+ "gopkg.in/jcmturner/gokrb5.v2/messages"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// SendToKDC performs network actions to send data to the KDC.
|
|
// SendToKDC performs network actions to send data to the KDC.
|
|
@@ -162,7 +164,7 @@ func sendTCP(kdc string, b []byte) ([]byte, error) {
|
|
|
s := binary.BigEndian.Uint32(sh)
|
|
s := binary.BigEndian.Uint32(sh)
|
|
|
|
|
|
|
|
rb := make([]byte, s, s)
|
|
rb := make([]byte, s, s)
|
|
|
- _, err = conn.Read(rb)
|
|
|
|
|
|
|
+ _, err = io.ReadFull(conn, rb)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return r, fmt.Errorf("error reading response: %v", err)
|
|
return r, fmt.Errorf("error reading response: %v", err)
|
|
|
}
|
|
}
|