Commit 6d72b92f authored by garciay's avatar garciay
Browse files

Increase SSp size from Bit128 to Bit256

parent e16da27a
...@@ -68,7 +68,8 @@ public class Management implements IManagementTA, IManagementLayers { ...@@ -68,7 +68,8 @@ public class Management implements IManagementTA, IManagementLayers {
/** /**
* Enforce secured mode status * Enforce secured mode status
*/ */
private static final String TsEnforceSecuredMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsEnforceSecuredMode")).getString(); //private static String TsEnforceSecuredMode = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsEnforceSecuredMode")).getString();
private static String TsEnforceSecuredMode = "false";
/** /**
* Secured root path to access certificates & private keys * Secured root path to access certificates & private keys
...@@ -354,7 +355,12 @@ public class Management implements IManagementTA, IManagementLayers { ...@@ -354,7 +355,12 @@ public class Management implements IManagementTA, IManagementLayers {
@Override @Override
public void setSecuredMode(final byte[] securityData) { public void setSecuredMode(final byte[] securityData) {
certificateId = ByteHelper.byteArrayWithLengthToString(ByteHelper.concat(ByteHelper.intToByteArray(securityData.length, 4), securityData)); certificateId = ByteHelper.byteArrayWithLengthToString(ByteHelper.concat(ByteHelper.intToByteArray(securityData.length - 1, 4), securityData));
if (securityData[securityData.length - 1] == 0x01) {
TsEnforceSecuredMode = "true";
} else {
TsEnforceSecuredMode = "false";
}
setupSecuredMode(); setupSecuredMode();
} }
......
...@@ -421,7 +421,15 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific { ...@@ -421,7 +421,15 @@ public class GnLayer extends Layer implements Runnable, IEthernetSpecific {
// Other messages // Other messages
if(payloadLength > 0) { if(payloadLength > 0) {
byte[] mpayload = new byte[payloadLength]; byte[] mpayload = new byte[payloadLength];
System.arraycopy(payload, commonHdr.length + 44/*Topology-Scoped Broadcast*/, mpayload, 0, payloadLength); int extendedHeader = 0;
if (headerType == 1) { // Beacon
extendedHeader = 24;
} else if (headerType == 4) { // Geo Broadcast
extendedHeader = 44;
} else if (headerType == 5) { // Topology-Scoped Broadcast
extendedHeader = 28;
} // TODO To be continued
System.arraycopy(payload, commonHdr.length + extendedHeader, mpayload, 0, payloadLength);
//TERFactory.getInstance().logDebug("GnLayer.receive: Message =" + ByteHelper.byteArrayToString(mpayload)); //TERFactory.getInstance().logDebug("GnLayer.receive: Message =" + ByteHelper.byteArrayToString(mpayload));
lowerInfo.put(GN_NEXTHEADER, nextHeader); lowerInfo.put(GN_NEXTHEADER, nextHeader);
lowerInfo.put(GN_TYPE, headerType); lowerInfo.put(GN_TYPE, headerType);
......
...@@ -58,7 +58,7 @@ public class CamPort extends ProtocolPort { ...@@ -58,7 +58,7 @@ public class CamPort extends ProtocolPort {
); );
// Add security info to pass to the ATS // Add security info to pass to the ATS
if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) {
byte[] buf = new byte[16]; byte[] buf = new byte[32];
msgInd = ByteHelper.concat(msgInd, buf); msgInd = ByteHelper.concat(msgInd, buf);
} else { } else {
msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP));
......
...@@ -58,7 +58,7 @@ public class DenmPort extends ProtocolPort { ...@@ -58,7 +58,7 @@ public class DenmPort extends ProtocolPort {
); );
// Add security info to pass to the ATS // Add security info to pass to the ATS
if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) {
byte[] buf = new byte[16]; byte[] buf = new byte[32];
msgInd = ByteHelper.concat(msgInd, buf); msgInd = ByteHelper.concat(msgInd, buf);
} else { } else {
msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP));
......
...@@ -368,7 +368,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific ...@@ -368,7 +368,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
byte[] msgInd = ByteHelper.concat(message, (byte[])lowerInfo.get(EthernetLayer.LINK_LAYER_DESTINATION)); byte[] msgInd = ByteHelper.concat(message, (byte[])lowerInfo.get(EthernetLayer.LINK_LAYER_DESTINATION));
// Add security info to pass to the ATS // Add security info to pass to the ATS
if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) {
byte[] buf = new byte[16]; byte[] buf = new byte[32];
msgInd = ByteHelper.concat(msgInd, buf); msgInd = ByteHelper.concat(msgInd, buf);
} else { } else {
msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP));
......
...@@ -58,7 +58,7 @@ public class IvimPort extends ProtocolPort { ...@@ -58,7 +58,7 @@ public class IvimPort extends ProtocolPort {
); );
// Add security info to pass to the ATS // Add security info to pass to the ATS
if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) {
byte[] buf = new byte[16]; byte[] buf = new byte[32];
msgInd = ByteHelper.concat(msgInd, buf); msgInd = ByteHelper.concat(msgInd, buf);
} else { } else {
msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP));
......
...@@ -47,7 +47,7 @@ public class MapemSpatemPort extends ProtocolPort { ...@@ -47,7 +47,7 @@ public class MapemSpatemPort extends ProtocolPort {
); );
// Add security info to pass to the ATS // Add security info to pass to the ATS
if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) {
byte[] buf = new byte[16]; byte[] buf = new byte[32];
msgInd = ByteHelper.concat(msgInd, buf); msgInd = ByteHelper.concat(msgInd, buf);
} else { } else {
msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP));
......
...@@ -47,7 +47,7 @@ public class SremSsemPort extends ProtocolPort { ...@@ -47,7 +47,7 @@ public class SremSsemPort extends ProtocolPort {
); );
// Add security info to pass to the ATS // Add security info to pass to the ATS
if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) { if (lowerInfo.get(SecurityHelper.SEC_SSP) == null) {
byte[] buf = new byte[16]; byte[] buf = new byte[32];
msgInd = ByteHelper.concat(msgInd, buf); msgInd = ByteHelper.concat(msgInd, buf);
} else { } else {
msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP)); msgInd = ByteHelper.concat(msgInd, (byte[])lowerInfo.get(SecurityHelper.SEC_SSP));
......
...@@ -22,7 +22,7 @@ public class FacilitiesInd extends Record { ...@@ -22,7 +22,7 @@ public class FacilitiesInd extends Record {
protected void preDecode(CodecBuffer buf, Type decodingHypothesis) { protected void preDecode(CodecBuffer buf, Type decodingHypothesis) {
// System.out.println(">>> FacilitiesInd.preDecode: " + decodingHypothesis); // System.out.println(">>> FacilitiesInd.preDecode: " + decodingHypothesis);
int msgLen = buf.getNbBits() - 8 - 8 - 8 - 32 - 8 - 16 - 16 - 128 - 32; // FIXME Add support of SSP (Bit128) & ITS-AID (UInt32) extra fields: fixed size (128) is not nice! int msgLen = buf.getNbBits() - 8 - 8 - 8 - 32 - 8 - 16 - 16 - 256 - 32; // FIXME Add support of SSP (Bit128) & ITS-AID (UInt32) extra fields: fixed size (256) is not nice!
int offset = 0; int offset = 0;
messageBuffer = buf.getBuffer(offset, msgLen); offset += msgLen; messageBuffer = buf.getBuffer(offset, msgLen); offset += msgLen;
...@@ -33,7 +33,7 @@ public class FacilitiesInd extends Record { ...@@ -33,7 +33,7 @@ public class FacilitiesInd extends Record {
gnTc = buf.getBuffer(offset, 8); offset += 8; gnTc = buf.getBuffer(offset, 8); offset += 8;
btpDestinationPort = buf.getBuffer(offset, 16); offset += 16; btpDestinationPort = buf.getBuffer(offset, 16); offset += 16;
btpInfo = buf.getBuffer(offset, 16); offset += 16; btpInfo = buf.getBuffer(offset, 16); offset += 16;
ssp = buf.getBuffer(offset, 128); offset += 128; ssp = buf.getBuffer(offset, 256); offset += 256;
its_aid = buf.getBuffer(offset, 32); offset += 32; its_aid = buf.getBuffer(offset, 32); offset += 32;
} }
......
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