Repository navigation
Conversation
A CSR subject containing a value that pkix.Name cannot represent, such as the RELATIVE-OID of a Trust Anchor ID name, failed to sign with "asn1: cannot marshal nil value" because ParseCertificateRequest rebuilt the subject from a decoded pkix.Name. signer: RELATIVE-OID attribute values are taken from the encoded subject when the decoded subject is built, so such a subject signs. The CSR's subject bytes are kept only when the signing profile sets the new KeepCSRSubject flag, which cannot be set from a configuration file. local.Sign copies them only when the profile whitelists the subject and clears them when the sign request overrides the subject. With a name_whitelist, every common name of a kept raw subject must be a string that matches. CSRs that master signs produce the same certificates unless the flag is set. csr: CertificateRequest.RawSubject is used verbatim as the CSR subject. It is not read from or written to JSON or YAML, must be a structurally valid non-empty X.501 Name (ValidateRawName), and is rejected together with CN, Names or SerialNumber. helpers: IsUnsigned reports the RFC 9925 id-alg-unsigned algorithm. initca: New and NewFromSigner set KeepCSRSubject for a request with a raw subject. RenewFromSigner carries the old subject over as encoded and rejects unsigned roots, since renewal would produce a signed certificate. Unsign rewrites a version 3 certificate of any kind as an RFC 9925 unsigned certificate without verifying its signature. It removes the authority key identifier and issuer alternative name extensions and rejects an issuer without attributes or an issuerUniqueID. NewUnsigned and NewUnsignedFromSigner are New and NewFromSigner followed by Unsign, without Hosts. NewUnsignedFromSigner applies req.CRL and req.CA.Backdate as NewUnsigned does and checks the signature under the certificate's public key before removing it. A CA with an empty subject, which RenewFromSigner accepted before, is now rejected because an empty Name fails the raw subject check.
mitch292
approved these changes
Nov 18, 2026
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.
Replaces #1466 (Luke is out of office) so it can merge without pushing to his fork.
This branch is Luke's commit a47b854 from #1466, unchanged, plus a merge of current master (cb5f8cf, which includes #1465). See #1466 for the description and review history.
The only conflict was at the end of
helpers/helpers_test.go, where #1465 and #1466 both appended tests. The resolution keeps both sides and adds back the two closing braces ofTestIsUnsigned.git show --remerge-diff 7973d27bshows only the resolution:go vet ./helpersandgo test ./helpers ./csr ./initca ./signer/...pass.Please merge with a merge commit rather than squash, so Luke's commit keeps its authorship and message.