-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is a circular dependency in gpg.constants -> gpg.rsa -> gpg.util -> gpg.constants This is not a problem on python3 or python2 when the imports are done with "import securesystemslib.<mod>" style. However with the "from securesystemslib import <mod>" style python2 decides this is a ImportError. Remove the circular dependency by moving the module variables from constants to another file.
- Loading branch information
Jussi Kukkonen
committed
Feb 11, 2021
1 parent
f0fbeb0
commit 25f112b
Showing
4 changed files
with
53 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
""" | ||
<Module Name> | ||
handlers.py | ||
<Author> | ||
Santiago Torres-Arias <santiago@nyu.edu> | ||
<Started> | ||
Jan 15, 2020 | ||
<Copyright> | ||
See LICENSE for licensing information. | ||
<Purpose> | ||
Provides links from signatures/algorithms to modules implementing | ||
the signature verification and key parsing. | ||
""" | ||
|
||
from securesystemslib.gpg import rsa | ||
from securesystemslib.gpg import dsa | ||
from securesystemslib.gpg import eddsa | ||
|
||
# See section 9.1. (public-key algorithms) of RFC4880 (-bis8) | ||
SUPPORTED_SIGNATURE_ALGORITHMS = { | ||
0x01: { | ||
"type":"rsa", | ||
"method": "pgp+rsa-pkcsv1.5", | ||
"handler": rsa | ||
}, | ||
0x11: { | ||
"type": "dsa", | ||
"method": "pgp+dsa-fips-180-2", | ||
"handler": dsa | ||
}, | ||
0x16: { | ||
"type": "eddsa", | ||
"method": "pgp+eddsa-ed25519", | ||
"handler": eddsa | ||
} | ||
} | ||
|
||
SIGNATURE_HANDLERS = { | ||
"rsa": rsa, | ||
"dsa": dsa, | ||
"eddsa": eddsa | ||
} |