]> Cypherpunks.ru repositories - govpn.git/blobdiff - common.go
Use A-EKE instead of EKE. Doc refactoring. Preparing for 3.0 release
[govpn.git] / common.go
index b87133a59a2ca80c6c16182b5a0c998ecd18029d..fbafd56ab680de6afc61eb50f41890e1ed1babfc 100644 (file)
--- a/common.go
+++ b/common.go
@@ -19,8 +19,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 package govpn
 
 import (
-       "encoding/hex"
-       "io/ioutil"
        "log"
        "os"
        "os/exec"
@@ -54,25 +52,6 @@ func ScriptCall(path, ifaceName string) ([]byte, error) {
        return out, err
 }
 
-// Read authentication key from the file.
-// Key is 64 hexadecimal chars long.
-func KeyRead(path string) *[KeySize]byte {
-       keyData, err := ioutil.ReadFile(path)
-       if err != nil {
-               panic("Unable to read keyfile: " + err.Error())
-       }
-       if len(keyData) < 64 {
-               panic("Key must be 64 hex characters long")
-       }
-       keyDecoded, err := hex.DecodeString(string(keyData[0:64]))
-       if err != nil {
-               panic("Unable to decode the key: " + err.Error())
-       }
-       key := new([KeySize]byte)
-       copy(key[:], keyDecoded)
-       return key
-}
-
 // Zero each byte
 func sliceZero(data []byte) {
        for i := 0; i < len(data); i++ {