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

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

?? n_pkey.c

?? openssl包含TLS
?? C
字號:
/* crypto/asn1/n_pkey.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.] */#ifndef OPENSSL_NO_RSA#include <stdio.h>#include "cryptlib.h"#include <openssl/rsa.h>#include <openssl/objects.h>#include <openssl/asn1t.h>#include <openssl/asn1_mac.h>#include <openssl/evp.h>#include <openssl/x509.h>#ifndef OPENSSL_NO_RC4typedef struct netscape_pkey_st	{	long version;	X509_ALGOR *algor;	ASN1_OCTET_STRING *private_key;	} NETSCAPE_PKEY;typedef struct netscape_encrypted_pkey_st	{	ASN1_OCTET_STRING *os;	/* This is the same structure as DigestInfo so use it:	 * although this isn't really anything to do with	 * digests.	 */	X509_SIG *enckey;	} NETSCAPE_ENCRYPTED_PKEY;ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY) = {	ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING),	ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, enckey, X509_SIG)} ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY)DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY,NETSCAPE_ENCRYPTED_PKEY)IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)ASN1_SEQUENCE(NETSCAPE_PKEY) = {	ASN1_SIMPLE(NETSCAPE_PKEY, version, LONG),	ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR),	ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING)} ASN1_SEQUENCE_END(NETSCAPE_PKEY)DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_PKEY,NETSCAPE_PKEY)IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os,	     int (*cb)(), int sgckey);int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, int (*cb)()){	return i2d_RSA_NET(a, pp, cb, 0);}int i2d_RSA_NET(const RSA *a, unsigned char **pp, int (*cb)(), int sgckey)	{	int i, j, ret = 0;	int rsalen, pkeylen, olen;	NETSCAPE_PKEY *pkey = NULL;	NETSCAPE_ENCRYPTED_PKEY *enckey = NULL;	unsigned char buf[256],*zz;	unsigned char key[EVP_MAX_KEY_LENGTH];	EVP_CIPHER_CTX ctx;	if (a == NULL) return(0);	if ((pkey=NETSCAPE_PKEY_new()) == NULL) goto err;	if ((enckey=NETSCAPE_ENCRYPTED_PKEY_new()) == NULL) goto err;	pkey->version = 0;	pkey->algor->algorithm=OBJ_nid2obj(NID_rsaEncryption);	if ((pkey->algor->parameter=ASN1_TYPE_new()) == NULL) goto err;	pkey->algor->parameter->type=V_ASN1_NULL;	rsalen = i2d_RSAPrivateKey(a, NULL);	/* Fake some octet strings just for the initial length	 * calculation. 	 */	pkey->private_key->length=rsalen;	pkeylen=i2d_NETSCAPE_PKEY(pkey,NULL);	enckey->enckey->digest->length = pkeylen;	enckey->os->length = 11;	/* "private-key" */	enckey->enckey->algor->algorithm=OBJ_nid2obj(NID_rc4);	if ((enckey->enckey->algor->parameter=ASN1_TYPE_new()) == NULL) goto err;	enckey->enckey->algor->parameter->type=V_ASN1_NULL;	if (pp == NULL)		{		olen = i2d_NETSCAPE_ENCRYPTED_PKEY(enckey, NULL);		NETSCAPE_PKEY_free(pkey);		NETSCAPE_ENCRYPTED_PKEY_free(enckey);		return olen;		}	/* Since its RC4 encrypted length is actual length */	if ((zz=(unsigned char *)OPENSSL_malloc(rsalen)) == NULL)		{		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);		goto err;		}	pkey->private_key->data = zz;	/* Write out private key encoding */	i2d_RSAPrivateKey(a,&zz);	if ((zz=OPENSSL_malloc(pkeylen)) == NULL)		{		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);		goto err;		}	if (!ASN1_STRING_set(enckey->os, "private-key", -1)) 		{		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);		goto err;		}	enckey->enckey->digest->data = zz;	i2d_NETSCAPE_PKEY(pkey,&zz);	/* Wipe the private key encoding */	OPENSSL_cleanse(pkey->private_key->data, rsalen);			if (cb == NULL)		cb=EVP_read_pw_string;	i=cb(buf,256,"Enter Private Key password:",1);	if (i != 0)		{		ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ASN1_R_BAD_PASSWORD_READ);		goto err;		}	i = strlen((char *)buf);	/* If the key is used for SGC the algorithm is modified a little. */	if(sgckey) {		EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL);		memcpy(buf + 16, "SGCKEYSALT", 10);		i = 26;	}	EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);	OPENSSL_cleanse(buf,256);	/* Encrypt private key in place */	zz = enckey->enckey->digest->data;	EVP_CIPHER_CTX_init(&ctx);	EVP_EncryptInit_ex(&ctx,EVP_rc4(),NULL,key,NULL);	EVP_EncryptUpdate(&ctx,zz,&i,zz,pkeylen);	EVP_EncryptFinal_ex(&ctx,zz + i,&j);	EVP_CIPHER_CTX_cleanup(&ctx);	ret = i2d_NETSCAPE_ENCRYPTED_PKEY(enckey, pp);err:	NETSCAPE_ENCRYPTED_PKEY_free(enckey);	NETSCAPE_PKEY_free(pkey);	return(ret);	}RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)()){	return d2i_RSA_NET(a, pp, length, cb, 0);}RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, int (*cb)(), int sgckey)	{	RSA *ret=NULL;	const unsigned char *p, *kp;	NETSCAPE_ENCRYPTED_PKEY *enckey = NULL;	p = *pp;	enckey = d2i_NETSCAPE_ENCRYPTED_PKEY(NULL, &p, length);	if(!enckey) {		ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_DECODING_ERROR);		return NULL;	}	if ((enckey->os->length != 11) || (strncmp("private-key",		(char *)enckey->os->data,11) != 0))		{		ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_PRIVATE_KEY_HEADER_MISSING);		NETSCAPE_ENCRYPTED_PKEY_free(enckey);		return NULL;		}	if (OBJ_obj2nid(enckey->enckey->algor->algorithm) != NID_rc4)		{		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM);		goto err;	}	kp = enckey->enckey->digest->data;	if (cb == NULL)		cb=EVP_read_pw_string;	if ((ret=d2i_RSA_NET_2(a, enckey->enckey->digest,cb, sgckey)) == NULL) goto err;	*pp = p;	err:	NETSCAPE_ENCRYPTED_PKEY_free(enckey);	return ret;	}static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os,	     int (*cb)(), int sgckey)	{	NETSCAPE_PKEY *pkey=NULL;	RSA *ret=NULL;	int i,j;	unsigned char buf[256];	const unsigned char *zz;	unsigned char key[EVP_MAX_KEY_LENGTH];	EVP_CIPHER_CTX ctx;	i=cb(buf,256,"Enter Private Key password:",0);	if (i != 0)		{		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_BAD_PASSWORD_READ);		goto err;		}	i = strlen((char *)buf);	if(sgckey){		EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL);		memcpy(buf + 16, "SGCKEYSALT", 10);		i = 26;	}			EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);	OPENSSL_cleanse(buf,256);	EVP_CIPHER_CTX_init(&ctx);	EVP_DecryptInit_ex(&ctx,EVP_rc4(),NULL, key,NULL);	EVP_DecryptUpdate(&ctx,os->data,&i,os->data,os->length);	EVP_DecryptFinal_ex(&ctx,&(os->data[i]),&j);	EVP_CIPHER_CTX_cleanup(&ctx);	os->length=i+j;	zz=os->data;	if ((pkey=d2i_NETSCAPE_PKEY(NULL,&zz,os->length)) == NULL)		{		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY);		goto err;		}			zz=pkey->private_key->data;	if ((ret=d2i_RSAPrivateKey(a,&zz,pkey->private_key->length)) == NULL)		{		ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNABLE_TO_DECODE_RSA_KEY);		goto err;		}err:	NETSCAPE_PKEY_free(pkey);	return(ret);	}#endif /* OPENSSL_NO_RC4 */#else /* !OPENSSL_NO_RSA */# if PEDANTICstatic void *dummy=&dummy;# endif#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av在线播放中文字幕| 欧美大黄免费观看| 国产一区二区在线电影| 天堂一区二区在线| 偷拍一区二区三区| 美女网站色91| 国产精品综合网| 国产99精品视频| 国产精品一线二线三线精华| 国产精品91xxx| 成人午夜短视频| 色中色一区二区| 欧美色图天堂网| 欧美影院精品一区| 久久婷婷久久一区二区三区| 精品免费99久久| 欧美激情中文不卡| 国产精品狼人久久影院观看方式| 日本一二三不卡| 亚洲视频电影在线| 亚洲永久精品大片| 日韩**一区毛片| 狠狠v欧美v日韩v亚洲ⅴ| 成人午夜免费视频| 在线一区二区视频| 日韩午夜中文字幕| 国产日韩欧美精品一区| 国产精品久久久久影视| 亚洲高清免费观看高清完整版在线观看| 亚洲福利一二三区| 国产传媒日韩欧美成人| 欧洲精品在线观看| 精品国产乱子伦一区| 亚洲国产精品v| 午夜久久久久久久久久一区二区| 国产一区二区三区久久悠悠色av| 97久久超碰精品国产| 日韩三级免费观看| 中文字幕一区二区三区av| 午夜激情久久久| 不卡的电影网站| 欧美一区二区三区性视频| 亚洲国产成人午夜在线一区| 亚洲成人av电影在线| 国产成人在线视频播放| 欧美精品在线一区二区| 中文幕一区二区三区久久蜜桃| 午夜国产精品影院在线观看| 国产91露脸合集magnet| 51久久夜色精品国产麻豆| 国产精品色哟哟| 日韩中文字幕不卡| 久久国产精品一区二区| 成人短视频下载| 日韩欧美国产1| 日韩精品影音先锋| 欧美三级蜜桃2在线观看| 日本一区二区三区在线观看| 白白色 亚洲乱淫| 亚洲电影第三页| 日韩欧美在线综合网| 粉嫩av一区二区三区在线播放 | 亚洲国产精品一区二区久久恐怖片| 在线免费观看日韩欧美| 蜜臀久久99精品久久久久宅男| 精品国产麻豆免费人成网站| 成人三级在线视频| 香蕉久久一区二区不卡无毒影院| 欧美一级精品大片| av亚洲精华国产精华精| 日韩精品国产欧美| 国产日本一区二区| 欧美日韩国产精品自在自线| 国产精品99久久久久久有的能看| 中文字幕乱码亚洲精品一区| 欧美日韩国产综合久久| 丰满白嫩尤物一区二区| 免费成人在线网站| 亚洲天堂福利av| 欧美v日韩v国产v| 欧美色网站导航| 成人黄色小视频| 久久成人免费电影| 亚洲午夜羞羞片| 国产精品欧美一级免费| 日韩精品一区二区三区在线播放| www.亚洲在线| 国内成人精品2018免费看| 亚洲综合色成人| 亚洲欧美在线观看| 久久久久国产精品麻豆ai换脸| 911国产精品| 欧美无砖砖区免费| 91在线观看成人| 国产精品一区二区在线看| 日韩福利视频导航| 亚洲国产你懂的| 亚洲精品视频在线看| 欧美国产一区视频在线观看| 日韩午夜小视频| 91精品国产欧美一区二区18| 欧美私人免费视频| 色香蕉久久蜜桃| 91视频.com| 一本久道中文字幕精品亚洲嫩| 国产成人在线影院| 国产一区二区三区免费| 国产一本一道久久香蕉| 国产在线不卡一卡二卡三卡四卡| 日韩一区欧美二区| 日韩av电影免费观看高清完整版在线观看 | 免费在线欧美视频| 视频一区二区三区在线| 图片区小说区区亚洲影院| 午夜伦欧美伦电影理论片| 性做久久久久久久免费看| 亚洲在线视频免费观看| 一区二区在线免费观看| 亚洲欧美日韩久久| 一区二区三区在线视频免费观看| 亚洲免费观看视频| 亚洲精品水蜜桃| 视频在线观看一区二区三区| 日韩专区一卡二卡| 日韩成人一区二区三区在线观看| 日本va欧美va精品发布| 开心九九激情九九欧美日韩精美视频电影 | 国产精品亚洲一区二区三区妖精 | 亚洲成人动漫av| 日本欧美一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 日本成人中文字幕| 精品一区二区三区在线观看国产| 精品午夜一区二区三区在线观看| 国产精品一区二区三区网站| 成人午夜av电影| 91美女视频网站| 56国语精品自产拍在线观看| 精品久久久久av影院| 国产精品免费免费| 亚洲国产视频a| 久久爱www久久做| av午夜精品一区二区三区| 在线不卡欧美精品一区二区三区| 日韩一区二区在线看| 国产亲近乱来精品视频| 亚洲视频电影在线| 美国三级日本三级久久99| 懂色av一区二区在线播放| 欧美视频中文一区二区三区在线观看| 欧美一级二级三级乱码| 国产精品素人一区二区| 亚洲一区二区综合| 国产一区二区按摩在线观看| 在线观看视频一区二区欧美日韩| 日韩一区二区精品| 最近日韩中文字幕| 久久 天天综合| 色婷婷综合激情| 久久久久久久综合日本| 亚洲妇女屁股眼交7| 高清不卡一区二区| 在线不卡免费欧美| 亚洲精品中文字幕在线观看| 国产在线一区观看| 欧美丰满高潮xxxx喷水动漫| 亚洲国产成人一区二区三区| 毛片不卡一区二区| 欧洲一区在线观看| 中文字幕亚洲电影| 国产精品911| 日韩美女在线视频| 天堂资源在线中文精品| 不卡av电影在线播放| 精品久久久久久久人人人人传媒 | 国产一区二区在线观看免费| 欧美欧美午夜aⅴ在线观看| 中文字幕第一区综合| 久久国产精品免费| 欧美日韩综合色| 亚洲蜜臀av乱码久久精品蜜桃| 国模无码大尺度一区二区三区| 欧美色手机在线观看| 国产精品二区一区二区aⅴ污介绍| 九一九一国产精品| 精品美女被调教视频大全网站| 亚洲线精品一区二区三区八戒| 波多野结衣亚洲| 中文字幕精品一区二区精品绿巨人| 日本特黄久久久高潮| 欧美精品在欧美一区二区少妇| 亚洲另类在线视频| av电影在线观看不卡 | 日韩欧美一级精品久久| 偷拍一区二区三区| 91麻豆精品国产无毒不卡在线观看 | 欧美日韩国产系列| 亚洲黄色av一区| 成+人+亚洲+综合天堂| 国产精品久线在线观看|