Skip to content

Commit

Permalink
Update from 0.9.8 stable. Eliminate duplicate error codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
snhenson committed Nov 21, 2006
1 parent d9907c9 commit 47a9d52
Show file tree
Hide file tree
Showing 34 changed files with 240 additions and 309 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Changes between 0.9.8e and 0.9.9 [xx XXX xxxx]

*) Load error codes if they are not already present instead of using a
static variable. This allows them to be cleanly unloaded and reloaded.
Improve header file function name parsing.
[Steve Henson]

*) Initial incomplete changes to avoid need for function casts in OpenSSL
when OPENSSL_NO_FCAST is set: some compilers (gcc 4.2 and later) reject
their use. Safestack is reimplemented using inline functions: tests show
Expand Down
18 changes: 8 additions & 10 deletions crypto/asn1/asn1_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/asn1/asn1_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -123,7 +123,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_EX_D2I), "ASN1_TEMPLATE_EX_D2I"},
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NEW), "ASN1_TEMPLATE_NEW"},
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I), "ASN1_TEMPLATE_NOEXP_D2I"},
{ERR_FUNC(ASN1_F_ASN1_TIME_SET), "ASN1_TIME_SET"},
{ERR_FUNC(ASN1_F_ASN1_TIME_SET), "ASN1_TIME_set"},
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING), "ASN1_TYPE_get_int_octetstring"},
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_OCTETSTRING), "ASN1_TYPE_get_octetstring"},
{ERR_FUNC(ASN1_F_ASN1_UNPACK_STRING), "ASN1_unpack_string"},
Expand Down Expand Up @@ -168,9 +168,10 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{ERR_FUNC(ASN1_F_OID_MODULE_INIT), "OID_MODULE_INIT"},
{ERR_FUNC(ASN1_F_PARSE_TAGGING), "PARSE_TAGGING"},
{ERR_FUNC(ASN1_F_PKCS5_PBE2_SET_IV), "PKCS5_pbe2_set_iv"},
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET), "PKCS5_pbe_set"},
{ERR_FUNC(ASN1_F_X509_CINF_NEW), "X509_CINF_NEW"},
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED), "X509_CRL_ADD0_REVOKED"},
{ERR_FUNC(ASN1_F_X509_INFO_NEW), "X509_INFO_NEW"},
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED), "X509_CRL_add0_revoked"},
{ERR_FUNC(ASN1_F_X509_INFO_NEW), "X509_INFO_new"},
{ERR_FUNC(ASN1_F_X509_NAME_ENCODE), "X509_NAME_ENCODE"},
{ERR_FUNC(ASN1_F_X509_NAME_EX_D2I), "X509_NAME_EX_D2I"},
{ERR_FUNC(ASN1_F_X509_NAME_EX_NEW), "X509_NAME_EX_NEW"},
Expand Down Expand Up @@ -290,15 +291,12 @@ static ERR_STRING_DATA ASN1_str_reasons[]=

