Skip to content

Commit fd72b88

Browse files
Merge pull request #6592 from embhorn/zd16415
Fix Micrium config and new examples with NO_FILESYSTEM
2 parents 0b18e25 + d84adce commit fd72b88

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

examples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,9 @@ and
8484
This directory contains example wolfSSL configuration file templates for use when autoconf is not available, such as building with a custom IDE.
8585

8686
See [configs/README.md](configs/README.md) for more details.
87+
88+
## asn1
89+
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`.
90+
91+
## pem
92+
This directory contains an example of converting to/from PEM and DER. Configure wolfSSL with `--enable-coding`

examples/asn1/asn1.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
#include <wolfssl/wolfcrypt/asn_public.h>
3131
#include <wolfssl/wolfcrypt/coding.h>
3232
#include <wolfssl/wolfcrypt/error-crypt.h>
33+
#include <stdio.h>
3334

34-
#ifdef WOLFSSL_ASN_PRINT
35+
#if defined(WOLFSSL_ASN_PRINT) && !defined(NO_FILESYSTEM)
3536

3637
/* Increment allocated data by this much. */
3738
#define DATA_INC_LEN 256
@@ -485,9 +486,9 @@ int main(int argc, char* argv[])
485486
{
486487
(void)argc;
487488
(void)argv;
488-
fprintf(stderr, "ASN.1 Parsing and Printing not compiled in.\n");
489+
fprintf(stderr, "ASN.1 Parsing and Printing or file system not compiled"
490+
" in.\n");
489491
return 0;
490492
}
491493

492-
#endif /* WOLFSSL_ASN_PRINT */
493-
494+
#endif /* WOLFSSL_ASN_PRINT && !defined(NO_FILESYSTEM)*/

examples/pem/pem.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
#ifdef DEBUG_WOLFSSL
3636
#include <wolfssl/wolfcrypt/logging.h>
3737
#endif
38+
#include <stdio.h>
3839

39-
#ifdef WOLFSSL_PEM_TO_DER
40+
#if defined(WOLFSSL_PEM_TO_DER) && !defined(NO_FILESYSTEM)
4041

4142
/* Increment allocated data by this much. */
4243
#define DATA_INC_LEN 256
@@ -1034,9 +1035,9 @@ int main(int argc, char* argv[])
10341035
{
10351036
(void)argc;
10361037
(void)argv;
1037-
fprintf(stderr, "PEM to DER conversion not compiled in.\n");
1038+
fprintf(stderr, "PEM to DER conversion of file system support not compiled"
1039+
" in.\n");
10381040
return 0;
10391041
}
10401042

1041-
#endif /* WOLFSSL_PEM_TO_DER */
1042-
1043+
#endif /* WOLFSSL_PEM_TO_DER && !NO_FILESYSTEM */

wolfssl/wolfcrypt/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,7 @@ extern void uITRON4_free(void *p) ;
15351535
#ifdef MICRIUM
15361536
#include <stdlib.h>
15371537
#include <os.h>
1538+
#include <app_cfg.h>
15381539
#if defined(RTOS_MODULE_NET_AVAIL) || (APP_CFG_TCPIP_EN == DEF_ENABLED)
15391540
#include <net_cfg.h>
15401541
#include <net_sock.h>

0 commit comments

Comments
 (0)