/** * Negotiates the EAP Authentication Protocol to use * @param id The EAP ID * @param eapType The wanted EAP Protocol Type * @return Returns the EAP-Message */ protected byte[] negotiateEAPType(byte id, byte eapType) { return eapResponse(EAP_NAK, id, new byte[] { eapType }); }
public byte[] doEAPType(byte id, byte[] data, byte[] fullEAPPacket) throws RadiusException, NoSuchAlgorithmException { return doEAPType(id, data); }
byte codeOrType = bb.get(); if (suedoEAPType(eapReply)) return tlvSuccess(id); return eapResponse(EAP_IDENTITY, id, getUsername()); return negotiateEAPType(id, eapType); return eapResponse(eapType, id, doEAPType(id, data, eapReply));
protected boolean doTunnelAuthentication(byte id, byte[] in) throws RadiusException, SSLException, NoSuchAlgorithmException { byte []out; if (in != null && in.length > 0) { out = tunnelAuth.doEAP(in); } else { out = tunnelAuth.eapResponse(EAP_IDENTITY, (byte)0, getUsername()); } putAppBuffer(out); return true; } }
/** * @see net.jradius.client.auth.RadiusAuthenticator#processRequest(net.jradius.packet.RadiusPacket) */ public void processRequest(RadiusPacket p) throws RadiusException { p.removeAttribute(AttributeDictionary.USER_PASSWORD); RadiusAttribute a = AttributeFactory.newAttribute(AttributeDictionary.EAP_MESSAGE, isStartWithIdentity() ? eapResponse(EAP_IDENTITY, (byte)0, getUsername()) : null, p.isRecyclable()); p.overwriteAttribute(a); }
/** * @throws NoSuchAlgorithmException * @see net.jradius.client.auth.RadiusAuthenticator#setupRequest(net.jradius.client.RadiusClient, net.jradius.packet.RadiusPacket) */ public void setupRequest(RadiusClient c, RadiusPacket p) throws RadiusException, NoSuchAlgorithmException { super.setupRequest(c, p); tunnelRequest = new AccessRequest(); AttributeList attrs = tunnelRequest.getAttributes(); if (attrs.get(Attr_UserName.TYPE) == null) attrs.add(AttributeFactory.copyAttribute(username, false)); if (attrs.get(Attr_UserPassword.TYPE) == null) attrs.add(AttributeFactory.copyAttribute(password, false)); tunnelAuth.setupRequest(c, tunnelRequest); tunnelAuth.processRequest(tunnelRequest); }
/** * EAP requires a challenge/response. The request packet is reset with a new * RADIUS identifier and the EAP-Message is encoded. * @throws NoSuchAlgorithmException * @see net.jradius.client.auth.RadiusAuthenticator#processChallenge(net.jradius.packet.RadiusPacket, net.jradius.packet.RadiusPacket) */ public void processChallenge(RadiusPacket p, RadiusPacket r) throws RadiusException, NoSuchAlgorithmException { super.processChallenge(p, r); p.setIdentifier(-1); byte[] eapReply = AttributeFactory.assembleAttributeList(r.getAttributes(), AttributeDictionary.EAP_MESSAGE); byte[] eapMessage = doEAP(eapReply); RadiusAttribute a = p.findAttribute(AttributeDictionary.EAP_MESSAGE); if (a != null) p.removeAttribute(a); AttributeFactory.addToAttributeList(p.getAttributes(), AttributeDictionary.EAP_MESSAGE, eapMessage, p.isRecyclable()); RadiusLog.debug("Sending Challenge:\n" + p.toString()); }
public void setupRequest(RadiusClient c, RadiusPacket p) throws RadiusException, NoSuchAlgorithmException { super.setupRequest(c, p); init(); }
byte codeOrType = bb.get(); if (suedoEAPType(eapReply)) return tlvSuccess(id); return eapResponse(EAP_IDENTITY, id, getUsername()); return negotiateEAPType(id, eapType); return eapResponse(eapType, id, doEAPType(id, data, eapReply));
protected boolean doTunnelAuthentication(byte id, byte[] in) throws RadiusException, SSLException, NoSuchAlgorithmException { byte []out; if (in != null && in.length > 0) { out = tunnelAuth.doEAP(in); } else { out = tunnelAuth.eapResponse(EAP_IDENTITY, (byte)0, getUsername()); } putAppBuffer(out); return true; } }
/** * @see net.jradius.client.auth.RadiusAuthenticator#processRequest(net.jradius.packet.RadiusPacket) */ public void processRequest(RadiusPacket p) throws RadiusException { p.removeAttribute(AttributeDictionary.USER_PASSWORD); RadiusAttribute a = AttributeFactory.newAttribute(AttributeDictionary.EAP_MESSAGE, isStartWithIdentity() ? eapResponse(EAP_IDENTITY, (byte)0, getUsername()) : null, p.isRecyclable()); p.overwriteAttribute(a); }
/** * @throws NoSuchAlgorithmException * @see net.jradius.client.auth.RadiusAuthenticator#setupRequest(net.jradius.client.RadiusClient, net.jradius.packet.RadiusPacket) */ public void setupRequest(RadiusClient c, RadiusPacket p) throws RadiusException, NoSuchAlgorithmException { super.setupRequest(c, p); tunnelRequest = new AccessRequest(); AttributeList attrs = tunnelRequest.getAttributes(); if (attrs.get(Attr_UserName.TYPE) == null) attrs.add(AttributeFactory.copyAttribute(username, false)); if (attrs.get(Attr_UserPassword.TYPE) == null) attrs.add(AttributeFactory.copyAttribute(password, false)); tunnelAuth.setupRequest(c, tunnelRequest); tunnelAuth.processRequest(tunnelRequest); }
/** * EAP requires a challenge/response. The request packet is reset with a new * RADIUS identifier and the EAP-Message is encoded. * @throws NoSuchAlgorithmException * @see net.jradius.client.auth.RadiusAuthenticator#processChallenge(net.jradius.packet.RadiusPacket, net.jradius.packet.RadiusPacket) */ public void processChallenge(RadiusPacket p, RadiusPacket r) throws RadiusException, NoSuchAlgorithmException { super.processChallenge(p, r); p.setIdentifier(-1); byte[] eapReply = AttributeFactory.assembleAttributeList(r.getAttributes(), AttributeDictionary.EAP_MESSAGE); byte[] eapMessage = doEAP(eapReply); RadiusAttribute a = p.findAttribute(AttributeDictionary.EAP_MESSAGE); if (a != null) p.removeAttribute(a); AttributeFactory.addToAttributeList(p.getAttributes(), AttributeDictionary.EAP_MESSAGE, eapMessage, p.isRecyclable()); RadiusLog.debug("Sending Challenge:\n" + p.toString()); }
public void setupRequest(RadiusClient c, RadiusPacket p) throws RadiusException, NoSuchAlgorithmException { super.setupRequest(c, p); init(); }
protected boolean doTunnelAuthentication(byte id, byte[] in) throws RadiusException, SSLException, NoSuchAlgorithmException { byte []out; if (in != null && in.length > 0) { out = tunnelAuth.doEAP(in); } else { out = tunnelAuth.eapResponse(EAP_IDENTITY, (byte)0, getUsername()); } putAppBuffer(out); return true; } }
/** * @throws NoSuchAlgorithmException * @see net.jradius.client.auth.RadiusAuthenticator#setupRequest(net.jradius.client.RadiusClient, net.jradius.packet.RadiusPacket) */ public void setupRequest(RadiusClient c, RadiusPacket p) throws RadiusException, NoSuchAlgorithmException { super.setupRequest(c, p); tunnelRequest = new AccessRequest(); AttributeList attrs = tunnelRequest.getAttributes(); if (attrs.get(Attr_UserName.TYPE) == null) attrs.add(AttributeFactory.copyAttribute(username, false)); if (attrs.get(Attr_UserPassword.TYPE) == null) attrs.add(AttributeFactory.copyAttribute(password, false)); tunnelAuth.setupRequest(c, tunnelRequest); tunnelAuth.processRequest(tunnelRequest); }
public byte[] tlvSuccess(byte id) { byte[] b = new byte[6]; b[0] = (byte)0x80; b[1] = (byte)0x03; b[2] = (byte)0x00; b[3] = (byte)0x02; b[4] = (byte)0x00; b[5] = (byte)0x01; return eapResponse(EAP_TLV, id, b); }
public void setupRequest(RadiusClient c, RadiusPacket p) throws RadiusException, NoSuchAlgorithmException { super.setupRequest(c, p); init(); }
public byte[] doEAPType(byte id, byte[] data, byte[] fullEAPPacket) throws RadiusException, NoSuchAlgorithmException { return doEAPType(id, data); }
/** * Negotiates the EAP Authentication Protocol to use * @param id The EAP ID * @param eapType The wanted EAP Protocol Type * @return Returns the EAP-Message */ protected byte[] negotiateEAPType(byte id, byte eapType) { return eapResponse(EAP_NAK, id, new byte[] { eapType }); }