From ad7148cc98d85da1fe9f1dde3e946c8c62e2df65 Mon Sep 17 00:00:00 2001 From: markm Date: Tue, 28 Jan 2003 22:12:30 +0000 Subject: Remove files no longer on OpenSSL 0.9.7. crypto/des/rnd_keys.c is retained as it is still used. --- crypto/openssl/crypto/asn1/a_bmp.c | 89 ---- crypto/openssl/crypto/asn1/a_null.c | 119 ----- crypto/openssl/crypto/asn1/a_vis.c | 89 ---- crypto/openssl/crypto/asn1/d2i_dhp.c | 102 ----- crypto/openssl/crypto/asn1/d2i_dsap.c | 99 ----- crypto/openssl/crypto/asn1/d2i_r_pr.c | 129 ------ crypto/openssl/crypto/asn1/d2i_r_pu.c | 103 ----- crypto/openssl/crypto/asn1/d2i_s_pr.c | 106 ----- crypto/openssl/crypto/asn1/d2i_s_pu.c | 121 ----- crypto/openssl/crypto/asn1/i2d_dhp.c | 128 ------ crypto/openssl/crypto/asn1/i2d_dsap.c | 117 ----- crypto/openssl/crypto/asn1/i2d_r_pr.c | 133 ------ crypto/openssl/crypto/asn1/i2d_r_pu.c | 118 ----- crypto/openssl/crypto/asn1/i2d_s_pr.c | 123 ----- crypto/openssl/crypto/asn1/i2d_s_pu.c | 129 ------ crypto/openssl/crypto/asn1/p7_dgst.c | 121 ----- crypto/openssl/crypto/asn1/p7_enc.c | 111 ----- crypto/openssl/crypto/asn1/p7_enc_c.c | 120 ----- crypto/openssl/crypto/asn1/p7_evp.c | 119 ----- crypto/openssl/crypto/asn1/p7_i_s.c | 111 ----- crypto/openssl/crypto/asn1/p7_lib.c | 393 ---------------- crypto/openssl/crypto/asn1/p7_recip.c | 125 ------ crypto/openssl/crypto/asn1/p7_s_e.c | 145 ------ crypto/openssl/crypto/asn1/p7_signd.c | 135 ------ crypto/openssl/crypto/asn1/p7_signi.c | 150 ------- crypto/openssl/crypto/bn/test.c | 241 ---------- crypto/openssl/crypto/des/FILES | 96 ---- crypto/openssl/crypto/pkcs12/p12_bags.c | 192 -------- crypto/openssl/crypto/pkcs12/p12_lib.c | 111 ----- crypto/openssl/crypto/pkcs12/p12_mac.c | 110 ----- crypto/openssl/crypto/pkcs12/p12_sbag.c | 234 ---------- crypto/openssl/doc/crypto/BIO_new_bio_pair.pod | 102 ----- crypto/openssl/perl/MANIFEST | 17 - crypto/openssl/perl/Makefile.PL | 45 -- crypto/openssl/perl/OpenSSL.pm | 90 ---- crypto/openssl/perl/OpenSSL.xs | 82 ---- crypto/openssl/perl/README.1ST | 4 - crypto/openssl/perl/openssl.h | 96 ---- crypto/openssl/perl/openssl_bio.xs | 450 ------------------- crypto/openssl/perl/openssl_bn.xs | 593 ------------------------- crypto/openssl/perl/openssl_cipher.xs | 154 ------- crypto/openssl/perl/openssl_digest.xs | 84 ---- crypto/openssl/perl/openssl_err.xs | 47 -- crypto/openssl/perl/openssl_ssl.xs | 483 -------------------- crypto/openssl/perl/openssl_x509.xs | 75 ---- crypto/openssl/perl/t/01-use.t | 13 - crypto/openssl/perl/t/02-version.t | 10 - crypto/openssl/perl/t/03-bio.t | 16 - crypto/openssl/perl/typemap | 96 ---- 49 files changed, 6676 deletions(-) delete mode 100644 crypto/openssl/crypto/asn1/a_bmp.c delete mode 100644 crypto/openssl/crypto/asn1/a_null.c delete mode 100644 crypto/openssl/crypto/asn1/a_vis.c delete mode 100644 crypto/openssl/crypto/asn1/d2i_dhp.c delete mode 100644 crypto/openssl/crypto/asn1/d2i_dsap.c delete mode 100644 crypto/openssl/crypto/asn1/d2i_r_pr.c delete mode 100644 crypto/openssl/crypto/asn1/d2i_r_pu.c delete mode 100644 crypto/openssl/crypto/asn1/d2i_s_pr.c delete mode 100644 crypto/openssl/crypto/asn1/d2i_s_pu.c delete mode 100644 crypto/openssl/crypto/asn1/i2d_dhp.c delete mode 100644 crypto/openssl/crypto/asn1/i2d_dsap.c delete mode 100644 crypto/openssl/crypto/asn1/i2d_r_pr.c delete mode 100644 crypto/openssl/crypto/asn1/i2d_r_pu.c delete mode 100644 crypto/openssl/crypto/asn1/i2d_s_pr.c delete mode 100644 crypto/openssl/crypto/asn1/i2d_s_pu.c delete mode 100644 crypto/openssl/crypto/asn1/p7_dgst.c delete mode 100644 crypto/openssl/crypto/asn1/p7_enc.c delete mode 100644 crypto/openssl/crypto/asn1/p7_enc_c.c delete mode 100644 crypto/openssl/crypto/asn1/p7_evp.c delete mode 100644 crypto/openssl/crypto/asn1/p7_i_s.c delete mode 100644 crypto/openssl/crypto/asn1/p7_lib.c delete mode 100644 crypto/openssl/crypto/asn1/p7_recip.c delete mode 100644 crypto/openssl/crypto/asn1/p7_s_e.c delete mode 100644 crypto/openssl/crypto/asn1/p7_signd.c delete mode 100644 crypto/openssl/crypto/asn1/p7_signi.c delete mode 100644 crypto/openssl/crypto/bn/test.c delete mode 100644 crypto/openssl/crypto/des/FILES delete mode 100644 crypto/openssl/crypto/pkcs12/p12_bags.c delete mode 100644 crypto/openssl/crypto/pkcs12/p12_lib.c delete mode 100644 crypto/openssl/crypto/pkcs12/p12_mac.c delete mode 100644 crypto/openssl/crypto/pkcs12/p12_sbag.c delete mode 100644 crypto/openssl/doc/crypto/BIO_new_bio_pair.pod delete mode 100644 crypto/openssl/perl/MANIFEST delete mode 100644 crypto/openssl/perl/Makefile.PL delete mode 100644 crypto/openssl/perl/OpenSSL.pm delete mode 100644 crypto/openssl/perl/OpenSSL.xs delete mode 100644 crypto/openssl/perl/README.1ST delete mode 100644 crypto/openssl/perl/openssl.h delete mode 100644 crypto/openssl/perl/openssl_bio.xs delete mode 100644 crypto/openssl/perl/openssl_bn.xs delete mode 100644 crypto/openssl/perl/openssl_cipher.xs delete mode 100644 crypto/openssl/perl/openssl_digest.xs delete mode 100644 crypto/openssl/perl/openssl_err.xs delete mode 100644 crypto/openssl/perl/openssl_ssl.xs delete mode 100644 crypto/openssl/perl/openssl_x509.xs delete mode 100644 crypto/openssl/perl/t/01-use.t delete mode 100644 crypto/openssl/perl/t/02-version.t delete mode 100644 crypto/openssl/perl/t/03-bio.t delete mode 100644 crypto/openssl/perl/typemap (limited to 'crypto') diff --git a/crypto/openssl/crypto/asn1/a_bmp.c b/crypto/openssl/crypto/asn1/a_bmp.c deleted file mode 100644 index d9ac5a0..0000000 --- a/crypto/openssl/crypto/asn1/a_bmp.c +++ /dev/null @@ -1,89 +0,0 @@ -/* crypto/asn1/a_bmp.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 -#include "cryptlib.h" -#include - -ASN1_BMPSTRING *ASN1_BMPSTRING_new(void) -{ return M_ASN1_BMPSTRING_new(); } - -void ASN1_BMPSTRING_free(ASN1_BMPSTRING *x) -{ M_ASN1_BMPSTRING_free(x); } - -int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp) - { - return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, - V_ASN1_BMPSTRING,V_ASN1_UNIVERSAL)); - } - -ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp, - long length) - { - ASN1_BMPSTRING *ret=NULL; - - ret=(ASN1_BMPSTRING *)d2i_ASN1_bytes((ASN1_STRING **)a, - pp,length,V_ASN1_BMPSTRING,V_ASN1_UNIVERSAL); - if (ret == NULL) - { - ASN1err(ASN1_F_D2I_ASN1_BMPSTRING,ERR_R_NESTED_ASN1_ERROR); - return(NULL); - } - return(ret); - } - diff --git a/crypto/openssl/crypto/asn1/a_null.c b/crypto/openssl/crypto/asn1/a_null.c deleted file mode 100644 index 119fd78..0000000 --- a/crypto/openssl/crypto/asn1/a_null.c +++ /dev/null @@ -1,119 +0,0 @@ -/* a_null.c */ -/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * 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 above 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 acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``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 THE OpenSSL PROJECT OR - * ITS 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. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include -#include "cryptlib.h" -#include - -/* ASN1 functions for NULL type. For compatibility with other ASN1 code - * it returns a pointer to an "ASN1_NULL" structure. The new/free functions - * don't need to do any allocating because nothing is stored in a NULL. - */ - -int i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **pp) - { - if(!a) return 0; - if (pp) ASN1_put_object(pp,0,0,V_ASN1_NULL,V_ASN1_UNIVERSAL); - return 2; - } - -ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, unsigned char **pp, long length) - { - ASN1_NULL *ret = NULL; - 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_NULL) - { - i=ASN1_R_EXPECTING_A_NULL; - goto err; - } - - if (len != 0) - { - i=ASN1_R_NULL_IS_WRONG_LENGTH; - goto err; - } - ret=(ASN1_NULL *)1; - if (a != NULL) (*a)=ret; - *pp=p; - return(ret); -err: - ASN1err(ASN1_F_D2I_ASN1_NULL,i); - return(ret); - } - -ASN1_NULL *ASN1_NULL_new(void) -{ - return (ASN1_NULL *)1; -} - -void ASN1_NULL_free(ASN1_NULL *a) -{ - return; -} diff --git a/crypto/openssl/crypto/asn1/a_vis.c b/crypto/openssl/crypto/asn1/a_vis.c deleted file mode 100644 index 5cfc080..0000000 --- a/crypto/openssl/crypto/asn1/a_vis.c +++ /dev/null @@ -1,89 +0,0 @@ -/* crypto/asn1/a_vis.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 -#include "cryptlib.h" -#include - -ASN1_VISIBLESTRING *ASN1_VISIBLESTRING_new(void) -{ return M_ASN1_VISIBLESTRING_new(); } - -void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *x) -{ M_ASN1_VISIBLESTRING_free(x); } - -int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **pp) - { - return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, - V_ASN1_VISIBLESTRING,V_ASN1_UNIVERSAL)); - } - -ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, - unsigned char **pp, long length) - { - ASN1_VISIBLESTRING *ret=NULL; - - ret=(ASN1_VISIBLESTRING *)d2i_ASN1_bytes((ASN1_STRING **)a, - pp,length,V_ASN1_VISIBLESTRING,V_ASN1_UNIVERSAL); - if (ret == NULL) - { - ASN1err(ASN1_F_D2I_ASN1_VISIBLESTRING,ERR_R_NESTED_ASN1_ERROR); - return(NULL); - } - return(ret); - } - diff --git a/crypto/openssl/crypto/asn1/d2i_dhp.c b/crypto/openssl/crypto/asn1/d2i_dhp.c deleted file mode 100644 index 223ebbb..0000000 --- a/crypto/openssl/crypto/asn1/d2i_dhp.c +++ /dev/null @@ -1,102 +0,0 @@ -/* crypto/asn1/d2i_dhp.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 NO_DH -#include -#include "cryptlib.h" -#include -#include -#include -#include - -DH *d2i_DHparams(DH **a, unsigned char **pp, long length) - { - int i=ERR_R_NESTED_ASN1_ERROR; - ASN1_INTEGER *bs=NULL; - long v=0; - M_ASN1_D2I_vars(a,DH *,DH_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->p=BN_bin2bn(bs->data,bs->length,ret->p)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn; - - if (!M_ASN1_D2I_end_sequence()) - { - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - for (i=0; ilength; i++) - v=(v<<8)|(bs->data[i]); - ret->length=(int)v; - } - - M_ASN1_BIT_STRING_free(bs); - bs = NULL; - - M_ASN1_D2I_Finish_2(a); - -err_bn: - i=ERR_R_BN_LIB; -err: - ASN1err(ASN1_F_D2I_DHPARAMS,i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) DH_free(ret); - if (bs != NULL) M_ASN1_BIT_STRING_free(bs); - return(NULL); - } -#endif diff --git a/crypto/openssl/crypto/asn1/d2i_dsap.c b/crypto/openssl/crypto/asn1/d2i_dsap.c deleted file mode 100644 index a68f35d..0000000 --- a/crypto/openssl/crypto/asn1/d2i_dsap.c +++ /dev/null @@ -1,99 +0,0 @@ -/* crypto/asn1/d2i_dsap.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 NO_DSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -#ifndef NO_NEG_PUBKEY_BUG -#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER -#endif - -DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length) - { - int i=ERR_R_NESTED_ASN1_ERROR; - ASN1_INTEGER *bs=NULL; - M_ASN1_D2I_vars(a,DSA *,DSA_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->p=BN_bin2bn(bs->data,bs->length,ret->p)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->q=BN_bin2bn(bs->data,bs->length,ret->q)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn; - - M_ASN1_BIT_STRING_free(bs); - bs = NULL; - - M_ASN1_D2I_Finish_2(a); - -err_bn: - i=ERR_R_BN_LIB; -err: - ASN1err(ASN1_F_D2I_DSAPARAMS,i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_free(ret); - if (bs != NULL) M_ASN1_BIT_STRING_free(bs); - return(NULL); - } -#endif diff --git a/crypto/openssl/crypto/asn1/d2i_r_pr.c b/crypto/openssl/crypto/asn1/d2i_r_pr.c deleted file mode 100644 index afd5adb..0000000 --- a/crypto/openssl/crypto/asn1/d2i_r_pr.c +++ /dev/null @@ -1,129 +0,0 @@ -/* crypto/asn1/d2i_r_pr.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 NO_RSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -static ASN1_METHOD method={ - (int (*)()) i2d_RSAPrivateKey, - (char *(*)())d2i_RSAPrivateKey, - (char *(*)())RSA_new, - (void (*)()) RSA_free}; - -ASN1_METHOD *RSAPrivateKey_asn1_meth(void) - { - return(&method); - } - -RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length) - { - int i=ASN1_R_PARSING; - ASN1_INTEGER *bs=NULL; - M_ASN1_D2I_vars(a,RSA *,RSA_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if (bs->length == 0) - ret->version=0; - else ret->version=bs->data[0]; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->n=BN_bin2bn(bs->data,bs->length,ret->n)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->e=BN_bin2bn(bs->data,bs->length,ret->e)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->d=BN_bin2bn(bs->data,bs->length,ret->d)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->p=BN_bin2bn(bs->data,bs->length,ret->p)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->q=BN_bin2bn(bs->data,bs->length,ret->q)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->dmp1=BN_bin2bn(bs->data,bs->length,ret->dmp1)) == NULL) - goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->dmq1=BN_bin2bn(bs->data,bs->length,ret->dmq1)) == NULL) - goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->iqmp=BN_bin2bn(bs->data,bs->length,ret->iqmp)) == NULL) - goto err_bn; - - M_ASN1_INTEGER_free(bs); - bs = NULL; - - M_ASN1_D2I_Finish_2(a); -err_bn: - i=ERR_R_BN_LIB; -err: - ASN1err(ASN1_F_D2I_RSAPRIVATEKEY,i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) RSA_free(ret); - if (bs != NULL) M_ASN1_INTEGER_free(bs); - - return(NULL); - } -#else /* !NO_RSA */ - -# if PEDANTIC -static void *dummy=&dummy; -# endif - -#endif diff --git a/crypto/openssl/crypto/asn1/d2i_r_pu.c b/crypto/openssl/crypto/asn1/d2i_r_pu.c deleted file mode 100644 index 9e5d41c..0000000 --- a/crypto/openssl/crypto/asn1/d2i_r_pu.c +++ /dev/null @@ -1,103 +0,0 @@ -/* crypto/asn1/d2i_r_pu.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 NO_RSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -#ifndef NO_NEG_PUBKEY_BUG -#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER -#endif - -RSA *d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length) - { - int i=ASN1_R_PARSING; - ASN1_INTEGER *bs=NULL; - M_ASN1_D2I_vars(a,RSA *,RSA_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->n=BN_bin2bn(bs->data,bs->length,ret->n)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->e=BN_bin2bn(bs->data,bs->length,ret->e)) == NULL) goto err_bn; - - M_ASN1_INTEGER_free(bs); - bs=NULL; - - M_ASN1_D2I_Finish_2(a); - -err_bn: - i=ERR_R_BN_LIB; -err: - ASN1err(ASN1_F_D2I_RSAPUBLICKEY,i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) RSA_free(ret); - if (bs != NULL) M_ASN1_INTEGER_free(bs); - return(NULL); - } -#else /* !NO_RSA */ - -# if PEDANTIC -static void *dummy=&dummy; -# endif - -#endif diff --git a/crypto/openssl/crypto/asn1/d2i_s_pr.c b/crypto/openssl/crypto/asn1/d2i_s_pr.c deleted file mode 100644 index 55d5802..0000000 --- a/crypto/openssl/crypto/asn1/d2i_s_pr.c +++ /dev/null @@ -1,106 +0,0 @@ -/* crypto/asn1/d2i_s_pr.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.] - */ - -/* Original version from Steven Schoch */ - -#ifndef NO_DSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length) - { - int i=ASN1_R_PARSING; - ASN1_INTEGER *bs=NULL; - M_ASN1_D2I_vars(a,DSA *,DSA_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if (bs->length == 0) - ret->version=0; - else ret->version=bs->data[0]; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->p=BN_bin2bn(bs->data,bs->length,ret->p)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->q=BN_bin2bn(bs->data,bs->length,ret->q)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->pub_key=BN_bin2bn(bs->data,bs->length,ret->pub_key)) - == NULL) goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->priv_key=BN_bin2bn(bs->data,bs->length,ret->priv_key)) - == NULL) goto err_bn; - - M_ASN1_INTEGER_free(bs); - bs = NULL; - - M_ASN1_D2I_Finish_2(a); -err_bn: - i=ERR_R_BN_LIB; -err: - ASN1err(ASN1_F_D2I_DSAPRIVATEKEY,i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_free(ret); - if (bs != NULL) M_ASN1_INTEGER_free(bs); - return(NULL); - } -#endif diff --git a/crypto/openssl/crypto/asn1/d2i_s_pu.c b/crypto/openssl/crypto/asn1/d2i_s_pu.c deleted file mode 100644 index 0b7d2fa..0000000 --- a/crypto/openssl/crypto/asn1/d2i_s_pu.c +++ /dev/null @@ -1,121 +0,0 @@ -/* crypto/asn1/d2i_s_pu.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.] - */ - -/* Original version from Steven Schoch */ - -#ifndef NO_DSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -#ifndef NO_NEG_PUBKEY_BUG -#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER -#endif - -DSA *d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length) - { - int i=ASN1_R_PARSING; - ASN1_INTEGER *bs=NULL; - M_ASN1_D2I_vars(a,DSA *,DSA_new); - - M_ASN1_D2I_Init(); - if ((length != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) - == (V_ASN1_UNIVERSAL|(V_ASN1_INTEGER)))) - { - c.slen=length; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->pub_key=BN_bin2bn(bs->data,bs->length,ret->pub_key)) - == NULL) - goto err_bn; - ret->write_params=0; - } - else - { - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->pub_key=BN_bin2bn(bs->data,bs->length,ret->pub_key)) - == NULL) - goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->p=BN_bin2bn(bs->data,bs->length,ret->p)) == NULL) - goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->q=BN_bin2bn(bs->data,bs->length,ret->q)) == NULL) - goto err_bn; - M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER); - if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) - goto err_bn; - - ret->write_params=1; - } - - M_ASN1_INTEGER_free(bs); - bs=NULL; - M_ASN1_D2I_Finish_2(a); -err_bn: - i=ERR_R_BN_LIB; -err: - ASN1err(ASN1_F_D2I_DSAPUBLICKEY,i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) DSA_free(ret); - if (bs != NULL) M_ASN1_INTEGER_free(bs); - return(NULL); - } -#endif diff --git a/crypto/openssl/crypto/asn1/i2d_dhp.c b/crypto/openssl/crypto/asn1/i2d_dhp.c deleted file mode 100644 index b1de17f..0000000 --- a/crypto/openssl/crypto/asn1/i2d_dhp.c +++ /dev/null @@ -1,128 +0,0 @@ -/* crypto/asn1/i2d_dhp.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 NO_DH -#include -#include "cryptlib.h" -#include -#include -#include - -int i2d_DHparams(DH *a, unsigned char **pp) - { - BIGNUM *num[3]; - ASN1_INTEGER bs; - unsigned int j,i,tot=0,len,max=0; - int t,ret= -1; - unsigned char *p; - - if (a == NULL) return(0); - num[0]=a->p; - num[1]=a->g; - if (a->length != 0) - { - if ((num[2]=BN_new()) == NULL) goto err; - if (!BN_set_word(num[2],a->length)) goto err; - } - else - num[2]=NULL; - - for (i=0; i<3; i++) - { - if (num[i] == NULL) continue; - j=BN_num_bits(num[i]); - len=((j == 0)?0:((j/8)+1)); - if (len > max) max=len; - len=ASN1_object_size(0,len, - (num[i]->neg)?V_ASN1_NEG_INTEGER:V_ASN1_INTEGER); - tot+=len; - } - - t=ASN1_object_size(1,tot,V_ASN1_SEQUENCE); - if (pp == NULL) - { - if (num[2] != NULL) - BN_free(num[2]); - return(t); - } - - p= *pp; - ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - - bs.type=V_ASN1_INTEGER; - bs.data=(unsigned char *)OPENSSL_malloc(max+4); - if (bs.data == NULL) - { - ASN1err(ASN1_F_I2D_DHPARAMS,ERR_R_MALLOC_FAILURE); - goto err; - } - - for (i=0; i<3; i++) - { - if (num[i] == NULL) continue; - bs.length=BN_bn2bin(num[i],bs.data); - i2d_ASN1_INTEGER(&bs,&p); - } - OPENSSL_free(bs.data); - ret=t; -err: - if (num[2] != NULL) BN_free(num[2]); - *pp=p; - return(ret); - } -#endif diff --git a/crypto/openssl/crypto/asn1/i2d_dsap.c b/crypto/openssl/crypto/asn1/i2d_dsap.c deleted file mode 100644 index 157fb43..0000000 --- a/crypto/openssl/crypto/asn1/i2d_dsap.c +++ /dev/null @@ -1,117 +0,0 @@ -/* crypto/asn1/i2d_dsap.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 NO_DSA -#include -#include "cryptlib.h" -#include -#include -#include - -int i2d_DSAparams(DSA *a, unsigned char **pp) - { - BIGNUM *num[3]; - ASN1_INTEGER bs; - unsigned int j,i,tot=0,len,max=0; - int t,ret= -1; - unsigned char *p; - - if (a == NULL) return(0); - num[0]=a->p; - num[1]=a->q; - num[2]=a->g; - - for (i=0; i<3; i++) - { - if (num[i] == NULL) continue; - j=BN_num_bits(num[i]); - len=((j == 0)?0:((j/8)+1)); - if (len > max) max=len; - len=ASN1_object_size(0,len, - (num[i]->neg)?V_ASN1_NEG_INTEGER:V_ASN1_INTEGER); - tot+=len; - } - - t=ASN1_object_size(1,tot,V_ASN1_SEQUENCE); - if (pp == NULL) return(t); - - p= *pp; - ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - - bs.type=V_ASN1_INTEGER; - bs.data=(unsigned char *)OPENSSL_malloc(max+4); - if (bs.data == NULL) - { - ASN1err(ASN1_F_I2D_DSAPARAMS,ERR_R_MALLOC_FAILURE); - goto err; - } - - for (i=0; i<3; i++) - { - if (num[i] == NULL) continue; - bs.length=BN_bn2bin(num[i],bs.data); - i2d_ASN1_INTEGER(&bs,&p); - } - OPENSSL_free(bs.data); - ret=t; -err: - *pp=p; - return(ret); - } -#endif - diff --git a/crypto/openssl/crypto/asn1/i2d_r_pr.c b/crypto/openssl/crypto/asn1/i2d_r_pr.c deleted file mode 100644 index 88b1aac..0000000 --- a/crypto/openssl/crypto/asn1/i2d_r_pr.c +++ /dev/null @@ -1,133 +0,0 @@ -/* crypto/asn1/i2d_r_pr.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 NO_RSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) - { - BIGNUM *num[9]; - unsigned char data[1]; - ASN1_INTEGER bs; - unsigned int j,i,tot,t,len,max=0; - unsigned char *p; - - if (a == NULL) return(0); - - num[1]=a->n; - num[2]=a->e; - num[3]=a->d; - num[4]=a->p; - num[5]=a->q; - num[6]=a->dmp1; - num[7]=a->dmq1; - num[8]=a->iqmp; - - bs.length=1; - bs.data=data; - bs.type=V_ASN1_INTEGER; - data[0]=a->version&0x7f; - - tot=i2d_ASN1_INTEGER(&(bs),NULL); - for (i=1; i<9; i++) - { - j=BN_num_bits(num[i]); - len=((j == 0)?0:((j/8)+1)); - if (len > max) max=len; - len=ASN1_object_size(0,len, - (num[i]->neg)?V_ASN1_NEG_INTEGER:V_ASN1_INTEGER); - tot+=len; - } - - t=ASN1_object_size(1,tot,V_ASN1_SEQUENCE); - if (pp == NULL) return(t); - - p= *pp; - ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - - i2d_ASN1_INTEGER(&bs,&p); - - bs.data=(unsigned char *)OPENSSL_malloc(max+4); - if (bs.data == NULL) - { - ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ERR_R_MALLOC_FAILURE); - return(-1); - } - - for (i=1; i<9; i++) - { - bs.length=BN_bn2bin(num[i],bs.data); - i2d_ASN1_INTEGER(&bs,&p); - } - OPENSSL_free(bs.data); - *pp=p; - return(t); - } -#else /* !NO_RSA */ - -# if PEDANTIC -static void *dummy=&dummy; -# endif - -#endif - diff --git a/crypto/openssl/crypto/asn1/i2d_r_pu.c b/crypto/openssl/crypto/asn1/i2d_r_pu.c deleted file mode 100644 index 8178c2c..0000000 --- a/crypto/openssl/crypto/asn1/i2d_r_pu.c +++ /dev/null @@ -1,118 +0,0 @@ -/* crypto/asn1/i2d_r_pu.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 NO_RSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -int i2d_RSAPublicKey(RSA *a, unsigned char **pp) - { - BIGNUM *num[2]; - ASN1_INTEGER bs; - unsigned int j,i,tot=0,len,max=0,t; - unsigned char *p; - - if (a == NULL) return(0); - - num[0]=a->n; - num[1]=a->e; - - for (i=0; i<2; i++) - { - j=BN_num_bits(num[i]); - len=((j == 0)?0:((j/8)+1)); - if (len > max) max=len; - len=ASN1_object_size(0,len, - (num[i]->neg)?V_ASN1_NEG_INTEGER:V_ASN1_INTEGER); - tot+=len; - } - - t=ASN1_object_size(1,tot,V_ASN1_SEQUENCE); - if (pp == NULL) return(t); - - p= *pp; - ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - - bs.type=V_ASN1_INTEGER; - bs.data=(unsigned char *)OPENSSL_malloc(max+4); - if (bs.data == NULL) - { - ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ERR_R_MALLOC_FAILURE); - return(-1); - } - - for (i=0; i<2; i++) - { - bs.length=BN_bn2bin(num[i],bs.data); - i2d_ASN1_INTEGER(&bs,&p); - } - OPENSSL_free(bs.data); - *pp=p; - return(t); - } -#else /* !NO_RSA */ - -# if PEDANTIC -static void *dummy=&dummy; -# endif - -#endif diff --git a/crypto/openssl/crypto/asn1/i2d_s_pr.c b/crypto/openssl/crypto/asn1/i2d_s_pr.c deleted file mode 100644 index 9922952..0000000 --- a/crypto/openssl/crypto/asn1/i2d_s_pr.c +++ /dev/null @@ -1,123 +0,0 @@ -/* crypto/asn1/i2d_s_pr.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 NO_DSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -int i2d_DSAPrivateKey(DSA *a, unsigned char **pp) - { - BIGNUM *num[6]; - unsigned char data[1]; - ASN1_INTEGER bs; - unsigned int j,i,tot,t,len,max=0; - unsigned char *p; - - if (a == NULL) return(0); - - num[1]=a->p; - num[2]=a->q; - num[3]=a->g; - num[4]=a->pub_key; - num[5]=a->priv_key; - - bs.length=1; - bs.data=data; - bs.type=V_ASN1_INTEGER; - data[0]=a->version&0x7f; - - tot=i2d_ASN1_INTEGER(&(bs),NULL); - for (i=1; i<6; i++) - { - j=BN_num_bits(num[i]); - len=((j == 0)?0:((j/8)+1)); - if (len > max) max=len; - len=ASN1_object_size(0,len, - (num[i]->neg)?V_ASN1_NEG_INTEGER:V_ASN1_INTEGER); - tot+=len; - } - - t=ASN1_object_size(1,tot,V_ASN1_SEQUENCE); - if (pp == NULL) return(t); - - p= *pp; - ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - - i2d_ASN1_INTEGER(&bs,&p); - - bs.data=(unsigned char *)OPENSSL_malloc(max+4); - if (bs.data == NULL) - { - ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ERR_R_MALLOC_FAILURE); - return(-1); - } - - for (i=1; i<6; i++) - { - bs.length=BN_bn2bin(num[i],bs.data); - i2d_ASN1_INTEGER(&bs,&p); - } - OPENSSL_free(bs.data); - *pp=p; - return(t); - } -#endif diff --git a/crypto/openssl/crypto/asn1/i2d_s_pu.c b/crypto/openssl/crypto/asn1/i2d_s_pu.c deleted file mode 100644 index e6014b8..0000000 --- a/crypto/openssl/crypto/asn1/i2d_s_pu.c +++ /dev/null @@ -1,129 +0,0 @@ -/* crypto/asn1/i2d_s_pu.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 NO_DSA -#include -#include "cryptlib.h" -#include -#include -#include -#include - -int i2d_DSAPublicKey(DSA *a, unsigned char **pp) - { - BIGNUM *num[4]; - ASN1_INTEGER bs; - unsigned int j,i,tot=0,len,max=0,t=0,all,n=1; - unsigned char *p; - - if (a == NULL) return(0); - - all=a->write_params; - - num[0]=a->pub_key; - if (all) - { - num[1]=a->p; - num[2]=a->q; - num[3]=a->g; - n=4; - } - - for (i=0; i max) max=len; - len=ASN1_object_size(0,len, - (num[i]->neg)?V_ASN1_NEG_INTEGER:V_ASN1_INTEGER); - tot+=len; - } - - if (all) - { - t=ASN1_object_size(1,tot,V_ASN1_SEQUENCE); - if (pp == NULL) return(t); - } - else - { - if (pp == NULL) return(tot); - } - - p= *pp; - if (all) - ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - - bs.type=V_ASN1_INTEGER; - bs.data=(unsigned char *)OPENSSL_malloc(max+4); - if (bs.data == NULL) - { - ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ERR_R_MALLOC_FAILURE); - return(-1); - } - - for (i=0; i -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_DIGEST(PKCS7_DIGEST *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len(a->md,i2d_X509_ALGOR); - M_ASN1_I2D_len(a->contents,i2d_PKCS7); - M_ASN1_I2D_len(a->digest,i2d_ASN1_OCTET_STRING); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put(a->md,i2d_X509_ALGOR); - M_ASN1_I2D_put(a->contents,i2d_PKCS7); - M_ASN1_I2D_put(a->digest,i2d_ASN1_OCTET_STRING); - - M_ASN1_I2D_finish(); - } - -PKCS7_DIGEST *d2i_PKCS7_DIGEST(PKCS7_DIGEST **a, unsigned char **pp, - long length) - { - M_ASN1_D2I_vars(a,PKCS7_DIGEST *,PKCS7_DIGEST_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get(ret->md,d2i_X509_ALGOR); - M_ASN1_D2I_get(ret->contents,d2i_PKCS7); - M_ASN1_D2I_get(ret->digest,d2i_ASN1_OCTET_STRING); - - M_ASN1_D2I_Finish(a,PKCS7_DIGEST_free,ASN1_F_D2I_PKCS7_DIGEST); - } - -PKCS7_DIGEST *PKCS7_DIGEST_new(void) - { - PKCS7_DIGEST *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_DIGEST); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->md,X509_ALGOR_new); - M_ASN1_New(ret->contents,PKCS7_new); - M_ASN1_New(ret->digest,M_ASN1_OCTET_STRING_new); - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_DIGEST_NEW); - } - -void PKCS7_DIGEST_free(PKCS7_DIGEST *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - X509_ALGOR_free(a->md); - PKCS7_free(a->contents); - M_ASN1_OCTET_STRING_free(a->digest); - OPENSSL_free(a); - } - diff --git a/crypto/openssl/crypto/asn1/p7_enc.c b/crypto/openssl/crypto/asn1/p7_enc.c deleted file mode 100644 index 38ccafb..0000000 --- a/crypto/openssl/crypto/asn1/p7_enc.c +++ /dev/null @@ -1,111 +0,0 @@ -/* crypto/asn1/p7_enc.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len(a->enc_data,i2d_PKCS7_ENC_CONTENT); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put(a->enc_data,i2d_PKCS7_ENC_CONTENT); - - M_ASN1_I2D_finish(); - } - -PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **a, unsigned char **pp, - long length) - { - M_ASN1_D2I_vars(a,PKCS7_ENCRYPT *,PKCS7_ENCRYPT_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get(ret->enc_data,d2i_PKCS7_ENC_CONTENT); - - M_ASN1_D2I_Finish(a,PKCS7_ENCRYPT_free,ASN1_F_D2I_PKCS7_ENCRYPT); - } - -PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void) - { - PKCS7_ENCRYPT *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_ENCRYPT); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new); - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_ENCRYPT_NEW); - } - -void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - PKCS7_ENC_CONTENT_free(a->enc_data); - OPENSSL_free(a); - } - diff --git a/crypto/openssl/crypto/asn1/p7_enc_c.c b/crypto/openssl/crypto/asn1/p7_enc_c.c deleted file mode 100644 index 031178a..0000000 --- a/crypto/openssl/crypto/asn1/p7_enc_c.c +++ /dev/null @@ -1,120 +0,0 @@ -/* crypto/asn1/p7_enc_c.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->content_type,i2d_ASN1_OBJECT); - M_ASN1_I2D_len(a->algorithm,i2d_X509_ALGOR); - M_ASN1_I2D_len_IMP_opt(a->enc_data,i2d_ASN1_OCTET_STRING); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->content_type,i2d_ASN1_OBJECT); - M_ASN1_I2D_put(a->algorithm,i2d_X509_ALGOR); - M_ASN1_I2D_put_IMP_opt(a->enc_data,i2d_ASN1_OCTET_STRING,0); - - M_ASN1_I2D_finish(); - } - -PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **a, - unsigned char **pp, long length) - { - M_ASN1_D2I_vars(a,PKCS7_ENC_CONTENT *,PKCS7_ENC_CONTENT_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->content_type,d2i_ASN1_OBJECT); - M_ASN1_D2I_get(ret->algorithm,d2i_X509_ALGOR); - M_ASN1_D2I_get_IMP_opt(ret->enc_data,d2i_ASN1_OCTET_STRING,0, - V_ASN1_OCTET_STRING); - - M_ASN1_D2I_Finish(a,PKCS7_ENC_CONTENT_free, - ASN1_F_D2I_PKCS7_ENC_CONTENT); - } - -PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new(void) - { - PKCS7_ENC_CONTENT *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_ENC_CONTENT); - /* M_ASN1_New(ret->content_type,ASN1_OBJECT_new); */ - /* We will almost always want this: so make it the default */ - ret->content_type=OBJ_nid2obj(NID_pkcs7_data); - M_ASN1_New(ret->algorithm,X509_ALGOR_new); - ret->enc_data=NULL; - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_ENC_CONTENT_NEW); - } - -void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a) - { - if (a == NULL) return; - ASN1_OBJECT_free(a->content_type); - X509_ALGOR_free(a->algorithm); - M_ASN1_OCTET_STRING_free(a->enc_data); - OPENSSL_free(a); - } - diff --git a/crypto/openssl/crypto/asn1/p7_evp.c b/crypto/openssl/crypto/asn1/p7_evp.c deleted file mode 100644 index 60be3e5..0000000 --- a/crypto/openssl/crypto/asn1/p7_evp.c +++ /dev/null @@ -1,119 +0,0 @@ -/* crypto/asn1/p7_evp.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len_SET_type(PKCS7_RECIP_INFO,a->recipientinfo, - i2d_PKCS7_RECIP_INFO); - M_ASN1_I2D_len(a->enc_data,i2d_PKCS7_ENC_CONTENT); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put_SET_type(PKCS7_RECIP_INFO,a->recipientinfo, - i2d_PKCS7_RECIP_INFO); - M_ASN1_I2D_put(a->enc_data,i2d_PKCS7_ENC_CONTENT); - - M_ASN1_I2D_finish(); - } - -PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, unsigned char **pp, - long length) - { - M_ASN1_D2I_vars(a,PKCS7_ENVELOPE *,PKCS7_ENVELOPE_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get_set_type(PKCS7_RECIP_INFO,ret->recipientinfo, - d2i_PKCS7_RECIP_INFO,PKCS7_RECIP_INFO_free); - M_ASN1_D2I_get(ret->enc_data,d2i_PKCS7_ENC_CONTENT); - - M_ASN1_D2I_Finish(a,PKCS7_ENVELOPE_free,ASN1_F_D2I_PKCS7_ENVELOPE); - } - -PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void) - { - PKCS7_ENVELOPE *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_ENVELOPE); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->recipientinfo,sk_PKCS7_RECIP_INFO_new_null); - M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new); - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_ENVELOPE_NEW); - } - -void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free); - PKCS7_ENC_CONTENT_free(a->enc_data); - OPENSSL_free(a); - } - diff --git a/crypto/openssl/crypto/asn1/p7_i_s.c b/crypto/openssl/crypto/asn1/p7_i_s.c deleted file mode 100644 index 4a7260a..0000000 --- a/crypto/openssl/crypto/asn1/p7_i_s.c +++ /dev/null @@ -1,111 +0,0 @@ -/* crypto/asn1/p7_i_s.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL *a, - unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->issuer,i2d_X509_NAME); - M_ASN1_I2D_len(a->serial,i2d_ASN1_INTEGER); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->issuer,i2d_X509_NAME); - M_ASN1_I2D_put(a->serial,i2d_ASN1_INTEGER); - - M_ASN1_I2D_finish(); - } - -PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL **a, unsigned char **pp, long length) - { - M_ASN1_D2I_vars(a,PKCS7_ISSUER_AND_SERIAL *,PKCS7_ISSUER_AND_SERIAL_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->issuer,d2i_X509_NAME); - M_ASN1_D2I_get(ret->serial,d2i_ASN1_INTEGER); - M_ASN1_D2I_Finish(a,PKCS7_ISSUER_AND_SERIAL_free, - ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL); - } - -PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new(void) - { - PKCS7_ISSUER_AND_SERIAL *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_ISSUER_AND_SERIAL); - M_ASN1_New(ret->issuer,X509_NAME_new); - M_ASN1_New(ret->serial,M_ASN1_INTEGER_new); - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW); - } - -void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a) - { - if (a == NULL) return; - X509_NAME_free(a->issuer); - M_ASN1_INTEGER_free(a->serial); - OPENSSL_free(a); - } - diff --git a/crypto/openssl/crypto/asn1/p7_lib.c b/crypto/openssl/crypto/asn1/p7_lib.c deleted file mode 100644 index 8a340b0..0000000 --- a/crypto/openssl/crypto/asn1/p7_lib.c +++ /dev/null @@ -1,393 +0,0 @@ -/* crypto/asn1/p7_lib.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 -#include "cryptlib.h" -#include -#include -#include - -#ifdef PKCS7_INDEFINITE_ENCODING - -int i2d_PKCS7(PKCS7 *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - if (a->asn1 != NULL) - { - if (pp == NULL) - return((int)a->length); - memcpy(*pp,a->asn1,(int)a->length); - *pp+=a->length; - return((int)a->length); - } - - ret+=4; /* sequence, BER header plus '0 0' end padding */ - M_ASN1_I2D_len(a->type,i2d_ASN1_OBJECT); - if (a->d.ptr != NULL) - { - ret+=4; /* explicit tag [ 0 ] BER plus '0 0' */ - switch (OBJ_obj2nid(a->type)) - { - case NID_pkcs7_data: - M_ASN1_I2D_len(a->d.data,i2d_ASN1_OCTET_STRING); - break; - case NID_pkcs7_signed: - M_ASN1_I2D_len(a->d.sign,i2d_PKCS7_SIGNED); - break; - case NID_pkcs7_enveloped: - M_ASN1_I2D_len(a->d.enveloped,i2d_PKCS7_ENVELOPE); - break; - case NID_pkcs7_signedAndEnveloped: - M_ASN1_I2D_len(a->d.signed_and_enveloped, - i2d_PKCS7_SIGN_ENVELOPE); - break; - case NID_pkcs7_digest: - M_ASN1_I2D_len(a->d.digest,i2d_PKCS7_DIGEST); - break; - case NID_pkcs7_encrypted: - M_ASN1_I2D_len(a->d.encrypted,i2d_PKCS7_ENCRYPT); - break; - default: - M_ASN1_I2D_len(a->d.other,i2d_ASN1_TYPE); - break; - } - } - r=ret; - if (pp == NULL) return(r); - p= *pp; - M_ASN1_I2D_INF_seq_start(V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - M_ASN1_I2D_put(a->type,i2d_ASN1_OBJECT); - - if (a->d.ptr != NULL) - { - M_ASN1_I2D_INF_seq_start(0,V_ASN1_CONTEXT_SPECIFIC); - switch (OBJ_obj2nid(a->type)) - { - case NID_pkcs7_data: - M_ASN1_I2D_put(a->d.data,i2d_ASN1_OCTET_STRING); - break; - case NID_pkcs7_signed: - M_ASN1_I2D_put(a->d.sign,i2d_PKCS7_SIGNED); - break; - case NID_pkcs7_enveloped: - M_ASN1_I2D_put(a->d.enveloped,i2d_PKCS7_ENVELOPE); - break; - case NID_pkcs7_signedAndEnveloped: - M_ASN1_I2D_put(a->d.signed_and_enveloped, - i2d_PKCS7_SIGN_ENVELOPE); - break; - case NID_pkcs7_digest: - M_ASN1_I2D_put(a->d.digest,i2d_PKCS7_DIGEST); - break; - case NID_pkcs7_encrypted: - M_ASN1_I2D_put(a->d.encrypted,i2d_PKCS7_ENCRYPT); - break; - default: - M_ASN1_I2D_put(a->d.other,i2d_ASN1_TYPE); - break; - } - M_ASN1_I2D_INF_seq_end(); - } - M_ASN1_I2D_INF_seq_end(); - M_ASN1_I2D_finish(); - } - -#else - -int i2d_PKCS7(PKCS7 *a, unsigned char **pp) - { - int explen = 0; - M_ASN1_I2D_vars(a); - - if (a->asn1 != NULL) - { - if (pp == NULL) - return((int)a->length); - memcpy(*pp,a->asn1,(int)a->length); - *pp+=a->length; - return((int)a->length); - } - - M_ASN1_I2D_len(a->type,i2d_ASN1_OBJECT); - if (a->d.ptr != NULL) - { - /* Save current length */ - r = ret; - switch (OBJ_obj2nid(a->type)) - { - case NID_pkcs7_data: - M_ASN1_I2D_len(a->d.data,i2d_ASN1_OCTET_STRING); - break; - case NID_pkcs7_signed: - M_ASN1_I2D_len(a->d.sign,i2d_PKCS7_SIGNED); - break; - case NID_pkcs7_enveloped: - M_ASN1_I2D_len(a->d.enveloped,i2d_PKCS7_ENVELOPE); - break; - case NID_pkcs7_signedAndEnveloped: - M_ASN1_I2D_len(a->d.signed_and_enveloped, - i2d_PKCS7_SIGN_ENVELOPE); - break; - case NID_pkcs7_digest: - M_ASN1_I2D_len(a->d.digest,i2d_PKCS7_DIGEST); - break; - case NID_pkcs7_encrypted: - M_ASN1_I2D_len(a->d.encrypted,i2d_PKCS7_ENCRYPT); - break; - default: - M_ASN1_I2D_len(a->d.other,i2d_ASN1_TYPE); - break; - } - /* Work out explicit tag content size */ - explen = ret - r; - /* Work out explicit tag size: Note: ASN1_object_size - * includes the content length. - */ - ret = r + ASN1_object_size(1, explen, 0); - } - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->type,i2d_ASN1_OBJECT); - - if (a->d.ptr != NULL) - { - ASN1_put_object(&p, 1, explen, 0, V_ASN1_CONTEXT_SPECIFIC); - switch (OBJ_obj2nid(a->type)) - { - case NID_pkcs7_data: - M_ASN1_I2D_put(a->d.data,i2d_ASN1_OCTET_STRING); - break; - case NID_pkcs7_signed: - M_ASN1_I2D_put(a->d.sign,i2d_PKCS7_SIGNED); - break; - case NID_pkcs7_enveloped: - M_ASN1_I2D_put(a->d.enveloped,i2d_PKCS7_ENVELOPE); - break; - case NID_pkcs7_signedAndEnveloped: - M_ASN1_I2D_put(a->d.signed_and_enveloped, - i2d_PKCS7_SIGN_ENVELOPE); - break; - case NID_pkcs7_digest: - M_ASN1_I2D_put(a->d.digest,i2d_PKCS7_DIGEST); - break; - case NID_pkcs7_encrypted: - M_ASN1_I2D_put(a->d.encrypted,i2d_PKCS7_ENCRYPT); - break; - default: - M_ASN1_I2D_put(a->d.other,i2d_ASN1_TYPE); - break; - } - } - M_ASN1_I2D_finish(); - } - -#endif - -PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length) - { - M_ASN1_D2I_vars(a,PKCS7 *,PKCS7_new); - - if ((a != NULL) && ((*a) != NULL)) - { - if ((*a)->asn1 != NULL) - { - OPENSSL_free((*a)->asn1); - (*a)->asn1=NULL; - } - (*a)->length=0; - } - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->type,d2i_ASN1_OBJECT); - if (!M_ASN1_D2I_end_sequence()) - { - int Tinf,Ttag,Tclass; - long Tlen; - - if (M_ASN1_next != (V_ASN1_CONSTRUCTED| - V_ASN1_CONTEXT_SPECIFIC|0)) - { - c.error=ASN1_R_BAD_PKCS7_CONTENT; - c.line=__LINE__; - goto err; - } - - ret->detached=0; - - c.q=c.p; - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass, - (c.inf & 1)?(length+ *pp-c.q):c.slen); - if (Tinf & 0x80) { c.line=__LINE__; goto err; } - c.slen-=(c.p-c.q); - - switch (OBJ_obj2nid(ret->type)) - { - case NID_pkcs7_data: - M_ASN1_D2I_get(ret->d.data,d2i_ASN1_OCTET_STRING); - break; - case NID_pkcs7_signed: - M_ASN1_D2I_get(ret->d.sign,d2i_PKCS7_SIGNED); - if (ret->d.sign->contents->d.ptr == NULL) - ret->detached=1; - break; - case NID_pkcs7_enveloped: - M_ASN1_D2I_get(ret->d.enveloped,d2i_PKCS7_ENVELOPE); - break; - case NID_pkcs7_signedAndEnveloped: - M_ASN1_D2I_get(ret->d.signed_and_enveloped, - d2i_PKCS7_SIGN_ENVELOPE); - break; - case NID_pkcs7_digest: - M_ASN1_D2I_get(ret->d.digest,d2i_PKCS7_DIGEST); - break; - case NID_pkcs7_encrypted: - M_ASN1_D2I_get(ret->d.encrypted,d2i_PKCS7_ENCRYPT); - break; - default: - M_ASN1_D2I_get(ret->d.other,d2i_ASN1_TYPE); - break; - } - if (Tinf == (1|V_ASN1_CONSTRUCTED)) - { - c.q=c.p; - if (!ASN1_check_infinite_end(&c.p,c.slen)) - { - c.error=ERR_R_MISSING_ASN1_EOS; - c.line=__LINE__; - goto err; - } - c.slen-=(c.p-c.q); - } - } - else - ret->detached=1; - - M_ASN1_D2I_Finish(a,PKCS7_free,ASN1_F_D2I_PKCS7); - } - -PKCS7 *PKCS7_new(void) - { - PKCS7 *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7); - ret->type=OBJ_nid2obj(NID_undef); - ret->asn1=NULL; - ret->length=0; - ret->detached=0; - ret->d.ptr=NULL; - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_NEW); - } - -void PKCS7_free(PKCS7 *a) - { - if (a == NULL) return; - - PKCS7_content_free(a); - if (a->type != NULL) - { - ASN1_OBJECT_free(a->type); - } - OPENSSL_free(a); - } - -void PKCS7_content_free(PKCS7 *a) - { - if(a == NULL) - return; - - if (a->asn1 != NULL) OPENSSL_free(a->asn1); - - if (a->d.ptr != NULL) - { - if (a->type == NULL) return; - - switch (OBJ_obj2nid(a->type)) - { - case NID_pkcs7_data: - M_ASN1_OCTET_STRING_free(a->d.data); - break; - case NID_pkcs7_signed: - PKCS7_SIGNED_free(a->d.sign); - break; - case NID_pkcs7_enveloped: - PKCS7_ENVELOPE_free(a->d.enveloped); - break; - case NID_pkcs7_signedAndEnveloped: - PKCS7_SIGN_ENVELOPE_free(a->d.signed_and_enveloped); - break; - case NID_pkcs7_digest: - PKCS7_DIGEST_free(a->d.digest); - break; - case NID_pkcs7_encrypted: - PKCS7_ENCRYPT_free(a->d.encrypted); - break; - default: - ASN1_TYPE_free(a->d.other); - break; - } - } - a->d.ptr=NULL; - } - -IMPLEMENT_STACK_OF(PKCS7) -IMPLEMENT_ASN1_SET_OF(PKCS7) diff --git a/crypto/openssl/crypto/asn1/p7_recip.c b/crypto/openssl/crypto/asn1/p7_recip.c deleted file mode 100644 index 5f6c88a..0000000 --- a/crypto/openssl/crypto/asn1/p7_recip.c +++ /dev/null @@ -1,125 +0,0 @@ -/* crypto/asn1/p7_recip.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len(a->issuer_and_serial,i2d_PKCS7_ISSUER_AND_SERIAL); - M_ASN1_I2D_len(a->key_enc_algor,i2d_X509_ALGOR); - M_ASN1_I2D_len(a->enc_key,i2d_ASN1_OCTET_STRING); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put(a->issuer_and_serial,i2d_PKCS7_ISSUER_AND_SERIAL); - M_ASN1_I2D_put(a->key_enc_algor,i2d_X509_ALGOR); - M_ASN1_I2D_put(a->enc_key,i2d_ASN1_OCTET_STRING); - - M_ASN1_I2D_finish(); - } - -PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a, - unsigned char **pp, long length) - { - M_ASN1_D2I_vars(a,PKCS7_RECIP_INFO *,PKCS7_RECIP_INFO_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get(ret->issuer_and_serial,d2i_PKCS7_ISSUER_AND_SERIAL); - M_ASN1_D2I_get(ret->key_enc_algor,d2i_X509_ALGOR); - M_ASN1_D2I_get(ret->enc_key,d2i_ASN1_OCTET_STRING); - - M_ASN1_D2I_Finish(a,PKCS7_RECIP_INFO_free,ASN1_F_D2I_PKCS7_RECIP_INFO); - } - -PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void) - { - PKCS7_RECIP_INFO *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_RECIP_INFO); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->issuer_and_serial,PKCS7_ISSUER_AND_SERIAL_new); - M_ASN1_New(ret->key_enc_algor,X509_ALGOR_new); - M_ASN1_New(ret->enc_key,M_ASN1_OCTET_STRING_new); - ret->cert=NULL; - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_RECIP_INFO_NEW); - } - -void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - PKCS7_ISSUER_AND_SERIAL_free(a->issuer_and_serial); - X509_ALGOR_free(a->key_enc_algor); - M_ASN1_OCTET_STRING_free(a->enc_key); - if (a->cert != NULL) X509_free(a->cert); - OPENSSL_free(a); - } - -IMPLEMENT_STACK_OF(PKCS7_RECIP_INFO) -IMPLEMENT_ASN1_SET_OF(PKCS7_RECIP_INFO) diff --git a/crypto/openssl/crypto/asn1/p7_s_e.c b/crypto/openssl/crypto/asn1/p7_s_e.c deleted file mode 100644 index 709eb24..0000000 --- a/crypto/openssl/crypto/asn1/p7_s_e.c +++ /dev/null @@ -1,145 +0,0 @@ -/* crypto/asn1/p7_s_e.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len_SET_type(PKCS7_RECIP_INFO,a->recipientinfo, - i2d_PKCS7_RECIP_INFO); - M_ASN1_I2D_len_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); - M_ASN1_I2D_len(a->enc_data,i2d_PKCS7_ENC_CONTENT); - M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_len_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); - M_ASN1_I2D_len_SET_type(PKCS7_SIGNER_INFO,a->signer_info, - i2d_PKCS7_SIGNER_INFO); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put_SET_type(PKCS7_RECIP_INFO,a->recipientinfo, - i2d_PKCS7_RECIP_INFO); - M_ASN1_I2D_put_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); - M_ASN1_I2D_put(a->enc_data,i2d_PKCS7_ENC_CONTENT); - M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_put_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); - M_ASN1_I2D_put_SET_type(PKCS7_SIGNER_INFO,a->signer_info, - i2d_PKCS7_SIGNER_INFO); - - M_ASN1_I2D_finish(); - } - -PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a, - unsigned char **pp, long length) - { - M_ASN1_D2I_vars(a,PKCS7_SIGN_ENVELOPE *,PKCS7_SIGN_ENVELOPE_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get_set_type(PKCS7_RECIP_INFO,ret->recipientinfo, - d2i_PKCS7_RECIP_INFO,PKCS7_RECIP_INFO_free); - M_ASN1_D2I_get_set_type(X509_ALGOR,ret->md_algs,d2i_X509_ALGOR, - X509_ALGOR_free); - M_ASN1_D2I_get(ret->enc_data,d2i_PKCS7_ENC_CONTENT); - M_ASN1_D2I_get_IMP_set_opt_type(X509,ret->cert,d2i_X509,X509_free,0); - M_ASN1_D2I_get_IMP_set_opt_type(X509_CRL,ret->crl,d2i_X509_CRL, - X509_CRL_free,1); - M_ASN1_D2I_get_set_type(PKCS7_SIGNER_INFO,ret->signer_info, - d2i_PKCS7_SIGNER_INFO,PKCS7_SIGNER_INFO_free); - - M_ASN1_D2I_Finish(a,PKCS7_SIGN_ENVELOPE_free, - ASN1_F_D2I_PKCS7_SIGN_ENVELOPE); - } - -PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void) - { - PKCS7_SIGN_ENVELOPE *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->recipientinfo,sk_PKCS7_RECIP_INFO_new_null); - M_ASN1_New(ret->md_algs,sk_X509_ALGOR_new_null); - M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new); - ret->cert=NULL; - ret->crl=NULL; - M_ASN1_New(ret->signer_info,sk_PKCS7_SIGNER_INFO_new_null); - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_SIGN_ENVELOPE_NEW); - } - -void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free); - sk_X509_ALGOR_pop_free(a->md_algs,X509_ALGOR_free); - PKCS7_ENC_CONTENT_free(a->enc_data); - sk_X509_pop_free(a->cert,X509_free); - sk_X509_CRL_pop_free(a->crl,X509_CRL_free); - sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free); - OPENSSL_free(a); - } - diff --git a/crypto/openssl/crypto/asn1/p7_signd.c b/crypto/openssl/crypto/asn1/p7_signd.c deleted file mode 100644 index c835f54..0000000 --- a/crypto/openssl/crypto/asn1/p7_signd.c +++ /dev/null @@ -1,135 +0,0 @@ -/* crypto/asn1/p7_signd.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); - M_ASN1_I2D_len(a->contents,i2d_PKCS7); - M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_len_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); - M_ASN1_I2D_len_SET_type(PKCS7_SIGNER_INFO,a->signer_info, - i2d_PKCS7_SIGNER_INFO); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); - M_ASN1_I2D_put(a->contents,i2d_PKCS7); - M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_put_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); - M_ASN1_I2D_put_SET_type(PKCS7_SIGNER_INFO,a->signer_info, - i2d_PKCS7_SIGNER_INFO); - - M_ASN1_I2D_finish(); - } - -PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, unsigned char **pp, - long length) - { - M_ASN1_D2I_vars(a,PKCS7_SIGNED *,PKCS7_SIGNED_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get_set_type(X509_ALGOR,ret->md_algs,d2i_X509_ALGOR, - X509_ALGOR_free); - M_ASN1_D2I_get(ret->contents,d2i_PKCS7); - M_ASN1_D2I_get_IMP_set_opt_type(X509,ret->cert,d2i_X509,X509_free,0); - M_ASN1_D2I_get_IMP_set_opt_type(X509_CRL,ret->crl,d2i_X509_CRL, - X509_CRL_free,1); - M_ASN1_D2I_get_set_type(PKCS7_SIGNER_INFO,ret->signer_info, - d2i_PKCS7_SIGNER_INFO,PKCS7_SIGNER_INFO_free); - - M_ASN1_D2I_Finish(a,PKCS7_SIGNED_free,ASN1_F_D2I_PKCS7_SIGNED); - } - -PKCS7_SIGNED *PKCS7_SIGNED_new(void) - { - PKCS7_SIGNED *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_SIGNED); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->md_algs,sk_X509_ALGOR_new_null); - M_ASN1_New(ret->contents,PKCS7_new); - ret->cert=NULL; - ret->crl=NULL; - M_ASN1_New(ret->signer_info,sk_PKCS7_SIGNER_INFO_new_null); - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_SIGNED_NEW); - } - -void PKCS7_SIGNED_free(PKCS7_SIGNED *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - sk_X509_ALGOR_pop_free(a->md_algs,X509_ALGOR_free); - PKCS7_free(a->contents); - sk_X509_pop_free(a->cert,X509_free); - sk_X509_CRL_pop_free(a->crl,X509_CRL_free); - sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free); - OPENSSL_free(a); - } diff --git a/crypto/openssl/crypto/asn1/p7_signi.c b/crypto/openssl/crypto/asn1/p7_signi.c deleted file mode 100644 index 248bf00..0000000 --- a/crypto/openssl/crypto/asn1/p7_signi.c +++ /dev/null @@ -1,150 +0,0 @@ -/* crypto/asn1/p7_signi.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 -#include "cryptlib.h" -#include -#include - -int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, unsigned char **pp) - { - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_len(a->issuer_and_serial,i2d_PKCS7_ISSUER_AND_SERIAL); - M_ASN1_I2D_len(a->digest_alg,i2d_X509_ALGOR); - M_ASN1_I2D_len_IMP_SET_opt_type(X509_ATTRIBUTE,a->auth_attr, - i2d_X509_ATTRIBUTE,0); - M_ASN1_I2D_len(a->digest_enc_alg,i2d_X509_ALGOR); - M_ASN1_I2D_len(a->enc_digest,i2d_ASN1_OCTET_STRING); - M_ASN1_I2D_len_IMP_SET_opt_type(X509_ATTRIBUTE,a->unauth_attr, - i2d_X509_ATTRIBUTE,1); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); - M_ASN1_I2D_put(a->issuer_and_serial,i2d_PKCS7_ISSUER_AND_SERIAL); - M_ASN1_I2D_put(a->digest_alg,i2d_X509_ALGOR); - M_ASN1_I2D_put_IMP_SET_opt_type(X509_ATTRIBUTE,a->auth_attr, - i2d_X509_ATTRIBUTE,0); - M_ASN1_I2D_put(a->digest_enc_alg,i2d_X509_ALGOR); - M_ASN1_I2D_put(a->enc_digest,i2d_ASN1_OCTET_STRING); - M_ASN1_I2D_put_IMP_SET_opt_type(X509_ATTRIBUTE,a->unauth_attr, - i2d_X509_ATTRIBUTE,1); - - M_ASN1_I2D_finish(); - } - -PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a, - unsigned char **pp, long length) - { - M_ASN1_D2I_vars(a,PKCS7_SIGNER_INFO *,PKCS7_SIGNER_INFO_new); - - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); - M_ASN1_D2I_get(ret->issuer_and_serial,d2i_PKCS7_ISSUER_AND_SERIAL); - M_ASN1_D2I_get(ret->digest_alg,d2i_X509_ALGOR); - M_ASN1_D2I_get_IMP_set_opt_type(X509_ATTRIBUTE,ret->auth_attr, - d2i_X509_ATTRIBUTE,X509_ATTRIBUTE_free, - 0); - M_ASN1_D2I_get(ret->digest_enc_alg,d2i_X509_ALGOR); - M_ASN1_D2I_get(ret->enc_digest,d2i_ASN1_OCTET_STRING); - M_ASN1_D2I_get_IMP_set_opt_type(X509_ATTRIBUTE,ret->unauth_attr, - d2i_X509_ATTRIBUTE, - X509_ATTRIBUTE_free,1); - - M_ASN1_D2I_Finish(a,PKCS7_SIGNER_INFO_free, - ASN1_F_D2I_PKCS7_SIGNER_INFO); - } - -PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void) - { - PKCS7_SIGNER_INFO *ret=NULL; - ASN1_CTX c; - - M_ASN1_New_Malloc(ret,PKCS7_SIGNER_INFO); - M_ASN1_New(ret->version,M_ASN1_INTEGER_new); - M_ASN1_New(ret->issuer_and_serial,PKCS7_ISSUER_AND_SERIAL_new); - M_ASN1_New(ret->digest_alg,X509_ALGOR_new); - ret->auth_attr=NULL; - M_ASN1_New(ret->digest_enc_alg,X509_ALGOR_new); - M_ASN1_New(ret->enc_digest,M_ASN1_OCTET_STRING_new); - ret->unauth_attr=NULL; - ret->pkey=NULL; - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS7_SIGNER_INFO_NEW); - } - -void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a) - { - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - PKCS7_ISSUER_AND_SERIAL_free(a->issuer_and_serial); - X509_ALGOR_free(a->digest_alg); - sk_X509_ATTRIBUTE_pop_free(a->auth_attr,X509_ATTRIBUTE_free); - X509_ALGOR_free(a->digest_enc_alg); - M_ASN1_OCTET_STRING_free(a->enc_digest); - sk_X509_ATTRIBUTE_pop_free(a->unauth_attr,X509_ATTRIBUTE_free); - if (a->pkey != NULL) - EVP_PKEY_free(a->pkey); - OPENSSL_free(a); - } - -IMPLEMENT_STACK_OF(PKCS7_SIGNER_INFO) -IMPLEMENT_ASN1_SET_OF(PKCS7_SIGNER_INFO) diff --git a/crypto/openssl/crypto/bn/test.c b/crypto/openssl/crypto/bn/test.c deleted file mode 100644 index a048b9f..0000000 --- a/crypto/openssl/crypto/bn/test.c +++ /dev/null @@ -1,241 +0,0 @@ -#include -#include "cryptlib.h" -#include "bn_lcl.h" - -#define SIZE 32 - -#define BN_MONT_CTX_set bn_mcs -#define BN_from_montgomery bn_fm -#define BN_mod_mul_montgomery bn_mmm -#undef BN_to_montgomery -#define BN_to_montgomery(r,a,mont,ctx) bn_mmm(\ - r,a,(mont)->RR,(mont),ctx) - -main() - { - BIGNUM prime,a,b,r,A,B,R; - BN_MONT_CTX *mont; - BN_CTX *ctx; - int i; - - ctx=BN_CTX_new(); - BN_init(&prime); - BN_init(&a); BN_init(&b); BN_init(&r); - BN_init(&A); BN_init(&B); BN_init(&R); - - BN_generate_prime(&prime,SIZE,0,NULL,NULL,NULL,NULL); - BN_rand(&A,SIZE,1,0); - BN_rand(&B,SIZE,1,0); - BN_mod(&A,&A,&prime,ctx); - BN_mod(&B,&B,&prime,ctx); - - i=A.top; - BN_mul(&R,&A,&B,ctx); - BN_mask_bits(&R,i*BN_BITS2); - - - BN_print_fp(stdout,&A); printf(" <- a\n"); - BN_print_fp(stdout,&B); printf(" <- b\n"); - BN_mul_high(&r,&A,&B,&R,i); - BN_print_fp(stdout,&r); printf(" <- high(BA*DC)\n"); - - BN_mask_bits(&A,i*32); - BN_mask_bits(&B,i*32); - - BN_mul(&R,&A,&B); - BN_rshift(&R,&R,i*32); - BN_print_fp(stdout,&R); printf(" <- norm BA*DC\n"); - BN_sub(&R,&R,&r); - BN_print_fp(stdout,&R); printf(" <- diff\n"); - } - -#if 0 -int bn_mul_high(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *low, int words) - { - int i; - BIGNUM t1,t2,t3,h,ah,al,bh,bl,m,s0,s1; - - BN_init(&al); BN_init(&ah); - BN_init(&bl); BN_init(&bh); - BN_init(&t1); BN_init(&t2); BN_init(&t3); - BN_init(&s0); BN_init(&s1); - BN_init(&h); BN_init(&m); - - i=a->top; - if (i >= words) - { - al.top=words; - ah.top=a->top-words; - ah.d= &(a->d[ah.top]); - } - else - al.top=i; - al.d=a->d; - - i=b->top; - if (i >= words) - { - bl.top=words; - bh.top=i-words; - bh.d= &(b->d[bh.top]); - } - else - bl.top=i; - bl.d=b->d; - - i=low->top; - if (i >= words) - { - s0.top=words; - s1.top=i-words; - s1.d= &(low->d[s1.top]); - } - else - s0.top=i; - s0.d=low->d; - -al.max=al.top; ah.max=ah.top; -bl.max=bl.top; bh.max=bh.top; -s0.max=bl.top; s1.max=bh.top; - - /* Calculate (al-ah)*(bh-bl) */ - BN_sub(&t1,&al,&ah); - BN_sub(&t2,&bh,&bl); - BN_mul(&m,&t1,&t2); - - /* Calculate ah*bh */ - BN_mul(&h,&ah,&bh); - - /* s0 == low(al*bl) - * s1 == low(ah*bh)+low((al-ah)*(bh-bl))+low(al*bl)+high(al*bl) - * We know s0 and s1 so the only unknown is high(al*bl) - * high(al*bl) == s1 - low(ah*bh+(al-ah)*(bh-bl)+s0) - */ - BN_add(&m,&m,&h); - BN_add(&t2,&m,&s0); - /* Quick and dirty mask off of high words */ - t3.d=t2.d; - t3.top=(t2.top > words)?words:t2.top; - t3.neg=t2.neg; -t3.max=t3.top; -/* BN_print_fp(stdout,&s1); printf(" s1\n"); */ -/* BN_print_fp(stdout,&t2); printf(" middle value\n"); */ -/* BN_print_fp(stdout,&t3); printf(" low middle value\n"); */ - BN_sub(&t1,&s1,&t3); - - if (t1.neg) - { -/*printf("neg fixup\n"); BN_print_fp(stdout,&t1); printf(" before\n"); */ - BN_lshift(&t2,BN_value_one(),words*32); - BN_add(&t1,&t2,&t1); - BN_mask_bits(&t1,words*32); -/* BN_print_fp(stdout,&t1); printf(" after\n"); */ - } - /* al*bl == high(al*bl)<bn[ctx->tos++]); - - if (a == b) - { - if (!BN_sqr(tmp,a,ctx)) goto err; - } - else - { - if (!BN_mul(tmp,a,b)) goto err; - } - /* reduce from aRR to aR */ - if (!BN_from_montgomery(r,tmp,mont,ctx)) goto err; - ctx->tos--; - return(1); -err: - return(0); - } - -int BN_from_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, BN_CTX *ctx) - { - BIGNUM z1; - BIGNUM *t1,*t2; - BN_ULONG *ap,*bp,*rp; - int j,i,bl,al; - - BN_init(&z1); - t1= &(ctx->bn[ctx->tos]); - t2= &(ctx->bn[ctx->tos+1]); - - if (!BN_copy(t1,a)) goto err; - /* can cheat */ - BN_mask_bits(t1,mont->ri); - if (!BN_mul(t2,t1,mont->Ni)) goto err; - BN_mask_bits(t2,mont->ri); - - if (!BN_mul(t1,t2,mont->N)) goto err; - if (!BN_add(t2,t1,a)) goto err; - - /* At this point, t2 has the bottom ri bits set to zero. - * This means that the bottom ri bits == the 1^ri minus the bottom - * ri bits of a. - * This means that only the bits above 'ri' in a need to be added, - * and XXXXXXXXXXXXXXXXXXXXXXXX - */ -BN_print_fp(stdout,t2); printf("\n"); - BN_rshift(r,t2,mont->ri); - - if (BN_ucmp(r,mont->N) >= 0) - BN_usub(r,r,mont->N); - - return(1); -err: - return(0); - } - -int BN_MONT_CTX_set(BN_MONT_CTX *mont, BIGNUM *mod, BN_CTX *ctx) - { - BIGNUM *Ri=NULL,*R=NULL; - - if (mont->RR == NULL) mont->RR=BN_new(); - if (mont->N == NULL) mont->N=BN_new(); - - R=mont->RR; /* grab RR as a temp */ - BN_copy(mont->N,mod); /* Set N */ - - mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2; - BN_lshift(R,BN_value_one(),mont->ri); /* R */ - if ((Ri=BN_mod_inverse(NULL,R,mod,ctx)) == NULL) goto err;/* Ri */ - BN_lshift(Ri,Ri,mont->ri); /* R*Ri */ - BN_usub(Ri,Ri,BN_value_one()); /* R*Ri - 1 */ - BN_div(Ri,NULL,Ri,mod,ctx); - if (mont->Ni != NULL) BN_free(mont->Ni); - mont->Ni=Ri; /* Ni=(R*Ri-1)/N */ - - /* setup RR for conversions */ - BN_lshift(mont->RR,BN_value_one(),mont->ri*2); - BN_mod(mont->RR,mont->RR,mont->N,ctx); - - return(1); -err: - return(0); - } - - -#endif diff --git a/crypto/openssl/crypto/des/FILES b/crypto/openssl/crypto/des/FILES deleted file mode 100644 index 4c7ea2d..0000000 --- a/crypto/openssl/crypto/des/FILES +++ /dev/null @@ -1,96 +0,0 @@ -/* General stuff */ -COPYRIGHT - Copyright info. -MODES.DES - A description of the features of the different modes of DES. -FILES - This file. -INSTALL - How to make things compile. -Imakefile - For use with kerberos. -README - What this package is. -VERSION - Which version this is and what was changed. -KERBEROS - Kerberos version 4 notes. -Makefile.PL - An old makefile to build with perl5, not current. -Makefile.ssl - The SSLeay makefile -Makefile.uni - The normal unix makefile. -GNUmakefile - The makefile for use with glibc. -makefile.bc - A Borland C makefile -times - Some outputs from 'speed' on some machines. -vms.com - For use when compiling under VMS - -/* My SunOS des(1) replacement */ -des.c - des(1) source code. -des.man - des(1) manual. - -/* Testing and timing programs. */ -destest.c - Source for libdes.a test program. -speed.c - Source for libdes.a timing program. -rpw.c - Source for libdes.a testing password reading routines. - -/* libdes.a source code */ -des_crypt.man - libdes.a manual page. -des.h - Public libdes.a header file. -ecb_enc.c - des_ecb_encrypt() source, this contains the basic DES code. -ecb3_enc.c - des_ecb3_encrypt() source. -cbc_ckm.c - des_cbc_cksum() source. -cbc_enc.c - des_cbc_encrypt() source. -ncbc_enc.c - des_cbc_encrypt() that is 'normal' in that it copies - the new iv values back in the passed iv vector. -ede_enc.c - des_ede3_cbc_encrypt() cbc mode des using triple DES. -cbc3_enc.c - des_3cbc_encrypt() source, don't use this function. -cfb_enc.c - des_cfb_encrypt() source. -cfb64enc.c - des_cfb64_encrypt() cfb in 64 bit mode but setup to be - used as a stream cipher. -cfb64ede.c - des_ede3_cfb64_encrypt() cfb in 64 bit mode but setup to be - used as a stream cipher and using triple DES. -ofb_enc.c - des_cfb_encrypt() source. -ofb64_enc.c - des_ofb_encrypt() ofb in 64 bit mode but setup to be - used as a stream cipher. -ofb64ede.c - des_ede3_ofb64_encrypt() ofb in 64 bit mode but setup to be - used as a stream cipher and using triple DES. -enc_read.c - des_enc_read() source. -enc_writ.c - des_enc_write() source. -pcbc_enc.c - des_pcbc_encrypt() source. -qud_cksm.c - quad_cksum() source. -rand_key.c - des_random_key() source. -read_pwd.c - Source for des_read_password() plus related functions. -set_key.c - Source for des_set_key(). -str2key.c - Covert a string of any length into a key. -fcrypt.c - A small, fast version of crypt(3). -des_locl.h - Internal libdes.a header file. -podd.h - Odd parity tables - used in des_set_key(). -sk.h - Lookup tables used in des_set_key(). -spr.h - What is left of the S tables - used in ecb_encrypt(). -des_ver.h - header file for the external definition of the - version string. -des.doc - SSLeay documentation for the library. - -/* The perl scripts - you can ignore these files they are only - * included for the curious */ -des.pl - des in perl anyone? des_set_key and des_ecb_encrypt - both done in a perl library. -testdes.pl - Testing program for des.pl -doIP - Perl script used to develop IP xor/shift code. -doPC1 - Perl script used to develop PC1 xor/shift code. -doPC2 - Generates sk.h. -PC1 - Output of doPC1 should be the same as output from PC1. -PC2 - used in development of doPC2. -shifts.pl - Perl library used by my perl scripts. - -/* I started making a perl5 dynamic library for libdes - * but did not fully finish, these files are part of that effort. */ -DES.pm -DES.pod -DES.xs -t -typemap - -/* The following are for use with sun RPC implementaions. */ -rpc_des.h -rpc_enc.c - -/* The following are contibuted by Mark Murray . They - * are not normally built into libdes due to machine specific routines - * contained in them. They are for use in the most recent incarnation of - * export kerberos v 4 (eBones). */ -supp.c -new_rkey.c - - diff --git a/crypto/openssl/crypto/pkcs12/p12_bags.c b/crypto/openssl/crypto/pkcs12/p12_bags.c deleted file mode 100644 index 56547ef..0000000 --- a/crypto/openssl/crypto/pkcs12/p12_bags.c +++ /dev/null @@ -1,192 +0,0 @@ -/* p12_bags.c */ -/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * 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 above 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 acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``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 THE OpenSSL PROJECT OR - * ITS 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. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include -#include "cryptlib.h" -#include -#include - -int i2d_PKCS12_BAGS(PKCS12_BAGS *a, unsigned char **pp) -{ - int bagnid, v = 0; - M_ASN1_I2D_vars(a); - bagnid = OBJ_obj2nid (a->type); - M_ASN1_I2D_len (a->type, i2d_ASN1_OBJECT); - - switch (bagnid) { - - case NID_x509Certificate: - M_ASN1_I2D_len_EXP_opt (a->value.x509cert, - i2d_ASN1_OCTET_STRING, 0, v); - break; - - case NID_x509Crl: - M_ASN1_I2D_len_EXP_opt (a->value.x509crl, - i2d_ASN1_OCTET_STRING, 0, v); - break; - - case NID_sdsiCertificate: - M_ASN1_I2D_len_EXP_opt (a->value.sdsicert, - i2d_ASN1_IA5STRING, 0, v); - break; - - default: - M_ASN1_I2D_len_EXP_opt (a->value.other, - i2d_ASN1_TYPE, 0, v); - break; - } - - M_ASN1_I2D_seq_total (); - - M_ASN1_I2D_put (a->type, i2d_ASN1_OBJECT); - - switch (bagnid) { - - case NID_x509Certificate: - M_ASN1_I2D_put_EXP_opt (a->value.x509cert, - i2d_ASN1_OCTET_STRING, 0, v); - break; - - case NID_x509Crl: - M_ASN1_I2D_put_EXP_opt (a->value.x509crl, - i2d_ASN1_OCTET_STRING, 0, v); - break; - - case NID_sdsiCertificate: - M_ASN1_I2D_put_EXP_opt (a->value.sdsicert, - i2d_ASN1_IA5STRING, 0, v); - break; - - default: - M_ASN1_I2D_put_EXP_opt (a->value.other, i2d_ASN1_TYPE, 0, v); - break; - } - M_ASN1_I2D_finish(); -} - -PKCS12_BAGS *PKCS12_BAGS_new(void) -{ - PKCS12_BAGS *ret=NULL; - ASN1_CTX c; - M_ASN1_New_Malloc(ret, PKCS12_BAGS); - ret->type=NULL; - ret->value.other=NULL; - return (ret); - M_ASN1_New_Error(ASN1_F_PKCS12_BAGS_NEW); -} - -PKCS12_BAGS *d2i_PKCS12_BAGS(PKCS12_BAGS **a, unsigned char **pp, - long length) -{ - int bagnid; - M_ASN1_D2I_vars(a,PKCS12_BAGS *,PKCS12_BAGS_new); - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get (ret->type, d2i_ASN1_OBJECT); - bagnid = OBJ_obj2nid (ret->type); - switch (bagnid) { - - case NID_x509Certificate: - M_ASN1_D2I_get_EXP_opt (ret->value.x509cert, - d2i_ASN1_OCTET_STRING, 0); - break; - - case NID_x509Crl: - M_ASN1_D2I_get_EXP_opt (ret->value.x509crl, - d2i_ASN1_OCTET_STRING, 0); - break; - - case NID_sdsiCertificate: - M_ASN1_D2I_get_EXP_opt (ret->value.sdsicert, - d2i_ASN1_IA5STRING, 0); - break; - - default: - M_ASN1_D2I_get_EXP_opt (ret->value.other, - d2i_ASN1_TYPE, 0); - break; - } - - M_ASN1_D2I_Finish(a, PKCS12_BAGS_free, ASN1_F_D2I_PKCS12_BAGS); -} - -void PKCS12_BAGS_free (PKCS12_BAGS *a) -{ - if (a == NULL) return; - switch (OBJ_obj2nid(a->type)) { - - case NID_x509Certificate: - M_ASN1_OCTET_STRING_free (a->value.x509cert); - break; - - case NID_x509Crl: - M_ASN1_OCTET_STRING_free (a->value.x509crl); - break; - - case NID_sdsiCertificate: - M_ASN1_IA5STRING_free (a->value.sdsicert); - break; - - default: - ASN1_TYPE_free (a->value.other); - break; - } - - ASN1_OBJECT_free (a->type); - OPENSSL_free (a); -} diff --git a/crypto/openssl/crypto/pkcs12/p12_lib.c b/crypto/openssl/crypto/pkcs12/p12_lib.c deleted file mode 100644 index 7d464e3..0000000 --- a/crypto/openssl/crypto/pkcs12/p12_lib.c +++ /dev/null @@ -1,111 +0,0 @@ -/* p12_lib.c */ -/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * 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 above 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 acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``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 THE OpenSSL PROJECT OR - * ITS 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. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include -#include "cryptlib.h" -#include -#include - -int i2d_PKCS12(PKCS12 *a, unsigned char **pp) -{ - M_ASN1_I2D_vars(a); - - M_ASN1_I2D_len (a->version, i2d_ASN1_INTEGER); - M_ASN1_I2D_len (a->authsafes, i2d_PKCS7); - M_ASN1_I2D_len (a->mac, i2d_PKCS12_MAC_DATA); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put (a->version, i2d_ASN1_INTEGER); - M_ASN1_I2D_put (a->authsafes, i2d_PKCS7); - M_ASN1_I2D_put (a->mac, i2d_PKCS12_MAC_DATA); - - M_ASN1_I2D_finish(); -} - -PKCS12 *d2i_PKCS12(PKCS12 **a, unsigned char **pp, long length) -{ - M_ASN1_D2I_vars(a,PKCS12 *,PKCS12_new); - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get (ret->version, d2i_ASN1_INTEGER); - M_ASN1_D2I_get (ret->authsafes, d2i_PKCS7); - M_ASN1_D2I_get_opt (ret->mac, d2i_PKCS12_MAC_DATA, V_ASN1_SEQUENCE); - M_ASN1_D2I_Finish(a, PKCS12_free, ASN1_F_D2I_PKCS12); -} - -PKCS12 *PKCS12_new(void) -{ - PKCS12 *ret=NULL; - ASN1_CTX c; - M_ASN1_New_Malloc(ret, PKCS12); - ret->version=NULL; - ret->mac=NULL; - ret->authsafes=NULL; - return (ret); - M_ASN1_New_Error(ASN1_F_PKCS12_NEW); -} - -void PKCS12_free (PKCS12 *a) -{ - if (a == NULL) return; - M_ASN1_INTEGER_free(a->version); - PKCS12_MAC_DATA_free (a->mac); - PKCS7_free (a->authsafes); - OPENSSL_free (a); -} diff --git a/crypto/openssl/crypto/pkcs12/p12_mac.c b/crypto/openssl/crypto/pkcs12/p12_mac.c deleted file mode 100644 index fbd1eca..0000000 --- a/crypto/openssl/crypto/pkcs12/p12_mac.c +++ /dev/null @@ -1,110 +0,0 @@ -/* p12_mac.c */ -/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * 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 above 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 acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``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 THE OpenSSL PROJECT OR - * ITS 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. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include -#include "cryptlib.h" -#include -#include - -int i2d_PKCS12_MAC_DATA(PKCS12_MAC_DATA *a, unsigned char **pp) -{ - M_ASN1_I2D_vars(a); - M_ASN1_I2D_len (a->dinfo, i2d_X509_SIG); - M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING); - M_ASN1_I2D_len (a->iter, i2d_ASN1_INTEGER); - - M_ASN1_I2D_seq_total(); - - M_ASN1_I2D_put (a->dinfo, i2d_X509_SIG); - M_ASN1_I2D_put (a->salt, i2d_ASN1_OCTET_STRING); - M_ASN1_I2D_put (a->iter, i2d_ASN1_INTEGER); - M_ASN1_I2D_finish(); -} - -PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void) -{ - PKCS12_MAC_DATA *ret=NULL; - ASN1_CTX c; - M_ASN1_New_Malloc(ret, PKCS12_MAC_DATA); - ret->dinfo = X509_SIG_new(); - ret->salt = M_ASN1_OCTET_STRING_new(); - ret->iter = NULL; - return(ret); - M_ASN1_New_Error(ASN1_F_PKCS12_MAC_DATA_NEW); -} - -PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a, unsigned char **pp, - long length) -{ - M_ASN1_D2I_vars(a,PKCS12_MAC_DATA *,PKCS12_MAC_DATA_new); - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get(ret->dinfo, d2i_X509_SIG); - M_ASN1_D2I_get(ret->salt, d2i_ASN1_OCTET_STRING); - M_ASN1_D2I_get_opt(ret->iter, d2i_ASN1_INTEGER, V_ASN1_INTEGER); - M_ASN1_D2I_Finish(a, PKCS12_MAC_DATA_free, ASN1_F_D2I_PKCS12_MAC_DATA); -} - -void PKCS12_MAC_DATA_free (PKCS12_MAC_DATA *a) -{ - if (a == NULL) return; - X509_SIG_free (a->dinfo); - M_ASN1_OCTET_STRING_free(a->salt); - M_ASN1_INTEGER_free(a->iter); - OPENSSL_free (a); -} diff --git a/crypto/openssl/crypto/pkcs12/p12_sbag.c b/crypto/openssl/crypto/pkcs12/p12_sbag.c deleted file mode 100644 index 64ac32e..0000000 --- a/crypto/openssl/crypto/pkcs12/p12_sbag.c +++ /dev/null @@ -1,234 +0,0 @@ -/* p12_sbag.c */ -/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * 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 above 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 acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``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 THE OpenSSL PROJECT OR - * ITS 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. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include -#include "cryptlib.h" -#include -#include - -int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp) -{ - int bagnid, v = 0; - M_ASN1_I2D_vars(a); - bagnid = OBJ_obj2nid (a->type); - M_ASN1_I2D_len (a->type, i2d_ASN1_OBJECT); - - switch (bagnid) { - - case NID_keyBag: - M_ASN1_I2D_len_EXP_opt (a->value.keybag, - i2d_PKCS8_PRIV_KEY_INFO, 0, v); - break; - - case NID_pkcs8ShroudedKeyBag: - M_ASN1_I2D_len_EXP_opt (a->value.shkeybag, - i2d_X509_SIG, 0, v); - break; - - case NID_safeContentsBag: - M_ASN1_I2D_len_EXP_SEQUENCE_opt_type - (PKCS12_SAFEBAG, a->value.safes, i2d_PKCS12_SAFEBAG, - 0, V_ASN1_SEQUENCE, v); - break; - - case NID_certBag: - case NID_crlBag: - case NID_secretBag: - M_ASN1_I2D_len_EXP_opt (a->value.bag, - i2d_PKCS12_BAGS, 0, v); - break; - - default: - M_ASN1_I2D_len_EXP_opt (a->value.other, - i2d_ASN1_TYPE, 0, v); - break; - } - - M_ASN1_I2D_len_SET_type (X509_ATTRIBUTE,a->attrib, i2d_X509_ATTRIBUTE); - - M_ASN1_I2D_seq_total (); - - M_ASN1_I2D_put (a->type, i2d_ASN1_OBJECT); - - switch (bagnid) { - - case NID_keyBag: - M_ASN1_I2D_put_EXP_opt (a->value.keybag, - i2d_PKCS8_PRIV_KEY_INFO, 0, v); - break; - - case NID_pkcs8ShroudedKeyBag: - M_ASN1_I2D_put_EXP_opt (a->value.shkeybag, - i2d_X509_SIG, 0, v); - break; - - case NID_safeContentsBag: - M_ASN1_I2D_put_EXP_SEQUENCE_opt_type - (PKCS12_SAFEBAG, a->value.safes, i2d_PKCS12_SAFEBAG, - 0, V_ASN1_SEQUENCE, v); - break; - - case NID_certBag: - case NID_crlBag: - case NID_secretBag: - M_ASN1_I2D_put_EXP_opt (a->value.bag, - i2d_PKCS12_BAGS, 0, v); - break; - - default: - M_ASN1_I2D_put_EXP_opt (a->value.other, - i2d_ASN1_TYPE, 0, v); - break; - } - - M_ASN1_I2D_put_SET_type (X509_ATTRIBUTE, a->attrib, i2d_X509_ATTRIBUTE); - - M_ASN1_I2D_finish(); -} - -PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void) -{ - PKCS12_SAFEBAG *ret=NULL; - ASN1_CTX c; - M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG); - ret->type=NULL; - ret->value.other=NULL; - M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null); - ret->rest=NULL; - return (ret); - M_ASN1_New_Error(ASN1_F_PKCS12_SAFEBAG_NEW); -} - -PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp, - long length) -{ - int bagnid; - M_ASN1_D2I_vars(a,PKCS12_SAFEBAG *,PKCS12_SAFEBAG_new); - M_ASN1_D2I_Init(); - M_ASN1_D2I_start_sequence(); - M_ASN1_D2I_get (ret->type, d2i_ASN1_OBJECT); - bagnid = OBJ_obj2nid (ret->type); - - switch (bagnid) { - - case NID_keyBag: - M_ASN1_D2I_get_EXP_opt (ret->value.keybag, - d2i_PKCS8_PRIV_KEY_INFO, 0); - break; - - case NID_pkcs8ShroudedKeyBag: - M_ASN1_D2I_get_EXP_opt (ret->value.shkeybag, - d2i_X509_SIG, 0); - break; - - case NID_safeContentsBag: - M_ASN1_D2I_get_EXP_set_opt_type - (PKCS12_SAFEBAG, ret->value.safes, - d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free, 0, - V_ASN1_SEQUENCE); - break; - - case NID_certBag: - case NID_crlBag: - case NID_secretBag: - M_ASN1_D2I_get_EXP_opt (ret->value.bag, - d2i_PKCS12_BAGS, 0); - break; - - default: - M_ASN1_D2I_get_EXP_opt (ret->value.other, - d2i_ASN1_TYPE, 0); - break; - } - M_ASN1_D2I_get_set_opt_type(X509_ATTRIBUTE,ret->attrib, - d2i_X509_ATTRIBUTE,X509_ATTRIBUTE_free); - M_ASN1_D2I_Finish(a, PKCS12_SAFEBAG_free, ASN1_F_D2I_PKCS12_SAFEBAG); -} - -void PKCS12_SAFEBAG_free (PKCS12_SAFEBAG *a) -{ - if (a == NULL) return; - switch (OBJ_obj2nid(a->type)) { - - case NID_keyBag: - PKCS8_PRIV_KEY_INFO_free (a->value.keybag); - break; - - case NID_pkcs8ShroudedKeyBag: - X509_SIG_free (a->value.shkeybag); - break; - - case NID_certBag: - case NID_crlBag: - case NID_secretBag: - PKCS12_BAGS_free (a->value.bag); - break; - - default: - ASN1_TYPE_free (a->value.other); - break; - } - - ASN1_OBJECT_free (a->type); - sk_X509_ATTRIBUTE_pop_free (a->attrib, X509_ATTRIBUTE_free); - OPENSSL_free (a); -} - -IMPLEMENT_STACK_OF(PKCS12_SAFEBAG) -IMPLEMENT_ASN1_SET_OF(PKCS12_SAFEBAG) -IMPLEMENT_PKCS12_STACK_OF(PKCS12_SAFEBAG) diff --git a/crypto/openssl/doc/crypto/BIO_new_bio_pair.pod b/crypto/openssl/doc/crypto/BIO_new_bio_pair.pod deleted file mode 100644 index 2256ba9..0000000 --- a/crypto/openssl/doc/crypto/BIO_new_bio_pair.pod +++ /dev/null @@ -1,102 +0,0 @@ -=pod - -=head1 NAME - -BIO_new_bio_pair - create a new BIO pair - -=head1 SYNOPSIS - - #include - - int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, BIO **bio2, size_t writebuf2); - -=head1 DESCRIPTION - -BIO_new_bio_pair() creates a buffering BIO pair. It has two endpoints between -data can be buffered. Its typical use is to connect one endpoint as underlying -input/output BIO to an SSL and access the other one controlled by the program -instead of accessing the network connection directly. - -The two new BIOs B and B are symmetric with respect to their -functionality. The size of their buffers is determined by B and -B. If the size give is 0, the default size is used. - -BIO_new_bio_pair() does not check whether B or B do point to -some other BIO, the values are overwritten, BIO_free() is not called. - -The two BIOs, even though forming a BIO pair and must be BIO_free()'ed -separately. This can be of importance, as some SSL-functions like SSL_set_bio() -or SSL_free() call BIO_free() implicitly, so that the peer-BIO is left -untouched and must also be BIO_free()'ed. - -=head1 EXAMPLE - -The BIO pair can be used to have full control over the network access of an -application. The application can call select() on the socket as required -without having to go through the SSL-interface. - - BIO *internal_bio, *network_bio; - ... - BIO_new_bio_pair(internal_bio, 0, network_bio, 0); - SSL_set_bio(ssl, internal_bio); - SSL_operations(); - ... - - application | TLS-engine - | | - +----------> SSL_operations() - | /\ || - | || \/ - | BIO-pair (internal_bio) - +----------< BIO-pair (network_bio) - | | - socket | - - ... - SSL_free(ssl); /* implicitly frees internal_bio */ - BIO_free(network_bio); - ... - -As the BIO pair will only buffer the data and never directly access the -connection, it behaves non-blocking and will return as soon as the write -buffer is full or the read buffer is drained. Then the application has to -flush the write buffer and/or fill the read buffer. - -Use the BIO_ctrl_pending(), to find out whether data is buffered in the BIO -and must be transfered to the network. Use BIO_ctrl_get_read_request() to -find out, how many bytes must be written into the buffer before the -SSL_operation() can successfully be continued. - -=head1 IMPORTANT - -As the data is buffered, SSL_operation() may return with a ERROR_SSL_WANT_READ -condition, but there is still data in the write buffer. An application must -not rely on the error value of SSL_operation() but must assure that the -write buffer is always flushed first. Otherwise a deadlock may occur as -the peer might be waiting for the data before being able to continue. - -=head1 RETURN VALUES - -The following return values can occur: - -=over 4 - -=item 1 - -The BIO pair was created successfully. The new BIOs are available in -B and B. - -=item 0 - -The operation failed. The NULL pointer is stored into the locations for -B and B. Check the error stack for more information. - -=back - -=head1 SEE ALSO - -L, L, L, -L, -L - -=cut diff --git a/crypto/openssl/perl/MANIFEST b/crypto/openssl/perl/MANIFEST deleted file mode 100644 index 80c9007..0000000 --- a/crypto/openssl/perl/MANIFEST +++ /dev/null @@ -1,17 +0,0 @@ -README.1ST -MANIFEST -Makefile.PL -typemap -OpenSSL.pm -OpenSSL.xs -openssl.h -openssl_bio.xs -openssl_bn.xs -openssl_cipher.xs -openssl_digest.xs -openssl_err.xs -openssl_ssl.xs -openssl_x509.xs -t/01-use.t -t/02-version.t -t/03-bio.t diff --git a/crypto/openssl/perl/Makefile.PL b/crypto/openssl/perl/Makefile.PL deleted file mode 100644 index 2a67ad0..0000000 --- a/crypto/openssl/perl/Makefile.PL +++ /dev/null @@ -1,45 +0,0 @@ -## -## Makefile.PL -- Perl MakeMaker specification -## - -open(IN,"<../Makefile.ssl") || die "unable to open Makefile.ssl!\n"; -while() { - $V=$1 if (/^VERSION=(.*)$/); -} -close(IN); -print "Configuring companion Perl module for OpenSSL $V\n"; - -use ExtUtils::MakeMaker; - -WriteMakefile( - 'OPTIMIZE' => '', - 'DISTNAME' => "openssl-$V", - 'NAME' => 'OpenSSL', - 'VERSION_FROM' => 'OpenSSL.pm', - 'LIBS' => ( $^O eq 'MSWin32' - ? [ '-L../out32dll -lssleay32 -llibeay32' ] - : [ '-L.. -lssl -lcrypto' ] ), - 'DEFINE' => '', - 'INC' => '-I../include', - 'H' => ['openssl.h'], - 'OBJECT' => - 'OpenSSL.o ' . - 'openssl_bio.o ' . - 'openssl_bn.o ' . - 'openssl_cipher.o ' . - 'openssl_digest.o ' . - 'openssl_err.o ' . - 'openssl_ssl.o ' . - 'openssl_x509.o ', - 'XS' => { - 'OpenSSL.xs' => 'OpenSSL.c', - 'openssl_bio.xs' => 'openssl_bio.c', - 'openssl_bn.xs' => 'openssl_bn.c', - 'openssl_cipher.xs' => 'openssl_cipher.c', - 'openssl_digest.xs' => 'openssl_digest.c', - 'openssl_err.xs' => 'openssl_err.c', - 'openssl_ssl.xs' => 'openssl_ssl.c', - 'openssl_x509.xs' => 'openssl_x509.c', - }, -); - diff --git a/crypto/openssl/perl/OpenSSL.pm b/crypto/openssl/perl/OpenSSL.pm deleted file mode 100644 index ae7265a..0000000 --- a/crypto/openssl/perl/OpenSSL.pm +++ /dev/null @@ -1,90 +0,0 @@ -## -## OpenSSL.pm -## - -package OpenSSL; - -require 5.000; -use Exporter; -use DynaLoader; - -@ISA = qw(Exporter DynaLoader); -@EXPORT = qw(); - -$VERSION = '0.94'; -bootstrap OpenSSL; - -@OpenSSL::BN::ISA = qw(OpenSSL::ERR); -@OpenSSL::MD::ISA = qw(OpenSSL::ERR); -@OpenSSL::Cipher::ISA = qw(OpenSSL::ERR); -@OpenSSL::SSL::CTX::ISA = qw(OpenSSL::ERR); -@OpenSSL::BIO::ISA = qw(OpenSSL::ERR); -@OpenSSL::SSL::ISA = qw(OpenSSL::ERR); - -@BN::ISA = qw(OpenSSL::BN); -@MD::ISA = qw(OpenSSL::MD); -@Cipher::ISA = qw(OpenSSL::Cipher); -@SSL::ISA = qw(OpenSSL::SSL); -@SSL::CTX::ISA = qw(OpenSSL::SSL::CTX); -@BIO::ISA = qw(OpenSSL::BIO); - -@OpenSSL::MD::names = qw( - md2 md5 sha sha1 ripemd160 mdc2 -); - -@OpenSSL::Cipher::names = qw( - des-ecb des-cfb des-ofb des-cbc - des-ede des-ede-cfb des-ede-ofb des-ede-cbc - des-ede3 des-ede3-cfb des-ede3-ofb des-ede3-cbc - desx-cbc rc4 rc4-40 - idea-ecb idea-cfb idea-ofb idea-cbc - rc2-ecb rc2-cbc rc2-40-cbc rc2-cfb rc2-ofb - bf-ecb bf-cfb bf-ofb bf-cbc - cast5-ecb cast5-cfb cast5-ofb cast5-cbc - rc5-ecb rc5-cfb rc5-ofb rc5-cbc -); - -sub OpenSSL::SSL::CTX::new_ssl { - OpenSSL::SSL::new($_[0]); -} - -sub OpenSSL::ERR::error { - my($o) = @_; - my($s, $ret); - - while (($s = $o->get_error()) != 0) { - $ret.=$s."\n"; - } - return($ret); -} - -@OpenSSL::Cipher::aliases = qw( - des desx des3 idea rc2 bf cast -); - -package OpenSSL::BN; - -sub bnfix { - (ref($_[0]) ne "OpenSSL::BN") ? OpenSSL::BN::dec2bn($_[0]) : $_[0]; -} - -use overload -"=" => sub { dup($_[0]); }, -"+" => sub { add($_[0],$_[1]); }, -"-" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; OpenSSL::BN::sub($_[0],$_[1]); }, -"*" => sub { mul($_[0],$_[1]); }, -"**" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; OpenSSL::BN::exp($_[0],$_[1]); }, -"/" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; (div($_[0],$_[1]))[0]; }, -"%" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; mod($_[0],$_[1]); }, -"<<" => sub { lshift($_[0],$_[1]); }, -">>" => sub { rshift($_[0],$_[1]); }, -"<=>" => sub { OpenSSL::BN::cmp($_[0],$_[1]); }, -'""' => sub { bn2dec($_[0]); }, -'0+' => sub { dec2bn($_[0]); }, -"bool" => sub { ref($_[0]) eq "OpenSSL::BN"; }; - -sub OpenSSL::BIO::do_accept { - OpenSSL::BIO::do_handshake(@_); -} - -1; diff --git a/crypto/openssl/perl/OpenSSL.xs b/crypto/openssl/perl/OpenSSL.xs deleted file mode 100644 index 2267168..0000000 --- a/crypto/openssl/perl/OpenSSL.xs +++ /dev/null @@ -1,82 +0,0 @@ -/* -** OpenSSL.xs -*/ - -#include "openssl.h" - -SV * -new_ref(type, obj, mort) - char *type; - char *obj; -{ - SV *ret; - - if (mort) - ret = sv_newmortal(); - else - ret = newSViv(0); -#ifdef DEBUG - printf(">new_ref %d\n",type); -#endif - sv_setref_pv(ret, type, (void *)obj); - return(ret); -} - -int -ex_new(obj, data, ad, idx, argl, argp) - char *obj; - SV *data; - CRYPTO_EX_DATA *ad; - int idx; - long argl; - char *argp; -{ - SV *sv; - -#ifdef DEBUG - printf("ex_new %08X %s\n",obj,argp); -#endif - sv = sv_newmortal(); - sv_setref_pv(sv, argp, (void *)obj); -#ifdef DEBUG - printf("%d>new_ref '%s'\n", sv, argp); -#endif - CRYPTO_set_ex_data(ad, idx, (char *)sv); - return(1); -} - -void -ex_cleanup(obj, data, ad, idx, argl, argp) - char *obj; - SV *data; - CRYPTO_EX_DATA *ad; - int idx; - long argl; - char *argp; -{ - pr_name("ex_cleanup"); -#ifdef DEBUG - printf("ex_cleanup %08X %s\n", obj, argp); -#endif - if (data != NULL) - SvREFCNT_dec((SV *)data); -} - -MODULE = OpenSSL PACKAGE = OpenSSL - -PROTOTYPES: ENABLE - -BOOT: - boot_bio(); - boot_cipher(); - boot_digest(); - boot_err(); - boot_ssl(); - boot_OpenSSL__BN(); - boot_OpenSSL__BIO(); - boot_OpenSSL__Cipher(); - boot_OpenSSL__MD(); - boot_OpenSSL__ERR(); - boot_OpenSSL__SSL(); - boot_OpenSSL__X509(); - diff --git a/crypto/openssl/perl/README.1ST b/crypto/openssl/perl/README.1ST deleted file mode 100644 index 7b5a1aa..0000000 --- a/crypto/openssl/perl/README.1ST +++ /dev/null @@ -1,4 +0,0 @@ - - WARNING, this Perl interface to OpenSSL is horrible incomplete. - Don't expect it to be really useable!! - diff --git a/crypto/openssl/perl/openssl.h b/crypto/openssl/perl/openssl.h deleted file mode 100644 index 2712324..0000000 --- a/crypto/openssl/perl/openssl.h +++ /dev/null @@ -1,96 +0,0 @@ -/* 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.] - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#ifdef __cplusplus -} -#endif - -typedef struct datum_st { - char *dptr; - int dsize; -} datum; - -#include -#include -#include -#include -#include -#include -#include - -#ifdef DEBUG -#define pr_name(name) printf("%s\n",name) -#define pr_name_d(name,p2) printf("%s %d\n",name,p2) -#define pr_name_dd(name,p2,p3) printf("%s %d %d\n",name,p2,p3) -#else -#define pr_name(name) -#define pr_name_d(name,p2) -#define pr_name_dd(name,p2,p3) -#endif - -SV *new_ref(char *type, char *obj, int mort); -int ex_new(char *obj, SV *data, CRYPTO_EX_DATA *ad, int idx, long argl, char *argp); -void ex_cleanup(char *obj, SV *data, CRYPTO_EX_DATA *ad, int idx, long argl, char *argp); - diff --git a/crypto/openssl/perl/openssl_bio.xs b/crypto/openssl/perl/openssl_bio.xs deleted file mode 100644 index 06d61af..0000000 --- a/crypto/openssl/perl/openssl_bio.xs +++ /dev/null @@ -1,450 +0,0 @@ - -#include "openssl.h" - -static int p5_bio_ex_bio_ptr = 0; -static int p5_bio_ex_bio_callback = 0; -static int p5_bio_ex_bio_callback_data = 0; - -static long -p5_bio_callback(bio,state,parg,cmd,larg,ret) - BIO *bio; - int state; - char *parg; - int cmd; - long larg; - int ret; -{ - int i; - SV *me,*cb; - - me = (SV *)BIO_get_ex_data(bio, p5_bio_ex_bio_ptr); - cb = (SV *)BIO_get_ex_data(bio, p5_bio_ex_bio_callback); - if (cb != NULL) { - dSP; - - ENTER; - SAVETMPS; - - PUSHMARK(sp); - XPUSHs(sv_2mortal(newSVsv(me))); - XPUSHs(sv_2mortal(newSViv(state))); - XPUSHs(sv_2mortal(newSViv(cmd))); - if ((state == BIO_CB_READ) || (state == BIO_CB_WRITE)) - XPUSHs(sv_2mortal(newSVpv(parg,larg))); - else - XPUSHs(&sv_undef); - /* ptr one */ - XPUSHs(sv_2mortal(newSViv(larg))); - XPUSHs(sv_2mortal(newSViv(ret))); - PUTBACK; - - i = perl_call_sv(cb,G_SCALAR); - - SPAGAIN; - if (i == 1) - ret = POPi; - else - ret = 1; - PUTBACK; - FREETMPS; - LEAVE; - } - else { - croak("Internal error in p5_bio_callback"); - } - return(ret); -} - -int -boot_bio(void) -{ - p5_bio_ex_bio_ptr = BIO_get_ex_new_index(0, "OpenSSL::BIO", ex_new, NULL, ex_cleanup); - p5_bio_ex_bio_callback = BIO_get_ex_new_index(0, "bio_callback", NULL, NULL, ex_cleanup); - p5_bio_ex_bio_callback_data = BIO_get_ex_new_index(0, "bio_callback_data", NULL, NULL, ex_cleanup); - return(1); -} - -MODULE = OpenSSL::BIO PACKAGE = OpenSSL::BIO PREFIX = p5_BIO_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -void -p5_BIO_new_buffer_ssl_connect(...) - PROTOTYPE: ;$ - PREINIT: - SSL_CTX *ctx; - BIO *bio; - SV *arg; - PPCODE: - if (items == 1) - arg = ST(0); - else if (items == 2) - arg = ST(1); - else - arg = NULL; - if ((arg == NULL) || !(sv_derived_from(arg,"OpenSSL::SSL::CTX"))) - croak("Usage: OpenSSL::BIO::new_buffer_ssl_connect(SSL_CTX)"); - else { - IV tmp = SvIV((SV *)SvRV(arg)); - ctx = (SSL_CTX *)tmp; - } - EXTEND(sp, 1); - bio = BIO_new_buffer_ssl_connect(ctx); - arg = (SV *)BIO_get_ex_data(bio, p5_bio_ex_bio_ptr); - PUSHs(arg); - -void -p5_BIO_new_ssl_connect(...) - PROTOTYPE: ;$ - PREINIT: - SSL_CTX *ctx; - BIO *bio; - SV *arg; - PPCODE: - if (items == 1) - arg = ST(0); - else if (items == 2) - arg = ST(1); - else - arg = NULL; - if ((arg == NULL) || !(sv_derived_from(arg,"OpenSSL::SSL::CTX"))) - croak("Usage: OpenSSL::BIO::new_ssl_connect(SSL_CTX)"); - else { - IV tmp = SvIV((SV *)SvRV(arg)); - ctx = (SSL_CTX *)tmp; - } - EXTEND(sp,1); - bio = BIO_new_ssl_connect(ctx); - arg = (SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - PUSHs(arg); - -void -p5_BIO_new(...) - PROTOTYPE: ;$ - PREINIT: - BIO *bio; - char *type; - SV *arg; - PPCODE: - pr_name("p5_BIO_new"); - if ((items == 1) && SvPOK(ST(0))) - type = SvPV(ST(0),na); - else if ((items == 2) && SvPOK(ST(1))) - type = SvPV(ST(1),na); - else - croak("Usage: OpenSSL::BIO::new(type)"); - EXTEND(sp,1); - if (strcmp(type, "mem") == 0) - bio=BIO_new(BIO_s_mem()); - else if (strcmp(type, "socket") == 0) - bio=BIO_new(BIO_s_socket()); - else if (strcmp(type, "connect") == 0) - bio=BIO_new(BIO_s_connect()); - else if (strcmp(type, "accept") == 0) - bio=BIO_new(BIO_s_accept()); - else if (strcmp(type, "fd") == 0) - bio=BIO_new(BIO_s_fd()); - else if (strcmp(type, "file") == 0) - bio=BIO_new(BIO_s_file()); - else if (strcmp(type, "null") == 0) - bio=BIO_new(BIO_s_null()); - else if (strcmp(type, "ssl") == 0) - bio=BIO_new(BIO_f_ssl()); - else if (strcmp(type, "buffer") == 0) - bio=BIO_new(BIO_f_buffer()); - else - croak("unknown BIO type"); - arg = (SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - PUSHs(arg); - -int -p5_BIO_hostname(bio, name) - BIO *bio; - char *name; - PROTOTYPE: $$ - CODE: - RETVAL = BIO_set_conn_hostname(bio, name); - OUTPUT: - RETVAL - -int -p5_BIO_set_accept_port(bio, str) - BIO *bio; - char *str; - PROTOTYPE: $$ - CODE: - RETVAL = BIO_set_accept_port(bio, str); - OUTPUT: - RETVAL - -int -p5_BIO_do_handshake(bio) - BIO *bio; - PROTOTYPE: $ - CODE: - RETVAL = BIO_do_handshake(bio); - OUTPUT: - RETVAL - -BIO * -p5_BIO_push(b, bio) - BIO *b; - BIO *bio; - PROTOTYPE: $$ - CODE: - /* This reference will be reduced when the reference is - * let go, and then when the BIO_free_all() is called - * inside the OpenSSL library by the BIO with this - * pushed into */ - bio->references++; - RETVAL = BIO_push(b, bio); - OUTPUT: - RETVAL - -void -p5_BIO_pop(b) - BIO *b - PROTOTYPE: $ - PREINIT: - BIO *bio; - char *type; - SV *arg; - PPCODE: - bio = BIO_pop(b); - if (bio != NULL) { - /* This BIO will either be one created in the - * perl library, in which case it will have a perl - * SV, otherwise it will have been created internally, - * inside OpenSSL. For the 'pushed in', it needs - * the reference count decremented. */ - arg = (SV *)BIO_get_ex_data(bio, p5_bio_ex_bio_ptr); - if (arg == NULL) { - arg = new_ref("OpenSSL::BIO",(char *)bio,0); - BIO_set_ex_data(bio, p5_bio_ex_bio_ptr, (char *)arg); - PUSHs(arg); - } - else { - /* it was pushed in */ - SvREFCNT_inc(arg); - PUSHs(arg); - } - } - -int -p5_BIO_sysread(bio, in, num, ...) - BIO *bio; - SV *in; - int num; - PROTOTYPE: $$$; - PREINIT: - int i,n,olen; - int offset; - char *p; - CODE: - offset = 0; - if (!SvPOK(in)) - sv_setpvn(in, "", 0); - SvPV(in, olen); - if (items > 3) { - offset = SvIV(ST(3)); - if (offset < 0) { - if (-offset > olen) - croak("Offset outside string"); - offset+=olen; - } - } - if ((num+offset) > olen) { - SvGROW(in, num+offset+1); - p=SvPV(in, i); - memset(&(p[olen]), 0, (num+offset)-olen+1); - } - p = SvPV(in,n); - i = BIO_read(bio, p+offset, num); - RETVAL = i; - if (i <= 0) - i = 0; - SvCUR_set(in, offset+i); - OUTPUT: - RETVAL - -int -p5_BIO_syswrite(bio, in, ...) - BIO *bio; - SV *in; - PROTOTYPE: $$; - PREINIT: - char *ptr; - int len,in_len; - int offset=0; - int n; - CODE: - ptr = SvPV(in, in_len); - if (items > 2) { - len = SvOK(ST(2)) ? SvIV(ST(2)) : in_len; - if (items > 3) { - offset = SvIV(ST(3)); - if (offset < 0) { - if (-offset > in_len) - croak("Offset outside string"); - offset+=in_len; - } - else if ((offset >= in_len) && (in_len > 0)) - croak("Offset outside string"); - } - if (len >= (in_len-offset)) - len = in_len-offset; - } - else - len = in_len; - RETVAL = BIO_write(bio, ptr+offset, len); - OUTPUT: - RETVAL - -void -p5_BIO_getline(bio) - BIO *bio; - PROTOTYPE: $ - PREINIT: - int i; - char *p; - PPCODE: - pr_name("p5_BIO_gets"); - EXTEND(sp, 1); - PUSHs(sv_newmortal()); - sv_setpvn(ST(0), "", 0); - SvGROW(ST(0), 1024); - p=SvPV(ST(0), na); - i = BIO_gets(bio, p, 1024); - if (i < 0) - i = 0; - SvCUR_set(ST(0), i); - -int -p5_BIO_flush(bio) - BIO *bio; - PROTOTYPE: $ - CODE: - RETVAL = BIO_flush(bio); - OUTPUT: - RETVAL - -char * -p5_BIO_type(bio) - BIO *bio; - PROTOTYPE: $ - CODE: - RETVAL = bio->method->name; - OUTPUT: - RETVAL - -void -p5_BIO_next_bio(b) - BIO *b - PROTOTYPE: $ - PREINIT: - BIO *bio; - char *type; - SV *arg; - PPCODE: - bio = b->next_bio; - if (bio != NULL) { - arg = (SV *)BIO_get_ex_data(bio, p5_bio_ex_bio_ptr); - if (arg == NULL) { - arg = new_ref("OpenSSL::BIO", (char *)bio, 0); - BIO_set_ex_data(bio, p5_bio_ex_bio_ptr, (char *)arg); - bio->references++; - PUSHs(arg); - } - else { - SvREFCNT_inc(arg); - PUSHs(arg); - } - } - -int -p5_BIO_puts(bio, in) - BIO *bio; - SV *in; - PROTOTYPE: $$ - PREINIT: - char *ptr; - CODE: - ptr = SvPV(in,na); - RETVAL = BIO_puts(bio, ptr); - OUTPUT: - RETVAL - -void -p5_BIO_set_callback(bio, cb,...) - BIO *bio; - SV *cb; - PROTOTYPE: $$; - PREINIT: - SV *arg = NULL; - SV *arg2 = NULL; - CODE: - if (items > 3) - croak("Usage: OpenSSL::BIO::set_callback(bio,callback[,arg]"); - if (items == 3) { - arg2 = sv_mortalcopy(ST(2)); - SvREFCNT_inc(arg2); - BIO_set_ex_data(bio, p5_bio_ex_bio_callback_data, (char *)arg2); - } - arg = sv_mortalcopy(ST(1)); - SvREFCNT_inc(arg); - BIO_set_ex_data(bio, p5_bio_ex_bio_callback, (char *)arg); - /* printf("%08lx < bio_ptr\n",BIO_get_ex_data(bio,p5_bio_ex_bio_ptr)); */ - BIO_set_callback(bio, p5_bio_callback); - -void -p5_BIO_DESTROY(bio) - BIO *bio - PROTOTYPE: $ - PREINIT: - SV *sv; - PPCODE: - pr_name_d("p5_BIO_DESTROY",bio->references); - /* printf("p5_BIO_DESTROY <%s> %d\n",bio->method->name,bio->references); */ - BIO_set_ex_data(bio,p5_bio_ex_bio_ptr,NULL); - BIO_free_all(bio); - -int -p5_BIO_set_ssl(bio, ssl) - BIO *bio; - SSL *ssl; - PROTOTYPE: $$ - CODE: - pr_name("p5_BIO_set_ssl"); - ssl->references++; - RETVAL = BIO_set_ssl(bio, ssl, BIO_CLOSE); - OUTPUT: - RETVAL - -int -p5_BIO_number_read(bio) - BIO *bio; - PROTOTYPE: $ - CODE: - RETVAL = BIO_number_read(bio); - OUTPUT: - RETVAL - -int -p5_BIO_number_written(bio) - BIO *bio; - PROTOTYPE: $ - CODE: - RETVAL = BIO_number_written(bio); - OUTPUT: - RETVAL - -int -p5_BIO_references(bio) - BIO *bio; - PROTOTYPE: $ - CODE: - RETVAL = bio->references; - OUTPUT: - RETVAL - diff --git a/crypto/openssl/perl/openssl_bn.xs b/crypto/openssl/perl/openssl_bn.xs deleted file mode 100644 index f79bf87..0000000 --- a/crypto/openssl/perl/openssl_bn.xs +++ /dev/null @@ -1,593 +0,0 @@ - -#include "openssl.h" - -int sv_to_BIGNUM(var,arg,name) -BIGNUM **var; -SV *arg; -char *name; - { - int ret=1; - - if (sv_derived_from(arg,"OpenSSL::BN")) - { - IV tmp = SvIV((SV*)SvRV(arg)); - *var = (BIGNUM *) tmp; - } - else if (SvIOK(arg)) { - SV *tmp=sv_newmortal(); - *var=BN_new(); - BN_set_word(*var,SvIV(arg)); - sv_setref_pv(tmp,"OpenSSL::BN",(void*)*var); - } - else if (SvPOK(arg)) { - char *ptr; - STRLEN len; - SV *tmp=sv_newmortal(); - *var=BN_new(); - sv_setref_pv(tmp,"OpenSSL::BN", (void*)*var); - ptr=SvPV(arg,len); - SvGROW(arg,len+1); - ptr[len]='\0'; - BN_dec2bn(var,ptr); - } - else - { - croak(name); - ret=0; - } - return(ret); - } - -typedef struct gpc_args_st { - SV *cb; - SV *arg; - } GPC_ARGS; - -static void generate_prime_callback(pos,num,arg) -int pos; -int num; -char *arg; - { - dSP ; - int i; - GPC_ARGS *a=(GPC_ARGS *)arg; - - ENTER ; - SAVETMPS ; - - PUSHMARK(sp); - XPUSHs(sv_2mortal(newSViv(pos))); - XPUSHs(sv_2mortal(newSViv(num))); - XPUSHs(sv_2mortal(newSVsv(a->arg))); - PUTBACK; - - i=perl_call_sv(a->cb,G_DISCARD); - - SPAGAIN; - - PUTBACK; - FREETMPS; - LEAVE; - } - -MODULE = OpenSSL::BN PACKAGE = OpenSSL::BN PREFIX = p5_BN_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -void -p5_BN_new(...) - PREINIT: - BIGNUM *bn; - SV *arg; - PPCODE: - pr_name("p5_BN_new"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - bn=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)bn); - -void -p5_BN_dup(a) - BIGNUM *a; - PREINIT: - BIGNUM *bn; - PPCODE: - pr_name("p5_BN_dup"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - bn=BN_dup(a); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)bn); - -void -p5_BN_rand(bits,...) - int bits; - PREINIT: - int top=1; - int bottom=0; - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_rand"); - if ((items < 1) || (items > 3)) - croak("Usage: OpenSSL::BN::rand(bits[,top_bit][,bottombit]"); - if (items >= 2) top=(int)SvIV(ST(0)); - if (items >= 3) bottom=(int)SvIV(ST(1)); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - BN_rand(ret,bits,top,bottom); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - -void -p5_BN_bin2bn(a) - datum a; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_bin2bn"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_bin2bn(a.dptr,a.dsize,NULL); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - -void -p5_BN_bn2bin(a) - BIGNUM *a; - PREINIT: - int i; - PPCODE: - pr_name("p5_BN_bn2bin"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - i=BN_num_bytes(a)+2; - sv_setpvn(ST(0),"",1); - SvGROW(ST(0),i+1); - SvCUR_set(ST(0),BN_bn2bin(a,SvPV(ST(0),na))); - -void -p5_BN_mpi2bn(a) - datum a; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_mpi2bn"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_mpi2bn(a.dptr,a.dsize,NULL); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - -void -p5_BN_bn2mpi(a) - BIGNUM *a; - PREINIT: - int i; - PPCODE: - pr_name("p5_BN_bn2mpi"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - i=BN_bn2mpi(a,NULL); - sv_setpvn(ST(0),"",1); - SvGROW(ST(0),i+1); - SvCUR_set(ST(0),BN_bn2mpi(a,SvPV(ST(0),na))); - -void -p5_BN_hex2bn(a) - datum a; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_hex2bn"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_hex2bn(&ret,a.dptr); - -void -p5_BN_dec2bn(a) - datum a; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_dec2bn"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_dec2bn(&ret,a.dptr); - -SV * -p5_BN_bn2hex(a) - BIGNUM *a; - PREINIT: - char *ptr; - int i; - CODE: - pr_name("p5_BN_bn2hex"); - ptr=BN_bn2hex(a); - RETVAL=newSVpv("",0); - i=strlen(ptr); - SvGROW(RETVAL,i+1); - memcpy(SvPV(RETVAL,na),ptr,i+1); - SvCUR_set(RETVAL,i); - Free(ptr); - OUTPUT: - RETVAL - -SV * -p5_BN_bn2dec(a) - BIGNUM *a; - PREINIT: - char *ptr; - int i; - CODE: - pr_name("p5_BN_bn2dec"); - ptr=BN_bn2dec(a); - RETVAL=newSVpv("",0); - i=strlen(ptr); - SvGROW(RETVAL,i+1); - memcpy(SvPV(RETVAL,na),ptr,i+1); - SvCUR_set(RETVAL,i); - Free(ptr); - OUTPUT: - RETVAL - -void -p5_BN_add(a,b) - BIGNUM *a; - BIGNUM *b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_add"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_add(ret,a,b); - -void -p5_BN_sub(a,b) - BIGNUM *a; - BIGNUM *b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_sub"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_sub(ret,a,b); - -void -p5_BN_mul(a,b) - BIGNUM *a; - BIGNUM *b; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_mul"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_mul(ret,a,b,ctx); - -void -p5_BN_div(a,b) - BIGNUM *a; - BIGNUM *b; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *div,*mod; - PPCODE: - pr_name("p5_BN_div"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,2); - PUSHs(sv_newmortal()); - PUSHs(sv_newmortal()); - div=BN_new(); - mod=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)div); - sv_setref_pv(ST(1), "OpenSSL::BN", (void*)mod); - BN_div(div,mod,a,b,ctx); - -void -p5_BN_mod(a,b) - BIGNUM *a; - BIGNUM *b; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *rem; - PPCODE: - pr_name("p5_BN_mod"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - rem=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)rem); - BN_mod(rem,a,b,ctx); - -void -p5_BN_exp(a,p) - BIGNUM *a; - BIGNUM *p; - PREINIT: - BIGNUM *ret; - static BN_CTX *ctx=NULL; - PPCODE: - pr_name("p5_BN_exp"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_exp(ret,a,p,ctx); - -void -p5_BN_mod_mul(a,b,c) - BIGNUM *a; - BIGNUM *b; - BIGNUM *c; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_mod_mul"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_mod_mul(ret,a,b,c,ctx); - -void -p5_BN_mod_exp(a,b,c) - BIGNUM *a; - BIGNUM *b; - BIGNUM *c; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_mod_exp"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_mod_exp(ret,a,b,c,ctx); - -void -p5_BN_generate_prime(...) - PREINIT: - int bits=512; - int strong=0; - BIGNUM *ret=NULL; - SV *callback=NULL; - SV *cb_arg=NULL; - GPC_ARGS arg; - dSP; - - PPCODE: - pr_name("p5_BN_generate_prime"); - if ((items < 0) || (items > 4)) - croak("Usage: OpenSSL::BN::generate_prime(a[,strong][,callback][,cb_arg]"); - if (items >= 1) bits=(int)SvIV(ST(0)); - if (items >= 2) strong=(int)SvIV(ST(1)); - if (items >= 3) callback=ST(2); - if (items == 4) cb_arg=ST(3); - - if (callback == NULL) - ret=BN_generate_prime(ret,bits,strong,NULL,NULL,NULL,NULL); - else - { - arg.cb=callback; - arg.arg=cb_arg; - - ret=BN_generate_prime(ret,bits,strong,NULL,NULL, - generate_prime_callback,(char *)&arg); - } - - SPAGAIN; - sp-=items; /* a bit evil that I do this */ - - EXTEND(sp,1); - PUSHs(sv_newmortal()); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - -void -p5_BN_is_prime(p,...) - BIGNUM *p; - PREINIT: - int nchecks=5,ret; - SV *callback=NULL; - SV *cb_arg=NULL; - GPC_ARGS arg; - dSP; - static BN_CTX *ctx=NULL; - PPCODE: - pr_name("p5_BN_is_prime"); - if ((items < 1) || (items > 4)) - croak("Usage: OpenSSL::BN::is_prime(a[,ncheck][,callback][,callback_arg]"); - if (ctx == NULL) ctx=BN_CTX_new(); - if (items >= 2) nchecks=(int)SvIV(ST(1)); - if (items >= 3) callback=ST(2); - if (items >= 4) cb_arg=ST(3); - arg.arg=cb_arg; - if (callback == NULL) - ret=BN_is_prime(p,nchecks,NULL,ctx,NULL); - else - { - arg.cb=callback; - arg.arg=cb_arg; - ret=BN_is_prime(p,nchecks,generate_prime_callback, - ctx,(char *)&arg); - } - SPAGAIN; - sp-=items; /* a bit evil */ - PUSHs(sv_2mortal(newSViv(ret))); - -int -p5_BN_num_bits(a) - BIGNUM *a; - CODE: - pr_name("p5_BN_num_bits"); - RETVAL=BN_num_bits(a); - OUTPUT: - RETVAL - -int -p5_BN_cmp(a,b) - BIGNUM *a; - BIGNUM *b; - CODE: - pr_name("p5_BN_cmp"); - RETVAL=BN_cmp(a,b); - OUTPUT: - RETVAL - -int -p5_BN_ucmp(a,b) - BIGNUM *a; - BIGNUM *b; - CODE: - pr_name("p5_BN_ucmp"); - RETVAL=BN_ucmp(a,b); - OUTPUT: - RETVAL - -int -p5_BN_is_bit_set(a,b) - BIGNUM *a; - int b; - CODE: - pr_name("p5_BN_is_bit_set"); - RETVAL=BN_is_bit_set(a,b); - OUTPUT: - RETVAL - -void -p5_BN_set_bit(a,b) - BIGNUM *a; - int b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_set_bit"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_dup(a); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_set_bit(ret,b); - -void -p5_BN_clear_bit(a,b) - BIGNUM *a; - int b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_clear_bit"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_dup(a); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_clear_bit(ret,b); - -void -p5_BN_lshift(a,b) - BIGNUM *a; - int b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_lshift"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - if (b == 1) - BN_lshift1(ret,a); - else - BN_lshift(ret,a,b); - -void -p5_BN_rshift(a,b) - BIGNUM *a; - int b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_rshift"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - if (b == 1) - BN_rshift1(ret,a); - else - BN_rshift(ret,a,b); - -void -p5_BN_mask_bits(a,b) - BIGNUM *a; - int b; - PREINIT: - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_mask_bits"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_dup(a); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_mask_bits(ret,b); - -void -p5_BN_clear(a) - BIGNUM *a; - PPCODE: - pr_name("p5_BN_clear"); - BN_clear(a); - -void -p5_BN_gcd(a,b) - BIGNUM *a; - BIGNUM *b; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_gcd"); - if (ctx == NULL) ctx=BN_CTX_new(); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ret=BN_new(); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - BN_gcd(ret,a,b,ctx); - -void -p5_BN_mod_inverse(a,mod) - BIGNUM *a; - BIGNUM *mod; - PREINIT: - static BN_CTX *ctx=NULL; - BIGNUM *ret; - PPCODE: - pr_name("p5_BN_mod_inverse"); - if (ctx == NULL) ctx=BN_CTX_new(); - ret=BN_mod_inverse(ret,a,mod,ctx); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret); - -void -p5_BN_DESTROY(bn) - BIGNUM *bn - CODE: - pr_name("p5_BN_DESTROY"); - BN_free(bn); - diff --git a/crypto/openssl/perl/openssl_cipher.xs b/crypto/openssl/perl/openssl_cipher.xs deleted file mode 100644 index e9ff2a8..0000000 --- a/crypto/openssl/perl/openssl_cipher.xs +++ /dev/null @@ -1,154 +0,0 @@ - -#include "openssl.h" - -int boot_cipher() - { - SSLeay_add_all_ciphers(); - return(1); - } - -MODULE = OpenSSL::Cipher PACKAGE = OpenSSL::Cipher PREFIX = p5_EVP_C_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -void -p5_EVP_C_new(...) - PREINIT: - EVP_CIPHER_CTX *ctx; - const EVP_CIPHER *c; - char *name; - PPCODE: - if ((items == 1) && SvPOK(ST(0))) - name=SvPV(ST(0),na); - else if ((items == 2) && SvPOK(ST(1))) - name=SvPV(ST(1),na); - else - croak("Usage: OpenSSL::Cipher::new(type)"); - PUSHs(sv_newmortal()); - c=EVP_get_cipherbyname(name); - if (c != NULL) - { - ctx=malloc(sizeof(EVP_CIPHER_CTX)); - EVP_EncryptInit(ctx,c,NULL,NULL); - sv_setref_pv(ST(0), "OpenSSL::Cipher", (void*)ctx); - } - -datum -p5_EVP_C_name(ctx) - EVP_CIPHER_CTX *ctx - CODE: - RETVAL.dptr=OBJ_nid2ln(EVP_CIPHER_CTX_nid(ctx)); - RETVAL.dsize=strlen(RETVAL.dptr); - OUTPUT: - RETVAL - -int -p5_EVP_C_key_length(ctx) - EVP_CIPHER_CTX *ctx - CODE: - RETVAL=EVP_CIPHER_CTX_key_length(ctx); - OUTPUT: - RETVAL - -int -p5_EVP_C_iv_length(ctx) - EVP_CIPHER_CTX *ctx - CODE: - RETVAL=EVP_CIPHER_CTX_iv_length(ctx); - OUTPUT: - RETVAL - -int -p5_EVP_C_block_size(ctx) - EVP_CIPHER_CTX *ctx - CODE: - RETVAL=EVP_CIPHER_CTX_block_size(ctx); - OUTPUT: - RETVAL - -void -p5_EVP_C_init(ctx,key,iv,enc) - EVP_CIPHER_CTX *ctx - datum key - datum iv - int enc - PREINIT: - char loc_iv[EVP_MAX_IV_LENGTH]; - char loc_key[EVP_MAX_KEY_LENGTH]; - char *ip=loc_iv,*kp=loc_key; - int i; - memset(loc_iv,0,EVP_MAX_IV_LENGTH); - memset(loc_key,0,EVP_MAX_KEY_LENGTH); - CODE: - i=key.dsize; - if (key.dsize > EVP_CIPHER_CTX_key_length(ctx)) - i=EVP_CIPHER_CTX_key_length(ctx); - if (i > 0) - { - memset(kp,0,EVP_MAX_KEY_LENGTH); - memcpy(kp,key.dptr,i); - } - else - kp=NULL; - i=iv.dsize; - if (iv.dsize > EVP_CIPHER_CTX_iv_length(ctx)) - i=EVP_CIPHER_CTX_iv_length(ctx); - if (i > 0) - { - memcpy(ip,iv.dptr,i); - memset(ip,0,EVP_MAX_IV_LENGTH); - } - else - ip=NULL; - EVP_CipherInit(ctx,EVP_CIPHER_CTX_cipher(ctx),kp,ip,enc); - memset(loc_key,0,sizeof(loc_key)); - memset(loc_iv,0,sizeof(loc_iv)); - -SV * -p5_EVP_C_cipher(ctx,in) - EVP_CIPHER_CTX *ctx; - datum in; - CODE: - RETVAL=newSVpv("",0); - SvGROW(RETVAL,in.dsize+EVP_CIPHER_CTX_block_size(ctx)+1); - EVP_Cipher(ctx,SvPV(RETVAL,na),in.dptr,in.dsize); - SvCUR_set(RETVAL,in.dsize); - OUTPUT: - RETVAL - -SV * -p5_EVP_C_update(ctx, in) - EVP_CIPHER_CTX *ctx - datum in - PREINIT: - int i; - CODE: - RETVAL=newSVpv("",0); - SvGROW(RETVAL,in.dsize+EVP_CIPHER_CTX_block_size(ctx)+1); - EVP_CipherUpdate(ctx,SvPV(RETVAL,na),&i,in.dptr,in.dsize); - SvCUR_set(RETVAL,i); - OUTPUT: - RETVAL - -SV * -p5_EVP_C_final(ctx) - EVP_CIPHER_CTX *ctx - PREINIT: - int i; - CODE: - RETVAL=newSVpv("",0); - SvGROW(RETVAL,EVP_CIPHER_CTX_block_size(ctx)+1); - if (!EVP_CipherFinal(ctx,SvPV(RETVAL,na),&i)) - sv_setpv(RETVAL,"BAD DECODE"); - else - SvCUR_set(RETVAL,i); - OUTPUT: - RETVAL - -void -p5_EVP_C_DESTROY(ctx) - EVP_CIPHER_CTX *ctx - CODE: - free((char *)ctx); - diff --git a/crypto/openssl/perl/openssl_digest.xs b/crypto/openssl/perl/openssl_digest.xs deleted file mode 100644 index 6cd3018..0000000 --- a/crypto/openssl/perl/openssl_digest.xs +++ /dev/null @@ -1,84 +0,0 @@ - -#include "openssl.h" - -int boot_digest() - { - SSLeay_add_all_digests(); - return(1); - } - -MODULE = OpenSSL::MD PACKAGE = OpenSSL::MD PREFIX = p5_EVP_MD_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -# OpenSSL::MD::new(name) name= md2, md5, sha, sha1, or mdc2 -# md->name() - returns the name -# md->init() - reinitalises the digest -# md->update(data) - adds more data to digest -# digest=md->final() - returns digest -# - -void -p5_EVP_MD_new(...) - PREINIT: - EVP_MD_CTX *ctx; - const EVP_MD *md; - char *name; - PPCODE: - if ((items == 1) && SvPOK(ST(0))) - name=SvPV(ST(0),na); - else if ((items == 2) && SvPOK(ST(1))) - name=SvPV(ST(1),na); - else - croak("Usage: OpenSSL::MD::new(type)"); - PUSHs(sv_newmortal()); - md=EVP_get_digestbyname(name); - if (md != NULL) - { - ctx=malloc(sizeof(EVP_MD_CTX)); - EVP_DigestInit(ctx,md); - sv_setref_pv(ST(0), "OpenSSL::MD", (void*)ctx); - } - -datum -p5_EVP_MD_name(ctx) - EVP_MD_CTX *ctx - CODE: - RETVAL.dptr=OBJ_nid2ln(EVP_MD_type(EVP_MD_CTX_type(ctx))); - RETVAL.dsize=strlen(RETVAL.dptr); - OUTPUT: - RETVAL - -void -p5_EVP_MD_init(ctx) - EVP_MD_CTX *ctx - CODE: - EVP_DigestInit(ctx,EVP_MD_CTX_type(ctx)); - -void -p5_EVP_MD_update(ctx, in) - EVP_MD_CTX *ctx - datum in - CODE: - EVP_DigestUpdate(ctx,in.dptr,in.dsize); - -datum -p5_EVP_MD_final(ctx) - EVP_MD_CTX *ctx - PREINIT: - char md[EVP_MAX_MD_SIZE]; - int len; - CODE: - EVP_DigestFinal(ctx,md,&len); - RETVAL.dptr=md; - RETVAL.dsize=len; - OUTPUT: - RETVAL - -void -p5_EVP_MD_DESTROY(ctx) - EVP_MD_CTX *ctx - CODE: - free((char *)ctx); - diff --git a/crypto/openssl/perl/openssl_err.xs b/crypto/openssl/perl/openssl_err.xs deleted file mode 100644 index 3a6f698..0000000 --- a/crypto/openssl/perl/openssl_err.xs +++ /dev/null @@ -1,47 +0,0 @@ - -#include "openssl.h" - -int boot_err() - { - SSL_load_error_strings(); - return(1); - } - -MODULE = OpenSSL::ERR PACKAGE = OpenSSL::ERR PREFIX = p5_ERR_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -# md->error() - returns the last error in text or numeric context - -void -p5_ERR_get_error(...) - PPCODE: - char buf[512]; - unsigned long l; - - pr_name("p5_ERR_get_code"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - l=ERR_get_error(); - ERR_error_string(l,buf); - sv_setiv(ST(0),l); - sv_setpv(ST(0),buf); - SvIOK_on(ST(0)); - -void -p5_ERR_peek_error(...) - PPCODE: - char buf[512]; - unsigned long l; - - pr_name("p5_ERR_get_code"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - l=ERR_peek_error(); - ERR_error_string(l,buf); - sv_setiv(ST(0),l); - sv_setpv(ST(0),buf); - SvIOK_on(ST(0)); - - diff --git a/crypto/openssl/perl/openssl_ssl.xs b/crypto/openssl/perl/openssl_ssl.xs deleted file mode 100644 index c7d1b17..0000000 --- a/crypto/openssl/perl/openssl_ssl.xs +++ /dev/null @@ -1,483 +0,0 @@ - -#include "openssl.h" - -static int p5_ssl_ex_ssl_ptr=0; -static int p5_ssl_ex_ssl_info_callback=0; -static int p5_ssl_ex_ssl_ctx_ptr=0; -static int p5_ssl_ctx_ex_ssl_info_callback=0; - -typedef struct ssl_ic_args_st { - SV *cb; - SV *arg; - } SSL_IC_ARGS; - -static void p5_ssl_info_callback(ssl,mode,ret) -SSL *ssl; -int mode; -int ret; - { - int i; - SV *me,*cb; - - me=(SV *)SSL_get_ex_data(ssl,p5_ssl_ex_ssl_ptr); - cb=(SV *)SSL_get_ex_data(ssl,p5_ssl_ex_ssl_info_callback); - if (cb == NULL) - cb=(SV *)SSL_CTX_get_ex_data( - SSL_get_SSL_CTX(ssl),p5_ssl_ctx_ex_ssl_info_callback); - if (cb != NULL) - { - dSP; - - PUSHMARK(sp); - XPUSHs(me); - XPUSHs(sv_2mortal(newSViv(mode))); - XPUSHs(sv_2mortal(newSViv(ret))); - PUTBACK; - - i=perl_call_sv(cb,G_DISCARD); - } - else - { - croak("Internal error in SSL p5_ssl_info_callback"); - } - } - -int boot_ssl() - { - p5_ssl_ex_ssl_ptr= - SSL_get_ex_new_index(0,"OpenSSL::SSL",ex_new,NULL,ex_cleanup); - p5_ssl_ex_ssl_info_callback= - SSL_get_ex_new_index(0,"ssl_info_callback",NULL,NULL, - ex_cleanup); - p5_ssl_ex_ssl_ctx_ptr= - SSL_get_ex_new_index(0,"ssl_ctx_ptr",NULL,NULL, - ex_cleanup); - p5_ssl_ctx_ex_ssl_info_callback= - SSL_CTX_get_ex_new_index(0,"ssl_ctx_info_callback",NULL,NULL, - ex_cleanup); - return(1); - } - -MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL::CTX PREFIX = p5_SSL_CTX_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -void -p5_SSL_CTX_new(...) - PREINIT: - SSL_METHOD *meth; - SSL_CTX *ctx; - char *method; - PPCODE: - pr_name("p5_SSL_CTX_new"); - if ((items == 1) && SvPOK(ST(0))) - method=SvPV(ST(0),na); - else if ((items == 2) && SvPOK(ST(1))) - method=SvPV(ST(1),na); - else - croak("Usage: OpenSSL::SSL::CTX::new(type)"); - - if (strcmp(method,"SSLv3") == 0) - meth=SSLv3_method(); - else if (strcmp(method,"SSLv3_client") == 0) - meth=SSLv3_client_method(); - else if (strcmp(method,"SSLv3_server") == 0) - meth=SSLv3_server_method(); - else if (strcmp(method,"SSLv23") == 0) - meth=SSLv23_method(); - else if (strcmp(method,"SSLv23_client") == 0) - meth=SSLv23_client_method(); - else if (strcmp(method,"SSLv23_server") == 0) - meth=SSLv23_server_method(); - else if (strcmp(method,"SSLv2") == 0) - meth=SSLv2_method(); - else if (strcmp(method,"SSLv2_client") == 0) - meth=SSLv2_client_method(); - else if (strcmp(method,"SSLv2_server") == 0) - meth=SSLv2_server_method(); - else if (strcmp(method,"TLSv1") == 0) - meth=TLSv1_method(); - else if (strcmp(method,"TLSv1_client") == 0) - meth=TLSv1_client_method(); - else if (strcmp(method,"TLSv1_server") == 0) - meth=TLSv1_server_method(); - else - { - croak("Not a valid SSL method name, should be 'SSLv[23] [client|server]'"); - } - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ctx=SSL_CTX_new(meth); - sv_setref_pv(ST(0), "OpenSSL::SSL::CTX", (void*)ctx); - -int -p5_SSL_CTX_use_PrivateKey_file(ctx,file,...) - SSL_CTX *ctx; - char *file; - PREINIT: - int i=SSL_FILETYPE_PEM; - char *ptr; - CODE: - pr_name("p5_SSL_CTX_use_PrivateKey_file"); - if (items > 3) - croak("OpenSSL::SSL::CTX::use_PrivateKey_file(ssl_ctx,file[,type])"); - if (items == 3) - { - ptr=SvPV(ST(2),na); - if (strcmp(ptr,"der") == 0) - i=SSL_FILETYPE_ASN1; - else - i=SSL_FILETYPE_PEM; - } - RETVAL=SSL_CTX_use_RSAPrivateKey_file(ctx,file,i); - OUTPUT: - RETVAL - -int -p5_SSL_CTX_set_options(ctx,...) - SSL_CTX *ctx; - PREINIT: - int i; - char *ptr; - SV *sv; - CODE: - pr_name("p5_SSL_CTX_set_options"); - - for (i=1; ireferences); - SSL_CTX_free(ctx); - -MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL PREFIX = p5_SSL_ - -void -p5_SSL_new(...) - PREINIT: - SV *sv_ctx; - SSL_CTX *ctx; - SSL *ssl; - SV *arg; - PPCODE: - pr_name("p5_SSL_new"); - if ((items != 1) && (items != 2)) - croak("Usage: OpenSSL::SSL::new(ssl_ctx)"); - if (sv_derived_from(ST(items-1),"OpenSSL::SSL::CTX")) - { - IV tmp = SvIV((SV*)SvRV(ST(items-1))); - ctx=(SSL_CTX *)tmp; - sv_ctx=ST(items-1); - } - else - croak("ssl_ctx is not of type OpenSSL::SSL::CTX"); - - EXTEND(sp,1); - PUSHs(sv_newmortal()); - ssl=SSL_new(ctx); - sv_setref_pv(ST(0), "OpenSSL::SSL", (void*)ssl); - - /* Now this is being a little hairy, we keep a pointer to - * our perl reference. We need to do a different one - * to the one we return because it will have its reference - * count dropped to 0 upon return and if we up its reference - * count, it will never be DESTROYED */ - arg=newSVsv(ST(0)); - SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ptr,(char *)arg); - SvREFCNT_inc(sv_ctx); - SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ctx_ptr,(char *)sv_ctx); - -int -p5_SSL_connect(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_connect(ssl); - OUTPUT: - RETVAL - -int -p5_SSL_accept(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_connect(ssl); - OUTPUT: - RETVAL - -int -p5_SSL_sysread(ssl,in,num, ...) - SSL *ssl; - SV *in; - int num; - PREINIT: - int i,n,olen; - int offset; - char *p; - CODE: - offset=0; - if (!SvPOK(in)) - sv_setpvn(in,"",0); - SvPV(in,olen); - if (items > 3) - { - offset=SvIV(ST(3)); - if (offset < 0) - { - if (-offset > olen) - croak("Offset outside string"); - offset+=olen; - } - } - if ((num+offset) > olen) - { - SvGROW(in,num+offset+1); - p=SvPV(in,i); - memset(&(p[olen]),0,(num+offset)-olen+1); - } - p=SvPV(in,n); - - i=SSL_read(ssl,p+offset,num); - RETVAL=i; - if (i <= 0) i=0; - SvCUR_set(in,offset+i); - OUTPUT: - RETVAL - -int -p5_SSL_syswrite(ssl,in, ...) - SSL *ssl; - SV *in; - PREINIT: - char *ptr; - int len,in_len; - int offset=0; - int n; - CODE: - ptr=SvPV(in,in_len); - if (items > 2) - { - len=SvOK(ST(2))?SvIV(ST(2)):in_len; - if (items > 3) - { - offset=SvIV(ST(3)); - if (offset < 0) - { - if (-offset > in_len) - croak("Offset outside string"); - offset+=in_len; - } - else if ((offset >= in_len) && (in_len > 0)) - croak("Offset outside string"); - } - if (len >= (in_len-offset)) - len=in_len-offset; - } - else - len=in_len; - - RETVAL=SSL_write(ssl,ptr+offset,len); - OUTPUT: - RETVAL - -void -p5_SSL_set_bio(ssl,bio) - SSL *ssl; - BIO *bio; - CODE: - bio->references++; - SSL_set_bio(ssl,bio,bio); - -int -p5_SSL_set_options(ssl,...) - SSL *ssl; - PREINIT: - int i; - char *ptr; - SV *sv; - CODE: - pr_name("p5_SSL_set_options"); - - for (i=1; ireferences,ssl->ctx->references); -#ifdef DEBUG - fprintf(stderr,"SSL_DESTROY %d\n",ssl->references); -#endif - SSL_free(ssl); - -int -p5_SSL_references(ssl) - SSL *ssl; - CODE: - RETVAL=ssl->references; - OUTPUT: - RETVAL - -int -p5_SSL_do_handshake(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_do_handshake(ssl); - OUTPUT: - RETVAL - -int -p5_SSL_renegotiate(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_renegotiate(ssl); - OUTPUT: - RETVAL - -int -p5_SSL_shutdown(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_shutdown(ssl); - OUTPUT: - RETVAL - -char * -p5_SSL_get_version(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_get_version(ssl); - OUTPUT: - RETVAL - -SSL_CIPHER * -p5_SSL_get_current_cipher(ssl) - SSL *ssl; - CODE: - RETVAL=SSL_get_current_cipher(ssl); - OUTPUT: - RETVAL - -X509 * -p5_SSL_get_peer_certificate(ssl) - SSL *ssl - CODE: - RETVAL=SSL_get_peer_certificate(ssl); - OUTPUT: - RETVAL - -MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL::CIPHER PREFIX = p5_SSL_CIPHER_ - -int -p5_SSL_CIPHER_get_bits(sc) - SSL_CIPHER *sc - PREINIT: - int i,ret; - PPCODE: - EXTEND(sp,2); - PUSHs(sv_newmortal()); - PUSHs(sv_newmortal()); - ret=SSL_CIPHER_get_bits(sc,&i); - sv_setiv(ST(0),(IV)ret); - sv_setiv(ST(1),(IV)i); - -char * -p5_SSL_CIPHER_get_version(sc) - SSL_CIPHER *sc - CODE: - RETVAL=SSL_CIPHER_get_version(sc); - OUTPUT: - RETVAL - -char * -p5_SSL_CIPHER_get_name(sc) - SSL_CIPHER *sc - CODE: - RETVAL=SSL_CIPHER_get_name(sc); - OUTPUT: - RETVAL - -MODULE = OpenSSL::SSL PACKAGE = OpenSSL::BIO PREFIX = p5_BIO_ - -void -p5_BIO_get_ssl(bio) - BIO *bio; - PREINIT: - SSL *ssl; - SV *ret; - int i; - PPCODE: - if ((i=BIO_get_ssl(bio,&ssl)) > 0) - { - ret=(SV *)SSL_get_ex_data(ssl,p5_ssl_ex_ssl_ptr); - ret=sv_mortalcopy(ret); - } - else - ret= &sv_undef; - EXTEND(sp,1); - PUSHs(ret); - diff --git a/crypto/openssl/perl/openssl_x509.xs b/crypto/openssl/perl/openssl_x509.xs deleted file mode 100644 index 008d959..0000000 --- a/crypto/openssl/perl/openssl_x509.xs +++ /dev/null @@ -1,75 +0,0 @@ - -#include "openssl.h" - -MODULE = OpenSSL::X509 PACKAGE = OpenSSL::X509 PREFIX = p5_X509_ - -PROTOTYPES: ENABLE -VERSIONCHECK: DISABLE - -void -p5_X509_new(void ) - PREINIT: - X509 *x509; - SV *arg; - PPCODE: - pr_name("p5_X509_new"); - EXTEND(sp,1); - PUSHs(sv_newmortal()); - x509=X509_new(); - sv_setref_pv(ST(0),"OpenSSL::X509",(void *)x509); - -char * -p5_X509_get_subject_name(x509) - X509 *x509; - PREINIT: - char *p; - X509_NAME *name; - char buf[1024]; - int i; - CODE: - name=X509_get_subject_name(x509); - X509_NAME_oneline(name,buf,sizeof(buf)); - p= &(buf[0]); - RETVAL=p; - OUTPUT: - RETVAL - -char * -p5_X509_get_issuer_name(x509) - X509 *x509; - PREINIT: - char *p; - X509_NAME *name; - char buf[1024]; - int i; - CODE: - name=X509_get_issuer_name(x509); - X509_NAME_oneline(name,buf,sizeof(buf)); - p= &(buf[0]); - RETVAL=p; - OUTPUT: - RETVAL - -int -p5_X509_get_version(x509) - X509 *x509; - CODE: - RETVAL=X509_get_version(x509); - OUTPUT: - RETVAL - -BIGNUM * -p5_X509_get_serialNumber(x509) - X509 *x509; - CODE: - RETVAL=ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL); - OUTPUT: - RETVAL - -void -p5_X509_DESTROY(x509) - X509 *x509; - CODE: - pr_name("p5_X509_DESTROY"); - X509_free(x509); - diff --git a/crypto/openssl/perl/t/01-use.t b/crypto/openssl/perl/t/01-use.t deleted file mode 100644 index e24fd1f..0000000 --- a/crypto/openssl/perl/t/01-use.t +++ /dev/null @@ -1,13 +0,0 @@ - -BEGIN { - $| = 1; - print "1..1\n"; -} -END { - print "not ok 1\n" unless $loaded; -} -use OpenSSL; -$loaded = 1; -print "ok 1\n"; - - diff --git a/crypto/openssl/perl/t/02-version.t b/crypto/openssl/perl/t/02-version.t deleted file mode 100644 index 8b5f6a0..0000000 --- a/crypto/openssl/perl/t/02-version.t +++ /dev/null @@ -1,10 +0,0 @@ - -print "1..1\n"; -use OpenSSL; -if ($OpenSSL::VERSION ne '') { - print "ok 1\n"; -} -else { - print "not ok 1\n"; -} - diff --git a/crypto/openssl/perl/t/03-bio.t b/crypto/openssl/perl/t/03-bio.t deleted file mode 100644 index e3ed7ed..0000000 --- a/crypto/openssl/perl/t/03-bio.t +++ /dev/null @@ -1,16 +0,0 @@ - -BEGIN { - $| = 1; - print "1..1\n"; -} -END { - print "not ok 1\n" unless $ok; -} - -use OpenSSL; -my $bio = OpenSSL::BIO::new("mem") || die; -undef $bio; - -$ok = 1; -print "ok 1\n"; - diff --git a/crypto/openssl/perl/typemap b/crypto/openssl/perl/typemap deleted file mode 100644 index f67b598..0000000 --- a/crypto/openssl/perl/typemap +++ /dev/null @@ -1,96 +0,0 @@ - -datum T_DATUM -EVP_MD_CTX * T_MD_CTX -EVP_CIPHER_CTX * T_CIPHER_CTX -BIGNUM * T_BIGNUM -SSL_METHOD * T_SSL_METHOD -SSL_CTX * T_SSL_CTX -SSL_CIPHER * T_SSL_CIPHER -SSL * T_SSL -BIO * T_BIO -X509 * T_X509 - -INPUT -T_DATUM - $var.dptr=SvPV($arg,$var.dsize); -T_MD_CTX - if (sv_derived_from($arg, \"OpenSSL::MD\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (EVP_MD_CTX *) tmp; - } - else - croak(\"$var is not of type OpenSSL::MD\") -T_CIPHER_CTX - if (sv_derived_from($arg, \"OpenSSL::Cipher\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (EVP_CIPHER_CTX *) tmp; - } - else - croak(\"$var is not of type OpenSSL::Cipher\") -T_BIGNUM - sv_to_BIGNUM(&($var),$arg,\"$var is not of type OpenSSL::MD, int or string\") -T_SSL_METHOD - if (sv_derived_from($arg, \"OpenSSL::SSL::METHOD\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (SSL_METHOD *) tmp; - } - else - croak(\"$var is not of type OpenSSL::SSL::METHOD\") -T_SSL_CTX - if (sv_derived_from($arg, \"OpenSSL::SSL::CTX\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (SSL_CTX *) tmp; - } - else - croak(\"$var is not of type OpenSSL::SSL::CTX\") -T_SSL_CIPHER - if (sv_derived_from($arg, \"OpenSSL::SSL::CIPHER\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (SSL_CIPHER *) tmp; - } - else - croak(\"$var is not of type OpenSSL::SSL::CIPHER\") -T_SSL - if (sv_derived_from($arg, \"OpenSSL::SSL\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (SSL *) tmp; - } - else - croak(\"$var is not of type OpenSSL::SSL\") -T_BIO - if (sv_derived_from($arg, \"OpenSSL::BIO\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (BIO *) tmp; - } - else - croak(\"$var is not of type OpenSSL::BIO\") -T_X509 - if (sv_derived_from($arg, \"OpenSSL::X509\")) { - IV tmp = SvIV((SV*)SvRV($arg)); - $var = (X509 *) tmp; - } - else - croak(\"$var is not of type OpenSSL::X509\") -OUTPUT -T_DATUM - sv_setpvn($arg,$var.dptr,$var.dsize); -T_MD_CTX - sv_setref_pv($arg, \"OpenSSL::MD\", (void*)$var); -T_CIPHER_CTX - sv_setref_pv($arg, \"OpenSSL::Cipher\", (void*)$var); -T_BIGNUM - sv_setref_pv($arg, \"OpenSSL::BN\", (void*)$var); -T_SSL_METHOD - sv_setref_pv($arg, \"OpenSSL::SSL::METHOD\", (void*)$var); -T_SSL_CTX - sv_setref_pv($arg, \"OpenSSL::SSL::CTX\", (void*)$var); -T_SSL_CIPHER - sv_setref_pv($arg, \"OpenSSL::SSL::CIPHER\", (void*)$var); -T_SSL - sv_setref_pv($arg, \"OpenSSL::SSL\", (void*)$var); -T_BIO - sv_setref_pv($arg, \"OpenSSL::BIO\", (void*)$var); -T_X509 - sv_setref_pv($arg, \"OpenSSL::X509\", (void*)$var); - - -- cgit v1.1