diff options
author | djm <> | 2008-09-06 12:17:54 +0000 |
---|---|---|
committer | djm <> | 2008-09-06 12:17:54 +0000 |
commit | 38ce604e3cc97706b876b0525ddff0121115456d (patch) | |
tree | 7ccc28afe1789ea3dbedf72365f955d5b8e105b5 /src/lib/libcrypto/asn1/asn1_mac.h | |
parent | 12867252827c8efaa8ddd1fa3b3d6e321e2bcdef (diff) | |
download | openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.gz openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.bz2 openbsd-38ce604e3cc97706b876b0525ddff0121115456d.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_mac.h')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_mac.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h index a48649ceeb..d958ca60d9 100644 --- a/src/lib/libcrypto/asn1/asn1_mac.h +++ b/src/lib/libcrypto/asn1/asn1_mac.h | |||
@@ -73,11 +73,11 @@ extern "C" { | |||
73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(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_const_CTX c; \ |
77 | type ret=NULL; \ | 77 | type ret=NULL; \ |
78 | \ | 78 | \ |
79 | c.pp=(unsigned char **)pp; \ | 79 | c.pp=(const unsigned char **)pp; \ |
80 | c.q= *(unsigned char **)pp; \ | 80 | c.q= *(const 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= *(unsigned char **)pp; \ | 88 | c.p= *(const 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_const_Finish(&c)) \ |
93 | { c.line=__LINE__; goto err; } \ | 93 | { c.line=__LINE__; goto err; } \ |
94 | *(unsigned char **)pp=c.p; \ | 94 | *(const 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(*(unsigned char **)pp,(int)(c.q- *pp)); \ | 102 | asn1_add_error(*(const 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 | ||
@@ -123,15 +123,22 @@ err:\ | |||
123 | 123 | ||
124 | #define M_ASN1_D2I_end_sequence() \ | 124 | #define M_ASN1_D2I_end_sequence() \ |
125 | (((c.inf&1) == 0)?(c.slen <= 0): \ | 125 | (((c.inf&1) == 0)?(c.slen <= 0): \ |
126 | (c.eos=ASN1_check_infinite_end(&c.p,c.slen))) | 126 | (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen))) |
127 | 127 | ||
128 | /* Don't use this with d2i_ASN1_BOOLEAN() */ | 128 | /* Don't use this with d2i_ASN1_BOOLEAN() */ |
129 | #define M_ASN1_D2I_get(b,func) \ | 129 | #define M_ASN1_D2I_get(b, func) \ |
130 | c.q=c.p; \ | 130 | c.q=c.p; \ |
131 | if (func(&(b),&c.p,c.slen) == NULL) \ | 131 | if (func(&(b),&c.p,c.slen) == NULL) \ |
132 | {c.line=__LINE__; goto err; } \ | 132 | {c.line=__LINE__; goto err; } \ |
133 | c.slen-=(c.p-c.q); | 133 | c.slen-=(c.p-c.q); |
134 | 134 | ||
135 | /* Don't use this with d2i_ASN1_BOOLEAN() */ | ||
136 | #define M_ASN1_D2I_get_x(type,b,func) \ | ||
137 | c.q=c.p; \ | ||
138 | if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \ | ||
139 | {c.line=__LINE__; goto err; } \ | ||
140 | c.slen-=(c.p-c.q); | ||
141 | |||
135 | /* use this instead () */ | 142 | /* use this instead () */ |
136 | #define M_ASN1_D2I_get_int(b,func) \ | 143 | #define M_ASN1_D2I_get_int(b,func) \ |
137 | c.q=c.p; \ | 144 | c.q=c.p; \ |
@@ -278,7 +285,7 @@ err:\ | |||
278 | { c.line=__LINE__; goto err; } \ | 285 | { c.line=__LINE__; goto err; } \ |
279 | if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ | 286 | if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ |
280 | Tlen = c.slen - (c.p - c.q); \ | 287 | Tlen = c.slen - (c.p - c.q); \ |
281 | if(!ASN1_check_infinite_end(&c.p, Tlen)) \ | 288 | if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \ |
282 | { c.error=ERR_R_MISSING_ASN1_EOS; \ | 289 | { c.error=ERR_R_MISSING_ASN1_EOS; \ |
283 | c.line=__LINE__; goto err; } \ | 290 | c.line=__LINE__; goto err; } \ |
284 | }\ | 291 | }\ |
@@ -353,8 +360,12 @@ err:\ | |||
353 | return(NULL) | 360 | return(NULL) |
354 | 361 | ||
355 | 362 | ||
356 | #define M_ASN1_next (*c.p) | 363 | /* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, |
357 | #define M_ASN1_next_prev (*c.q) | 364 | some macros that use ASN1_const_CTX still insist on writing in the input |
365 | stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. | ||
366 | Please? -- Richard Levitte */ | ||
367 | #define M_ASN1_next (*((unsigned char *)(c.p))) | ||
368 | #define M_ASN1_next_prev (*((unsigned char *)(c.q))) | ||
358 | 369 | ||
359 | /*************************************************/ | 370 | /*************************************************/ |
360 | 371 | ||
@@ -551,8 +562,8 @@ err:\ | |||
551 | #define M_ASN1_I2D_finish() *pp=p; \ | 562 | #define M_ASN1_I2D_finish() *pp=p; \ |
552 | return(r); | 563 | return(r); |
553 | 564 | ||
554 | int asn1_GetSequence(ASN1_CTX *c, long *length); | 565 | int asn1_GetSequence(ASN1_const_CTX *c, long *length); |
555 | void asn1_add_error(unsigned char *address,int offset); | 566 | void asn1_add_error(const unsigned char *address,int offset); |
556 | #ifdef __cplusplus | 567 | #ifdef __cplusplus |
557 | } | 568 | } |
558 | #endif | 569 | #endif |