* @return Returns currently assigned port number.
*/
uint16_t getAssignedPortNumber(OCTransportAdapter adapter, OCTransportFlags flag);
+
+#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
+ /**
+ * Select the cipher suite for TLS/DTLS handshake.
+ * @param cipher cipher suite (Note : Make sure endianness).
+ * 0x35 : TLS_RSA_WITH_AES_256_CBC_SHA
+ * 0xC018 : TLS_ECDH_anon_WITH_AES_128_CBC_SHA
+ * 0xC037 : TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
+ * 0xC0AE : TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
+ * @param adapter transport adapter type.
+ * @return Returns ::OC_STACK_OK if success.
+ */
+ OCStackResult setCipherSuite(const uint16_t cipher, OCTransportAdapter adapter);
+#endif // defined(__WITH_DTLS__) || defined(__WITH_TLS__)
}
}
#include "OCApi.h"
#include "CAManager.h"
#include "cautilinterface.h"
+#include "casecurityinterface.h"
using namespace OC;
{
return CAGetAssignedPortNumber((CATransportAdapter_t) adapter, (CATransportFlags_t) flag);
}
+#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
+OCStackResult CAManager::setCipherSuite(const uint16_t cipher, OCTransportAdapter adapter)
+{
+ CAResult_t ret = CASelectCipherSuite(cipher, (CATransportAdapter_t) adapter);
+ return convertCAResultToOCResult(ret);
+}
+#endif // defined(__WITH_DTLS__) || defined(__WITH_TLS__)