]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add "secret" flag to attribute
authorAlan T. DeKok <aland@freeradius.org>
Mon, 22 Mar 2021 19:39:33 +0000 (15:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 22 Mar 2021 19:57:32 +0000 (15:57 -0400)
so we can not print it.  Sometimes.  Maybe.

src/include/libradius.h
src/lib/dict.c

index 48844be4acd24efca40823cdd66102c6b65743bf..c82dc7ed03dfefff20c4b8bbc7b0be0dcee37a83 100644 (file)
@@ -197,6 +197,8 @@ typedef struct attr_flags {
 
        unsigned int    is_dup : 1;                             //!< is a duplicate of another attribute
 
+       unsigned int    secret : 1;                             //!< is a secret thingy
+
        uint8_t         encrypt;                                //!< Ecryption method.
        uint8_t         length;
 } ATTR_FLAGS;
index 339b255122b9ab283563087910bae9a1d3002f2a..cc2624afaab5dd422814fc45ea587edd959a0772 100644 (file)
@@ -883,6 +883,8 @@ int dict_addattr(char const *name, int attr, unsigned int vendor, PW_TYPE type,
                return -1;
        }
 
+       if (flags.encrypt) flags.secret = 1;
+
        if (flags.length && (type != PW_TYPE_OCTETS)) {
                fr_strerror_printf("The \"length\" flag can only be set for attributes of type \"octets\"");
                return -1;
@@ -1755,6 +1757,10 @@ static int process_attribute(char const* fn, int const line,
                                                           "\"encrypt=3\" flag set", fn, line);
                                        return -1;
                                }
+                               flags.secret = 1;
+
+                       } else if (strncmp(key, "secret", 6) == 0) {
+                               flags.secret = 1;
 
                        } else if (strncmp(key, "array", 6) == 0) {
                                flags.array = 1;