<div dir="ltr">Attaching patch, which fixes described issue for me.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 14, 2017 at 4:03 PM, Jan Kalina <span dir="ltr"><<a href="mailto:jkalina@redhat.com" target="_blank">jkalina@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>I has found bug in SunNativeProvider:<br><br></div>When debug messages are enabled, JDK confirms GSS library was loaded with mechs:<br><br>[GSSLibStub_init] libName=/usr/lib64/libgssapi_<wbr>krb5.so.2.2<br>SunNativeGSS: Loaded GSS library: /usr/lib64/libgssapi_krb5.so.<wbr>2.2<br>SunNativeGSS: Native MF for 1.2.840.113554.1.2.2<br>SunNativeGSS: Native MF for 1.3.6.1.5.2.5<br>SunNativeGSS: Native MF for 1.3.6.1.5.5.2<br><br></div>But when I try to use it, it claims mechanism with given OID are not supported:<br><br>GSSException: Provider SunNativeGSS does not support mechanism 1.2.840.113554.1.2.2<br>    at java.security.jgss/sun.<wbr>security.jgss.ProviderList.<wbr>getMechFactory(ProviderList.<wbr>java:253)<br>    at java.security.jgss/sun.<wbr>security.jgss.ProviderList.<wbr>getMechFactory(ProviderList.<wbr>java:209)<br>    at java.security.jgss/sun.<wbr>security.jgss.GSSManagerImpl.<wbr>getMechanismContext(<wbr>GSSManagerImpl.java:234)<br>    at java.security.jgss/sun.<wbr>security.jgss.GSSContextImpl.<wbr>acceptSecContext(<wbr>GSSContextImpl.java:337)<br>    at java.security.jgss/sun.<wbr>security.jgss.GSSContextImpl.<wbr>acceptSecContext(<wbr>GSSContextImpl.java:302)<br><br></div><b>When I has try to debug it, I has found the SunNativeProvider is created in two instances:</b><br><br></div>First instance is created on initialization of SunNativeProvider.INSTANCE, but it is BEFORE</div><div>the mechs are passed into SunNativeProvider.MECH_MAP. The second instance is created</div><div>correctly in ProviderList constructor.</div><div><br></div><div>The problem is, in some situations is used the too soon created SunNativeProvider.INSTANCE,</div><div>so the to call throws exception above.<br></div><div><div><div><div><br></div><div><b>I think sufficient fix would be to move SunNativeProvider.INSTANCE declaration after</b></div><div><b>the static constructor (filling the </b><b>MECH_MAP) in SunNativeProvider file.</b></div><div><br></div><div>Would be possible to fix this?</div><div>Should I send a patch?</div><br><div><div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div>Jan Kalina<br></div></font></span></div></div></div></div></div></div>
</blockquote></div><br></div>