diff --git a/src/Cedar/Proto.c b/src/Cedar/Proto.c index 7023e4c7..d626b9b9 100644 --- a/src/Cedar/Proto.c +++ b/src/Cedar/Proto.c @@ -291,7 +291,7 @@ PROTO_CONTAINER *ProtoContainerNew(const PROTO_IMPL *impl) option->Bool = impl_option->Bool; break; case PROTO_OPTION_STRING: - option->String = CopyStr(impl_option->String); + option->String = impl_option->String != NULL ? CopyStr(impl_option->String) : impl->OptionStringValue(option->Name); break; default: Debug("ProtoContainerNew(): unhandled option type %u!\n", impl_option->Type); diff --git a/src/Cedar/Proto.h b/src/Cedar/Proto.h index e0714cab..e14ceced 100644 --- a/src/Cedar/Proto.h +++ b/src/Cedar/Proto.h @@ -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); diff --git a/src/Cedar/Proto_OpenVPN.c b/src/Cedar/Proto_OpenVPN.c index a801c4b1..d844ea90 100644 --- a/src/Cedar/Proto_OpenVPN.c +++ b/src/Cedar/Proto_OpenVPN.c @@ -20,6 +20,7 @@ const PROTO_IMPL *OvsGetProtoImpl() { OvsName, OvsOptions, + NULL, OvsInit, OvsFree, OvsIsPacketForMe, diff --git a/src/Cedar/Proto_SSTP.c b/src/Cedar/Proto_SSTP.c index 514ddeda..6c69fb11 100644 --- a/src/Cedar/Proto_SSTP.c +++ b/src/Cedar/Proto_SSTP.c @@ -13,6 +13,7 @@ const PROTO_IMPL *SstpGetProtoImpl() { SstpName, SstpOptions, + NULL, SstpInit, SstpFree, NULL,