Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Running this:
sscg --subject-alt-name "IP:127.0.0.1/255.255.255.255"
causes this error:
ERROR: Cannot allocate memory
Version-Release number of selected component (if applicable):
sscg-3.0.0-4.el9.x86_64
openssl-libs-3.0.1-14.el9.x86_64
How reproducible:
Always
Additional info:
strace shows no failed memory allocation. This only happens with this specific --subject-alt-name syntax, things like "--subject-alt-name localhost" is fine.
sscg-3.0.0-1.fc35.x86_64 / openssl-libs-1.1.1l-2.fc35.x86_64 on Fedora 35 is fine.
Fedora 36 has the same problem with:
sscg-3.0.2-1.fc36.x86_64
openssl-libs-3.0.0-1.fc36.x86_64
Comment 2Stephen Gallagher
2022-03-08 20:13:09 UTC
I'll take a look at this. My guess is that it's an OpenSSL 3.0 behavior-change that I need to adapt to. Thanks for reporting it!
Comment 3Stephen Gallagher
2022-03-08 21:20:58 UTC
So, I just did a deep-dive into RFC 5280(1) and it looks like this is actually a case of OpenSSL 3.0 just being stricter than previous versions. According to RFC 5280, the subjectAltName for IPaddresses 'MUST be stored in the octet string in "network byte order"'. However, the name-constraint extension must be stored in the "x.x.x.x/y.y.y.y" format(2), which makes things a bit complicated.
In OpenSSL 1.1, the API appears to have automatically truncated the mask portion of the IP address when it was added as a SAN, but in 3.0 it throws an error. (The "Cannot allocate memory" message was erroneous).
I'm inclined to solve this by just explicitly chopping off the mask before I insert it as a SAN.
(1) https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.6
(2) https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10
Comment 4Stephen Gallagher
2022-03-08 21:38:42 UTC
(In reply to Stephen Gallagher from comment #3)
> In OpenSSL 1.1, the API appears to have automatically truncated the mask
> portion of the IP address when it was added as a SAN,
Yes, that's what I see as well. The certificates ended up having just "IP:127.0.0.1" in them.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (sscg bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2022:7946
Description of problem: Running this: sscg --subject-alt-name "IP:127.0.0.1/255.255.255.255" causes this error: ERROR: Cannot allocate memory Version-Release number of selected component (if applicable): sscg-3.0.0-4.el9.x86_64 openssl-libs-3.0.1-14.el9.x86_64 How reproducible: Always Additional info: strace shows no failed memory allocation. This only happens with this specific --subject-alt-name syntax, things like "--subject-alt-name localhost" is fine. sscg-3.0.0-1.fc35.x86_64 / openssl-libs-1.1.1l-2.fc35.x86_64 on Fedora 35 is fine.