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

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

?? req.c

?? openssl中req程序的VC實(shí)現(xiàn)
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/* apps/req.c *//* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. *  * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to.  The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code.  The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). *  * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. *  * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright *    notice, this list of conditions and the following disclaimer. * 2. 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. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *    "This product includes cryptographic software written by *     Eric Young (eay@cryptsoft.com)" *    The word 'cryptographic' can be left out if the rouines from the library *    being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from  *    the apps directory (application code) you must include an acknowledgement: *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" *  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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. *  * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed.  i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */#include <stdio.h>#include <stdlib.h>#include <time.h>#include <string.h>#ifdef NO_STDIO#define APPS_WIN16#endif#include "apps.h"#include <openssl/bio.h>#include <openssl/evp.h>#include <openssl/conf.h>#include <openssl/err.h>#include <openssl/asn1.h>#include <openssl/x509.h>#include <openssl/x509v3.h>#include <openssl/objects.h>#include <openssl/pem.h>#define SECTION		"req"#define BITS		"default_bits"#define KEYFILE		"default_keyfile"#define PROMPT		"prompt"#define DISTINGUISHED_NAME	"distinguished_name"#define ATTRIBUTES	"attributes"#define V3_EXTENSIONS	"x509_extensions"#define REQ_EXTENSIONS	"req_extensions"#define STRING_MASK	"string_mask"#define DEFAULT_KEY_LENGTH	512#define MIN_KEY_LENGTH		384#undef PROG#define PROG	req_main/* -inform arg	- input format - default PEM (DER or PEM) * -outform arg - output format - default PEM * -in arg	- input file - default stdin * -out arg	- output file - default stdout * -verify	- check request signature * -noout	- don't print stuff out. * -text	- print out human readable text. * -nodes	- no des encryption * -config file	- Load configuration file. * -key file	- make a request using key in file (or use it for verification). * -keyform	- key file format. * -rand file(s) - load the file(s) into the PRNG. * -newkey	- make a key and a request. * -modulus	- print RSA modulus. * -x509	- output a self signed X509 structure instead. * -asn1-kludge	- output new certificate request in a format that some CA's *		  require.  This format is wrong */static int make_REQ(X509_REQ *req,EVP_PKEY *pkey,int attribs);static int prompt_info(X509_REQ *req,		STACK_OF(CONF_VALUE) *dn_sk, char *dn_sect,		STACK_OF(CONF_VALUE) *attr_sk, char *attr_sect, int attribs);static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *sk,				STACK_OF(CONF_VALUE) *attr, int attribs);static int add_attribute_object(X509_REQ *req, char *text,				char *def, char *value, int nid, int min,				int max);static int add_DN_object(X509_NAME *n, char *text, char *def, char *value,	int nid,int min,int max);#ifndef NO_RSAstatic void MS_CALLBACK req_cb(int p,int n,void *arg);#endifstatic int req_check_len(int len,int min,int max);static int check_end(char *str, char *end);#ifndef MONOLITHstatic char *default_config_file=NULL;//static LHASH *config=NULL;#endifstatic LHASH *req_conf=NULL;#define TYPE_RSA	1#define TYPE_DSA	2#define TYPE_DH		3int MAIN(int, char **);int MAIN(int argc, char **argv)	{#ifndef NO_DSA	DSA *dsa_params=NULL;#endif	int ex=1,x509=0,days=30;	X509 *x509ss=NULL;	X509_REQ *req=NULL;	EVP_PKEY *pkey=NULL;	int i,badops=0,newreq=0,newkey= -1,pkey_type=0;	BIO *in=NULL,*out=NULL;	int informat,outformat,verify=0,noout=0,text=0,keyform=FORMAT_PEM;	int nodes=0,kludge=0,newhdr=0;	char *infile,*outfile,*prog,*keyfile=NULL,*template=NULL,*keyout=NULL;	char *extensions = NULL;	char *req_exts = NULL;	EVP_CIPHER *cipher=NULL;	int modulus=0;	char *inrand=NULL;	char *passargin = NULL, *passargout = NULL;	char *passin = NULL, *passout = NULL;	char *p;	const EVP_MD *md_alg=NULL,*digest=EVP_md5();#ifndef MONOLITH	MS_STATIC char config_name[256];#endif	req_conf = NULL;#ifndef NO_DES	cipher=EVP_des_ede3_cbc();#endif	apps_startup();	if (bio_err == NULL)		if ((bio_err=BIO_new(BIO_s_file())) != NULL)			BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);	infile=NULL;	outfile=NULL;	informat=FORMAT_PEM;	outformat=FORMAT_PEM;	prog=argv[0];	argc--;	argv++;	while (argc >= 1)		{		if 	(strcmp(*argv,"-inform") == 0)			{			if (--argc < 1) goto bad;			informat=str2fmt(*(++argv));			}		else if (strcmp(*argv,"-outform") == 0)			{			if (--argc < 1) goto bad;			outformat=str2fmt(*(++argv));			}		else if (strcmp(*argv,"-key") == 0)			{			if (--argc < 1) goto bad;			keyfile= *(++argv);			}		else if (strcmp(*argv,"-new") == 0)			{			pkey_type=TYPE_RSA;			newreq=1;			}		else if (strcmp(*argv,"-config") == 0)			{				if (--argc < 1) goto bad;			template= *(++argv);			}		else if (strcmp(*argv,"-keyform") == 0)			{			if (--argc < 1) goto bad;			keyform=str2fmt(*(++argv));			}		else if (strcmp(*argv,"-in") == 0)			{			if (--argc < 1) goto bad;			infile= *(++argv);			}		else if (strcmp(*argv,"-out") == 0)			{			if (--argc < 1) goto bad;			outfile= *(++argv);			}		else if (strcmp(*argv,"-keyout") == 0)			{			if (--argc < 1) goto bad;			keyout= *(++argv);			}		else if (strcmp(*argv,"-passin") == 0)			{			if (--argc < 1) goto bad;			passargin= *(++argv);			}		else if (strcmp(*argv,"-passout") == 0)			{			if (--argc < 1) goto bad;			passargout= *(++argv);			}		else if (strcmp(*argv,"-rand") == 0)			{			if (--argc < 1) goto bad;			inrand= *(++argv);			}		else if (strcmp(*argv,"-newkey") == 0)			{			int is_numeric;			if (--argc < 1) goto bad;			p= *(++argv);			is_numeric = p[0] >= '0' && p[0] <= '9';			if (strncmp("rsa:",p,4) == 0 || is_numeric)				{				pkey_type=TYPE_RSA;				if(!is_numeric)				    p+=4;				newkey= atoi(p);				}			else#ifndef NO_DSA				if (strncmp("dsa:",p,4) == 0)				{				X509 *xtmp=NULL;				EVP_PKEY *dtmp;				pkey_type=TYPE_DSA;				p+=4;				if ((in=BIO_new_file(p,"r")) == NULL)					{					perror(p);					goto end;					}				if ((dsa_params=PEM_read_bio_DSAparams(in,NULL,NULL,NULL)) == NULL)					{					ERR_clear_error();					(void)BIO_reset(in);					if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)						{						BIO_printf(bio_err,"unable to load DSA parameters from file\n");						goto end;						}					if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end;					if (dtmp->type == EVP_PKEY_DSA)						dsa_params=DSAparams_dup(dtmp->pkey.dsa);					EVP_PKEY_free(dtmp);					X509_free(xtmp);					if (dsa_params == NULL)						{						BIO_printf(bio_err,"Certificate does not contain DSA parameters\n");						goto end;						}					}				BIO_free(in);				newkey=BN_num_bits(dsa_params->p);				in=NULL;				}			else #endif#ifndef NO_DH				if (strncmp("dh:",p,4) == 0)				{				pkey_type=TYPE_DH;				p+=3;				}			else#endif				pkey_type=TYPE_RSA;			newreq=1;			}		else if (strcmp(*argv,"-newhdr") == 0)			newhdr=1;		else if (strcmp(*argv,"-modulus") == 0)			modulus=1;		else if (strcmp(*argv,"-verify") == 0)			verify=1;		else if (strcmp(*argv,"-nodes") == 0)			nodes=1;		else if (strcmp(*argv,"-noout") == 0)			noout=1;		else if (strcmp(*argv,"-text") == 0)			text=1;		else if (strcmp(*argv,"-x509") == 0)			x509=1;		else if (strcmp(*argv,"-asn1-kludge") == 0)			kludge=1;		else if (strcmp(*argv,"-no-asn1-kludge") == 0)			kludge=0;		else if (strcmp(*argv,"-days") == 0)			{			if (--argc < 1) goto bad;			days= atoi(*(++argv));			if (days == 0) days=30;			}		else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)			{			/* ok */			digest=md_alg;			}		else if (strcmp(*argv,"-extensions") == 0)			{			if (--argc < 1) goto bad;			extensions = *(++argv);			}		else if (strcmp(*argv,"-reqexts") == 0)			{			if (--argc < 1) goto bad;			req_exts = *(++argv);			}		else			{			BIO_printf(bio_err,"unknown option %s\n",*argv);			badops=1;			break;			}		argc--;		argv++;		}	if (badops)		{bad:		BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog);		BIO_printf(bio_err,"where options  are\n");		BIO_printf(bio_err," -inform arg    input format - DER or PEM\n");		BIO_printf(bio_err," -outform arg   output format - DER or PEM\n");		BIO_printf(bio_err," -in arg        input file\n");		BIO_printf(bio_err," -out arg       output file\n");		BIO_printf(bio_err," -text          text form of request\n");		BIO_printf(bio_err," -noout         do not output REQ\n");		BIO_printf(bio_err," -verify        verify signature on REQ\n");		BIO_printf(bio_err," -modulus       RSA modulus\n");		BIO_printf(bio_err," -nodes         don't encrypt the output key\n");		BIO_printf(bio_err," -key file	use the private key contained in file\n");		BIO_printf(bio_err," -keyform arg   key file format\n");		BIO_printf(bio_err," -keyout arg    file to send the key to\n");		BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);		BIO_printf(bio_err,"                load the file (or the files in the directory) into\n");		BIO_printf(bio_err,"                the random number generator\n");		BIO_printf(bio_err," -newkey rsa:bits generate a new RSA key of 'bits' in size\n");		BIO_printf(bio_err," -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");		BIO_printf(bio_err," -[digest]      Digest to sign with (md5, sha1, md2, mdc2, md4)\n");		BIO_printf(bio_err," -config file   request template file.\n");		BIO_printf(bio_err," -new           new request.\n");		BIO_printf(bio_err," -x509          output a x509 structure instead of a cert. req.\n");		BIO_printf(bio_err," -days          number of days a x509 generated by -x509 is valid for.\n");		BIO_printf(bio_err," -newhdr        output \"NEW\" in the header lines\n");		BIO_printf(bio_err," -asn1-kludge   Output the 'request' in a format that is wrong but some CA's\n");		BIO_printf(bio_err,"                have been reported as requiring\n");		BIO_printf(bio_err," -extensions .. specify certificate extension section (override value in config file)\n");		BIO_printf(bio_err," -reqexts ..    specify request extension section (override value in config file)\n");		goto end;		}	ERR_load_crypto_strings();	if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {		BIO_printf(bio_err, "Error getting passwords\n");		goto end;	}#ifndef MONOLITH /* else this has happened in openssl.c (global `config') */	/* Lets load up our environment a little */	p=getenv("OPENSSL_CONF");	if (p == NULL)		p=getenv("SSLEAY_CONF");	if (p == NULL)		{		strcpy(config_name,X509_get_default_cert_area());#ifndef VMS		strcat(config_name,"/");#endif		strcat(config_name,OPENSSL_CONF);		p=config_name;		}	default_config_file=p;	config=CONF_load(config,p,NULL);#endif	if (template != NULL)		{		long errline = -1;		BIO_printf(bio_err,"Using configuration from %s\n",template);		req_conf=CONF_load(NULL,template,&errline);		if (req_conf == NULL)			{			BIO_printf(bio_err,"error on line %ld of %s\n",errline,template);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产免费视频| 久久综合狠狠综合久久激情 | 国产在线精品视频| 秋霞成人午夜伦在线观看| 亚洲va韩国va欧美va精品| 天天综合网 天天综合色| 午夜精品久久久久久久久久久| 亚洲国产精品久久人人爱| 一区二区三区中文字幕精品精品 | 国产成人免费av在线| 国产呦精品一区二区三区网站| 国产一区二区三区在线观看免费| 九色porny丨国产精品| 国产精品亚洲专一区二区三区| 国产一区二区三区黄视频 | 欧美性一区二区| 在线日韩国产精品| 欧美色综合网站| 欧美人狂配大交3d怪物一区| 91精品一区二区三区在线观看| 91精品国产品国语在线不卡| 精品国产免费久久| 国产精品高潮呻吟| 亚洲靠逼com| 五月天亚洲精品| 久久99精品久久久久久动态图| 风间由美一区二区三区在线观看 | 国产成人高清视频| 成人av资源网站| 欧美亚洲国产一卡| 日韩欧美亚洲国产精品字幕久久久| 精品成人私密视频| 亚洲欧洲99久久| 五月激情丁香一区二区三区| 激情综合一区二区三区| 99久久久免费精品国产一区二区| 欧美伊人久久久久久午夜久久久久| 在线播放日韩导航| 久久久久9999亚洲精品| 亚洲三级小视频| 免费成人性网站| 成人v精品蜜桃久久一区| 欧美日韩国产美女| 精品国产伦理网| 一二三区精品福利视频| 久久精品国产一区二区| 不卡电影一区二区三区| 欧美日高清视频| 日本一区二区三区高清不卡 | 色婷婷综合久久久久中文 | 亚洲欧洲日韩在线| 日韩电影在线观看一区| 欧美一区二区三区四区在线观看 | 同产精品九九九| 国产91丝袜在线观看| 欧美日韩一区在线| 国产欧美日韩三级| 午夜亚洲福利老司机| 成人在线综合网| 欧美一区二区三区视频| 136国产福利精品导航| 国内精品自线一区二区三区视频| 日本韩国精品在线| 国产喂奶挤奶一区二区三区| 五月激情综合色| 91捆绑美女网站| 久久精品视频免费| 天堂在线一区二区| 日本电影亚洲天堂一区| 国产精品久久久久一区二区三区共| 日本午夜精品视频在线观看 | 欧美亚洲图片小说| 中文字幕欧美激情一区| 久久不见久久见免费视频7| 91国产免费看| 亚洲人成人一区二区在线观看 | 成人av资源下载| 精品福利一二区| 日本成人在线不卡视频| 在线观看国产日韩| 亚洲欧洲国产专区| 国产成人精品免费一区二区| 欧美成人综合网站| 日韩精品福利网| 欧美色视频一区| 一区二区三区精品视频| 成人精品免费看| 国产调教视频一区| 久久国产精品99久久久久久老狼 | 精品国产一区二区三区久久影院 | 欧美色综合网站| 亚洲一区精品在线| 91麻豆成人久久精品二区三区| 国产女同性恋一区二区| 欧美区视频在线观看| 亚洲视频在线观看三级| 99久久久免费精品国产一区二区| 国产欧美一二三区| 国产jizzjizz一区二区| 欧美激情一区二区三区蜜桃视频| 国产真实乱对白精彩久久| 精品奇米国产一区二区三区| 美女尤物国产一区| 日韩精品一区二区三区蜜臀| 免费成人深夜小野草| 制服丝袜激情欧洲亚洲| 日韩精品电影在线| 制服丝袜av成人在线看| 日韩av中文在线观看| 日韩视频一区二区在线观看| 强制捆绑调教一区二区| 精品国偷自产国产一区| 狠狠色丁香婷婷综合| 久久精品人人做人人爽人人| 国产精品1区2区3区在线观看| 亚洲国产精华液网站w| av电影在线观看完整版一区二区| 国产精品久久久久国产精品日日 | 日韩欧美亚洲国产另类| 国内外精品视频| 国产精品五月天| 色菇凉天天综合网| 日韩国产欧美在线视频| 欧美成人a在线| 国产九色sp调教91| 亚洲丝袜另类动漫二区| 欧美午夜一区二区三区| 天天av天天翘天天综合网| 精品日韩一区二区三区免费视频| 国产·精品毛片| 亚洲丝袜制服诱惑| 91精品久久久久久久久99蜜臂| 久久不见久久见免费视频1| 国产亚洲欧洲一区高清在线观看| 成人av在线播放网站| 一区二区三区精品| 欧美一区二区视频网站| 欧美日韩国产精品成人| 免费成人在线影院| 国产蜜臀av在线一区二区三区| 在线观看免费视频综合| 捆绑变态av一区二区三区| 国产精品夫妻自拍| 91精品啪在线观看国产60岁| 国产精品一区二区三区网站| 一区二区三区精密机械公司| 精品国产91亚洲一区二区三区婷婷 | 日本成人在线看| 中文一区在线播放| 欧美巨大另类极品videosbest | 国产丝袜在线精品| 欧美午夜免费电影| 国产一区二区三区香蕉| 亚洲综合免费观看高清完整版| 日韩欧美一级二级三级久久久| 成人av网站在线观看| 日韩av一二三| 亚洲女女做受ⅹxx高潮| 日韩欧美一区二区免费| 99精品国产99久久久久久白柏 | 欧美男女性生活在线直播观看| 国产乱码精品一区二区三区av| 一区二区三区欧美日韩| 久久亚洲精精品中文字幕早川悠里| 91在线码无精品| 国产乱码精品一区二区三区五月婷| 亚洲福利视频导航| 中文字幕日韩欧美一区二区三区| 精品日韩99亚洲| 欧美日本韩国一区二区三区视频 | 精品少妇一区二区三区在线播放 | 国产成人亚洲精品狼色在线| 午夜久久久久久久久| 蜜臀av一区二区| 亚洲啪啪综合av一区二区三区| 久久综合狠狠综合久久综合88| 欧美美女黄视频| 在线观看日韩电影| 成人国产精品免费观看视频| 精品一二三四区| 舔着乳尖日韩一区| 亚洲午夜久久久久久久久久久| 国产精品美女久久久久aⅴ国产馆| 日韩欧美高清一区| 欧美久久一二区| 91精彩视频在线| 91在线看国产| av成人老司机| av在线不卡网| 丰满白嫩尤物一区二区| 国精产品一区一区三区mba桃花| 欧美a级一区二区| 日韩av电影天堂| 亚洲高清不卡在线观看| 亚洲精品高清在线| 中文字幕一区二区在线播放| 中文字幕欧美激情一区| 国产精品午夜电影| 国产精品日日摸夜夜摸av| 国产欧美精品区一区二区三区|