Bug 806588

Summary: Disable SSL PKCS #11 bypass at build time
Product: [Fedora] Fedora Reporter: Elio Maldonado Batiz <emaldona>
Component: nssAssignee: Elio Maldonado Batiz <emaldona>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: emaldona, kdudka, kengert
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nss-3.14-9.fc19, nss-3.14-6.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-27 05:03:50 UTC Type: ---
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: 689918, 689919    
Attachments:
Description Flags
Disables ssl bypass at build time
none
Disable ssl pkcs11 layer bypass at build time
none
Disable sslbypass at build time
none
Disable ssl pkcs11 bypass at build time and preserve ABI
none
Disable ssl pkcs #11 bypass at buitime
none
Disable ssl pkcs #11 bypass at buildtime
rrelyea: review-
Return failure if caller mistakenly requests bypass at runtime none

Description Elio Maldonado Batiz 2012-03-25 04:52:52 UTC
Description of problem: The environment variable SSLBYPASS when set allows NSS SSL/TLS to bypass the PKCS #11 layer. The user is advised to not set this variable if FIPS is enabled. We do not support the SSLBYPASS, neither in Fedora nor in RHEL, and so we should disable the feature at build time. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.
2.
3.
  
Actual results:

Expected results:

Additional info:

Comment 1 Elio Maldonado Batiz 2012-03-25 18:58:57 UTC
Created attachment 572564 [details]
Disables ssl bypass at build time

Comment 2 Elio Maldonado Batiz 2012-03-29 00:15:09 UTC
Comment on attachment 572564 [details]
Disables ssl bypass at build time

My own comment: NSS_ALLOW_SSLBYPASS is too long, no need for the NSS_ in front to disambiguate as this is not a runtime environment variable but a build time variable.

Comment 3 Elio Maldonado Batiz 2012-03-30 22:33:13 UTC
Created attachment 574100 [details]
Disable ssl pkcs11 layer bypass at build time

Comment 4 Elio Maldonado Batiz 2012-03-30 22:38:20 UTC
Comment on attachment 574100 [details]
Disable ssl pkcs11 layer bypass at build time

One must add export NSS_NOSSLBYPASS=1
to the %build section of nss.spec to trigger CFLAGS +=NOSSLBYPASS

Comment 5 Elio Maldonado Batiz 2012-04-14 18:34:17 UTC
Created attachment 577475 [details]
Disable sslbypass at build time

Comment 6 Kai Engert (:kaie) (inactive account) 2012-04-18 00:01:18 UTC
Elio, I reviewed the patch in the upstream bug, is that sufficient?

Comment 7 Elio Maldonado Batiz 2012-04-18 01:15:54 UTC
Kai, I don't think so. That's because this patch for Fedora disables SSLBYPASS unconditionally whereas the upstream patch requires the package maintainer to setting the build time environment variable to activate the disabling. Thanks for the prompt review on the upstream one.

Comment 8 Elio Maldonado Batiz 2012-04-18 15:32:36 UTC
On second thought, for the sake of consistency I should rely on the upstream patch instead. I should submit the upstream one suitably one adapted for 3.13.4 and with the modifications that Kai suggested upstream. It makes life easier.

Comment 9 Kai Engert (:kaie) (inactive account) 2012-04-19 13:22:11 UTC
Comment on attachment 577475 [details]
Disable sslbypass at build time

