[elbe-devel] [PATCH] rfs: Prevent cutting OpenPGP armor end line

Ros Spolyak rostokus at gmail.com
Mon Apr 17 14:45:55 CEST 2023


"Signed-off-by: Ros Spolyak <rostokus at gmail.com>"

пн, 17 квіт. 2023 р. о 13:47 Bastian Germann <bage at linutronix.de> пише:

> Stripping the end line via :-1 can result in
> "-----END PGP PUBLIC KEY BLOCK-----" being stripped depending on the
> raw-key
> having a terminating line feed or not. Also, stripping the first line via
> 1:
> is not necessary here. Get rid of the list range.
>
> bullseye's gpg will complain about a wrong CRC when the end line is
> stripped,
> which is misleading.
>
> Signed-off-by: Bastian Germann <bage at linutronix.de>
> ---
>  elbepack/rfs.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/elbepack/rfs.py b/elbepack/rfs.py
> index 1f5c8fb0a5..6974e2d69a 100644
> --- a/elbepack/rfs.py
> +++ b/elbepack/rfs.py
> @@ -287,7 +287,7 @@ class BuildEnv:
>              # I could make a none global 'noauth' flag for mirrors
>              for i, url in
> enumerate(self.xml.node('project/mirror/url-list')):
>                  if url.has('raw-key'):
> -                    key = "\n".join(line.strip(" \t") for line in
> url.text('raw-key').splitlines()[1:-1])
> +                    key = "\n".join(line.strip(" \t") for line in
> url.text('raw-key').splitlines())
>                      self.add_key(unarmor_openpgp_keyring(key),
> f"elbe-xml-raw-key{i}.gpg")
>
>      def initialize_dirs(self, build_sources=False):
> --
> 2.39.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20230417/92466123/attachment.htm>


More information about the elbe-devel mailing list