Opened 3 years ago

Last modified 3 years ago

#6797 enhancement new

Implement dns.Record_CERT record class

Reported by: Aaron Spike Owned by: Aaron Spike
Priority: normal Milestone:
Component: names Keywords:
Cc: Branch: branches/cert-record-6797-2
branch-diff, diff-cov, branch-cov, buildbot
Author: rwall


Implement the DNS CERT resource record following cues in #6664 by rwall.

The goal of this effort is to provide a DNS server implementation that is compatible with the needs of the Direct Project.

Attachments (3)

twisted_names_trunk_CERT.diff (7.0 KB) - added by Aaron Spike 3 years ago.
Patch implementing DNS CERT resource record
twisted_names_trunk_CERT_tests.diff (2.9 KB) - added by Aaron Spike 3 years ago.
version of patch with tests
twisted_names_trunk_CERT.2.diff (16.8 KB) - added by Aaron Spike 3 years ago.
Version of patch with tests. Sorry about the last file (which was a copy of the dnskey tests).

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by Aaron Spike

Patch implementing DNS CERT resource record

Changed 3 years ago by Aaron Spike

version of patch with tests

Changed 3 years ago by Aaron Spike

Version of patch with tests. Sorry about the last file (which was a copy of the dnskey tests).

comment:1 Changed 3 years ago by Itamar Turner-Trauring

Keywords: review added

comment:2 Changed 3 years ago by Richard Wall

Author: rwall
Branch: branches/cert-record-6797

(In [40424]) Branching to 'cert-record-6797'

comment:3 Changed 3 years ago by Richard Wall

(In [40425]) apply twisted_names_trunk_CERT.2.diff from acspike. Refs #6797.

comment:4 Changed 3 years ago by Richard Wall

Branch: branches/cert-record-6797branches/cert-record-6797-2

(In [40426]) Branching to 'cert-record-6797-2'

comment:5 Changed 3 years ago by Richard Wall

(In [40427]) Really apply twisted_names_trunk_CERT.2.diff from acspike. Refs #6797.

comment:6 Changed 3 years ago by Richard Wall

Keywords: review removed
Owner: changed from Richard Wall to Aaron Spike

Thanks acspike!

The patch looks very good. Here are some notes and points.


  • The coverage seems complete


  1. twistedchecker warnings (
    1. Most of the warnings are spurious, but there are one or two that need fixing
    2. "W9010:1607,0: Trailing whitespace found in the end of line"
    3. "W9012:1905,0: Expected 2 blank lines, found 3"
    4. "W9013:2676,0: Expected 3 blank lines, found 2"
  1. branches/cert-record-6797-2/twisted/names/
    1. _base64Format
      1. Missing fullstop on first docstring line.
    2. Record_CERT
      1. Typo "recommende"
    3. hash
      1. Typo "A has allowing"
  1. branches/cert-record-6797-2/twisted/names/test/
    1. testCERT
      1. New test methods should use the "test_CERT" naming convention.
  1. branches/cert-record-6797-2/twisted/names/test/
    1. test_cert
      1. docstring should be wrapped at 80 columns
  1. I guess that some of these points will also apply to my DNSKEY branch (#6664) so I should probably go back and fix them there too.
  1. I haven't properly read RFC4398 so treat this as a cosmetic review.
  1. I don't yet understand how this fits in with DANE ( and TLSA -- have you got any good comparisons / explanations. I found this summary:
  1. I'm interested to know how you intend to create the CERT records. Do you think Record_CERT is usable as is, or do we need to create some sort of factory method which accepts a PEM certificate file or an OpenSSL.crypto.X509 instance. eg
  1. I found this page from your project but couldn't find any live examples of CERT records. I wanted to see how dig formats CERT records and eventually found this:
    $ dig @ CERT +tcp +short
    PGP 0 0 mQGiBDnY2vERBAD3cOxqoAYHYzS+xttvuyN9wZS8CrgwLIlT8Ewo/CCF I11PEO+gJyNPvWPRQsyt1SE60reaIsie2bQTg3DYIg0PmH+ZOlNkpKes PULzdlw4Rx3dD/M3Lkrm977h4Y70ZKC+tbvoYKCCOIkUVevny1PVZ+mB 94rb0mMgawSTrct03QCg/w6aHNJFQV7O9ZQ1Fir85M3RS8cEAOo4/1AS Vudz3qKZQEhU2Z9O2ydXqpEanHfGirjWYi5RelVsQ9IfBSPFaPAWzQ24 nvQ18NU7TgdDQhP4meZXiVXcLBR5Mee2kByf2KAnBUF9aah5s8wZbSrC 6u8xEZLuiauvWmCUIWe0Ylc1/L37XeDjrBI2pT+k183X119d6Fr1BACG fZVGsot5rxBUEFPPSrBqYXG/0hRYv9Eq8a4rJAHK2IUWYfivZgL4DtrJ nHlha+H5EPQVYkIAN3nGjXoHmosY+J3Sk+GyR+dCBHEwCkoHMKph3igc zCEfxAWgqKeYd5mf+QQq2JKr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QQSj1iOWV7HUrVRb2qY39hVBQ1 y1G00Tj79V4an9Lu2GDkRZ1nlbb8yiMVWohGBBgRAgAGBQI52Nr0AAoJ EPu+WjBiS7JJQVoAnje8/cZOdsv2qGgrheoWG9Hft5PfAKDEcbx7lyNT XNhV2P8euT8B4lG2mA==
    1. I note that dig presents the "Mnemonic" certificate type. We could do something similar in our repr if we defined and used twisted.python.constants for the various certificate types and algorithms. I might do the same in #6664 for DNSKEY.
  1. Missing news file

Anyway, that's all for now. Please address or answer the numbered points above and submit another patch against the new branch.

I'm waiting for the DNSKEY branch #6664 to be reviewed and I expect that the feedback I get there will also be applicable here.

Also note that twisted branches are mirrored on github at:

...which might be useful if you prefer git.

Thanks again.


comment:7 Changed 3 years ago by Aaron Spike

Thanks for the thorough review. I will address the all of the needed code changes in the branch.

#7 I'm not familiar with DANE and so I cannot comment on the relationship.

#8 I wondered if generating the record from a PEM would be the best solution. (Or at the very least generating the keyTag.) I decided that I'm not familiar enough with the standards to avoid limiting the usefulness of the implementation by accident. (Sysadmins have to generate this configuration for bind in some way too.) So I figured the most compatible and flexible implementation would allow all of the properties to be directly specified. Here is a tool (implemented using dnspython) which generates the bind configuration:

#9 I'm just a concerned citizen, not a representative of the Direct Project. (This applies to my answer to #7 equally.) So I can't offer any explanation on why this particular record type was chosen, but it is being used in the wild. Here are a few examples: dig -t CERT dig -t CERT

#9.1 I wondered what about best practices for implementing those enumerations in twisted.

comment:8 Changed 3 years ago by Aaron Spike

Sorry for the wait. I have addressed the cosmetic issues in the following change set:

Note: See TracTickets for help on using tickets.