(In reply to comment #8)
> for the sake of consistency I should rely on the upstream patch instead

I understand this patch is now obsolete.

Comment 10 Elio Maldonado Batiz 2012-05-14 18:20:38 UTC
Created attachment 584430 [details]
Disable ssl pkcs11 bypass at build time and preserve ABI

Submitting for upstream review as well.

Comment 11 Elio Maldonado Batiz 2012-05-15 23:30:01 UTC
Comment on attachment 584430 [details]
Disable ssl pkcs11 bypass at build time and preserve ABI

Cancelling the request for review due to upstream feedback.

Comment 12 Elio Maldonado Batiz 2012-06-26 20:41:52 UTC
After modifications and expansion the patch has been approved and committed upstream for nss-3.14.

Comment 13 Elio Maldonado Batiz 2012-06-26 22:06:36 UTC
Created attachment 594623 [details]
Disable ssl pkcs #11 bypass at buitime

This is a backport to nss-3.13.5 of the changes committed upstream for nss-3.14.
Requires adding 'export NSS_NO_PKCS11_BYPASS=1' to the %build section of nss.spec for it to take effect as the default is to allow bypass to occur as before.

Comment 14 Elio Maldonado Batiz 2012-06-27 14:19:32 UTC
Created attachment 594787 [details]
Disable ssl pkcs #11 bypass at buildtime

Follows the upstream one a bit more closely.

Comment 15 Bob Relyea 2012-06-28 23:04:27 UTC
Comment on attachment 594787 [details]
Disable ssl pkcs #11 bypass at buildtime

r-

Well this would work, sort of, but rather than

if (bypass) {
#ifndef NO_BYPASS
  code
#endif
} else {


I'd like to see

#ifdef NO_BYPASS
if (bypass) {
    code
} else
#endif
{

Comment 16 Elio Maldonado Batiz 2012-06-28 23:18:32 UTC
Bob, please make those comments also in the bug 
https://bugzilla.mozilla.org/show_bug.cgi?id=745281

The multicolor explanation on a whiteboard of the three styles was very clear and to the point.

Comment 17 Elio Maldonado Batiz 2012-11-09 23:23:42 UTC
The upstram bug https://bugzilla.mozilla.org/show_bug.cgi?id=745281
was fixed in nss-3.14 to which we have rebased nss in fedora. That is the bulck of the work but a small part remains. The upstream fix was to provide the option of disabling SSL PKCS #11 bypass at build time. What remains is mostly for the downstream nss packager maintainer exersize his option. Add to the %build section of the nss.spc file:

NSS_NO_PKCS11_BYPASS=1
export NSS_NO_PKCS11_BYPASS

Comment 18 Elio Maldonado Batiz 2012-11-09 23:30:49 UTC
Created attachment 641885 [details]
Return failure if caller mistakenly requests bypass at runtime

Besides disabling bypass at buildtime, also protect user from mistajenly trying to enable it via the environment variable. Fedora has never supported bypass so compatibility is not an issue

Comment 19 Fedora Update System 2012-11-10 03:34:16 UTC
nss-softokn-3.14-1.fc18, nss-util-3.14-1.fc18, nss-3.14-6.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2012-17351/nss-3.14-6.fc18,nss-softokn-3.14-1.fc18,nss-util-3.14-1.fc18

Comment 20 Fedora Update System 2012-11-13 19:05:58 UTC
Package nss-softokn-3.14-1.fc18, nss-util-3.14-1.fc18, nss-3.14-6.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing nss-softokn-3.14-1.fc18 nss-util-3.14-1.fc18 nss-3.14-6.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17351/nss-3.14-6.fc18,nss-softokn-3.14-1.fc18,nss-util-3.14-1.fc18
then log in and leave karma (feedback).

Comment 21 Fedora Update System 2012-11-21 20:53:55 UTC
Package nss-util-3.14-1.fc18, nss-3.14-7.fc18, nss-softokn-3.14-5.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing nss-util-3.14-1.fc18 nss-3.14-7.fc18 nss-softokn-3.14-5.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17351/nss-3.14-7.fc18,nss-softokn-3.14-5.fc18,nss-util-3.14-1.fc18
then log in and leave karma (feedback).

Comment 22 Fedora Update System 2012-11-24 03:42:15 UTC
nss-util-3.14-1.fc17,nss-softokn-3.14-5.fc17,nss-3.14-7.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/nss-util-3.14-1.fc17,nss-softokn-3.14-5.fc17,nss-3.14-7.fc17

Comment 23 Fedora Update System 2012-11-27 05:03:53 UTC
nss-util-3.14-1.fc18, nss-3.14-7.fc18, nss-softokn-3.14-5.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2012-12-12 04:33:25 UTC
nss-util-3.14-1.fc17, nss-softokn-3.14-5.fc17, nss-3.14-7.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2012-12-19 03:11:49 UTC
nss-util-3.14-1.fc16,nss-softokn-3.14-5.fc16,nss-3.14-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/nss-util-3.14-1.fc16,nss-softokn-3.14-5.fc16,nss-3.14-7.fc16