void ERR_load_ASN1_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(ASN1_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,ASN1_str_functs);
ERR_load_strings(0,ASN1_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/bio/bio_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/bio/bio_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -143,15 +143,12 @@ static ERR_STRING_DATA BIO_str_reasons[]=

void ERR_load_BIO_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(BIO_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,BIO_str_functs);
ERR_load_strings(0,BIO_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/bn/bn_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/bn/bn_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -137,15 +137,12 @@ static ERR_STRING_DATA BN_str_reasons[]=

void ERR_load_BN_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(BN_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,BN_str_functs);
ERR_load_strings(0,BN_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/buffer/buf_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/buffer/buf_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -88,15 +88,12 @@ static ERR_STRING_DATA BUF_str_reasons[]=

void ERR_load_BUF_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(BUF_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,BUF_str_functs);
ERR_load_strings(0,BUF_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/comp/comp_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/comp/comp_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -82,15 +82,12 @@ static ERR_STRING_DATA COMP_str_reasons[]=

void ERR_load_COMP_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(COMP_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,COMP_str_functs);
ERR_load_strings(0,COMP_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/conf/conf_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/conf/conf_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -118,15 +118,12 @@ static ERR_STRING_DATA CONF_str_reasons[]=

void ERR_load_CONF_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(CONF_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,CONF_str_functs);
ERR_load_strings(0,CONF_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/cpt_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/cpt_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -92,15 +92,12 @@ static ERR_STRING_DATA CRYPTO_str_reasons[]=

void ERR_load_CRYPTO_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(CRYPTO_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,CRYPTO_str_functs);
ERR_load_strings(0,CRYPTO_str_reasons);
#endif

}
#endif
}
2 changes: 1 addition & 1 deletion crypto/dh/dh.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ void ERR_load_DH_strings(void);

/* Function codes. */
#define DH_F_COMPUTE_KEY 102
#define DH_F_DO_DH_PRINT 100
#define DH_F_DHPARAMS_PRINT_FP 101
#define DH_F_DH_BUILTIN_GENPARAMS 106
#define DH_F_DH_NEW_METHOD 105
Expand All @@ -236,6 +235,7 @@ void ERR_load_DH_strings(void);
#define DH_F_DH_PRIV_ENCODE 111
#define DH_F_DH_PUB_DECODE 108
#define DH_F_DH_PUB_ENCODE 109
#define DH_F_DO_DH_PRINT 100
#define DH_F_GENERATE_KEY 103
#define DH_F_GENERATE_PARAMETERS 104
#define DH_F_PKEY_DH_DERIVE 112
Expand Down
11 changes: 4 additions & 7 deletions crypto/dh/dh_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/dh/dh_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -106,15 +106,12 @@ static ERR_STRING_DATA DH_str_reasons[]=

void ERR_load_DH_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(DH_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,DH_str_functs);
ERR_load_strings(0,DH_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/dsa/dsa_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/dsa/dsa_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -114,15 +114,12 @@ static ERR_STRING_DATA DSA_str_reasons[]=

void ERR_load_DSA_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(DSA_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,DSA_str_functs);
ERR_load_strings(0,DSA_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/dso/dso_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/dso/dso_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -148,15 +148,12 @@ static ERR_STRING_DATA DSO_str_reasons[]=

void ERR_load_DSO_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(DSO_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,DSO_str_functs);
ERR_load_strings(0,DSO_str_reasons);
#endif

}
#endif
}
1 change: 0 additions & 1 deletion crypto/ec/ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,6 @@ void ERR_load_EC_strings(void);
#define EC_F_EC_KEY_PRINT 180
#define EC_F_EC_KEY_PRINT_FP 181
#define EC_F_EC_POINTS_MAKE_AFFINE 136
#define EC_F_EC_POINTS_MUL 138
#define EC_F_EC_POINT_ADD 112
#define EC_F_EC_POINT_CMP 113
#define EC_F_EC_POINT_COPY 114
Expand Down
12 changes: 4 additions & 8 deletions crypto/ec/ec_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/ec/ec_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -155,7 +155,6 @@ static ERR_STRING_DATA EC_str_functs[]=
{ERR_FUNC(EC_F_EC_KEY_PRINT), "EC_KEY_print"},
{ERR_FUNC(EC_F_EC_KEY_PRINT_FP), "EC_KEY_print_fp"},
{ERR_FUNC(EC_F_EC_POINTS_MAKE_AFFINE), "EC_POINTs_make_affine"},
{ERR_FUNC(EC_F_EC_POINTS_MUL), "EC_POINTs_mul"},
{ERR_FUNC(EC_F_EC_POINT_ADD), "EC_POINT_add"},
{ERR_FUNC(EC_F_EC_POINT_CMP), "EC_POINT_cmp"},
{ERR_FUNC(EC_F_EC_POINT_COPY), "EC_POINT_copy"},
Expand Down Expand Up @@ -247,15 +246,12 @@ static ERR_STRING_DATA EC_str_reasons[]=

void ERR_load_EC_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(EC_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,EC_str_functs);
ERR_load_strings(0,EC_str_reasons);
#endif

}
#endif
}
11 changes: 4 additions & 7 deletions crypto/ecdh/ech_err.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* crypto/ecdh/ech_err.c */
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2006 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
Expand Down Expand Up @@ -87,15 +87,12 @@ static ERR_STRING_DATA ECDH_str_reasons[]=

void ERR_load_ECDH_strings(void)
{
static int init=1;
#ifndef OPENSSL_NO_ERR

if (init)
if (ERR_func_error_string(ECDH_str_functs[0].error) == NULL)
{
init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(0,ECDH_str_functs);
ERR_load_strings(0,ECDH_str_reasons);
#endif

}
#endif
}
Loading

0 comments on commit 47a9d52

Please sign in to comment.