Hcxpsktool
Hcxpsktool
#include <ctype.h>
#include <getopt.h>
#include <libgen.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/types.h>
#include "include/hcxpsktool.h"
#include "include/hashcatops.h"
#include "include/strings.c"
/*===========================================================================*/
/* global var */
uint8_t essidglen;
/*===========================================================================*/
static void globalinit(void)
{
static time_t t;
static struct tm *tm;
apessidliste = NULL;
apessidcount = 0;
essidglen = 32;
t = time(NULL);
tm = localtime(&t);
thisyear = tm->tm_year +1900;
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
return;
}
/*===========================================================================*/
/*===========================================================================*/
static void writepsk(FILE *fhout, const char *pskstring)
{
static bool lflag = false;
static bool uflag = false;
static int p, l;
static char lowerpskstring[PSKSTRING_LEN_MAX] = { 0 };
static char upperpskstring[PSKSTRING_LEN_MAX] = { 0 };
l = strlen(pskstring);
if((l < 8) || (l > PSKSTRING_LEN_MAX)) return;
fprintf(fhout,"%s\n", pskstring);
for(p = 0; p < l; p++)
{
if(islower((unsigned char)pskstring[p]))
{
upperpskstring[p] = toupper((unsigned char)pskstring[p]);
uflag = true;
}
else upperpskstring[p] = pskstring[p];
if(isupper((unsigned char)pskstring[p]))
{
lowerpskstring[p] = tolower((unsigned char)pskstring[p]);
lflag = true;
}
else lowerpskstring[p] = pskstring[p];
}
upperpskstring[p] = 0;
lowerpskstring[p] = 0;
if(uflag == true) fprintf(fhout,"%s\n", upperpskstring);
if(lflag == true) fprintf(fhout,"%s\n", lowerpskstring);
if((lowerpskstring[0] >= 'a') && (lowerpskstring[0] <= 'z'))
{
lowerpskstring[0] = toupper((unsigned char)lowerpskstring[0]);
fprintf(fhout,"%s\n", lowerpskstring);
}
return;
}
/*===========================================================================*/
static void keywritedigit10(FILE *fhout)
{
static int i;
static uint16_t f1, f2;
static unsigned long long int ec, el, eu;
static unsigned int digestmd5len;
static EVP_MD_CTX* mdctx;
char** uword3;
char** uword4;
char** uword5;
return;
}
/*===========================================================================*/
/* source: soxrok2212,
https://github.com/soxrok2212/PSKracker/tree/master/dicts/altice-optimum */
static void keywritealticeoptimum(FILE *fhout)
{
static unsigned int w, i, j; // w1
if (i < 10)
{
fprintf(fhout, "%s-%01d-%s\n", word[w], i, word[w1]);
fprintf(fhout, "%01d-%s-%s\n", i, word[w], word[w1]);
fprintf(fhout, "%s-%s-%01d\n", word[w], word[w1], i);
}
if (i < 100)
{
fprintf(fhout, "%s-%02d-%s\n", word[w], i, word[w1]);
fprintf(fhout, "%02d-%s-%s\n", i, word[w], word[w1]);
fprintf(fhout, "%s-%s-%02d\n", word[w], word[w1], i);
}
if (i < 1000)
{
fprintf(fhout, "%s-%03d-%s\n", word[w], i, word[w1]);
fprintf(fhout, "%03d-%s-%s\n", i, word[w], word[w1]);
fprintf(fhout, "%s-%s-%03d\n", word[w], word[w1], i);
}
if (i < 10000)
{
fprintf(fhout, "%s-%04d-%s\n", word[w], i, word[w1]);
fprintf(fhout, "%04d-%s-%s\n", i, word[w], word[w1]);
fprintf(fhout, "%s-%s-%04d\n", word[w], word[w1], i);
}
}
*/
}
}
return;
}
/*===========================================================================*/
static void keywriteasus(FILE *fhout)
{
static unsigned int w, i;
return;
}
/*===========================================================================*/
static void keywriteweakpass(FILE *fhout)
{
static size_t w;
static unsigned int y;
if(essidlen >= 6)
{
if((isxdigit((unsigned char)essid[essidlen -6])) && (isxdigit((unsigned
char)essid[essidlen -5])) && (isxdigit((unsigned char)essid[essidlen -4])) &&
(isxdigit((unsigned char)essid[essidlen -3])) && (isxdigit((unsigned
char)essid[essidlen -2])) && (isxdigit((unsigned char)essid[essidlen -1])))
{
ev = (char*)(essid +essidlen -6);
ek = strtol(ev, NULL, 16);
oui = (macaddr &0xffffff000000L) >> 24;
snprintf(essidtmp, PSKSTRING_LEN_MAX, "%06x%06x", oui, ek);
writepsk(fhout, essidtmp);
}
}
return;
if(essidlen >= 4)
{
if((isxdigit((unsigned char)essid[essidlen -4])) && (isxdigit((unsigned
char)essid[essidlen -3])) && (isxdigit((unsigned char)essid[essidlen -2])) &&
(isxdigit((unsigned char)essid[essidlen -1])))
{
ev = (char*)(essid +7);
ek = strtol(ev, NULL, 16);
for(k2 = ek -10; k2 < ek +10; k2++)
{
snprintf(essidtmp, PSKSTRING_LEN_MAX, "%08llx%04x", (macaddr >>
16), (k2 &0xffff));
writepsk(fhout, essidtmp);
}
}
}
return;
}
/*===========================================================================*/
static void processbssidsessids(FILE *fhout)
{
static int c;
static apessidl_t *zeiger;
static apessidl_t *zeiger1;
if(essidglen <= 2)
{
for(c = thisyear +1; c < 1000000; c++)
{
snprintf(essidstring, PSKSTRING_LEN_MAX +PSKSTRING_LEN_MAX , "%s%d",
essid, c);
writepsk(fhout, essidstring);
}
}
if(essidglen <= 3)
{
for(c = thisyear +1; c < 100000; c++)
{
snprintf(essidstring, PSKSTRING_LEN_MAX +PSKSTRING_LEN_MAX , "%s%d",
essid, c);
writepsk(fhout, essidstring);
}
}
po = 0;
removeflag = false;
essidlentmp = essidlen;
memset(&essidtmp, 0, PSKSTRING_LEN_MAX);
for(pi = 0; pi < essidlen; pi++)
{
if(((essid[pi] >= 'A') && (essid[pi] <= 'Z')) || ((essid[pi] >= 'a') &&
(essid[pi] <= 'z')))
{
essidtmp[po] = essid[pi];
po++;
}
else
{
essidlentmp--;
removeflag = true;
}
}
writeessidadd(fhout, (char*)essid);
if(removeflag == true) writeessidadd(fhout, essidtmp);
return removeflag;
}
/*===========================================================================*/
static void writeessidsweeped(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static int l1, l2;
static uint8_t sweepstring[PSKSTRING_LEN_MAX] = { 0 };
if(essidlen >= 8)
{
if((!isxdigit((unsigned char)essid[6])) || (!isxdigit((unsigned
char)essid[7]))) return;
if(memcmp(essid, dg860A, 6) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "DG860A%04X%c%c\n", k1,
essid[6], essid[7]);
return;
}
if(memcmp(essid, tg852g, 6) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "TG852G%04X%c%c\n", k1,
essid[6], essid[7]);
return;
}
if(memcmp(essid, tg862g, 6) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "TG862G%04X%c%c\n", k1,
essid[6], essid[7]);
return;
}
}
if(essidlen >= 9)
{
if((!isxdigit((unsigned char)essid[7])) || (!isxdigit((unsigned
char)essid[8]))) return;
if(memcmp(essid, dg1670A, 7) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "DG1670A%04X%c%c\n", k1,
essid[7], essid[8]);
return;
}
if(memcmp(essid, sbg6580, 7) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "SBG6580%04X%c%c\n", k1,
essid[7], essid[8]);
return;
}
if(memcmp(essid, tg1672g, 7) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "TG1672G%04X%c%c\n", k1,
essid[7], essid[8]);
return;
}
}
return;
}
/*===========================================================================*/
static void testaxtelxtremo(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static int k1;
static const char *axtelxtremo = "AXTEL XTREMO-";
return;
}
/*===========================================================================*/
static void testhotbox(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static int k1, k2;
static char *ev;
static const char *hotbox = "HOTBOX";
if(essidlen == 7)
{
if(memcmp(essid, a1, 3) == 0)
{
if((isxdigit((unsigned char)essid[3])) && (isxdigit((unsigned
char)essid[4])) && (isxdigit((unsigned char)essid[5])) && (isxdigit((unsigned
char)essid[6])))
{
for(k1 = 0; k1 < 0x100; k1++)
for(k2 = 0; k2 < 0x100; k2++)
{
snprintf(essidtmp, PSKSTRING_LEN_MAX, "48575443%02X%c
%c%c%c%02X", k1, essid[3], essid[4], essid[5], essid[6], k2);
writepsk(fhout, essidtmp);
}
}
}
return;
}
if(essidlen == 10)
{
if(memcmp(essid, mtel, 6) == 0)
{
if((isxdigit((unsigned char)essid[6])) && (isxdigit((unsigned
char)essid[7])) && (isxdigit((unsigned char)essid[8])) && (isxdigit((unsigned
char)essid[9])))
{
for(k1 = 0; k1 < 0x100; k1++)
{
for(k2 = 0; k2 < 0x100; k2++)
{
snprintf(essidtmp, PSKSTRING_LEN_MAX, "48575443%02X%c
%c%c%c%02X", k1, essid[6], essid[7], essid[8], essid[9], k2);
writepsk(fhout, essidtmp);
}
}
}
}
return;
}
return;
}
/*===========================================================================*/
static void testmywifi(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static int k1;
static const char *mywifi = "MY WIFI ";
if(essidlen == 10)
{
if((isxdigit((unsigned char)essid[4])) && (isxdigit((unsigned char)essid[5]))
&& (isxdigit((unsigned char)essid[6])) && (isxdigit((unsigned char)essid[7])) &&
(isxdigit((unsigned char)essid[8])) && (isxdigit((unsigned char)essid[9])))
{
if(memcmp(essid, rtk, 4) == 0)
{
for(k1 = 0; k1 < 0x100000; k1++)
{
fprintf(fhout, "454C54585C0%05X\n", k1);
fprintf(fhout, "454C54585C1%05X\n", k1);
fprintf(fhout, "53434F4D1A0%05X\n", k1);
fprintf(fhout, "ELTX1A0%05X\n", k1);
fprintf(fhout, "ELTX5C0%05X\n", k1);
}
}
return;
}
}
return;
}
/*===========================================================================*/
static void testtechnicolor(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static int k1;
static const char *tc8715d = "TC8715D";
static const char *tc8717t = "TC8717T";
if(essidlen >= 9)
{
if((!isxdigit((unsigned char)essid[7])) || (!isxdigit((unsigned
char)essid[8]))) return;
if(memcmp(essid, tc8715d, 7) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "TC8715D%04X%c%c\n", k1,
essid[7], essid[8]);
}
if(memcmp(essid, tc8717t, 7) == 0)
{
for(k1 = 0; k1 < 0x10000; k1++) fprintf(fhout, "TC8717T%04X%c%c\n", k1,
essid[7], essid[8]);
}
return;
}
return;
}
/*===========================================================================*/
static void testtelered(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static uint32_t i;
static int c;
static const char *telered = "TeleRed-";
if(essidlen != 8) return;
if(essid[0] != 'W') return;
if(essid[1] != 'E') return;
if(!isxdigit((unsigned char)essid[6])) return;
if(!isxdigit((unsigned char)essid[7])) return;
for(k1 = 0; k1 < 0x100000; k1++) fprintf(fhout, "%c%c0%05x\n", tolower(essid[6]),
tolower(essid[7]), k1);
return;
}
/*===========================================================================*/
static void testwifirsu(FILE *fhout, uint8_t essidlen, uint8_t *essid)
{
static int k1;
static const char *wifirsu = "WiFiRSU_";
while (pin)
{
accum += 3 * (pin % 10);
pin /= 10;
accum += pin % 10;
pin /= 10;
}
return (10 - accum % 10) % 10;
}
/*---------------------------------------------------------------------------*/
static void writebssidwps(FILE *fhout, unsigned long long int macaddr)
{
static int pin;
pin = (((macaddr >> 24) &0xff) *256 *256) +(((macaddr >> 16) &0xff) *256) +
((macaddr >> 8) &0xff);
pin = pin % 10000000;
pin = ((pin * 10) + wpspinchecksum(pin));
fprintf(fhout, "%08d\n", pin);
return;
}
/*===========================================================================*/
static void writewpsall(FILE *fhout)
{
static int c, cs;
writebssidmd5(fhout, macaddr);
writebssidwps(fhout, macaddr);
return;
}
/*===========================================================================*/
static void test000559(FILE *fhout, unsigned long long int macaddr)
{
static int k1;
static unsigned long long int oui;
me = macaddr &0xffffff;
fprintf(fhout, "05%6d\n", me);
oui = macaddr &0xffffff000000L;
nic = (macaddr -0x7f) &0xffffffL;
for(c = 0; c <= 0xff; c++) writebssid(fhout, oui +((nic +c) &0xffffffL));
swap = (nic >> 8) & 0xffff;
{
swap = (swap & 0xf000) >> 12 | (swap & 0x0f00) >> 4 | (swap & 0x00f0) << 4 |
(swap & 0x000f) << 12;
snprintf(pskstring, PSKSTRING_LEN_MAX, "000000%04X", swap);
fprintf(fhout, "%s\n", pskstring);
}
test000559(fhout, macaddr);
return;
}
/*===========================================================================*/
static void processbssids(FILE *fhout)
{
static int c;
static apessidl_t *zeiger;
static apessidl_t *zeiger1;
while(1)
{
if((len = fgetline(fh_file, PMKID_LINE_LEN, linein)) == -1) break;
if((len < 61) || ((len > 59 +(ESSID_LEN_MAX *2))))
{
fprintf(stderr, "reading hash line %d failed: %s\n", aktread, linein);
aktread++;
continue;
}
if(((linein[32] != ':') && (linein[45] != ':') && (linein[58] != ':')) &&
((linein[32] != '*') && (linein[45] != '*') && (linein[58] != '*')))
{
fprintf(stderr, "reading hash line %d failed: %s\n", aktread, linein);
aktread++;
continue;
}
essidlen = len -59;
if((essidlen %2) != 0)
{
fprintf(stderr, "reading hash line %d failed: %s\n", aktread, linein);
aktread++;
continue;
}
macaddr = strtoull(linein +33, &macaddrstop, 16);
if((macaddrstop -linein) != 45)
{
fprintf(stderr, "reading hash line %d failed: %s\n", aktread, linein);
aktread++;
continue;
}
if(hex2bin(&linein[59], essid, essidlen/2) == true) addapessid(macaddr,
essidlen/2, essid);
aktread++;
}
fclose(fh_file);
return;
}
/*===========================================================================*/
static void readpmkideapolfile(char *pmkideapolname)
{
static int len;
static int aktread = 1;
static int essidlen;
static char *macaddrstop = NULL;
static char *essidstop = NULL;
static unsigned long long int macaddr;
static FILE *fh_file;
if(stat(hccapxname, &statinfo) != 0)
{
fprintf(stderr, "can't stat %s\n", hccapxname);
return;
}
if((statinfo.st_size %HCCAPX_SIZE) != 0)
{
fprintf(stderr, "file corrupt\n");
return;
}
if((fhhcx = fopen(hccapxname, "r")) == NULL)
{
fprintf(stderr, "error opening file %s", hccapxname);
return;
}
hcxptr = (hccapx_t*)hcxdata;
while(fread(&hcxdata, HCCAPX_SIZE, 1, fhhcx) == 1)
{
if(hcxptr->signature != HCCAPX_SIGNATURE) continue;
if((hcxptr->version != 3) && (hcxptr->version != 4)) continue;
if(hcxptr->essid_len > ESSID_LEN_MAX) continue;
macaddr = 0;
macaddr = hcxptr->mac_ap[0];
macaddr = (macaddr << 8) + hcxptr->mac_ap[1];
macaddr = (macaddr << 8) + hcxptr->mac_ap[2];
macaddr = (macaddr << 8) + hcxptr->mac_ap[3];
macaddr = (macaddr << 8) + hcxptr->mac_ap[4];
macaddr = (macaddr << 8) + hcxptr->mac_ap[5];
addapessid(macaddr, hcxptr->essid_len, hcxptr->essid);
}
fclose(fhhcx);
return;
}
/*===========================================================================*/
static void readcommandline(char *macapname, char *essidname)
{
static int essidlen = 0;
static int essidlenuh = 0;
static char *macaddrstop = NULL;
static unsigned long long int macaddr = 0xffffffffffffL;
static uint8_t essid[ESSID_LEN_MAX];
if(macapname != NULL)
{
macaddr = strtoull(macapname, &macaddrstop, 16);
if((macaddrstop -macapname) != 12) fprintf(stderr, "invalid MAC specified\
n");
}
memset(&essid, 0, ESSID_LEN_MAX);
if(essidname != NULL)
{
essidlen = strlen(essidname);
essidlenuh = ishexify(essidname);
if((essidlenuh > 0) && (essidlenuh <= ESSID_LEN_MAX))
{
if(hex2bin(&essidname[5], essid, essidlenuh) == true)
addapessid(macaddr, essidlenuh, essid);
return;
}
memset(&essid, 0, ESSID_LEN_MAX);
if(essidlen <= ESSID_LEN_MAX) memcpy(&essid, essidname, essidlen);
}
addapessid(macaddr, essidlen, essid);
return;
}
/*===========================================================================*/
__attribute__ ((noreturn))
static void version(char *eigenname)
{
fprintf(stdout, "%s %s (C) %s ZeroBeat\n", eigenname, VERSION_TAG, VERSION_YEAR);
exit(EXIT_SUCCESS);
}
/*---------------------------------------------------------------------------*/
__attribute__ ((noreturn))
static void usage(char *eigenname)
{
fprintf(stdout, "%s %s (C) %s ZeroBeat\n"
"usage:\n"
"%s <options>\n"
"\n"
"options:\n"
"-c <file> : input PMKID/EAPOL hash file (hashcat -m 22000/22001)\n"
"-i <file> : input EAPOL hash file (hashcat -m 2500/2501)\n"
"-j <file> : input EAPOL hash file (john)\n"
"-z <file> : input PMKID hash file (hashcat -m 16800/16801 and john)\n"
"-e <char> : input ESSID\n"
"-b <xdigit> : input MAC access point\n"
" format: 112233445566\n"
"-o <file> : output PSK file\n"
" default: stdout\n"
" output list must be sorted unique!\n"
"-h : show this help\n"
"-v : show version\n"
"\n"
"--maconly : print only candidates based on ACCESS POINT MAC\n"
"--noessidcombination: exclude ESSID combinations\n"
"--netgear : include weak NETGEAR / ORBI / NTGR_VMB / ARLO_VMB
candidates\n"
"--spectrum : include weak MySpectrumWiFi / SpectrumSetup /
MyCharterWiFi candidates\n"
" list will be > 2.1GB\n"
"--digit10 : include weak 10 digit candidates (INFINITUM, ALHN,
INEA, VodafoneNet, VIVACOM)\n"
" list will be > 1GB\n"
"--phome : include weak PEGATRON / Vantiva candidates (HOME,
CBCI, XFSETUP)\n"
" list will be > 2.2GB\n"
"--tenda : include weak TENDA candidates\n"
"--ee : include weak EE BrightBox candidates\n"
" list will be > 3.5GB\n"
"--alticeoptimum : include weak Altice/Optimum candidates (MyAltice)\n"
"--asus : include weak ASUS RT-AC58U candidates (ASUS_XX)\n"
"--weakpass : include weak password candidates\n"
"--eudate : include complete european dates\n"
"--usdate : include complete american dates\n"
"--wpskeys : include complete WPS keys\n"
"--egn : include Bulgarian EGN\n"
"--help : show this help\n"
"--version : show version\n"
"\n"
"if hcxpsktool recovered your password, you should change it immediately!\n\
n",
eigenname, VERSION_TAG, VERSION_YEAR, eigenname);
exit(EXIT_SUCCESS);
}
/*---------------------------------------------------------------------------*/
__attribute__ ((noreturn))
static void usageerror(char *eigenname)
{
fprintf(stdout, "%s %s (C) %s by ZeroBeat\n"
"usage: %s -h for help\n", eigenname, VERSION_TAG, VERSION_YEAR, eigenname);
exit(EXIT_FAILURE);
}
/*===========================================================================*/
int main(int argc, char *argv[])
{
static int auswahl;
static int index;
static FILE *fhpsk;
airtelflag = false;
alticeoptimumflag = false;
asusflag = false;
digit10flag = false;
easyboxflag = false;
eeflag = false;
egnflag = false;
eudateflag = false;
hb5flag = false;
maconlyflag = false;
netgearflag = false;
noessidcombinationflag = false;
phomeflag = false;
podaflag = false;
spectrumflag = false;
tendaflag = false;
ukrtelecomflag = false;
usdateflag = false;
weakpassflag = false;
wpskeysflag = false;
znidflag = false;
auswahl = -1;
index = 0;
optind = 1;
optopt = 0;
while((auswahl = getopt_long (argc, argv, short_options, long_options, &index)) !=
-1)
{
switch (auswahl)
{
case HCXD_MACONLY:
maconlyflag = true;
break;
case HCXD_NETGEAR:
netgearflag = true;
break;
case HCXD_SPECTRUM:
spectrumflag = true;
break;
case HCXD_NOESSIDCOMBINATION:
noessidcombinationflag = true;
break;
case HCXD_DIGIT10:
digit10flag = true;
break;
case HCXD_PHOME:
phomeflag = true;
break;
case HCXD_TENDA:
tendaflag = true;
break;
case HCXD_EE:
eeflag = true;
break;
case HCXD_ALTICEOPTIMUM:
alticeoptimumflag = true;
break;
case HCXD_ASUS:
asusflag = true;
break;
case HCXD_WEAKPASS:
weakpassflag = true;
break;
case HCXD_EUDATE:
eudateflag = true;
break;
case HCXD_USDATE:
usdateflag = true;
break;
case HCXD_WPSKEYS:
wpskeysflag = true;
break;
case HCXD_EGN:
egnflag = true;
break;
case HCXD_HELP:
usage(basename(argv[0]));
break;
case HCXD_VERSION:
version(basename(argv[0]));
break;
case 'c':
pmkideapolname = optarg;
break;
case 'i':
hccapxname = optarg;
break;
case 'j':
johnname = optarg;
break;
case 'z':
pmkidname = optarg;
break;
case 'e':
essidname = optarg;
break;
case 'b':
macapname = optarg;
if(strlen(macapname) != 12)
{
fprintf(stderr, "invalid MAC specified\n");
exit(EXIT_FAILURE);
}
break;
case 'o':
pskname = optarg;
break;
case '?':
usageerror(basename(argv[0]));
break;
}
}
if(argc < 2)
{
fprintf(stderr, "no option selected\n");
return EXIT_SUCCESS;
}
globalinit();
if(pmkideapolname != NULL)
{
readpmkideapolfile(pmkideapolname);
}
if(pmkidname != NULL)
{
readpmkidfile(pmkidname);
}
if(hccapxname != NULL)
{
readhccapxfile(hccapxname);
}
if(johnname != NULL)
{
readjohnfile(johnname);
}
if(apessidliste == NULL)
{
fprintf(stderr, "no hashes loaded\n");
}
if(pskname != NULL)
{
if((fhpsk = fopen(pskname, "w")) == NULL)
{
fprintf(stderr, "error opening psk file %s\n", pskname);
exit(EXIT_FAILURE);
}
processbssids(fhpsk);
if(maconlyflag == false)
{
processessids(fhpsk);
processbssidsessids(fhpsk);
processadditionals(fhpsk);
}
}
else
{
processbssids(stdout);
if(maconlyflag == false)
{
processessids(stdout);
processbssidsessids(stdout);
processadditionals(stdout);
}
}
if(pskname != NULL)
{
fclose(fhpsk);
}
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
return EXIT_SUCCESS;
}
/*===========================================================================*/