mirror of
https://git.numenor-labs.us/dsfx.git
synced 2025-04-29 08:10:34 +00:00
remove unnecessary logs
This commit is contained in:
parent
b78eb2b71a
commit
560d5aef6d
@ -5,7 +5,6 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -55,9 +54,7 @@ func ExportPrivateKey(key ed25519.PrivateKey) ([]byte, error) {
|
|||||||
|
|
||||||
// ExportPublicKey exports the public key as a byte slice.
|
// ExportPublicKey exports the public key as a byte slice.
|
||||||
func ExportPublicKey(key ed25519.PublicKey) ([]byte, error) {
|
func ExportPublicKey(key ed25519.PublicKey) ([]byte, error) {
|
||||||
log.Println("exporting key", len(key))
|
|
||||||
encoded := []byte(base64.StdEncoding.EncodeToString(key))
|
encoded := []byte(base64.StdEncoding.EncodeToString(key))
|
||||||
log.Println("exported key", len(encoded))
|
|
||||||
return encoded, nil
|
return encoded, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,12 +74,10 @@ func ImportPrivateKey(keyBytes []byte) (ed25519.PrivateKey, error) {
|
|||||||
|
|
||||||
// ImportPublicKey imports the public key from a byte slice.
|
// ImportPublicKey imports the public key from a byte slice.
|
||||||
func ImportPublicKey(keyBytes []byte) (ed25519.PublicKey, error) {
|
func ImportPublicKey(keyBytes []byte) (ed25519.PublicKey, error) {
|
||||||
log.Println("importing key", len(keyBytes))
|
|
||||||
decoded, err := base64.StdEncoding.DecodeString(string(keyBytes))
|
decoded, err := base64.StdEncoding.DecodeString(string(keyBytes))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to decode public key: %w", err)
|
return nil, fmt.Errorf("failed to decode public key: %w", err)
|
||||||
}
|
}
|
||||||
log.Println("imported key", len(decoded))
|
|
||||||
return ed25519.PublicKey(decoded), nil
|
return ed25519.PublicKey(decoded), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/pkg/assert"
|
"koti.casa/numenor-labs/dsfx/pkg/assert"
|
||||||
@ -128,9 +127,6 @@ func Initiate(
|
|||||||
}
|
}
|
||||||
assert.Assert(len(derivedKey) == 32, "invalid shared secret size")
|
assert.Assert(len(derivedKey) == 32, "invalid shared secret size")
|
||||||
|
|
||||||
log.Println("raw pub key", len(ourPublicKeyRaw))
|
|
||||||
log.Println("raw sig", len(signature))
|
|
||||||
|
|
||||||
plaintext := make([]byte, 0, len(ourPublicKeyRaw)+len(signature))
|
plaintext := make([]byte, 0, len(ourPublicKeyRaw)+len(signature))
|
||||||
plaintext = append(plaintext, ourPublicKeyRaw...)
|
plaintext = append(plaintext, ourPublicKeyRaw...)
|
||||||
plaintext = append(plaintext, signature...)
|
plaintext = append(plaintext, signature...)
|
||||||
@ -142,8 +138,6 @@ func Initiate(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println(string(plaintext), len(plaintext))
|
|
||||||
|
|
||||||
// Write the boxed message to the connection.
|
// Write the boxed message to the connection.
|
||||||
logger.DebugContext(ctx, "sending authentication message", slog.Int("message.size", len(boxedMsg)))
|
logger.DebugContext(ctx, "sending authentication message", slog.Int("message.size", len(boxedMsg)))
|
||||||
boxedMsgPrepared, err := buffer.NewLenPrefixed(boxedMsg)
|
boxedMsgPrepared, err := buffer.NewLenPrefixed(boxedMsg)
|
||||||
@ -287,7 +281,6 @@ func Accept(ctx context.Context, conn io.ReadWriteCloser, lPrivKey ed25519.Priva
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
log.Println(string(plaintext), len(plaintext))
|
|
||||||
|
|
||||||
clientPublicKeyRaw := plaintext[:44]
|
clientPublicKeyRaw := plaintext[:44]
|
||||||
signature := plaintext[44:]
|
signature := plaintext[44:]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user