Install
Works with Drupal: ^10.3 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
24.34 KB
MD5: 5179ee43458610b68fbdb050edfd3514
SHA-1: 642d5c10070a94789b61e34f525f12c40782b922
SHA-256: a59bf9a5f8b31c8d18b766af6c0b0c60bc06880e470e40c12d408af99909051f
Download zip
37.84 KB
MD5: b5b92b2036976aac3f04b2beb1d579aa
SHA-1: 37e384b9fde2c966934731c7b3f373bbac605126
SHA-256: fe895c7cc182b58d57fe4a4b3ef9538c2bf1e77060ad2db43e497d068aa1321f
Release notes
Highlights
- OpenSSH-style SHA-256 fingerprints. Stored fingerprints move from md5-hex to
SHA256:<base64>(matchesssh-keygen -lf). Rundrush updatedbafter upgrading — existing rows are migrated in batched chunks. - Minimum RSA modulus length as a per-field setting (default 2048 bits; 0 disables). Enforced via phpseclib.
- Full structural validation. Every accepted algorithm is parsed by
phpseclib3\Crypt\PublicKeyLoader, so curve-invalid ed25519, malformed RSA, and similar payloads are rejected — not just those failing the prefix check. - Length cap. The raw key value is capped at 16 KB (was previously bounded only by the underlying
text/bigcolumn).
Security
- XSS in
NameFormatter::viewElements()— the admin-supplied name now renders as#plain_textinstead of#markup. - MD5 fingerprint replaced with SHA-256 (MD5 collisions are practical).
sshkey.permissions.ymlremoved — it declared seven permissions that no code ever enforced; site builders granting them got no behavior change. Access has always flowed through the host entity's field-access logic.
Bug fixes
- #3579902: Field-settings algorithm checkboxes now show saved selections when reopened; the validator honors the per-field allowlist (no more silent fallback to "accept anything the module recognises");
SshKeyConstraintconstructor accepts Drupal's options-array calling convention. - #3579871: Declared a description on the
sshkey_defaultfield type — eliminates the "Undefined array key 'description'" warning on the Add Field form. - #3590025: Added per-field
min_rsa_bitssetting. - #3590156: Pre-stable audit — see Highlights, Security, and Cleanup.
Behaviour changes
- Fingerprint column is now
NOT NULL. Utils::getFingerprintMd5()has been removed.getFingerprintSha256()now returns the OpenSSHSHA256:-prefixed format with base64 padding stripped.- The 7 permissions in
sshkey.permissions.ymlare gone (see Security). - The
sshkey.modulefile is gone — the deadsshkey_theme()+
theme_sshkey_fingerprint()functions had no callers.
Cleanup
generateSampleValue()now returns a wire-format key that passes the validator, so devel-generate fixtures actually exercise downstream paths.sshkey.info.ymldescription rewritten for grammar.field.storage_settings.sshkey_defaultschema no longer carries thefooplaceholder.- Three lingering
@todo/@DCGscaffold markers resolved. - README rewritten to describe the module as it actually is (field type, no permissions, no uniqueness constraint, SHA-256 fingerprints).
Upgrade
- Run
drush updatedb(or visitupdate.php). This migrates existing
fingerprints from MD5 to SHA-256 and tightens the column to NOT NULL. - If you have downstream code calling
Utils::getFingerprintMd5(), switch to
getFingerprintSha256()(note the newSHA256:prefix in the return value). - If you'd been granting the now-removed permissions to roles, those grants are silently dropped — they were never enforced, so no functional change.
Commits in this release
- ca591c8 Issue #3579902 by colan: Restore saved algorithm checkboxes in field settings form.
- 49552bd Issue #3579902 by colan: Honor field-settings algorithm allowlist during key validation.
- 2716141 Issue #3579902 by colan: Fix SshKeyConstraint to accept the factory's options-array call.
- fab0926 Issue #3579871 by colan: Declare a description on the sshkey_default field type.
- 5def9e8 Issue #3590025 by colan: Add minimum RSA key length enforcement to the SshKey field.
- 2ab473b Issue #3590156 by colan: Fix grammar in module description.
- bc4deef Issue #3590156 by colan: Fix misleading comment in SshKeyItem::setValue().
- c88e011 Issue #3590156 by colan: Remove the 'foo' placeholder from storage-settings schema.
- 0b0d910 Issue #3590156 by colan: Drop the dead sshkey.module file.
- 7264117 Issue #3590156 by colan: Escape admin-supplied name in NameFormatter (XSS).
- f678d31 Issue #3590156 by colan: Cap the SSH-key value at 16 KB.
- 279125a Issue #3590156 by colan: Make generateSampleValue() produce a parseable SSH key.
- a94bbd0 Issue #3590156 by colan: Fix CI failures from prior commits.
- b462023 Issue #3590156 by colan: Migrate fingerprints from MD5 to OpenSSH SHA-256.
- 44109ce Issue #3590156 by colan: Fix the SHA-256 migration commit's CI and counter.
- c85b466 Issue #3590156 by colan: Remove unenforced sshkey.permissions.yml.
- e3ff807 Issue #3590156 by colan: Validate full key structure via phpseclib.
- 075b718 Issue #3590156 by colan: Resolve trailing @todo and @DCG scaffold markers.
- 2fb54ca Issue #3590156 by colan: Fix CI failures from the structural-check commit.
- 621707b Issue #3590156 by colan: Rewrite README to match the module as it actually is.
- affcf7b Merge branch
'3590156-pre-stable-audit' into '4.x'