blob: 5eca90b2b4467817eec923755d5533c7690dd9ba [file] [log] [blame]
package vgrpc
import (
"net"
"time"
// TODO(krakauer0: this is in like 4 places too many
"google.golang.org/grpc/credentials"
"v.io/x/ref/runtime"
)
type VanadiumCred struct{}
// TODO(krakauer): This needs to actually encrypt stuff, right? See https://github.com/grpc/grpc-go/blob/master/credentials/credentials.go.
func (c *VanadiumCred) ClientHandshake(addr string, rawConn net.Conn, timeout time.Duration) (net.Conn, credentials.AuthInfo, error) {
return runtime.ClientHandshake(addr, rawConn, timeout)
}
func (c *VanadiumCred) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {
return runtime.ServerHandshake(rawConn)
}
func (c *VanadiumCred) Info() credentials.ProtocolInfo {
return credentials.ProtocolInfo{
SecurityProtocol: runtime.SecurityProtocol(),
SecurityVersion: runtime.SecurityVersion(),
}
}