Commit c89d62ed authored by berge's avatar berge
Browse files

Merged revision(s) 1840-1916 from branches/Security

parent d0339b89
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -27,6 +27,8 @@ import org.etsi.its.adapter.ports.FsapPort;
import org.etsi.its.adapter.ports.GnPort;
import org.etsi.its.adapter.ports.GnPort;
import org.etsi.ttcn.tci.CharstringValue;
import org.etsi.ttcn.tci.CharstringValue;


import de.fraunhofer.sit.c2x.CryptoLib;

/**
/**
 *  This class is used to centralise test adapter configuration and execution parameters 
 *  This class is used to centralise test adapter configuration and execution parameters 
 *  All settings are component specific (multiton)
 *  All settings are component specific (multiton)
@@ -411,8 +413,9 @@ public class Management implements IManagementTA, IManagementLayers {
            // Extract public keys
            // Extract public keys
            atCertificate = certificate.toByteArray();
            atCertificate = certificate.toByteArray();
//                System.out.println("Management.setupSecuredModeFromTaConfig: certificate=" + ByteHelper.byteArrayToString(value));
//                System.out.println("Management.setupSecuredModeFromTaConfig: certificate=" + ByteHelper.byteArrayToString(value));
            atCertificateDigest = new byte[8];
            // Compute AT certificate digest
            System.arraycopy(atCertificate, 3, atCertificateDigest, 0, 8);
            byte[] atHash = CryptoLib.hashWithSha256(atCertificate);
            atCertificateDigest = ByteHelper.extract(atHash, atHash.length - 8, 8);
//                System.out.println("Management.setupSecuredModeFromTaConfig: atCertificateDigest=" + ByteHelper.byteArrayToString(atCertificateDigest));
//                System.out.println("Management.setupSecuredModeFromTaConfig: atCertificateDigest=" + ByteHelper.byteArrayToString(atCertificateDigest));
            int offset = 18;
            int offset = 18;
            // KeyX
            // KeyX
+1 −1
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@ package org.etsi.its.adapter;


import java.io.ByteArrayInputStream;
import java.io.ByteArrayInputStream;


import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;


public class TlsHelper {
public class TlsHelper {
    
    
+2 −2
Original line number Original line Diff line number Diff line
@@ -242,7 +242,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
    @Override
    @Override
    public boolean send(byte[] message) {
    public boolean send(byte[] message) {
        HashMap<String, Object> params = new HashMap<String, Object>();
        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);
        byte[] destMacAddress = ByteHelper.extract(message, message.length - 6, 6);
        message = ByteHelper.extract(message, 0, message.length - 6);
        message = ByteHelper.extract(message, 0, message.length - 6);
@@ -250,7 +250,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
        if (management.isSecuredModeSet()) { // Secure mode disabled
        if (management.isSecuredModeSet()) { // Secure mode disabled
            message = createSecuredMessage(message);
            message = createSecuredMessage(message);
        }
        }
        ByteHelper.dump("GnPort.send", message);
//        ByteHelper.dump("GnPort.send", message);
        return send(message, params);
        return send(message, params);
    }
    }
    
    
+1 −1
Original line number Original line Diff line number Diff line
@@ -77,7 +77,7 @@ public abstract class ProtocolPort extends Layer implements IPort, IObservable {
	public boolean send(byte[] message) {
	public boolean send(byte[] message) {
		HashMap<String, Object> params = new HashMap<String, Object>();
		HashMap<String, Object> params = new HashMap<String, Object>();
        
        
		ByteHelper.dump("ProtocolPortLayer.send", message);
//		ByteHelper.dump("ProtocolPortLayer.send", message);
		return send(message, params);
		return send(message, params);
	}
	}
	
	
+1 −6
Original line number Original line Diff line number Diff line
@@ -5,11 +5,6 @@ import org.etsi.certificates.io.ICertificatesIO;


public class CertificatesIOFactory {
public class CertificatesIOFactory {
    
    
    /**
     * The single instance of this class.
     */
    private static CertificatesIOFactory _instance = new CertificatesIOFactory();
    
    /**
    /**
     * The single instance of the class CertificatesIO.
     * The single instance of the class CertificatesIO.
     */
     */
@@ -20,7 +15,7 @@ public class CertificatesIOFactory {
     * @return    The single instance of this class.
     * @return    The single instance of this class.
     */
     */
    public static ICertificatesIO getInstance() {
    public static ICertificatesIO getInstance() {
        return _instance._certIO;
        return _certIO;
    }
    }
    
    
    /**
    /**
Loading