Skip to content

Conversation

@nevun
Copy link
Contributor

@nevun nevun commented Dec 20, 2024

This matches what is done here: https://github.com/bjornedstrom/python-signify/blob/master/signify/pure.py#L440

before:

# signi.py -C -p ./dude.pub -x SHA256.sig
Signature Verified
Traceback (most recent call last):
  File "/usr/bin/signi.py", line 181, in <module>
    main()
  File "/usr/bin/signi.py", line 121, in main
    for path, status in check.checkfiles(os.getcwd(), message):
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/signify/check.py", line 36, in checkfiles
    for algo, path, ref_digest in re.findall(
                                  ^^^^^^^^^^^
  File "/usr/lib64/python3.12/re/__init__.py", line 217, in findall
    return _compile(pattern, flags).findall(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a string pattern on a bytes-like object

after:

# signi.py -C -p ./dude.pub -x SHA256.sig
Signature Verified
foo.pem: OK
bar.pem: OK

SHA256.sig looks like this:

# cat SHA256.sig
untrusted comment: signature from dude
RWTp/neG79aK6il7+KDR7gHdmJMt1CM8gt67ijEtupMg4u+qybNv23qPleuvBiLQ/rC3OccwI8opQkBAg/zB+H8PYCvnfb8B2gg=
SHA256 (foo.pem) = ae30f85e075085b4110de3d4a97483e45339ff2776196b6146dc3b10db7cbe9c
SHA256 (bar.pem) = 4d4d734dd38ca49e6364f3aaac0bde028f11620028448aa64320c79d7a742e61

This matches what is done here: https://github.com/bjornedstrom/python-signify/blob/master/signify/pure.py#L440

before:
```
Signature Verified
Traceback (most recent call last):
  File "/usr/bin/signi.py", line 181, in <module>
    main()
  File "/usr/bin/signi.py", line 121, in main
    for path, status in check.checkfiles(os.getcwd(), message):
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/signify/check.py", line 36, in checkfiles
    for algo, path, ref_digest in re.findall(
                                  ^^^^^^^^^^^
  File "/usr/lib64/python3.12/re/__init__.py", line 217, in findall
    return _compile(pattern, flags).findall(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a string pattern on a bytes-like object
```

after:
```
Signature Verified
foo.pem: OK
bar.pem: OK
```
@nevun nevun force-pushed the verify_files_embedded branch from 973a1da to c37fc95 Compare December 9, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant