Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235917

test/jdk/sun/security/krb5/IPv6.java tries to connect to non-routable address

    Details

      Description

      test/jdk/sun/security/krb5/IPv6.java needs to be re-examined as it makes the assumption that Kerberos UDP client can connect to a non-routable address. More specifically it creates a UDP socket bound to the wildcard address and the attempts to connect to 0.0.0.1:88. This connect fails on most platforms, just isn't reported by the legacy DatagramSocket implementation as it falls back to emulation when the address association cannot be established by the kernel. A new DatagramSocket implementation in the works that correctly reports the exception when the connect fails, the exception looks like this:

      java.lang.Error: java.net.SocketException: Invalid argument
      at java.base/sun.nio.ch.DatagramSocketAdaptor.connect(DatagramSocketAdaptor.java:109)
      at java.base/java.net.DatagramSocket.connect(DatagramSocket.java:364)
      at java.security.jgss/sun.security.krb5.internal.UDPClient.<init>(NetClient.java:190)
      at java.security.jgss/sun.security.krb5.internal.NetClient.getInstance(NetClient.java:44)
      at java.security.jgss/sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:399)
      at java.security.jgss/sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:362)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
      at java.security.jgss/sun.security.krb5.KdcComm.send(KdcComm.java:346)
      at java.security.jgss/sun.security.krb5.KdcComm.sendIfPossible(KdcComm.java:251)
      at java.security.jgss/sun.security.krb5.KdcComm.send(KdcComm.java:232)
      at java.security.jgss/sun.security.krb5.KdcComm.send(KdcComm.java:198)
      at java.security.jgss/sun.security.krb5.KrbAsReqBuilder.send(KrbAsReqBuilder.java:343)
      at java.security.jgss/sun.security.krb5.KrbAsReqBuilder.action(KrbAsReqBuilder.java:447)
      at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:744)
      at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:571)
      at IPv6.main(IPv6.java:97)

      Would it be possible to update the test so that it doesn't depend on non-routable addresses?

        Attachments

          Activity

            People

            • Assignee:
              ssahoo Sibabrata Sahoo
              Reporter:
              alanb Alan Bateman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: