Bug 1467189
Summary: | keytool says "Input not an X.509 certificate" when importing a cert | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Hisanobu Okuda <hokuda> |
Component: | java-1.7.0-openjdk | Assignee: | Andrew John Hughes <ahughes> |
Status: | CLOSED WONTFIX | QA Contact: | zzambers |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | ahughes, cdolphy, cww, hokuda, jvanek, zzambers |
Target Milestone: | rc | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-11-15 20:13:17 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1477664 |
Description
Hisanobu Okuda
2017-07-03 06:53:16 UTC
The appears to be a specification violation. The issue occurs when trying to parse this section: A3 81 24 81 indicates it's long form (multi-byte) and a single byte. Then 24 is the length. The check that leads to "DerInputStream.getLength(): Should use short form for length" checks for long form length octet that has a value less than 127 and rejects it because it should have used short form (single-byte). However, according to spec whether to use long form or short for is at sender's option: ~~~ 8.1.3.3 For the definite form, the length octets shall consist of one or more octets, and shall represent the number of octets in the contents octets using either the short form (see 8.1.3.4) or the long form (see 8.1.3.5) as a sender's option. NOTE – The short form can only be used if the number of octets in the contents octets is less than or equal to 127. ~~~ The disclaimer at the end doesn't mean that short form must be used if the length is less than 127, but that the short form only is possible with values less than 127. [1] https://www.itu.int/rec/T-REC-X.690-201508-I/en And I'm wrong. DER rules specify smallest number of octets should be used: 10 Distinguished encoding rules The encoding of a data values employed by the distinguished encoding rules is the basic encoding described in clause 8, together with the following restrictions and those also listed in clause 11. 10.1 Length forms The definite form of length encoding shall be used, encoded in the minimum number of octets. [Contrast with 8.1.3.2 b).] I'll look into this after the imminent security update. Yes, I moved this to RHEL7 seems easy to test |