File tree 4 files changed +20
-6
lines changed
rust/rbac-registration/src/cardano/cip509/rbac
4 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,10 @@ impl Decode<'_, ProblemReport> for C509Cert {
28
28
minicbor:: data:: Type :: Tag => {
29
29
let tag = decode_tag ( d, "C509Cert" ) ?;
30
30
match tag {
31
- t if t == KeyTag :: Deleted . tag ( ) => Ok ( Self :: Deleted ) ,
31
+ t if t == KeyTag :: Deleted . tag ( ) => {
32
+ d. undefined ( ) ?;
33
+ Ok ( Self :: Deleted )
34
+ } ,
32
35
_ => Err ( decode:: Error :: message ( "Unknown tag for C509Cert" ) ) ,
33
36
}
34
37
} ,
Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ impl Decode<'_, ProblemReport> for X509DerCert {
26
26
minicbor:: data:: Type :: Tag => {
27
27
let tag = decode_tag ( d, "X509DerCert" ) ?;
28
28
match tag {
29
- t if t == KeyTag :: Deleted . tag ( ) => Ok ( Self :: Deleted ) ,
29
+ t if t == KeyTag :: Deleted . tag ( ) => {
30
+ d. undefined ( ) ?;
31
+ Ok ( Self :: Deleted )
32
+ } ,
30
33
_ => Err ( decode:: Error :: message ( "Unknown tag for X509DerCert" ) ) ,
31
34
}
32
35
} ,
Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ impl Decode<'_, ProblemReport> for SimplePublicKeyType {
25
25
minicbor:: data:: Type :: Tag => {
26
26
let tag = decode_tag ( d, "SimplePublicKeyType" ) ?;
27
27
match tag {
28
- t if t == KeyTag :: Deleted . tag ( ) => Ok ( Self :: Deleted ) ,
28
+ t if t == KeyTag :: Deleted . tag ( ) => {
29
+ d. undefined ( ) ?;
30
+ Ok ( Self :: Deleted )
31
+ } ,
29
32
t if t == KeyTag :: Ed25519 . tag ( ) => {
30
33
let bytes = decode_bytes ( d, "Ed25519 SimplePublicKeyType" ) ?;
31
34
let mut ed25519 = [ 0u8 ; 32 ] ;
@@ -42,7 +45,11 @@ impl Decode<'_, ProblemReport> for SimplePublicKeyType {
42
45
) ) )
43
46
}
44
47
} ,
45
- _ => Err ( decode:: Error :: message ( "Unknown tag for Self" ) ) ,
48
+ _ => {
49
+ Err ( decode:: Error :: message (
50
+ "Unknown tag for SimplePublicKeyType" ,
51
+ ) )
52
+ } ,
46
53
}
47
54
} ,
48
55
minicbor:: data:: Type :: Undefined => {
Original file line number Diff line number Diff line change @@ -7,15 +7,16 @@ pub(crate) enum KeyTag {
7
7
/// Deleted Key tag 31.
8
8
Deleted ,
9
9
/// Ed25519 Key tag 32773.
10
+ /// <https://cips.cardano.org/cip/CIP-0115>
10
11
Ed25519 ,
11
12
}
12
13
13
14
impl KeyTag {
14
15
/// Get the tag value.
15
16
pub ( crate ) fn tag ( self ) -> Tag {
16
17
match self {
17
- KeyTag :: Deleted => Tag :: new ( 0x31 ) ,
18
- KeyTag :: Ed25519 => Tag :: new ( 0x8005 ) ,
18
+ KeyTag :: Deleted => Tag :: new ( 31 ) ,
19
+ KeyTag :: Ed25519 => Tag :: new ( 32773 ) ,
19
20
}
20
21
}
21
22
}
You can’t perform that action at this time.
0 commit comments