From 2ebf8ad9f0c9fe42645108754bb0b9927faf48b9 Mon Sep 17 00:00:00 2001 From: zhaoxiaomeng Date: Mon, 10 Jul 2017 16:35:06 +0800 Subject: [PATCH] [crypto] fix no-base58 --- crypto/base58/base58_err.c | 5 +++++ crypto/err/err.c | 5 ++++- crypto/err/err_all.c | 2 ++ include/openssl/err.h | 8 ++++++-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/crypto/base58/base58_err.c b/crypto/base58/base58_err.c index 9a034293..7563860a 100644 --- a/crypto/base58/base58_err.c +++ b/crypto/base58/base58_err.c @@ -12,9 +12,12 @@ #include #include +#ifndef OPENSSL_NO_BASE58 + /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + # define ERR_FUNC(func) ERR_PACK(ERR_LIB_BASE58,func,0) # define ERR_REASON(reason) ERR_PACK(ERR_LIB_BASE58,0,reason) @@ -42,3 +45,5 @@ int ERR_load_BASE58_strings(void) #endif return 1; } + +#endif \ No newline at end of file diff --git a/crypto/err/err.c b/crypto/err/err.c index 7f209432..1a0ba825 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -73,7 +73,9 @@ static ERR_STRING_DATA ERR_str_libraries[] = { {ERR_PACK(ERR_LIB_SDF, 0, 0), "SDF routines"}, {ERR_PACK(ERR_LIB_SKF, 0, 0), "SKF routines"}, {ERR_PACK(ERR_LIB_SOF, 0, 0), "SOF routines"}, + #ifndef OPENSSL_NO_BASE58 {ERR_PACK(ERR_LIB_BASE58, 0, 0), "BASE58 routines"}, + #endif {0, NULL}, }; @@ -132,8 +134,9 @@ static ERR_STRING_DATA ERR_str_reasons[] = { {ERR_R_SDF_LIB, "SDF lib"}, {ERR_R_SKF_LIB, "SKF lib"}, {ERR_R_SOF_LIB, "SOF lib"}, + #ifndef OPENSSL_NO_BASE58 {ERR_R_BASE58_LIB, "BASE58 lib"}, - + #endif {ERR_R_NESTED_ASN1_ERROR, "nested asn1 error"}, {ERR_R_MISSING_ASN1_EOS, "missing asn1 eos"}, diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c index 0bf62396..107fcd44 100644 --- a/crypto/err/err_all.c +++ b/crypto/err/err_all.c @@ -53,7 +53,9 @@ #include #include #include +#ifndef OPENSSL_NO_BASE58 #include +#endif int err_load_crypto_strings_int(void) diff --git a/include/openssl/err.h b/include/openssl/err.h index 2b51f5ba..2ccd04f5 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -107,7 +107,9 @@ typedef struct err_state_st { # define ERR_LIB_SDF 63 # define ERR_LIB_SKF 64 # define ERR_LIB_SOF 65 +#ifndef OPENSSL_NO_BASE58 # define ERR_LIB_BASE58 66 +#endif # define ERR_LIB_USER 128 @@ -160,8 +162,9 @@ typedef struct err_state_st { # define SDFerr(f,r) ERR_PUT_error(ERR_LIB_SDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define SKFerr(f,r) ERR_PUT_error(ERR_LIB_SKF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define SOFerr(f,r) ERR_PUT_error(ERR_LIB_SOF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +#ifndef OPENSSL_NO_BASE58 # define BASE58err(f,r) ERR_PUT_error(ERR_LIB_BASE58,(f),(r),OPENSSL_FILE,OPENSSL_LINE) - +#endif # define ERR_PACK(l,f,r) ( \ (((unsigned int)(l) & 0x0FF) << 24L) | \ (((unsigned int)(f) & 0xFFF) << 12L) | \ @@ -222,8 +225,9 @@ typedef struct err_state_st { # define ERR_R_SDF_LIB ERR_LIB_SDF/* 63 */ # define ERR_R_SKF_LIB ERR_LIB_SKF/* 64 */ # define ERR_R_SOF_LIB ERR_LIB_SOF/* 65 */ +#ifndef OPENSSL_NO_BASE58 # define ERR_R_BASE58_LIB ERR_LIB_BASE58/* 66 */ - +#endif # define ERR_R_NESTED_ASN1_ERROR 58 # define ERR_R_NESTED_ASN1_ERROR 58