From fbcf39e1e1da3d94024a3d78962f4b80370516b0 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 11 Jul 2014 14:02:25 -0500 Subject: [PATCH] Correct regex in is_keyid The `rpm_key` module claims to take a key ID as an argument, however it fails if one is actually given: msg: Not a valid key DEADBEEF The reason for this is the regular expression in the `RpmKey.is_keyid` method is incorrect; it will only match the literal string "0-9a-f" exactly 8 times, rather than exactly 8 characters in the set 0-9 or a-f. --- packaging/rpm_key | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/rpm_key b/packaging/rpm_key index 56d5ad4b5f6..d8530f9206e 100644 --- a/packaging/rpm_key +++ b/packaging/rpm_key @@ -156,7 +156,7 @@ class RpmKey: def is_keyid(self, keystr): """Verifies if a key, as provided by the user is a keyid""" - return re.match('(0x)?(0-9a-f){8}', keystr, flags=re.IGNORECASE) + return re.match('(0x)?[0-9a-f]{8}', keystr, flags=re.IGNORECASE) def execute_command(self, cmd): if self.syslogging: