Loading CHANGES +5 −1 Original line number Diff line number Diff line Loading @@ -4,10 +4,14 @@ Changes between 0.9.8j and 0.9.9 [xx XXX xxxx] *) Type-checked OBJ_bsearch_ex. [Ben Laurie] *) Type-checked OBJ_bsearch. Also some constification necessitated by type-checking. Still to come: TXT_DB, bsearch(?), OBJ_bsearch_ex, qsort, CRYPTO_EX_DATA, ASN1_VALUE, ASN1_STRING, CONF_VALUE. [Ben Laurie] CONF_VALUE. [Ben Laurie] *) New function OPENSSL_gmtime_adj() to add a specific number of days and seconds to a tm structure directly, instead of going through OS Loading crypto/objects/obj_dat.c +5 −3 Original line number Diff line number Diff line Loading @@ -678,11 +678,13 @@ int OBJ_sn2nid(const char *s) const void *OBJ_bsearch_(const void *key, const void *base, int num, int size, int (*cmp)(const void *, const void *)) { return OBJ_bsearch_ex(key, base, num, size, cmp, 0); return OBJ_bsearch_ex_(key, base, num, size, cmp, 0); } const void *OBJ_bsearch_ex(const void *key, const void *base_, int num, int size, int (*cmp)(const void *, const void *), int flags) const void *OBJ_bsearch_ex_(const void *key, const void *base_, int num, int size, int (*cmp)(const void *, const void *), int flags) { const char *base=base_; int l,h,i=0,c=0; Loading crypto/objects/objects.h +11 −3 Original line number Diff line number Diff line Loading @@ -1013,8 +1013,9 @@ int OBJ_sn2nid(const char *s); int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b); const void * OBJ_bsearch_(const void *key,const void *base,int num,int size, int (*cmp)(const void *, const void *)); const void * OBJ_bsearch_ex(const void *key,const void *base,int num, int size, int (*cmp)(const void *, const void *), const void * OBJ_bsearch_ex_(const void *key,const void *base,int num, int size, int (*cmp)(const void *, const void *), int flags); #define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, cmp) \ Loading Loading @@ -1074,6 +1075,13 @@ const void * OBJ_bsearch_ex(const void *key,const void *base,int num, cmp##_type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \ cmp##_BSEARCH_CMP_FN))) #define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \ ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \ num,sizeof(type2), \ (cmp##_type_1=CHECKED_PTR_OF(type1,cmp##_type_1), \ cmp##_type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \ cmp##_BSEARCH_CMP_FN)),flags) int OBJ_new_nid(int num); int OBJ_add_object(const ASN1_OBJECT *obj); int OBJ_create(const char *oid,const char *sn,const char *ln); Loading crypto/stack/safestack.h +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ ((void (*)(void *)) ((1 ? p : (void (*)(type))0))) #define CHECKED_SK_CMP_FUNC(type, p) \ ((int (*)(const void * const *, const void * const *)) \ ((int (*)(const void *, const void *)) \ ((1 ? p : (int (*)(const type * const *, const type * const *))0))) #define STACK_OF(type) struct stack_st_##type Loading crypto/stack/stack.c +10 −18 Original line number Diff line number Diff line Loading @@ -77,11 +77,10 @@ const char STACK_version[]="Stack" OPENSSL_VERSION_PTEXT; #include <errno.h> int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void * const *, const void * const *))) (const void * const *, const void * const *) int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void *, const void *))) (const void *, const void *) { int (*old)(const void * const *,const void * const *)=sk->comp; int (*old)(const void *,const void *)=sk->comp; if (sk->comp != c) sk->sorted=0; Loading Loading @@ -115,10 +114,10 @@ err: _STACK *sk_new_null(void) { return sk_new((int (*)(const void * const *, const void * const *))0); return sk_new((int (*)(const void *, const void *))0); } _STACK *sk_new(int (*c)(const void * const *, const void * const *)) _STACK *sk_new(int (*c)(const void *, const void *)) { _STACK *ret; int i; Loading Loading @@ -213,9 +212,9 @@ void *sk_delete(_STACK *st, int loc) static int internal_find(_STACK *st, void *data, int ret_val_options) { char **r; const void * const *r; int i; int (*comp_func)(const void *,const void *); if(st == NULL) return -1; if (st->comp == NULL) Loading @@ -227,17 +226,10 @@ static int internal_find(_STACK *st, void *data, int ret_val_options) } sk_sort(st); if (data == NULL) return(-1); /* This (and the "qsort" below) are the two places in OpenSSL * where we need to convert from our standard (type **,type **) * compare callback type to the (void *,void *) type required by * bsearch. However, the "data" it is being called(back) with are * not (type *) pointers, but the *pointers* to (type *) pointers, * so we get our extra level of pointer dereferencing that way. */ comp_func=(int (*)(const void *,const void *))(st->comp); r=(char **)OBJ_bsearch_ex((char *)&data,(char *)st->data, st->num,sizeof(char *),comp_func,ret_val_options); r=OBJ_bsearch_ex_(&data,st->data,st->num,sizeof(void *),st->comp, ret_val_options); if (r == NULL) return(-1); return((int)(r-st->data)); return (int)((char **)r-st->data); } int sk_find(_STACK *st, void *data) Loading Loading
CHANGES +5 −1 Original line number Diff line number Diff line Loading @@ -4,10 +4,14 @@ Changes between 0.9.8j and 0.9.9 [xx XXX xxxx] *) Type-checked OBJ_bsearch_ex. [Ben Laurie] *) Type-checked OBJ_bsearch. Also some constification necessitated by type-checking. Still to come: TXT_DB, bsearch(?), OBJ_bsearch_ex, qsort, CRYPTO_EX_DATA, ASN1_VALUE, ASN1_STRING, CONF_VALUE. [Ben Laurie] CONF_VALUE. [Ben Laurie] *) New function OPENSSL_gmtime_adj() to add a specific number of days and seconds to a tm structure directly, instead of going through OS Loading
crypto/objects/obj_dat.c +5 −3 Original line number Diff line number Diff line Loading @@ -678,11 +678,13 @@ int OBJ_sn2nid(const char *s) const void *OBJ_bsearch_(const void *key, const void *base, int num, int size, int (*cmp)(const void *, const void *)) { return OBJ_bsearch_ex(key, base, num, size, cmp, 0); return OBJ_bsearch_ex_(key, base, num, size, cmp, 0); } const void *OBJ_bsearch_ex(const void *key, const void *base_, int num, int size, int (*cmp)(const void *, const void *), int flags) const void *OBJ_bsearch_ex_(const void *key, const void *base_, int num, int size, int (*cmp)(const void *, const void *), int flags) { const char *base=base_; int l,h,i=0,c=0; Loading
crypto/objects/objects.h +11 −3 Original line number Diff line number Diff line Loading @@ -1013,8 +1013,9 @@ int OBJ_sn2nid(const char *s); int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b); const void * OBJ_bsearch_(const void *key,const void *base,int num,int size, int (*cmp)(const void *, const void *)); const void * OBJ_bsearch_ex(const void *key,const void *base,int num, int size, int (*cmp)(const void *, const void *), const void * OBJ_bsearch_ex_(const void *key,const void *base,int num, int size, int (*cmp)(const void *, const void *), int flags); #define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, cmp) \ Loading Loading @@ -1074,6 +1075,13 @@ const void * OBJ_bsearch_ex(const void *key,const void *base,int num, cmp##_type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \ cmp##_BSEARCH_CMP_FN))) #define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \ ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \ num,sizeof(type2), \ (cmp##_type_1=CHECKED_PTR_OF(type1,cmp##_type_1), \ cmp##_type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \ cmp##_BSEARCH_CMP_FN)),flags) int OBJ_new_nid(int num); int OBJ_add_object(const ASN1_OBJECT *obj); int OBJ_create(const char *oid,const char *sn,const char *ln); Loading
crypto/stack/safestack.h +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ ((void (*)(void *)) ((1 ? p : (void (*)(type))0))) #define CHECKED_SK_CMP_FUNC(type, p) \ ((int (*)(const void * const *, const void * const *)) \ ((int (*)(const void *, const void *)) \ ((1 ? p : (int (*)(const type * const *, const type * const *))0))) #define STACK_OF(type) struct stack_st_##type Loading
crypto/stack/stack.c +10 −18 Original line number Diff line number Diff line Loading @@ -77,11 +77,10 @@ const char STACK_version[]="Stack" OPENSSL_VERSION_PTEXT; #include <errno.h> int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void * const *, const void * const *))) (const void * const *, const void * const *) int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void *, const void *))) (const void *, const void *) { int (*old)(const void * const *,const void * const *)=sk->comp; int (*old)(const void *,const void *)=sk->comp; if (sk->comp != c) sk->sorted=0; Loading Loading @@ -115,10 +114,10 @@ err: _STACK *sk_new_null(void) { return sk_new((int (*)(const void * const *, const void * const *))0); return sk_new((int (*)(const void *, const void *))0); } _STACK *sk_new(int (*c)(const void * const *, const void * const *)) _STACK *sk_new(int (*c)(const void *, const void *)) { _STACK *ret; int i; Loading Loading @@ -213,9 +212,9 @@ void *sk_delete(_STACK *st, int loc) static int internal_find(_STACK *st, void *data, int ret_val_options) { char **r; const void * const *r; int i; int (*comp_func)(const void *,const void *); if(st == NULL) return -1; if (st->comp == NULL) Loading @@ -227,17 +226,10 @@ static int internal_find(_STACK *st, void *data, int ret_val_options) } sk_sort(st); if (data == NULL) return(-1); /* This (and the "qsort" below) are the two places in OpenSSL * where we need to convert from our standard (type **,type **) * compare callback type to the (void *,void *) type required by * bsearch. However, the "data" it is being called(back) with are * not (type *) pointers, but the *pointers* to (type *) pointers, * so we get our extra level of pointer dereferencing that way. */ comp_func=(int (*)(const void *,const void *))(st->comp); r=(char **)OBJ_bsearch_ex((char *)&data,(char *)st->data, st->num,sizeof(char *),comp_func,ret_val_options); r=OBJ_bsearch_ex_(&data,st->data,st->num,sizeof(void *),st->comp, ret_val_options); if (r == NULL) return(-1); return((int)(r-st->data)); return (int)((char **)r-st->data); } int sk_find(_STACK *st, void *data) Loading