Postgres code for SSO (almost certainly needs work)

This commit is contained in:
Adam Ierymenko 2021-05-28 17:08:24 -04:00
parent 198e6f765c
commit c470c6255e
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
6 changed files with 102 additions and 13 deletions

View file

@ -466,14 +466,6 @@ EmbeddedNetworkController::EmbeddedNetworkController(Node *node,const char *ztPa
_db(this),
_rc(rc)
{
memset(_ssoPsk, 0, sizeof(_ssoPsk));
char *const ssoPskHex = getenv("ZT_SSO_PSK");
if (ssoPskHex) {
// SECURITY: note that ssoPskHex will always be null-terminated if libc acatually
// returns something non-NULL. If the hex encodes something shorter than 48 bytes,
// it will be padded at the end with zeroes. If longer, it'll be truncated.
Utils::unhex(ssoPskHex, _ssoPsk, sizeof(_ssoPsk));
}
}
EmbeddedNetworkController::~EmbeddedNetworkController()