cmd/scepclient: add -encryption-algo flag (DES-CBC/AES-128-CBC/AES-256-CBC) - #253
Closed
sleventyeleven wants to merge 1 commit into
Closed
sleventyeleven wants to merge 1 commit into
sleventyeleven wants to merge 1 commit into
Conversation
scepclient currently hardcodes the SCEP PKIOperation request's CMS EnvelopedData encryption to DES-CBC (smallstep/pkcs7's package-level ContentEncryptionAlgorithm default), with no way to override it and no GetCACaps-based negotiation. Some SCEP servers reject DES-CBC outright - AWS Private CA's Connector for SCEP returns "ValidationException: Unsupported algorithm: 1.3.14.3.2.7" (the DES-CBC OID) for every enrollment attempt. Adds -encryption-algo (DES-CBC, AES-128-CBC, or AES-256-CBC), defaulting to DES-CBC to preserve existing behavior for servers that only support it. Verified against a real AWS Private CA Connector for SCEP deployment: -encryption-algo AES-256-CBC results in pkiStatus=SUCCESS and a valid issued certificate, where the previous DES-CBC-only behavior always failed.
Author
|
Closed because this is almost entirely redundant in use case and feature as PR #252 |
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.
Summary
scepclientcurrently hardcodes the SCEPPKIOperationrequest's CMSEnvelopedDataencryption to DES-CBC (smallstep/pkcs7's package-levelContentEncryptionAlgorithmdefault), with no way to override it and noGetCACaps-based negotiation for this choice.Some SCEP servers reject DES-CBC outright. AWS Private CA's Connector for
SCEP returns
ValidationException: Unsupported algorithm: 1.3.14.3.2.7(the DES-CBC OID) for every enrollment attempt, making
scepclientcurrently unusable against it.
This adds a single new flag,
-encryption-algo, acceptingDES-CBC,AES-128-CBC, orAES-256-CBC, defaulting toDES-CBCto preserveexisting behavior for any server that only supports it.
Testing
Verified against a real AWS Private CA Connector for SCEP deployment:
Unsupported algorithm: 1.3.14.3.2.7.-encryption-algo AES-256-CBC:pkiStatus=SUCCESS, validcertificate issued and confirmed usable for TLS ClientAuth against a
downstream mTLS-verifying service.
A temporary test build with this change (plus binaries for
windows/amd64, darwin/amd64, darwin/arm64) is available at
https://github.com/sleventyeleven/scep/releases/tag/v2.3.0-encryption-algo-test1
if useful for review.
Notes
DES-CBCremains the default.(
parseEncryptionAlgorithm), and settingpkcs7.ContentEncryptionAlgorithmonce during flag parsing in
main().github.com/smallstep/pkcs7was already an indirect dependency (viagithub.com/smallstep/scep); this adds it as an explicit directgo.modrequirement since it's now imported directly.