Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Invalid signature for JSF and XML examples #335

@andreas-hilti

Description

@andreas-hilti

The examples on https://cyclonedx.org/use-cases/#authenticity were modified over the years (e.g. the specification version), but the signature was not modified. Thus, the signature became invalid.

I managed to verify this JSF signature:
https://github.com/CycloneDX/cyclonedx.org/blob/e44cfc0576a5202450aad357e904ba0e9ea753f9/theme/_includes/examples/authenticity.html
roughly:

var str = [...] //json document without value
var strCanonical = new JsonCanonicalizer(str).GetEncodedString();
var publicJswKey = new JsonWebKey { Kty = "RSA", N= "qOSWbDOGS31lv3[...]", E= "AQAB" };
var encSignature = "HGIX_ccdIcqmaOpk[...]";
var signingProvider = new CryptoProviderFactory().CreateForVerifying(publicJswKey, "RS512");
var result = signingProvider.Verify(Encoding.UTF8.GetBytes(strCanonical), Base64UrlEncoder.DecodeBytes(encSignature));

(based on the current document, result = false)

I haven't yet managed to verify the initial xml document.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions