Commit b9b1f6fd authored by mullers's avatar mullers
Browse files

Merged revision(s) 1925-2226 from branches/STF484_VALIDATION

parent 9bdb3b4a
Loading
Loading
Loading
Loading

data/gencerts.bat

0 → 100644
+55 −0
Changes for data/gencerts.bat: 55 added lines, 0 removed lines.
Original line number Diff line number Diff line
@echo off

REM Output path
REM Path where certificates must be stored
SET OUTPATH=certificates

REM IUT public key file
REM Set it for IUTs which store private keys internally
REM SET IUT_PUBLIC_KEY=<path>

REM Certificate generator path
REM Visual studio
SET CERTGEN=..\tools\itscertgen\build\msvc\Debug\itscertgen.exe 
REM MINGW32
REM SET CERTGEN=..\tools\itscertgen\build\mingw32-d\itscertgen.exe
REM ---------------------------------------------------------------

if DEFINED IUT_PUBLIC_KEY (
	IF NOT EXIST %IUT_PUBLIC_KEY% (^
		echo %IUT_PUBLIC_KEY%: IUT public key file not found 
		exit 1
	)
)

if not exist %OUTPATH% md %OUTPATH%

REM Generate Generic TS certificates
for  %%f in ( profiles\CERT_*_ROOT.xml ^
	profiles\CERT_TS_?_EA.xml profiles\CERT_TS_??_EA.xml ^
	profiles\CERT_TS_?_AA.xml profiles\CERT_TS_??_AA.xml ^
	profiles\CERT_TS_?_EC.xml profiles\CERT_TS_??_EC.xml ^
	profiles\CERT_TS_?_AT.xml profiles\CERT_TS_??_AT.xml  ) DO (
	echo %%f:
	%CERTGEN% -C gencerts.cfg -o %OUTPATH% %%f
)

REM Generate various valid or invalid TS certificates
for  %%f in ( profiles\CERT_*_BO_CA.xml profiles\CERT_*_BV_CA.xml ^
	profiles\CERT_*_BO_AA.xml profiles\CERT_*_BV_AA.xml ^
	profiles\CERT_*_BO_EA.xml profiles\CERT_*_BV_EA.xml ^
	profiles\CERT_*_BO_EC.xml profiles\CERT_*_BV_EC.xml ^
	profiles\CERT_*_BO_AT.xml profiles\CERT_*_BV_AT.xml ) DO (
	echo %%f:
	%CERTGEN% -C gencerts.cfg -o %OUTPATH% %%f
)

REM Generate IUT certificates
for  %%f in (profiles\CERT_IUT_*.xml) DO (
	echo %%f:
        if DEFINED IUT_PUBLIC_KEY (
		%CERTGEN% -C gencerts.cfg -o %OUTPATH% -v %IUT_PUBLIC_KEY% %%f
	) ELSE (
		%CERTGEN% -C gencerts.cfg -o %OUTPATH% %%f
	)
)

data/gencerts.cfg

0 → 100644
+11 −0
Changes for data/gencerts.cfg: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Reuse already existing private and public keys if exists
reuse=yes

# Certificates and keys are provided as hexadecimal streams
format=hex

# Reference time point. The begining of the current year is used by default
#reftime=2015-01-01

# location of the IUT position
reflocation=51.4744200:5.6240500

data/gencerts.sh

0 → 100644
+55 −0
Changes for data/gencerts.sh: 55 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/sh

# Output path
# Path where certificates must be stored
OUTPATH=certificates

# IUT public key file
# Set it for IUTs which store private keys internally
# IUT_PUBLIC_KEY=<path>

# Certificate generator path
CERTGEN=../tools/itscertgen/build/itscertgen
#CERTGEN=../tools/itscertgen/build/msvc/Debug/itscertgen.exe 
# ---------------------------------------------------------------

if ! [ -x "$CERTGEN" ]; then 
  echo "$CERTGEN: generator not found"
  exit 1
fi

IUT_PARAMS=
if [ "x" !=  "x$IUT_PUBLIC_KEY" ]; then
	 [ -f "$IUT_PUBLIC_KEY" ] || ( echo "$IUT_PUBLIC_KEY: public key file not found" ; exit 1 )
	 IUT_PARAMS="-v \"$IUT_PUBLIC_KEY\""
fi

mkdir -p "$OUTPATH"

