in-toto / in-toto-rs

A rust implementation of in-toto
MIT License
32 stars 14 forks source link

Sign using utf8 string in Metablock::new #48

Closed danbev closed 1 year ago

danbev commented 1 year ago

This commit updates the Metablock new function to use utf8 string when signing instead of the raw representation which is currently used.

The motivation for this change is that the verifying performed in Metablock::verify uses the utf8 string to generate the signature, and this can lead to a signature mismatch if the signatures are not created in the same manner.

This change also seems to be inline with the code in MetablockBuilder::sign, which also converts the raw bytes to utf8 before signing.

Signed-off-by: Daniel Bevenius daniel.bevenius@gmail.com

adityasaky commented 1 year ago

Thanks, @danbev!