From 340808ca67b843fab483883197485301adcdcc14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 8 Feb 2022 11:15:26 +0100 Subject: [PATCH] Add comments on error codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Pégourié-Gonnard --- programs/cipher/cipher_aead_demo.c | 4 +++- programs/hash/md_hmac_demo.c | 4 +++- programs/psa/aead_demo.c | 4 +++- programs/psa/hmac_demo.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/programs/cipher/cipher_aead_demo.c b/programs/cipher/cipher_aead_demo.c index 05d1cb0c4..0cee51f7c 100644 --- a/programs/cipher/cipher_aead_demo.c +++ b/programs/cipher/cipher_aead_demo.c @@ -98,7 +98,9 @@ void print_buf( const char *title, unsigned char *buf, size_t len ) printf( "\n" ); } -/* Run an Mbed TLS function and bail out if it fails. */ +/* Run an Mbed TLS function and bail out if it fails. + * A string description of the error code can be recovered with: + * programs/util/strerror */ #define CHK( expr ) \ do \ { \ diff --git a/programs/hash/md_hmac_demo.c b/programs/hash/md_hmac_demo.c index 0f6495c86..d4cc3ccd4 100644 --- a/programs/hash/md_hmac_demo.c +++ b/programs/hash/md_hmac_demo.c @@ -77,7 +77,9 @@ void print_buf( const char *title, unsigned char *buf, size_t len ) printf( "\n" ); } -/* Run an Mbed TLS function and bail out if it fails. */ +/* Run an Mbed TLS function and bail out if it fails. + * A string description of the error code can be recovered with: + * programs/util/strerror */ #define CHK( expr ) \ do \ { \ diff --git a/programs/psa/aead_demo.c b/programs/psa/aead_demo.c index ac7bf6577..7a07d8b0c 100644 --- a/programs/psa/aead_demo.c +++ b/programs/psa/aead_demo.c @@ -100,7 +100,9 @@ void print_buf( const char *title, uint8_t *buf, size_t len ) printf( "\n" ); } -/* Run a PSA function and bail out if it fails. */ +/* Run a PSA function and bail out if it fails. + * The symbolic name of the error code can be recovered using: + * programs/psa/psa_consant_name status */ #define PSA_CHECK( expr ) \ do \ { \ diff --git a/programs/psa/hmac_demo.c b/programs/psa/hmac_demo.c index 3cb0d21dd..c6c320bdb 100644 --- a/programs/psa/hmac_demo.c +++ b/programs/psa/hmac_demo.c @@ -79,7 +79,9 @@ void print_buf( const char *title, uint8_t *buf, size_t len ) printf( "\n" ); } -/* Run a PSA function and bail out if it fails. */ +/* Run a PSA function and bail out if it fails. + * The symbolic name of the error code can be recovered using: + * programs/psa/psa_consant_name status */ #define PSA_CHECK( expr ) \ do \ { \