Unwarp Kerberos encrypted request problem (Invalid padding on Wrap Token)
843810Dec 4 2007 — edited Mar 28 2008Hi averybody.
I am trying to "unwarp" Kerberos encrypted packet from Windows Vista but always have exception:
-----
GSSException: Defective token detected (Mechanism level: Invalid padding on Wrap Token)
at sun.security.jgss.krb5.CipherHelper.arcFourDecrypt(CipherHelper.java:1226)
at sun.security.jgss.krb5.CipherHelper.decryptData(CipherHelper.java:532)
at sun.security.jgss.krb5.WrapToken.getDataFromBuffer(WrapToken.java:230)
at sun.security.jgss.krb5.WrapToken.getData(WrapToken.java:195)
at sun.security.jgss.krb5.WrapToken.getData(WrapToken.java:168)
at sun.security.jgss.krb5.Krb5Context.unwrap(Krb5Context.java:941)
at sun.security.jgss.GSSContextImpl.unwrap(GSSContextImpl.java:384)
at com.myproject.ws_management.WSServer$MyHandler.handle(WSServer.java:361)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:552)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:524)
at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:119)
at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:349)
at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:321)
at java.lang.Thread.run(Thread.java:619)
-----
I correctly created GSS context (using acceptSecContext)
Debug from "acceptSecContext" caller:
-----
Remaining lifetime in seconds = 2147483647
Context mechanism = 1.2.840.113554.1.2.2
Initiator = UVISTA$@SYMCBQ.LOCAL
Acceptor = HOST/JUGGERNAUT@SYMCBQ.LOCAL
Confidentiality (i.e., privacy) is available
Integrity is available
-----
Before "unwarp(content)" method throws exception
I created GSSHeader gssHeader = new GSSHeader(new ByteArrayInputStream(content)); for debugging and debug information which was extracted from gssHeader variable is:
-----
Incoming warped content length: 1671
Incoming GSS header OID: 1.2.840.113554.1.2.2
Incoming GSS header length: 15
Incoming GSS header MechTokenLength: 1656
-----
Does anybody have ideas why it is happens ?
Thanks,
Andrey