diff options
Diffstat (limited to 'crypto/openssl/crypto')
31 files changed, 0 insertions, 4219 deletions
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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1.h> - -/* 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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/dh.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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; i<bs->length; 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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -#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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/rsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/rsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -#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 <schoch@sheba.arc.nasa.gov> */ - -#ifndef NO_DSA -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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 <schoch@sheba.arc.nasa.gov> */ - -#ifndef NO_DSA -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -#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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/asn1_mac.h> -#include <openssl/dh.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/asn1_mac.h> -#include <openssl/dsa.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/rsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/rsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/objects.h> -#include <openssl/asn1_mac.h> - -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<n; 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; - } - - 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<n; i++) - { - bs.length=BN_bn2bin(num[i],bs.data); - i2d_ASN1_INTEGER(&bs,&p); - } - OPENSSL_free(bs.data); - *pp=p; - if(all) return(t); - else return(tot); - } -#endif diff --git a/crypto/openssl/crypto/asn1/p7_dgst.c b/crypto/openssl/crypto/asn1/p7_dgst.c deleted file mode 100644 index c170244..0000000 --- a/crypto/openssl/crypto/asn1/p7_dgst.c +++ /dev/null @@ -1,121 +0,0 @@ -/* crypto/asn1/p7_dgst.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/pkcs7.h> -#include <openssl/objects.h> - -#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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/x509.h> - -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 <stdio.h> -#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)<<words+s0 */ - BN_lshift(&t1,&t1,words*32); - BN_add(&t1,&t1,&s0); - - /* We now have - * al*bl - t1 - * (al-ah)*(bh-bl)+ah*bh - m - * ah*bh - h - */ - BN_copy(r,&t1); - BN_mask_bits(r,words*32*2); - - /*BN_lshift(&m,&m,words*/ - - BN_free(&t1); BN_free(&t2); - BN_free(&m); BN_free(&h); - } - -int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_MONT_CTX *mont, - BN_CTX *ctx) - { - BIGNUM *tmp; - - tmp= &(ctx->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 <mark@grondar.za>. 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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/pkcs12.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/pkcs12.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/pkcs12.h> - -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 <stdio.h> -#include "cryptlib.h" -#include <openssl/asn1_mac.h> -#include <openssl/pkcs12.h> - -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) |