From: "cron2 (Code Review)" Date: Mon, 2 Mar 2026 21:55:23 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., selva.nair@...277..., openvpn-devel@lists.sourceforge.net Message-ID: <207538d9823f26b55183eb7d691355c46d7da5c6-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="zv1mOZGipsQ="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Document management client versions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: selvanair Cc: plaisthos , openvpn-devel --zv1mOZGipsQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/15= 52?usp=3Demail ) Change subject: Document management client versions ...................................................................... Document management client versions Also add an enum to keep track of client version updates. Change-Id: I1c01fa1bc7d65ac060b334724feb56ef4d0b5d35 Signed-off-by: Selva Nair Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1552 Message-Id: <20260302141811.5697-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 805.html Signed-off-by: Gert Doering --- M doc/management-notes.txt M src/openvpn/manage.c 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/doc/management-notes.txt b/doc/management-notes.txt index 86b74f3..41e2a91 100644 --- a/doc/management-notes.txt +++ b/doc/management-notes.txt @@ -496,6 +496,10 @@ version. This was fixed starting version 4: clients should expect "SUCCESS: .. " message only when setting the version to >=3D 4. +Minimum client version required for certain features is listed below: + >PK_SIGN:[base64] -- version 2 or greater + >PK_SIGN:[base64],[alg] -- version 3 or greater + COMMAND -- auth-retry --------------------- diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index 03ff5b3..d26c9b2 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -61,6 +61,17 @@ /* tag for blank username/password */ static const char blank_up[] =3D "[[BLANK]]"; +/* + * Management client versions indicating feature support in client. + * Append new values as needed but do not change exisiting ones. + */ +enum mcv +{ + MCV_DEFAULT =3D 1, + MCV_PKSIGN =3D 2, + MCV_PKSIGN_ALG =3D 3, +}; + struct management *management; /* GLOBAL */ /* static forward declarations */ @@ -1333,8 +1344,8 @@ if (version) { man->connection.client_version =3D atoi(version); - /* Prior to version 3, we missed to respond to this command. Ackno= wledge only if version >=3D 4 */ - if (man->connection.client_version >=3D 4) + /* Until MCV_PKSIGN_ALG, we missed to respond to this command. Ack= nowledge only if version is newer */ + if (man->connection.client_version > MCV_PKSIGN_ALG) { msg(M_CLIENT, "SUCCESS: Management client version set to %d", = man->connection.client_version); } @@ -2656,7 +2667,7 @@ man->connection.es =3D event_set_init(&maxevents, EVENT_METHOD= _FAST); } - man->connection.client_version =3D 1; /* default version */ + man->connection.client_version =3D MCV_DEFAULT; /* default version= */ /* * Listen/connect socket @@ -3776,14 +3787,14 @@ const char *desc =3D "pk-sign"; struct buffer buf_data =3D alloc_buf(strlen(b64_data) + strlen(algorit= hm) + 20); - if (man->connection.client_version <=3D 1) + if (man->connection.client_version <=3D MCV_DEFAULT) { prompt =3D "RSA_SIGN"; desc =3D "rsa-sign"; } buf_write(&buf_data, b64_data, (int)strlen(b64_data)); - if (man->connection.client_version > 2) + if (man->connection.client_version >=3D MCV_PKSIGN_ALG) { buf_write(&buf_data, ",", (int)strlen(",")); buf_write(&buf_data, algorithm, (int)strlen(algorithm)); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1552?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I1c01fa1bc7d65ac060b334724feb56ef4d0b5d35 Gerrit-Change-Number: 1552 Gerrit-PatchSet: 3 Gerrit-Owner: selvanair Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --zv1mOZGipsQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

Document management client versions

Also = add an enum to keep track of client version updates.

Change-Id: I1c0= 1fa1bc7d65ac060b334724feb56ef4d0b5d35
Signed-off-by: Selva Nair <selv= a.nair@...277...>
Acked-by: Arne Schwabe <arne-openvpn@...1227...&= gt;
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1552
Message-I= d: <20260302141811.5697-1-gert@...1296...>
URL: https://www.mail-a= rchive.com/openvpn-devel@lists.sourceforge.net/msg35805.html
Signed-off-= by: Gert Doering <gert@...1296...>
---
M doc/management-notes.t= xt
M src/openvpn/manage.c
2 files changed, 20 insertions(+), 5 deleti= ons(-)

diff --git a/doc/management-notes.txt b/doc/management-notes.txt<=
br>index 86b74f3..41e2a91 100644
--- a/doc/management= -notes.txt
+++ b/doc/management-notes.txt
@= @ -496,6 +496,10 @@
version. This was fixed starting versi= on 4: clients should expect
"SUCCESS: .. " messa= ge only when setting the version to >=3D 4.

= +Minimum client version require= d for certain features is listed below:
+ >PK_SIGN:[base64] -- version 2 or grea= ter
+ >PK_SIGN:= [base64],[alg] -- version 3 or greater
+
COMMAND -- auth-retry
---------------------

diff --git a/s= rc/openvpn/manage.c b/src/openvpn/manage.c
index 03ff5b3..d= 26c9b2 100644
--- a/src/openvpn/manage.c
++= + b/src/openvpn/manage.c
@@ -61,6 +61,17 @@
/* tag for blank username/password */
static const char = blank_up[] =3D "[[BLANK]]";

