Skip to content

Commit

Permalink
allinkl: removed deprecated sha1 hashing (#1713)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-defa committed Sep 17, 2022
1 parent fd8a9f8 commit 60bd1c2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions providers/dns/allinkl/internal/client.go
Expand Up @@ -2,7 +2,6 @@ package internal

import (
"bytes"
"crypto/sha1"
"encoding/json"
"encoding/xml"
"fmt"
Expand Down Expand Up @@ -46,18 +45,15 @@ func NewClient(login string, password string) *Client {
// - sessionLifetime: Validity of the token in seconds.
// - sessionUpdateLifetime: with `true` the session is extended with every request.
func (c Client) Authentication(sessionLifetime int, sessionUpdateLifetime bool) (string, error) {
hash := sha1.New()
hash.Write([]byte(c.password))

sul := "N"
if sessionUpdateLifetime {
sul = "Y"
}

ar := AuthRequest{
Login: c.login,
AuthData: fmt.Sprintf("%x", hash.Sum(nil)),
AuthType: "sha1",
AuthData: c.password,
AuthType: "plain",
SessionLifetime: sessionLifetime,
SessionUpdateLifetime: sul,
}
Expand Down

0 comments on commit 60bd1c2

Please sign in to comment.