Autosar Srs Cryptostack
Autosar Srs Cryptostack
AUTOSAR CP R19-11
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and
the companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Scope of Document
This document specifies the requirements of the crypto stack:
Crypto Service Manager (Csm),
Crypto Interface (CryIf) and
Crypto Driver (Crypto)
Key Manager.
2 Conventions to be used
4 Functional Overview
The Crypto Stack offers a standardized access to cryptographic services for applications
and system functions.
The cryptographic services are, e.g., the computation of hashes, the verification of
asymmetrical signatures, or the symmetrical encryption of data. These services depend
on underlying cryptographic primitives and cryptographic schemes. The CSM shall make
it possible for different applications to use the same service but using different underlying
primitives and/or schemes. E.g., one application might need to use the hash service to
compute an SHA2 digest and another might need to compute an SHA1 digest. Or one
application might need to verify a signature which has been computed with the RSASSA-
PKCS1-V1_5 signature scheme and using SHA1 as an underlying hash primitive, while
another application might need to verify a signature computed with a different scheme
which uses SHA2 as an underlying hash primitive. The Crypto Stack shall make it
possible to configure which services are needed and to create several configurations for
each service where schemes and primitives can be chosen.
Furthermore, since the computation of many of the cryptographic services is very
computation intensive, provisions have to be made for scheduling these long
computations. The jobs shall be configurable to be executed synchronously or
asynchronously.
The Crypto Stack provides services with cryptography functionality, based on software
libraries
or on hardware modules. Also, mixed setups are possible, for example if a hardware
module cannot supply the necessary functionality on its own. In the following, we refer to
all instantiations of underlying functionality, be it hardware or software, as "crypto library".
5 Requirements Specification
5.1.1.1 General
5.1.1.2 Configuration
5.1.1.2.1 [SRS_CryptoStack_00007] The Crypto Stack shall provide scalability for the
cryptographic features
⌈
Type: Valid
Use Case: The mapping between crypto stack and the functionalities of microcontroller hardware
allows hardware vendors to develop generic drivers for their HSMs.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_01456, RS_BRF_02031 )
Description: The Crypto Stack shall allow static configuration of symmetric and asymmetric key
pairs used for crypto services.
5.1.1.2.3 [SRS_CryptoStack_00105] The Crypto Stack shall only allow unique key
identifiers
⌈
Type: Valid
⌈
Type: Valid
Description: The modules of the crypto stack shall support only pre-compile time configuration.
Supporting --
Material:
⌋(RS_BRF_01136)
Rationale: Human being have to read and understand the configuration. So the
configuration shall be readable and understandable for human being.
Use Case: Debugging
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01456)
5.1.1.3 Initialization
None
5.1.1.4.1 [SRS_CryptoStack_00009] The Crypto Stack shall support reentrancy for all
crypto services
⌈
Type: Valid
Description: The Crypto Stack shall support reentrancy of crypto related interfaces to enable
parallel operations of the same or different type when requested by multiple users.
This requirement also covers scenarios where applications are residing on different
cores.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02033 )
Description: There shall be no interface to extract symmetric key values directly to the user. Keys
shall be addressed via identifiers by the users.
Supporting --
Material:
⌋(RS_BRF_02031, RS_BRF_01946 )
Description: There shall be no interface to extract asymmetric private key values directly to the
user. Keys shall be addressed via identifiers by the Users.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031, RS_BRF_01946 )
⌈
Type: Valid
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall identify symmetric encryption/decryption as a cryptographic
primitive which can be requested to a driver.
Rationale: Symmetric algorithms residing on different crypto drivers should be accessed using a
homogenous interface.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Rationale: MAC algorithms residing on different crypto drivers should be accessed using a
homogenous interface.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description:
The Crypto Stack shall identify asymmetric signature generation/verification as a
cryptographic primitive which can be requested to a driver.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall identify hash calculation as a cryptographic primitive which can
be requested to a driver.
Rationale: Hash algorithms residing on different crypto drivers should be accessed using a
homogenous interface.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall provide an abstracted interface for the generation of
asymmetric key pair service.
Rationale: Key generation services residing on different Crypto drivers should be accessed using
a homogenous interface.
Use Case:
Generation of an asymmetric key pair inside the ECU. Then, the private key never has
to be available outside the ECU.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall abstract the user from multiple symmetric keys stored by
various Crypto Drivers through a standardized interface. Also, it shall provide an
interface to the driver for generation of such keys.
Rationale: Key generation services residing on different Crypto drivers should be accessed using
a homogenous interface.
Use Case: Password-based key input
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall abstract the user from multiple symmetric keys stored by
various Crypto Drivers through a standardized interface. Also, it shall provide an
interface to the driver for derivation of such keys.
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall support key exchange mechanism as a key management
interface
Rationale: Key exchange algorithms residing on different crypto drivers should be accessed
using a homogenous interface
Use Case: Session handling
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
⌈
Type: Valid
Description: The Crypto Stack shall support key wrapping (encapsulation) and extraction
mechanism forward such requests from CSM to the respective driver. It shall support
wrapping using a symmetric key as well as asymmetric key.
Rationale: Key wrapping and encapsulation algorithms implemented in the driver shall not be
accessed directly by the users and need to be abstracted.
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031 )
Description: The Crypto Stack shall support parsing certificates and extracting the contained keys
Rationale: The crypto driver shall parse incoming certificates and store the key information in the
corresponding key
Use Case: For PKI it is necessary to obtain public keys out of certificates
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_01946 )
Rationale: Algorithms like RSA or several ECC flavors know keys which can be used to perform
the mathematical foundation of the algorithm without an error but address special
corner cases and are not secure to handle. Keys like that have to be identified and
rejected. There is no generic approach hence the implementation has to be in the
cryptographic primitive itself or, in case hardware is used, in its driver.
Use Case: RSA and several Elliptic Curve Cryptosystems
Dependencies: --
Supporting --
Material:
⌋(RS_BRF_02031, RS_BRF_01946 )
None
None
5.1.2.1 General
5.1.2.2 Configuration
5.1.2.3 Initialization
Rationale: A key server may not be available during development of a secure system. So it
should be possible to configure default keys which can be used during development.
Use Case: System tests during development phase.
Dependencies: --
Supporting Concept 636 “Security Extensions” – C2
Material:
⌋(Uptrace: Link to RS_Main: [RS_Main_00514])
5.1.3.1 General
5.1.3.2 Configuration
5.1.3.6.4 [SRS_CryptoStack_00097] The CSM shall check passed API parameters for
validity
⌈
Type: Valid
Description: The CSM shall check passed API parameters for validity. This checking shall
be statically configurable for those errors that only can occur during
development.
Rationale: Basic functionality
Use Case: Debugging
Dependencies: --
Supporting Material: --
⌋( RS_BRF_00129, RS_BRF_02168, RS_BRF_02232)
5.1.4.1 Configuration
⌈
Type: Valid
Description: The Crypto Interface shall have an interface to the static configuration information of
the Crypto Driver.
Supporting --
Material:
⌋(RS_BRF_01008)
⌈
Type: Valid
Virtual channels are the virtual way from the queue of the CSM over the CRYIF to the
corresponding Crypto Driver Object.
Rationale: Each crypto driver object in the driver can be abstracted from and utilized by CSM
using virtual channels.
Use Case: Two hardware resources: one for symmetric cryptography, one for asymmetric
cryptography
Dependencies: --
Supporting --
Material:
5.1.4.2 Initialization
None
⌈
Type: Valid
Description: The Crypto Interface shall report detected development errors to the Default Error
Tracer (DET).
The detection and reporting shall be statically configurable with one single
preprocessor switch.
Supporting --
Material:
⌋(RS_BRF_02232)
5.1.5.1 Configuration
⌈
Type: Valid
Description: The Crypto Driver shall allow defining of different Crypto Driver Objects.
⌈
Type: Valid
Description: The Crypto Interface shall support a configuration model where all CRYIF keys shall
be statically mapped to keys in the crypto driver.
Rationale: Similar to the channels where the CsmQueue is mapped to the Crypto Driver Object,
the keys in the CSM have to mapped via the CRYIF to the corresponding key in the
Crypto Driver.
Use Case: Multiple Crypto Driver modules where each module has its own key identifiers
Dependencies: --
Supporting --
Material:
5.1.5.2 Initialization
Description: The Crypto Driver shall support access to all by the Crypto Stack supported
algorithms.
Rationale: Usage of hardware support and performance benefits.
Supporting --
Material:
⌋()
None
5.1.6.1 General
5.2.1 General
⌈
Type: Valid
Description: The CSM module shall provide an abstraction layer which offers a
standardized interface to higher software layers to access cryptographic
algorithms.
Rationale: An abstraction layer encapsulates internal behaviors and reduces
complexity. It also increases maintainability, improves portability and eases
testability.
Use Case: Session handling.
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01456, RS_BRF_01016, RS_BRF_01056)
⌈
Type: Valid
Description: The CSM module shall be located in the Autosar service layer
Rationale: Management functionality must be available to all modules and layers of the
system
Use Case: The CSM module shall be accessible from applications above the RTE.
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01016, RS_BRF_01408)
⌈
Type: Valid
Description: The CSM shall provide an interface to be accessible via the RTE.
Rationale: The CSM module shall be accessible from applications above the RTE.
Use Case: Applications which require crypto services.
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01408, RS_BRF_01280)
⌈
Type: Valid
Description: The CSM shall provide one Provide--Port for each configuration. All
configured services shall be accessible via this port.
Rationale: All crypto services shall be accessible from applications above the RTE via
the Provide-Port.
Use Case: All applications request to the CSM uses this port.
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01056, RS_BRF_01280, RS_BRF_01408, RS_BRF_01456)
⌈
Type: Valid
Description: The CSM shall provide one Require-Port for each configuration. The
configured callback function shall be accessible via this port.
Rationale: All crypto services shall have access to the configured callback functions via
the Require-Port.
Use Case: Most asynchronous services own a callback function.
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01056, RS_BRF_01280, RS_BRF_01408, RS_BRF_01456)
⌈
Type: Valid
Description: The Crypto Interface is the single interface for all upper Layer (BSW) for crypto
operations.
The Crypto Interface is the single user of the Crypto Driver
Dependencies: --
⌈
Type: Valid
Description: The CRYIF implementation and CRYIF interfaces shall be independent from the
underlying Crypto Driver modules.
Supporting --
Material:
⌋(RS_BRF_01000, RS_BRF_02031)
⌈
Type: Valid
Description: The Crypto Driver module shall strictly separate error and status information.
This requirement applies to return values and also to internal variables.
Rationale: The distinction between error and status information allow an easier handling
with them. Errors shall be treated differently than status information.
Use Case: All return values are error information.
Dependencies: --
Supporting Material: --
⌋( RS_BRF_00129, RS_BRF_02168, RS_BRF_02232, RS_BRF_02272)
6 Requirements Tracing
7 References