Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
NetworkManager-openvpn
nm-openvpn-fix-openvpn-ciphers-list.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nm-openvpn-fix-openvpn-ciphers-list.patch of Package NetworkManager-openvpn
From 214a996329435792b3bbc8d02933e52ce5e9b46f Mon Sep 17 00:00:00 2001 From: Beniamino Galvani <bgalvani@redhat.com> Date: Fri, 2 Dec 2016 22:27:49 +0100 Subject: [PATCH] properties: skip comments from openvpn ciphers list We already skip the first comment block of the 'openvpn --show-ciphers' output before the first empty line. However, there can be another comment block followed by other ciphers, for example: ~ $ openvpn --show-ciphers The following ciphers and cipher modes are available for use with OpenVPN. Each cipher shown below may be used as a parameter to the --cipher option. The default key size is shown as well as whether or not it can be changed with the --keysize directive. Using a CBC mode is recommended. In static key mode only CBC mode is allowed. AES-128-CBC (128 bit key, 128 bit block) AES-128-CFB (128 bit key, 128 bit block, TLS client/server mode only) The following ciphers have a block size of less than 128 bits, and are therefore deprecated. Do not use unless you have to. BF-CBC (128 bit key by default, 64 bit block) BF-CFB (128 bit key by default, 64 bit block, TLS client/server mode only) ~ $ Basically, each empty line toggles between comments and ciphers. Implement this. --- properties/auth-helpers.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c index 31df8d5..e8a4562 100644 --- a/properties/auth-helpers.c +++ b/properties/auth-helpers.c @@ -1003,7 +1003,7 @@ populate_cipher_combo (GtkComboBox *box, const char *user_cipher) gboolean user_added = FALSE; char *argv[3]; GError *error = NULL; - gboolean success, found_blank = FALSE; + gboolean success, ignore_lines = TRUE; openvpn_binary = nm_find_openvpn (); if (!openvpn_binary) @@ -1042,15 +1042,21 @@ populate_cipher_combo (GtkComboBox *box, const char *user_cipher) g_free (tmp); for (item = items; *item; item++) { - char *space = strchr (*item, ' '); + char *space; - /* Don't add anything until after the first blank line */ - if (!found_blank) { - if (!strlen (*item)) - found_blank = TRUE; + /* Don't add anything until after the first blank line. Also, + * any blank line indicates the start of a comment, ended by + * another blank line. + */ + if (!strlen (*item)) { + ignore_lines = !ignore_lines; continue; } + if (ignore_lines) + continue; + + space = strchr (*item, ' '); if (space) *space = '\0'; -- 2.21.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor