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

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

?? easy-tls.c

?? mediastreamer2是開源的網絡傳輸媒體流的庫
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* -*- Mode: C; c-file-style: "bsd" -*- *//* * easy-tls.c -- generic TLS proxy. * $Id: easy-tls.c,v 1.1.1.1 2006-06-26 02:22:36 jack 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.1.1.1 2006-06-26 02:22:36 jack 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();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费人成黄页网站在线一区二区| 天天操天天色综合| 自拍偷在线精品自拍偷无码专区| 亚洲成人激情av| 成人性生交大合| 精品国内二区三区| 亚洲大片一区二区三区| 成人高清视频免费观看| 精品三级在线观看| 日本午夜一本久久久综合| 99国产精品一区| 国产日韩一级二级三级| 理论电影国产精品| 日韩一区二区麻豆国产| 亚洲一区二区三区三| 91一区二区三区在线播放| 国产视频一区在线观看| 免费高清成人在线| 日韩三级视频在线观看| 日韩经典中文字幕一区| 在线看日韩精品电影| 亚洲精品久久久久久国产精华液| 国产v日产∨综合v精品视频| 26uuu亚洲| 久久精品国产99国产| 日韩精品最新网址| 免费在线看成人av| 欧美一级精品大片| 日本伊人精品一区二区三区观看方式| 色欧美88888久久久久久影院| 国产精品国产馆在线真实露脸| 国产999精品久久久久久| 久久综合九色综合97婷婷| 韩国av一区二区三区四区| 精品国产乱码久久久久久牛牛| 九色综合狠狠综合久久| 久久嫩草精品久久久精品一| 国产一区999| 欧美激情中文字幕| 91在线免费看| 亚洲综合男人的天堂| 欧美日韩亚洲综合一区二区三区| 伊人色综合久久天天人手人婷| 91热门视频在线观看| 亚洲一区在线视频观看| 欧美精品自拍偷拍| 蜜桃一区二区三区在线| 精品国产乱码久久久久久夜甘婷婷 | 亚洲欧美视频在线观看视频| 99精品视频在线观看免费| 一区二区欧美在线观看| 欧美日韩国产高清一区| 国产曰批免费观看久久久| 中文字幕av一区 二区| jlzzjlzz欧美大全| 亚洲国产精品自拍| 日韩精品一区二区三区视频在线观看 | 亚洲午夜精品网| 日韩美女主播在线视频一区二区三区| 黑人精品欧美一区二区蜜桃| 亚洲欧美一区二区在线观看| 欧美日韩在线免费视频| 久久成人18免费观看| 国产精品久久久久天堂| 精品视频1区2区3区| 寂寞少妇一区二区三区| 亚洲欧美aⅴ...| 精品福利视频一区二区三区| www.爱久久.com| 免费一级片91| 亚洲欧美一区二区久久| 欧美电视剧免费全集观看| 9人人澡人人爽人人精品| 日韩黄色免费网站| 国产蜜臀av在线一区二区三区 | 成人午夜看片网址| 日韩影院精彩在线| 亚洲欧美日韩中文字幕一区二区三区 | 日韩精品中文字幕一区二区三区| 国产精品一二三四五| 国产精品毛片a∨一区二区三区| 一本到不卡免费一区二区| 激情久久五月天| 亚洲国产精品久久久男人的天堂 | 国产成人99久久亚洲综合精品| 亚洲一区二区三区小说| 国产精品区一区二区三| 亚洲精品一区二区三区影院| 欧美日韩精品福利| 99久久综合国产精品| 捆绑变态av一区二区三区| 亚洲高清视频在线| 亚洲美女一区二区三区| 国产精品每日更新在线播放网址| 日韩亚洲欧美中文三级| 欧美日本在线看| 欧洲精品一区二区| 成熟亚洲日本毛茸茸凸凹| 精一区二区三区| 无码av免费一区二区三区试看 | 91黄视频在线| 99视频一区二区| 成人免费看视频| 国产一区999| 国产原创一区二区三区| 久久99精品视频| 免费成人av在线| 日本aⅴ亚洲精品中文乱码| 亚洲成人av免费| 亚洲风情在线资源站| 亚洲国产毛片aaaaa无费看 | 18欧美乱大交hd1984| 中文字幕不卡在线| 国产精品美女www爽爽爽| 日本一区二区在线不卡| 亚洲国产高清不卡| 亚洲国产精品黑人久久久| 欧美国产精品一区二区三区| wwww国产精品欧美| 欧美激情中文不卡| 最新中文字幕一区二区三区| 中文字幕一区在线| 亚洲欧美偷拍卡通变态| 亚洲免费视频中文字幕| 一区二区三区毛片| 天堂久久久久va久久久久| 日本中文字幕一区二区有限公司| 秋霞电影网一区二区| 久久se精品一区精品二区| 激情伊人五月天久久综合| 成人理论电影网| 欧美丝袜丝交足nylons图片| 欧美日韩国产小视频在线观看| 欧美一区二区在线观看| 久久先锋资源网| 日韩一区有码在线| 五月天精品一区二区三区| 狠狠色综合色综合网络| av中文字幕一区| 欧美日韩国产成人在线免费| 欧美精品一区二区三区蜜桃视频| 中文乱码免费一区二区| 亚洲动漫第一页| 国产成人激情av| 欧美巨大另类极品videosbest| 欧美成va人片在线观看| 亚洲色图清纯唯美| 美国欧美日韩国产在线播放| 成人av电影免费观看| 91精品综合久久久久久| 国产精品乱码妇女bbbb| 日韩精品一卡二卡三卡四卡无卡| 国产一区二区三区美女| 色狠狠桃花综合| 国产视频一区在线播放| 午夜精品福利一区二区蜜股av| 国产精品69毛片高清亚洲| 欧美特级限制片免费在线观看| 26uuu亚洲| 亚洲一区二区成人在线观看| 久久99久久99精品免视看婷婷| 福利一区二区在线观看| 91麻豆精品国产91久久久久久久久 | 亚洲国产婷婷综合在线精品| 日本一不卡视频| av网站一区二区三区| 欧美日韩一区在线| 91福利国产成人精品照片| 国产亚洲精品aa| 亚洲午夜在线电影| 国产剧情一区在线| 日韩欧美综合一区| 亚洲免费观看在线视频| 美女网站色91| 91丨九色丨黑人外教| 欧美激情一区在线观看| 丝瓜av网站精品一区二区| 国产成人在线免费观看| 精品国产乱码久久久久久免费| 亚洲精品一二三区| 精品在线观看视频| 成人午夜电影小说| 久久蜜臀中文字幕| 日韩精品亚洲专区| 在线看国产一区| 一区二区三区 在线观看视频| 国产精品综合视频| 欧美一级一区二区| 一色屋精品亚洲香蕉网站| 东方欧美亚洲色图在线| 日韩欧美国产一区二区三区| 亚洲国产欧美日韩另类综合| 91黄色免费看| 亚洲欧美一区二区在线观看| 国产精品18久久久久久久久| 欧美日韩美女一区二区| 午夜亚洲福利老司机| 色女孩综合影院| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 欧美日韩国产一级二级|