⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asn1.h

📁 很有名的一款用于组织DDoS的恶意机器人程序。仅供研究学习
💻 H
📖 第 1 页 / 共 3 页
字号:
/* crypto/asn1/asn1.h *//* 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 HEADER_ASN1_H#define HEADER_ASN1_H#include <time.h>#ifndef NO_BIO#include <openssl/bio.h>#endif#include <openssl/bn.h>#include <openssl/stack.h>#include <openssl/safestack.h>#include <openssl/symhacks.h>#ifdef  __cplusplusextern "C" {#endif#define V_ASN1_UNIVERSAL		0x00#define	V_ASN1_APPLICATION		0x40#define V_ASN1_CONTEXT_SPECIFIC		0x80#define V_ASN1_PRIVATE			0xc0#define V_ASN1_CONSTRUCTED		0x20#define V_ASN1_PRIMITIVE_TAG		0x1f#define V_ASN1_PRIMATIVE_TAG		0x1f#define V_ASN1_APP_CHOOSE		-2	/* let the recipient choose */#define V_ASN1_OTHER			-3	/* used in ASN1_TYPE */#define V_ASN1_NEG			0x100	/* negative flag */#define V_ASN1_UNDEF			-1#define V_ASN1_EOC			0#define V_ASN1_BOOLEAN			1	/**/#define V_ASN1_INTEGER			2#define V_ASN1_NEG_INTEGER		(2 | V_ASN1_NEG)#define V_ASN1_BIT_STRING		3#define V_ASN1_OCTET_STRING		4#define V_ASN1_NULL			5#define V_ASN1_OBJECT			6#define V_ASN1_OBJECT_DESCRIPTOR	7#define V_ASN1_EXTERNAL			8#define V_ASN1_REAL			9#define V_ASN1_ENUMERATED		10#define V_ASN1_NEG_ENUMERATED		(10 | V_ASN1_NEG)#define V_ASN1_UTF8STRING		12#define V_ASN1_SEQUENCE			16#define V_ASN1_SET			17#define V_ASN1_NUMERICSTRING		18	/**/#define V_ASN1_PRINTABLESTRING		19#define V_ASN1_T61STRING		20#define V_ASN1_TELETEXSTRING		20	/* alias */#define V_ASN1_VIDEOTEXSTRING		21	/**/#define V_ASN1_IA5STRING		22#define V_ASN1_UTCTIME			23#define V_ASN1_GENERALIZEDTIME		24	/**/#define V_ASN1_GRAPHICSTRING		25	/**/#define V_ASN1_ISO64STRING		26	/**/#define V_ASN1_VISIBLESTRING		26	/* alias */#define V_ASN1_GENERALSTRING		27	/**/#define V_ASN1_UNIVERSALSTRING		28	/**/#define V_ASN1_BMPSTRING		30/* For use with d2i_ASN1_type_bytes() */#define B_ASN1_NUMERICSTRING	0x0001#define B_ASN1_PRINTABLESTRING	0x0002#define B_ASN1_T61STRING	0x0004#define B_ASN1_TELETEXSTRING	0x0008#define B_ASN1_VIDEOTEXSTRING	0x0008#define B_ASN1_IA5STRING	0x0010#define B_ASN1_GRAPHICSTRING	0x0020#define B_ASN1_ISO64STRING	0x0040#define B_ASN1_VISIBLESTRING	0x0040#define B_ASN1_GENERALSTRING	0x0080#define B_ASN1_UNIVERSALSTRING	0x0100#define B_ASN1_OCTET_STRING	0x0200#define B_ASN1_BIT_STRING	0x0400#define B_ASN1_BMPSTRING	0x0800#define B_ASN1_UNKNOWN		0x1000#define B_ASN1_UTF8STRING	0x2000/* For use with ASN1_mbstring_copy() */#define MBSTRING_FLAG		0x1000#define MBSTRING_ASC		(MBSTRING_FLAG|1)#define MBSTRING_BMP		(MBSTRING_FLAG|2)#define MBSTRING_UNIV		(MBSTRING_FLAG|3)#define MBSTRING_UTF8		(MBSTRING_FLAG|4)struct X509_algor_st;#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */typedef struct asn1_ctx_st	{	unsigned char *p;/* work char pointer */	int eos;	/* end of sequence read for indefinite encoding */	int error;	/* error code to use when returning an error */	int inf;	/* constructed if 0x20, indefinite is 0x21 */	int tag;	/* tag from last 'get object' */	int xclass;	/* class from last 'get object' */	long slen;	/* length of last 'get object' */	unsigned char *max; /* largest value of p allowed */	unsigned char *q;/* temporary variable */	unsigned char **pp;/* variable */	int line;	/* used in error processing */	} ASN1_CTX;/* These are used internally in the ASN1_OBJECT to keep track of * whether the names and data need to be free()ed */#define ASN1_OBJECT_FLAG_DYNAMIC	 0x01	/* internal use */#define ASN1_OBJECT_FLAG_CRITICAL	 0x02	/* critical x509v3 object id */#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04	/* internal use */#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 	 0x08	/* internal use */typedef struct asn1_object_st	{	const char *sn,*ln;	int nid;	int length;	unsigned char *data;	int flags;	/* Should we free this one */	} ASN1_OBJECT;#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value *//* This is the base type that holds just about everything :-) */typedef struct asn1_string_st	{	int length;	int type;	unsigned char *data;	/* The value of the following field depends on the type being	 * held.  It is mostly being used for BIT_STRING so if the	 * input data has a non-zero 'unused bits' value, it will be	 * handled correctly */	long flags;	} ASN1_STRING;#define STABLE_FLAGS_MALLOC	0x01#define STABLE_NO_MASK		0x02#define DIRSTRING_TYPE	\ (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)typedef struct asn1_string_table_st {	int nid;	long minsize;	long maxsize;	unsigned long mask;	unsigned long flags;} ASN1_STRING_TABLE;DECLARE_STACK_OF(ASN1_STRING_TABLE)/* size limits: this stuff is taken straight from RFC2459 */#define ub_name				32768#define ub_common_name			64#define ub_locality_name		128#define ub_state_name			128#define ub_organization_name		64#define ub_organization_unit_name	64#define ub_title			64#define ub_email_address		128#ifdef NO_ASN1_TYPEDEFS#define ASN1_INTEGER		ASN1_STRING#define ASN1_ENUMERATED		ASN1_STRING#define ASN1_BIT_STRING		ASN1_STRING#define ASN1_OCTET_STRING	ASN1_STRING#define ASN1_PRINTABLESTRING	ASN1_STRING#define ASN1_T61STRING		ASN1_STRING#define ASN1_IA5STRING		ASN1_STRING#define ASN1_UTCTIME		ASN1_STRING#define ASN1_GENERALIZEDTIME	ASN1_STRING#define ASN1_TIME		ASN1_STRING#define ASN1_GENERALSTRING	ASN1_STRING#define ASN1_UNIVERSALSTRING	ASN1_STRING#define ASN1_BMPSTRING		ASN1_STRING#define ASN1_VISIBLESTRING	ASN1_STRING#define ASN1_UTF8STRING		ASN1_STRING#define ASN1_BOOLEAN		int#elsetypedef struct asn1_string_st ASN1_INTEGER;typedef struct asn1_string_st ASN1_ENUMERATED;typedef struct asn1_string_st ASN1_BIT_STRING;typedef struct asn1_string_st ASN1_OCTET_STRING;typedef struct asn1_string_st ASN1_PRINTABLESTRING;typedef struct asn1_string_st ASN1_T61STRING;typedef struct asn1_string_st ASN1_IA5STRING;typedef struct asn1_string_st ASN1_GENERALSTRING;typedef struct asn1_string_st ASN1_UNIVERSALSTRING;typedef struct asn1_string_st ASN1_BMPSTRING;typedef struct asn1_string_st ASN1_UTCTIME;typedef struct asn1_string_st ASN1_TIME;typedef struct asn1_string_st ASN1_GENERALIZEDTIME;typedef struct asn1_string_st ASN1_VISIBLESTRING;typedef struct asn1_string_st ASN1_UTF8STRING;typedef int ASN1_BOOLEAN;#endiftypedef int ASN1_NULL;/* Parameters used by ASN1_STRING_print_ex() *//* These determine which characters to escape: * RFC2253 special characters, control characters and * MSB set characters */#define ASN1_STRFLGS_ESC_2253		1#define ASN1_STRFLGS_ESC_CTRL		2#define ASN1_STRFLGS_ESC_MSB		4/* This flag determines how we do escaping: normally * RC2253 backslash only, set this to use backslash and * quote. */#define ASN1_STRFLGS_ESC_QUOTE		8/* These three flags are internal use only. *//* Character is a valid PrintableString character */#define CHARTYPE_PRINTABLESTRING	0x10/* Character needs escaping if it is the first character */#define CHARTYPE_FIRST_ESC_2253		0x20/* Character needs escaping if it is the last character */#define CHARTYPE_LAST_ESC_2253		0x40/* NB the internal flags are safely reused below by flags * handled at the top level. *//* If this is set we convert all character strings * to UTF8 first  */#define ASN1_STRFLGS_UTF8_CONVERT	0x10/* If this is set we don't attempt to interpret content: * just assume all strings are 1 byte per character. This * will produce some pretty odd looking output! */#define ASN1_STRFLGS_IGNORE_TYPE	0x20/* If this is set we include the string type in the output */#define ASN1_STRFLGS_SHOW_TYPE		0x40/* This determines which strings to display and which to * 'dump' (hex dump of content octets or DER encoding). We can * only dump non character strings or everything. If we * don't dump 'unknown' they are interpreted as character * strings with 1 octet per character and are subject to * the usual escaping options. */#define ASN1_STRFLGS_DUMP_ALL		0x80#define ASN1_STRFLGS_DUMP_UNKNOWN	0x100/* These determine what 'dumping' does, we can dump the * content octets or the DER encoding: both use the * RFC2253 #XXXXX notation. */#define ASN1_STRFLGS_DUMP_DER		0x200/* All the string flags consistent with RFC2253, * escaping control characters isn't essential in * RFC2253 but it is advisable anyway. */#define ASN1_STRFLGS_RFC2253	(ASN1_STRFLGS_ESC_2253 | \				ASN1_STRFLGS_ESC_CTRL | \				ASN1_STRFLGS_ESC_MSB | \				ASN1_STRFLGS_UTF8_CONVERT | \				ASN1_STRFLGS_DUMP_UNKNOWN | \				ASN1_STRFLGS_DUMP_DER)DECLARE_STACK_OF(ASN1_INTEGER)DECLARE_ASN1_SET_OF(ASN1_INTEGER)typedef struct asn1_type_st	{	int type;	union	{		char *ptr;		ASN1_BOOLEAN		boolean;		ASN1_STRING *		asn1_string;		ASN1_OBJECT *		object;		ASN1_INTEGER *		integer;		ASN1_ENUMERATED *	enumerated;		ASN1_BIT_STRING *	bit_string;		ASN1_OCTET_STRING *	octet_string;		ASN1_PRINTABLESTRING *	printablestring;		ASN1_T61STRING *	t61string;		ASN1_IA5STRING *	ia5string;		ASN1_GENERALSTRING *	generalstring;		ASN1_BMPSTRING *	bmpstring;		ASN1_UNIVERSALSTRING *	universalstring;		ASN1_UTCTIME *		utctime;		ASN1_GENERALIZEDTIME *	generalizedtime;		ASN1_VISIBLESTRING *	visiblestring;		ASN1_UTF8STRING *	utf8string;		/* set and sequence are left complete and still		 * contain the set or sequence bytes */		ASN1_STRING *		set;		ASN1_STRING *		sequence;		} value;	} ASN1_TYPE;DECLARE_STACK_OF(ASN1_TYPE)DECLARE_ASN1_SET_OF(ASN1_TYPE)typedef struct asn1_method_st	{	int (*i2d)();	char *(*d2i)();	char *(*create)();	void (*destroy)();	} ASN1_METHOD;/* This is used when parsing some Netscape objects */typedef struct asn1_header_st

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -