X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fgovpn%2Fidentify.go;h=54c87d31e0117a300bab5a6b21fc4edd5aec1f01;hb=9364defa689e91c6fb54651876fbf2d02eec35ec;hp=a0b7d22f65de59d0840de73f8b4efbb8be6626ca;hpb=17c2f7327a0178dd61a8a2afa26a0dda383154a9;p=govpn.git diff --git a/src/govpn/identify.go b/src/govpn/identify.go index a0b7d22..54c87d3 100644 --- a/src/govpn/identify.go +++ b/src/govpn/identify.go @@ -21,7 +21,6 @@ package govpn import ( "crypto/subtle" "encoding/hex" - "errors" "log" "sync" @@ -38,22 +37,6 @@ func (id PeerId) String() string { return hex.EncodeToString(id[:]) } -// Decode identification string. -// It must be 32 hexadecimal characters long. -func IDDecode(raw string) (*PeerId, error) { - if len(raw) != IDSize*2 { - return nil, errors.New("ID must be 32 characters long") - } - idDecoded, err := hex.DecodeString(raw) - if err != nil { - return nil, errors.New("ID must contain hexadecimal characters only") - } - idP := new([IDSize]byte) - copy(idP[:], idDecoded) - id := PeerId(*idP) - return &id, nil -} - type CipherCache struct { c map[PeerId]*xtea.Cipher l sync.RWMutex