static int valid_md5 ( char *  val  )  [static]

Determine if a string containing an MD5 hash is valid.

Definition at line 91 of file config.c.

00092 {
00093         int i;
00094 
00095         if (val[0] == '\0')
00096                 return (0);
00097         
00098         for (i = 0; i < 32; i++) {
00099                 /* Silently convert hash to lowercase */
00100                 val[i] = g_ascii_tolower(val[i]);
00101 
00102                 if (!g_ascii_isxdigit(val[i]))
00103                         /* Invalid character found */
00104                         return (-1);
00105         }
00106 
00107         if (val[i] != '\0')
00108                 /* String too long */
00109                 return (-1);
00110 
00111         return (0);
00112 }

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:07 2010 for herrie by  doxygen 1.6.3