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.
This commit is contained in:
Dr. Stephen Henson
2000-12-21 01:38:55 +00:00
parent 1cc0b0a66a
commit 3c07b4c2ee
7 changed files with 24 additions and 9 deletions

View File

@@ -292,12 +292,17 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
#define DECLARE_ASN1_FUNCTIONS_name(type, name) \
type *name##_new(void); \
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); \
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) \
type *d2i_##name(type **a, const unsigned char **in, long len); \
@@ -641,7 +646,7 @@ typedef struct BIT_STRING_BITNAME_st {
#define IS_SEQUENCE 0
#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);
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);

View File

@@ -201,7 +201,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1
if(tag != -1) {
p = *in;
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);
@@ -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.
*/
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 */
ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx);
if(!ret) {