Skip to content

Commit 2add588

Browse files
Ensure that there is no encryption key for the role 0
1 parent 5dd995d commit 2add588

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rust/rbac-registration/src/cardano/cip509/validation.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,15 @@ pub fn validate_role_data(metadata: &Cip509RbacMetadata, report: &ProblemReport)
267267
fn validate_role_0(
268268
role: &RoleData, metadata: &Cip509RbacMetadata, context: &str, report: &ProblemReport,
269269
) {
270+
if role.encryption_key().is_some() {
271+
report.invalid_value(
272+
"Role 0 encryption key",
273+
"<some value>",
274+
"The role 0 shouldn't have the encryption key",
275+
context,
276+
);
277+
}
278+
270279
let Some(signing_key) = role.signing_key() else {
271280
report.missing_field("(Role 0) RoleData::signing_key", context);
272281
return;

0 commit comments

Comments
 (0)