Add INFO logging for fingerprint passthrough

This commit is contained in:
Russell Ballestrini 2025-12-21 09:47:57 -05:00
parent 56577b727e
commit f127c624c0

View file

@ -296,14 +296,16 @@ func (p *SkelPlugin) createUpstreamWithClientKey(conn libplugin.ConnMetadata, to
}
// If client public key is provided, prepend fingerprint to username
// Format: "SHA256:xxxxx.originaluser" - maldoror/upstream can parse this
// Format: "fp:xxxxx.originaluser" - maldoror/upstream can parse this
if clientPublicKey != nil {
hash := sha256.Sum256(clientPublicKey)
fingerprint := base64.RawStdEncoding.EncodeToString(hash[:])
// Replace any dots in fingerprint with underscores to avoid parsing issues
fingerprint = strings.ReplaceAll(fingerprint, ".", "_")
user = "fp:" + fingerprint + "." + user
log.Debugf("passing client fingerprint in username: %s", user)
log.Infof("passing client fingerprint in username: %s", user)
} else {
log.Infof("no client public key provided, using original username: %s", user)
}
p.cache.SetDefault(conn.UniqueID(), to)