Skip to content

Commit 0e0ccce

Browse files
kkasperczyk-norlubos
authored andcommitted
Revert "doc: remove duplicated headers for API"
This reverts commit 5225b4b. Signed-off-by: Kamil Kasperczyk <[email protected]>
1 parent 3bd999e commit 0e0ccce

File tree

5 files changed

+455
-8
lines changed

5 files changed

+455
-8
lines changed

doc/nrf/libraries/security/trusted_storage.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,22 @@ This library has dependencies to the following libraries:
193193
* :ref:`lib_hw_unique_key`
194194
* :ref:`Zephyr's settings subsystem <zephyr:settings_api>`
195195

196+
196197
API documentation
197198
*****************
198199

199200
Protected storage
200201
=================
201202

202-
| Header file: :file:`subsys/trusted_storage/include/psa/protected_storage.h`
203+
| Header file: :file:`include/protected_storage.h`
203204
| Source files: :file:`subsys/secure_storage/src/protected_storage/backend_interface.c`
204205
205206
.. doxygengroup:: protected_storage
206207

207208
Internal trusted storage
208209
========================
209210

210-
| Header file: :file:`subsys/trusted_storage/include/psa/internal_trusted_storage.h`
211+
| Header file: :file:`include/internal_trusted_storage.h`
211212
| Source files: :file:`subsys/secure_storage/src/internal_trusted_storage/backend_interface.c`
212213
213214
.. doxygengroup:: internal_trusted_storage

doc/nrf/nrf.doxyfile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,7 @@ INPUT = @DOCSET_SOURCE_BASE@/applications \
962962
@DOCSET_SOURCE_BASE@/subsys/nrf_security/include/psa/crypto_driver_contexts_composites.h \
963963
@DOCSET_SOURCE_BASE@/subsys/nrf_security/include/psa/crypto_driver_contexts_key_derivation.h \
964964
@DOCSET_SOURCE_BASE@/subsys/nrf_security/include/psa/crypto_driver_contexts_primitives.h \
965-
@DOCSET_SOURCE_BASE@/subsys/nrf_security/include/nrf_security_api_structure.h \
966-
@DOCSET_SOURCE_BASE@/subsys/trusted_storage/include/psa \
965+
@DOCSET_SOURCE_BASE@/subsys/nrf_security/include/nrf_security_api_structure.h
967966

968967
# This tag can be used to specify the character encoding of the source files
969968
# that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,7 @@ Gazell libraries
918918
Security libraries
919919
------------------
920920

921-
* :ref:`trusted_storage_readme` library:
922-
923-
* Updated the API documentation to be based on headers in :file:`subsys/trusted_storage/include/psa` instead of :file:`include/`.
924-
* Removed the :file:`internal_trusted_storage.h` and :file:`protected_storage.h` files from :file:`include/` as they were duplicating the same files in :file:`subsys/trusted_storage/include/psa`.
921+
|no_changes_yet_note|
925922

926923
Modem libraries
927924
---------------

