2525#define WOLFSSH_TEST_CLIENT
2626
2727#include <wolfssh/ssh.h>
28+ #include <wolfssh/internal.h>
2829#include <wolfssh/test.h>
2930#ifdef WOLFSSH_AGENT
3031 #include <wolfssh/agent.h>
@@ -197,7 +198,7 @@ static word32 userPrivateKeyTypeSz = 0;
197198static byte isPrivate = 0 ;
198199
199200
200- #ifndef NO_RSA
201+ #ifndef WOLFSSH_NO_RSA
201202static const char * hanselPublicRsa =
202203 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9P3ZFowOsONXHD5MwWiCciXytBRZGho"
203204 "MNiisWSgUs5HdHcACuHYPi2W6Z1PBFmBWT9odOrGRjoZXJfDDoPi+j8SSfDGsc/hsCmc3G"
@@ -311,8 +312,8 @@ static const unsigned int hanselPrivateRsaSz = 1191;
311312#endif
312313
313314
314- #ifdef HAVE_ECC
315- #ifndef NO_ECC256
315+ #ifndef WOLFSSH_NO_ECC
316+ #ifndef WOLFSSH_NO_ECDSA_SHA2_NISTP256
316317static const char * hanselPublicEcc =
317318 "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAA"
318319 "BBBNkI5JTP6D0lF42tbxX19cE87hztUS6FSDoGvPfiU0CgeNSbI+aFdKIzTP5CQEJSvm25"
@@ -331,7 +332,7 @@ static const byte hanselPrivateEcc[] = {
331332 0xf9
332333};
333334static const unsigned int hanselPrivateEccSz = 121 ;
334- #elif defined(HAVE_ECC521 )
335+ #elif ! defined(WOLFSSH_NO_ECDSA_SHA2_NISTP521 )
335336static const char * hanselPublicEcc =
336337 "ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAA"
337338 "CFBAET/BOzBb9Jx9b52VIHFP4g/uk5KceDpz2M+/Ln9WiDjsMfb4NgNCAB+EMNJUX/TNBL"
@@ -553,7 +554,7 @@ static THREAD_RET readInput(void* in)
553554 return THREAD_RET_SUCCESS ;
554555 }
555556 }
556- #if defined(HAVE_ECC ) && defined(FP_ECC ) && defined(HAVE_THREAD_LS )
557+ #if ! defined(WOLFSSH_NO_ECC ) && defined(FP_ECC ) && defined(HAVE_THREAD_LS )
557558 wc_ecc_fp_free (); /* free per thread cache */
558559#endif
559560 return THREAD_RET_SUCCESS ;
@@ -674,7 +675,7 @@ static THREAD_RET readPeer(void* in)
674675 }
675676 wc_UnLockMutex (& args -> lock );
676677 }
677- #if defined(HAVE_ECC ) && defined(FP_ECC ) && defined(HAVE_THREAD_LS )
678+ #if ! defined(WOLFSSH_NO_ECC ) && defined(FP_ECC ) && defined(HAVE_THREAD_LS )
678679 wc_ecc_fp_free (); /* free per thread cache */
679680#endif
680681
@@ -924,7 +925,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
924925 if (username == NULL )
925926 err_sys ("client requires a username parameter." );
926927
927- #ifdef NO_RSA
928+ #ifdef WOLFSSH_NO_RSA
928929 userEcc = 1 ;
929930#endif
930931
@@ -939,14 +940,14 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
939940
940941 if (privKeyName == NULL ) {
941942 if (userEcc ) {
942- #ifdef HAVE_ECC
943+ #ifndef WOLFSSH_NO_ECC
943944 ret = wolfSSH_ReadKey_buffer (hanselPrivateEcc , hanselPrivateEccSz ,
944945 WOLFSSH_FORMAT_ASN1 , & userPrivateKey , & userPrivateKeySz ,
945946 & userPrivateKeyType , & userPrivateKeyTypeSz , NULL );
946947 #endif
947948 }
948949 else {
949- #ifndef NO_RSA
950+ #ifndef WOLFSSH_NO_RSA
950951 ret = wolfSSH_ReadKey_buffer (hanselPrivateRsa , hanselPrivateRsaSz ,
951952 WOLFSSH_FORMAT_ASN1 , & userPrivateKey , & userPrivateKeySz ,
952953 & userPrivateKeyType , & userPrivateKeyTypeSz , NULL );
@@ -974,15 +975,15 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
974975 userPublicKeySz = sizeof (userPublicKeyBuf );
975976
976977 if (userEcc ) {
977- #ifdef HAVE_ECC
978+ #ifndef WOLFSSH_NO_ECC
978979 ret = wolfSSH_ReadKey_buffer ((const byte * )hanselPublicEcc ,
979980 (word32 )strlen (hanselPublicEcc ), WOLFSSH_FORMAT_SSH ,
980981 & p , & userPublicKeySz ,
981982 & userPublicKeyType , & userPublicKeyTypeSz , NULL );
982983 #endif
983984 }
984985 else {
985- #ifndef NO_RSA
986+ #ifndef WOLFSSH_NO_RSA
986987 ret = wolfSSH_ReadKey_buffer ((const byte * )hanselPublicRsa ,
987988 (word32 )strlen (hanselPublicRsa ), WOLFSSH_FORMAT_SSH ,
988989 & p , & userPublicKeySz ,
@@ -1169,7 +1170,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
11691170 if (privKeyName != NULL && userPrivateKey != NULL ) {
11701171 WFREE (userPrivateKey , NULL , DYNTYPE_PRIVKEY );
11711172 }
1172- #if defined(HAVE_ECC ) && defined(FP_ECC ) && defined(HAVE_THREAD_LS )
1173+ #if ! defined(WOLFSSH_NO_ECC ) && defined(FP_ECC ) && defined(HAVE_THREAD_LS )
11731174 wc_ecc_fp_free (); /* free per thread cache */
11741175#endif
11751176
0 commit comments