diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_mac.h')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_mac.h | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h index af0e664b2d..a48649ceeb 100644 --- a/src/lib/libcrypto/asn1/asn1_mac.h +++ b/src/lib/libcrypto/asn1/asn1_mac.h | |||
@@ -70,14 +70,14 @@ extern "C" { | |||
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #define ASN1_MAC_H_err(f,r,line) \ | 72 | #define ASN1_MAC_H_err(f,r,line) \ |
73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),ERR_file_name,(line)) | 73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) |
74 | 74 | ||
75 | #define M_ASN1_D2I_vars(a,type,func) \ | 75 | #define M_ASN1_D2I_vars(a,type,func) \ |
76 | ASN1_CTX c; \ | 76 | ASN1_CTX c; \ |
77 | type ret=NULL; \ | 77 | type ret=NULL; \ |
78 | \ | 78 | \ |
79 | c.pp=pp; \ | 79 | c.pp=(unsigned char **)pp; \ |
80 | c.q= *pp; \ | 80 | c.q= *(unsigned char **)pp; \ |
81 | c.error=ERR_R_NESTED_ASN1_ERROR; \ | 81 | c.error=ERR_R_NESTED_ASN1_ERROR; \ |
82 | if ((a == NULL) || ((*a) == NULL)) \ | 82 | if ((a == NULL) || ((*a) == NULL)) \ |
83 | { if ((ret=(type)func()) == NULL) \ | 83 | { if ((ret=(type)func()) == NULL) \ |
@@ -85,13 +85,13 @@ extern "C" { | |||
85 | else ret=(*a); | 85 | else ret=(*a); |
86 | 86 | ||
87 | #define M_ASN1_D2I_Init() \ | 87 | #define M_ASN1_D2I_Init() \ |
88 | c.p= *pp; \ | 88 | c.p= *(unsigned char **)pp; \ |
89 | c.max=(length == 0)?0:(c.p+length); | 89 | c.max=(length == 0)?0:(c.p+length); |
90 | 90 | ||
91 | #define M_ASN1_D2I_Finish_2(a) \ | 91 | #define M_ASN1_D2I_Finish_2(a) \ |
92 | if (!asn1_Finish(&c)) \ | 92 | if (!asn1_Finish(&c)) \ |
93 | { c.line=__LINE__; goto err; } \ | 93 | { c.line=__LINE__; goto err; } \ |
94 | *pp=c.p; \ | 94 | *(unsigned char **)pp=c.p; \ |
95 | if (a != NULL) (*a)=ret; \ | 95 | if (a != NULL) (*a)=ret; \ |
96 | return(ret); | 96 | return(ret); |
97 | 97 | ||
@@ -99,7 +99,7 @@ extern "C" { | |||
99 | M_ASN1_D2I_Finish_2(a); \ | 99 | M_ASN1_D2I_Finish_2(a); \ |
100 | err:\ | 100 | err:\ |
101 | ASN1_MAC_H_err((e),c.error,c.line); \ | 101 | ASN1_MAC_H_err((e),c.error,c.line); \ |
102 | asn1_add_error(*pp,(int)(c.q- *pp)); \ | 102 | asn1_add_error(*(unsigned char **)pp,(int)(c.q- *pp)); \ |
103 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ | 103 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ |
104 | return(NULL) | 104 | return(NULL) |
105 | 105 | ||
@@ -196,9 +196,6 @@ err:\ | |||
196 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 196 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
197 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); | 197 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); |
198 | 198 | ||
199 | #define M_ASN1_I2D_put_SEQUENCE_opt_ex_type(type,a,f) \ | ||
200 | if (a) M_ASN1_I2D_put_SEQUENCE_type(type,a,f); | ||
201 | |||
202 | #define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ | 199 | #define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ |
203 | if ((c.slen != 0) && \ | 200 | if ((c.slen != 0) && \ |
204 | (M_ASN1_next == \ | 201 | (M_ASN1_next == \ |
@@ -392,9 +389,6 @@ err:\ | |||
392 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 389 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
393 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); | 390 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); |
394 | 391 | ||
395 | #define M_ASN1_I2D_len_SEQUENCE_opt_ex_type(type,a,f) \ | ||
396 | if (a) M_ASN1_I2D_len_SEQUENCE_type(type,a,f); | ||
397 | |||
398 | #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ | 392 | #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ |
399 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); | 393 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); |
400 | 394 | ||
@@ -458,15 +452,6 @@ err:\ | |||
458 | ret+=ASN1_object_size(1,v,mtag); \ | 452 | ret+=ASN1_object_size(1,v,mtag); \ |
459 | } | 453 | } |
460 | 454 | ||
461 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt_ex_type(type,a,f,mtag,tag,v) \ | ||
462 | if (a)\ | ||
463 | { \ | ||
464 | v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \ | ||
465 | V_ASN1_UNIVERSAL, \ | ||
466 | IS_SEQUENCE); \ | ||
467 | ret+=ASN1_object_size(1,v,mtag); \ | ||
468 | } | ||
469 | |||
470 | /* Put Macros */ | 455 | /* Put Macros */ |
471 | #define M_ASN1_I2D_put(a,f) f(a,&p) | 456 | #define M_ASN1_I2D_put(a,f) f(a,&p) |
472 | 457 | ||
@@ -551,14 +536,6 @@ err:\ | |||
551 | IS_SEQUENCE); \ | 536 | IS_SEQUENCE); \ |
552 | } | 537 | } |
553 | 538 | ||
554 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_ex_type(type,a,f,mtag,tag,v) \ | ||
555 | if (a) \ | ||
556 | { \ | ||
557 | ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
558 | i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \ | ||
559 | IS_SEQUENCE); \ | ||
560 | } | ||
561 | |||
562 | #define M_ASN1_I2D_seq_total() \ | 539 | #define M_ASN1_I2D_seq_total() \ |
563 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ | 540 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ |
564 | if (pp == NULL) return(r); \ | 541 | if (pp == NULL) return(r); \ |