Bug fixes for TLS authentication
Change-Id: I568273cb6fc5f0c95c15dc37ad17f51c2090917b
diff --git a/src/main/java/org/onosproject/aaa/AAA.java b/src/main/java/org/onosproject/aaa/AAA.java
index 6e80de0..021beb7 100644
--- a/src/main/java/org/onosproject/aaa/AAA.java
+++ b/src/main/java/org/onosproject/aaa/AAA.java
@@ -394,8 +394,9 @@
stateMachine.challengeState());
stateMachine.setRequestAuthenticator(radiusPayload.generateAuthCode());
- sendRADIUSPacket(radiusPayload);
radiusPayload.addMessageAuthenticator(AAA.this.radiusSecret);
+ sendRADIUSPacket(radiusPayload);
+
// TODO: this gets called on every fragment, should only be called at TLS-Start
stateMachine.requestAccess();
@@ -473,7 +474,9 @@
RADIUS inboundRadiusPacket;
while (!done) {
try {
- DatagramPacket inboundBasePacket = new DatagramPacket(new byte[1000], 1000);
+ byte[] packetBuffer = new byte[RADIUS.RADIUS_MAX_LENGTH];
+ DatagramPacket inboundBasePacket =
+ new DatagramPacket(packetBuffer, packetBuffer.length);
DatagramSocket socket = radiusSocket;
socket.receive(inboundBasePacket);
log.info("Packet #{} received", packetNumber++);