@@ -95,23 +95,27 @@ static int _HandleAesGcm(whServerContext* ctx, uint16_t magic,
9595static int _HandleEccKeyGen (whServerContext * ctx , uint16_t magic ,
9696 const void * cryptoDataIn , uint16_t inSize ,
9797 void * cryptoDataOut , uint16_t * outSize );
98-
98+ #ifdef HAVE_ECC_DHE
9999static int _HandleEccSharedSecret (whServerContext * ctx , uint16_t magic ,
100100 const void * cryptoDataIn , uint16_t inSize ,
101101 void * cryptoDataOut , uint16_t * outSize );
102-
102+ #endif /* HAVE_ECC_DHE */
103+ #ifdef HAVE_ECC_SIGN
103104static int _HandleEccSign (whServerContext * ctx , uint16_t magic ,
104105 const void * cryptoDataIn , uint16_t inSize ,
105106 void * cryptoDataOut , uint16_t * outSize );
106-
107+ #endif /* HAVE_ECC_SIGN */
108+ #ifdef HAVE_ECC_VERIFY
107109static int _HandleEccVerify (whServerContext * ctx , uint16_t magic ,
108110 const void * cryptoDataIn , uint16_t inSize ,
109111 void * cryptoDataOut , uint16_t * outSize );
112+ #endif /* HAVE_ECC_VERIFY */
110113#if 0
114+ #ifdef HAVE_ECC_CHECK_KEY
111115static int _HandleEccCheckPrivKey (whServerContext * server , whPacket * packet ,
112116 uint16_t * size )
117+ #endif /* HAVE_ECC_CHECK_KEY */
113118#endif
114-
115119#endif /* HAVE_ECC */
116120
117121#ifdef HAVE_CURVE25519
@@ -745,6 +749,7 @@ static int _HandleEccKeyGen(whServerContext* ctx, uint16_t magic,
745749 return ret ;
746750}
747751
752+ #ifdef HAVE_ECC_DHE
748753static int _HandleEccSharedSecret (whServerContext * ctx , uint16_t magic ,
749754 const void * cryptoDataIn , uint16_t inSize ,
750755 void * cryptoDataOut , uint16_t * outSize )
@@ -818,7 +823,9 @@ static int _HandleEccSharedSecret(whServerContext* ctx, uint16_t magic,
818823 }
819824 return ret ;
820825}
826+ #endif /* HAVE_ECC_DHE */
821827
828+ #ifdef HAVE_ECC_SIGN
822829static int _HandleEccSign (whServerContext * ctx , uint16_t magic ,
823830 const void * cryptoDataIn , uint16_t inSize ,
824831 void * cryptoDataOut , uint16_t * outSize )
@@ -885,7 +892,9 @@ static int _HandleEccSign(whServerContext* ctx, uint16_t magic,
885892 }
886893 return ret ;
887894}
895+ #endif /* HAVE_ECC_SIGN */
888896
897+ #ifdef HAVE_ECC_VERIFY
889898static int _HandleEccVerify (whServerContext * ctx , uint16_t magic ,
890899 const void * cryptoDataIn , uint16_t inSize ,
891900 void * cryptoDataOut , uint16_t * outSize )
@@ -971,8 +980,10 @@ static int _HandleEccVerify(whServerContext* ctx, uint16_t magic,
971980 }
972981 return ret ;
973982}
983+ #endif /* HAVE_ECC_VERIFY */
974984
975985#if 0
986+ #ifdef HAVE_ECC_CHECK_KEY
976987/* TODO: Implement check key */
977988static int _HandleEccCheckPrivKey (whServerContext * server , whPacket * packet ,
978989 uint16_t * size )
@@ -1007,6 +1018,7 @@ static int _HandleEccCheckPrivKey(whServerContext* server, whPacket* packet,
10071018 }
10081019 return ret ;
10091020}
1021+ #endif /* HAVE_ECC_CHECK_KEY */
10101022#endif
10111023#endif /* HAVE_ECC */
10121024
@@ -2177,19 +2189,25 @@ int wh_Server_HandleCryptoRequest(whServerContext* ctx, uint16_t magic,
21772189 _HandleEccKeyGen (ctx , magic , cryptoDataIn , cryptoInSize ,
21782190 cryptoDataOut , & cryptoOutSize );
21792191 break ;
2192+ #ifdef HAVE_ECC_DHE
21802193 case WC_PK_TYPE_ECDH :
21812194 ret = _HandleEccSharedSecret (ctx , magic , cryptoDataIn ,
21822195 cryptoInSize , cryptoDataOut ,
21832196 & cryptoOutSize );
21842197 break ;
2198+ #endif /* HAVE_ECC_DHE */
2199+ #ifdef HAVE_ECC_SIGN
21852200 case WC_PK_TYPE_ECDSA_SIGN :
21862201 ret = _HandleEccSign (ctx , magic , cryptoDataIn , cryptoInSize ,
21872202 cryptoDataOut , & cryptoOutSize );
21882203 break ;
2204+ #endif /* HAVE_ECC_SIGN */
2205+ #ifdef HAVE_ECC_VERIFY
21892206 case WC_PK_TYPE_ECDSA_VERIFY :
21902207 ret = _HandleEccVerify (ctx , magic , cryptoDataIn , cryptoInSize ,
21912208 cryptoDataOut , & cryptoOutSize );
21922209 break ;
2210+ #endif /* HAVE_ECC_VERIFY */
21932211#if 0
21942212 case WC_PK_TYPE_EC_CHECK_PRIV_KEY :
21952213 ret = _HandleEccCheckPrivKey (ctx , magic , cryptoDataIn , cryptoInSize ,
0 commit comments