@@ -456,16 +456,19 @@ values are decoded; others signal an error. See RFC4880 section 4.3."
456456DEFINE-FIELD) from PSTREAM."
457457 (funcall (get field ' reader-function ' missing-reader-function) pstream))
458458
459- (defun read-field-value (field pstream)
459+ (defun read-field-value (field pstream &key (default nil defaultp) )
460460 " Read and FIELD from PSTREAM and look up and return its symbolic
461461value."
462462 (let* ((raw-value (read-field field pstream))
463463 (translation (assoc raw-value (get field ' values-alist))))
464- (unless translation
464+ (when (and (not translation)
465+ (not defaultp))
465466 (error " Unsupported value ~A for field ~A "
466467 raw-value
467468 field))
468- (cdr translation)))
469+ (if translation
470+ (cdr translation)
471+ default)))
469472
470473(define-field signature-type (:type u8)
471474 ; ; RFC 4880 section 5.2.1
@@ -488,6 +491,7 @@ value."
488491 (22 . :preferred-compression-algorithms )
489492 (23 . :key-server-preferences )
490493 (27 . :key-flags )
494+ (28 . :signer-user-id )
491495 (30 . :features ))
492496
493497(define-field public-key-algorithm (:type u8)
@@ -530,7 +534,8 @@ size, from PSTREAM. See RFC4880 5.2.3.1 for details."
530534 " Read a single signature subpacket from PSTREAM. Returns the packet
531535 type and data as multiple values."
532536 (let* ((length (read-subpacket-length pstream))
533- (type (read-field-value ' subpacket-type pstream))
537+ (type (read-field-value ' subpacket-type pstream
538+ :default :unrecognized ))
534539 (data (read-n-octets (1- length ) pstream)))
535540 (values type data)))
536541
0 commit comments