Fixed the key thing again.
This commit is contained in:
@ -80,12 +80,12 @@ I'm eventually going to make the manager implement net.Conn. This won't be
|
||||
exposed in the default application probably though, but rather as a library.
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAlughYwACgkQ11wDs5te
|
||||
FOHorAf8CzDvhSk+3wlFSCCeO2v5xzBLps+Q6MchI6vi2MQ/KF1H41Y/uc8boeJ9
|
||||
OUBsT5h8Ig8IgkOIL0MVsa4573C47Ox3eUbuhV1hqoGZKmc9OSF6xEQiIwda9Ptg
|
||||
VnyDACGtk35V7EGUnXDSzsr+AQasbLhEsnwoVaIZF3S3J3lO4rXnRqnDPSfJz4dB
|
||||
QnxgnSLjhaZBSu+gVfr/WwhtkXP7ffnhbc0SXntV0u8jvk36AIYmEQgNtcim+l4P
|
||||
2FmG3Z2MgfKf4fn1HfpVzepY9K6EsnxR1OJTpTctpXmPhh5Q0kFLe4ErrjSA8OOw
|
||||
LsRnWdaDJ3qYEuvCcMWgyH7KUWMtuw==
|
||||
=4UVf
|
||||
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAlugh5AACgkQ11wDs5te
|
||||
FOG3yQf7BfPSZ7iYj7PUBK7jmjHtmZp6TeEYgI98dzcXUZctMcg+EYzVMBo+q7Yc
|
||||
jAbuNQa953DKjvYtQ0PMWbDXH1qFoazHf7EYX4TJJfWdU9uJJ8H/0HJqBt6fVgeN
|
||||
CDSqq+d0+QokwN75IOmRIHwfu5NWJYQUOyUkAQEGCBQgvYXPWq9mu4IWRL9hHOXy
|
||||
C+TgyOBUx5C7BAclP/M32kXnEoooVdgfQOCI/rcUhjG2piMJsg4lh2dg7fXv8udf
|
||||
Fvsy1GODl1ppDQViZmNQ9R2Bqr3QoCvCPXST1Uo0iyA1tJei2Z5djdk7xRj3VxRl
|
||||
seAfY156PYsqXznXNdITWovBsSNbGg==
|
||||
=Yh59
|
||||
-----END PGP SIGNATURE-----
|
||||
|
@ -27,13 +27,13 @@ func Encrypt(i2pkeypath, aeskeypath string) error {
|
||||
if r, e := ioutil.ReadFile(i2pkeypath); e != nil {
|
||||
return e
|
||||
} else {
|
||||
if _, err := os.Stat(aeskeypath + ".key"); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(aeskeypath); os.IsNotExist(err) {
|
||||
key := cryptopasta.NewEncryptionKey()
|
||||
ioutil.WriteFile(aeskeypath, bytes(*key), 644)
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
if ra, re := ioutil.ReadFile(aeskeypath + ".key"); re != nil {
|
||||
if ra, re := ioutil.ReadFile(aeskeypath); re != nil {
|
||||
return e
|
||||
} else {
|
||||
crypted, err := cryptopasta.Encrypt(r, key(ra))
|
||||
@ -52,10 +52,10 @@ func Decrypt(i2pkeypath, aeskeypath string) error {
|
||||
if r, e := ioutil.ReadFile(i2pkeypath); e != nil {
|
||||
return e
|
||||
} else {
|
||||
if _, err := os.Stat(aeskeypath + ".key"); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(aeskeypath); os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
if ra, re := ioutil.ReadFile(aeskeypath + ".key"); re != nil {
|
||||
if ra, re := ioutil.ReadFile(aeskeypath); re != nil {
|
||||
return e
|
||||
} else {
|
||||
crypted, err := cryptopasta.Decrypt(r, key(ra))
|
||||
|
@ -27,13 +27,13 @@ func Encrypt(i2pkeypath, aeskeypath string) error {
|
||||
if r, e := ioutil.ReadFile(i2pkeypath); e != nil {
|
||||
return e
|
||||
} else {
|
||||
if _, err := os.Stat(aeskeypath + ".key"); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(aeskeypath); os.IsNotExist(err) {
|
||||
key := cryptopasta.NewEncryptionKey()
|
||||
ioutil.WriteFile(aeskeypath, bytes(*key), 644)
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
if ra, re := ioutil.ReadFile(aeskeypath + ".key"); re != nil {
|
||||
if ra, re := ioutil.ReadFile(aeskeypath); re != nil {
|
||||
return e
|
||||
} else {
|
||||
crypted, err := cryptopasta.Encrypt(r, key(ra))
|
||||
@ -52,10 +52,10 @@ func Decrypt(i2pkeypath, aeskeypath string) error {
|
||||
if r, e := ioutil.ReadFile(i2pkeypath); e != nil {
|
||||
return e
|
||||
} else {
|
||||
if _, err := os.Stat(aeskeypath + ".key"); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(aeskeypath); os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
if ra, re := ioutil.ReadFile(aeskeypath + ".key"); re != nil {
|
||||
if ra, re := ioutil.ReadFile(aeskeypath); re != nil {
|
||||
return e
|
||||
} else {
|
||||
crypted, err := cryptopasta.Decrypt(r, key(ra))
|
||||
|
Reference in New Issue
Block a user