| 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 ...
|
| 27e8d08d | 27-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Introduce CFG_TA_BGET_TEST
Introduces CFG_TA_BGET_TEST which compiles the integrated bget test suite together with the rest of bget. When enabled, the test entry point is bget_main_test() in libutil
Introduce CFG_TA_BGET_TEST
Introduces CFG_TA_BGET_TEST which compiles the integrated bget test suite together with the rest of bget. When enabled, the test entry point is bget_main_test() in libutils.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
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 ...
|
| 12f1ba86 | 24-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Fix error returned
When trying to access an object of type CKA_PRIVATE without logging in, the error returned should be PKCS11_CKR_USER_NOT_LOGGED_IN.
Signed-off-by: Ruchika Gupta <ruch
ta: pkcs11: Fix error returned
When trying to access an object of type CKA_PRIVATE without logging in, the error returned should be PKCS11_CKR_USER_NOT_LOGGED_IN.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 90c47fe2 | 22-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Use get_attribute_ptr() instead of get_attribute()
When just trying to determine if an attribute is present in the list or not withour requiring the actual value of the attribute, using
ta: pkcs11: Use get_attribute_ptr() instead of get_attribute()
When just trying to determine if an attribute is present in the list or not withour requiring the actual value of the attribute, using get_attribute_ptr() is better to use as it is more light-weight than it's counterpart get_attribute().
Suggested-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 4cfce748 | 21-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add class_id in create_attributes_from_template()
Add a parameter to pass pkcs11_class_id. The parameter will be used when attributes need to be created for a template supporting public
ta: pkcs11: Add class_id in create_attributes_from_template()
Add a parameter to pass pkcs11_class_id. The parameter will be used when attributes need to be created for a template supporting public or private class key. It is unused for now.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| dcad3409 | 18-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add class and type hint in sanitize_client_object()
Specification allows one to pass templates while genrating key/keypair where class and type may be omitted from the template. In such
ta: pkcs11: Add class and type hint in sanitize_client_object()
Specification allows one to pass templates while genrating key/keypair where class and type may be omitted from the template. In such cases, pass class and type as hint in sanitize_client_object() so that they can be added in the attribute list being prepared.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 70c78a55 | 17-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Fix for CKA_KEY_GEN_MECHANISM in create_attributes_from_template()
CKA_KEY_GEN_MECHANISM attribute is not added in the attribute list (attrs) from the template (temp) when a key object i
ta: pkcs11: Fix for CKA_KEY_GEN_MECHANISM in create_attributes_from_template()
CKA_KEY_GEN_MECHANISM attribute is not added in the attribute list (attrs) from the template (temp) when a key object is created as it doesn't fall in mandatory/optional attribute. So, error checking for this attribute should be done on the original source template(temp) and not the attribute list(attrs) in create_attributes_from_template().
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| ff65c72a | 17-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Fix for CKA_LOCAL in create_attributes_from_template()
CKA_LOCAL attribute is not added in the attribute list (attrs) from the template (temp) when a key object is created as it doesn't
ta: pkcs11: Fix for CKA_LOCAL in create_attributes_from_template()
CKA_LOCAL attribute is not added in the attribute list (attrs) from the template (temp) when a key object is created as it doesn't fall in mandatory/optional attribute. So, error checking for this attribute should be done on the original source template(temp) and not the attribute list(attrs) in create_attributes_from_template().
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| fa247a2a | 10-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Add support for Key Generation
Adds support of mechanisms PKCS11_CKM_GENERIC_SECRET_KEY_GEN, PKCS11_CKM_AES_KEY_GEN for key generation API.
Co-developed-by: Etienne Carriere <etienne.ca
ta: pkcs11: Add support for Key Generation
Adds support of mechanisms PKCS11_CKM_GENERIC_SECRET_KEY_GEN, PKCS11_CKM_AES_KEY_GEN for key generation API.
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 4cbb7eac | 07-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Define TA mechanisms for Key Generation
Adds the mechanisms PKCS11_CKM_GENERIC_SECRET_KEY_GEN in enum pkcs11_mechanism_id.
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org
ta: pkcs11: Define TA mechanisms for Key Generation
Adds the mechanisms PKCS11_CKM_GENERIC_SECRET_KEY_GEN in enum pkcs11_mechanism_id.
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| d09e2463 | 07-Dec-2020 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Define command for Key Generation
Add command PKCS11_CMD_GENERATE_KEY in enum pkcs11_ta_cmd.
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carri
ta: pkcs11: Define command for Key Generation
Add command PKCS11_CMD_GENERATE_KEY in enum pkcs11_ta_cmd.
Co-developed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|