drivers: wifi: simplelink: Return success when TLS_PEER_VERIFY is set
mqtt_client_tls_connect() calls setsockopt() to set the TLS_PEER_VERIFY option to require verfication. To enable mqtt, we need to return success at a minimum when this option is set to 2. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
parent
7816827468
commit
017446ba20
1 changed files with 23 additions and 1 deletions
|
@ -671,8 +671,30 @@ static int simplelink_setsockopt(int sd, int level, int optname,
|
||||||
_SEC_DOMAIN_VERIF,
|
_SEC_DOMAIN_VERIF,
|
||||||
(const char *)optval, optlen);
|
(const char *)optval, optlen);
|
||||||
break;
|
break;
|
||||||
case TLS_CIPHERSUITE_LIST:
|
|
||||||
case TLS_PEER_VERIFY:
|
case TLS_PEER_VERIFY:
|
||||||
|
if (optval) {
|
||||||
|
/*
|
||||||
|
* Not currently supported. Verification
|
||||||
|
* is automatically performed if a CA
|
||||||
|
* certificate is set. We are returning
|
||||||
|
* success here to allow
|
||||||
|
* mqtt_client_tls_connect()
|
||||||
|
* to proceed, given it requires
|
||||||
|
* verification and it is indeed
|
||||||
|
* performed when the cert is set.
|
||||||
|
*/
|
||||||
|
if (*(u32_t *)optval != 2) {
|
||||||
|
retval = slcb_SetErrno(ENOTSUP);
|
||||||
|
goto exit;
|
||||||
|
} else {
|
||||||
|
retval = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
retval = slcb_SetErrno(EINVAL);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TLS_CIPHERSUITE_LIST:
|
||||||
case TLS_DTLS_ROLE:
|
case TLS_DTLS_ROLE:
|
||||||
/* Not yet supported: */
|
/* Not yet supported: */
|
||||||
retval = slcb_SetErrno(ENOTSUP);
|
retval = slcb_SetErrno(ENOTSUP);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue