Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
76ffa86f
Commit
76ffa86f
authored
Nov 08, 2018
by
garciay
Browse files
Merge branch 'STF525' of
https://forge.etsi.org/gitlab/ITS/ITS
into STF525
parents
a36766e8
fe5140eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
ccsrc/Protocols/Pki/pki_layer.cc
View file @
76ffa86f
...
@@ -104,7 +104,10 @@ void pki_layer::sendMsg(const EtsiTs102941TypesAuthorizationValidation::Authoriz
...
@@ -104,7 +104,10 @@ void pki_layer::sendMsg(const EtsiTs102941TypesAuthorizationValidation::Authoriz
return
;
return
;
}
}
// FIXME Encapsulate p_authorization_validation_request into EtsiTs102941Data first
// Create the EtsiTs102941Data layer
EtsiTs102941MessagesCa
::
EtsiTs102941Data
etsi_ts_102941_data
;
etsi_ts_102941_data
.
content
().
authorizationValidationRequest
()
=
p_authorization_validation_request
;
loggers
::
get_instance
().
log_msg
(
"pki_layer::sendMsg: AuthorizationValidationRequest: "
,
etsi_ts_102941_data
);
OCTETSTRING
authorization_validation_request
;
OCTETSTRING
authorization_validation_request
;
_etsi_ts102941_types_authorization_validation_request
.
encode
(
p_authorization_validation_request
,
authorization_validation_request
);
_etsi_ts102941_types_authorization_validation_request
.
encode
(
p_authorization_validation_request
,
authorization_validation_request
);
...
...
LibIts
@
ee052906
Compare
b951e6f1
...
ee052906
Subproject commit
b951e6f197f1fe65a99a0916cf63d6a98a506e09
Subproject commit
ee0529068f3ecf75f6845029f10935668a70340d
ttcn/TestCodec/TestCodec_Pki.ttcn
View file @
76ffa86f
...
@@ -673,13 +673,22 @@ module TestCodec_Pki {
...
@@ -673,13 +673,22 @@ module TestCodec_Pki {
log
(
"whole-v_hashedid8_ea_certificate= "
,
v_hashedid8_ea_certificate
);
log
(
"whole-v_hashedid8_ea_certificate= "
,
v_hashedid8_ea_certificate
);
// Create InnerEcResponse message
// Create InnerEcResponse message
f_generate_autorization_validation_response
(
f_generate_authorization_validation_response
(
'
DF0185451707BD702C957AB8B8AF827A6FBFBA7777723DDCA40CF6F58DAEA4E4
'
O
,
'
DF0185451707BD702C957AB8B8AF827A6FBFBA7777723DDCA40CF6F58DAEA4E4
'
O
,
valueof
(
v_cert
),
valueof
(
v_authorization_validation_response
m_certificate_subject_attributes
(
v_cert
.
toBeSigned
.
appPermissions
,
{
{
subjectPermissions
:=
{
all_
:=
NULL
},
minChainLength
:=
1
,
chainLengthRange
:=
0
,
eeType
:=
'00000000'B
}
},
v_cert
.
toBeSigned
.
id
,
v_cert
.
toBeSigned
.
validityPeriod
,
v_cert
.
toBeSigned
.
region
,
v_cert
.
toBeSigned
.
assuranceLevel
)
),
v_authorization_validation_response
);
);
// Build secured PKI message
// Build secured PKI message
v_enc_msg
:=
encvalue
(
m_etsiTs102941Data_
v_
authorization_validation_response
(
v_authorization_validation_response
));
v_enc_msg
:=
encvalue
(
m_etsiTs102941Data_authorization_validation_response
(
v_authorization_validation_response
));
if
(
ischosen
(
v_cert_ts_a_ea
.
toBeSigned
.
encryptionKey
.
publicKey
.
eciesNistP256
.
compressed_y_0
))
{
if
(
ischosen
(
v_cert_ts_a_ea
.
toBeSigned
.
encryptionKey
.
publicKey
.
eciesNistP256
.
compressed_y_0
))
{
v_ret
:=
f_build_pki_secured_message
(
v_private_key_cert_iut_a_ea
,
valueof
(
m_signerIdentifier_digest
(
v_hashed_id8_cert_iut_a_ea
)),
int2oct
(
0
,
8
),
v_cert_ts_a_ea
.
toBeSigned
.
encryptionKey
.
publicKey
.
eciesNistP256
.
compressed_y_0
,
0
,
bit2oct
(
v_enc_msg
),
v_ieee1609dot2_signed_and_encrypted_data
);
v_ret
:=
f_build_pki_secured_message
(
v_private_key_cert_iut_a_ea
,
valueof
(
m_signerIdentifier_digest
(
v_hashed_id8_cert_iut_a_ea
)),
int2oct
(
0
,
8
),
v_cert_ts_a_ea
.
toBeSigned
.
encryptionKey
.
publicKey
.
eciesNistP256
.
compressed_y_0
,
0
,
bit2oct
(
v_enc_msg
),
v_ieee1609dot2_signed_and_encrypted_data
);
}
else
{
}
else
{
...
@@ -745,23 +754,8 @@ module TestCodec_Pki {
...
@@ -745,23 +754,8 @@ module TestCodec_Pki {
if
(
v_result
==
0
)
{
if
(
v_result
==
0
)
{
log
(
"Decoded authorization_validation_response: "
,
v_dec_authorization_validation_response
);
log
(
"Decoded authorization_validation_response: "
,
v_dec_authorization_validation_response
);
setverdict
(
pass
,
"Decoded succeed"
);
setverdict
(
pass
,
"Decoded succeed"
);
if
(
match
(
v_dec_
inner_ec_response
.
content
.
enrolment
Response
,
v_authorization_validation_response
))
{
if
(
match
(
v_dec_
authorization_validation_response
.
content
.
authorizationValidation
Response
,
v_authorization_validation_response
))
{
setverdict
(
pass
,
"Decoded match succeed"
);
setverdict
(
pass
,
"Decoded match succeed"
);
// Extract the new EA certificate
v_cert
:=
v_dec_inner_ec_response
.
content
.
enrolmentResponse
.
certificate
;
// Check signature
v_tbs
:=
encvalue
(
v_cert
.
toBeSigned
);
if
(
f_verifyWithEcdsaNistp256WithSha256
(
bit2oct
(
v_tbs
),
int2oct
(
11
,
32
),
valueof
(
v_cert
.
signature_
.
ecdsaNistP256Signature
.
rSig
.
x_only
)
&
valueof
(
v_cert
.
signature_
.
ecdsaNistP256Signature
.
sSig
),
v_publicKeyCompressed
,
v_compressedMode
)
==
true
)
{
setverdict
(
pass
,
"Check signature succeed"
);
}
else
{
setverdict
(
fail
,
"Check signature failed"
);
stop
;
}
}
else
{
}
else
{
setverdict
(
fail
,
"Decoded match failed"
);
setverdict
(
fail
,
"Decoded match failed"
);
stop
;
stop
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment