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

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

?? easy-tls.c

?? 開源的ssl算法openssl,版本0.9.8H
?? C
?? 第 1 頁 / 共 3 頁
字號(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();

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久免费视频色| 国产精品一级黄| 欧美a一区二区| 成人美女视频在线看| 欧美日韩免费观看一区三区| 日韩欧美国产1| 亚洲日本电影在线| 国产一区二区三区美女| 欧美高清你懂得| 亚洲人快播电影网| 国产成人在线电影| 日韩色视频在线观看| 一个色在线综合| av日韩在线网站| 久久―日本道色综合久久| 久久五月婷婷丁香社区| 黄色资源网久久资源365| 日本在线不卡一区| 国内精品久久久久影院薰衣草| 91精品国产综合久久精品图片 | 久久久久久久久久久久久久久99| 久久91精品国产91久久小草| 欧美午夜精品一区二区三区| 日韩美女视频一区| 欧美三级在线视频| 狠狠色狠狠色综合| 亚洲精品老司机| 99久久久精品免费观看国产蜜| 久久久久久久久久久99999| 波多野结衣在线一区| 欧美va亚洲va在线观看蝴蝶网| 偷拍与自拍一区| 久久精品国产精品亚洲红杏| 精品国产99国产精品| 一区二区三区四区乱视频| 欧美放荡的少妇| 成人黄色一级视频| 全国精品久久少妇| 国产精品嫩草影院com| 国产精品一区二区久久精品爱涩| 成人免费小视频| 91污片在线观看| 亚洲精品乱码久久久久| 久久综合色婷婷| 欧美视频精品在线| 国产成人av影院| 日韩综合小视频| 精品欧美一区二区三区精品久久| 99久久婷婷国产| 国产精品一区二区男女羞羞无遮挡| 亚洲一区二区五区| 日韩欧美综合一区| 一本大道av一区二区在线播放| 亚洲一区二区三区自拍| 久久精品亚洲精品国产欧美 | 91日韩精品一区| 精品在线免费观看| 亚洲国产精品嫩草影院| 欧美一区二区三区在线看| 美女精品一区二区| 国产精品免费aⅴ片在线观看| 91精品国产综合久久婷婷香蕉| www.亚洲人| 国产综合久久久久久鬼色| 肉色丝袜一区二区| 一区二区三区免费网站| 中文在线资源观看网站视频免费不卡 | 亚洲成av人**亚洲成av**| 91精品久久久久久蜜臀| 日本韩国精品在线| 久久99国产精品尤物| 肉色丝袜一区二区| 亚洲成av人综合在线观看| 亚洲精品乱码久久久久久黑人| 亚洲欧洲精品成人久久奇米网| 久久精品水蜜桃av综合天堂| 日韩欧美中文一区二区| 91精品国产欧美一区二区18| 欧美日韩aaaaaa| 成人午夜激情在线| 国产精品一区二区三区网站| 国产在线不卡视频| 黄色精品一二区| 国产一区亚洲一区| 韩国精品在线观看| 国产精品一区二区三区99| 国产99久久久精品| 日韩中文字幕一区二区三区| 一区二区三区在线免费| 亚洲精品久久久蜜桃| 亚洲图片有声小说| 亚洲va欧美va天堂v国产综合| 亚洲电影一区二区三区| 亚洲h在线观看| 秋霞影院一区二区| 国产精品中文字幕日韩精品| 国产91丝袜在线播放九色| 不卡电影免费在线播放一区| 在线观看亚洲精品| 97成人超碰视| 欧美日韩一级大片网址| 欧美大片国产精品| 国产三级一区二区| 日韩美女啊v在线免费观看| 亚洲综合色网站| 美日韩一级片在线观看| 国产91精品露脸国语对白| 99在线精品免费| 欧美日韩精品免费| 精品奇米国产一区二区三区| 国产精品视频你懂的| 亚洲欧美国产三级| 亚洲地区一二三色| 国产一区中文字幕| 91丨九色丨黑人外教| 欧美日韩精品综合在线| 最新欧美精品一区二区三区| 一区二区在线观看免费视频播放| 久久影院午夜论| 久久人人97超碰com| 亚洲人xxxx| 裸体在线国模精品偷拍| 国产精品一二三区| 欧美午夜免费电影| 日本一区二区三区四区| 久久久久久久久蜜桃| 一区二区三区四区激情| 久久69国产一区二区蜜臀| 高清在线不卡av| 欧美放荡的少妇| 国产精品五月天| 日韩av一级电影| gogogo免费视频观看亚洲一| 欧美美女网站色| 国产精品成人一区二区艾草| 亚洲色图.com| 久久99久久99| 欧美日韩黄视频| 亚洲少妇30p| 韩日av一区二区| 欧美电影一区二区三区| 亚洲精品视频免费看| 国产成人av一区二区三区在线| 欧美三级电影一区| 日韩一区欧美一区| 紧缚奴在线一区二区三区| 欧美图区在线视频| 国产精品毛片无遮挡高清| 精久久久久久久久久久| 51精品国自产在线| 一区二区三区免费看视频| a级精品国产片在线观看| 久久久久久日产精品| 三级在线观看一区二区| 色婷婷精品久久二区二区蜜臀av | 久久99精品视频| 欧美年轻男男videosbes| 一区二区在线观看免费视频播放| 99久久精品免费| 国产区在线观看成人精品 | 777精品伊人久久久久大香线蕉| 亚洲色欲色欲www| 岛国av在线一区| 久久久久久久av麻豆果冻| 免费在线成人网| 91麻豆精品国产91久久久 | 久久精品视频一区二区三区| 久久不见久久见免费视频1| 欧美美女喷水视频| 香蕉久久夜色精品国产使用方法| 91免费看视频| 亚洲少妇30p| 欧美在线一区二区| 亚洲成人一二三| 91精品国产品国语在线不卡| 丝瓜av网站精品一区二区| 欧美日韩在线不卡| 亚洲成av人综合在线观看| 欧美理论电影在线| 日本中文字幕一区| 欧美成人a∨高清免费观看| 日韩电影免费在线观看网站| 欧美一区二区视频网站| 日本在线不卡视频一二三区| 欧美电影免费观看高清完整版| 久久99精品久久久久婷婷| 国产日韩精品视频一区| www.欧美日韩| 亚洲综合一区二区| 欧美一区二区二区| 韩国v欧美v日本v亚洲v| 欧美激情中文不卡| 一本一本久久a久久精品综合麻豆| 日韩美女久久久| 欧美丰满嫩嫩电影| 国产精品自拍在线| 国产精品久久久久久久久晋中| 色综合色狠狠综合色| 天天综合天天做天天综合| 精品国产伦一区二区三区免费|