Skip to content

fix(realm): enforce exactly 4 realm extended measurements per spec#41

Open
shefali-kamal wants to merge 1 commit into
veraison:mainfrom
MonakaResearch:main
Open

fix(realm): enforce exactly 4 realm extended measurements per spec#41
shefali-kamal wants to merge 1 commit into
veraison:mainfrom
MonakaResearch:main

Conversation

@shefali-kamal
Copy link
Copy Markdown

The specification https://www.ietf.org/archive/id/draft-ffm-rats-cca-token-00.html#section-4.8.5 requires exactly 4 realm extensible measurements in the evidence. The previous implementatio only checked for non‑empty values, which allowed invalid inputs. ValidateExtendedMeas now returns ErrWrongSyntax if len(v) != MaxLenRealmExtendedMeas (4).

Fixes: #20

The specification https://www.ietf.org/archive/id/draft-ffm-rats-cca-token-00.html#section-4.8.5 requires exactly 4 realm extensible measurements in the evidence. The previous implementatio only checked for non‑empty values, which allowed invalid inputs.
ValidateExtendedMeas now returns ErrWrongSyntax if len(v) != MaxLenRealmExtendedMeas (4).

Fixes: veraison#20

Signed-off-by: Badiyasar, Harshita <Harshita.Badiyasar@fujitsu.com>
Comment thread realm/common.go
if len(v) == 0 {
return fmt.Errorf("%w realm extended measurements",
psatoken.ErrMandatoryClaimMissing)
if len(v) != MaxLenRealmExtendedMeas {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MaxLenRealmExtendedMeas should probably be rename to just LenRealmExtendedMeas, as it is not a maximum but an exact value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

the number of extensible measurements is exactly 4

3 participants