Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p11req -X option results in malloc failure #48

Open
gl-mc opened this issue Aug 30, 2023 · 3 comments
Open

p11req -X option results in malloc failure #48

gl-mc opened this issue Aug 30, 2023 · 3 comments
Assignees

Comments

@gl-mc
Copy link
Contributor

gl-mc commented Aug 30, 2023

Describe the bug
using the p11req command with the following options

$ p11req -i testp1 -d /CN=abc/O=def/C=xx-o ~/cavium_testp1.pkcs10 -e IP:0.0.0.0 -X

results in the following bug

*** OpenSSL ERROR at ../../lib/pkcs11_req.c:49  'error:0F076041:common libcrypto routines:OPENSSL_hexstr2buf:malloc failure' - (from crypto/o_str.c:157)

To Reproduce
1.

$ p11req -i testp1 -d /CN=abc/O=def/C=xx-o ~/cavium_testp1.pkcs10 -e IP:0.0.0.0 -X
*** OpenSSL ERROR at ../../lib/pkcs11_req.c:49  'error:0F076041:common libcrypto routines:OPENSSL_hexstr2buf:malloc failure' - (from crypto/o_str.c:157)

Expected behavior
No malloc error, command should produce valid pkcs10 request file. Removing the -X option at the end makes it succeed.

Screenshots
N/A

Operating System (please complete the following information):

  • OS: Linux
  • Version
Linux 3.10.0-1160.71.1.0.1.el7.x86_64 #1 SMP Tue Jun 28 22:16:18 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
$ p11req -V
p11req belongs to pkcs11-tools v2.6.0 (Jul 13 2023)
arch/CPU/OS: x86_64/x86_64/linux-gnu
using openssl library: OpenSSL 1.1.1t  7 Feb 2023
compiled with nCipher extensions
compiled with Gemalto Safenet Luna extensions

Additional context
N/A

@keldonin keldonin self-assigned this Sep 1, 2023
@keldonin
Copy link
Contributor

keldonin commented Sep 1, 2023

definitely an issue that requires fixing, however I see that the country code is illegal:
C=xx
Can this be tested with a valid country code as well?

@keldonin
Copy link
Contributor

keldonin commented Sep 1, 2023

which HSM is being interfaced in this case? Marvell, CloudHSM?

@gl-mc
Copy link
Contributor Author

gl-mc commented Sep 4, 2023

This was a Marvell. The certificate information string was valid including the country, but I redacted it as this is a public bug report and I did not want to leak information. I'll send you the details in direct email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants