(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ismacryp.c) |
| |
| 420 | | | static offset_struct* ( tvbuff_t *tvb, offset_struct *poffset, packet_info *pinfo, proto_tree *ismacryp_tree, guint set_version ) |
| 421 | | | { |
| 422 | | | proto_item *ismacryp_item; |
| 423 | | | proto_tree *; |
| 424 | | | proto_tree *; |
| 425 | | | |
| 426 | | | guint16 = 0; |
| 427 | | | gint = 0; |
| 428 | | | gint cts_flag =0; |
| 429 | | | gint dts_flag =0; |
| 430 | | | gboolean first_au_flag=FALSE; |
| 431 | | | gint bit_offset = 0; |
| 432 | | | |
| 433 | | | |
| 434 | | | |
| 435 | | | switch (set_version) { |
| 436 | | | case V11: |
| 437 | | | if (selective_encryption) |
| 438 | | | +=8; |
| 439 | | | break; |
| 440 | | | case V20: |
| 441 | | | if (selective_encryption || slice_indication || padding_indication) |
| 442 | | | +=8; |
| 443 | | | break; |
| 444 | | | default: |
| 445 | | | DISSECTOR_ASSERT_NOT_REACHED();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
131 | #define DISSECTOR_ASSERT_NOT_REACHED() \ |
132 | (REPORT_DISSECTOR_BUG( \ |
133 | ep_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \ |
134 | __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 446 | | | break; |
| 447 | | | } |
| 448 | | | +=au_size_length; |
| 449 | | | |
| 450 | | | if (poffset->offset_bytes==){ |
| 451 | | | +=8*(iv_length); |
| 452 | | | +=8*key_indicator_length; |
| 453 | | | +=au_index_length; |
| 454 | | | first_au_flag = TRUE; |
| 455 | | | } |
| 456 | | | else { |
| 457 | | | if (key_indicator_per_au_flag == TRUE) |
| 458 | | | +=8*key_indicator_length; |
| 459 | | | +=8*(delta_iv_length); |
| 460 | | | +=au_index_delta_length; |
| 461 | | | } |
| 462 | | | |
| 463 | | | if (cts_delta_length != 0){ |
| 464 | | | cts_flag=tvb_get_bits8(tvb, *8+, 1); |
| 465 | | | +=1; |
| 466 | | | if (cts_flag==1) |
| 467 | | | +=cts_delta_length; |
| 468 | | | } |
| 469 | | | |
| 470 | | | if (dts_delta_length != 0){ |
| 471 | | | dts_flag=tvb_get_bits8(tvb, *8+, 1); |
| 472 | | | +=1; |
| 473 | | | if (dts_flag==1) |
| 474 | | | +=dts_delta_length; |
| 475 | | | } |
| 476 | | | |
| 477 | | | if (random_access_indication != FALSE) |
| 478 | | | +=1; |
| 479 | | | |
| 480 | | | |
| 481 | | | if (stream_state_indication !=0) |
| 482 | | | +=stream_state_indication; |
| 483 | | | |
| 484 | | | |
| 485 | | | if (% 8!=0) |
| 486 | | | { |
| 487 | | | =(()/8)+1; |
| 488 | | | } |
| 489 | | | else |
| 490 | | | =(()/8); |
| 491 | | | |
| 492 | | | |
| 493 | | | ismacryp_item = proto_tree_add_item(ismacryp_tree, , tvb, poffset->offset_bytes, , FALSE ); |
| 494 | | | proto_item_append_text(ismacryp_item, ": Length=%d bits", ); |
| 495 | | | |
| 496 | | | if ( == 0) |
| 497 | | | { |
| 498 | | | proto_item_append_text(ismacryp_item, " Error - zero bit AU size - check parameters!"); |
| 499 | | | } |
| 500 | | | = proto_item_add_subtree(ismacryp_item, ); |
| 501 | | | |
| 502 | | | |
| 503 | | | |
| 504 | | | |
| 505 | | | |
| 506 | | | |
| 507 | | | if ((set_version==V20 && (selective_encryption || slice_indication || padding_indication)) |
| 508 | | | || (set_version==V11 && selective_encryption)){ |
| 509 | | | |
| 510 | | | |
| 511 | | | ismacryp_item = proto_tree_add_item(, , |
| 512 | | | tvb, poffset->offset_bytes, 1, FALSE ); |
| 513 | | | proto_item_append_text(ismacryp_item, ": Length=8 bits"); |
| 514 | | | = proto_item_add_subtree(ismacryp_item, ); |
| 515 | | | |
| 516 | | | |
| 517 | | | |
| 518 | | | |
| 519 | | | add_bits(poffset,7); |
| 520 | | | |
| 521 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 522 | | | if (selective_encryption){ |
| 523 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_au_is_encrypted, |
| 524 | | | tvb, bit_offset, 1, FALSE); |
| 525 | | | } |
| 526 | | | else { |
| 527 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_unused_bits, |
| 528 | | | tvb, bit_offset, 1, FALSE); |
| 529 | | | } |
| 530 | | | switch (set_version){ |
| 531 | | | case V11: |
| 532 | | | |
| 533 | | | add_bits(poffset, -7); |
| 534 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 535 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_reserved_bits, |
| 536 | | | tvb, bit_offset, 7, FALSE); |
| 537 | | | add_bits(poffset,8); |
| 538 | | | break; |
| 539 | | | case V20: |
| 540 | | | |
| 541 | | | add_bits(poffset, -1); |
| 542 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 543 | | | if (slice_indication){ |
| 544 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_slice_start, |
| 545 | | | tvb, bit_offset, 1, FALSE); |
| 546 | | | } |
| 547 | | | else { |
| 548 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_unused_bits, |
| 549 | | | tvb, bit_offset, 1, FALSE); |
| 550 | | | } |
| 551 | | | add_bits(poffset, -1); |
| 552 | | | |
| 553 | | | |
| 554 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 555 | | | if (slice_indication){ |
| 556 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_slice_end, |
| 557 | | | tvb, bit_offset, 1, FALSE); |
| 558 | | | } |
| 559 | | | else { |
| 560 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_unused_bits, |
| 561 | | | tvb, bit_offset, 1, FALSE); |
| 562 | | | } |
| 563 | | | add_bits(poffset, -3); |
| 564 | | | |
| 565 | | | |
| 566 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 567 | | | if (padding_indication){ |
| 568 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_padding_bitcount, |
| 569 | | | tvb, bit_offset, 3, FALSE); |
| 570 | | | } |
| 571 | | | else { |
| 572 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_unused_bits, |
| 573 | | | tvb, bit_offset, 3, FALSE); |
| 574 | | | } |
| 575 | | | add_bits(poffset, -2); |
| 576 | | | |
| 577 | | | |
| 578 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 579 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_reserved_bits, |
| 580 | | | tvb, bit_offset, 2, FALSE); |
| 581 | | | add_bits(poffset,8); |
| 582 | | | break; |
| 583 | | | default: |
| 584 | | | DISSECTOR_ASSERT_NOT_REACHED();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
131 | #define DISSECTOR_ASSERT_NOT_REACHED() \ |
132 | (REPORT_DISSECTOR_BUG( \ |
133 | ep_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \ |
134 | __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 585 | | | break; |
Unreachable Control Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 586 | | | } |
| 587 | | | } |
| 588 | | | |
| 589 | | | if (first_au_flag == TRUE && iv_length != 0) |
| 590 | | | { |
| 591 | | | ismacryp_item = proto_tree_add_item(, hf_ismacryp_iv, tvb, poffset->offset_bytes, iv_length, FALSE); |
| 592 | | | proto_item_append_text(ismacryp_item, ": Length=%d bytes",iv_length); |
| 593 | | | if ( check_col( pinfo->cinfo, COL_INFO) ) { |
| 594 | | | col_append_fstr( pinfo->cinfo, COL_INFO, |
| 595 | | | ", IV=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, iv_length,' ')); |
| 596 | | | } |
| 597 | | | poffset->offset_bytes+=iv_length; |
| 598 | | | } |
| 599 | | | |
| 600 | | | if (first_au_flag == FALSE && delta_iv_length != 0) |
| 601 | | | { |
| 602 | | | ismacryp_item = proto_tree_add_item(, hf_ismacryp_delta_iv, |
| 603 | | | tvb, poffset->offset_bytes, delta_iv_length, FALSE); |
| 604 | | | proto_item_append_text(ismacryp_item, ": Length=%d bytes",delta_iv_length); |
| 605 | | | if ( check_col( pinfo->cinfo, COL_INFO) ) { |
| 606 | | | col_append_fstr( pinfo->cinfo, COL_INFO, |
| 607 | | | ", Delta IV=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, delta_iv_length,' ')); |
| 608 | | | } |
| 609 | | | poffset->offset_bytes+=iv_length; |
| 610 | | | } |
| 611 | | | |
| 612 | | | if ( key_indicator_length != 0 && ( first_au_flag == TRUE || key_indicator_per_au_flag == TRUE) ) |
| 613 | | | { |
| 614 | | | |
| 615 | | | ismacryp_item = proto_tree_add_item(, hf_ismacryp_key_indicator, |
| 616 | | | tvb, poffset->offset_bytes, key_indicator_length, FALSE); |
| 617 | | | proto_item_append_text(ismacryp_item,": Length=%d bytes",key_indicator_length); |
| 618 | | | if ( check_col( pinfo->cinfo, COL_INFO) ) { |
| 619 | | | col_append_fstr( pinfo->cinfo, COL_INFO, |
| 620 | | | ", KI=0x%s", tvb_bytes_to_str_punct(tvb, poffset->offset_bytes, key_indicator_length,' ')); |
| 621 | | | } |
| 622 | | | poffset->offset_bytes+=key_indicator_length; |
| 623 | | | } |
| 624 | | | |
| 625 | | | if (au_size_length != 0) |
| 626 | | | { |
| 627 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 628 | | | ismacryp_item = proto_tree_add_bits_item(,hf_ismacryp_au_size, |
| 629 | | | tvb, bit_offset, au_size_length, FALSE); |
| 630 | | | proto_item_append_text(ismacryp_item, " bytes: Length=%d bits",au_size_length); |
| 631 | | | bit_offset+=au_size_length; |
| 632 | | | add_bits(poffset, au_size_length); |
| 633 | | | } |
| 634 | | | |
| 635 | | | if (first_au_flag == TRUE && au_index_length != 0) |
| 636 | | | { |
| 637 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 638 | | | ismacryp_item = proto_tree_add_bits_item(,hf_ismacryp_au_index, |
| 639 | | | tvb, bit_offset, au_index_length, FALSE); |
| 640 | | | proto_item_append_text(ismacryp_item, " bits: Length=%d bits",au_index_length); |
| 641 | | | bit_offset+=au_index_length; |
| 642 | | | add_bits(poffset, au_index_length); |
| 643 | | | } |
| 644 | | | |
| 645 | | | if (first_au_flag == FALSE && au_index_delta_length != 0) |
| 646 | | | { |
| 647 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 648 | | | ismacryp_item = proto_tree_add_bits_item(,hf_ismacryp_au_index_delta, |
| 649 | | | tvb, bit_offset, au_index_delta_length, FALSE); |
| 650 | | | proto_item_append_text(ismacryp_item, ": Length=%d bits", au_index_delta_length); |
| 651 | | | bit_offset+=au_index_delta_length; |
| 652 | | | add_bits(poffset, au_index_delta_length); |
| 653 | | | } |
| 654 | | | |
| 655 | | | if (cts_delta_length != 0) |
| 656 | | | { |
| 657 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 658 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_cts_flag, |
| 659 | | | tvb, bit_offset, 1, FALSE); |
| 660 | | | add_bits(poffset, 1); |
| 661 | | | if (cts_flag==1) |
| 662 | | | { |
| 663 | | | |
| 664 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 665 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_cts_delta, |
| 666 | | | tvb, bit_offset, cts_delta_length, FALSE); |
| 667 | | | proto_item_append_text(ismacryp_item, ": Length=%d bits",cts_delta_length); |
| 668 | | | add_bits(poffset, cts_delta_length); |
| 669 | | | } |
| 670 | | | } |
| 671 | | | |
| 672 | | | if (dts_delta_length != 0) |
| 673 | | | { |
| 674 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 675 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_dts_flag, |
| 676 | | | tvb, bit_offset, 1, FALSE); |
| 677 | | | add_bits(poffset, 1); |
| 678 | | | |
| 679 | | | |
| 680 | | | if (dts_flag ==1) |
| 681 | | | { |
| 682 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 683 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_dts_delta, |
| 684 | | | tvb, bit_offset, dts_delta_length, FALSE); |
| 685 | | | proto_item_append_text(ismacryp_item, ": Length=%d bits",dts_delta_length); |
| 686 | | | add_bits(poffset, dts_delta_length); |
| 687 | | | } |
| 688 | | | } |
| 689 | | | |
| 690 | | | if (random_access_indication != FALSE) |
| 691 | | | { |
| 692 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 693 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_rap_flag, |
| 694 | | | tvb, bit_offset, 1, FALSE); |
| 695 | | | add_bits(poffset, 1); |
| 696 | | | } |
| 697 | | | |
| 698 | | | if (stream_state_indication != 0) |
| 699 | | | { |
| 700 | | | bit_offset = (poffset->offset_bytes)*8+poffset->offset_bits; |
| 701 | | | ismacryp_item = proto_tree_add_bits_item(, hf_ismacryp_stream_state, |
| 702 | | | tvb, bit_offset, stream_state_indication, FALSE); |
| 703 | | | add_bits(poffset, stream_state_indication); |
| 704 | | | } |
| 705 | | | |
| 706 | | | return poffset; |
| 707 | | | } |
| |