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 ...@@ -105,7 +105,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
byte[] securedBeaconHeader = buildSecuredBeacon(beaconHeader, tst, currentTime, false); byte[] securedBeaconHeader = buildSecuredBeacon(beaconHeader, tst, currentTime, false);
// triggerTime = currentTime; // triggerTime = currentTime;
// Send the secured beacon // 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); send(securedBeaconHeader, params);
} }
/* TODO Uncomment to get secured beacon*/ /* TODO Uncomment to get secured beacon*/
...@@ -182,18 +182,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific ...@@ -182,18 +182,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
byte[] b; byte[] b;
if (itsAid < 128) { if (itsAid < 128) {
b = new byte[] { (byte)itsAid }; 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 { } else {
b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE); b = SecurityHelper.getInstance().size2tls(itsAid);
b = ByteHelper.concat(
SecurityHelper.getInstance().size2tls(b.length),
b
);
} }
headersField = ByteHelper.concat( headersField = ByteHelper.concat(
headersField, headersField,
......
...@@ -589,18 +589,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable { ...@@ -589,18 +589,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable {
byte[] b; byte[] b;
if (itsAid < 128) { if (itsAid < 128) {
b = new byte[] { (byte)itsAid }; 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 { } else {
b = ByteHelper.intToByteArray(itsAid, Integer.SIZE / Integer.SIZE); b = SecurityHelper.getInstance().size2tls(itsAid);
b = ByteHelper.concat(
SecurityHelper.getInstance().size2tls(b.length),
b
);
} }
headersField = ByteHelper.concat( headersField = ByteHelper.concat(
headersField, 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