#188 [tests] 002-keygen-rsa hangs
Closed: fixed by slev. Opened by slev.

002-keygen-rsa has been failing since SQLite-3.34.0+.

This test hangs in an infinite loop:

+ /usr/src/RPM/BUILD/certmonger-0.79.13/tests/tools/keygen entry.4096
2021-02-02 11:33:10 [2577929] Found token 'NSS Certificate DB'.
2021-02-02 11:33:10 [2577929] Generating key pair.
2021-02-02 11:33:13 [2577929] Ended up with 4096 bit public key.
2021-02-02 11:33:13 [2577929] Nickname "keyi4096" appears to be unused.
2021-02-02 11:33:13 [2577929] Set nickname "keyi4096" on private key.
+ sed -i 's,^key_gen_size.*,,g' entry.4096
+ /usr/src/RPM/BUILD/certmonger-0.79.13/tests/tools/keyiread entry.4096
2021-02-02 11:33:13 [2578065] Found token 'NSS Certificate DB'.
2021-02-02 11:33:13 [2578065] Located the key 'keyi4096'.
2021-02-02 11:33:13 [2578065] Converted private key 'keyi4096' to public key.
2021-02-02 11:33:13 [2578065] Key is an RSA key.
2021-02-02 11:33:13 [2578065] Key size is 4096.
+ echo '[nss:rosubdir]'
+ cat
+ /usr/src/RPM/BUILD/certmonger-0.79.13/tests/tools/keygen entry.4096
2021-02-02 11:33:13 [2578068] Error initializing database '${tmpdir}/rosubdir': PR_NO_ACCESS_RIGHTS_ERROR.
+ true
+ echo '[nss:rwsubdir]'
+ cat
+ /usr/src/RPM/BUILD/certmonger-0.79.13/tests/tools/keygen entry.4096
2021-02-02 11:33:13 [2578071] Found token 'NSS Certificate DB'.
2021-02-02 11:33:13 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
2021-02-02 11:33:15 [2578071] Overriding requested key size of 4096 with -1.
2021-02-02 11:33:15 [2578071] Generating key pair.
...

Note: this is not reproduced in Fedora due to nss-fedora-btrf-sql-hack.patch https://src.fedoraproject.org/rpms/nss/c/4ecb833a82b0039b0eebfcb5dc921e516f47ac2b?branch=master

NSS ticket:
https://bugzilla.mozilla.org/show_bug.cgi?id=1690232


As of SQLite 3.34.0+ NSS_InitContext with config directory having read-only files doesn't fail.

I suppose I'll push on NSS to get this patch upstream.

Fixed in NSS 3.69.

Metadata Update from @slev:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Thanks for following up on this

Metadata