blob: ae959144b3c243c4339d8bee70ebf314de05afe4 [file] [log] [blame]
package vgrpc
import (
"log"
"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) {
defer log.Printf("Finished ClientHandshake.\n\n\n")
return runtime.ClientHandshake(addr, rawConn, timeout)
}
func (c *VanadiumCred) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {
defer log.Printf("Finished ServerHandshake.\n\n\n")
return runtime.ServerHandshake(rawConn)
}
func (c *VanadiumCred) Info() credentials.ProtocolInfo {
return credentials.ProtocolInfo{
SecurityProtocol: runtime.SecurityProtocol(),
SecurityVersion: runtime.SecurityVersion(),
}
}