Commit 59804da6 authored by garciay's avatar garciay
Browse files

Bug fixed in ItsAid encoding

parent 9e763848
......@@ -105,7 +105,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
byte[] securedBeaconHeader = buildSecuredBeacon(beaconHeader, tst, currentTime, false);
// triggerTime = currentTime;
// Send the secured beacon
//System.out.println("GnPort: Call send " + ByteHelper.byteArrayToString(securedBeaconHeader));
//TERFactory.getInstance().logDebug("GnPort: Call send " + ByteHelper.byteArrayToString(securedBeaconHeader));
send(securedBeaconHeader, params);
}
/* TODO Uncomment to get secured beacon*/
......@@ -182,18 +182,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
byte[] b;
if (itsAid < 128) {
b = new byte[] { (byte)itsAid };
} else if (itsAid < Short.MAX_VALUE) {
b = ByteHelper.intToByteArray(itsAid, Short.SIZE / Byte.SIZE);
b = ByteHelper.concat(
SecurityHelper.getInstance().size2tls(b.length),
b
);
} else {
b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE);
b = ByteHelper.concat(
SecurityHelper.getInstance().size2tls(b.length),
b
);
b = SecurityHelper.getInstance().size2tls(itsAid);
}
headersField = ByteHelper.concat(
headersField,
......
......@@ -589,18 +589,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable {
byte[] b;
if (itsAid < 128) {
b = new byte[] { (byte)itsAid };
} else if (itsAid < Short.MAX_VALUE) {
b = ByteHelper.intToByteArray(itsAid, Short.SIZE / Byte.SIZE);
b = ByteHelper.concat(
SecurityHelper.getInstance().size2tls(b.length),
b
);
} else {
b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE);
b = ByteHelper.concat(
SecurityHelper.getInstance().size2tls(b.length),
b
);
b = SecurityHelper.getInstance().size2tls(itsAid);
}
headersField = ByteHelper.concat(
headersField,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment