This commit is contained in:
emersion 2017-08-22 10:16:20 +02:00
parent 653a8a0dc0
commit d964a951a0
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
4 changed files with 50 additions and 50 deletions

View File

@ -116,8 +116,6 @@ func (c *Client) Auth(username, password, twoFactorCode string, info *AuthInfo)
} }
} }
log.Printf("%#v\n", info)
proofs, err := srp([]byte(password), info) proofs, err := srp([]byte(password), info)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -9,7 +9,7 @@ import (
"strconv" "strconv"
) )
const Version = 2 const Version = 3
const headerAPIVersion = "X-Pm-Apiversion" const headerAPIVersion = "X-Pm-Apiversion"
@ -39,15 +39,17 @@ func (err apiError) Error() string {
// Client is a ProtonMail API client. // Client is a ProtonMail API client.
type Client struct { type Client struct {
HTTPClient *http.Client
RootURL string RootURL string
AppVersion string AppVersion string
ClientID string ClientID string
ClientSecret string ClientSecret string
HTTPClient *http.Client
} }
func (c *Client) newRequest(method, path string, body io.Reader) (*http.Request, error) { func (c *Client) newRequest(method, path string, body io.Reader) (*http.Request, error) {
req, err := http.NewRequest(method, c.RootURL + path, body) req, err := http.NewRequest(method, c.RootURL+path, body)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -41,7 +41,7 @@ func reverse(b []byte) {
func itoa(i *big.Int, l int) []byte { func itoa(i *big.Int, l int) []byte {
b := i.Bytes() b := i.Bytes()
reverse(b) reverse(b)
padding := make([]byte, l/8 - len(b)) padding := make([]byte, l/8-len(b))
b = append(b, padding...) b = append(b, padding...)
return b return b
} }