Skip to content

Commit

Permalink
Fix Micrium config and new examples with NO_FILESYSTEM
Browse files Browse the repository at this point in the history
  • Loading branch information
embhorn committed Jul 10, 2023
1 parent 9f6ef65 commit d84adce
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ and
This directory contains example wolfSSL configuration file templates for use when autoconf is not available, such as building with a custom IDE.

See [configs/README.md](configs/README.md) for more details.

## asn1
This directory contains an example that prints the ASN.1 data of a BER/DER or PEM encoded file. Configure wolfSSL with `--enable-asn-print`.

## pem
This directory contains an example of converting to/from PEM and DER. Configure wolfSSL with `--enable-coding`
9 changes: 5 additions & 4 deletions examples/asn1/asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
#include <wolfssl/wolfcrypt/asn_public.h>
#include <wolfssl/wolfcrypt/coding.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <stdio.h>

#ifdef WOLFSSL_ASN_PRINT
#if defined(WOLFSSL_ASN_PRINT) && !defined(NO_FILESYSTEM)

/* Increment allocated data by this much. */
#define DATA_INC_LEN 256
Expand Down Expand Up @@ -485,9 +486,9 @@ int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
fprintf(stderr, "ASN.1 Parsing and Printing not compiled in.\n");
fprintf(stderr, "ASN.1 Parsing and Printing or file system not compiled"
" in.\n");
return 0;
}

#endif /* WOLFSSL_ASN_PRINT */

#endif /* WOLFSSL_ASN_PRINT && !defined(NO_FILESYSTEM)*/
9 changes: 5 additions & 4 deletions examples/pem/pem.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
#ifdef DEBUG_WOLFSSL
#include <wolfssl/wolfcrypt/logging.h>
#endif
#include <stdio.h>

#ifdef WOLFSSL_PEM_TO_DER
#if defined(WOLFSSL_PEM_TO_DER) && !defined(NO_FILESYSTEM)

/* Increment allocated data by this much. */
#define DATA_INC_LEN 256
Expand Down Expand Up @@ -1034,9 +1035,9 @@ int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
fprintf(stderr, "PEM to DER conversion not compiled in.\n");
fprintf(stderr, "PEM to DER conversion of file system support not compiled"
" in.\n");
return 0;
}

#endif /* WOLFSSL_PEM_TO_DER */

#endif /* WOLFSSL_PEM_TO_DER && !NO_FILESYSTEM */
1 change: 1 addition & 0 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,7 @@ extern void uITRON4_free(void *p) ;
#ifdef MICRIUM
#include <stdlib.h>
#include <os.h>
#include <app_cfg.h>
#if defined(RTOS_MODULE_NET_AVAIL) || (APP_CFG_TCPIP_EN == DEF_ENABLED)
#include <net_cfg.h>
#include <net_sock.h>
Expand Down

0 comments on commit d84adce

Please sign in to comment.