Skip to content

Commit

Permalink
make fields in SignedInfo unused to comply with V2G2-771
Browse files Browse the repository at this point in the history
Signed-off-by: Siebren Weertman <siebren.w@gmail.com>
  • Loading branch information
SiebrenW authored and Siebren Weertman committed Mar 13, 2024
1 parent 57bc14a commit ea7591f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/EvseV2G/iso_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ static bool check_iso2_signature(const struct iso2_SignatureType* iso2_signature
sig_fragment.SignedInfo_isUsed = 1;
sig_fragment.SignedInfo = sig->SignedInfo;

/** \req [V2G2-771] Don't use following fields */
sig_fragment.SignedInfo.Id_isUsed = 0;
sig_fragment.SignedInfo.CanonicalizationMethod.ANY_isUsed = 0;
sig_fragment.SignedInfo.SignatureMethod.HMACOutputLength_isUsed = 0;
sig_fragment.SignedInfo.SignatureMethod.ANY_isUsed = 0;
for (auto* ref = sig_fragment.SignedInfo.Reference.array;
ref != (sig_fragment.SignedInfo.Reference.array + sig_fragment.SignedInfo.Reference.arrayLen); ++ref) {
ref->Type_isUsed = 0;
ref->Transforms.Transform.ANY_isUsed = 0;
ref->Transforms.Transform.XPath_isUsed = 0;
ref->DigestMethod.ANY_isUsed = 0;
}

stream.byte_pos = 0;
stream.bit_count = 0;
err = encode_iso2_xmldsigFragment(&stream, &sig_fragment);
Expand Down

0 comments on commit ea7591f

Please sign in to comment.