#4373 allow renaming rpm signatures
Merged by mikem. Opened by mikem.
mikem/koji multi-signature  into  master

Download 4373.patch

More complex signature headers cannot be described by a single key.

This PR takes the approach of treating the sigkey field as a descriptive label for the signature that can be specified at import or changed later. This gives us the ability to handle more complex signing without radically altering the api or file layout.

Fixes https://pagure.io/koji/issue/4415

Side note: this also drops the check_rpm_sig function from the hub code, which has never been used

rebased onto 45c290dd74b6b56dafcd3d8cacbb16d0b8ff1284

rebased, fixed a typo, and extended the unit tests

@tkopecek

Not really important, but maybe we can verify sigkey names more strictly (hexadecimal string). In some rare case admin could want RegexNameInternal without numbers? /but it is really esoteric usecase/

:thumbsup: I wonder if it shouldn't be also copied to <sigkey>.save as in case of delete_rpm_sig, so it could be more visible that it originaly was "oldkey" if logs are no longer accessible?

maybe we can verify sigkey names more strictly (hexadecimal string)

I'm imagining names could be something like beta2+pq_beta2+ima, so definitely not just hex. This change is basically leaving the naming to external tools. That said, RegexNameInternal is probably not the right check. It used it initially because it seemed close enough, but the cases are different enough that I should separate that.

I wonder if it shouldn't be also copied to .save

Hmm, maybe

I think using RegexNameInternal is good enough for now. After all, both cases are names. It should be possible adjust this rule later.

I don't think it is necessary to make a save file here. We're not deleting the files and the name here is just a label. I see the point about history visibility, but I think it might be more trouble than its worth.

Metadata Update from @mikem:
- Pull-request tagged with: testing-custom

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

rebased onto 311dfde77b3d6654c264014c6319e8407de7925f

Commit 930a285e fixes this pull-request

Pull-Request has been merged by mikem

Metadata