Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateCopyDestroyObject, read only error for CKA_VALUE #53

Open
metekesler opened this issue Jun 9, 2021 · 6 comments
Open

CreateCopyDestroyObject, read only error for CKA_VALUE #53

metekesler opened this issue Jun 9, 2021 · 6 comments

Comments

@metekesler
Copy link
Contributor

metekesler commented Jun 9, 2021

// Make another copy but change the value attribute along the way.
CK_OBJECT_HANDLE object3;
CK_BYTE facefeed[] = { 0xFA, 0xCE, 0xFE, 0xED};
CK_ATTRIBUTE attrs3[] = {
{CKA_VALUE, facefeed, sizeof(facefeed)},
};
EXPECT_CKR_OK(g_fns->C_CopyObject(session_, object, attrs3, 1, &object3));

Updating the CKA_VALUE attribute. It says read-only in the standard. Could the testing process here be wrong?

url

@daviddrysdale
Copy link
Contributor

The section you linked to (4.3.4.2) seems to be specific to a "Monotonic Counter Object", but the test is manipulating a CKO_DATA object (section 4.5.2). Or am I getting the wrong spec section?

@metekesler
Copy link
Contributor Author

metekesler commented Jun 21, 2021

Yes that's the wrong property section.
The right part : url

@daviddrysdale
Copy link
Contributor

I can't see anything in the CKO_DATA section that indicates that CKA_VALUE should be read-only – please re-open with exact spec text if I'm missing something.

@ruchi393
Copy link

As per specification only attributes marked with "8, 10, 11 and 12"
are modifiable after an object has been created/key generated.
The only exception to these are any attributes if mentioned in
footnote of the other tables. (eg table 16 which in its footnote
specifies explicitly about the modifiable attributes). For Data Object,
attributes (Table 17) neither are the attributes marked with 8,10,11 or 12
as per Table 10, nor is it specified that these are modifiable later.
So, this suggests that attribute CKA_VALUE can't be modified and is read-only.

@daviddrysdale
Copy link
Contributor

Re-opening the issue, but I'm still not convinced – I haven't yet seen a definitive spec reference.

BTW, https://thalesdocs.com/gphsm/ptk/5.9/docs/Content/PTK-C_Program/Obj_Classes/data_obj.htm includes "Each of these attributes may be modified after the object is created."

@metekesler
Copy link
Contributor Author

This means that the CKA_VALUE value cannot be changed when the entire specification is read and the footnote is considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants