Skip to content

EncodeWithoutSignature breaks signatures generated by Jujutsu #1626

@baloo

Description

@baloo

The canonical commit representation returned by EncodeWithoutSignature will strip out any extra field it doesn't support.

Jujutsu commits would add extra fields like:

tree eddf38b125ad5ed8fbd9438b33e0c41662f8739d
parent 7f92e7685ce2cac51a8348d38be665faf1af314d
parent 185bd1d7dbb2464cf744dc33c0993de1965685a6
author Arthur Gautier <...> 1753582512 +0000
committer Arthur Gautier <...> 1754670137 -0700
change-id xkmmqzonpyyrvxvtxsuutmmxrzyyvwon
gpgsig -----BEGIN PGP SIGNATURE-----

 -----END PGP SIGNATURE-----

Foobar

(notice the change-id which is jujutsu specific).

The canonical representation (the one to be signed) should be:

tree eddf38b125ad5ed8fbd9438b33e0c41662f8739d
parent 7f92e7685ce2cac51a8348d38be665faf1af314d
parent 185bd1d7dbb2464cf744dc33c0993de1965685a6
author Arthur Gautier <...> 1753582512 +0000
committer Arthur Gautier <...> 1754670137 -0700
change-id xkmmqzonpyyrvxvtxsuutmmxrzyyvwon

Foobar

but instead we get:

tree eddf38b125ad5ed8fbd9438b33e0c41662f8739d
parent 7f92e7685ce2cac51a8348d38be665faf1af314d
parent 185bd1d7dbb2464cf744dc33c0993de1965685a6
author Arthur Gautier <...> 1753582512 +0000
committer Arthur Gautier <...> 1754670137 -0700

Foobar

Which in effects breaks signatures.

The implementation should instead just filter out the gpgsig field and leave out the other ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions