6923681: Jarsigner crashes during timestamping
authorweijun
Thu, 04 Mar 2010 10:38:00 +0800
changeset 4988 1268f09a31e3
parent 4987 5b7352dd6a2f
child 4989 1abad76dc481
6923681: Jarsigner crashes during timestamping Reviewed-by: vinnie
jdk/src/share/classes/sun/security/tools/TimestampedSigner.java
--- a/jdk/src/share/classes/sun/security/tools/TimestampedSigner.java	Thu Mar 04 10:37:16 2010 +0800
+++ b/jdk/src/share/classes/sun/security/tools/TimestampedSigner.java	Thu Mar 04 10:38:00 2010 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 2007-2010 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -375,7 +375,8 @@
                 }
                 if (!isSigner) {
                     keyPurposes = cert.getExtendedKeyUsage();
-                    if (! keyPurposes.contains(KP_TIMESTAMPING_OID)) {
+                    if (keyPurposes == null ||
+                            ! keyPurposes.contains(KP_TIMESTAMPING_OID)) {
                         throw new CertificateException(
                             "Certificate is not valid for timestamping");
                     }