Text   |  XML   |  ReML   |   Visible Warnings:

Unreasonable Size Argument  at crypt-sha1.c:251

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

snmp_usm_auth_sha1

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-snmp.c)expand/collapse
Show more  
 1280  static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_auth_len_p,  gchar const** error _U_) {
 1281          guint msg_len;
 1282          guint8* msg;
 1283          guint auth_len;
 1284          guint8* auth;
 1285          guint8* key;
 1286          guint key_len;
 1287          guint8 *calc_auth;
 1288          guint start;
 1289          guint end;
 1290          guint i;
 1291   
 1292          if (!p->auth_tvb) {
 1293                  *error = "No Authenticator";
 1294                  return FALSE;
 1295          }
 1296   
 1297          key = p->user_assoc->user.authKey.data;
 1298          key_len = p->user_assoc->user.authKey.len;
 1299   
 1300          if (! key ) {
 1301                  *error = "User has no authKey";
 1302                  return FALSE;
 1303          }
 1304   
 1305   
 1306[+]         auth_len = tvb_length_remaining(p->auth_tvb,0);
 1307   
 1308   
 1309          if (auth_len != 12) {
 1310                  *error = "Authenticator length wrong";
 1311                  return FALSE;
 1312          }
 1313   
 1314[+]         msg_len = tvb_length_remaining(p->msg_tvb,0);
 1315          msg = ep_tvb_memdup(p->msg_tvb,0,msg_len);
 1316   
 1317          auth = ep_tvb_memdup(p->auth_tvb,0,auth_len);
 1318   
 1319          start = p->auth_offset - p->start_offset;
 1320          end =   start + auth_len;
 1321   
 1322          /* fill the authenticator with zeros */
 1323          for ( i = start ; i < end ; i++ ) {
 1324                  msg[i] = '\0';
 1325          }
 1326   
 1327          calc_auth = ep_alloc(20);
 1328   
 1329[+]         sha1_hmac(key, key_len, msg, msg_len, calc_auth);
expand/collapse

sha1_hmac

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/crypt/crypt-sha1.c)expand/collapse
Show more  
 296  void sha1_hmac( const guint8 *key, guint32 keylen, const guint8 *buf, guint32 buflen,
 297                  guint8 digest[20] )
 298  {
 299      guint32 i;
 300      sha1_context ctx;
 301      guint8 k_ipad[64];
 302      guint8 k_opad[64];
 303      guint8 tmpbuf[20];
 304   
 305      memset( k_ipad, 0x36, 64 );
 306      memset( k_opad, 0x5C, 64 );
 307   
 308      for( i = 0; i < keylen; i++ )
 309      {
 310          if( i >= 64 ) break;
 311   
 312          k_ipad[i] ^= key[i];
 313          k_opad[i] ^= key[i];
 314      }
 315   
 316      sha1_starts( &ctx );
 317      sha1_update( &ctx, k_ipad, 64 );
 318[+]     sha1_update( &ctx, buf, buflen );
expand/collapse

sha1_update

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/crypt/crypt-sha1.c)expand/collapse
Show more  
 216  void sha1_update( sha1_context *ctx, const guint8 *input, guint32 length )
 217  {
 218      guint32 left, fill;
 219   
 220      if( ! length ) return;
 221   
 222      left = ctx->total[0] & 0x3F;
 223      fill = 64 - left;
 224   
 225      ctx->total[0] += length;
 226      ctx->total[0] &= 0xFFFFFFFF;
 227   
 228      if( ctx->total[0] < length )
 229          ctx->total[1]++;
 230   
 231      if( left && length >= fill )
 232      {
 233          memcpy( (void *) (ctx->buffer + left),
 234                  (const void *) input, fill );
 235          sha1_process( ctx, ctx->buffer );
 236          length -= fill;
 237          input  += fill;
 238          left = 0;
 239      }
 240   
 241      while( length >= 64 )
 242      {
 243          sha1_process( ctx, input );
 244          length -= 64;
 245          input  += 64;
 246      }
 247   
 248      if( length )
 249      {
 250          memcpy( (void *) (ctx->buffer + left),
 251                  (const void *) input, length );
Show more  
Show more  
Show more  




Change Warning 1642.30863 : Unreasonable Size Argument

Priority:
State:
Finding:
Owner:
Note: