From 6175b37578a8e991b4823551a22537f1446d4fe5 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 6 Apr 2002 19:48:58 +0000 Subject: [PATCH] Merge in recent changes from 0.9.6-stable. make update. --- CHANGES | 7 ++++ Makefile.org | 2 ++ apps/dgst.c | 4 +-- apps/enc.c | 4 +-- apps/openssl.c | 4 +-- apps/speed.c | 2 ++ crypto/conf/Makefile.ssl | 7 ++-- crypto/objects/obj_dat.h | 66 +++++++++++++++++++------------------- crypto/objects/obj_mac.h | 4 +-- crypto/objects/objects.pl | 2 ++ crypto/objects/objects.txt | 4 +-- e_os.h | 7 ++++ e_os2.h | 2 +- test/Makefile.ssl | 1 + 14 files changed, 69 insertions(+), 47 deletions(-) diff --git a/CHANGES b/CHANGES index bc3df77b1d..d91011f12d 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,13 @@ Changes between 0.9.6c and 0.9.6d [XX xxx XXXX] + *) Fix object definitions for Private and Enterprise: they were not + recognized in their shortname (=lowercase) representation. Extend + obj_dat.pl to issue an error when using undefined keywords instead + of silently ignoring the problem (Svenning Sorensen + ). + [Lutz Jaenicke] + *) Fix DH_generate_parameters() so that it works for 'non-standard' generators, i.e. generators other than 2 and 5. (Previously, the code did not properly initialise the 'add' and 'rem' values to diff --git a/Makefile.org b/Makefile.org index d8a44ecf0f..594f9d52f4 100644 --- a/Makefile.org +++ b/Makefile.org @@ -262,6 +262,7 @@ do_gnu-shared: ( set -x; ${CC} ${SHARED_LDFLAGS} \ -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ + -Wl,-Bsymbolic \ -Wl,--whole-archive lib$$i.a \ -Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \ libs="$$libs -l$$i"; \ @@ -288,6 +289,7 @@ do_darwin-shared: do_cygwin-shared: libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ ( set -x; ${CC} -shared -o cyg$$i.dll \ + -Wl,-Bsymbolic \ -Wl,--whole-archive lib$$i.a \ -Wl,--out-implib,lib$$i.dll.a \ -Wl,--no-whole-archive $$libs ) || exit 1; \ diff --git a/apps/dgst.c b/apps/dgst.c index 61b2a0dc4b..9a4c8103e0 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -89,8 +89,8 @@ int MAIN(int argc, char **argv) BIO *bmd=NULL; BIO *out = NULL; const char *name; -#define PROG_NAME_SIZE 16 - char pname[PROG_NAME_SIZE]; +#define PROG_NAME_SIZE 39 + char pname[PROG_NAME_SIZE+1]; int separator=0; int debug=0; const char *outfile = NULL, *keyfile = NULL; diff --git a/apps/enc.c b/apps/enc.c index fcb2581b66..c56b66bde8 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -101,8 +101,8 @@ int MAIN(int argc, char **argv) const EVP_CIPHER *cipher=NULL,*c; char *inf=NULL,*outf=NULL; BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL; -#define PROG_NAME_SIZE 16 - char pname[PROG_NAME_SIZE]; +#define PROG_NAME_SIZE 39 + char pname[PROG_NAME_SIZE+1]; char *engine = NULL; apps_startup(); diff --git a/apps/openssl.c b/apps/openssl.c index 4f61006b73..24450ddb71 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -88,8 +88,8 @@ BIO *bio_err=NULL; int main(int Argc, char *Argv[]) { ARGS arg; -#define PROG_NAME_SIZE 16 - char pname[PROG_NAME_SIZE]; +#define PROG_NAME_SIZE 39 + char pname[PROG_NAME_SIZE+1]; FUNCTION f,*fp; MS_STATIC char *prompt,buf[1024],config_name[256]; int n,i,ret=0; diff --git a/apps/speed.c b/apps/speed.c index be7bebab7a..a13e257566 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -337,7 +337,9 @@ int MAIN(int argc, char **argv) #define DSA_NUM 3 long count,rsa_count; int i,j,k; +#ifndef NO_RSA unsigned rsa_num; +#endif #ifndef NO_MD2 unsigned char md2[MD2_DIGEST_LENGTH]; #endif diff --git a/crypto/conf/Makefile.ssl b/crypto/conf/Makefile.ssl index a792a526f4..15dcd6679c 100644 --- a/crypto/conf/Makefile.ssl +++ b/crypto/conf/Makefile.ssl @@ -82,9 +82,10 @@ clean: conf_api.o: ../../include/openssl/bio.h ../../include/openssl/conf.h conf_api.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h -conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h -conf_api.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -conf_api.o: ../../include/openssl/symhacks.h +conf_api.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h +conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h +conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h conf_def.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h conf_def.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h conf_def.o: ../../include/openssl/crypto.h ../../include/openssl/err.h diff --git a/crypto/objects/obj_dat.h b/crypto/objects/obj_dat.h index 47c6b9a072..63e11f7354 100644 --- a/crypto/objects/obj_dat.h +++ b/crypto/objects/obj_dat.h @@ -67,7 +67,7 @@ #define NUM_LN 402 #define NUM_OBJ 376 -static unsigned char lvalues[2941]={ +static unsigned char lvalues[2951]={ 0x00, /* [ 0] OBJ_undef */ 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */ 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */ @@ -429,21 +429,21 @@ static unsigned char lvalues[2941]={ 0x2B,0x06,0x01,0x05, /* [2851] OBJ_Security */ 0x2B,0x06,0x01,0x06, /* [2855] OBJ_SNMPv2 */ 0x2B,0x06,0x01,0x07, /* [2859] OBJ_Mail */ -0x01, /* [2863] OBJ_Enterprises */ -0xBA,0x82,0x58, /* [2864] OBJ_dcObject */ -0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,/* [2867] OBJ_domainComponent */ -0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,/* [2877] OBJ_Domain */ -0x50, /* [2887] OBJ_joint_iso_ccitt */ -0x55,0x01,0x05, /* [2888] OBJ_selected_attribute_types */ -0x55,0x01,0x05,0x37, /* [2891] OBJ_clearance */ -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x03,/* [2895] OBJ_md4WithRSAEncryption */ -0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0A, /* [2904] OBJ_ac_proxying */ -0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0B, /* [2912] OBJ_sinfo_access */ -0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x06, /* [2920] OBJ_id_aca_encAttrs */ -0x55,0x04,0x48, /* [2928] OBJ_role */ -0x55,0x1D,0x24, /* [2931] OBJ_policy_constraints */ -0x55,0x1D,0x37, /* [2934] OBJ_target_information */ -0x55,0x1D,0x38, /* [2937] OBJ_no_rev_avail */ +0x2B,0x06,0x01,0x04,0x01, /* [2863] OBJ_Enterprises */ +0x2B,0x06,0x01,0x04,0x01,0x8B,0x3A,0x82,0x58,/* [2868] OBJ_dcObject */ +0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,/* [2877] OBJ_domainComponent */ +0x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,/* [2887] OBJ_Domain */ +0x50, /* [2897] OBJ_joint_iso_ccitt */ +0x55,0x01,0x05, /* [2898] OBJ_selected_attribute_types */ +0x55,0x01,0x05,0x37, /* [2901] OBJ_clearance */ +0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x03,/* [2905] OBJ_md4WithRSAEncryption */ +0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0A, /* [2914] OBJ_ac_proxying */ +0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0B, /* [2922] OBJ_sinfo_access */ +0x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x06, /* [2930] OBJ_id_aca_encAttrs */ +0x55,0x04,0x48, /* [2938] OBJ_role */ +0x55,0x1D,0x24, /* [2941] OBJ_policy_constraints */ +0x55,0x1D,0x37, /* [2944] OBJ_target_information */ +0x55,0x1D,0x38, /* [2947] OBJ_no_rev_avail */ }; static ASN1_OBJECT nid_objs[NUM_NID]={ @@ -1052,29 +1052,29 @@ static ASN1_OBJECT nid_objs[NUM_NID]={ {"security","Security",NID_Security,4,&(lvalues[2851]),0}, {"snmpv2","SNMPv2",NID_SNMPv2,4,&(lvalues[2855]),0}, {"mail","Mail",NID_Mail,4,&(lvalues[2859]),0}, -{"enterprises","Enterprises",NID_Enterprises,1,&(lvalues[2863]),0}, -{"dcobject","dcObject",NID_dcObject,3,&(lvalues[2864]),0}, -{"DC","domainComponent",NID_domainComponent,10,&(lvalues[2867]),0}, -{"domain","Domain",NID_Domain,10,&(lvalues[2877]),0}, +{"enterprises","Enterprises",NID_Enterprises,5,&(lvalues[2863]),0}, +{"dcobject","dcObject",NID_dcObject,9,&(lvalues[2868]),0}, +{"DC","domainComponent",NID_domainComponent,10,&(lvalues[2877]),0}, +{"domain","Domain",NID_Domain,10,&(lvalues[2887]),0}, {"JOINT-ISO-CCITT","joint-iso-ccitt",NID_joint_iso_ccitt,1, - &(lvalues[2887]),0}, + &(lvalues[2897]),0}, {"selected-attribute-types","Selected Attribute Types", - NID_selected_attribute_types,3,&(lvalues[2888]),0}, -{"clearance","clearance",NID_clearance,4,&(lvalues[2891]),0}, + NID_selected_attribute_types,3,&(lvalues[2898]),0}, +{"clearance","clearance",NID_clearance,4,&(lvalues[2901]),0}, {"RSA-MD4","md4WithRSAEncryption",NID_md4WithRSAEncryption,9, - &(lvalues[2895]),0}, -{"ac-proxying","ac-proxying",NID_ac_proxying,8,&(lvalues[2904]),0}, + &(lvalues[2905]),0}, +{"ac-proxying","ac-proxying",NID_ac_proxying,8,&(lvalues[2914]),0}, {"subjectInfoAccess","Subject Information Access",NID_sinfo_access,8, - &(lvalues[2912]),0}, + &(lvalues[2922]),0}, {"id-aca-encAttrs","id-aca-encAttrs",NID_id_aca_encAttrs,8, - &(lvalues[2920]),0}, -{"role","role",NID_role,3,&(lvalues[2928]),0}, + &(lvalues[2930]),0}, +{"role","role",NID_role,3,&(lvalues[2938]),0}, {"policyConstraints","X509v3 Policy Constraints", - NID_policy_constraints,3,&(lvalues[2931]),0}, + NID_policy_constraints,3,&(lvalues[2941]),0}, {"targetInformation","X509v3 AC Targeting",NID_target_information,3, - &(lvalues[2934]),0}, + &(lvalues[2944]),0}, {"noRevAvail","X509v3 No Revocation Available",NID_no_rev_avail,3, - &(lvalues[2937]),0}, + &(lvalues[2947]),0}, }; static ASN1_OBJECT *sn_objs[NUM_SN]={ @@ -1889,7 +1889,6 @@ static ASN1_OBJECT *ln_objs[NUM_LN]={ static ASN1_OBJECT *obj_objs[NUM_OBJ]={ &(nid_objs[ 0]),/* OBJ_undef 0 */ -&(nid_objs[389]),/* OBJ_Enterprises 1 */ &(nid_objs[181]),/* OBJ_iso 1 */ &(nid_objs[182]),/* OBJ_member_body 1 2 */ &(nid_objs[379]),/* OBJ_org 1 3 */ @@ -1935,7 +1934,6 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={ &(nid_objs[126]),/* OBJ_ext_key_usage 2 5 29 37 */ &(nid_objs[402]),/* OBJ_target_information 2 5 29 55 */ &(nid_objs[403]),/* OBJ_no_rev_avail 2 5 29 56 */ -&(nid_objs[390]),/* OBJ_dcObject 1466 344 */ &(nid_objs[382]),/* OBJ_Directory 1 3 6 1 1 */ &(nid_objs[383]),/* OBJ_Management 1 3 6 1 2 */ &(nid_objs[384]),/* OBJ_Experimental 1 3 6 1 3 */ @@ -1949,6 +1947,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={ &(nid_objs[96]),/* OBJ_mdc2WithRSA 2 5 8 3 100 */ &(nid_objs[95]),/* OBJ_mdc2 2 5 8 3 101 */ &(nid_objs[184]),/* OBJ_X9_57 1 2 840 10040 */ +&(nid_objs[389]),/* OBJ_Enterprises 1 3 6 1 4 1 */ &(nid_objs[104]),/* OBJ_md5WithRSA 1 3 14 3 2 3 */ &(nid_objs[29]),/* OBJ_des_ecb 1 3 14 3 2 6 */ &(nid_objs[31]),/* OBJ_des_cbc 1 3 14 3 2 7 */ @@ -2142,6 +2141,7 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={ &(nid_objs[188]),/* OBJ_SMIME 1 2 840 113549 1 9 16 */ &(nid_objs[156]),/* OBJ_friendlyName 1 2 840 113549 1 9 20 */ &(nid_objs[157]),/* OBJ_localKeyID 1 2 840 113549 1 9 21 */ +&(nid_objs[390]),/* OBJ_dcObject 1 3 6 1 4 1 1466 344 */ &(nid_objs[91]),/* OBJ_bf_cbc 1 3 6 1 4 1 3029 1 2 */ &(nid_objs[315]),/* OBJ_id_regCtrl_regToken 1 3 6 1 5 5 7 5 1 1 */ &(nid_objs[316]),/* OBJ_id_regCtrl_authenticator 1 3 6 1 5 5 7 5 1 2 */ diff --git a/crypto/objects/obj_mac.h b/crypto/objects/obj_mac.h index ad2e4239e1..a2a960ee37 100644 --- a/crypto/objects/obj_mac.h +++ b/crypto/objects/obj_mac.h @@ -1817,12 +1817,12 @@ #define SN_Enterprises "enterprises" #define LN_Enterprises "Enterprises" #define NID_Enterprises 389 -#define OBJ_Enterprises OBJ_private,1L +#define OBJ_Enterprises OBJ_Private,1L #define SN_dcObject "dcobject" #define LN_dcObject "dcObject" #define NID_dcObject 390 -#define OBJ_dcObject OBJ_enterprises,1466L,344L +#define OBJ_dcObject OBJ_Enterprises,1466L,344L #define SN_domainComponent "DC" #define LN_domainComponent "domainComponent" diff --git a/crypto/objects/objects.pl b/crypto/objects/objects.pl index 2b8106eb99..fe0d88bcbd 100644 --- a/crypto/objects/objects.pl +++ b/crypto/objects/objects.pl @@ -208,6 +208,8 @@ sub process_oid if (!($a[0] =~ /^[0-9]+$/)) { $a[0] =~ s/-/_/g; + if (!defined($obj{$a[0]})) + { die "$ARGV[0]:$o:Undefined identifier ",$a[0],"\n"; } $pref_oid = "OBJ_" . $a[0]; $pref_sep = ","; shift @a; diff --git a/crypto/objects/objects.txt b/crypto/objects/objects.txt index 3087e9aba2..fb73408f46 100644 --- a/crypto/objects/objects.txt +++ b/crypto/objects/objects.txt @@ -593,10 +593,10 @@ internet 5 : security : Security internet 6 : snmpv2 : SNMPv2 internet 7 : mail : Mail -private 1 : enterprises : Enterprises +Private 1 : enterprises : Enterprises # RFC 2247 -enterprises 1466 344 : dcobject : dcObject +Enterprises 1466 344 : dcobject : dcObject # Stray OIDs we don't know the full name of each step for # RFC 2247 diff --git a/e_os.h b/e_os.h index 928032f9ed..aba8c6f41b 100644 --- a/e_os.h +++ b/e_os.h @@ -154,6 +154,13 @@ extern "C" { #define closesocket(s) MacSocket_close(s) #define readsocket(s,b,n) MacSocket_recv((s),(b),(n),true) #define writesocket(s,b,n) MacSocket_send((s),(b),(n)) +#elif defined(VMS) +#define get_last_socket_error() errno +#define clear_socket_error() errno=0 +#define ioctlsocket(a,b,c) ioctl(a,b,c) +#define closesocket(s) close(s) +#define readsocket(s,b,n) recv((s),(b),(n),0) +#define writesocket(s,b,n) send((s),(b),(n),0) #else #define get_last_socket_error() errno #define clear_socket_error() errno=0 diff --git a/e_os2.h b/e_os2.h index 5a25ac7cf6..3d1dec1cfa 100644 --- a/e_os2.h +++ b/e_os2.h @@ -23,7 +23,7 @@ extern "C" { declared explicitely with globaldef and globalref. On other OS:es, these macros are defined with something sensible. */ -#if defined(VMS) && !defined(__DECC) +#if defined(VMS) && !defined(__DECC) && !defined(__DECCXX) # define OPENSSL_EXTERN globalref # define OPENSSL_GLOBAL globaldef #else diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 24a06e4c67..deacb72c91 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -352,6 +352,7 @@ destest.o: ../include/openssl/des.h ../include/openssl/e_os2.h destest.o: ../include/openssl/opensslconf.h dhtest.o: ../include/openssl/bio.h ../include/openssl/bn.h dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h +dhtest.o: ../include/openssl/err.h ../include/openssl/lhash.h dhtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -- 2.25.1