From 9a4e26a518dc5f929b3d35add80b302ff7734bc2 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sun, 1 Nov 2015 10:58:58 -0700 Subject: [PATCH] letsencrypt: Don't store KeyFile as field in user; staying consistent --- caddy/letsencrypt/user.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/caddy/letsencrypt/user.go b/caddy/letsencrypt/user.go index 1e1ab2c4..4d4d4829 100644 --- a/caddy/letsencrypt/user.go +++ b/caddy/letsencrypt/user.go @@ -20,7 +20,6 @@ import ( type User struct { Email string Registration *acme.RegistrationResource - KeyFile string key *rsa.PrivateKey } @@ -64,7 +63,7 @@ func getUser(email string) (User, error) { } // load their private key - user.key, err = loadRSAPrivateKey(user.KeyFile) + user.key, err = loadRSAPrivateKey(storage.UserKeyFile(email)) if err != nil { return user, err } @@ -82,8 +81,7 @@ func saveUser(user User) error { } // save private key file - user.KeyFile = storage.UserKeyFile(user.Email) - err = saveRSAPrivateKey(user.key, user.KeyFile) + err = saveRSAPrivateKey(user.key, storage.UserKeyFile(user.Email)) if err != nil { return err }