forked from wolfSSL/wolfssl
QSH (quantum-safe handshake) extension
This commit is contained in:
68
src/ssl.c
68
src/ssl.c
@@ -777,6 +777,58 @@ int wolfSSL_CTX_UseSupportedCurve(WOLFSSL_CTX* ctx, word16 name)
|
||||
#endif /* NO_WOLFSSL_CLIENT */
|
||||
#endif /* HAVE_SUPPORTED_CURVES */
|
||||
|
||||
/* QSH quantum safe handshake */
|
||||
#ifdef HAVE_QSH
|
||||
/* returns 1 if QSH has been used 0 otherwise */
|
||||
int wolfSSL_isQSH(WOLFSSL* ssl)
|
||||
{
|
||||
/* if no ssl struct than QSH was not used */
|
||||
if (ssl == NULL)
|
||||
return 0;
|
||||
|
||||
return ssl->isQSH;
|
||||
}
|
||||
|
||||
|
||||
int wolfSSL_UseSupportedQSH(WOLFSSL* ssl, word16 name)
|
||||
{
|
||||
if (ssl == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
switch (name) {
|
||||
#ifdef HAVE_NTRU
|
||||
case WOLFSSL_NTRU_EESS439:
|
||||
case WOLFSSL_NTRU_EESS593:
|
||||
case WOLFSSL_NTRU_EESS743:
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
ssl->user_set_QSHSchemes = 1;
|
||||
|
||||
return TLSX_UseQSHScheme(&ssl->extensions, name, NULL, 0);
|
||||
}
|
||||
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
/* user control over sending client public key in hello
|
||||
when flag = 1 will send keys if flag is 0 or function is not called
|
||||
then will not send keys in the hello extension
|
||||
return 0 on success
|
||||
*/
|
||||
int wolfSSL_UseClientQSHKeys(WOLFSSL* ssl, unsigned char flag)
|
||||
{
|
||||
if (ssl == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
ssl->sendQSHKeys = flag;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* NO_WOLFSSL_CLIENT */
|
||||
#endif /* HAVE_QSH */
|
||||
|
||||
/* Secure Renegotiation */
|
||||
#ifdef HAVE_SECURE_RENEGOTIATION
|
||||
|
||||
@@ -9819,19 +9871,9 @@ const char* wolfSSL_CIPHER_get_name(const WOLFSSL_CIPHER* cipher)
|
||||
case TLS_RSA_WITH_RABBIT_SHA :
|
||||
return "TLS_RSA_WITH_RABBIT_SHA";
|
||||
#endif
|
||||
#ifdef HAVE_NTRU
|
||||
#ifndef NO_RC4
|
||||
case TLS_NTRU_RSA_WITH_RC4_128_SHA :
|
||||
return "TLS_NTRU_RSA_WITH_RC4_128_SHA";
|
||||
#endif
|
||||
#ifndef NO_DES3
|
||||
case TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA :
|
||||
return "TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
#endif
|
||||
case TLS_NTRU_RSA_WITH_AES_128_CBC_SHA :
|
||||
return "TLS_NTRU_RSA_WITH_AES_128_CBC_SHA";
|
||||
case TLS_NTRU_RSA_WITH_AES_256_CBC_SHA :
|
||||
return "TLS_NTRU_RSA_WITH_AES_256_CBC_SHA";
|
||||
#ifdef HAVE_QSH
|
||||
case TLS_QSH :
|
||||
return "TLS_QSH";
|
||||
#endif /* HAVE_NTRU */
|
||||
#endif /* NO_SHA */
|
||||
case TLS_RSA_WITH_AES_128_GCM_SHA256 :
|
||||
|
||||
Reference in New Issue
Block a user