forked from TrueCloudLab/lego
allinkl: removed deprecated sha1 hashing (#1713)
This commit is contained in:
parent
fd8a9f86ec
commit
60bd1c205e
1 changed files with 2 additions and 6 deletions
|
@ -2,7 +2,6 @@ package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/sha1"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -46,9 +45,6 @@ func NewClient(login string, password string) *Client {
|
||||||
// - sessionLifetime: Validity of the token in seconds.
|
// - sessionLifetime: Validity of the token in seconds.
|
||||||
// - sessionUpdateLifetime: with `true` the session is extended with every request.
|
// - sessionUpdateLifetime: with `true` the session is extended with every request.
|
||||||
func (c Client) Authentication(sessionLifetime int, sessionUpdateLifetime bool) (string, error) {
|
func (c Client) Authentication(sessionLifetime int, sessionUpdateLifetime bool) (string, error) {
|
||||||
hash := sha1.New()
|
|
||||||
hash.Write([]byte(c.password))
|
|
||||||
|
|
||||||
sul := "N"
|
sul := "N"
|
||||||
if sessionUpdateLifetime {
|
if sessionUpdateLifetime {
|
||||||
sul = "Y"
|
sul = "Y"
|
||||||
|
@ -56,8 +52,8 @@ func (c Client) Authentication(sessionLifetime int, sessionUpdateLifetime bool)
|
||||||
|
|
||||||
ar := AuthRequest{
|
ar := AuthRequest{
|
||||||
Login: c.login,
|
Login: c.login,
|
||||||
AuthData: fmt.Sprintf("%x", hash.Sum(nil)),
|
AuthData: c.password,
|
||||||
AuthType: "sha1",
|
AuthType: "plain",
|
||||||
SessionLifetime: sessionLifetime,
|
SessionLifetime: sessionLifetime,
|
||||||
SessionUpdateLifetime: sul,
|
SessionUpdateLifetime: sul,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue