亚洲欧美第一页_禁久久精品乱码_粉嫩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电影在线网| 欧美va亚洲va| 精品乱人伦小说| 亚洲欧洲99久久| 狠狠色狠狠色合久久伊人| 色综合久久久网| 久久亚洲捆绑美女| 日韩黄色免费电影| 91高清在线观看| ㊣最新国产の精品bt伙计久久| 婷婷成人激情在线网| 99精品在线免费| 国产日产精品一区| 国产一区二区免费视频| 在线不卡的av| 亚洲一区二区三区四区在线观看| 成人精品gif动图一区| 久久中文娱乐网| 久久草av在线| 欧美一区二区三区不卡| 日韩专区一卡二卡| 欧美调教femdomvk| 亚洲在线观看免费视频| 日本韩国精品在线| 亚洲精选一二三| 亚洲精品一区二区精华| 久久精品国产一区二区三区免费看| 欧美日韩中字一区| 亚洲成人你懂的| 欧美情侣在线播放| 日本成人超碰在线观看| 欧美妇女性影城| 日本美女一区二区| 欧美成人一区二区| 国产盗摄女厕一区二区三区| 久久视频一区二区| 成人午夜av电影| 136国产福利精品导航| 91美女视频网站| 亚洲一区二区三区四区五区黄| 在线免费观看日韩欧美| 亚洲国产日韩a在线播放性色| 欧美日韩一区在线| 久色婷婷小香蕉久久| 久久亚区不卡日本| 99re8在线精品视频免费播放| 自拍偷拍国产亚洲| 欧美精品成人一区二区三区四区| 男女视频一区二区| 国产人久久人人人人爽| 91在线视频网址| 亚洲成a人v欧美综合天堂下载| 制服丝袜中文字幕一区| 黄一区二区三区| 亚洲欧洲av一区二区三区久久| 欧美性淫爽ww久久久久无| 免费高清成人在线| 国产精品毛片久久久久久| 欧美三级在线播放| 久久99国产精品麻豆| 国产精品久线观看视频| 欧美三级中文字幕| 国产香蕉久久精品综合网| av动漫一区二区| 欧美aaa在线| 最新不卡av在线| 欧美一区二区三区人| 99久久精品免费精品国产| 日本亚洲最大的色成网站www| 欧美国产乱子伦| 69av一区二区三区| 99久免费精品视频在线观看| 日韩电影免费在线看| 综合在线观看色| 精品久久久久久久久久久院品网 | 国产一区在线视频| 亚洲欧美一区二区三区孕妇| 久久综合久色欧美综合狠狠| 日本韩国一区二区| 成人高清伦理免费影院在线观看| 三级成人在线视频| 亚洲精品免费一二三区| 2024国产精品| 这里只有精品视频在线观看| 91麻豆免费看| 国产v综合v亚洲欧| 久久国产尿小便嘘嘘尿| 一区二区三区不卡在线观看| 国产亚洲一区二区三区| 日韩欧美在线综合网| 色综合久久中文字幕综合网| 国产成人在线视频播放| 久久精品国产成人一区二区三区| 亚洲国产日日夜夜| 亚洲男人的天堂一区二区| 国产亚洲欧美一级| 精品少妇一区二区三区免费观看 | 国产精品影视网| 人人狠狠综合久久亚洲| 亚洲国产成人高清精品| 亚洲精品免费在线| 亚洲精品欧美二区三区中文字幕| 中文字幕亚洲不卡| 欧美激情一区不卡| 久久久久久免费网| 久久综合九色欧美综合狠狠| 欧美一区二区国产| 欧美精品一级二级| 欧美高清视频在线高清观看mv色露露十八| 91亚洲精品久久久蜜桃| 91免费看片在线观看| 99久久精品国产毛片| 成人精品一区二区三区四区| 国产成a人亚洲精品| 国产福利91精品一区| 国产成人免费av在线| 岛国av在线一区| 粉嫩av一区二区三区| 成人污视频在线观看| 91丝袜美女网| 欧美性受极品xxxx喷水| 欧美日韩三级视频| 欧美精品自拍偷拍| 日韩美女视频在线| 国产亚洲综合在线| 国产精品你懂的| 亚洲一区二区精品久久av| 亚洲sss视频在线视频| 日本在线不卡一区| 国内精品伊人久久久久av影院| 国产一区视频导航| 91一区二区三区在线播放| 欧美在线一二三四区| 91精品国产综合久久精品| 26uuu久久天堂性欧美| 国产精品拍天天在线| 伊人色综合久久天天| 日本特黄久久久高潮| 国产乱色国产精品免费视频| av毛片久久久久**hd| 欧美三级午夜理伦三级中视频| 欧美一区二区视频在线观看2022| 久久久不卡网国产精品二区| 亚洲欧美视频在线观看| 麻豆精品新av中文字幕| 成人91在线观看| 日韩一区二区免费高清| 国产精品人成在线观看免费 | 91精品一区二区三区久久久久久| 精品对白一区国产伦| 亚洲欧美国产三级| 久久丁香综合五月国产三级网站| 99久久久精品| 欧美精品一区二区三区视频| 亚洲精品乱码久久久久久日本蜜臀| 青青草原综合久久大伊人精品优势| 成人性色生活片| 欧美一级日韩不卡播放免费| 国产精品私人自拍| 另类欧美日韩国产在线| 色域天天综合网| 欧美—级在线免费片| 青青青爽久久午夜综合久久午夜| www.成人在线| 欧美v日韩v国产v| 天堂一区二区在线| 一本色道**综合亚洲精品蜜桃冫| 精品国产青草久久久久福利| 一区二区三区精品| 处破女av一区二区| 欧美精品一区二区精品网| 亚洲妇熟xx妇色黄| av电影在线观看完整版一区二区| 精品区一区二区| 日韩成人精品在线观看| 欧美色中文字幕| 成人免费一区二区三区在线观看| 国产一区二区网址| 91精品综合久久久久久| 亚洲成人一区二区在线观看| 92精品国产成人观看免费 | 成人av电影免费观看| 久久精品亚洲一区二区三区浴池| 日韩高清欧美激情| 欧美日产在线观看| 天天av天天翘天天综合网色鬼国产 | 天堂资源在线中文精品| 欧美日韩一区 二区 三区 久久精品| 亚洲欧美另类小说视频| 午夜免费久久看| 91麻豆蜜桃一区二区三区| 欧美高清在线精品一区| 国产精品一区二区免费不卡| 精品国产1区2区3区| 蜜桃av一区二区在线观看| 91精品久久久久久久99蜜桃| 亚洲成av人片在线观看无码| 欧美亚一区二区| 婷婷综合五月天| 91麻豆精品久久久久蜜臀 |