提交 3c07b4c2 编写于 作者: D Dr. Stephen Henson

Various Win32 related fixes. Doesn't compile yet on

Win32 but it is getting there...

Update mkdef.pl to handle ASN1_ANY and fix headers.

Stop various VC++ warnings.

Include some fixes from "Peter 'Luna' Runestig"
<peter@runestig.com>

Remove external declaration for des_set_weak_key_flag:
it doesn't exist.
上级 1cc0b0a6
...@@ -292,12 +292,17 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; ...@@ -292,12 +292,17 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
#define DECLARE_ASN1_FUNCTIONS_name(type, name) \ #define DECLARE_ASN1_FUNCTIONS_name(type, name) \
type *name##_new(void); \ type *name##_new(void); \
void name##_free(type *a); \ void name##_free(type *a); \
DECLARE_ASN1_ENCODE_FUNCTIONS(type, name) DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, name) \ #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
type *name##_new(void); \
void name##_free(type *a); \
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
type *d2i_##name(type **a, unsigned char **in, long len); \ type *d2i_##name(type **a, unsigned char **in, long len); \
int i2d_##name(type *a, unsigned char **out); \ int i2d_##name(type *a, unsigned char **out); \
extern const ASN1_ITEM name##_it; extern const ASN1_ITEM itname##_it;
#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
type *d2i_##name(type **a, const unsigned char **in, long len); \ type *d2i_##name(type **a, const unsigned char **in, long len); \
...@@ -641,7 +646,7 @@ typedef struct BIT_STRING_BITNAME_st { ...@@ -641,7 +646,7 @@ typedef struct BIT_STRING_BITNAME_st {
#define IS_SEQUENCE 0 #define IS_SEQUENCE 0
#define IS_SET 1 #define IS_SET 1
DECLARE_ASN1_FUNCTIONS(ASN1_TYPE) DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
int ASN1_TYPE_get(ASN1_TYPE *a); int ASN1_TYPE_get(ASN1_TYPE *a);
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
......
...@@ -201,7 +201,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1 ...@@ -201,7 +201,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1
if(tag != -1) { if(tag != -1) {
p = *in; p = *in;
imphack = *p; imphack = *p;
*p = (*p & V_ASN1_CONSTRUCTED) | it->utype; *p = (unsigned char)((*p & V_ASN1_CONSTRUCTED) | it->utype);
} }
ptmpval = cf->asn1_d2i(pval, in, len); ptmpval = cf->asn1_d2i(pval, in, len);
...@@ -315,7 +315,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1 ...@@ -315,7 +315,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1
* it increases efficiency in some cases. * it increases efficiency in some cases.
*/ */
if(i == (it->tcount - 1)) isopt = 0; if(i == (it->tcount - 1)) isopt = 0;
else isopt = seqtt->flags & ASN1_TFLG_OPTIONAL; else isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
/* attempt to read in field, allowing each to be OPTIONAL */ /* attempt to read in field, allowing each to be OPTIONAL */
ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx); ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx);
if(!ret) { if(!ret) {
......
...@@ -113,7 +113,6 @@ typedef struct des_ks_struct ...@@ -113,7 +113,6 @@ typedef struct des_ks_struct
OPENSSL_EXTERN int des_check_key; /* defaults to false */ OPENSSL_EXTERN int des_check_key; /* defaults to false */
OPENSSL_EXTERN int des_rw_mode; /* defaults to DES_PCBC_MODE */ OPENSSL_EXTERN int des_rw_mode; /* defaults to DES_PCBC_MODE */
OPENSSL_EXTERN int des_set_weak_key_flag; /* set the weak key flag */
const char *des_options(void); const char *des_options(void);
void des_ecb3_encrypt(const_des_cblock *input, des_cblock *output, void des_ecb3_encrypt(const_des_cblock *input, des_cblock *output,
......
...@@ -295,12 +295,12 @@ void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg), ...@@ -295,12 +295,12 @@ void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg),
d.n=0; d.n=0;
OBJ_NAME_do_all(type,do_all_sorted_fn,&d); OBJ_NAME_do_all(type,do_all_sorted_fn,&d);
qsort(d.names,d.n,sizeof *d.names,do_all_sorted_cmp); qsort((void *)d.names,d.n,sizeof *d.names,do_all_sorted_cmp);
for(n=0 ; n < d.n ; ++n) for(n=0 ; n < d.n ; ++n)
fn(d.names[n],arg); fn(d.names[n],arg);
OPENSSL_free(d.names); OPENSSL_free((void *)d.names);
} }
static int free_type; static int free_type;
......
...@@ -120,6 +120,8 @@ ASN1_CHOICE(OCSP_RESPID) = { ...@@ -120,6 +120,8 @@ ASN1_CHOICE(OCSP_RESPID) = {
ASN1_IMP(OCSP_RESPID, value.byKey, ASN1_OCTET_STRING, 2) ASN1_IMP(OCSP_RESPID, value.byKey, ASN1_OCTET_STRING, 2)
} ASN1_CHOICE_END(OCSP_RESPID); } ASN1_CHOICE_END(OCSP_RESPID);
IMPLEMENT_ASN1_FUNCTIONS(OCSP_RESPID)
ASN1_SEQUENCE(OCSP_REVOKEDINFO) = { ASN1_SEQUENCE(OCSP_REVOKEDINFO) = {
ASN1_SIMPLE(OCSP_REVOKEDINFO, revocationTime, ASN1_GENERALIZEDTIME), ASN1_SIMPLE(OCSP_REVOKEDINFO, revocationTime, ASN1_GENERALIZEDTIME),
ASN1_EXP_OPT(OCSP_REVOKEDINFO, revocationReason, ASN1_ENUMERATED, 0) ASN1_EXP_OPT(OCSP_REVOKEDINFO, revocationReason, ASN1_ENUMERATED, 0)
......
...@@ -176,3 +176,5 @@ ASN1_SEQUENCE(PKCS7_DIGEST) = { ...@@ -176,3 +176,5 @@ ASN1_SEQUENCE(PKCS7_DIGEST) = {
ASN1_SIMPLE(PKCS7_DIGEST, contents, PKCS7), ASN1_SIMPLE(PKCS7_DIGEST, contents, PKCS7),
ASN1_SIMPLE(PKCS7_DIGEST, digest, ASN1_OCTET_STRING) ASN1_SIMPLE(PKCS7_DIGEST, digest, ASN1_OCTET_STRING)
} ASN1_SEQUENCE_END(PKCS7_DIGEST); } ASN1_SEQUENCE_END(PKCS7_DIGEST);
IMPLEMENT_ASN1_FUNCTIONS(PKCS7_DIGEST)
...@@ -377,6 +377,13 @@ sub do_defs ...@@ -377,6 +377,13 @@ sub do_defs
} }
if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) { if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) {
next; next;
} elsif (/^\s*DECLARE_ASN1_FUNCTIONS_fname\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) {
$syms{"d2i_$3"} = 1;
$syms{"i2d_$3"} = 1;
$syms{"$3_new"} = 1;
$syms{"$3_free"} = 1;
$syms{"$2_it"} = 1;
$kind{"$2_it"} = "VARIABLE";
} elsif (/^\s*DECLARE_ASN1_FUNCTIONS\s*\(\s*(\w*)\s*\)/) { } elsif (/^\s*DECLARE_ASN1_FUNCTIONS\s*\(\s*(\w*)\s*\)/) {
$syms{"d2i_$1"} = 1; $syms{"d2i_$1"} = 1;
$syms{"i2d_$1"} = 1; $syms{"i2d_$1"} = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册