include/internal_trusted_storage.h

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/** This file describes the PSA Internal Trusted Storage API
8+
*/
9+
10+
#ifndef PSA_INTERNAL_TRUSTED_STORAGE_H
11+
#define PSA_INTERNAL_TRUSTED_STORAGE_H
12+
13+
#include <stddef.h>
14+
#include <stdint.h>
15+
16+
#include "psa/error.h"
17+
#include "psa/storage_common.h"
18+
19+
#ifdef __cplusplus
20+
extern "C" {
21+
#endif
22+
23+
/**
24+
* @defgroup internal_trusted_storage PSA Internal Trusted Storage
25+
* @{
26+
*/
27+
28+
29+
#define PSA_ITS_API_VERSION_MAJOR \
30+
1 /* The major version number of the \
31+
* PSA ITS API \
32+
*/
33+
#define PSA_ITS_API_VERSION_MINOR \
34+
0 /* The minor version number of the \
35+
* PSA ITS API \
36+
*/
37+
/* This version of the header file is associated with 1.0 final release. */
38+
39+
/**
40+
* \brief Create a new, or modify an existing, uid/value pair
41+
*
42+
* Stores data in the internal storage.
43+
*
44+
* \param[in] uid The identifier for the data
45+
* \param[in] data_length The size in bytes of the data in `p_data`
46+
* \param[in] p_data A buffer containing the data
47+
* \param[in] create_flags The flags that the data will be stored with
48+
*
49+
* \return A status indicating the success/failure of the operation
50+
*
51+
* \retval PSA_SUCCESS The operation completed successfully
52+
* \retval PSA_ERROR_NOT_PERMITTED The operation failed because the
53+
* provided `uid` value was already
54+
* created with
55+
* PSA_STORAGE_FLAG_WRITE_ONCE
56+
* \retval PSA_ERROR_NOT_SUPPORTED The operation failed because one or
57+
* more of the flags provided in
58+
* `create_flags` is not supported or is
59+
* not valid
60+
* \retval PSA_ERROR_INSUFFICIENT_STORAGE The operation failed because there
61+
* was insufficient space on the
62+
* storage medium
63+
* \retval PSA_ERROR_STORAGE_FAILURE The operation failed because the
64+
* physical storage has failed (Fatal
65+
* error)
66+
* \retval PSA_ERROR_INVALID_ARGUMENT The operation failed because one
67+
* of the provided pointers(`p_data`)
68+
* is invalid, for example is `NULL` or
69+
* references memory the caller cannot
70+
* access
71+
*/
72+
psa_status_t psa_its_set(psa_storage_uid_t uid, size_t data_length, const void *p_data,
73+
psa_storage_create_flags_t create_flags);
74+
75+
/**
76+
* \brief Retrieve data associated with a provided UID
77+
*
78+
* Retrieves up to `data_size` bytes of the data associated with `uid`, starting
79+
* at `data_offset` bytes from the beginning of the data. Upon successful
80+
* completion, the data will be placed in the `p_data` buffer, which must be at
81+
* least `data_size` bytes in size. The length of the data returned will be in
82+
* `p_data_length`. If `data_size` is 0, the contents of `p_data_length` will
83+
* be set to zero.
84+
*
85+
* \param[in] uid The uid value
86+
* \param[in] data_offset The starting offset of the data requested
87+
* \param[in] data_size The amount of data requested
88+
* \param[out] p_data On success, the buffer where the data will
89+
* be placed
90+
* \param[out] p_data_length On success, this will contain size of the data
91+
* placed in `p_data`
92+
*
93+
* \return A status indicating the success/failure of the operation
94+
*
95+
* \retval PSA_SUCCESS The operation completed successfully
96+
* \retval PSA_ERROR_DOES_NOT_EXIST The operation failed because the
97+
* provided `uid` value was not found in
98+
* the storage
99+
* \retval PSA_ERROR_STORAGE_FAILURE The operation failed because the
100+
* physical storage has failed (Fatal
101+
* error)
102+
* \retval PSA_ERROR_INVALID_ARGUMENT The operation failed because one of the
103+
* provided arguments (`p_data`,
104+
* `p_data_length`) is invalid, for example
105+
* is `NULL` or references memory the
106+
* caller cannot access. In addition, this
107+
* can also happen if `data_offset` is
108+
* larger than the size of the data
109+
* associated with `uid`
110+
*/
111+
psa_status_t psa_its_get(psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data,
112+
size_t *p_data_length);
113+
114+
/**
115+
* \brief Retrieve the metadata about the provided uid
116+
*
117+
* Retrieves the metadata stored for a given `uid` as a `psa_storage_info_t`
118+
* structure.
119+
*
120+
* \param[in] uid The `uid` value
121+
* \param[out] p_info A pointer to the `psa_storage_info_t` struct that will
122+
* be populated with the metadata
123+
*
124+
* \return A status indicating the success/failure of the operation
125+
*
126+
* \retval PSA_SUCCESS The operation completed successfully
127+
* \retval PSA_ERROR_DOES_NOT_EXIST The operation failed because the provided
128+
* uid value was not found in the storage
129+
* \retval PSA_ERROR_STORAGE_FAILURE The operation failed because the physical
130+
* storage has failed (Fatal error)
131+
* \retval PSA_ERROR_INVALID_ARGUMENT The operation failed because one of the
132+
* provided pointers(`p_info`)
133+
* is invalid, for example is `NULL` or
134+
* references memory the caller cannot
135+
* access
136+
*/
137+
psa_status_t psa_its_get_info(psa_storage_uid_t uid, struct psa_storage_info_t *p_info);
138+
139+
/**
140+
* \brief Remove the provided uid and its associated data from the storage
141+
*
142+
* Deletes the data from internal storage.
143+
*
144+
* \param[in] uid The `uid` value
145+
*
146+
* \return A status indicating the success/failure of the operation
147+
*
148+
* \retval PSA_SUCCESS The operation completed successfully
149+
* \retval PSA_ERROR_INVALID_ARGUMENT The operation failed because one or more
150+
* of the given arguments were invalid (null
151+
* pointer, wrong flags and so on)
152+
* \retval PSA_ERROR_DOES_NOT_EXIST The operation failed because the provided
153+
* uid value was not found in the storage
154+
* \retval PSA_ERROR_NOT_PERMITTED The operation failed because the provided
155+
* uid value was created with
156+
* PSA_STORAGE_FLAG_WRITE_ONCE
157+
* \retval PSA_ERROR_STORAGE_FAILURE The operation failed because the physical
158+
* storage has failed (Fatal error)
159+
*/
160+
psa_status_t psa_its_remove(psa_storage_uid_t uid);
161+
162+
/** @} */
163+
164+
165+
#ifdef __cplusplus
166+
}
167+
#endif
168+
169+
#endif /* PSA_INTERNAL_TRUSTED_STORAGE_H */

0 commit comments

Comments
 (0)