+/*
+ * Management client versions indicating feature support= in client.
+ * Appen= d new values as needed but do not change exisiting ones.
+ */
+enum mcv
+{
+ MCV_= DEFAULT =3D 1,
+ M= CV_PKSIGN =3D 2,
+ = MCV_PKSIGN_ALG =3D 3,
+
struct management *management; /* GLOBAL */
/* static forward declarations */
@@ -1333,8 +1344,= 8 @@
if (version)
{
man->connection.client_version =3D atoi(version);
= - /* Prior to version 3, w= e missed to respond to this command. Acknowledge only if version >=3D 4 = */
- if (man->= ;connection.client_version >=3D 4)
+ /* Until MCV_PKSIGN_ALG, we missed to respond to = this command. Acknowledge only if version is newer */
+ if (man->connection.client_ver= sion > MCV_PKSIGN_ALG)
{
= msg(M_CLIENT, "SUCCESS: Management client version set to %d&quo= t;, man->connection.client_version);
}@@ -2656,7 +2667,7 @@
man->connecti= on.es =3D event_set_init(&maxevents, EVENT_METHOD_FAST);
}

- man->connection.client_version =3D 1; /* default versio= n */
+ man->= ;connection.client_version =3D MCV_DEFAULT; /* default version */
/*
* Listen/con= nect socket
@@ -3776,14 +3787,14 @@
co= nst char *desc =3D "pk-sign";
struct buffer = buf_data =3D alloc_buf(strlen(b64_data) + strlen(algorithm) + 20);
- if (man-= >connection.client_version <=3D 1)
+ if (man->connection.client_version <=3D MCV_= DEFAULT)
{
prompt =3D "R= SA_SIGN";
desc =3D "rsa-sign";

}

buf_write(&bu= f_data, b64_data, (int)strlen(b64_data));
- if (man->connection.client_version > 2)

+ if (man->connectio= n.client_version >=3D MCV_PKSIGN_ALG)
{
<= span> buf_write(&buf_data, ",", (int)strlen(",&q= uot;));
buf_write(&buf_data, algorithm, (int)s= trlen(algorithm));

To view, visit change 1552. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1c01fa1bc7d65ac060b334724fe= b56ef4d0b5d35
Gerrit-Change-Number: 1552
Gerrit-PatchSet: 3
Gerrit-Owner: selvanair <selva.nair@...1354...= ..>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --zv1mOZGipsQ=--