more keystore work

This commit is contained in:
eyedeekay
2025-02-25 16:15:18 -05:00
parent d0b4db769e
commit c6867e0b16
2 changed files with 11 additions and 1 deletions

View File

@ -152,6 +152,7 @@ func (ks *RouterInfoKeystore) ConstructRouterInfo(addresses []*router_address.Ro
if err != nil {
return nil, err
}
pubKeySize := keyCert.CryptoSize()
sigKeySize := keyCert.SignatureSize()
paddingSize := keys_and_cert.KEYS_AND_CERT_DATA_SIZE - (pubKeySize + sigKeySize)

View File

@ -66,8 +66,17 @@ func CreateRouter(cfg *config.RouterConfig) (*Router, error) {
// sha256 hash of public key
pubHash := sha256.Sum256(pub.Bytes())
b32PubHash := base32.EncodeToString(pubHash[:])
log.Debug("Router public hash:", b32PubHash)
log.Debug("Router public key hash:", b32PubHash)
}
ri, err := r.RouterInfoKeystore.ConstructRouterInfo(nil)
if err != nil {
log.WithError(err).Error("Failed to construct RouterInfo")
return nil, err
} else {
log.Debug("RouterInfo constructed successfully")
log.Debug("RouterInfo:", ri)
}
r.TransportMuxer = transport.Mux()
return r, err