chiark
/
gitweb
/
~mdw
/
zone
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zone.lisp: Maintain `:sshfp' fingerprints in binary internally.
[zone]
/
zone.lisp
diff --git
a/zone.lisp
b/zone.lisp
index 22670261ab5a6040a3bdc7636c0d001f900081f8..96cddfb65b9a2b523f258a8dc83c41471fad2ace 100644
(file)
--- a/
zone.lisp
+++ b/
zone.lisp
@@
-946,26
+946,23
@@
(defzoneparse :sshfp (name data rec)
(= (length words) 4))
(error "Invalid SSHFP record."))
(pop words)
(= (length words) 4))
(error "Invalid SSHFP record."))
(pop words)
- (destructuring-bind (alg type fpr) words
+ (destructuring-bind (alg type fpr
hex
) words
(rec :data (list (parse-integer alg)
(parse-integer type)
(rec :data (list (parse-integer alg)
(parse-integer type)
-
fpr
))))))))
+
(decode-hex fprhex)
))))))))
(t
(dolist (item (listify data))
(t
(dolist (item (listify data))
- (destructuring-bind (fpr &key (alg 'rsa) (type 'sha-1))
+ (destructuring-bind (fpr
hex
&key (alg 'rsa) (type 'sha-1))
(listify item)
(rec :data (list (lookup-enum alg 'sshfp-algorithm :min 0 :max 255)
(lookup-enum type 'sshfp-type :min 0 :max 255)
(listify item)
(rec :data (list (lookup-enum alg 'sshfp-algorithm :min 0 :max 255)
(lookup-enum type 'sshfp-type :min 0 :max 255)
-
fpr
)))))))
+
(decode-hex fprhex)
)))))))
(defmethod zone-record-rrdata ((type (eql :sshfp)) zr)
(destructuring-bind (alg type fpr) (zr-data zr)
(rec-u8 alg)
(rec-u8 type)
(defmethod zone-record-rrdata ((type (eql :sshfp)) zr)
(destructuring-bind (alg type fpr) (zr-data zr)
(rec-u8 alg)
(rec-u8 type)
- (do ((i 0 (+ i 2))
- (n (length fpr)))
- ((>= i n))
- (rec-u8 (parse-integer fpr :start i :end (+ i 2) :radix 16))))
+ (rec-octet-vector fpr))
44)
(defenum tlsa-usage ()
44)
(defenum tlsa-usage ()
@@
-1632,7
+1629,9
@@
(defmethod zone-write-record ((format (eql :bind)) (type (eql :srv)) zr)
prio weight port (bind-hostname host))))
(defmethod zone-write-record ((format (eql :bind)) (type (eql :sshfp)) zr)
prio weight port (bind-hostname host))))
(defmethod zone-write-record ((format (eql :bind)) (type (eql :sshfp)) zr)
- (bind-format-record zr "~{~2D ~2D ~A~}~%" (zr-data zr)))
+ (destructuring-bind (alg type fpr) (zr-data zr)
+ (bind-format-record zr "~2D ~2D " alg type)
+ (bind-write-hex fpr 12)))
(defmethod zone-write-record ((format (eql :bind)) (type (eql :tlsa)) zr)
(destructuring-bind (usage selector match data) (zr-data zr)
(defmethod zone-write-record ((format (eql :bind)) (type (eql :tlsa)) zr)
(destructuring-bind (usage selector match data) (zr-data zr)