Replies: 10 comments 10 replies
-
Thanks, I'll take a look later this weekend! I will definitely want dnspython to support PQ DNSSEC when we know what that is, and enabling testing of various alternatives is good. |
Beta Was this translation helpful? Give feedback.
-
I'm a bit unsure where to implement signature validation for private algorithms. One would need a dictionary from N.B. hashing must be done in private algorithm class, not in the main logic as for other algorithms. Because of this, |
Beta Was this translation helpful? Give feedback.
-
Sorry about the delay getting back to you. I like the class encapsulation you've done in the draft PR. Re validation, passing the dictionary is certainly one way to go, but I wanted to bring up another as it is so similar an issue. Dnspython lets you add your own rdata class implementations, and these are not treated any differently by the code from the built-ins. To add a type, you use the dns.rdata.register_type() method. So I wonder if we should have a registry that the code uses instead of passing a dictionary around. This might also be nicer for other code using dnspython and DNSSEC (I even have such code!) where it wouldn't need to be modified to support private algorithms other than calling the registration function. So one easy change instead of making sure you do the right thing in all verify cases. For that matter, I wonder if all of the algorithms should be abstracted into classes so the main DNSSEC code isn't full of big "if" switches. This is, of course, not central to what you are doing, but might make things cleaner. So imagine that there is a registry of algorithms keyed by (id, prefix), and the prefix is b'' for non-private types. The mainline code would be aware of the need to extract a prefix if the algorithm was private. Then you'd get your algorithm and prefix (if needed), look up the right implementation, and then call it in all cases. What do people think? |
Beta Was this translation helpful? Give feedback.
-
I ended up using dataclasses to address this, if you don't want to use that it's easy to downgrade to pure classes. |
Beta Was this translation helpful? Give feedback.
-
Having looked at the implementation, I have a couple of questions.
|
Beta Was this translation helpful? Give feedback.
-
Yes, I should do that - much cleaner.
This is the case for DSA and ECDSA. For EDDSA the base class is different as the underlying key classes are different. RSA could be based of one of (any really) of the RSA algorithms, but I did a base class since I could not make up my mind. None of these reasons are really valid, ED448 could be based on ED25519 and all the RSA algorithms of RSASHA256. Should I clean it up?
Once we agree on the framework I will move on implementing this in the |
Beta Was this translation helpful? Give feedback.
-
I'm ok with this direction, but echoing what Brian said. And I definitely want to maintain backwards compatibility with the existing APIs. |
Beta Was this translation helpful? Give feedback.
-
It wasn't as noticable for DSA, as while there are technically two algorithm identifiers, they're basically identical. For ECDSA, it seems strange to have the P384 implementation using the P256 implementation, rather than both of them using the same base class.
Sounds good. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Step 3 - integrating into |
Beta Was this translation helpful? Give feedback.
-
PR filed as #944 |
Beta Was this translation helpful? Give feedback.
-
I've committed PR #934 to support signing with private algorithms. The idea was to create abstract base classes for Private/Public keys and implement generic functions to sign/verify using these. RRSIG validation is not yet supported.
My first use for this is testing key rollover to unknown algorithms, but this will also be useful for testing signing PQ algorithms and other new algorithms.
Comments welcome!
Beta Was this translation helpful? Give feedback.
All reactions