]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/identify.go
Use Argon2d PHC winner instead of PBKDF2
[govpn.git] / src / govpn / identify.go
index a0b7d22f65de59d0840de73f8b4efbb8be6626ca..54c87d31e0117a300bab5a6b21fc4edd5aec1f01 100644 (file)
@@ -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