@@ -148,20 +148,23 @@ pub mod msg_acknowledge {
148148 set_bit_range ! ( & mut self . response_code, response_code, u8 , u8 , 7 , 0 ) ;
149149 }
150150
151- /// Gets the [PublicSigningKey ][self::PublicSigningKey ] stored in the `correction_mask_on_demand` bitfield.
151+ /// Gets the [CorrectionsCertificate ][self::CorrectionsCertificate ] stored in the `correction_mask_on_demand` bitfield.
152152 ///
153- /// Returns `Ok` if the bitrange contains a known `PublicSigningKey ` variant.
153+ /// Returns `Ok` if the bitrange contains a known `CorrectionsCertificate ` variant.
154154 /// Otherwise the value of the bitrange is returned as an `Err(u8)`. This may be because of a malformed message,
155- /// or because new variants of `PublicSigningKey ` were added.
156- pub fn public_signing_key ( & self ) -> Result < PublicSigningKey , u8 > {
155+ /// or because new variants of `CorrectionsCertificate ` were added.
156+ pub fn corrections_certificate ( & self ) -> Result < CorrectionsCertificate , u8 > {
157157 get_bit_range ! ( self . correction_mask_on_demand, u16 , u8 , 0 , 0 ) . try_into ( )
158158 }
159159
160- /// Set the bitrange corresponding to the [PublicSigningKey][PublicSigningKey] of the `correction_mask_on_demand` bitfield.
161- pub fn set_public_signing_key ( & mut self , public_signing_key : PublicSigningKey ) {
160+ /// Set the bitrange corresponding to the [CorrectionsCertificate][CorrectionsCertificate] of the `correction_mask_on_demand` bitfield.
161+ pub fn set_corrections_certificate (
162+ & mut self ,
163+ corrections_certificate : CorrectionsCertificate ,
164+ ) {
162165 set_bit_range ! (
163166 & mut self . correction_mask_on_demand,
164- public_signing_key ,
167+ corrections_certificate ,
165168 u16 ,
166169 u8 ,
167170 0 ,
@@ -336,6 +339,51 @@ pub mod msg_acknowledge {
336339 8
337340 ) ;
338341 }
342+
343+ /// Gets the [IntermediateCertificate][self::IntermediateCertificate] stored in the `correction_mask_on_demand` bitfield.
344+ ///
345+ /// Returns `Ok` if the bitrange contains a known `IntermediateCertificate` variant.
346+ /// Otherwise the value of the bitrange is returned as an `Err(u8)`. This may be because of a malformed message,
347+ /// or because new variants of `IntermediateCertificate` were added.
348+ pub fn intermediate_certificate ( & self ) -> Result < IntermediateCertificate , u8 > {
349+ get_bit_range ! ( self . correction_mask_on_demand, u16 , u8 , 9 , 9 ) . try_into ( )
350+ }
351+
352+ /// Set the bitrange corresponding to the [IntermediateCertificate][IntermediateCertificate] of the `correction_mask_on_demand` bitfield.
353+ pub fn set_intermediate_certificate (
354+ & mut self ,
355+ intermediate_certificate : IntermediateCertificate ,
356+ ) {
357+ set_bit_range ! (
358+ & mut self . correction_mask_on_demand,
359+ intermediate_certificate,
360+ u16 ,
361+ u8 ,
362+ 9 ,
363+ 9
364+ ) ;
365+ }
366+
367+ /// Gets the [CertificateChain][self::CertificateChain] stored in the `correction_mask_on_demand` bitfield.
368+ ///
369+ /// Returns `Ok` if the bitrange contains a known `CertificateChain` variant.
370+ /// Otherwise the value of the bitrange is returned as an `Err(u8)`. This may be because of a malformed message,
371+ /// or because new variants of `CertificateChain` were added.
372+ pub fn certificate_chain ( & self ) -> Result < CertificateChain , u8 > {
373+ get_bit_range ! ( self . correction_mask_on_demand, u16 , u8 , 10 , 10 ) . try_into ( )
374+ }
375+
376+ /// Set the bitrange corresponding to the [CertificateChain][CertificateChain] of the `correction_mask_on_demand` bitfield.
377+ pub fn set_certificate_chain ( & mut self , certificate_chain : CertificateChain ) {
378+ set_bit_range ! (
379+ & mut self . correction_mask_on_demand,
380+ certificate_chain,
381+ u16 ,
382+ u8 ,
383+ 10 ,
384+ 10
385+ ) ;
386+ }
339387 }
340388
341389 impl ConcreteMessage for MsgAcknowledge {
@@ -458,31 +506,31 @@ pub mod msg_acknowledge {
458506 }
459507 }
460508
461- /// Public Signing Key
509+ /// Corrections certificate
462510 #[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
463- pub enum PublicSigningKey {
511+ pub enum CorrectionsCertificate {
464512 /// Not requested
465513 NotRequested = 0 ,
466514
467515 /// Requested
468516 Requested = 1 ,
469517 }
470518
471- impl std:: fmt:: Display for PublicSigningKey {
519+ impl std:: fmt:: Display for CorrectionsCertificate {
472520 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
473521 match self {
474- PublicSigningKey :: NotRequested => f. write_str ( "Not requested" ) ,
475- PublicSigningKey :: Requested => f. write_str ( "Requested" ) ,
522+ CorrectionsCertificate :: NotRequested => f. write_str ( "Not requested" ) ,
523+ CorrectionsCertificate :: Requested => f. write_str ( "Requested" ) ,
476524 }
477525 }
478526 }
479527
480- impl TryFrom < u8 > for PublicSigningKey {
528+ impl TryFrom < u8 > for CorrectionsCertificate {
481529 type Error = u8 ;
482530 fn try_from ( i : u8 ) -> Result < Self , u8 > {
483531 match i {
484- 0 => Ok ( PublicSigningKey :: NotRequested ) ,
485- 1 => Ok ( PublicSigningKey :: Requested ) ,
532+ 0 => Ok ( CorrectionsCertificate :: NotRequested ) ,
533+ 1 => Ok ( CorrectionsCertificate :: Requested ) ,
486534 i => Err ( i) ,
487535 }
488536 }
@@ -727,6 +775,66 @@ pub mod msg_acknowledge {
727775 }
728776 }
729777 }
778+
779+ /// Intermediate certificate
780+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
781+ pub enum IntermediateCertificate {
782+ /// Not requested
783+ NotRequested = 0 ,
784+
785+ /// Requested
786+ Requested = 1 ,
787+ }
788+
789+ impl std:: fmt:: Display for IntermediateCertificate {
790+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
791+ match self {
792+ IntermediateCertificate :: NotRequested => f. write_str ( "Not requested" ) ,
793+ IntermediateCertificate :: Requested => f. write_str ( "Requested" ) ,
794+ }
795+ }
796+ }
797+
798+ impl TryFrom < u8 > for IntermediateCertificate {
799+ type Error = u8 ;
800+ fn try_from ( i : u8 ) -> Result < Self , u8 > {
801+ match i {
802+ 0 => Ok ( IntermediateCertificate :: NotRequested ) ,
803+ 1 => Ok ( IntermediateCertificate :: Requested ) ,
804+ i => Err ( i) ,
805+ }
806+ }
807+ }
808+
809+ /// Certificate chain
810+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
811+ pub enum CertificateChain {
812+ /// Not requested
813+ NotRequested = 0 ,
814+
815+ /// Requested
816+ Requested = 1 ,
817+ }
818+
819+ impl std:: fmt:: Display for CertificateChain {
820+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
821+ match self {
822+ CertificateChain :: NotRequested => f. write_str ( "Not requested" ) ,
823+ CertificateChain :: Requested => f. write_str ( "Requested" ) ,
824+ }
825+ }
826+ }
827+
828+ impl TryFrom < u8 > for CertificateChain {
829+ type Error = u8 ;
830+ fn try_from ( i : u8 ) -> Result < Self , u8 > {
831+ match i {
832+ 0 => Ok ( CertificateChain :: NotRequested ) ,
833+ 1 => Ok ( CertificateChain :: Requested ) ,
834+ i => Err ( i) ,
835+ }
836+ }
837+ }
730838}
731839
732840pub mod msg_ssr_flag_high_level {
0 commit comments