]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more secret checks
authorAlan T. DeKok <aland@freeradius.org>
Wed, 8 Mar 2023 21:38:31 +0000 (16:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 8 Mar 2023 21:38:31 +0000 (16:38 -0500)
src/listen/bfd/proto_bfd.c

index ede04ea7c66ed87d511e8301b1853aa764b0fe25..dfd6d15b29b571f3b8dfddee57fbb3a26b12f8ed 100644 (file)
@@ -500,6 +500,11 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
                                break;
 
                        case BFD_AUTH_SIMPLE:
+                               if (!c->secret) {
+                                       cf_log_err(cs, "A 'secret' must be specified when using 'auth_type = simple'");
+                                       goto error;
+                               }
+
                                if (strlen(c->secret) > 16) {
                                        cf_log_err(cs, "Length of 'secret' must be no more than 16 octets for 'auth_type = simple'");
                                        goto error;
@@ -510,6 +515,11 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx)
                                 *      Secrets can be any length.
                                 */
                        default:
+                               if (!c->secret) {
+                                       cf_log_err(cs, "A 'secret' must be specified when using 'auth_type = ...'");
+                                       goto error;
+                               }
+
                                break;
 
                        }