aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@ziggo.nl>2015-05-12 20:24:11 +0800
committerBas van Kervel <basvankervel@ziggo.nl>2015-05-12 20:24:11 +0800
commitb79dd188d916da7adbf448dc27b0c59a04e0938d (patch)
tree7980ae848a916171fbc65fb958eebdf0c98406dc /crypto
parentd82caa5ce38705d2dcdc2ba15c93df9325504e34 (diff)
downloadgo-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.gz
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.bz2
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.lz
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.xz
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.zst
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.zip
replaced several path.* with filepath.* which is platform independent
Diffstat (limited to 'crypto')
-rw-r--r--crypto/key_store_passphrase.go4
-rw-r--r--crypto/key_store_plain.go10
2 files changed, 7 insertions, 7 deletions
diff --git a/crypto/key_store_passphrase.go b/crypto/key_store_passphrase.go
index 7d21b6604..9d36d7b03 100644
--- a/crypto/key_store_passphrase.go
+++ b/crypto/key_store_passphrase.go
@@ -72,7 +72,7 @@ import (
"errors"
"io"
"os"
- "path"
+ "path/filepath"
"code.google.com/p/go-uuid/uuid"
"github.com/ethereum/go-ethereum/crypto/randentropy"
@@ -163,7 +163,7 @@ func (ks keyStorePassphrase) DeleteKey(keyAddr []byte, auth string) (err error)
return err
}
- keyDirPath := path.Join(ks.keysDirPath, hex.EncodeToString(keyAddr))
+ keyDirPath := filepath.Join(ks.keysDirPath, hex.EncodeToString(keyAddr))
return os.RemoveAll(keyDirPath)
}
diff --git a/crypto/key_store_plain.go b/crypto/key_store_plain.go
index 9bbaf1c15..581968d7c 100644
--- a/crypto/key_store_plain.go
+++ b/crypto/key_store_plain.go
@@ -30,7 +30,7 @@ import (
"io"
"io/ioutil"
"os"
- "path"
+ "path/filepath"
)
// TODO: rename to KeyStore when replacing existing KeyStore
@@ -91,20 +91,20 @@ func (ks keyStorePlain) StoreKey(key *Key, auth string) (err error) {
}
func (ks keyStorePlain) DeleteKey(keyAddr []byte, auth string) (err error) {
- keyDirPath := path.Join(ks.keysDirPath, hex.EncodeToString(keyAddr))
+ keyDirPath := filepath.Join(ks.keysDirPath, hex.EncodeToString(keyAddr))
err = os.RemoveAll(keyDirPath)
return err
}
func GetKeyFile(keysDirPath string, keyAddr []byte) (fileContent []byte, err error) {
fileName := hex.EncodeToString(keyAddr)
- return ioutil.ReadFile(path.Join(keysDirPath, fileName, fileName))
+ return ioutil.ReadFile(filepath.Join(keysDirPath, fileName, fileName))
}
func WriteKeyFile(addr []byte, keysDirPath string, content []byte) (err error) {
addrHex := hex.EncodeToString(addr)
- keyDirPath := path.Join(keysDirPath, addrHex)
- keyFilePath := path.Join(keyDirPath, addrHex)
+ keyDirPath := filepath.Join(keysDirPath, addrHex)
+ keyFilePath := filepath.Join(keyDirPath, addrHex)
err = os.MkdirAll(keyDirPath, 0700) // read, write and dir search for user
if err != nil {
return err