function generate()
{
	echo "$1:"
	"${CERTGEN}" -C gencerts.cfg -o "$OUTPATH" $IUT_PARAMS "$1" || exit 1
}

# Generate Generic Root certificates
ls -1 profiles/CERT_*_ROOT.xml 2>/dev/null | while read F; do generate "$F"; done

# Generate Generic authority certificates
ls -1	profiles/CERT_TS_?_CA.xml profiles/CERT_TS_??_CA.xml \
	profiles/CERT_TS_?_EA.xml profiles/CERT_TS_??_EA.xml \
	profiles/CERT_TS_?_AA.xml profiles/CERT_TS_??_AA.xml 2>/dev/null | while read F; do generate "$F"; done

# Generate Generic authorization tickets
ls -1	profiles/CERT_TS_?_AT.xml profiles/CERT_TS_??_AT.xml 2>/dev/null | while read F; do generate "$F"; done

# Generate various valid or invalid authority certificates
ls -1	profiles/CERT_*_BO_CA.xml profiles/CERT_*_BV_CA.xml 2>/dev/null | while read F; do generate "$F"; done
ls -1	profiles/CERT_*_BO_AA.xml profiles/CERT_*_BV_AA.xml 2>/dev/null | while read F; do generate "$F"; done
ls -1	profiles/CERT_*_BO_EA.xml profiles/CERT_*_BV_EA.xml 2>/dev/null | while read F; do generate "$F"; done
ls -1	profiles/CERT_*_BO_EC.xml profiles/CERT_*_BV_EC.xml 2>/dev/null | while read F; do generate "$F"; done
ls -1	profiles/CERT_*_BO_AT.xml profiles/CERT_*_BV_AT.xml 2>/dev/null | while read F; do generate "$F"; done

# Generate IUT certificates
[ -n "$IUT_PUBLIC_KEY" ] && IUT_PARAMS="-v \"$IUT_PUBLIC_KEY\""
ls -1 profiles/CERT_IUT_*.xml 2>/dev/null | while read F; do generate "$F" ; done
+28 −0
Changes for data/profiles/CERT_IUT_A_AT.xml: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
<certificate name="CERT_IUT_A_AT">
	<version>2</version>
	<signer type="digest" name="CERT_TS_A_AA"/>
	<subject type="AT" name="">
		<!-- verification_key -->
		<attribute type="verification_key">
			<public_key algorythm="0">
				<ecc_point type="uncompressed"/>
			</public_key>
		</attribute>
		<!-- assurance_level -->
		<attribute type="assurance_level">
			<assurance level="3"/>
		</attribute>
		<!-- its_aid_ssp_list -->
		<attribute type="its_aid_ssp_list">
			<ssp aid="36">&#01;&#xFF;&#xFF;</ssp>  <!-- CAM -->
			<ssp aid="37">&#01;&#xFF;&#xFF;&#xFF;</ssp>  <!-- DENM -->
		</attribute>
	</subject>
	<validity>
		<restriction type="time" start="2015-01-01" end="2015-04-30"/>
		<restriction type="region">
			<none/>
		</restriction>
	</validity>
	<signature algorithm="0"/>
</certificate>
+28 −0
Changes for data/profiles/CERT_IUT_B_AT.xml: 28 added lines, 0 removed lines.
Original line number Diff line number Diff line
<certificate name="CERT_IUT_B_AT">
	<version>2</version>
	<signer type="digest" name="CERT_TS_B_AA"/>
	<subject type="AT" name="">
		<!-- verification_key -->
		<attribute type="verification_key">
			<public_key algorythm="0">
				<ecc_point type="uncompressed"/>
			</public_key>
		</attribute>
		<!-- assurance_level -->
		<attribute type="assurance_level">
			<assurance level="3"/>
		</attribute>
		<!-- its_aid_ssp_list -->
		<attribute type="its_aid_ssp_list">
			<ssp aid="36">&#01;&#xFF;&#xFF;</ssp>  <!-- CAM -->
			<ssp aid="37">&#01;&#xFF;&#xFF;&#xFF;</ssp>  <!-- DENM -->
		</attribute>
	</subject>
	<validity>
		<restriction type="time" start="2015-01-01" end="2015-04-30"/>
		<restriction type="region">
			<circle latitude="0.0" longitude="0.0" radius="5000"/>
		</restriction>
	</validity>
	<signature algorithm="0"/>
</certificate>
Loading