Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent handling of signatures, keys, etc. #63

Closed
samuelwilliams opened this issue Jan 13, 2020 · 0 comments
Closed

Inconsistent handling of signatures, keys, etc. #63

samuelwilliams opened this issue Jan 13, 2020 · 0 comments

Comments

@samuelwilliams
Copy link
Contributor

samuelwilliams commented Jan 13, 2020

The handling of cryptographic keys, signatures and other data that is ultimately represented as Base16, 32, or 64 encoded string is inconsistent across all Rdata type classes. These should be handled the same.

Signatures et al inputted into Rdata classes SHOULD be setted and getted in raw binary form; the only time it is outputted to a text encoding is when $rdata->toText() is called.

This would be a backward-compatibility breaking change, so will not be implemented until v4.0

These are the classes that are affected:

  • KEY
    • DNSKEY
      • CDNSKEY
  • DS
    • CDS
    • DLV
    • TA
  • CERT
  • DHCID
  • HIP
  • IPSECKEY
  • NSEC3
  • RRSIG
    • SIG
  • SSHFP
  • TKEY
  • TLSA
  • TSIG

The future code should look like:

$rdata = new TYPE1234();
$rdata->setPublicKey(10100011110000111010101110001001...);
$rdata->getPublicKey(); // Returns 10100011110000111010101110001001...
echo $rdata->toText(); // Echos o8OriQ...

The downside of this would be that you would need to be careful to decode already Base64 encoded strings.

@samuelwilliams samuelwilliams added this to the Version 4 milestone Jan 13, 2020
samuelwilliams added a commit that referenced this issue Oct 6, 2020
* Added method for calculating the digest.

* Update README

* Issue-63: CERT now only accepts binary certificates.

* Simplify TimeFormat class.

* DHCID digest now only accepts raw binary.

* Issue #63: IPSECKEY::publicKey is raw binary only.

* Issue #63 - Next hashed owner is expected as binary

* Added method to calculate next owner hash.

* Set the next owner name.

* Issue #63: Signature must be binary.

* Issue #63. SSHFP fingerprint to be inputted as raw binary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant