374663 optimize build loses header info r=christophe

git-svn-id: svn://10.0.0.236/trunk@224477 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
glen.beasley%sun.com 2007-04-12 23:05:38 +00:00
parent e24bdae7f5
commit d70cb71696
4 changed files with 50 additions and 39 deletions

View File

@ -59,6 +59,24 @@
#include <signal.h>
#endif
/** These externs are only here to
** keep certain compilers from optimizing the
** version info away.
*/
#include "util/jssver.h"
extern const char __jss_base_rcsid[];
extern const char __jss_base_sccsid[];
const char * jss_rcsid() {
return __jss_base_rcsid;
}
const char * jss_sccsid() {
return __jss_base_sccsid;
}
/********************************************************************/
/* The VERSION Strings should be updated in the following */
/* files everytime a new release of JSS is generated: */

View File

@ -210,10 +210,13 @@ public class GenerateTestCert {
}
static int nextRandInt(SecureRandom rand) throws Exception {
int i;
byte[] bytes = new byte[4];
rand.nextBytes(bytes);
return ((int)bytes[0])<<24 | ((int)bytes[1])<<16 |
i = ((int)bytes[0])<<24 | ((int)bytes[1])<<16 |
((int)bytes[2])<<8 | ((int)bytes[3]);
System.out.println("generated random value:" + i);
return i;
}
/**

View File

@ -36,53 +36,39 @@
package org.mozilla.jss.tests;
import org.mozilla.jss.ssl.*;
import org.mozilla.jss.CryptoManager;
import org.mozilla.jss.crypto.*;
import org.mozilla.jss.asn1.*;
import org.mozilla.jss.pkix.primitive.*;
import org.mozilla.jss.pkix.cert.*;
import org.mozilla.jss.pkix.cert.Certificate;
import org.mozilla.jss.util.PasswordCallback;
public class JSSPackageTest {
private static CryptoManager cm = null;
public static void main(String[] args) {
String certDbPath = ".";
try {
try {
certDbPath = (String)args[0];
} catch (Exception e) {
System.out.println("Exception caught : " + e.getMessage());
e.printStackTrace();
System.exit(1);
}
CryptoManager.initialize(certDbPath);
Package pkg = Package.getPackage("org.mozilla.jss");
if (pkg != null) {
System.out.println("\n---------------------------------------------------------");
System.out.println("Checking jss jar and library version");
System.out.println("---------------------------------------------------------");
System.out.println(" Introspecting jss jar file");
System.out.println("Package name:\t" + pkg.getName());
System.out.println("\n---------------------------------------------------------");
System.out.println("Checking jss jar and library version");
System.out.println("---------------------------------------------------------");
System.out.println(" Introspecting jss jar file");
System.out.println("Package name:\t" + pkg.getName());
System.out.println("Spec title :\t" + pkg.getSpecificationTitle());
System.out.println("Spec vendor :\t" + pkg.getSpecificationVendor());
System.out.println("Spec version:\t" + pkg.getSpecificationVersion());
System.out.println("Spec title :\t" + pkg.getSpecificationTitle());
System.out.println("Spec vendor :\t" + pkg.getSpecificationVendor());
System.out.println("Spec version:\t" + pkg.getSpecificationVersion());
System.out.println("Impl title :\t" + pkg.getImplementationTitle());
System.out.println("Impl vendor :\t" + pkg.getImplementationVendor());
System.out.println("Impl version:\t" + pkg.getImplementationVersion());
}
System.out.println("\n\tFetching version information " +
"from CryptoManager");
System.out.println("\n\t" + org.mozilla.jss.CryptoManager.JAR_JSS_VERSION);
System.out.println("\n\tSuggested NSS/NSPR version to use " +
"with this JSS:");
System.out.println("\n\t" + org.mozilla.jss.CryptoManager.JAR_NSS_VERSION);
System.out.println("\t" + org.mozilla.jss.CryptoManager.JAR_NSPR_VERSION);
System.out.println("Impl title :\t" + pkg.getImplementationTitle());
System.out.println("Impl vendor :\t" + pkg.getImplementationVendor());
System.out.println("Impl version:\t" + pkg.getImplementationVersion());
System.out.println("\n Fetching version information from CryptoManager");
System.out.println(CryptoManager.JAR_JSS_VERSION);
System.out.println(CryptoManager.JAR_NSS_VERSION);
System.out.println(CryptoManager.JAR_NSPR_VERSION);
System.out.println("\n Checking for header information in jss library");
System.out.println("\n\tTo check the JNI version in libjss4.so:");
System.out.println("\n\ttry: strings libjss4.so | grep -i header");
System.out.println("\n\tor : ident libjss4.so");
System.exit(0);
} catch (Exception e) {

View File

@ -377,9 +377,13 @@ public class SSLClientAuth implements Runnable {
}
static int nextRandInt(SecureRandom rand) throws Exception {
int i;
byte[] bytes = new byte[4];
rand.nextBytes(bytes);
return ((int)bytes[0])<<24 | ((int)bytes[1])<<16 |
i = ((int)bytes[0])<<24 | ((int)bytes[1])<<16 |
((int)bytes[2])<<8 | ((int)bytes[3]);
System.out.println("generated random value:" + i);
return i;
}
}