Skip to content

Commit c76703f

Browse files
Jakujesimo5
authored andcommitted
object: Do not allow changing attributes with NeverSettable Flags using SetAttributeValue
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent cbc41b3 commit c76703f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/object.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,9 @@ pub trait ObjectFactory: Debug + Send + Sync {
850850
match attrs.iter().find(|a| a.get_type() == ck_attr.type_) {
851851
None => return Err(CKR_ATTRIBUTE_TYPE_INVALID)?,
852852
Some(attr) => {
853+
if attr.is(OAFlags::NeverSettable) {
854+
return Err(CKR_ACTION_PROHIBITED)?;
855+
}
853856
if attr.is(OAFlags::Unchangeable) {
854857
if attr.attribute.get_attrtype() == AttrType::BoolType {
855858
let val = ck_attr.to_bool()?;

0 commit comments

Comments
 (0)