Lines Matching refs:sec
302 struct libipw_security sec = { in libipw_wx_set_encode() local
347 sec.enabled = 0; in libipw_wx_set_encode()
348 sec.encrypt = 0; in libipw_wx_set_encode()
349 sec.level = SEC_LEVEL_0; in libipw_wx_set_encode()
350 sec.flags |= SEC_ENABLED | SEC_LEVEL | SEC_ENCRYPT; in libipw_wx_set_encode()
356 sec.enabled = 1; in libipw_wx_set_encode()
357 sec.encrypt = 1; in libipw_wx_set_encode()
358 sec.flags |= SEC_ENABLED | SEC_ENCRYPT; in libipw_wx_set_encode()
398 memcpy(sec.keys[key], keybuf, erq->length); in libipw_wx_set_encode()
400 memset(sec.keys[key] + erq->length, 0, in libipw_wx_set_encode()
403 key, len, sec.keys[key], in libipw_wx_set_encode()
405 sec.key_sizes[key] = len; in libipw_wx_set_encode()
407 (*crypt)->ops->set_key(sec.keys[key], len, NULL, in libipw_wx_set_encode()
409 sec.flags |= (1 << key); in libipw_wx_set_encode()
412 if (key == sec.active_key) in libipw_wx_set_encode()
413 sec.flags |= SEC_ACTIVE_KEY; in libipw_wx_set_encode()
417 len = (*crypt)->ops->get_key(sec.keys[key], WEP_KEY_LEN, in libipw_wx_set_encode()
423 memset(sec.keys[key], 0, 13); in libipw_wx_set_encode()
424 (*crypt)->ops->set_key(sec.keys[key], 13, NULL, in libipw_wx_set_encode()
426 sec.key_sizes[key] = 13; in libipw_wx_set_encode()
427 sec.flags |= (1 << key); in libipw_wx_set_encode()
435 sec.active_key = key; in libipw_wx_set_encode()
436 sec.flags |= SEC_ACTIVE_KEY; in libipw_wx_set_encode()
441 sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : in libipw_wx_set_encode()
443 sec.flags |= SEC_AUTH_MODE; in libipw_wx_set_encode()
445 sec.auth_mode == WLAN_AUTH_OPEN ? in libipw_wx_set_encode()
451 sec.flags |= SEC_LEVEL; in libipw_wx_set_encode()
452 sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */ in libipw_wx_set_encode()
453 sec.encode_alg[key] = SEC_ALG_WEP; in libipw_wx_set_encode()
457 ieee->set_security(dev, &sec); in libipw_wx_set_encode()
468 struct libipw_security *sec = &ieee->sec; in libipw_wx_get_encode() local
482 if (!sec->enabled) { in libipw_wx_get_encode()
488 len = sec->key_sizes[key]; in libipw_wx_get_encode()
489 memcpy(keybuf, sec->keys[key], len); in libipw_wx_get_encode()
515 struct libipw_security sec = { in libipw_wx_set_encodeext() local
540 sec.flags |= SEC_ENABLED | SEC_ENCRYPT; in libipw_wx_set_encodeext()
551 sec.enabled = 0; in libipw_wx_set_encodeext()
552 sec.encrypt = 0; in libipw_wx_set_encodeext()
553 sec.level = SEC_LEVEL_0; in libipw_wx_set_encodeext()
554 sec.flags |= SEC_LEVEL; in libipw_wx_set_encodeext()
559 sec.enabled = 1; in libipw_wx_set_encodeext()
560 sec.encrypt = 1; in libipw_wx_set_encodeext()
631 sec.active_key = idx; in libipw_wx_set_encodeext()
632 sec.flags |= SEC_ACTIVE_KEY; in libipw_wx_set_encodeext()
638 memcpy(sec.keys[idx], ext->key, key_len); in libipw_wx_set_encodeext()
639 sec.key_sizes[idx] = key_len; in libipw_wx_set_encodeext()
640 sec.flags |= (1 << idx); in libipw_wx_set_encodeext()
642 sec.encode_alg[idx] = SEC_ALG_WEP; in libipw_wx_set_encodeext()
643 sec.flags |= SEC_LEVEL; in libipw_wx_set_encodeext()
644 sec.level = SEC_LEVEL_1; in libipw_wx_set_encodeext()
646 sec.encode_alg[idx] = SEC_ALG_TKIP; in libipw_wx_set_encodeext()
647 sec.flags |= SEC_LEVEL; in libipw_wx_set_encodeext()
648 sec.level = SEC_LEVEL_2; in libipw_wx_set_encodeext()
650 sec.encode_alg[idx] = SEC_ALG_CCMP; in libipw_wx_set_encodeext()
651 sec.flags |= SEC_LEVEL; in libipw_wx_set_encodeext()
652 sec.level = SEC_LEVEL_3; in libipw_wx_set_encodeext()
656 sec.flags &= ~SEC_LEVEL; in libipw_wx_set_encodeext()
660 ieee->set_security(dev, &sec); in libipw_wx_set_encodeext()
671 struct libipw_security *sec = &ieee->sec; in libipw_wx_get_encodeext() local
694 if (!sec->enabled) { in libipw_wx_get_encodeext()
699 if (sec->encode_alg[idx] == SEC_ALG_WEP) in libipw_wx_get_encodeext()
701 else if (sec->encode_alg[idx] == SEC_ALG_TKIP) in libipw_wx_get_encodeext()
703 else if (sec->encode_alg[idx] == SEC_ALG_CCMP) in libipw_wx_get_encodeext()
708 ext->key_len = sec->key_sizes[idx]; in libipw_wx_get_encodeext()
709 memcpy(ext->key, sec->keys[idx], ext->key_len); in libipw_wx_get_encodeext()