Author: rmeggins
Update of /cvs/dirsec/console/src/com/netscape/management/client/security
In directory
cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30150/console/src/com/netscape/management/client/security
Modified Files:
CertInstallCertNamePage.java
Log Message:
Resolves: bug 481176
Bug Description: Null Point Exception Attempting to Install CA Certifcate
Reviewed by: nhosoi (Thanks!)
Fix Description: The problem is that the certificate is not recognized by NSS as a CA
certificate because it is missing some flags and the basic constraint extension for CAs.
The wizard code wrongly assumed that any certificate being installed in this context is a
CA cert. I changed the code to handle other types of certs. However, this doesn't
fix the problem where the CA cert shows up under Server Certs instead of CA Certs, because
only "real" CA certs with the proper settings will show up under the CA Certs
list.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: CertInstallCertNamePage.java
===================================================================
RCS file:
/cvs/dirsec/console/src/com/netscape/management/client/security/CertInstallCertNamePage.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CertInstallCertNamePage.java 18 Jul 2005 00:34:15 -0000 1.1.1.1
+++ CertInstallCertNamePage.java 23 Jan 2009 20:45:06 -0000 1.2
@@ -41,8 +41,15 @@
if
(dataModel.getValue("certtype").equals(Integer.toString(CertInstallWizard.CA)))
{
CertificateList certList =
(CertificateList)(dataModel.getValue("certlist"));
Vector cert = (Vector)(certList.getCACerts());
- certName.setText(KeyCertUtility.getCertName((Hashtable)(cert.elementAt(0)),
_tokenName, _consoleInfo, _sie));
-
+ if ((cert == null) || cert.isEmpty()) {
+ cert = (Vector)(certList.getServerCerts());
+ }
+ if ((cert == null) || cert.isEmpty()) {
+ cert = (Vector)(certList.getCerts());
+ }
+ if ((cert != null) && !cert.isEmpty()) {
+ certName.setText(KeyCertUtility.getCertName((Hashtable)(cert.elementAt(0)),
_tokenName, _consoleInfo, _sie));
+ }
certName.setEnabled(false);
certType.setText(resource.getString("CertInstallCertNamePage",
"caCert"));
} else {
Show replies by date