v0.0.598 prevent json marshalling of PassHash
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 2m35s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 2m35s
This commit is contained in:
@@ -6,13 +6,15 @@ import (
|
||||
"crypto/sha512"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/totpext"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const LatestPassHashVersion = 5
|
||||
@@ -317,6 +319,13 @@ func (ph PassHash) String() string {
|
||||
return string(ph)
|
||||
}
|
||||
|
||||
func (ph PassHash) MarshalJSON() ([]byte, error) {
|
||||
if ph == "" {
|
||||
return json.Marshal("")
|
||||
}
|
||||
return json.Marshal("*****")
|
||||
}
|
||||
|
||||
func HashPassword(plainpass string, totpSecret []byte) (PassHash, error) {
|
||||
return HashPasswordV5(plainpass, totpSecret)
|
||||
}
|
||||
|
Reference in New Issue
Block a user