Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 1860 → Rev 1861

/branches/Security/javasrc/adapter/org/etsi/its/adapter/Management.java
26,6 → 26,8
import org.etsi.its.adapter.ports.GnPort;
import org.etsi.ttcn.tci.CharstringValue;
 
import de.fraunhofer.sit.c2x.CryptoLib;
 
/**
* This class is used to centralise test adapter configuration and execution parameters
* All settings are component specific (multiton)
405,8 → 407,9
// Extract public keys
atCertificate = certificate.toByteArray();
// System.out.println("Management.setupSecuredModeFromTaConfig: certificate=" + ByteHelper.byteArrayToString(value));
atCertificateDigest = new byte[8];
System.arraycopy(atCertificate, 3, atCertificateDigest, 0, 8);
// Compute AT certificate digest
byte[] atHash = CryptoLib.hashWithSha256(atCertificate);
atCertificateDigest = ByteHelper.extract(atHash, atHash.length - 8, 8);
// System.out.println("Management.setupSecuredModeFromTaConfig: atCertificateDigest=" + ByteHelper.byteArrayToString(atCertificateDigest));
int offset = 18;
// KeyX
/branches/Security/javasrc/adapter/org/etsi/its/adapter/TlsHelper.java
7,7 → 7,7
 
import java.io.ByteArrayInputStream;
 
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
 
public class TlsHelper {
/branches/Security/javasrc/adapter/org/etsi/its/adapter/ports/GnPort.java
242,7 → 242,7
@Override
public boolean send(byte[] message) {
HashMap<String, Object> params = new HashMap<String, Object>();
ByteHelper.dump(">>> GnPort.send", message);
// ByteHelper.dump(">>> GnPort.send", message);
byte[] destMacAddress = ByteHelper.extract(message, message.length - 6, 6);
message = ByteHelper.extract(message, 0, message.length - 6);
250,7 → 250,7
if (management.isSecuredModeSet()) { // Secure mode disabled
message = createSecuredMessage(message);
}
ByteHelper.dump("GnPort.send", message);
// ByteHelper.dump("GnPort.send", message);
return send(message, params);
}
/branches/Security/javasrc/codec/org/etsi/ttcn/codec/MainCodec.java
38,8 → 38,8
 
@Override
public Value decode(CodecBuffer buf, Type decodingHypothesis) {
System.out.println(">>> MainCodec.decode: " + decodingHypothesis.getName());
ByteHelper.dump(">>> MainCodec.decode: ", buf.getBytes());
// System.out.println(">>> MainCodec.decode: " + decodingHypothesis.getName());
// ByteHelper.dump(">>> MainCodec.decode: ", buf.getBytes());
CodecFactory cf = CodecFactory.getInstance();
TciCDProvided extCodec = cf.getExternalCodec(decodingHypothesis.getTypeEncoding());
61,10 → 61,10
codec.preDecode(buf, decodingHypothesis);
// TODO To be removed, for debug purpose only
Value decValue = codec.decode(buf, decodingHypothesis);
System.out.println("<<< MainCodec.decode: " + decValue);
return decValue;
// return codec.decode(buf, decodingHypothesis);
// Value decValue = codec.decode(buf, decodingHypothesis);
// System.out.println("<<< MainCodec.decode: " + decValue);
// return decValue;
return codec.decode(buf, decodingHypothesis);
}
}
 
90,7 → 90,7
buf = preBuf;
}
ByteHelper.dump("<<< MainCodec.encode: ", buf.getBytes());
// ByteHelper.dump("<<< MainCodec.encode: ", buf.getBytes());
return buf;
}
}
/branches/Security/javasrc/codec/org/etsi/ttcn/codec/generic/Float.java
26,7 → 26,7
FloatValue fv = mainCodec.getTciCDRequired().getFloat();
fv.setFloat(ByteHelper.byteArrayToFloat(buf.readBits(java.lang.Float.SIZE)));
System.out.println("<<< Float.decode: " + fv.getFloat());
// System.out.println("<<< Float.decode: " + fv.getFloat());
return fv;
}
/branches/Security/javasrc/codec/org/etsi/ttcn/codec/its/security/Plugin.java
113,6 → 113,7
cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "HeaderFieldContainer.its_aid", IntX.class);
cf.setCodec(TciTypeClass.INTEGER, "LibItsSecurity", "ValidityRestrictionContainer.end_validity", Time32.class);
cf.setCodec(TciTypeClass.SET_OF, "LibItsSecurity", "SignerInfoContainer.certificates", RecordOf.class);
cf.setCodec(TciTypeClass.SET_OF, "LibItsSecurity", "GeographicRegionContainer.rectangular_region", RecordOf.class);
cf.setCodec(TciTypeClass.SET_OF, "LibItsSecurity", "GeographicRegionContainer.polygonal_region", RecordOf.class);
cf.setCodec(TciTypeClass.SET_OF, "LibItsSecurity", "HeaderFieldContainer.digests", RecordOf.class);
/branches/Security/javasrc/codec/org/etsi/ttcn/codec/its/security/RecordOf.java
24,6 → 24,7
// System.out.println(">>> security.RecordOf.decode: " + decodingHypothesis.getName());
int len = (int) TlsHelper.getInstance().tls2size(buf);// buf.readBytes(1)[0]; // Get number of items into the RecordOf
// System.out.println("security.RecordOf.decode: length=" + len);
if (len == 0) {
RecordOfValue rov = (RecordOfValue)decodingHypothesis.newInstance();
rov.setLength(0);