diff options
Diffstat (limited to 'src/share/classes/javax')
6 files changed, 92 insertions, 23 deletions
diff --git a/src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java b/src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java index 71cc0aa50e..ff399839b2 100644 --- a/src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java +++ b/src/share/classes/javax/security/auth/kerberos/JavaxSecurityAuthKerberosAccessImpl.java @@ -33,6 +33,22 @@ class JavaxSecurityAuthKerberosAccessImpl KeyTab ktab) { return ktab.takeSnapshot(); } + + public KerberosPrincipal kerberosTicketGetClientAlias(KerberosTicket t) { + return t.clientAlias; + } + + public void kerberosTicketSetClientAlias(KerberosTicket t, KerberosPrincipal a) { + t.clientAlias = a; + } + + public KerberosPrincipal kerberosTicketGetServerAlias(KerberosTicket t) { + return t.serverAlias; + } + + public void kerberosTicketSetServerAlias(KerberosTicket t, KerberosPrincipal a) { + t.serverAlias = a; + } public KerberosTicket kerberosTicketGetProxy(KerberosTicket t) { return t.proxy; } diff --git a/src/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java b/src/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java index 308b619e99..ef767f02e8 100644 --- a/src/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java +++ b/src/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. 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 @@ -80,6 +80,11 @@ public final class KerberosPrincipal public static final int KRB_NT_UID = 5; + /** + * Enterprise name (alias) + */ + static final int KRB_NT_ENTERPRISE = 10; + private transient String fullName; private transient String realm; diff --git a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java index 0327f04db5..3f29d9ba95 100644 --- a/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java +++ b/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java @@ -194,6 +194,10 @@ public class KerberosTicket implements Destroyable, Refreshable, private InetAddress[] clientAddresses; + transient KerberosPrincipal clientAlias = null; + + transient KerberosPrincipal serverAlias = null; + /** * Evidence ticket if proxy_impersonator. This field can be accessed * by KerberosSecrets. It's serialized. @@ -308,11 +312,7 @@ public class KerberosTicket implements Destroyable, Refreshable, } else this.flags = new boolean[NUM_FLAGS]; - if (this.flags[RENEWABLE_TICKET_FLAG]) { - if (renewTill == null) - throw new IllegalArgumentException("The renewable period " - + "end time cannot be null for renewable tickets."); - + if (this.flags[RENEWABLE_TICKET_FLAG] && renewTill != null) { this.renewTill = new Date(renewTill.getTime()); } @@ -553,6 +553,11 @@ public class KerberosTicket implements Destroyable, Refreshable, if (!isRenewable()) throw new RefreshFailedException("This ticket is not renewable"); + if (getRenewTill() == null) { + // Renewable ticket without renew-till. Illegal and ignored. + return; + } + if (System.currentTimeMillis() > getRenewTill().getTime()) throw new RefreshFailedException("This ticket is past " + "its last renewal time."); @@ -562,7 +567,11 @@ public class KerberosTicket implements Destroyable, Refreshable, try { krb5Creds = new sun.security.krb5.Credentials(asn1Encoding, client.toString(), + (clientAlias != null ? + clientAlias.getName() : null), server.toString(), + (serverAlias != null ? + serverAlias.getName() : null), sessionKey.getEncoded(), sessionKey.getKeyType(), flags, diff --git a/src/share/classes/javax/security/auth/x500/X500Principal.java b/src/share/classes/javax/security/auth/x500/X500Principal.java index 77292b0be2..2236661098 100644 --- a/src/share/classes/javax/security/auth/x500/X500Principal.java +++ b/src/share/classes/javax/security/auth/x500/X500Principal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. 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 @@ -41,13 +41,13 @@ import sun.security.util.*; * of the distinguished name, or by using the ASN.1 DER encoded byte * representation of the distinguished name. The current specification * for the string representation of a distinguished name is defined in - * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253: Lightweight + * <a href="http://tools.ietf.org/html/rfc2253">RFC 2253: Lightweight * Directory Access Protocol (v3): UTF-8 String Representation of * Distinguished Names</a>. This class, however, accepts string formats from - * both RFC 2253 and <a href="http://www.ietf.org/rfc/rfc1779.txt">RFC 1779: + * both RFC 2253 and <a href="http://tools.ietf.org/html/rfc1779">RFC 1779: * A String Representation of Distinguished Names</a>, and also recognizes * attribute type keywords whose OIDs (Object Identifiers) are defined in - * <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509 + * <a href="http://tools.ietf.org/html/rfc5280">RFC 5280: Internet X.509 * Public Key Infrastructure Certificate and CRL Profile</a>. * * <p> The string representation for this {@code X500Principal} @@ -108,7 +108,7 @@ public final class X500Principal implements Principal, java.io.Serializable { * (and listed in {@link #getName(String format) getName(String format)}), * as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS, * GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose Object - * Identifiers (OIDs) are defined in RFC 3280 and its successor. + * Identifiers (OIDs) are defined in RFC 5280. * Any other attribute type must be specified as an OID. * * <p>This implementation enforces a more restrictive OID syntax than @@ -456,7 +456,7 @@ public final class X500Principal implements Principal, java.io.Serializable { * (obtained via the {@code getName(X500Principal.CANONICAL)} method) * of this object and <i>o</i> are equal. * - * <p> This implementation is compliant with the requirements of RFC 3280. + * <p> This implementation is compliant with the requirements of RFC 5280. * * @param o Object to be compared for equality with this * {@code X500Principal} diff --git a/src/share/classes/javax/security/auth/x500/package-info.java b/src/share/classes/javax/security/auth/x500/package-info.java index 12f8a5322d..1e9ca1a824 100644 --- a/src/share/classes/javax/security/auth/x500/package-info.java +++ b/src/share/classes/javax/security/auth/x500/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. 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 @@ -31,15 +31,15 @@ * <h2>Package Specification</h2> * * <ul> - * <li><a href="http://www.ietf.org/rfc/rfc1779.txt"> + * <li><a href="http://tools.ietf.org/html/rfc1779"> * RFC 1779: A String Representation of Distinguished Names</a></li> - * <li><a href="http://www.ietf.org/rfc/rfc2253.txt"> + * <li><a href="http://tools.ietf.org/html/rfc2253"> * RFC 2253: Lightweight Directory Access Protocol (v3): * UTF-8 String Representation of Distinguished Names</a></li> - * <li><a href="http://www.ietf.org/rfc/rfc3280.txt"> - * RFC 3280: Internet X.509 Public Key Infrastructure + * <li><a href="http://tools.ietf.org/html/rfc5280"> + * RFC 5280: Internet X.509 Public Key Infrastructure * Certificate and Certificate Revocation List (CRL) Profile</a></li> - * <li><a href="http://www.ietf.org/rfc/rfc4512.txt"> + * <li><a href="http://tools.ietf.org/html/rfc4512"> * RFC 4512: Lightweight Directory Access Protocol (LDAP): * Directory Information Models</a></li> * </ul> diff --git a/src/share/classes/javax/swing/ToolTipManager.java b/src/share/classes/javax/swing/ToolTipManager.java index 6a3954f7ec..ee6992bc51 100644 --- a/src/share/classes/javax/swing/ToolTipManager.java +++ b/src/share/classes/javax/swing/ToolTipManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, Oracle and/or its affiliates. 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 @@ -28,6 +28,8 @@ package javax.swing; import java.awt.event.*; import java.awt.*; +import javax.swing.event.MenuKeyEvent; +import javax.swing.event.MenuKeyListener; /** * Manages all the <code>ToolTips</code> in the system. @@ -409,8 +411,14 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener component.addMouseListener(this); component.removeMouseMotionListener(moveBeforeEnterListener); component.addMouseMotionListener(moveBeforeEnterListener); - component.removeKeyListener(accessibilityKeyListener); - component.addKeyListener(accessibilityKeyListener); + // use MenuKeyListener for menu items/elements + if (component instanceof JMenuItem) { + ((JMenuItem) component).removeMenuKeyListener((MenuKeyListener) accessibilityKeyListener); + ((JMenuItem) component).addMenuKeyListener((MenuKeyListener) accessibilityKeyListener); + } else { + component.removeKeyListener(accessibilityKeyListener); + component.addKeyListener(accessibilityKeyListener); + } } /** @@ -421,7 +429,11 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener public void unregisterComponent(JComponent component) { component.removeMouseListener(this); component.removeMouseMotionListener(moveBeforeEnterListener); - component.removeKeyListener(accessibilityKeyListener); + if (component instanceof JMenuItem) { + ((JMenuItem) component).removeMenuKeyListener((MenuKeyListener) accessibilityKeyListener); + } else { + component.removeKeyListener(accessibilityKeyListener); + } } // implements java.awt.event.MouseListener @@ -841,7 +853,7 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener * Post Tip: Ctrl+F1 * Unpost Tip: Esc and Ctrl+F1 */ - private class AccessibilityKeyListener extends KeyAdapter { + private class AccessibilityKeyListener extends KeyAdapter implements MenuKeyListener { public void keyPressed(KeyEvent e) { if (!e.isConsumed()) { JComponent source = (JComponent) e.getComponent(); @@ -858,5 +870,32 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener } } } + + @Override + public void menuKeyTyped(MenuKeyEvent e) {} + + @Override + public void menuKeyPressed(MenuKeyEvent e) { + if (postTip.equals(KeyStroke.getKeyStrokeForEvent(e))) { + // get element for the event + MenuElement path[] = e.getPath(); + MenuElement element = path[path.length - 1]; + + // retrieve currently highlighted element + MenuSelectionManager msm = e.getMenuSelectionManager(); + MenuElement selectedPath[] = msm.getSelectedPath(); + MenuElement selectedElement = selectedPath[selectedPath.length - 1]; + + if (element.equals(selectedElement)) { + // show/hide tooltip message + JComponent source = (JComponent) element.getComponent(); + ToolTipManager.this.show(source); + e.consume(); + } + } + } + + @Override + public void menuKeyReleased(MenuKeyEvent e) {} } } |