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

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

?? eapmd5.c

?? linux下可以用來通過802.1x認證
?? C
字號:
/** * A client-side 802.1x implementation supporting EAP/MD5 * * 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: eapmd5.c * * Authors: Chris.Hessing@utah.edu, Terry.Simons@utah.edu * *******************************************************************/#include <inttypes.h>#include <openssl/ssl.h>#include <string.h>#include <unistd.h>#include <stdlib.h>#include "eapmd5.h"#include "../../configparse.h"#include "dot1x_globals.h"#include "eap.h"#include "userconf.h"#include "logging.h"#include "auth_methods/auth_tools.h"#ifndef MD5_DEBUG#define MD5_DEBUG  0#endifchar *eapmd5_netid;char *eapmd5_config;int init_eapmd5(char *config, char *netid){#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "(EAPMD5) Initalized\n");#endif  eapmd5_netid = netid;  eapmd5_config = config;  return 0;}/*************************************************************  eapmd5_decode_packet - decode an MD5 challenge, and answer it  When an MD5 challenge is sent in, the header, up to the actual challenge  string is stripped off before we get here.  Since the ID is needed to   generate the return md5 hash, we need to have it passed in too.  The way that the MD5 challenge response works is fairly simple.  The  authenticator sends us a random stream of bytes.  The first byte in this  stream is the length of the stream.  From this, we build our response by  building a string that contains ID + password + challenge stream, and then  MD5 it.   The resulting value, with our username concatinated to the end is  returned in the response packet.************************************************************/int eapmd5_decode_packet(u_char *in, int in_size, u_char *out, int *out_size){  u_char challen = 0;  int hashlen =0;  char *chal =NULL;  char *answer =NULL;  char md5_result[16];  int md5_length=0;       // Should always be 16, but get it anyway.  EVP_MD_CTX *ctx=NULL;  char *username;  char *password;  // Get our username and password out of our configuration structure in memory  username = get_username();  password = get_password();#ifdef MD5_DEBUG    xlogf(DEBUG_AUTHTYPES, "(EAPMD5) ID : %d\n",get_receivedId());    xlogf(DEBUG_AUTHTYPES, "Username = %s   --   Password = %s\n",username,password);#endif  challen = in[0];#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "Incoming hex string (Length = %d) : ",challen);  print_hex((uint8_t *)&in[1],challen);#endif  if (chal == NULL)   //Which it *always* should    {      chal = (char *)malloc(challen);      if (chal == NULL)	{	  xlogf(DEBUG_NORMAL, "chal is NULL after malloc!\n");	}    } else {      xlogf(DEBUG_NORMAL, "ACK! chal != NULL, but it should!\n");    }  memcpy(chal, &in[1], challen);   // We should have our hash info.  answer = (char *)malloc(1+challen+strlen(password)+1);  if (answer == NULL)     {      xlogf(DEBUG_NORMAL, "answer was NULL!\n");      return -1;    // Something is wrong.    }  answer[0] = get_receivedId();#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "Using ID of %d\n", (u_char)answer[0]);#endif  memcpy(&answer[1], password, strlen(password));  memcpy(&answer[1+strlen(password)],chal,challen);#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "Challenge Response : %s\n",answer);#endif  ctx = (EVP_MD_CTX *)malloc(sizeof(EVP_MD_CTX));  hashlen = 1+strlen(password)+challen;   // Save us from nulls in answer.  EVP_DigestInit(ctx, EVP_md5());               //Initialize MD5  EVP_DigestUpdate(ctx, answer, hashlen);  EVP_DigestFinal(ctx, (char *)&md5_result, (int *)&md5_length);  if (md5_length != 16)    {      xlogf(DEBUG_NORMAL,"MD5 length was not 16!  We have a problem! (Actual length %d)\n",md5_length);    }  free(ctx);#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "Return hash : ");  print_hex((uint8_t *)&md5_result, 16);#endif  free(answer);  // We are done with these values.  answer = NULL;  free(chal);  chal = NULL;  // Probably shouldn't reuse the same variable....  // We need to malloc 1 for the length byte,  // 16 for the MD5 string,  // strlen(username) for the username,  // and 1 for a NULL byte for good measure. 8-)  answer = (char *)malloc(1+16+strlen(username)+1);  if (answer == NULL)     {      xlogf(DEBUG_NORMAL, "answer is NULL(2)!!!\n");      free(username);      username=NULL;      free(password);      password=NULL;      return -1;    }  answer[0] = 0x10;  memcpy(&answer[1],&md5_result,16);  memcpy(&answer[17],username,strlen(username)+1);  //  xlogf(DEBUG_AUTHTYPES, "Username = %s     Answer = %s\n",&answer[17], answer);  // We now have an answer!  memcpy(out, answer, 17+strlen(username)+1);  *out_size = 17+strlen(username)+1;  if (answer != NULL) free(answer);  answer=NULL;#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "(EAPMD5) Packet Built\n");#endif  free(username);  username = NULL;  free(password);  password = NULL;  return 0;  // Everything is okay.}/****************************************************************** * Get the password for the <nasid:id> found in the config file. ******************************************************************/int eapmd5_auth_challenge(){  char *temp_username=NULL;  char *temp_password=NULL;  char *trash;  // We may want to ask for the user's password.  temp_username = get_username();  // We need to think of a better way to handle this.  Right now, if you  // put in an incorrect password, you can never fix it.  trash = get_password();  if (trash == NULL)    {      xlogf(DEBUG_NORMAL, "(MD5 Authentication) %s's Password : ",temp_username);      temp_password = getpass("");   //This is obsolete, fix it!      set_password(temp_password);  // Update our config values.    } else {      xlogf(DEBUG_AUTHTYPES, "get_password returned a value!\n");    }  free(trash);  free(temp_username);  temp_username = NULL;  return 0;}// Clean up any memory we have allocated, and destroy anything we need to.int eapmd5_shutdown(){  // Don't free one_x_globals as it is a copy of a pointer to memory, and  // the shutdown_eap function will free it.#ifdef MD5_DEBUG  xlogf(DEBUG_AUTHTYPES, "(EAPMD5) Cleaning up.\n");#endif  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色香蕉久久蜜桃| 国产精品热久久久久夜色精品三区| 日韩午夜中文字幕| 国产午夜精品一区二区三区视频| 一区二区三区在线观看动漫| 久久99精品久久久久久动态图| 91丝袜国产在线播放| 精品捆绑美女sm三区| 亚洲色图丝袜美腿| 韩国三级中文字幕hd久久精品| 欧美亚洲图片小说| 韩日av一区二区| 日韩专区欧美专区| 久久97超碰国产精品超碰| 7777女厕盗摄久久久| 亚洲天堂精品视频| 成人毛片视频在线观看| 欧美不卡激情三级在线观看| 日本不卡一区二区| 成人av在线一区二区三区| 在线电影一区二区三区| 亚洲欧美日韩久久精品| 国产成人一区在线| 日韩精品一区二区三区中文不卡| 日韩美女精品在线| 91在线porny国产在线看| 亚洲日本青草视频在线怡红院 | 欧美aaa在线| 欧美一卡二卡三卡| 亚洲午夜私人影院| 99久久国产免费看| 中文字幕乱码久久午夜不卡| 精品一区二区三区久久久| 精品欧美久久久| 国产99久久久国产精品潘金| 精品国产乱码久久久久久浪潮| 日日摸夜夜添夜夜添精品视频| 国产麻豆精品在线观看| 91丨九色丨蝌蚪富婆spa| 最新中文字幕一区二区三区| 国产精品自拍一区| 久久久久亚洲综合| 久久精品国产**网站演员| 精品污污网站免费看| 亚洲精品国产视频| 一本一本大道香蕉久在线精品| 亚洲在线视频网站| 色妞www精品视频| 国产精品久久毛片| 成人国产亚洲欧美成人综合网 | 亚洲资源在线观看| 日韩一区二区三区视频在线观看 | 久久精品免费观看| 国产精品人成在线观看免费| 欧美亚洲国产一区二区三区| 麻豆精品一二三| 精品久久久影院| 波多野结衣亚洲一区| 国产精品动漫网站| 欧美日韩亚洲综合一区 | 精品一区二区三区影院在线午夜| 国产区在线观看成人精品| 国产在线乱码一区二区三区| 中文字幕在线一区免费| av在线这里只有精品| 欧美日韩一区二区欧美激情| 麻豆久久久久久久| 国产精品福利av| 欧美日韩黄视频| 亚洲一区自拍偷拍| 久久综合九色综合97婷婷| 国产一区久久久| 亚洲欧美偷拍卡通变态| 日韩一区二区三区高清免费看看| 白白色 亚洲乱淫| 日本免费新一区视频| 中文字幕日韩精品一区 | 成人av免费观看| 婷婷综合五月天| 欧美电影免费观看完整版| av在线综合网| 国内精品国产三级国产a久久| 亚洲精品五月天| 久久久www成人免费毛片麻豆| 欧美无砖砖区免费| 成人不卡免费av| 美腿丝袜亚洲色图| 亚洲已满18点击进入久久| 久久―日本道色综合久久| 欧美在线视频不卡| 激情综合五月天| 亚洲午夜久久久久久久久电影网 | 亚洲aaa精品| 欧洲精品中文字幕| 国产精品一区二区三区四区| 欧美肥胖老妇做爰| 亚洲视频网在线直播| 日韩免费电影一区| 欧美亚洲一区二区在线观看| 粉嫩aⅴ一区二区三区四区| 日本在线观看不卡视频| 亚洲一卡二卡三卡四卡| 国产精品理论片| 精品国产乱码久久久久久图片| 欧美日韩五月天| 色综合视频在线观看| 丁香婷婷综合激情五月色| 久久99精品久久久久婷婷| 日韩成人免费在线| 亚洲一区二区三区爽爽爽爽爽 | 国产婷婷色一区二区三区| 3d成人h动漫网站入口| 在线观看一区日韩| 99re这里只有精品6| 粉嫩久久99精品久久久久久夜 | 久久精品国产999大香线蕉| 亚洲最新视频在线播放| 亚洲欧美日韩在线播放| 国产精品天美传媒| 国产欧美日韩精品在线| 久久影院午夜片一区| 精品少妇一区二区三区 | 欧美精品精品一区| 欧美性受xxxx| 在线一区二区视频| 一本色道亚洲精品aⅴ| 97精品超碰一区二区三区| 成人av电影在线| 成人午夜激情影院| 成人听书哪个软件好| 成人激情午夜影院| 99精品黄色片免费大全| eeuss鲁一区二区三区| 国产91丝袜在线18| 成人av综合一区| caoporn国产一区二区| 不卡视频一二三| 91蜜桃网址入口| 色综合久久88色综合天天6 | 国产91清纯白嫩初高中在线观看| 国产精品中文字幕欧美| 国产高清无密码一区二区三区| 国产精品亚洲一区二区三区在线| 国产麻豆午夜三级精品| 国产精品一二三| 成人福利电影精品一区二区在线观看| 成人深夜福利app| 99这里只有久久精品视频| 色综合一区二区三区| 麻豆精品在线视频| 国内精品伊人久久久久影院对白| 国产一区二区免费在线| 国产成人在线免费观看| 91丨九色丨黑人外教| 在线免费亚洲电影| 欧美日韩成人在线| 欧美成人官网二区| 国产丝袜美腿一区二区三区| 国产精品久久久久久久久图文区| 亚洲免费av观看| 亚洲18色成人| 久久97超碰色| 国产精品123| 不卡大黄网站免费看| 在线观看日韩毛片| 欧美一卡二卡三卡| 国产欧美精品一区二区三区四区| 亚洲欧洲另类国产综合| 亚洲国产婷婷综合在线精品| 午夜不卡av在线| 国产在线精品一区二区| 久久精品一二三| 精品福利av导航| 国产精品三级在线观看| 一区二区三区美女| 毛片av一区二区| 成人永久aaa| 欧美丰满美乳xxx高潮www| 国产亚洲综合av| 亚洲综合视频网| 久久精品国产一区二区三区免费看 | 成人免费电影视频| 最近中文字幕一区二区三区| 亚洲高清久久久| 免费看欧美女人艹b| 国产精品一区在线| 日本久久电影网| 日韩精品在线一区二区| 《视频一区视频二区| 视频一区二区三区中文字幕| 国产成人免费在线观看不卡| 欧美自拍丝袜亚洲| 久久久久高清精品| 亚洲制服欧美中文字幕中文字幕| 精品一区二区在线视频| 日本高清不卡一区| 久久综合色婷婷| 亚洲午夜成aⅴ人片| 国产精品一品二品| 777久久久精品|