byte[] response = gssContext.acceptSecContext(token, 0, token.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException(); byte[] response = gssContext.acceptSecContext(message, 0, message.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException();
Oid actualMech = gssContext.getMech(); saslGssapi.tracef("Negotiated mechanism %s", actualMech); if (KERBEROS_V5.equals(actualMech) == false) {
/** * Instance a <code>SpnegoContext</code> object by wrapping a {@link GSSContext} * with the same mechanism this {@link GSSContext} used. * * @param source the {@link GSSContext} to be wrapped * @throws GSSException */ SpnegoContext(GSSContext source) throws GSSException{ this(source, new Oid[]{source.getMech()}); } /**
/** * {@inheritDoc} * * @see java.lang.Object#toString() */ @Override public String toString () { if ( this.gssContext == null || !this.gssContext.isEstablished() ) { return String.format("KERB5[src=%s,targ=%s]", this.clientName, this.serviceName); } try { return String .format("KERB5[src=%s,targ=%s,mech=%s]", this.gssContext.getSrcName(), this.gssContext.getTargName(), this.gssContext.getMech()); } catch ( GSSException e ) { log.debug("Failed to get info", e); return super.toString(); } }
/** * {@inheritDoc} * * @see java.lang.Object#toString() */ @Override public String toString () { if ( this.gssContext == null || !this.gssContext.isEstablished() ) { return String.format("KERB5[src=%s,targ=%s]", this.clientName, this.serviceName); } try { return String .format("KERB5[src=%s,targ=%s,mech=%s]", this.gssContext.getSrcName(), this.gssContext.getTargName(), this.gssContext.getMech()); } catch ( GSSException e ) { log.debug("Failed to get info", e); return super.toString(); } }
LOGGER.fine("Mechanism: " + context.getMech());
Key searchSessionKey(Subject subject) throws GSSException{ MIEName src = new MIEName(gssContext.getSrcName().export()); MIEName targ = new MIEName(gssContext.getTargName().export()); Iterator iter = subject.getPrivateCredentials(KerberosTicket.class).iterator(); while (iter.hasNext()) { KerberosTicket ticket = (KerberosTicket) iter.next(); MIEName client = new MIEName(gssContext.getMech(), ticket.getClient().getName()); MIEName server = new MIEName(gssContext.getMech(), ticket.getServer().getName()); if(src.equals(client)&&targ.equals(server)){ return ticket.getSessionKey(); } } return null; } public void dispose() throws GSSException {
LOGGER.debug("Context mechanism = {}", context.getMech()); LOGGER.debug("Initiator = {}", context.getSrcName()); LOGGER.debug("Acceptor = {}", context.getTargName());
Key searchSessionKey ( Subject subject ) throws GSSException { MIEName src = new MIEName(this.gssContext.getSrcName().export()); MIEName targ = new MIEName(this.gssContext.getTargName().export()); ASN1ObjectIdentifier mech = ASN1ObjectIdentifier.getInstance(this.gssContext.getMech().getDER()); for ( KerberosTicket ticket : subject.getPrivateCredentials(KerberosTicket.class) ) { MIEName client = new MIEName(mech, ticket.getClient().getName()); MIEName server = new MIEName(mech, ticket.getServer().getName()); if ( src.equals(client) && targ.equals(server) ) { return ticket.getSessionKey(); } } return null; }
Key searchSessionKey ( Subject subject ) throws GSSException { MIEName src = new MIEName(this.gssContext.getSrcName().export()); MIEName targ = new MIEName(this.gssContext.getTargName().export()); ASN1ObjectIdentifier mech = ASN1ObjectIdentifier.getInstance(this.gssContext.getMech().getDER()); for ( KerberosTicket ticket : subject.getPrivateCredentials(KerberosTicket.class) ) { MIEName client = new MIEName(mech, ticket.getClient().getName()); MIEName server = new MIEName(mech, ticket.getServer().getName()); if ( src.equals(client) && targ.equals(server) ) { return ticket.getSessionKey(); } } return null; }
contextFlags |= NegTokenInit.INTEGRITY; ret = new NegTokenInit(new String[]{context.getMech().toString()}, contextFlags, mechToken, null).toByteArray(); }else{ SpnegoToken spToken = getToken(inputBuf, offset, len); result = NegTokenTarg.ACCEPT_COMPLETED; ret = new NegTokenTarg(result, context.getMech().toString(), mechToken, null).toByteArray();
byte[] response = gssContext.acceptSecContext(token, 0, token.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException(); byte[] response = gssContext.acceptSecContext(message, 0, message.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException();
byte[] response = gssContext.acceptSecContext(token, 0, token.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException(); byte[] response = gssContext.acceptSecContext(message, 0, message.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException();
byte[] response = gssContext.acceptSecContext(token, 0, token.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException(); byte[] response = gssContext.acceptSecContext(message, 0, message.length); if (gssContext.isEstablished()) { Oid actualMechanism = gssContext.getMech(); if (! mechanism.equals(actualMechanism)) { throw saslGs2.mechGssApiMechanismMismatch().toSaslException();
Oid actualMech = gssContext.getMech(); saslGssapi.tracef("Negotiated mechanism %s", actualMech); if (KERBEROS_V5.equals(actualMech) == false) {
Oid actualMech = gssContext.getMech(); saslGssapi.tracef("Negotiated mechanism %s", actualMech); if (KERBEROS_V5.equals(actualMech) == false) {
Oid actualMech = gssContext.getMech(); saslGssapi.tracef("Negotiated mechanism %s", actualMech); if (KERBEROS_V5.equals(actualMech) == false) {