S4U2Self and OpenJDK 8

Marc Boorshtein marc.boorshtein at tremolosecurity.com
Tue Dec 1 02:38:27 UTC 2015


Thank Max.  On OSX with the latest 1.9 I get the following:

>>> KeyTabInputStream, readName(): RHELENT.LAN
>>> KeyTabInputStream, readName(): HTTP
>>> KeyTabInputStream, readName(): s4u.rhelent.lan
>>> KeyTab: load() entry length: 83; type: 18
>>> KeyTabInputStream, readName(): RHELENT.LAN
>>> KeyTabInputStream, readName(): HTTP
>>> KeyTabInputStream, readName(): s4u.rhelent.lan
>>> KeyTab: load() entry length: 67; type: 17
>>> KeyTabInputStream, readName(): RHELENT.LAN
>>> KeyTabInputStream, readName(): HTTP
>>> KeyTabInputStream, readName(): s4u.rhelent.lan
>>> KeyTab: load() entry length: 75; type: 16
>>> KeyTabInputStream, readName(): RHELENT.LAN
>>> KeyTabInputStream, readName(): HTTP
>>> KeyTabInputStream, readName(): s4u.rhelent.lan
>>> KeyTab: load() entry length: 67; type: 23
Looking for keys for: HTTP/s4u.rhelent.lan at RHELENT.LAN
Java config name: null
Native config name: /etc/krb5.conf
Loading krb5 profile at /etc/krb5.conf
Loaded from native config
Added key: 23version: 1
Added key: 16version: 1
Added key: 17version: 1
Found unsupported keytype (18) for HTTP/s4u.rhelent.lan at RHELENT.LAN
>>> KdcAccessibility: reset
Looking for keys for: HTTP/s4u.rhelent.lan at RHELENT.LAN
Added key: 23version: 1
Added key: 16version: 1
Added key: 17version: 1
Found unsupported keytype (18) for HTTP/s4u.rhelent.lan at RHELENT.LAN
default etypes for default_tkt_enctypes: 17 23 16.
>>> KrbAsReq creating message
>>> KrbKdcReq send: kdc=freeipa.rhelent.lan UDP:88, timeout=30000, number of retries =3, #bytes=175
>>> KDCCommunication: kdc=freeipa.rhelent.lan UDP:88, timeout=30000,Attempt =1, #bytes=175
>>> KrbKdcReq send: #bytes read=327
>>>Pre-Authentication Data:
PA-DATA type = 136

