adafruit / adafruit/Adafruit_CircuitPython_RSA

Incorrect type for hash_value arg in sign_hash function

Open
#38 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
10
Forks
12
PR merge metrics
No merged PRs in 30d

Description

The `hash_value` arg of the `sign_hash` in `pkcs1.py` currently is typed out as optional, but `hash_value` is required, lest an error occur when we reach the line:

```
clear_text = asn1_code + hash_value
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open pkcs1.py and inspect the sign_hash function, focusing on the hash_value annotation and the concatenation line identified in the issue. Confirm how the required argument is represented in the surrounding API and update the annotation so it matches the runtime requirement; done means hash_value is no longer typed as optional.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cryptography, security
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.