summaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@openssl.org>1998-12-21 10:52:47 +0000
committerRalf S. Engelschall <rse@openssl.org>1998-12-21 10:52:47 +0000
commitd02b48c63a58ea4367a0e905979f140b7d090f86 (patch)
tree504f62ed3d84799f785b9cd9fab255a21b0e1b0e /crypto/asn1
Import of old SSLeay release: SSLeay 0.8.1b
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/Makefile.ssl118
-rw-r--r--crypto/asn1/a_bitstr.c158
-rw-r--r--crypto/asn1/a_bool.c121
-rw-r--r--crypto/asn1/a_bytes.c337
-rw-r--r--crypto/asn1/a_d2i_fp.c200
-rw-r--r--crypto/asn1/a_digest.c91
-rw-r--r--crypto/asn1/a_dup.c86
-rw-r--r--crypto/asn1/a_hdr.c130
-rw-r--r--crypto/asn1/a_i2d_fp.c119
-rw-r--r--crypto/asn1/a_int.c304
-rw-r--r--crypto/asn1/a_meth.c84
-rw-r--r--crypto/asn1/a_object.c369
-rw-r--r--crypto/asn1/a_octet.c90
-rw-r--r--crypto/asn1/a_print.c161
-rw-r--r--crypto/asn1/a_set.c149
-rw-r--r--crypto/asn1/a_sign.c147
-rw-r--r--crypto/asn1/a_type.c317
-rw-r--r--crypto/asn1/a_utctm.c190
-rw-r--r--crypto/asn1/a_verify.c121
-rw-r--r--crypto/asn1/asn1.err178
-rw-r--r--crypto/asn1/asn1.h786
-rw-r--r--crypto/asn1/asn1_err.c256
-rw-r--r--crypto/asn1/asn1_lib.c433
-rw-r--r--crypto/asn1/asn1_mac.h318
-rw-r--r--crypto/asn1/asn1_par.c387
-rw-r--r--crypto/asn1/d2i_dhp.c108
-rw-r--r--crypto/asn1/d2i_dsap.c101
-rw-r--r--crypto/asn1/d2i_pr.c117
-rw-r--r--crypto/asn1/d2i_pu.c117
-rw-r--r--crypto/asn1/d2i_r_pr.c129
-rw-r--r--crypto/asn1/d2i_r_pu.c100
-rw-r--r--crypto/asn1/d2i_s_pr.c113
-rw-r--r--crypto/asn1/d2i_s_pu.c124
-rw-r--r--crypto/asn1/f_int.c211
-rw-r--r--crypto/asn1/f_string.c210
-rw-r--r--crypto/asn1/i2d_dhp.c128
-rw-r--r--crypto/asn1/i2d_dsap.c121
-rw-r--r--crypto/asn1/i2d_pr.c86
-rw-r--r--crypto/asn1/i2d_pu.c84
-rw-r--r--crypto/asn1/i2d_r_pr.c132
-rw-r--r--crypto/asn1/i2d_r_pu.c118
-rw-r--r--crypto/asn1/i2d_s_pr.c128
-rw-r--r--crypto/asn1/i2d_s_pu.c133
-rw-r--r--crypto/asn1/n_pkey.c364
-rw-r--r--crypto/asn1/p7_dgst.c130
-rw-r--r--crypto/asn1/p7_enc.c120
-rw-r--r--crypto/asn1/p7_enc_c.c127
-rw-r--r--crypto/asn1/p7_evp.c125
-rw-r--r--crypto/asn1/p7_i_s.c120
-rw-r--r--crypto/asn1/p7_lib.c299
-rw-r--r--crypto/asn1/p7_recip.c130
-rw-r--r--crypto/asn1/p7_s_e.c146
-rw-r--r--crypto/asn1/p7_signd.c140
-rw-r--r--crypto/asn1/p7_signi.c149
-rw-r--r--crypto/asn1/pk.c117
-rw-r--r--crypto/asn1/pkcs8.c139
-rw-r--r--crypto/asn1/t_pkey.c389
-rw-r--r--crypto/asn1/t_req.c226
-rw-r--r--crypto/asn1/t_x509.c386
-rw-r--r--crypto/asn1/test.c253
-rw-r--r--crypto/asn1/x_algor.c126
-rw-r--r--crypto/asn1/x_attrib.c152
-rw-r--r--crypto/asn1/x_cinf.c197
-rw-r--r--crypto/asn1/x_crl.c347
-rw-r--r--crypto/asn1/x_exten.c147
-rw-r--r--crypto/asn1/x_info.c108
-rw-r--r--crypto/asn1/x_name.c295
-rw-r--r--crypto/asn1/x_pkey.c153
-rw-r--r--crypto/asn1/x_pubkey.c252
-rw-r--r--crypto/asn1/x_req.c244
-rw-r--r--crypto/asn1/x_sig.c119
-rw-r--r--crypto/asn1/x_spki.c181
-rw-r--r--crypto/asn1/x_val.c118
-rw-r--r--crypto/asn1/x_x509.c155
74 files changed, 13864 insertions, 0 deletions
diff --git a/crypto/asn1/Makefile.ssl b/crypto/asn1/Makefile.ssl
new file mode 100644
index 0000000000..a39e009d27
--- /dev/null
+++ b/crypto/asn1/Makefile.ssl
@@ -0,0 +1,118 @@
+#
+# SSLeay/crypto/asn1/Makefile
+#
+
+DIR= asn1
+TOP= ../..
+CC= cc
+INCLUDES= -I.. -I../../include
+CFLAG=-g
+INSTALLTOP=/usr/local/ssl
+MAKE= make -f Makefile.ssl
+MAKEDEPEND= makedepend -f Makefile.ssl
+MAKEFILE= Makefile.ssl
+AR= ar r
+
+CFLAGS= $(INCLUDES) $(CFLAG)
+
+ERR=asn1
+ERRC=asn1_err
+GENERAL=Makefile README
+TEST=
+APPS=
+
+LIB=$(TOP)/libcrypto.a
+LIBSRC= a_object.c a_bitstr.c a_utctm.c a_int.c a_octet.c a_print.c \
+ a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c \
+ a_sign.c a_digest.c a_verify.c \
+ x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c \
+ x_name.c x_cinf.c x_x509.c x_crl.c x_info.c x_spki.c \
+ d2i_r_pr.c i2d_r_pr.c d2i_r_pu.c i2d_r_pu.c \
+ d2i_s_pr.c i2d_s_pr.c d2i_s_pu.c i2d_s_pu.c \
+ d2i_pu.c d2i_pr.c i2d_pu.c i2d_pr.c\
+ t_req.c t_x509.c t_pkey.c \
+ p7_i_s.c p7_signi.c p7_signd.c p7_recip.c p7_enc_c.c p7_evp.c \
+ p7_dgst.c p7_s_e.c p7_enc.c p7_lib.c \
+ f_int.c f_string.c i2d_dhp.c i2d_dsap.c d2i_dhp.c d2i_dsap.c n_pkey.c \
+ a_hdr.c x_pkey.c a_bool.c x_exten.c \
+ asn1_par.c asn1_lib.c $(ERRC).c a_meth.c a_bytes.c
+LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_int.o a_octet.o a_print.o \
+ a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o \
+ a_sign.o a_digest.o a_verify.o \
+ x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o \
+ x_name.o x_cinf.o x_x509.o x_crl.o x_info.o x_spki.o \
+ d2i_r_pr.o i2d_r_pr.o d2i_r_pu.o i2d_r_pu.o \
+ d2i_s_pr.o i2d_s_pr.o d2i_s_pu.o i2d_s_pu.o \
+ d2i_pu.o d2i_pr.o i2d_pu.o i2d_pr.o \
+ t_req.o t_x509.o t_pkey.o \
+ p7_i_s.o p7_signi.o p7_signd.o p7_recip.o p7_enc_c.o p7_evp.o \
+ p7_dgst.o p7_s_e.o p7_enc.o p7_lib.o \
+ f_int.o f_string.o i2d_dhp.o i2d_dsap.o d2i_dhp.o d2i_dsap.o n_pkey.o \
+ a_hdr.o x_pkey.o a_bool.o x_exten.o \
+ asn1_par.o asn1_lib.o $(ERRC).o a_meth.o a_bytes.o
+
+SRC= $(LIBSRC)
+
+EXHEADER= asn1.h asn1_mac.h
+HEADER= $(EXHEADER)
+
+ALL= $(GENERAL) $(SRC) $(HEADER)
+
+top:
+ (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
+
+test: test.c
+ cc -g -I../../include -c test.c
+ cc -g -I../../include -o test test.o -L../.. -lcrypto
+
+pk: pk.c
+ cc -g -I../../include -c pk.c
+ cc -g -I../../include -o pk pk.o -L../.. -lcrypto
+
+all: lib
+
+lib: $(LIBOBJ)
+ $(AR) $(LIB) $(LIBOBJ)
+ sh $(TOP)/util/ranlib.sh $(LIB)
+ @touch lib
+
+files:
+ perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
+
+links:
+ /bin/rm -f Makefile
+ $(TOP)/util/point.sh Makefile.ssl Makefile ;
+ $(TOP)/util/mklink.sh ../../include $(EXHEADER)
+ $(TOP)/util/mklink.sh ../../test $(TEST)
+ $(TOP)/util/mklink.sh ../../apps $(APPS)
+
+install:
+ @for i in $(EXHEADER) ; \
+ do \
+ (cp $$i $(INSTALLTOP)/include/$$i; \
+ chmod 644 $(INSTALLTOP)/include/$$i ); \
+ done;
+
+tags:
+ ctags $(SRC)
+
+tests:
+
+lint:
+ lint -DLINT $(INCLUDES) $(SRC)>fluff
+
+depend:
+ $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
+
+dclean:
+ perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
+ mv -f Makefile.new $(MAKEFILE)
+
+clean:
+ /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+
+errors:
+ perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).h
+ perl ../err/err_genc.pl $(ERR).h $(ERRC).c
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c
new file mode 100644
index 0000000000..eb99ebca2f
--- /dev/null
+++ b/crypto/asn1/a_bitstr.c
@@ -0,0 +1,158 @@
+/* crypto/asn1/a_bitstr.c */
+/* Copyright (C) 1995-1997 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 "cryptlib.h"
+#include "asn1.h"
+
+/* ASN1err(ASN1_F_ASN1_STRING_NEW,ASN1_R_STRING_TOO_SHORT);
+ * ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,ASN1_R_EXPECTING_A_BIT_STRING);
+ */
+
+int i2d_ASN1_BIT_STRING(a,pp)
+ASN1_BIT_STRING *a;
+unsigned char **pp;
+ {
+ int ret,j,r,bits;
+ unsigned char *p,*d;
+
+ if (a == NULL) return(0);
+
+ /* our bit strings are always a multiple of 8 :-) */
+ bits=0;
+ ret=1+a->length;
+ r=ASN1_object_size(0,ret,V_ASN1_BIT_STRING);
+ if (pp == NULL) return(r);
+ p= *pp;
+
+ ASN1_put_object(&p,0,ret,V_ASN1_BIT_STRING,V_ASN1_UNIVERSAL);
+ if (bits == 0)
+ j=0;
+ else j=8-bits;
+ *(p++)=(unsigned char)j;
+ d=a->data;
+ memcpy(p,d,a->length);
+ p+=a->length;
+ if (a->length > 0) p[-1]&=(0xff<<j);
+ *pp=p;
+ return(r);
+ }
+
+ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(a, pp, length)
+ASN1_BIT_STRING **a;
+unsigned char **pp;
+long length;
+ {
+ ASN1_BIT_STRING *ret=NULL;
+ unsigned char *p,*s;
+ long len;
+ int inf,tag,xclass;
+ int i;
+
+ if ((a == NULL) || ((*a) == NULL))
+ {
+ if ((ret=ASN1_BIT_STRING_new()) == NULL) return(NULL);
+ }
+ else
+ ret=(*a);
+
+ p= *pp;
+ inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
+ if (inf & 0x80)
+ {
+ i=ASN1_R_BAD_OBJECT_HEADER;
+ goto err;
+ }
+
+ if (tag != V_ASN1_BIT_STRING)
+ {
+ i=ASN1_R_EXPECTING_A_BIT_STRING;
+ goto err;
+ }
+ if (len < 1) { i=ASN1_R_STRING_TOO_SHORT; goto err; }
+
+ i= *(p++);
+ if (len-- > 1) /* using one because of the bits left byte */
+ {
+ s=(unsigned char *)Malloc((int)len);
+ if (s == NULL)
+ {
+ i=ERR_R_MALLOC_FAILURE;
+ goto err;
+ }
+ memcpy(s,p,(int)len);
+ s[len-1]&=(0xff<<i);
+ p+=len;
+ }
+ else
+ s=NULL;
+
+ ret->length=(int)len;
+ if (ret->data != NULL) Free((char *)ret->data);
+ ret->data=s;
+ ret->type=V_ASN1_BIT_STRING;
+ if (a != NULL) (*a)=ret;
+ *pp=p;
+ return(ret);
+err:
+ ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i);
+ if ((ret != NULL) && ((a == NULL) || (*a != ret)))
+ ASN1_BIT_STRING_free(ret);
+ return(NULL);
+ }
+
diff --git a/crypto/asn1/a_bool.c b/crypto/asn1/a_bool.c
new file mode 100644
index 0000000000..83607b58ef
--- /dev/null
+++ b/crypto/asn1/a_bool.c
@@ -0,0 +1,121 @@
+/* crypto/asn1/a_bool.c */
+/* Copyright (C) 1995-1997 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 "cryptlib.h"
+#include "asn1.h"
+
+/* ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,ASN1_R_EXPECTING_A_BOOLEAN);
+ * ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
+ */
+
+int i2d_ASN1_BOOLEAN(a,pp)
+int a;
+unsigned char **pp;
+ {
+ int r;
+ unsigned char *p;
+
+ r=ASN1_object_size(0,1,V_ASN1_BOOLEAN);
+ if (pp == NULL) return(r);
+ p= *pp;
+
+ ASN1_put_object(&p,0,1,V_ASN1_BOOLEAN,V_ASN1_UNIVERSAL);
+ *(p++)= (unsigned char)a;
+ *pp=p;
+ return(r);
+ }
+
+int d2i_ASN1_BOOLEAN(a, pp, length)
+int *a;
+unsigned char **pp;
+long length;
+ {
+ int ret= -1;
+ unsigned char *p;
+ long len;
+ int inf,tag,xclass;
+ int i=0;
+
+ p= *pp;
+ inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
+ if (inf & 0x80)
+ {
+ i=ASN1_R_BAD_OBJECT_HEADER;
+ goto err;
+ }
+
+ if (tag != V_ASN1_BOOLEAN)
+ {
+ i=ASN1_R_EXPECTING_A_BOOLEAN;
+ goto err;
+ }
+
+ if (len != 1)
+ {
+ i=ASN1_R_BOOLEAN_IS_WRONG_LENGTH;
+ goto err;
+ }
+ ret= (int)*(p++);
+ if (a != NULL) (*a)=ret;
+ *pp=p;
+ return(ret);
+err:
+ ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,i);
+ return(ret);
+ }
diff --git a/crypto/asn1/a_bytes.c b/crypto/asn1/a_bytes.c
new file mode 100644
index 0000000000..0c9132498c
--- /dev/null
+++ b/crypto/asn1/a_bytes.c
@@ -0,0 +1,337 @@
+/* crypto/asn1/a_bytes.c */
+/* Copyright (C) 1995-1997 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