>>>Pre-Authentication Data:
PA-DATA type = 19
PA-ETYPE-INFO2 etype = 17, salt = 4k at PqWo9iUZZ$[r", s2kparams = null
PA-ETYPE-INFO2 etype = 16, salt = KaQ|KB<CQ#Vq,Ls&, s2kparams = null
PA-ETYPE-INFO2 etype = 23, salt = Wl=W>9)&A{.`Y;1k, s2kparams = null

>>>Pre-Authentication Data:
PA-DATA type = 2
PA-ENC-TIMESTAMP
>>>Pre-Authentication Data:
PA-DATA type = 133

>>> KdcAccessibility: remove freeipa.rhelent.lan
>>> KDCRep: init() encoding tag is 126 req type is 11
>>>KRBError:
cTime is Sat Jan 20 19:00:57 EST 1996 822182457000
sTime is Mon Nov 30 21:35:51 EST 2015 1448937351000
suSec is 558140
error code is 25
error Message is Additional pre-authentication required
cname is HTTP/s4u.rhelent.lan at RHELENT.LAN
sname is krbtgt/RHELENT.LAN at RHELENT.LAN
eData provided.
msgType is 30
>>>Pre-Authentication Data:
PA-DATA type = 136

>>>Pre-Authentication Data:
PA-DATA type = 19
PA-ETYPE-INFO2 etype = 17, salt = 4k at PqWo9iUZZ$[r", s2kparams = null
PA-ETYPE-INFO2 etype = 16, salt = KaQ|KB<CQ#Vq,Ls&, s2kparams = null
PA-ETYPE-INFO2 etype = 23, salt = Wl=W>9)&A{.`Y;1k, s2kparams = null

>>>Pre-Authentication Data:
PA-DATA type = 2
PA-ENC-TIMESTAMP
>>>Pre-Authentication Data:
PA-DATA type = 133

KRBError received: NEEDED_PREAUTH
KrbAsReqBuilder: PREAUTH FAILED/REQ, re-send AS-REQ
default etypes for default_tkt_enctypes: 17 23 16.
Looking for keys for: HTTP/s4u.rhelent.lan at RHELENT.LAN
Added key: 23version: 1
Added key: 16version: 1
Added key: 17version: 1
Found unsupported keytype (18) for HTTP/s4u.rhelent.lan at RHELENT.LAN
Looking for keys for: HTTP/s4u.rhelent.lan at RHELENT.LAN
Added key: 23version: 1
Added key: 16version: 1
Added key: 17version: 1
Found unsupported keytype (18) for HTTP/s4u.rhelent.lan at RHELENT.LAN
default etypes for default_tkt_enctypes: 17 23 16.
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbAsReq creating message
>>> KrbKdcReq send: kdc=freeipa.rhelent.lan UDP:88, timeout=30000, number of retries =3, #bytes=264
>>> KDCCommunication: kdc=freeipa.rhelent.lan UDP:88, timeout=30000,Attempt =1, #bytes=264
>>> KrbKdcReq send: #bytes read=691
>>> KdcAccessibility: remove freeipa.rhelent.lan
Looking for keys for: HTTP/s4u.rhelent.lan at RHELENT.LAN
Added key: 23version: 1
Added key: 16version: 1
Added key: 17version: 1
Found unsupported keytype (18) for HTTP/s4u.rhelent.lan at RHELENT.LAN
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbAsRep cons in KrbAsReq.getReply HTTP/s4u.rhelent.lan
Service subject: Subject:
Principal: HTTP/s4u.rhelent.lan at RHELENT.LAN
Private Credential: Ticket (hex) =
0000: 61 82 01 51 30 82 01 4D   A0 03 02 01 05 A1 0D 1B  a..Q0..M........
0010: 0B 52 48 45 4C 45 4E 54   2E 4C 41 4E A2 20 30 1E  .RHELENT.LAN. 0.
0020: A0 03 02 01 02 A1 17 30   15 1B 06 6B 72 62 74 67  .......0...krbtg
0030: 74 1B 0B 52 48 45 4C 45   4E 54 2E 4C 41 4E A3 82  t..RHELENT.LAN..
0040: 01 13 30 82 01 0F A0 03   02 01 12 A1 03 02 01 01  ..0.............
0050: A2 82 01 01 04 81 FE 04   0B 24 5B A6 36 2A 4B C7  .........$[.6*K.
0060: 0D 58 1A EB 79 20 62 BE   16 44 28 93 5D 87 5B FD  .X..y b..D(.].[.
0070: DE 20 7D CF 79 4C 0E CC   77 90 40 06 10 11 9F 70  . ..yL..w. at ....p
0080: 9E B4 7E B5 CA 14 27 23   DD CD D6 6E 31 1F FC CA  ......'#...n1...
0090: 65 CB 98 47 2B F0 C8 3B   96 C3 D6 AF EB DB 91 2F  e..G+..;......./
00A0: 1D 88 66 53 4F 03 7B 47   3C 32 E8 F2 CE 3E B1 E7  ..fSO..G<2...>..
00B0: 78 80 B3 37 6F 5E 18 76   68 F4 AE C6 C7 C2 B8 99  x..7o^.vh.......
00C0: 61 A3 42 A1 5D 32 69 BB   0D 42 C5 98 46 B8 8A C6  a.B.]2i..B..F...
00D0: 4A 68 88 E3 79 D0 E2 F7   DD 62 0F DD E6 6A 97 7B  Jh..y....b...j..
00E0: 4B A1 A0 1C 45 17 97 E4   CC 71 D2 86 61 52 40 34  K...E....q..aR at 4
00F0: DE EF 45 5E 21 94 AB 5C   76 91 CE 68 DB A1 94 5F  ..E^!..\v..h..._
0100: 14 CC 54 BB 35 85 EB 56   F0 FC 83 B5 CB 41 48 A1  ..T.5..V.....AH.
0110: AE C8 2F 22 C6 48 B9 14   CD 5F 9B B5 14 2B CC D5  ../".H..._...+..
0120: B7 DC C3 74 4C 98 19 10   72 83 5D F6 BC A0 A1 9F  ...tL...r.].....
0130: 19 1F 63 07 AF C1 35 EE   1A 82 FE A5 88 CE 7A DF  ..c...5.......z.
0140: 0F 43 E4 55 EC CC 0C 34   47 B4 B8 E1 C2 90 AC 63  .C.U...4G......c
0150: 19 01 A1 87 A5                                     .....

Client Principal = HTTP/s4u.rhelent.lan at RHELENT.LAN
Server Principal = krbtgt/RHELENT.LAN at RHELENT.LAN
Session Key = EncryptionKey: keyType=17 keyBytes (hex dump)=
0000: D9 D2 7F 9D 3F 5F 32 1A   41 10 4D 9F 0C 7D C5 D8  ....?_2.A.M.....


Forwardable Ticket true
Forwarded Ticket false
Proxiable Ticket false
Proxy Ticket false
Postdated Ticket false
Renewable Ticket true
Initial Ticket true
Auth Time = Mon Nov 30 21:35:51 EST 2015
Start Time = Mon Nov 30 21:35:51 EST 2015
End Time = Tue Dec 01 21:35:51 EST 2015
Renew Till = Mon Dec 07 21:35:51 EST 2015
Client Addresses  Null
Private Credential: /Users/mlb/Documents/localdev.keytab for
HTTP/s4u.rhelent.lan at RHELENT.LAN

Search Subject for Kerberos V5 INIT cred (<<DEF>>,
sun.security.jgss.krb5.Krb5InitCredential)
Found ticket for HTTP/s4u.rhelent.lan at RHELENT.LAN to go to
krbtgt/RHELENT.LAN at RHELENT.LAN expiring on Tue Dec 01 21:35:51 EST
2015
Search Subject for SPNEGO INIT cred (<<DEF>>,
sun.security.jgss.spnego.SpNegoCredElement)
Search Subject for Kerberos V5 INIT cred (<<DEF>>,
sun.security.jgss.krb5.Krb5InitCredential)
Found ticket for HTTP/s4u.rhelent.lan at RHELENT.LAN to go to
krbtgt/RHELENT.LAN at RHELENT.LAN expiring on Tue Dec 01 21:35:51 EST
2015
>>> CksumType: sun.security.krb5.internal.crypto.HmacMd5ArcFourCksumType
default etypes for default_tgs_enctypes: 17 23 16.
>>> CksumType: sun.security.krb5.internal.crypto.RsaMd5CksumType
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbKdcReq send: kdc=freeipa.rhelent.lan UDP:88, timeout=30000, number of retries =3, #bytes=772
>>> KDCCommunication: kdc=freeipa.rhelent.lan UDP:88, timeout=30000,Attempt =1, #bytes=772
>>> KrbKdcReq send: #bytes read=582
>>> KdcAccessibility: remove freeipa.rhelent.lan
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
GSSException: Failure unspecified at GSS-API level (Mechanism level:
Attempt to obtain S4U2self credentials failed!)
at sun.security.jgss.krb5.Krb5InitCredential.impersonate(Krb5InitCredential.java:357)
at sun.security.jgss.spnego.SpNegoCredElement.impersonate(SpNegoCredElement.java:92)
at sun.security.jgss.GSSCredentialImpl.impersonate(GSSCredentialImpl.java:153)
at test24u2.KerberosDemo$1.run(KerberosDemo.java:128)
at test24u2.KerberosDemo$1.run(KerberosDemo.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at test24u2.KerberosDemo.impersonate(KerberosDemo.java:121)
at test24u2.KerberosDemo.generateToken(KerberosDemo.java:179)
at test24u2.KerberosDemo.main(KerberosDemo.java:215)
Caused by: KrbException: S4U2self ticket must be FORWARDABLE
at sun.security.krb5.internal.CredentialsUtil.acquireS4U2selfCreds(CredentialsUtil.java:75)
at sun.security.krb5.Credentials.acquireS4U2selfCreds(Credentials.java:463)
at sun.security.jgss.krb5.Krb5InitCredential.impersonate(Krb5InitCredential.java:353)
... 9 more

Seems it looks like its still doing the check for forwardable.

Thanks
Marc Boorshtein
CTO Tremolo Security
marc.boorshtein at tremolosecurity.com
(703) 828-4902


On Mon, Nov 30, 2015 at 8:32 PM, Wang Weijun <weijun.wang at oracle.com> wrote:
> Hi Marc
>
> Looks like the problem is below:
>
>>> KrbKdcRep.check: at #1. request for true, received false
>
> We've already fixed this in jdk9 at
>
>   https://bugs.openjdk.java.net/browse/JDK-8022582
>   http://hg.openjdk.java.net/jdk9/dev/jdk/rev/ae6449bc523f
>
> you can see the check now starts at #2.
>
> Can you try out the latest jdk9 at https://jdk9.java.net/download/?
>
> Meanwhile, I'll file a backport request to jdk8u.
>
> Thanks
> Max
>


More information about the security-dev mailing list