~ubuntu-branches/ubuntu/gutsy/wireshark/gutsy-security

« back to all changes in this revision

Viewing changes to epan/dissectors/packet-ipsec.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2007-04-01 08:58:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070401085840-or3qhrpv8alt1bwg
Tags: 0.99.5-1
* New upstream release.
* debian/patches/09_idl2wrs.dpatch: updated to patch idl2wrs.sh.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* packet-ipsec.c
2
2
 * Routines for IPsec/IPComp packet disassembly
3
3
 *
4
 
 * $Id: packet-ipsec.c 19486 2006-10-10 22:46:58Z gerald $
 
4
 * $Id: packet-ipsec.c 19714 2006-10-27 10:16:22Z martinm $
5
5
 *
6
6
 * Wireshark - Network traffic analyzer
7
7
 * By Gerald Combs <gerald@wireshark.org>
688
688
   Params:
689
689
      - char *sa : the Security Association in char *
690
690
      - guint index_start : the index to start to find the protocol type
691
 
      - gint *pt_protocol_typ : the protocl type found. Either IPv4, Either IPv6 (IPSEC_SA_IPV4, IPSEC_SA_IPV6)
 
691
      - gint *pt_protocol_typ : the protocol type found. Either IPv4 or IPv6 (IPSEC_SA_IPV4, IPSEC_SA_IPV6)
692
692
      - guint *index_end : the last index of the protocol type
693
693
*/
694
694
#ifdef HAVE_LIBGCRYPT
720
720
 
721
721
  *index_end = IPSEC_TYP_LEN + index_start + 1;
722
722
 
723
 
g_warning("For %s returning %d, %c, %d", sa, *pt_protocol_typ, sa[*index_end], *index_end);
 
723
/* g_warning("For %s returning %d, %c, %d", sa, *pt_protocol_typ, sa[*index_end], *index_end); */
724
724
  return done_flag;
725
725
}
726
726
#endif
1879
1879
 
1880
1880
              if(g_esp_enable_encryption_decode)
1881
1881
                {
1882
 
                  /* Desactivation of the Heuristic to decrypt using the NULL encryption algorithm since the packet is matching a SA */
 
1882
                  /* Deactivation of the Heuristic to decrypt using the NULL encryption algorithm since the packet is matching a SA */
1883
1883
                  null_encryption_decode_heuristic = FALSE;
1884
1884
 
1885
1885
                  switch(esp_crypt_algo)
1915
1915
 
1916
1916
                            if (esp_crypt_key_len != gcry_cipher_get_algo_keylen (crypt_algo_libgcrypt))
1917
1917
                              {
1918
 
                                fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm 3DES-CBC : Bad Keylen (%i Bits)\n",esp_crypt_key_len * 8);
1919
 
                                decrypt_ok = FALSE;
 
1918
                                fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm 3DES-CBC : Bad Keylen (got %i Bits, need %i)\n",
 
1919
                                         esp_crypt_key_len * 8, gcry_cipher_get_algo_keylen (crypt_algo_libgcrypt) * 8);
 
1920
                                decrypt_ok = FALSE;
1920
1921
                              }
1921
1922
                            else
1922
1923
                              decrypt_using_libgcrypt = TRUE;
1971
1972
                                }
1972
1973
                              default:
1973
1974
                                {
1974
 
                                  fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm AES-CBC : Bad Keylen (%i Bits)\n",esp_crypt_key_len * 8);
 
1975
                                  fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm AES-CBC : Bad Keylen (%i Bits)\n",
 
1976
                                           esp_crypt_key_len * 8);
1975
1977
                                  decrypt_ok = FALSE;
1976
1978
                                }
1977
1979
                              }
2006
2008
 
2007
2009
                            if (esp_crypt_key_len != gcry_cipher_get_algo_keylen (crypt_algo_libgcrypt))
2008
2010
                              {
2009
 
                                fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm DES-CBC : Bad Keylen (%i Bits)\n",esp_crypt_key_len * 8);
 
2011
                                fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm DES-CBC : Bad Keylen (%i Bits, need %i)\n",
 
2012
                                         esp_crypt_key_len * 8, gcry_cipher_get_algo_keylen (crypt_algo_libgcrypt) * 8);
2010
2013
                                decrypt_ok = FALSE;
2011
2014
                              }
2012
2015
                            else
2150
2153
 
2151
2154
                            if (esp_crypt_key_len != gcry_cipher_get_algo_keylen (crypt_algo_libgcrypt))
2152
2155
                              {
2153
 
                                fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm BLOWFISH-CBC : Bad Keylen (%i Bits)\n",esp_crypt_key_len * 8);
 
2156
                                fprintf (stderr,"<ESP Preferences> Error in Encryption Algorithm BLOWFISH-CBC : Bad Keylen (%i Bits, need %i)\n",
 
2157
                                        esp_crypt_key_len * 8, gcry_cipher_get_algo_keylen (crypt_algo_libgcrypt) * 8);
2154
2158
                                decrypt_ok = FALSE;
2155
2159
                              }
2156
2160
                            else
2680
2684
 
2681
2685
      PREF_STR_INIT();
2682
2686
      g_string_sprintf(name_str, "encryption_key_%d", i + 1);
2683
 
      g_string_sprintf(title_str, "Encryption Key #", i + 1);
 
2687
      g_string_sprintf(title_str, "Encryption Key #%d", i + 1);
2684
2688
 
2685
2689
      prefs_register_string_preference(esp_module, name_str->str, title_str->str,
2686
2690
                        "Encryption key. May be ASCII or hexadecimal (if "