aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-26 23:31:17 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-26 23:31:17 +0100
commit0c1b5b987647bb264a1027565357b1377e3f5fad (patch)
tree5c47636c824bdc30dd276db40477606b3b13cece /client.go
parenta6db8ecb747ac7ee0554c948b1ec7fdd4da290a8 (diff)
Move Thumb into Account
Diffstat (limited to 'client.go')
-rw-r--r--client.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/client.go b/client.go
index b0f76a0..45dca55 100644
--- a/client.go
+++ b/client.go
@@ -212,7 +212,7 @@ func pickChallenge(c []Challenge) (int, Challenge) {
return -1, Challenge{}
}
-func (c *Client) Authorize(a *Account, altnames []string) error {
+func (c *Client) Authorize(s Signer, altnames []string) error {
ident := Identifier{
Type: IdentDNS,
Value: altnames[0],
@@ -221,7 +221,7 @@ func (c *Client) Authorize(a *Account, altnames []string) error {
Resource: ResNewAuthz,
Identifier: ident,
}
- resp, err := c.post(c.NewAuthz, a, r)
+ resp, err := c.post(c.NewAuthz, s, r)
if err != nil {
return err
}
@@ -232,24 +232,24 @@ func (c *Client) Authorize(a *Account, altnames []string) error {
return errors.New("can't solve any challenges")
}
- ka, _ := Thumb(ch.Token, a.PrivKey.Public())
+ ka, _ := s.Thumb(ch.Token)
ans := &Challenge{
Resource: ResChallenge,
Type: ch.Type,
KeyAuthorization: ka,
}
- _, err = c.post(ch.URI, a, ans)
+ _, err = c.post(ch.URI, s, ans)
- var s Solver
+ var sol Solver
switch ch.Type {
case ChallengeHTTP:
- s = &httpChallenge{Addr: "localhost:8080", Challenge: *ans}
+ sol = &httpChallenge{Addr: "localhost:8080", Challenge: *ans}
default:
return errChallengeType
}
- if err := Solve(s, time.Minute); err != nil {
+ if err := Solve(sol, time.Minute); err != nil {
return err
}