diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2013-04-17 19:38:34 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2013-04-17 19:38:34 +0000 |
commit | 1093faf64315edd18c452ea6774ef4b704029368 (patch) | |
tree | 4f578b42620cce10cd9c1c5f37e89c6ba5c3c35e /airpcap_loader.c | |
parent | 0ef40a6145a9415ce68ec582d7506fcae7c3d960 (diff) |
From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8446 Wifi details are not stored in the Decryption Key Management dialog (post 1.8.x)
If there is not 80211_keys file, using Decryption Management Key don't create the file and keys is not saved.
From me:
Use a err2 variable to avoid to break API/ABI when backport to 1.8
svn path=/trunk/; revision=48900
Diffstat (limited to 'airpcap_loader.c')
-rw-r--r-- | airpcap_loader.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/airpcap_loader.c b/airpcap_loader.c index f2b2d891ce..16801e31b3 100644 --- a/airpcap_loader.c +++ b/airpcap_loader.c @@ -249,7 +249,8 @@ set_wep_key(pref_t *pref, gpointer ud _U_) keys_cb_data_t* user_data; uat_t *uat; gint i; - char* err = NULL; + const char* err = NULL; + char* err2 = NULL; uat_wep_key_record_t uat_key; decryption_key_t* new_key; @@ -260,10 +261,16 @@ set_wep_key(pref_t *pref, gpointer ud _U_) if (g_ascii_strcasecmp(pref->name, "wep_key_table") == 0 && pref->type == PREF_UAT) { uat = (uat_t *)pref->varp.uat; - /* UAT must be loaded */ if (!uat->loaded) - return 1; + { + /* UAT will only be loaded if previous keys exist, so it may need + to be loaded now */ + uat_load(uat, &err); + if (err != NULL) + return 1; + uat->loaded = 1; + } /* Free the old records */ uat_clear(uat); @@ -276,8 +283,8 @@ set_wep_key(pref_t *pref, gpointer ud _U_) uat_add_record(uat, &uat_key); } - uat_save(uat, &err); - if (err != NULL) + uat_save(uat, &err2); + if (err2 != NULL) return 1; } |