Open
Bug 292285
Opened 20 years ago
Updated 2 years ago
crlutil incorrectly encoding issuerAltNames extension
Categories
(NSS :: Tools, defect, P2)
Tracking
(Not tracked)
NEW
People
(Reporter: alvolkov.bgs, Unassigned)
Details
Attachments
(3 files)
|
3.20 KB,
patch
|
nelson
:
review-
|
Details | Diff | Splinter Review |
|
2.62 KB,
patch
|
julien.pierre
:
review-
|
Details | Diff | Splinter Review |
|
1.50 KB,
patch
|
julien.pierre
:
review+
|
Details | Diff | Splinter Review |
Example that was taken from nss/tests/cerl.sh: crlutil -d /export/SC/ws/nss-3.10-docs/mozilla/tests_results/security/goa1.2/CA -G -n TestCA -f ../tests.pw.30857 -o ../server/root.crl_40-42_or<<EOF_CRLINI addext issuerAltNames 0 "rfc822Name:caemail@ca.com|dnsName:ca.com|x400Address:x400Address|directoryName:CN=NSS Test CA,O=BOGUS NSS,L=Mountain View,ST=California,C=US|URI:http://ca.com|ipAddress:192.168.0.1|registerID=reg CA" EOF_CRLINI CRL Info: : Version: 2 (0x1) Signature Algorithm: PKCS #1 MD5 With RSA Encryption Issuer: "CN=NSS Test CA,O=BOGUS NSS,L=Mountain View,ST=California,C=US" This Update: Thu Apr 28 16:52:46 2005 Entry (1): Serial Number: 41 (0x29) Revocation Date: Thu Apr 28 16:52:15 2005 Entry Extensions: Name: CRL reason code CRL Extensions: Name: Certificate Issuer Alt Name Error: Parsing extension: security library: improperly formatted DER-enc oded message. Data: Sequence { [1] caemail@ca.com [2] ca.com
Updated•20 years ago
|
Assignee: wtchang → alexei.volkov.bugs
| Reporter | ||
Comment 1•20 years ago
|
||
Same warning is issued when creating crl with authKeyId extension
| Reporter | ||
Comment 2•20 years ago
|
||
The problem is in incorrect encoding technique for the extension. The following
member of the template was not properly encoded:
certEDIPartyName,
certOtherName,
certX400Address.
X400 Address has the following template:
static const SEC_ASN1Template CERT_X400AddressTemplate[] = {
{ SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_CONSTRUCTED | 3,
offsetof(CERTGeneralName, name.other), SEC_AnyTemplate,
sizeof (CERTGeneralName)}
};
and should be encoded with bits
SEC_ASN1_CONTEXT_SPECIFIC | SEC_ASN1_CONSTRUCTED
e.t.c (0x80 | 0x20), not only with 0x80. See patch for details.
Comment 3•20 years ago
|
||
Comment on attachment 182618 [details] [diff] [review] bug fix patch Please submit ALL patches using the output of diff -u, not diff -c.
Attachment #182618 -
Flags: review-
| Reporter | ||
Comment 4•20 years ago
|
||
Same patch created by running diff with -u option. Also added a fix for memory corruption problem in crlgen.c
| Reporter | ||
Updated•20 years ago
|
Attachment #182689 -
Flags: review?(julien.pierre.bugs)
Comment 5•20 years ago
|
||
Comment on attachment 182689 [details] [diff] [review] bug fix patch (diff -u) The patch looks OK, except you should use the macros from secasn1t.h rather the hardcoded values . Eg. 0x1f should be SEC_ASN1_TAGNUM_MASK, 0x80 should be SEC_ASN1_CONTEXT_SPECIFIC, 0x20 should be SEC_ASN1_CONSTRUCTED . This will make the code much clearer.
Attachment #182689 -
Flags: review?(julien.pierre.bugs) → review-
Updated•20 years ago
|
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → 3.10.1
Comment 6•20 years ago
|
||
Comment on attachment 182689 [details] [diff] [review] bug fix patch (diff -u) This patch changes code that modifies the ASN.1 encoding of data in an input buffer. I'd like to see a block comment explaining this. I'd like it to explain how it is that the value in the buffer is already encoded, why/how the encoded value can possibly be incorrect, and why it is changed here. Isn't it unusual for an encoding function or a decoding/printing function to modify its input? Is that really a good idea? I realize that the code was going this before the patch, and that the patch doesn't alter the fact that we're modifying the input, but only alters the specific change being made to the input. But I think the fact that we need to change this raises some questions about this design, and we should answer them before proceeding.
Updated•20 years ago
|
Summary: crlutil reports warning when creating crl with issuerAltNames extension → crlutil incorrectly encoding issuerAltNames extension
Updated•20 years ago
|
QA Contact: bishakhabanerjee → jason.m.reid
Updated•19 years ago
|
Target Milestone: 3.10.1 → 3.11
Comment 7•19 years ago
|
||
Please ignore my comment 6 above. It clearly doesn't apply to this patch. Perhaps I added the comment to the wrong bug. So, the problem is that crlutil attempted to construct an extension containing an X400address, and encoded the X400 Address without the CONSTRUCTED bit in the tag. The proposed fix will add the missing CONSTRUCTED bit to the tag. But I think that creates (or rather, uncovers) another problem, which is that the data that we're trying to encode as the body of the X400Address is just a simple printable string, and is not another DER construct. In other words, the data inside the X400Address is not really constructed at all. So, when we encode it as constructed, I think it will cause a different error, namely an invalid construction in a constructed type. The constructed bit in the tag implies that another tag will immediately follow this tag. But in this case, the data that follows the X400Address tag is merely the string "x400Address". I expect DER decoding errors to result from the attempt to interpret "x" as a tag and "4" as a length. I'll bet that if you take the existing CRL produced by the current crlutil (the output that gets that error about invalid encoding), and run it through a recursive descent parser, such as dumpasn1, that it will PASS (no error). I'll further bet that if you add the constructed bit, crlutil may stop complaining, but dumpasn1 will start to complain. Please test that theory. Maybe we simply should not encode any X400Address, certOtherName, or certEDIPartyNames until we have a way to properly construct them as constructed types. Julien, what do you think of that suggestion?
Comment 8•19 years ago
|
||
I'm raising the priority of this to P1 for 3.11.1. This build problem was introduced 9 months ago, and STILL isn't fixed. Alexei, Some solution needs to be put in place very soon.
Priority: P2 → P1
Target Milestone: 3.11 → 3.11.1
Comment 9•19 years ago
|
||
Adding Neil to CC list.
Comment 10•19 years ago
|
||
This patch does two things: a) it causes crlutil to no longer attempt to encode x400 names as alt names, thereby avoiding the error about incorrectly encoded CRLs, b) it quiets crlutil, so that it no longer pretty prints a complete CRL into the QA output log each time it creates or modifies a CRL.
Attachment #209774 -
Flags: review?
Updated•19 years ago
|
Attachment #209774 -
Flags: review? → review?(julien.pierre.bugs)
Updated•19 years ago
|
Attachment #209774 -
Flags: review?(julien.pierre.bugs) → review+
Comment 11•19 years ago
|
||
Work around checked in on trunk. Checking in cert.sh; new revision: 1.31; previous revision: 1.30
Comment 12•19 years ago
|
||
Workaround Checked in on NSS 3.11 branch. Checking in cert.sh; new revision: 1.28.2.1; previous revision: 1.28 Bug should remain open until a real fix is committed. Lowering priority to P2 now that workaround is in place.
Priority: P1 → P2
Updated•19 years ago
|
Attachment #209774 -
Attachment description: workaround, don't encode x400 addresses, don't print CRL contents → workaround, don't encode x400 addresses, don't print CRL contents (checked in)
Updated•19 years ago
|
QA Contact: jason.m.reid → tools
| Reporter | ||
Comment 13•18 years ago
|
||
real fix should be made for certutil and crlutil as both of them utilizes the same code. The fix will be made as a part of changes for bug 324744. Reassign to 3.12 release.
Target Milestone: 3.11.1 → 3.12
Comment 14•16 years ago
|
||
Unsetting target milestone in unresolved bugs whose targets have passed.
Target Milestone: 3.12 → ---
Comment 15•2 years ago
|
||
The bug assignee is inactive on Bugzilla, and this bug has priority 'P2'.
:beurdouche, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee: alvolkov.bgs → nobody
Flags: needinfo?(bbeurdouche)
Updated•2 years ago
|
Severity: normal → S3
Comment 16•2 years ago
|
||
We have modified the bot to only consider P1 as high priority, so I'm cancelling the needinfo here.
Flags: needinfo?(bbeurdouche)
You need to log in
before you can comment on or make changes to this bug.
Description
•