Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcm0x4d <cm0x4d@codemonkey.ch>2017-09-28 11:37:24 +0300
committercm0x4d <cm0x4d@codemonkey.ch>2017-09-28 11:37:24 +0300
commit78bcc07fa9cbbcaff21c8fad95eac52174c8cbb3 (patch)
treebd5f1b17f5af6f86644fb28ab673979c135f41c7
parent462840cf6effdb35179664e4b4c95f9325bc1d73 (diff)
Peer info optional in OvsParseKeyMethod2()
-rw-r--r--src/Cedar/Interop_OpenVPN.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Cedar/Interop_OpenVPN.c b/src/Cedar/Interop_OpenVPN.c
index 801f48b9..1eb57f82 100644
--- a/src/Cedar/Interop_OpenVPN.c
+++ b/src/Cedar/Interop_OpenVPN.c
@@ -1151,14 +1151,17 @@ UINT OvsParseKeyMethod2(OPENVPN_KEY_METHOD_2 *ret, UCHAR *data, UINT size, bool
// Random2
if (ReadBuf(b, ret->Random2, sizeof(ret->Random2)) == sizeof(ret->Random2))
{
- // String
- if (OvsReadStringFromBuf(b, ret->OptionString, sizeof(ret->OptionString)) &&
- OvsReadStringFromBuf(b, ret->Username, sizeof(ret->Username)) &&
- OvsReadStringFromBuf(b, ret->Password, sizeof(ret->Password)) &&
- OvsReadStringFromBuf(b, ret->PeerInfo, sizeof(ret->PeerInfo)))
- {
- read_size = b->Current;
- }
+ // String
+ if (OvsReadStringFromBuf(b, ret->OptionString, sizeof(ret->OptionString)) &&
+ OvsReadStringFromBuf(b, ret->Username, sizeof(ret->Username)) &&
+ OvsReadStringFromBuf(b, ret->Password, sizeof(ret->Password)))
+ {
+ if (!OvsReadStringFromBuf(b, ret->PeerInfo, sizeof(ret->PeerInfo)))
+ {
+ Zero(ret->PeerInfo, sizeof(ret->PeerInfo));
+ }
+ read_size = b->Current;
+ }
}
}
}