Rework SCTP auth pipeline to allow dynamic key change
The SCTP key sharing mechanism won't be using a file to communicate
the active authentication key anymore as we will be receiving
it directly into message bridge through an AOS channel instead.
Change-Id: I46e079b98cbb6a0ed52fca36c67f7fa724ba249c
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/sctp_client.h b/aos/network/sctp_client.h
index c6b6324..06f6b15 100644
--- a/aos/network/sctp_client.h
+++ b/aos/network/sctp_client.h
@@ -5,6 +5,7 @@
#include <cstdlib>
#include <string_view>
+#include "absl/types/span.h"
#include "glog/logging.h"
#include "aos/network/sctp_lib.h"
@@ -18,7 +19,7 @@
public:
SctpClient(std::string_view remote_host, int remote_port, int streams,
std::string_view local_host = "0.0.0.0", int local_port = 9971,
- std::vector<uint8_t> sctp_auth_key = {});
+ SctpAuthMethod requested_authentication = SctpAuthMethod::kNoAuth);
~SctpClient() {}
@@ -61,6 +62,10 @@
sctp_.FreeMessage(std::move(message));
}
+ void SetAuthKey(absl::Span<const uint8_t> auth_key) {
+ sctp_.SetAuthKey(auth_key);
+ }
+
private:
struct sockaddr_storage sockaddr_remote_;
struct sockaddr_storage sockaddr_local_;