Fix type-checking/casting issue.

This commit is contained in:
Ben Laurie 2010-01-16 13:32:14 +00:00
parent 7eceffbfef
commit 9e198c4bd0
3 changed files with 28 additions and 4 deletions

View file

@ -186,7 +186,7 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
ex_tag, ex_class)
#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
i2d_ASN1_SET(CHECKED_STACK_OF(type, st), pp, \
i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \
CHECKED_I2D_OF(type, i2d_func), \
ex_tag, ex_class, is_set)

View file

@ -61,6 +61,7 @@ ENGINETEST= enginetest
EVPTEST= evp_test
IGETEST= igetest
JPAKETEST= jpaketest
ASN1TEST= asn1test
TESTS= alltests
@ -71,7 +72,8 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)
$(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \
$(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \
$(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \
$(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT)
$(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) \
$(ASN1TEST)$(EXE_EXT)
# $(METHTEST)$(EXE_EXT)
@ -83,7 +85,7 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \
$(MDC2TEST).o $(RMDTEST).o \
$(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \
$(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \
$(EVPTEST).o $(IGETEST).o $(JPAKETEST).o
$(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o
SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \
$(HMACTEST).c $(WPTEST).c \
@ -91,7 +93,7 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \
$(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \
$(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \
$(EVPTEST).c $(IGETEST).c $(JPAKETEST).c
$(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(ASN1TEST).c
EXHEADER=
HEADER= $(EXHEADER)

22
test/asn1test.c Executable file
View file

@ -0,0 +1,22 @@
#include <openssl/x509.h>
#include <openssl/asn1_mac.h>
typedef struct X
{
STACK_OF(X509_EXTENSION) *ext;
} X;
/* This isn't meant to run particularly, it's just to test type checking */
int main(int argc, char **argv)
{
X *x = NULL;
unsigned char **pp = NULL;
M_ASN1_I2D_vars(x);
M_ASN1_I2D_len_SEQUENCE_opt_type(X509_EXTENSION, x->ext,
i2d_X509_EXTENSION);
M_ASN1_I2D_seq_total();
M_ASN1_I2D_put_SEQUENCE_opt_type(X509_EXTENSION, x->ext,
i2d_X509_EXTENSION);
M_ASN1_I2D_finish();
}