Preload crypto module to be tested with ieee80211_crypto_available()
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 28 Nov 2007 03:42:55 +0000 (03:42 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 28 Nov 2007 03:42:55 +0000 (03:42 +0000)
ieee80211_crypto_newkey() will fail if the crypto module for the cipher
is not loaded.  ieee80211_crypto_available() will try to load the module
first.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2987 0192ed92-7a03-0410-a25b-9323aeb14dbd

regression/ccmp/test_ccmp.c
regression/tkip/test_tkip.c
regression/wep/test_wep.c

index ac174b37b4898a81cec55f5280395d76add64c8b..3e062478e89426abf869e1f117744dbad66ae9cb 100644 (file)
@@ -589,6 +589,11 @@ runtest(struct ieee80211vap *vap, struct ciphertest *t)
 
        printk("%s: ", t->name);
 
+       if (!ieee80211_crypto_available(vap, t->cipher)) {
+               printk("FAIL: ieee80211_crypto_available failed\n");
+               return 0;
+       }
+
        /*
         * Setup key.
         */
index a793a0a2a60e2c22e7530fa5f8763508a5c99d32..4c0ad9e38f27dc6ea6d8691d65971b12e5227212 100644 (file)
@@ -161,6 +161,11 @@ tkip_test(struct ieee80211vap *vap)
        int hdrlen;
        const int keyix = 0;
 
+       if (!ieee80211_crypto_available(vap, IEEE80211_CIPHER_TKIP)) {
+               printk("FAIL: ieee80211_crypto_available failed\n");
+               return 0;
+       }
+
        /*
         * Setup key.
         */
index 5a2fed99c65e877b28bfae73273fb260adb71926..13b92795f9bc51cf22f5372f083cb3505aeec156 100644 (file)
@@ -194,6 +194,11 @@ runtest(struct ieee80211vap *vap, struct ciphertest *t)
 
        printk("%s: ", t->name);
 
+       if (!ieee80211_crypto_available(vap, t->cipher)) {
+               printk("FAIL: ieee80211_crypto_available failed\n");
+               return 0;
+       }
+
        /*
         * Setup key.
         */