fix client broke from last commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Steven Polley 2024-04-19 22:08:16 -06:00
parent 2951c1f684
commit 1e195c3768

View File

@ -4,6 +4,7 @@ Copyright © 2024 Steven Polley <himself@stevenpolley.net>
package cmd package cmd
import ( import (
"encoding/base32"
"fmt" "fmt"
"log" "log"
"net" "net"
@ -50,9 +51,13 @@ Example usage:
if err != nil { if err != nil {
log.Fatalf("failed to read file 'hyp.secret': %v", err) log.Fatalf("failed to read file 'hyp.secret': %v", err)
} }
sharedSecret := string(secretBytes)
ports, err := otphyp.GeneratePorts(sharedSecret, time.Now()) decodedSecret, err := base32.StdEncoding.DecodeString(string(secretBytes))
if err != nil {
log.Fatalf("failed to base32 decode secret '%s': %w", secretFilePath, err)
}
ports, err := otphyp.GeneratePorts(decodedSecret, time.Now())
if err != nil { if err != nil {
log.Fatalf("failed to generate ports from shared secret: %v", err) log.Fatalf("failed to generate ports from shared secret: %v", err)
} }