Bug 1238450

Summary: JSS -- load only hardcoded native library /usr/lib{64}/jss/libjss4.so
Product: Red Hat Enterprise Linux 7 Reporter: Noriko Hosoi <nhosoi>
Component: jssAssignee: Christina Fu <cfu>
Status: CLOSED ERRATA QA Contact: Asha Akkiangady <aakkiang>
Severity: urgent Docs Contact:
Priority: high    
Version: 7.2CC: cfu, edewata, lmiksik, mharmsen, vashirov
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: jss-4.2.6-37.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 14:43:50 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: 1238233, 1254826    
Attachments:
Description Flags
patch to resolve JSS Windows load library issue
none
this patch also fixes the same issue none

Description Noriko Hosoi 2015-07-01 22:07:56 UTC
Description of problem:
Version: jss-4.2.6-36.el7
In mozilla/security/jss/org/mozilla/jss/CryptoManager.java
synchronized static void loadNativeLibraries() tries to load just these 2 kind of native library.
  System.load( "/usr/lib64/jss/libjss4.so" )
  System.load( "/usr/lib/jss/libjss4.so" ); 

This make jss on Windows fail with this exception.
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.mozilla.jss.CryptoManager.initializeAllNative2(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Z)V
at org.mozilla.jss.CryptoManager.initializeAllNative2(Native Method)
at org.mozilla.jss.CryptoManager.initialize(CryptoManager.java:903)
at org.mozilla.jss.CryptoManager.initialize(CryptoManager.java:869)
    ...............
http://pastebin.test.redhat.com/293873

Note: it used to be
  System.load( "jss4" );
which worked on Windows.

Comment 3 Christina Fu 2015-07-07 18:44:57 UTC
Created attachment 1049521 [details]
patch to resolve JSS Windows load library issue

This patches resolves the JSS Windows load library issue while remains compliant to Fedora JNI load library guidelines:
https://fedoraproject.org/wiki/Packaging:Java?rd=Packaging/Java#Packaging_JAR_files_that_use_JNI

The issue was introduced due to patch jss-loadlibrary.patch, which was for:
https://bugzilla.redhat.com/show_bug.cgi?id=533304
 JSS in Fedora violates Fedora packaging guidelines

Comment 4 Christina Fu 2015-07-08 01:01:35 UTC
Created attachment 1049663 [details]
this patch also fixes the same issue

per email discussion, taking Endi's alternative proposed fix so loading is static.

Comment 5 Christina Fu 2015-07-08 17:21:31 UTC
Comment on attachment 1049521 [details]
patch to resolve JSS Windows load library issue

leave the other patch for a separate enhancement bug; Reverting back to this patch.

Comment 6 Christina Fu 2015-07-08 17:23:00 UTC
Comment on attachment 1049663 [details]
this patch also fixes the same issue

this patch will be for a separate enhancement bug.

Comment 7 Noriko Hosoi 2015-07-09 16:33:12 UTC
Thanks for building the fixed jss on brew!

I think jss-4.2.6-37.el7 is the right version.  I'm putting it to the Fixed In Version...

Comment 11 Viktor Ashirov 2015-09-07 15:06:19 UTC
C:\Program Files\Red Hat Identity Management Console>ver

Microsoft Windows [Version 6.3.9600]

C:\Program Files\Red Hat Identity Management Console>java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

C:\Program Files\Red Hat Identity Management Console>java -cp ./jss4.jar org.mozilla.jss.ssl.SSLTest remotehost redhat.com host redhat.com
Parameters:
port=443
remotehost=redhat.com
host=redhat.com
HTTP/1.0 301 Moved Permanently
Location: https://www.redhat.com/
Server: BigIP
Connection: close
Content-Length: 0

remote addr is /10.4.164.55
remote port is 47873
local addr is /192.168.122.212
local port is 49088
keepalive is true
receive buffer size is 32000
send buffer size is 8000
solinger is 10
sotimeout is 5000
tcpNoDelay is true


Also I was able successfully connect to https admin server using latest jss build from Windows. Marking as VERIFIED.

Comment 12 errata-xmlrpc 2015-11-19 14:43:50 UTC
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, 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://rhn.redhat.com/errata/RHBA-2015-2445.html

Comment 13 Fedora Update System 2016-08-09 17:51:49 UTC
jss-4.2.6-42.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-35dc802080

Comment 14 Fedora Update System 2016-08-09 19:05:36 UTC
jss-4.2.6-42.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-4036754389

Comment 15 Fedora Update System 2016-09-22 07:33:55 UTC
jss-4.2.6-42.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2016-09-23 00:24:47 UTC
jss-4.2.6-42.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Red Hat Bugzilla 2023-09-14 03:01:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days