亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? eapmschapv2.c

?? linux下可以用來通過802.1x認證
?? C
?? 第 1 頁 / 共 2 頁
字號:
/** * A client-side 802.1x implementation supporting EAP/TLS * * This code is released under both the GPL version 2 and BSD licenses. * Either license may be used.  The respective licenses are found below. * * Copyright (C) 2002 Chris Hessing & Terry Simons * All Rights Reserved * * --- GPL Version 2 License --- * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * * --- BSD License --- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * *  - Redistributions of source code must retain the above copyright notice, *    this list of conditions and the following disclaimer. *  - Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. *  - All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *       This product includes software developed by the University of *       Maryland at College Park and its contributors. *  - Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *//******************************************************************** EAPOL Function implementations for supplicant *  * File: eapmschap.c * * Authors: Chris.Hessing@utah.edu, Terry.Simons@utah.edu * *******************************************************************//* TODO:     Change DES routines to use OpenSSL     Return MS-CHAP failure if server isn't authentic     Use xlogf instead of printf.     Clean up warnings!     Look at implementing MPPE for dynamic keying.     Break MS-CHAPv2 code into it's own file, to be used with PEAP and TTLS.*/#include <inttypes.h>#include <openssl/ssl.h>#include <openssl/rand.h>#include <string.h>#include <unistd.h>#include <stdlib.h>#include <ctype.h>#include "eapmschapv2.h"#include "../../configparse.h"#include "dot1x_globals.h"#include "eap.h"#include "userconf.h"#include "logging.h"#include "auth_methods/auth_tools.h"#include "des.h"#ifndef MSCHAP_DEBUG#define MSCHAP_DEBUG  0#endifchar *eapmschap_netid;char *eapmschap_config;struct mschap_vars {  char NtResponse[24];  char PeerChallenge[16];  char AuthenticatorChallenge[16];};static struct mschap_vars savedvars;int init_eapmschap(char *config, char *netid){#ifdef MSCHAP_DEBUG  xlogf(DEBUG_AUTHTYPES, "(EAPMS-CHAP) Initalized\n");#endif  eapmschap_netid = netid;  eapmschap_config = config;  return 0;}void ntpasswordhash(char *uni_password, int len, char *out){  EVP_MD_CTX *cntx;  char retVal[16];  int i;  cntx = (EVP_MD_CTX *)malloc(sizeof(EVP_MD_CTX));  //  We should fix this, so that we are using only OpenSSL, rather than other types of hash routines.  EVP_DigestInit(cntx, EVP_md4());  EVP_DigestUpdate(cntx, uni_password, len);   EVP_DigestFinal(cntx, (char *)&retVal, (int *)&i);  if (i != 16) printf("Returned hash wasn't 16! ACK! (It was %d)\n",i);  #if MSCHAP_DEBUG  printf("Hash : ");  for (i=0; i<16; i++)    {      printf("%02x",(uint8_t)retVal[i]);    }#endif    memcpy(out, &retVal, 16);}void HashNtPasswordHash(char *inhash, char *outhash){  EVP_MD_CTX cntx;  int i;  EVP_DigestInit(&cntx, EVP_md4());  EVP_DigestUpdate(&cntx, inhash, 16);  EVP_DigestFinal(&cntx, outhash, &i);}void challenge_hash(char *peer_chal, char *auth_chal, char *username, char *chal){  EVP_MD_CTX *cntx;  // The context needed for the hashing.  char pre_digest[30];  // The originally returned digest.  int retLen;  cntx = (EVP_MD_CTX *)malloc(sizeof(EVP_MD_CTX));  EVP_DigestInit(cntx, EVP_sha1());  EVP_DigestUpdate(cntx, peer_chal, 16);  EVP_DigestUpdate(cntx, auth_chal, 16);  EVP_DigestUpdate(cntx, username, strlen(username));  EVP_DigestFinal(cntx, (char *)&pre_digest, &retLen);  if (cntx != NULL) free(cntx);  memcpy(chal, &pre_digest, 8);#if MSCHAP_DEBUG  printf("Challenge Hash : ");  print_hex(chal, 8);#endif}// Taken from FreeRADIUSstatic void parity_key(char * szOut, const char * szIn){  int i;  unsigned char cNext = 0;  unsigned char cWorking = 0;  for (i = 0; i < 7; i++) {    /* Shift operator works in place.  Copy the char out */    cWorking = szIn[i];    szOut[i] = (cWorking >> i) | cNext | 1;    cWorking = szIn[i];    cNext = (cWorking << (7 - i));  }  szOut[i] = cNext | 1;}//Taken from FreeRADIUSstatic void des_encrypt(const char *szClear, const char *szKey, char *szOut){  char szParityKey[9];  unsigned long ulK[16][2];  parity_key(szParityKey, szKey); /* Insert parity bits */#if MSCHAP_DEBUG  printf("Parity Key : ");  print_hex(szParityKey, 9);#endif  strncpy(szOut, szClear, 8);     /* des encrypts in place */  deskey(ulK, (unsigned char *) szParityKey, 0);  /* generate keypair */  des(ulK, szOut);  /* encrypt */}//Taken from FreeRADIUSstatic void mschap(const char *szChallenge, unsigned char * smbPasswd,		   char *szResponse) {  char szMD4[21];  /* initialize hash string */  memset(szMD4, 0, 21);  memcpy(szMD4, smbPasswd, 16);  /*   *   *      challenge_response takes an 8-byte challenge string and a   *      21-byte hash (16-byte hash padded to 21 bytes with zeros) and   *      returns a 24-byte response in szResponse   */  des_encrypt(szChallenge, szMD4, szResponse);  des_encrypt(szChallenge, szMD4 + 7, szResponse + 8);  des_encrypt(szChallenge, szMD4 + 14, szResponse + 16);}char ctonibble(char cnib){  char retVal=0x00;  char testval=0x00;  if ((cnib>='0') && (cnib<='9'))    {      retVal = cnib - '0';    } else {      testval = toupper(cnib);      if ((testval>='A') && (testval<='F'))	{	  retVal = ((testval - 'A') +10);	} else {	  printf("Error in conversion!  (Check ctonibble()) -- %02x\n",testval);	}    }  return retVal;}// Convert an ASCII string to a binary version of it.void process_hex(char *instr, int size, char *outstr){  int i;  // Make sure we don't try to convert something that isn't byte aligned.  if ((size % 2) != 0)    {      printf("Hex string isn't an even number of chars!!!\n");      return;    }  for (i=0;i<=(size/2);i++)    {      if (instr[i*2] != 0x00)	{	  outstr[i] = (ctonibble(instr[i*2]) << 4) + ctonibble(instr[(i*2)+1]);#if MSCHAP_DEBUG	  printf("%02x", (uint8_t)outstr[i]);#endif	}    }#if MSCHAP_DEBUG  printf("\n");#endif}// This routine decodes the MSCHAPv2 success message, and returns it// as a couple of char *'s to be more useful.  Return -1 if we were passed// a string that doesn't look like a success string.int decode_success(char *instr, int instr_size, char *authstr, char *msg){  char *temp;  int i;  // The success string passed in should look like this :  // S=<auth string> M=<message>  if (instr[0] != 'S') return -1;  // We shouldn't have a return code more than 40 hex digits, but just to be  // safe.  temp = (char *)malloc(50);    i=2;   //Start beyond the S=  while (instr[i] != ' ')    {      temp[i-2] = instr[i];      i++;    }  temp[i-2] = 0x00;  // Make it so we can print the string correctly.#if MSCHAP_DEBUG  printf("Processing string : %s\n", temp);#endif  process_hex(temp, i-2, authstr);  free(temp);#if MSCHAP_DEBUG  printf("Returned : ");  print_hex(authstr, 20); // 40 chars, boils down to 20 bytes.  printf("\n");#endif  // Skip to the next character.  while (instr[i] != ' ') i++;  // Make sure we have a message here.  if (instr[i] != 'M') return -1;  i+=2;  // Skip to the first character in the message.  memcpy(msg, &instr[i], (instr_size - i));  return 0;}void decode_error(char *instr, int *err, int *retry, char *challenge, int *pchange, char *msg){  char *err_blk=NULL, *retry_blk=NULL, *chal_blk=NULL, *pchange_blk=NULL;  char *msg_blk = NULL;  char *junk, *temp_store;  if (instr[0] != 'E')  // Then we don't have an error.    {      printf("The returned message isn't formatted correctly!\n");      return;    }  sprintf(instr, "%s %s %s %s %s", err_blk, retry_blk, chal_blk, pchange_blk, msg_blk);  // Now, process each block.  err = (int)strtod(&err_blk[2], &junk);#if MSCHAP_DEBUG  printf("Error number : %d\n", err);#endif  retry = (int)strtod(&retry_blk[2], &junk);#if MSCHAP_DEBUG

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久草av在线| 欧美一级高清片在线观看| 在线观看日韩av先锋影音电影院| 欧美美女喷水视频| 欧美国产亚洲另类动漫| 亚洲成a人v欧美综合天堂下载| 国产成人免费视频网站高清观看视频 | 欧美久久一区二区| 国产精品毛片高清在线完整版 | 国产精品高潮久久久久无| 偷拍与自拍一区| 波多野结衣中文字幕一区 | 久久久国产午夜精品| 天堂影院一区二区| 91香蕉视频污| 国产精品久久久久四虎| 国产在线观看免费一区| 91精品在线免费| 亚洲一二三级电影| 色8久久人人97超碰香蕉987| 久久精品亚洲精品国产欧美| 久色婷婷小香蕉久久| 欧美老女人第四色| 亚洲高清中文字幕| 欧美大胆一级视频| 亚洲一区二区视频在线| 99久久婷婷国产| 18成人在线视频| 97久久超碰精品国产| 国产精品对白交换视频 | 欧美色图激情小说| 亚洲精品综合在线| 色婷婷综合中文久久一本| 国产精品伦理一区二区| 成人动漫在线一区| 欧美高清在线精品一区| 成人av电影在线播放| 国产精品久久久久影视| 成人在线视频首页| 中文字幕欧美日韩一区| 粉嫩嫩av羞羞动漫久久久| 国产欧美日韩一区二区三区在线观看| 精品亚洲免费视频| 亚洲精品一区二区三区影院| 经典三级一区二区| 精品处破学生在线二十三| 精品一区二区三区视频| 欧美精品一区二区三区一线天视频 | 丁香激情综合五月| 亚洲欧洲av在线| 91高清在线观看| 日韩高清一区二区| 久久午夜羞羞影院免费观看| 国产成人亚洲综合a∨婷婷| 国产精品全国免费观看高清 | 亚洲影院理伦片| 欧美一区二区在线不卡| 国产一区视频网站| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 91福利在线导航| 免费在线观看一区二区三区| 2021久久国产精品不只是精品| 国产精品一线二线三线精华| 国产精品超碰97尤物18| 欧美性受极品xxxx喷水| 精品综合久久久久久8888| 国产精品成人在线观看| 欧美色综合天天久久综合精品| 日韩在线a电影| 中文字幕第一区| 欧美日韩国产综合视频在线观看 | 国产女人水真多18毛片18精品视频| 高清不卡一区二区| 日韩有码一区二区三区| 亚洲风情在线资源站| 欧美一级高清片| 日本道免费精品一区二区三区| 久久国产欧美日韩精品| 一区二区三区日韩在线观看| 日韩精品一区二区三区在线观看| 波多野结衣亚洲| 国内精品在线播放| 亚洲第一综合色| 中文字幕av不卡| 日韩女优视频免费观看| 91麻豆福利精品推荐| 国产一区欧美二区| 日韩精品一二三区| 综合精品久久久| 欧美激情一区二区三区在线| 欧美一区二区在线观看| 欧美无砖砖区免费| 9人人澡人人爽人人精品| 精品亚洲免费视频| 蜜桃久久久久久| 亚洲444eee在线观看| 18成人在线观看| 欧美激情在线看| 久久婷婷成人综合色| 91精品久久久久久久99蜜桃| 日本韩国欧美一区二区三区| 欧美tickling网站挠脚心| 欧美日韩激情一区| 91极品美女在线| 97久久超碰国产精品电影| 成人精品一区二区三区中文字幕| 激情文学综合网| 奇米影视在线99精品| 天天av天天翘天天综合网色鬼国产| 国产精品福利电影一区二区三区四区 | 欧美人狂配大交3d怪物一区| 色婷婷av一区| 色诱视频网站一区| 日本高清成人免费播放| 99久久精品国产一区| 波多野结衣在线aⅴ中文字幕不卡| 国产成人在线免费观看| 国产不卡高清在线观看视频| 国产一区中文字幕| 粉嫩一区二区三区性色av| 国产suv精品一区二区6| 成人午夜视频网站| 成人动漫一区二区三区| 99视频在线观看一区三区| 成人a免费在线看| 91搞黄在线观看| 欧美日韩视频在线观看一区二区三区| 欧美午夜寂寞影院| 欧美一区二区福利视频| 精品欧美一区二区在线观看| 精品蜜桃在线看| 国产精品麻豆视频| 亚洲午夜精品网| 蜜桃一区二区三区在线观看| 狠狠色丁香婷综合久久| 国产99精品在线观看| 96av麻豆蜜桃一区二区| 欧美综合亚洲图片综合区| 欧美巨大另类极品videosbest | 国产电影一区在线| 成人三级伦理片| 日本高清不卡在线观看| 欧美丰满少妇xxxxx高潮对白| 欧美变态tickling挠脚心| 国产欧美一区二区三区在线老狼 | 91福利国产精品| 欧美一区二区三区四区五区| 久久色在线观看| 亚洲精品成人少妇| 老汉av免费一区二区三区| 99久久精品情趣| 91精品综合久久久久久| 国产精品色一区二区三区| 一区二区三区在线影院| 另类欧美日韩国产在线| 色综合久久天天| 精品国产一区二区三区不卡| 亚洲美女视频在线观看| 男人的天堂久久精品| 91在线观看地址| 精品久久久久一区| 亚洲精品一二三| 国产精品69久久久久水密桃| 欧美天天综合网| 欧美激情一区不卡| 蜜臀国产一区二区三区在线播放| 成人高清在线视频| 日韩三级av在线播放| 一区二区三区欧美| 国产98色在线|日韩| 91精品国产aⅴ一区二区| 亚洲欧美日韩一区二区三区在线观看| 久国产精品韩国三级视频| 欧美中文字幕不卡| 国产精品美女www爽爽爽| 精品综合免费视频观看| 欧美日韩你懂的| 亚洲精品免费在线观看| 国产成人在线网站| 精品国产伦一区二区三区免费| 亚洲第一激情av| 日本韩国欧美国产| 亚洲视频电影在线| 99re在线视频这里只有精品| 国产午夜精品一区二区三区嫩草| 秋霞影院一区二区| 欧美三级电影网站| 亚洲一二三专区| 色婷婷综合视频在线观看| 国产精品国产精品国产专区不蜜| 国产一区二区女| 精品成人佐山爱一区二区| 久久99精品久久久久久国产越南| 91精品国产综合久久久久久久| 午夜久久久久久电影| 欧美日韩黄色一区二区| 天天亚洲美女在线视频| 欧美日韩和欧美的一区二区| 亚洲图片欧美色图| 欧美日韩久久久久久|