Skip to contentSkip to conversation

ssl_verify: define label only when required

PATCH Superseded Antonio Quartulli 1 participant 3 messages Aug 15, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ssl_verify: define label only when required

The "cleanup" label in ssl_verify.c:verify_user_pass_plugin() is used only when PLUGIN_DEF_AUTH is defined, therefore make the label definition dependent on the same define.

At the moment, gcc throws an error for unused label if PLUGIN_DEF_AUTH is not defined.

---
 src/openvpn/ssl_verify.c | 2 ++
 1 file changed, 2 insertions(+)
src/openvpn/ssl_verify.c +2 -0
index 61872251..9dfe23f8 100644
@@ -1220,7 +1220,9 @@ verify_user_pass_plugin(struct tls_session *session, const struct user_pass *up,
         msg(D_TLS_ERRORS, "TLS Auth Error (verify_user_pass_plugin): peer provided a blank username");
     }
 
+#ifdef PLUGIN_DEF_AUT
 cleanup:
+#endif
     return retval;
 }
 
Signature · 1 line
2.18.0
#1 lore raw

Hi,

Quoted 17 lines · Antonio Quartulli

The "cleanup" label in ssl_verify.c:verify_user_pass_plugin() is used only when PLUGIN_DEF_AUTH is defined, therefore make the label definition dependent on the same define.

At the moment, gcc throws an error for unused label if PLUGIN_DEF_AUTH is not defined.

---
 src/openvpn/ssl_verify.c | 2 ++
 1 file changed, 2 insertions(+)
src/openvpn/ssl_verify.c +0 -0
index 61872251..9dfe23f8 100644

src/openvpn/ssl_verify.c verify_user_pass_plugin(struct tls_session *session, const struct user_pass *up, · line 1228

Quoted 9 lines
src/openvpn/ssl_verify.c +2 -0
@@ -1220,7 +1220,9 @@ verify_user_pass_plugin(struct tls_session *session, const struct user_pass *up,
         msg(D_TLS_ERRORS, "TLS Auth Error (verify_user_pass_plugin): peer provided a blank username");
     }
 
+#ifdef PLUGIN_DEF_AUT
 cleanup:
+#endif
     return retval;
 }
 

Not sure which gcc version is being used on Gitlab-CI, but my jobs are failing with:

ssl_verify.c:1197:13: error: label 'cleanup' used but not defined

             goto cleanup;
             ^~~~

Makefile:680: recipe for target 'ssl_verify.o' failed make[3]: *** [ssl_verify.o] Error 1

It seems this is not just a warning anymore.

Regards,

Signature · 1 line
Antonio Quartulli
#2 lore raw
Quoted 34 lines · Antonio Quartulli

Hi,

Quoted 17 lines · Antonio Quartulli

The "cleanup" label in ssl_verify.c:verify_user_pass_plugin() is used only when PLUGIN_DEF_AUTH is defined, therefore make the label definition dependent on the same define.

At the moment, gcc throws an error for unused label if PLUGIN_DEF_AUTH is not defined.

---
 src/openvpn/ssl_verify.c | 2 ++
 1 file changed, 2 insertions(+)
src/openvpn/ssl_verify.c +0 -0
index 61872251..9dfe23f8 100644

src/openvpn/ssl_verify.c verify_user_pass_plugin(struct tls_session *session, const struct user_pass *up, · line 1228

Quoted 9 lines
src/openvpn/ssl_verify.c +2 -0
@@ -1220,7 +1220,9 @@ verify_user_pass_plugin(struct tls_session *session, const struct user_pass *up,
         msg(D_TLS_ERRORS, "TLS Auth Error (verify_user_pass_plugin): peer provided a blank username");
     }
 
+#ifdef PLUGIN_DEF_AUT
 cleanup:
+#endif
     return retval;
 }
 

Not sure which gcc version is being used on Gitlab-CI, but my jobs are failing with:

Quoted 7 lines

ssl_verify.c:1197:13: error: label 'cleanup' used but not defined

             goto cleanup;
             ^~~~

Makefile:680: recipe for target 'ssl_verify.o' failed make[3]: *** [ssl_verify.o] Error 1

It seems this is not just a warning anymore.

Sorry, I acted before being fully awake.

This is obviously not a warning because it tries to use a label that does not exist...

Indeed my patch is wrong and I messed it up.

Forget about this. I'll send a proper v2.

Cheers,

Signature · 1 line
Antonio Quartulli