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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? easy-tls.c

?? Openssl 0.9.8e 最新版OpenSSL
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* -*- Mode: C; c-file-style: "bsd" -*- *//* * easy-tls.c -- generic TLS proxy. * $Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $ *//* (c) Copyright 1999 Bodo Moeller.  All rights reserved. This is free software; you can redistributed and/or modify it unter the terms of either   -  the GNU General Public License as published by the      Free Software Foundation, version 1, or (at your option)      any later version, or   -  the following license:*//* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that each of the following * conditions is met: * * 1. Redistributions qualify as "freeware" or "Open Source Software" under *    one of the following terms: *  *    (a) Redistributions are made at no charge beyond the reasonable cost of *        materials and delivery. *  *    (b) Redistributions are accompanied by a copy of the Source Code *        or by an irrevocable offer to provide a copy of the Source Code *        for up to three years at the cost of materials and delivery. *        Such redistributions must allow further use, modification, and *        redistribution of the Source Code under substantially the same *        terms as this license. * * 2. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer.  * * 3. 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. * * 4. All advertising materials mentioning features or use of this *    software must display the following acknowledgment: *    "This product includes software developed by Bodo Moeller." *    (If available, substitute umlauted o for oe.) * * 5. Redistributions of any form whatsoever must retain the following *    acknowledgment: *    "This product includes software developed by Bodo Moeller." * * THIS SOFTWARE IS PROVIDED BY BODO MOELLER ``AS IS'' AND ANY * EXPRESSED 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 BODO MOELLER OR * HIS 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. *//* * Attribution for OpenSSL library: * * This product includes cryptographic software written by Eric Young * (eay@cryptsoft.com).  This product includes software written by Tim * Hudson (tjh@cryptsoft.com). * This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.openssl.org/) */static char const rcsid[] ="$Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $";#include <assert.h>#include <errno.h>#include <fcntl.h>#include <limits.h>#include <stdarg.h>#include <stdio.h>#include <string.h>#include <sys/select.h>#include <sys/socket.h>#include <sys/stat.h>#include <sys/time.h>#include <sys/types.h>#include <sys/utsname.h>#include <unistd.h>#include <openssl/crypto.h>#include <openssl/dh.h>#include <openssl/dsa.h>#include <openssl/err.h>#include <openssl/evp.h>#include <openssl/opensslv.h>#include <openssl/pem.h>#include <openssl/rand.h>#ifndef NO_RSA #include <openssl/rsa.h>#endif#include <openssl/ssl.h>#include <openssl/x509.h>#include <openssl/x509_vfy.h>#if OPENSSL_VERSION_NUMBER < 0x00904000L /* 0.9.4-dev */# error "This program needs OpenSSL 0.9.4 or later."#endif#include "easy-tls.h" /* include after <openssl/ssl.h> if both are needed */#if TLS_INFO_SIZE > PIPE_BUF# if PIPE_BUF < 512#  error "PIPE_BUF < 512" /* non-POSIX */# endif# error "TLS_INFO_SIZE > PIPE_BUF"#endif/*****************************************************************************/#ifdef TLS_APP# include TLS_APP#endif/* Applications can define: *   TLS_APP_PROCESS_INIT -- void ...(int fd, int client_p, void *apparg) *   TLS_CUMULATE_ERRORS  *   TLS_ERROR_BUFSIZ *   TLS_APP_ERRFLUSH -- void ...(int child_p, char *, size_t, void *apparg) */#ifndef TLS_APP_PROCESS_INIT# define TLS_APP_PROCESS_INIT(fd, client_p, apparg) ((void) 0)#endif#ifndef TLS_ERROR_BUFSIZ# define TLS_ERROR_BUFSIZ (10*160)#endif#if TLS_ERROR_BUFSIZ < 2 /* {'\n',0} */# error "TLS_ERROR_BUFSIZE is too small."#endif#ifndef TLS_APP_ERRFLUSH# define TLS_APP_ERRFLUSH tls_app_errflushstatic voidtls_app_errflush(int child_p, char *errbuf, size_t num, void *apparg){    fputs(errbuf, stderr);}#endif/*****************************************************************************/#ifdef DEBUG_TLS# define DEBUG_MSG(x) fprintf(stderr,"  %s\n",x)# define DEBUG_MSG2(x,y) fprintf(stderr, "  %s: %d\n",x,y)static int tls_loop_count = 0;static int tls_select_count = 0;#else# define DEBUG_MSG(x) (void)0# define DEBUG_MSG2(x,y) (void)0#endifstatic void tls_rand_seed_uniquely(void);static void tls_proxy(int clear_fd, int tls_fd, int info_fd, SSL_CTX *ctx, int client_p);static int tls_socket_nonblocking(int fd);static int tls_child_p = 0;static void *tls_child_apparg;struct tls_start_proxy_argstls_start_proxy_defaultargs(void){    struct tls_start_proxy_args ret;    ret.fd = -1;    ret.client_p = -1;    ret.ctx = NULL;    ret.pid = NULL;    ret.infofd = NULL;        return ret;}/* Slice in TLS proxy process at fd. * Return value: *   0    ok  (*pid is set to child's PID if pid != NULL), *   < 0  look at errno *   > 0  other error *   (return value encodes place of error) * */inttls_start_proxy(struct tls_start_proxy_args a, void *apparg){    int fds[2] = {-1, -1};    int infofds[2] = {-1, -1};    int r, getfd, getfl;    int ret;    DEBUG_MSG2("tls_start_proxy fd", a.fd);    DEBUG_MSG2("tls_start_proxy client_p", a.client_p);    if (a.fd == -1 || a.client_p == -1 || a.ctx == NULL)	return 1;    if (a.pid != NULL) {	*a.pid = 0;    }    if (a.infofd != NULL) {	*a.infofd = -1;    }    r = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);    if (r == -1)	return -1;    if (a.fd >= FD_SETSIZE || fds[0] >= FD_SETSIZE) {	ret = 2;	goto err;    }    if (a.infofd != NULL) {	r = pipe(infofds);	if (r == -1) {	    ret = -3;	    goto err;	}    }    r = fork();    if (r == -1) {	ret = -4;	goto err;    }    if (r == 0) {	DEBUG_MSG("fork");	tls_child_p = 1;	tls_child_apparg = apparg;	close(fds[1]);	if (infofds[0] != -1)	    close(infofds[0]);	TLS_APP_PROCESS_INIT(a.fd, a.client_p, apparg);	DEBUG_MSG("TLS_APP_PROCESS_INIT");	tls_proxy(fds[0], a.fd, infofds[1], a.ctx, a.client_p);	exit(0);    }    if (a.pid != NULL)	*a.pid = r;    if (infofds[1] != -1) {	close(infofds[1]);	infofds[1] = -1;    }    /* install fds[1] in place of fd: */    close(fds[0]);    fds[0] = -1;    getfd = fcntl(a.fd, F_GETFD);    getfl = fcntl(a.fd, F_GETFL);    r = dup2(fds[1], a.fd);    close(fds[1]);    fds[1] = -1;    if (r == -1) {	ret = -5;	goto err;    }    if (getfd != 1)	fcntl(a.fd, F_SETFD, getfd);    if (getfl & O_NONBLOCK)	(void)tls_socket_nonblocking(a.fd);    if (a.infofd != NULL)	*a.infofd = infofds[0];    return 0;      err:    if (fds[0] != -1)	close(fds[0]);    if (fds[1] != -1)	close(fds[1]);    if (infofds[0] != -1)	close(infofds[0]);    if (infofds[1] != -1)	close(infofds[1]);    return ret;}/*****************************************************************************/static char errbuf[TLS_ERROR_BUFSIZ];static size_t errbuf_i = 0;static voidtls_errflush(void *apparg){    if (errbuf_i == 0)	return;        assert(errbuf_i < sizeof errbuf);    assert(errbuf[errbuf_i] == 0);    if (errbuf_i == sizeof errbuf - 1) {	/* make sure we have a newline, even if string has been truncated */	errbuf[errbuf_i - 1] = '\n';    }    /* TLS_APP_ERRFLUSH may modify the string as needed,     * e.g. substitute other characters for \n for convenience */    TLS_APP_ERRFLUSH(tls_child_p, errbuf, errbuf_i, apparg);    errbuf_i = 0;}static voidtls_errprintf(int flush, void *apparg, const char *fmt, ...){    va_list args;    int r;        if (errbuf_i < sizeof errbuf - 1) {	size_t n;	va_start(args, fmt);	n = (sizeof errbuf) - errbuf_i;	r = vsnprintf(errbuf + errbuf_i, n, fmt, args);	if (r >= n)	    r = n - 1;	if (r >= 0) {	    errbuf_i += r;	} else {	    errbuf_i = sizeof errbuf - 1;	    errbuf[errbuf_i] = '\0';	}	assert(errbuf_i < sizeof errbuf);	assert(errbuf[errbuf_i] == 0);    }#ifndef TLS_CUMULATE_ERRORS    tls_errflush(apparg);#else    if (flush)	tls_errflush(apparg);#endif}/* app_prefix.. are for additional information provided by caller. * If OpenSSL error queue is empty, print default_text ("???" if NULL). */static char *tls_openssl_errors(const char *app_prefix_1, const char *app_prefix_2, const char *default_text, void *apparg){    static char reasons[255];    size_t reasons_i;    unsigned long err;    const char *file;    int line;    const char *data;    int flags;    char *errstring;    int printed_something = 0;        reasons_i = 0;    assert(app_prefix_1 != NULL);    assert(app_prefix_2 != NULL);    if (default_text == NULL)	default_text = "?""?""?";        while ((err = ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) {	if (reasons_i < sizeof reasons) {	    size_t n;	    int r;	    n = (sizeof reasons) - reasons_i;	    r = snprintf(reasons + reasons_i, n, "%s%s", (reasons_i > 0 ? ", " : ""), ERR_reason_error_string(err));	    if (r >= n)		r = n - 1;	    if (r >= 0) {		reasons_i += r;	    } else {		reasons_i = sizeof reasons;	    }	    assert(reasons_i <= sizeof reasons);	}		errstring = ERR_error_string(err, NULL);	assert(errstring != NULL);	tls_errprintf(0, apparg, "OpenSSL error%s%s: %s:%s:%d:%s\n", app_prefix_1, app_prefix_2, errstring, file, line, (flags & ERR_TXT_STRING) ? data : "");	printed_something = 1;    }    if (!printed_something) {	assert(reasons_i == 0);	snprintf(reasons, sizeof reasons, "%s", default_text);	tls_errprintf(0, apparg, "OpenSSL error%s%s: %s\n", app_prefix_1, app_prefix_2, default_text);    }#ifdef TLS_CUMULATE_ERRORS        tls_errflush(apparg);#endif    assert(errbuf_i == 0);    return reasons;}/*****************************************************************************/static int tls_init_done = 0;static inttls_init(void *apparg){    if (tls_init_done)	return 0;        SSL_load_error_strings();

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区视频| 久久久精品人体av艺术| 欧美曰成人黄网| 成人a区在线观看| 粉嫩久久99精品久久久久久夜 | 成人动漫视频在线| 国产aⅴ精品一区二区三区色成熟| 国内精品伊人久久久久av影院 | 国产精品一区二区果冻传媒| 激情综合网激情| 国产一区二区三区日韩| 激情欧美日韩一区二区| 国产一区二区三区在线观看免费| 国产伦精品一区二区三区免费 | 蜜臀av性久久久久av蜜臀妖精| 日韩精品乱码免费| 青青草国产成人99久久| 麻豆精品国产传媒mv男同| 久久国产精品区| 国产高清视频一区| 成人动漫精品一区二区| 色婷婷亚洲一区二区三区| 欧美性受xxxx黑人xyx| 91精品黄色片免费大全| 精品久久久网站| 久久久久久久网| 中文字幕一区二| 亚洲毛片av在线| 婷婷夜色潮精品综合在线| 麻豆精品一二三| 粉嫩av一区二区三区| 一本大道综合伊人精品热热| 欧美日韩一区久久| 久久综合精品国产一区二区三区| 国产欧美视频在线观看| 亚洲视频免费看| 香港成人在线视频| 国产一区三区三区| av电影在线不卡| 欧美日韩国产美女| 久久久久久综合| 亚洲免费av高清| 美女高潮久久久| 成人av网站免费| 欧美日韩国产精选| 国产欧美一区二区精品性色超碰| 一区二区视频在线| 久久国产婷婷国产香蕉| av在线这里只有精品| 91精品国产综合久久香蕉麻豆| 国产性做久久久久久| 亚洲精品视频在线| 久久精品99国产精品日本| 色综合色综合色综合| 欧美一区二区三区啪啪| 国产精品欧美精品| 亚洲成年人影院| 国产成a人亚洲精品| 67194成人在线观看| 亚洲色图制服丝袜| 国产一区二区毛片| 欧美精品自拍偷拍动漫精品| 国产精品国产a| 美女视频第一区二区三区免费观看网站 | 夜夜嗨av一区二区三区中文字幕| 国产一区欧美二区| 在线不卡欧美精品一区二区三区| 国产精品视频麻豆| 久久综合综合久久综合| 色婷婷综合久久| 国产精品视频第一区| 久久99热狠狠色一区二区| 在线视频欧美区| 国产蜜臀av在线一区二区三区| 日本午夜精品一区二区三区电影| 色综合久久综合| 亚洲国产成人自拍| 激情另类小说区图片区视频区| 欧美日韩国产精品成人| 亚洲免费观看高清完整版在线观看| 国产精品一二一区| 精品三级av在线| 首页国产欧美久久| 91福利小视频| 亚洲免费成人av| 91首页免费视频| 欧美国产视频在线| 国产麻豆午夜三级精品| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 粉嫩嫩av羞羞动漫久久久 | 国产精品成人免费| 丁香激情综合国产| 久久久久88色偷偷免费| 久久精品国内一区二区三区| 在线播放日韩导航| 午夜激情综合网| 欧美精品精品一区| 性久久久久久久久久久久| 欧美又粗又大又爽| 亚洲大片精品永久免费| 欧美综合色免费| 亚洲综合免费观看高清在线观看| av在线不卡网| 亚洲女人的天堂| 色噜噜夜夜夜综合网| 伊人开心综合网| 欧美最猛性xxxxx直播| 亚洲国产欧美另类丝袜| 欧美日韩你懂得| 日韩1区2区3区| 欧美成人性福生活免费看| 蜜桃在线一区二区三区| 欧美zozozo| 国产一区二区电影| 中文子幕无线码一区tr| 99久久久久久99| 亚洲黄色免费电影| 欧美日韩精品一区二区在线播放| 亚洲成av人片在线| 欧美一级理论片| 狠狠色狠狠色合久久伊人| 久久奇米777| 99久久久久久| 亚洲成av人片一区二区梦乃| 欧美丰满嫩嫩电影| 精品一区二区三区在线播放视频 | 久久久久久久久伊人| 国产成人8x视频一区二区 | 91在线视频免费观看| 一区二区欧美在线观看| 欧美性猛交xxxx乱大交退制版| 日韩国产一二三区| 久久中文字幕电影| 99精品国产视频| 亚洲h动漫在线| 欧美成人猛片aaaaaaa| 高清成人在线观看| 亚洲精品国产无套在线观| 7777精品伊人久久久大香线蕉最新版| 美女mm1313爽爽久久久蜜臀| 日本一区二区三区免费乱视频| 日本高清无吗v一区| 男人的j进女人的j一区| 日本一区二区综合亚洲| 欧美日韩成人一区| 国产成人精品亚洲777人妖 | 国产一区二区精品久久| 亚洲视频免费看| 日韩精品影音先锋| 波多野结衣的一区二区三区| 香蕉av福利精品导航| 国产校园另类小说区| 欧美日高清视频| 国产大陆a不卡| 亚洲成人黄色小说| 国产精品欧美久久久久无广告| 欧美日韩国产一二三| 成人免费高清在线观看| 日本不卡在线视频| 中文字幕永久在线不卡| 日韩一区和二区| 91久久精品一区二区二区| 国产精品伊人色| 亚洲成人午夜影院| 欧美激情在线一区二区| 欧美一二三在线| 91精品福利视频| 国v精品久久久网| 久久av中文字幕片| 亚洲一区二区三区激情| 久久久99精品久久| 欧美人妇做爰xxxⅹ性高电影| 成人高清视频在线观看| 麻豆91在线播放| 亚洲国产精品久久人人爱| 欧美激情资源网| 欧美成人免费网站| 欧美日韩国产精品成人| 色香色香欲天天天影视综合网| 国产福利91精品一区| 久久精品久久精品| 日韩高清在线电影| 亚洲自拍偷拍综合| 国产精品女人毛片| 国产日韩影视精品| 欧美成人女星排名| 日韩午夜激情免费电影| 欧美色图免费看| 色哦色哦哦色天天综合| 99久免费精品视频在线观看| 国产精品一品二品| 国内外精品视频| 狠狠色丁香九九婷婷综合五月| 日韩电影在线一区| 亚洲成在人线免费| 婷婷久久综合九色国产成人| 亚洲一区国产视频| 一区二区三区四区中文字幕| 亚洲欧美一区二区在线观看| 国产精品久久久久毛片软件|