mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
dco-win: fix broken ASSERT in dco_new_key
Commit
e77c343 ("dco_win: In dco_new_key, document size assumptions for the integer casts")
has added an ASSERT on key-id, but didn't take into account that
key-id 0 is a perfectly valid value and is the first key-id. This
essentially broke dco-win.
Fix by adjusting ASSERT to >= 0.
Change-Id: I3b1243461ec9b6e85897f452f78dc4b05f7e126d
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1223
Message-Id: <20250929152841.177424-1-frank@lichtenheld.com>
URL: https://sourceforge.net/p/openvpn/mailman/message/59240115/
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
36a09c8dbf
commit
290a14cd9e
1 changed files with 1 additions and 1 deletions
|
|
@ -541,7 +541,7 @@ dco_new_key(dco_context_t *dco, unsigned int peerid, int keyid, dco_key_slot_t s
|
|||
ZeroMemory(&crypto_data, sizeof(crypto_data));
|
||||
|
||||
crypto_data.CipherAlg = dco_get_cipher(ciphername);
|
||||
ASSERT(keyid > 0 && keyid <= UCHAR_MAX);
|
||||
ASSERT(keyid >= 0 && keyid <= UCHAR_MAX);
|
||||
crypto_data.KeyId = (unsigned char)keyid;
|
||||
crypto_data.PeerId = peerid;
|
||||
crypto_data.KeySlot = slot;
|
||||
|
|
|
|||
Loading…
Reference in a new issue