1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-02-21 10:00:09 +03:00

Cedar: Add ProtoOptionString() in PROTO_IMPL, to generate default option values

The WireGuard implementation will have two options that should not have a fixed default value, because they represent two keys (one is preshared, the other is private).

Instead of handling these two options differently in ProtoNewContainer(), this commit adds a new function to PROTO_IMPL: ProtoOptionString().

ProtoOptionString() takes the option's name as argument and returns a heap-allocated string that will be used as value. The function returns NULL when the option doesn't need a randomized value.
This commit is contained in:
Davide Beatrici
2020-08-12 00:49:31 +02:00
parent d8aa470192
commit decfcecc97
4 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,7 @@ typedef struct PROTO_IMPL
{
const char *(*Name)();
const PROTO_OPTION *(*Options)();
char *(*OptionStringValue)(const char *name);
bool (*Init)(void **param, const LIST *options, CEDAR *cedar, INTERRUPT_MANAGER *im, SOCK_EVENT *se, const char *cipher, const char *hostname);
void (*Free)(void *param);
bool (*IsPacketForMe)(const PROTO_MODE mode, const void *data, const UINT size);