Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Fix reserved 2 bytes in ipv6 authentication header
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikars committed May 1, 2019
1 parent 90d8c27 commit 7cb1260
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
package com.ardikars.jxpacket.core.ip.ip6;

import com.ardikars.common.memory.Memory;
import com.ardikars.common.util.Strings;
import com.ardikars.common.util.Validate;
import com.ardikars.jxpacket.common.AbstractPacket;
import com.ardikars.jxpacket.common.Packet;
import com.ardikars.jxpacket.common.layer.TransportLayer;

import java.util.Arrays;

public class Authentication extends AbstractPacket {

private final Authentication.Header header;
Expand Down Expand Up @@ -136,7 +135,7 @@ public String toString() {
.append("\t\tpayloadLength: ").append(payloadLength).append('\n')
.append("\t\tsecurityParameterIndex: ").append(securityParameterIndex).append('\n')
.append("\t\tsequenceNumber: ").append(sequenceNumber).append('\n')
.append("\t\tintegrityCheckValue: ").append(Arrays.toString(integrityCheckValue)).append('\n')
.append("\t\tintegrityCheckValue: ").append(Strings.toHexString(integrityCheckValue)).append('\n')
.toString();
}

Expand Down Expand Up @@ -200,6 +199,7 @@ public Packet build() {
public Packet build(final Memory buffer) {
this.nextHeader = TransportLayer.valueOf(buffer.readByte());
this.payloadLength = buffer.readByte();
buffer.readShort(); // reserved
this.securityParameterIndex = buffer.readInt();
this.sequenceNumber = buffer.readInt();
this.integrityCheckValue = new byte[(this.payloadLength + 2) * 4 - 12];
Expand Down

0 comments on commit 7cb1260

Please sign in to comment.