diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-11-01 05:25:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-11-01 05:25:51 +0000 |
commit | f230b6efa98415f5afbd97e3da12e9f4cb5e6f7d (patch) | |
tree | 9dd425452f7f8eb122c682c584824e10cb458962 | |
parent | 0e0457d405819b55d6314768902de2a625215fc8 (diff) |
bye bye wpa-psk. instead of using ifconfig wpapsk `wpa-psk password` you
can now simply use ifconfig wpakey password
ok damien
-rw-r--r-- | sbin/Makefile | 4 | ||||
-rw-r--r-- | sbin/wpa-psk/Makefile | 10 | ||||
-rw-r--r-- | sbin/wpa-psk/wpa-psk.8 | 74 | ||||
-rw-r--r-- | sbin/wpa-psk/wpa-psk.c | 69 |
4 files changed, 2 insertions, 155 deletions
diff --git a/sbin/Makefile b/sbin/Makefile index e13bbf5e900..c73a4f0468b 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.92 2010/06/07 08:39:43 reyk Exp $ +# $OpenBSD: Makefile,v 1.93 2010/11/01 05:25:49 deraadt Exp $ SUBDIR= atactl badsect bioctl ccdconfig clri dhclient \ disklabel dmesg dump dumpfs fdisk fsck fsck_ext2fs fsck_ffs \ @@ -10,6 +10,6 @@ SUBDIR= atactl badsect bioctl ccdconfig clri dhclient \ nfsd nologin pdisk pfctl pflogd ping ping6 quotacheck \ raidctl reboot restore route rtsol savecore scan_ffs \ scsi shutdown slattach swapctl sysctl ttyflags tunefs \ - umount wpa-psk wsconsctl + umount wsconsctl .include <bsd.subdir.mk> diff --git a/sbin/wpa-psk/Makefile b/sbin/wpa-psk/Makefile deleted file mode 100644 index ce41ada6bfb..00000000000 --- a/sbin/wpa-psk/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2008/07/22 07:37:25 djm Exp $ - -.PATH: ${.CURDIR}/../bioctl -CFLAGS+=-Wall -I${.CURDIR}/../bioctl - -PROG= wpa-psk -MAN= wpa-psk.8 -SRCS= wpa-psk.c pbkdf2.c - -.include <bsd.prog.mk> diff --git a/sbin/wpa-psk/wpa-psk.8 b/sbin/wpa-psk/wpa-psk.8 deleted file mode 100644 index 22bf4441162..00000000000 --- a/sbin/wpa-psk/wpa-psk.8 +++ /dev/null @@ -1,74 +0,0 @@ -.\" $OpenBSD: wpa-psk.8,v 1.3 2010/08/27 07:50:38 jmc Exp $ -.\" -.\" Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.Dd $Mdocdate: August 27 2010 $ -.Dt WPA-PSK 8 -.Os -.Sh NAME -.Nm wpa-psk -.Nd passphrase to WPA pre-shared key mapping -.Sh SYNOPSIS -.Nm -.Ar ssid -.Ar passphrase -.Sh DESCRIPTION -.Nm -generates a 256-bit pre-shared key from a service set identifier (SSID) and -a passphrase. -The passphrase must be a sequence of between 8 and 63 ASCII-encoded -characters. -The length of the SSID must be between 1 and 32 octets. -.Pp -.Nm -prints the generated pre-shared key to stdout as a series of 64 hexadecimal -digits preceded by -.So 0x Sc . -The output is intended to be passed to -.Xr ifconfig 8 -via the -.Cm wpapsk -option. -The -.Ar ssid -parameter should be the same as the -.Ar nwid -parameter passed to -.Xr ifconfig 8 -via the -.Cm nwid -option. -.Pp -To generate the pre-shared key, -.Nm -uses the Password-Based Key Derivation Function 2 (PBKDF2). -The passphrase is hashed 4096 times using HMAC-SHA1. -.Sh SEE ALSO -.Xr ifconfig 8 -.Rs -.%R IEEE Std 802.11i -.%T Medium Access Control (MAC) Security Enhancements -.%D 2004 -.Re -.Rs -.%R PKCS #5 v2.0 -.%T Password-Based Cryptography Standard -.%D 1999 -.Re -.Rs -.%R RFC 3174 -.%T US Secure Hash Algorithm 1 (SHA1) -.%D 2001 -.Re diff --git a/sbin/wpa-psk/wpa-psk.c b/sbin/wpa-psk/wpa-psk.c deleted file mode 100644 index 060324ec8e9..00000000000 --- a/sbin/wpa-psk/wpa-psk.c +++ /dev/null @@ -1,69 +0,0 @@ -/* $OpenBSD: wpa-psk.c,v 1.3 2008/07/22 07:37:25 djm Exp $ */ - -/*- - * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <net80211/ieee80211.h> -#include <crypto/sha1.h> - -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <err.h> - -#include "pbkdf2.h" - -int -main(int argc, char **argv) -{ - extern char *__progname; - const char *pass, *ssid; - u_int len, ssid_len; - u_int8_t keybuf[32]; - int i; - - if (argc != 3) { - (void)fprintf(stderr, "usage: %s <ssid> <passphrase>\n", - __progname); - exit(1); - } - ssid = argv[1]; - pass = argv[2]; - - /* validate passphrase */ - len = strlen(pass); - if (len < 8 || len > 63) - errx(1, "passphrase must be between 8 and 63 characters"); - - /* validate SSID */ - ssid_len = strlen(ssid); - if (ssid_len == 0) - errx(1, "invalid SSID"); - if (ssid_len > IEEE80211_NWID_LEN) { - ssid_len = IEEE80211_NWID_LEN; - warnx("truncating SSID to its first %d characters", ssid_len); - } - - pkcs5_pbkdf2(pass, len, ssid, ssid_len, keybuf, sizeof(keybuf), 4096); - - printf("0x"); - for (i = 0; i < 32; i++) - printf("%02x", keybuf[i]); - printf("\n"); - - return 0; -} |