Skip to content

x5t header is not correct while performing CWT signing #601

Open

Description

@swatigoel

Description

While verifying the CWT format and relying on x5t header, we found some difference while referring to RFC 9360
As per RFC, x5t in header should be an array 2 elements

  1. algo identifier
  2. hash

but we are just the hash value instead. Reference https://github.com/mosip/keymanager/blob/master/kernel/kernel-keymanager-service/src/main/java/io/mosip/kernel/signature/builder/CoseHeaderBuilder.java#L69

Steps to Reproduce

  1. Generate CWTSignRequestDto with x5t and x5u as protectedHeader or unProtectedHeade
  2. Initiate cwtSign either through api or as library
  3. Verify the header in signed data

Actual Behavior

x5t is not array instead just hash value

Expected Behavior

In header, x5t should be returned as an array with 1st element referring to algorithm and 2nd element hash value.

Attachment / Evidence / Docs / Screenshots

No response

Root Cause

No response

Additional Context

Version used - 1.4.0

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    End Date

    None yet

    Complexity

    None yet

    Start Date

    None yet

    Original Estimate

    None yet

    Time Tracking

    None yet

    Resolved By

    None yet

    Story Points

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions