Commit 50ccd846 authored by YannGarcia's avatar YannGarcia
Browse files

CV2X#3 Validation against PKIs

parent 267aba68
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -693,7 +693,7 @@ namespace LibItsSecurity__Functions {
    p__publicEphemeralKeyCompressed = ec->public_key_compressed();
    p__publicEphemeralKeyCompressed = ec->public_key_compressed();
    loggers::get_instance().log_msg("fx__encryptWithEciesNistp256WithSha256: Ephemeral public compressed key: ", p__publicEphemeralKeyCompressed);
    loggers::get_instance().log_msg("fx__encryptWithEciesNistp256WithSha256: Ephemeral public compressed key: ", p__publicEphemeralKeyCompressed);
    p__ephemeralCompressedMode = (ec->public_key_compressed_mode() == ecc_compressed_mode::compressed_y_0) ? 0 : 1;
    p__ephemeralCompressedMode = (ec->public_key_compressed_mode() == ecc_compressed_mode::compressed_y_0) ? 0 : 1;
    loggers::get_instance().log("fx__encryptWithEciesNistp256WithSha256: Ephemeral public compressed mode: %d: ", p__ephemeralCompressedMode);
    loggers::get_instance().log("fx__encryptWithEciesNistp256WithSha256: Ephemeral public compressed mode: %d: ", (int)p__ephemeralCompressedMode);
    // 3. Retrieve AES 128 parameters
    // 3. Retrieve AES 128 parameters
    p__nonce = ec->nonce();
    p__nonce = ec->nonce();
    loggers::get_instance().log_msg("fx__encryptWithEciesNistp256WithSha256: p__nonce: ", p__nonce);
    loggers::get_instance().log_msg("fx__encryptWithEciesNistp256WithSha256: p__nonce: ", p__nonce);
@@ -858,7 +858,7 @@ namespace LibItsSecurity__Functions {
    p__publicEphemeralKeyCompressed = ec->public_key_compressed();
    p__publicEphemeralKeyCompressed = ec->public_key_compressed();
    loggers::get_instance().log_msg("fx__encryptWithEciesBrainpoolp256r1WithSha256: Ephemeral public compressed key: ", p__publicEphemeralKeyCompressed);
    loggers::get_instance().log_msg("fx__encryptWithEciesBrainpoolp256r1WithSha256: Ephemeral public compressed key: ", p__publicEphemeralKeyCompressed);
    p__ephemeralCompressedMode = (ec->public_key_compressed_mode() == ecc_compressed_mode::compressed_y_0) ? 0 : 1;
    p__ephemeralCompressedMode = (ec->public_key_compressed_mode() == ecc_compressed_mode::compressed_y_0) ? 0 : 1;
    loggers::get_instance().log("fx__encryptWithEciesBrainpoolp256r1WithSha256: Ephemeral public compressed mode: %d: ", p__ephemeralCompressedMode);
    loggers::get_instance().log("fx__encryptWithEciesBrainpoolp256r1WithSha256: Ephemeral public compressed mode: %d: ", (int)p__ephemeralCompressedMode);
    // 3. Retrieve AES 128 parameters
    // 3. Retrieve AES 128 parameters
    p__nonce = ec->nonce();
    p__nonce = ec->nonce();
    loggers::get_instance().log_msg("fx__encryptWithEciesBrainpoolp256r1WithSha256: p__nonce: ", p__nonce);
    loggers::get_instance().log_msg("fx__encryptWithEciesBrainpoolp256r1WithSha256: p__nonce: ", p__nonce);
+45 −5
Original line number Original line Diff line number Diff line
@@ -6,20 +6,25 @@ else
 endif
 endif
endif
endif


ifeq (,$(CERTGEN))
 $(error CERTGEN variable shall point to the certgen project)
endif

outdir=certificates
outdir=certificates
in=profiles
in=profiles
xerdir=xer
xerdir=xer
depdir=temp
depdir=temp
keydir=certificates
keydir=certificates
iutdir=iut


ifeq ($(ARCH),msvc)
ifeq ($(ARCH),msvc)
  asn1certgen= ../../../itscertgen/build/msvc/x64/Debug/certgen.exe
  asn1certgen= $(CERTGEN)/build/msvc/x64/Debug/certgen.exe
else
else
  asn1certgen=../../../itscertgen/build/$(ARCH)-d/certgen
  asn1certgen=$(CERTGEN)/build/$(ARCH)-d/certgen
endif
endif


xsl_cvt=../../../itscertgen/certgen/asn1certgen.xslt
xsl_cvt=$(CERTGEN)/itscertgen/certgen/asn1certgen.xslt
xsl_dep=../../../itscertgen/certgen/prof2dep.xsl
xsl_dep=$(CERTGEN)/itscertgen/certgen/prof2dep.xsl


profiles=$(wildcard $(in)/*.xml)
profiles=$(wildcard $(in)/*.xml)
certificates_oer=$(patsubst $(in)/%.xml, $(outdir)/%.oer, $(profiles))
certificates_oer=$(patsubst $(in)/%.xml, $(outdir)/%.oer, $(profiles))
@@ -28,7 +33,7 @@ deps=$(patsubst $(in)/%.xml, $(depdir)/%.dep, $(profiles))


all: $(sort $(outdir) $(xerdir) $(depdir)) $(certificates_oer)
all: $(sort $(outdir) $(xerdir) $(depdir)) $(certificates_oer)


$(sort $(outdir) $(xerdir) $(depdir)):
$(sort $(outdir) $(xerdir) $(depdir) $(iutdir)):
	mkdir -p $@
	mkdir -p $@
clean:
clean:
	rm -f $(certificates_oer) $(certificates_xer)
	rm -f $(certificates_oer) $(certificates_xer)
@@ -45,4 +50,39 @@ $(deps): $(depdir)/%.dep : $(in)/%.xml


$(certificates_xer) : $(xsl_cvt)
$(certificates_xer) : $(xsl_cvt)


certs_iut_at = $(filter $(outdir)/CERT_IUT_%_AT.oer, $(certificates_oer))
vkeys_iut_at = $(patsubst %.oer, %.vkey, $(certs_iut_at))
ekeys_iut_at = $(patsubst %.oer, %.ekey, $(certs_iut_at))

certs_iut := $(filter $(outdir)/CERT_IUT_%_RCA.oer, $(certificates_oer))
certs_iut += $(filter $(outdir)/CERT_IUT_%_AA.oer, $(certificates_oer))
certs_iut += $(certs_iut_at)

iut_files = $(patsubst $(outdir)/%, $(iutdir)/%, $(certs_iut) $(vkeys_iut_at) $(ekeys_iut_at))

install: $(iutdir) $(iut_files)

$(iut_files): $(iutdir)/%: $(outdir)/%
	-cp -f $< $@

$(vkeys_iut_at) $(ekeys_iut_at):

IUT_TC23 = CERT_IUT_C1_AT.oer CERT_IUT_C1_AT.vkey CERT_IUT_C1_AT.ekey CERT_IUT_CC_AA.oer CERT_IUT_C_RCA.oer CERT_TS_A_AT.oer CERT_IUT_A_AA.oer
IUT_TC24 = CERT_IUT_C2_AT.oer CERT_IUT_C2_AT.vkey CERT_IUT_C2_AT.ekey CERT_IUT_C2_AA.oer CERT_IUT_C_RCA.oer CERT_IUT_A_RCA.oer CERT_TS_A_AT.oer CERT_IUT_A_AA.oer
IUT_TC25 = CERT_IUT_A1_AT.oer CERT_IUT_A1_AT.vkey CERT_IUT_A1_AT.ekey CERT_IUT_A_AA.oer CERT_IUT_A_RCA.oer CERT_TS_A_AT.oer 
IUT_TC26 = CERT_IUT_A2_AT.oer CERT_IUT_A2_AT.vkey CERT_IUT_A2_AT.ekey CERT_IUT_A_AA.oer CERT_IUT_A_RCA.oer CERT_TS_A_AT.oer 
IUT_TC27 = CERT_IUT_A3_AT.oer CERT_IUT_A3_AT.vkey CERT_IUT_A3_AT.ekey CERT_IUT_A_AA.oer CERT_IUT_A_RCA.oer CERT_TS_A_AT.oer 
IUT_TC28 = CERT_IUT_A_AT_A8.oer CERT_IUT_A_AT_A8.vkey CERT_IUT_A_AT_A8.ekey CERT_IUT_A_AA_A8.oer CERT_IUT_A_RCA.oer CERT_TS_A_AT.oer CERT_IUT_A_AA.oer

IUT_TCS = TC23 TC24 TC25 TC26 TC27 TC28

define InstallTC
$(addprefix $(TC)/,$(IUT_$(TC))): $(TC)/% : $$(outdir)/%
	mkdir -p $(TC)
	-cp -f $$< $$@
endef
$(foreach TC, $(IUT_TCS), $(eval $(InstallTC)))

install_tc: $(foreach TC, $(IUT_TCS), $(addprefix $(TC)/, $(IUT_$(TC))))

include $(deps)
include $(deps)
+38 −36
Original line number Original line Diff line number Diff line
@@ -27,10 +27,12 @@
	</subject>
	</subject>
	<validity>
	<validity>
		<restriction type="time" start="+0d" end="+365d"/>
		<restriction type="time" start="+0d" end="+365d"/>
		<restriction type="region">
			<rectangle>
			<rectangle>
				<location latitude="+10km" longitude="-10km"/>
				<location latitude="+10km" longitude="-10km"/>
				<location latitude="+5km" longitude="-5km" />
				<location latitude="+5km" longitude="-5km" />
			</rectangle>
			</rectangle>
		</restriction>
	</validity>
	</validity>
	<signature algorithm="0"/>
	<signature algorithm="0"/>
</certificate>
</certificate>
+47 −45
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@
			<assurance level="4" confidence="0"/>
			<assurance level="4" confidence="0"/>
		</attribute>
		</attribute>
		<!-- its_aid_list -->
		<!-- its_aid_list -->
		<attribute type="its_aid_list" eeType="04"> <!-- issue permissions -->
		<attribute type="its_aid_list" eeType="enrol"> <!-- issue permissions -->
			<aid value="CAM"/>  <!--CAM-->
			<aid value="CAM"/>  <!--CAM-->
			<aid value="DENM"/>  <!--DENM-->
			<aid value="DENM"/>  <!--DENM-->
			<aid value="SPAT"/> <!-- TLM / SPAT -->
			<aid value="SPAT"/> <!-- TLM / SPAT -->
@@ -29,6 +29,8 @@
			<aid value="SREM"/> <!-- TLC REQUEST-->
			<aid value="SREM"/> <!-- TLC REQUEST-->
			<aid value="SSEM"/> <!-- TLC RESPONSE -->
			<aid value="SSEM"/> <!-- TLC RESPONSE -->
			<aid value="GN-MGMT"/> <!-- GN-MGMT -->
			<aid value="GN-MGMT"/> <!-- GN-MGMT -->
		</attribute>
		<attribute type="its_aid_list"> <!-- issue permissions -->
			<aid value="CRT-REQ">01 C0</aid> <!-- Cert request:  -->
			<aid value="CRT-REQ">01 C0</aid> <!-- Cert request:  -->
		</attribute>
		</attribute>
		<attribute type="its_aid_ssp_list"> <!-- app permissions -->
		<attribute type="its_aid_ssp_list"> <!-- app permissions -->
+46 −44
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@
			<assurance level="4" confidence="0"/>
			<assurance level="4" confidence="0"/>
		</attribute>
		</attribute>
		<!-- its_aid_list -->
		<!-- its_aid_list -->
		<attribute type="its_aid_list" eeType="04"> <!-- issue permissions -->
		<attribute type="its_aid_list" eeType="enrol"> <!-- issue permissions -->
			<aid value="CAM"/>  <!--CAM-->
			<aid value="CAM"/>  <!--CAM-->
			<aid value="DENM"/>  <!--DENM-->
			<aid value="DENM"/>  <!--DENM-->
			<aid value="SPAT"/> <!-- TLM / SPAT -->
			<aid value="SPAT"/> <!-- TLM / SPAT -->
@@ -29,6 +29,8 @@
			<aid value="SREM"/> <!-- TLC REQUEST-->
			<aid value="SREM"/> <!-- TLC REQUEST-->
			<aid value="SSEM"/> <!-- TLC RESPONSE -->
			<aid value="SSEM"/> <!-- TLC RESPONSE -->
			<aid value="GN-MGMT"/> <!-- GN-MGMT -->
			<aid value="GN-MGMT"/> <!-- GN-MGMT -->
		</attribute>
		<attribute type="its_aid_list"> <!-- issue permissions -->
			<aid value="CRT-REQ">01 C0</aid> <!-- Cert request:  -->
			<aid value="CRT-REQ">01 C0</aid> <!-- Cert request:  -->
		</attribute>
		</attribute>
		<attribute type="its_aid_ssp_list"> <!-- app permissions -->
		<attribute type="its_aid_ssp_list"> <!-- app permissions -->
Loading