Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at password-scheme.c:178

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

md5_verify

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/password-scheme.c)expand/collapse
Show more  
 294  md5_verify(const char *plaintext, const char *user,
 295             const unsigned char *raw_password, size_t size)
 296  {
 297          const char *password, *str;
 298          const unsigned char *md5_password;
 299          size_t md5_size;
 300   
 301          password = t_strndup(raw_password, size);
 302          if (strncmp(password, "$1$", 3) == 0) {
 303                  /* MD5-CRYPT */
 304                  str = password_generate_md5_crypt(plaintext, password);
 305                  return strcmp(str, password) == 0;
 306          } else if (password_decode(password, "PLAIN-MD5",
 307[+]                                    &md5_password, &md5_size) < 0) {
expand/collapse

password_decode

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/auth/password-scheme.c)expand/collapse
Show more  
 129  int password_decode(const char *password, const char *scheme,
 130                      const unsigned char **raw_password_r, size_t *size_r)
 131  {
 132          const struct password_scheme *s;
 133          enum password_encoding encoding;
 134          buffer_t *buf;
 135          unsigned int len;
 136   
 137[+]         s = password_scheme_lookup(scheme, &encoding);
 138          if (s == NULL)
 139                  return 0;
 140   
 141          len = strlen(password);
 142          if (encoding != PW_ENCODING_NONE && s->raw_password_len != 0 &&
 143              strchr(scheme, '.') == NULL) {
 144                  /* encoding not specified. we can guess quite well between
 145                     base64 and hex encodings. the only problem is distinguishing 
 146                     2 character strings, but there shouldn't be any that short
 147                     raw_password_lens. */
 148                  encoding = len == s->raw_password_len * 2 ? PW_ENCODING_HEX :
 149                          PW_ENCODING_BASE64;
 150          }
 151   
 152          switch (encoding) {
 153          case PW_ENCODING_NONE:
 154                  *raw_password_r = (const unsigned char *)password;
 155                  *size_r = len;
 156                  break;
 157          case PW_ENCODING_HEX:
 158                  buf = buffer_create_static_hard(pool_datastack_create(),
 159                                                  len / 2 + 1);
 160                  if (hex_to_binary(password, buf) == 0) {
 161                          *raw_password_r = buf->data;
 162                          *size_r = buf->used;
 163                          break;
 164                  }
 165                  /* fall through, just in case it was base64-encoded after 
 166                     all. some input lengths produce matching hex and base64
 167                     encoded lengths. */
 168          case PW_ENCODING_BASE64:
 169                  buf = buffer_create_static_hard(pool_datastack_create(),
 170                                                  MAX_BASE64_DECODED_SIZE(len));
 171                  if (base64_decode(password, len, NULL, buf) < 0)
 172                          return -1;
 173   
 174                  *raw_password_r = buf->data;
 175                  *size_r = buf->used;
 176                  break;
 177          }
 178          if (s->raw_password_len != *size_r && s->raw_password_len != 0) {
Show more  
Show more  




Change Warning 7536.24675 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: