Skip to content

Commit

Permalink
Fix files with mistakes from launching the script:
Browse files Browse the repository at this point in the history
include/psa/crypto_struct.h
library/psa_crypto_storage.c

Add ALLOW_PRIVATE_ACCESS to programs.

Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
  • Loading branch information
mstarzyk-mobica committed May 17, 2021
1 parent 8cd4bc7 commit 30b20a8
Show file tree
Hide file tree
Showing 46 changed files with 90 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/psa/crypto_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static inline struct psa_key_attributes_s psa_key_attributes_init( void )
static inline void psa_set_key_id( psa_key_attributes_t *attributes,
mbedtls_svc_key_id_t key )
{
psa_key_lifetime_t MBEDTLS_PRIVATE(lifetime) = attributes->MBEDTLS_PRIVATE(core).lifetime;
psa_key_lifetime_t lifetime = attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(lifetime);

attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(id) = key;

Expand Down
2 changes: 2 additions & 0 deletions library/psa_crypto_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* limitations under the License.
*/

#include "common.h"

#if defined(MBEDTLS_CONFIG_FILE)
#include MBEDTLS_CONFIG_FILE
#else
Expand Down
Binary file added programs/aes/aescrypt2
Binary file not shown.
2 changes: 2 additions & 0 deletions programs/aes/crypt_and_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* Harmless on other platforms. */
#define _POSIX_C_SOURCE 200112L

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_client.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include "mbedtls/ssl.h"
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_dtlsclient.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <string.h>
#include <stdlib.h>
#include <stdint.h>
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_dtlsserver.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <string.h>
#include <stdlib.h>
#include <stdint.h>
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_privkey.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <stdint.h>
#include <stdlib.h>
#include "mbedtls/pk.h"
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_pubkey.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <stdint.h>
#include <stdlib.h>
#include "mbedtls/pk.h"
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_server.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include "mbedtls/ssl.h"
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_x509crl.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <stdint.h>
#include "mbedtls/x509_crl.h"

Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_x509crt.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <stdint.h>
#include "mbedtls/x509_crt.h"

Expand Down
2 changes: 2 additions & 0 deletions programs/fuzz/fuzz_x509csr.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include <stdint.h>
#include "mbedtls/x509_csr.h"

Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/dh_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/dh_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/ecdh_curve25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/ecdsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/gen_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/key_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/key_app_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/pk_decrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/pk_encrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/pk_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/pk_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/rsa_sign_pss.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/pkey/rsa_verify_pss.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/dtls_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/dtls_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/mini_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_client1.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_client2.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include "ssl_test_lib.h"

#if defined(MBEDTLS_SSL_TEST_IMPOSSIBLE)
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_context_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_fork_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
3 changes: 3 additions & 0 deletions programs/ssl/ssl_mail_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
/* Enable definition of gethostname() even when compiling with -std=c99. Must
* be set before config.h, which pulls in glibc's features.h indirectly.
* Harmless on other platforms. */

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#define _POSIX_C_SOURCE 200112L
#define _XOPEN_SOURCE 600

Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_server2.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include "ssl_test_lib.h"

#if defined(MBEDTLS_SSL_TEST_IMPOSSIBLE)
Expand Down
2 changes: 2 additions & 0 deletions programs/ssl/ssl_test_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#include "ssl_test_lib.h"

#if defined(MBEDTLS_TEST_HOOKS)
Expand Down
2 changes: 2 additions & 0 deletions programs/test/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/test/query_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/test/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/test/udp_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* example of good general usage.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/x509/cert_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/x509/cert_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/x509/cert_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/x509/crl_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down
2 changes: 2 additions & 0 deletions programs/x509/req_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* limitations under the License.
*/

#define MBEDTLS_ALLOW_PRIVATE_ACCESS

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
Expand Down

0 comments on commit 30b20a8

Please sign in to comment.