Only "string" can have "encrypt=2"
authorAlan T. DeKok <aland@freeradius.org>
Wed, 19 Oct 2011 15:20:37 +0000 (17:20 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 19 Oct 2011 15:31:29 +0000 (17:31 +0200)
src/lib/dict.c

index 065adca..8ca426c 100644 (file)
@@ -1284,6 +1284,13 @@ static int process_attribute(const char* fn, const int line,
                                                    fn, line, key);
                                        return -1;
                                }
+
+                               if ((flags.encrypt == FLAG_ENCRYPT_ASCEND_SECRET) &&
+                                   (type != PW_TYPE_STRING)) {
+                                       fr_strerror_printf( "dict_init: %s[%d] Only \"string\" types can have the \"encrypt=2\" flag set.",
+                                                           fn, line);
+                                       return -1;
+                               }
                                
                        } else if (strncmp(key, "array", 6) == 0) {
                                flags.array = 1;