KDC-REQ ::= SEQUENCE { -- NOTE: first tag is [1], not [0] pvno [1] INTEGER (5) , msg-type [2] INTEGER (10 -- AS -- | 12 -- TGS --), padata [3] SEQUENCE OF OPTIONAL -- NOTE: not empty --, req-body [4] }
1408140914101411141214131414141514161417141814191420142114221423
KerberosPrincipal clientPrincipal = new KerberosPrincipal( "hnelson@EXAMPLE.COM" ); String passPhrase = "secret"; PaData[] paDatas = getPreAuthEncryptedTimeStamp( clientPrincipal, passPhrase ); KdcReq message = new AsReq(); message.setKdcReqBody( kdcReqBody ); for ( PaData paData : paDatas ) { message.addPaData( paData ); } handler.messageReceived( session, message ); Object msg = session.getMessage();
1453145414551456145714581459146014611462146314641465146614671468
1498149915001501150215031504150515061507150815091510151115121513
412413414415416417418419420421422
long currentTime = System.currentTimeMillis(); KerberosTime requestedEndTime = new KerberosTime( currentTime + KerberosTime.DAY ); kdcReqBody.setTill( requestedEndTime ); KdcReq message = getKdcRequest( tgt, kdcReqBody ); handler.messageReceived( session, message ); Object msg = session.getMessage(); assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
453454455456457458459460461462463
long currentTime = System.currentTimeMillis(); KerberosTime requestedEndTime = new KerberosTime( currentTime + KerberosTime.DAY ); kdcReqBody.setTill( requestedEndTime ); KdcReq message = getKdcRequest( tgt, kdcReqBody ); handler.messageReceived( session, message ); Object msg = session.getMessage(); assertEquals( "session.getMessage() instanceOf", TgsRep.class, msg.getClass() );
504505506507508509510511512513514
560561562563564565566567568569570
HostAddress[] address = { new HostAddress( InetAddress.getByName( null ) ) }; HostAddresses addresses = new HostAddresses( address ); kdcReqBody.setAddresses( addresses ); KdcReq message = getKdcRequest( tgt, kdcReqBody ); handler.messageReceived( session, message ); Object msg = session.getMessage(); assertEquals( "session.getMessage() instanceOf", TgsRep.class, msg.getClass() );
620621622623624625626627628629630
675676677678679680681682683684685
long now = System.currentTimeMillis(); KerberosTime requestedEndTime = new KerberosTime( now + KerberosTime.DAY ); kdcReqBody.setTill( requestedEndTime ); KdcReq message = getKdcRequest( tgt, kdcReqBody ); handler.messageReceived( session, message ); Object msg = session.getMessage(); assertEquals( "session.getMessage() instanceOf", KrbError.class, msg.getClass() );
725726727728729730731732733734735