[JENKINS-76219] Update SSH key fingerprints to use SHA-256#631
Merged
kuisathaverat merged 1 commit intoOct 18, 2025
Merged
Conversation
Replace MD5 fingerprint format with SHA-256 Base64 encoding to match OpenSSH 6.8+ behavior. Existing stored keys automatically use the new format without migration.
kuisathaverat
approved these changes
Oct 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace MD5 fingerprint format with SHA-256 Base64 encoding to match OpenSSH 6.8+ behavior. Existing stored keys automatically use the new format without migration.
Description
Updates SSH host key fingerprints to use SHA-256 with Base64 encoding instead of the deprecated MD5 hex format, aligning with OpenSSH 6.8+ standards.
Old format:
B5:A8:8D:C1:11:E5:C5:E0:53:62:DD:20:E1:DA:85New format:
SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8Changes Made
HostKey.getFingerprint()to use SHA-256 MessageDigest with Base64 encodingMessageDigest,NoSuchAlgorithmException, andBase64HostKeyTestto verify the new fingerprint formatBackward Compatibility
Fully backward compatible - no data migration required:
Testing done
mvn clean test)HostKeyTestwith two test cases:testFingerprintUsesSHA256()- Verifies SHA256: prefix and valid Base64 encodingtestFingerprintFormat()- Validates the complete format matchesSHA256:[Base64]patternmvn spotless:apply)mvn clean install)HostKeyHelperstores raw key bytes, ensuring automatic migrationManual Testing:
The change affects fingerprint display in:
Submitter checklist
Related Issues
Fixes JENKINS-76219 - Please update to using SHA-256 for SSH key fingerprints
Additional Notes
This change only affects the display format of fingerprints. The underlying storage and verification mechanisms are unchanged, ensuring seamless operation with existing configurations. Users will see the new SHA-256 format immediately without any action required on their part.