| df017b2b | 10-Feb-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: forbid change of CKA_PRIVATE from true to false on object copy
In C_CopyObject(), forbid copying of an object with a template which attempts to change the attribute CKA_PRIVATE from true
ta: pkcs11: forbid change of CKA_PRIVATE from true to false on object copy
In C_CopyObject(), forbid copying of an object with a template which attempts to change the attribute CKA_PRIVATE from true to false.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| bc09507c | 09-Feb-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add support for copying objects
Implement command PKCS11_CMD_COPY_OBJECT.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.
ta: pkcs11: Add support for copying objects
Implement command PKCS11_CMD_COPY_OBJECT.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 2d25a9bc | 09-Feb-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add support for modifying objects
Implement command PKCS11_CMD_SET_ATTRIBUTE_VALUE.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carrie
ta: pkcs11: Add support for modifying objects
Implement command PKCS11_CMD_SET_ATTRIBUTE_VALUE.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 3bf0e097 | 22-Jan-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta/pkcs11: Use LIST_FOREACH_SAFE when removing objects from list
When traversing object list to remove objects, use LIST_FOREACH_SAFE to avoid segmentation fault.
Signed-off-by: Ruchika Gupta <ruch
ta/pkcs11: Use LIST_FOREACH_SAFE when removing objects from list
When traversing object list to remove objects, use LIST_FOREACH_SAFE to avoid segmentation fault.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| db0f45f3 | 20-Jan-2021 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: add debug string for PKCS11_CKA_KEY_GEN_MECHANISM
Add missing attribute debug string for PKCS11_CKA_KEY_GEN_MECHANISM.
Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by:
ta: pkcs11: add debug string for PKCS11_CKA_KEY_GEN_MECHANISM
Add missing attribute debug string for PKCS11_CKA_KEY_GEN_MECHANISM.
Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 46900d03 | 02-Dec-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: Fix serialization handling for non-indirect attributes
Both sides of serialization and de-serialization must match the logic.
Only TEMPLATE based arguments has indirect attributes so de
ta: pkcs11: Fix serialization handling for non-indirect attributes
Both sides of serialization and de-serialization must match the logic.
Only TEMPLATE based arguments has indirect attributes so detect them and handle them specifically.
Otherwise use standard attribute handling code for other attributes.
Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| f3178382 | 31-Dec-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: get_attribute: fix return value when querying value size
When C_GetAttributeValue() is issued with attribute with pValue == NULL: - Size of the attribute value should be returned - Retur
ta: pkcs11: get_attribute: fix return value when querying value size
When C_GetAttributeValue() is issued with attribute with pValue == NULL: - Size of the attribute value should be returned - Return value should be CKR_OK
If pValue != NULL and value does not fit then CKR_BUFFER_TOO_SMALL should be returned.
Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| d17c25d2 | 29-Dec-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: get_attribute: fix returning values into larger buffer
It is completely fine for callee to allocate more memory than what is needed.
Now attributes value is wholly copied and copied dat
ta: pkcs11: get_attribute: fix returning values into larger buffer
It is completely fine for callee to allocate more memory than what is needed.
Now attributes value is wholly copied and copied data amount is returned.
Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 18cbc7a2 | 16-Sep-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: fix get attribute data alignment problem
In OP-TEE there is no behind the scenes handler that would fix data alignment problems.
Use aligned variables when accessing struct variables.
ta: pkcs11: fix get attribute data alignment problem
In OP-TEE there is no behind the scenes handler that would fix data alignment problems.
Use aligned variables when accessing struct variables.
Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| fa1ac767 | 15-Jan-2021 |
Robin van der Gracht <robin@protonic.nl> |
ta: pkcs11: Don't load objects that don't match the search during find
Don't load all persistent object attributes in find_objects_init(). Instead, temporary load object attributes and release them
ta: pkcs11: Don't load objects that don't match the search during find
Don't load all persistent object attributes in find_objects_init(). Instead, temporary load object attributes and release them if not matching the current search.
Move object attribute loading from token_obj_matches_ref() to load_persistent_object_attributes() and introduce counterpart release_persistent_object_attributes().
Changes attributes_match_reference() to always return true when reference is empty (match all case).
Remove token_obj_matches_ref() since attributes_match_reference() can be called straight from load_persistent_object_attributes().
Signed-off-by: Robin van der Gracht <robin@protonic.nl> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org>
show more ...
|
| 89735787 | 12-Jan-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Deal with the private objects in C_Logout
The logic to deal with the private objects was missing in the C_Logout() implementation. PKCS#11 specification states that : When C_Logout succe
ta: pkcs11: Deal with the private objects in C_Logout
The logic to deal with the private objects was missing in the C_Logout() implementation. PKCS#11 specification states that : When C_Logout successfully executes, any of the application’s handles to private objects should become invalid (even if a user is later logged back into the token, those handles remain invalid). In addition, all private session objects from sessions belonging to the application should also be destroyed.
In addition, also release any ongoing cryptographic or object-finding operations that may be associated with the session while logging out.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 355d722a | 12-Jan-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Reduce the minimum pin length required
SoftHSM Unit test suite passes a 4 byte pin while initializing pin. Since current implementation restricts the minimum pin length to 10, C_InitPin(
ta: pkcs11: Reduce the minimum pin length required
SoftHSM Unit test suite passes a 4 byte pin while initializing pin. Since current implementation restricts the minimum pin length to 10, C_InitPin() fails resulting in the testcases to be aborted. Reduce the minimum pin length requirement inorder to run the SoftHSM test suite.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5db0fef4 | 12-Jan-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Access check for private objects
Private objects of a session/token are accessible only in a R/O or R/W user session i.e if a user is logged in. R/O or R/W public session or a R/W SO ses
ta: pkcs11: Access check for private objects
Private objects of a session/token are accessible only in a R/O or R/W user session i.e if a user is logged in. R/O or R/W public session or a R/W SO session cannot access these private objects. Check for SO session was missing in the logic when checking for access of private objects. This has now been added.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 783c1515 | 13-Jan-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add support for getting object size and attribute value
Implement commands - PKCS11_CMD_GET_OBJECT_SIZE - PKCS11_CMD_GET_ATTRIBUTE_VALUE
Co-developed-by: Etienne Carriere <etienne.carri
ta: pkcs11: Add support for getting object size and attribute value
Implement commands - PKCS11_CMD_GET_OBJECT_SIZE - PKCS11_CMD_GET_ATTRIBUTE_VALUE
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Co-developed-by: Gabor Szekely <szvgabor@gmail.com> Signed-off-by: Gabor Szekely <szvgabor@gmail.com> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| dc99b202 | 22-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add support for finding objects
Implement commands - PKCS11_CMD_FIND_OBJECTS_INIT - PKCS11_CMD_FIND_OBJECTS - PKCS11_CMD_FIND_OBJECTS_FINAL
Co-developed-by: Etienne Carriere <etienne.ca
ta: pkcs11: Add support for finding objects
Implement commands - PKCS11_CMD_FIND_OBJECTS_INIT - PKCS11_CMD_FIND_OBJECTS - PKCS11_CMD_FIND_OBJECTS_FINAL
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Co-developed-by: Gabor Szekely <szvgabor@gmail.com> Signed-off-by: Gabor Szekely <szvgabor@gmail.com> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| c2f85e81 | 22-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: define TA commands for finding objects
Adds commands - PKCS11_CMD_FIND_OBJECTS_INIT - PKCS11_CMD_FIND_OBJECTS - PKCS11_CMD_FIND_OBJECTS_FINAL in enum pkcs11_ta_cmd.
Co-developed-by: Eti
ta: pkcs11: define TA commands for finding objects
Adds commands - PKCS11_CMD_FIND_OBJECTS_INIT - PKCS11_CMD_FIND_OBJECTS - PKCS11_CMD_FIND_OBJECTS_FINAL in enum pkcs11_ta_cmd.
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Co-developed-by: Gabor Szekely <szvgabor@gmail.com> Signed-off-by: Gabor Szekely <szvgabor@gmail.com> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 7f12c782 | 06-Jan-2021 |
Robin van der Gracht <robin@protonic.nl> |
ta: pkcs11: Remove persistent objects on token re-initialization
When re-initializing a token the previously created objects need to be removed.
Signed-off-by: Robin van der Gracht <robin@protonic.
ta: pkcs11: Remove persistent objects on token re-initialization
When re-initializing a token the previously created objects need to be removed.
Signed-off-by: Robin van der Gracht <robin@protonic.nl> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 1a27b197 | 21-Oct-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: Add TEE Identity based authentication support
In C_InitToken() if PIN is NULL_PTR then it will activate TEE Identity based authentication support for token.
Once activated:
- When ever
ta: pkcs11: Add TEE Identity based authentication support
In C_InitToken() if PIN is NULL_PTR then it will activate TEE Identity based authentication support for token.
Once activated:
- When ever PIN is required client's TEE Identity will be used for authentication - PIN failure counters are disabled - If new PIN is given as input it is in form of PIN ACL string - It can be disabled with C_InitToken with non-zero PIN
Internally protected authentication path will be used for mode determination.
Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 1e497011 | 21-Oct-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: set_pin: use token shortcut like in other pin functions
Use common shortcut variable 'token' as in check_so_pin and check_user_pin.
Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Re
ta: pkcs11: set_pin: use token shortcut like in other pin functions
Use common shortcut variable 'token' as in check_so_pin and check_user_pin.
Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 12253e9e | 21-Oct-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: entry_ck_token_initialize: reset SO flags on init
If successful token init has been performed and new PIN is set then reset all pin change flags.
Call update_persistent_db() only once a
ta: pkcs11: entry_ck_token_initialize: reset SO flags on init
If successful token init has been performed and new PIN is set then reset all pin change flags.
Call update_persistent_db() only once as a last step during the execution.
Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 974adb9f | 14-Dec-2020 |
Robin van der Gracht <robin@protonic.nl> |
pkcs11: persistent_token: Don't read token object UUIDs if we have none
Do not call TEE_ReadObjectData() when there is no object data to read because the function panics when reading 0 bytes.
Revie
pkcs11: persistent_token: Don't read token object UUIDs if we have none
Do not call TEE_ReadObjectData() when there is no object data to read because the function panics when reading 0 bytes.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Robin van der Gracht <robin@protonic.nl>
show more ...
|
| a3c511df | 07-Jan-2021 |
Robin van der Gracht <robin@protonic.nl> |
ta: pkcs11: Change sizeof argument for consistency
The bytes subtracted here were added a few lines ago. Since *db_objs was used there we should also do this here for readability.
Reviewed-by: Etie
ta: pkcs11: Change sizeof argument for consistency
The bytes subtracted here were added a few lines ago. Since *db_objs was used there we should also do this here for readability.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Robin van der Gracht <robin@protonic.nl>
show more ...
|
| fab91492 | 29-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add more checks before destroying object in a session
Few checks were missing in the implementaion of C_DestroyObject() as per PKCS#11 Specification. These have been added now. These che
ta: pkcs11: Add more checks before destroying object in a session
Few checks were missing in the implementaion of C_DestroyObject() as per PKCS#11 Specification. These have been added now. These checks are - only session objects can be destroyed during a read only session - only public objects can be destroyed unless the normal user is logged in - Certain objects may not be destroyed. Calling C_DestroyObject on such objects will result in the CKR_ACTION_PROHIBITED error code. An application can consult the object's CKA_DESTROYABLE attribute to determine if an object may be destroyed or not.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 08774c86 | 31-Dec-2020 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: Fix return value when trying to open parallel session
It is mandatory to have CKF_SERIAL_SESSION set when invoking C_OpenSession(). When omitted CKR_SESSION_PARALLEL_NOT_SUPPORTED must b
ta: pkcs11: Fix return value when trying to open parallel session
It is mandatory to have CKF_SERIAL_SESSION set when invoking C_OpenSession(). When omitted CKR_SESSION_PARALLEL_NOT_SUPPORTED must be returned.
Specified in: PKCS #11 Cryptographic Token Interface Base Specification Version 2.40 Plus Errata 01 5.6 Session management functions C_OpenSession
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| b68aca61 | 24-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Check for CKA_PRIVATE when creating objects
PKCS#11 Specification[1] states that Private session/token objects cannot be created in Public sessions. So, add a check for access type when
ta: pkcs11: Check for CKA_PRIVATE when creating objects
PKCS#11 Specification[1] states that Private session/token objects cannot be created in Public sessions. So, add a check for access type when creating objects.
[1] PKCS #11 Cryptographic Token Interface Usage Guide Version 2.40 (Table 3 - ACCESS TO DIFFERENT TYPES OBJECTS BY DIFFERENT TYPES OF SESSIONS)
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|