X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fcodec%2Fpemdec.c;h=51e610b5b153d60738e70b9d8c47af7c29968130;hp=362311719e981cb53ecdfdac7e4738a923928465;hb=5414fd525e903fe65e372735f106dcdc19109aad;hpb=292f43357850dbadd1f7e8a343415a707af3a800 diff --git a/src/codec/pemdec.c b/src/codec/pemdec.c index 3623117..51e610b 100644 --- a/src/codec/pemdec.c +++ b/src/codec/pemdec.c @@ -58,7 +58,7 @@ t0_parse7E_signed(const unsigned char **p) #define T0_INT4(x) T0_VBYTE(x, 21), T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0) #define T0_INT5(x) T0_SBYTE(x), T0_VBYTE(x, 21), T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0) -static const uint8_t t0_datablock[]; +/* static const unsigned char t0_datablock[]; */ void br_pem_decoder_init_main(void *t0ctx); @@ -109,12 +109,12 @@ br_pem_decoder_event(br_pem_decoder_context *ctx) -static const uint8_t t0_datablock[] = { +static const unsigned char t0_datablock[] = { 0x00, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x42, 0x45, 0x47, 0x49, 0x4E, 0x20, 0x00, 0x2D, 0x2D, 0x2D, 0x2D, 0x45, 0x4E, 0x44, 0x20, 0x00 }; -static const uint8_t t0_codeblock[] = { +static const unsigned char t0_codeblock[] = { 0x00, 0x01, 0x00, 0x09, 0x00, 0x00, 0x01, 0x01, 0x07, 0x00, 0x00, 0x01, 0x01, 0x08, 0x00, 0x00, 0x13, 0x13, 0x00, 0x00, 0x01, T0_INT2(offsetof(br_pem_decoder_context, event)), 0x00, 0x00, 0x01, @@ -225,6 +225,8 @@ name(void *ctx) \ T0_DEFENTRY(br_pem_decoder_init_main, 38) +#define T0_NEXT(t0ipp) (*(*(t0ipp)) ++) + void br_pem_decoder_run(void *t0ctx) { @@ -272,15 +274,17 @@ br_pem_decoder_run(void *t0ctx) #define T0_CO() do { \ goto t0_exit; \ } while (0) -#define T0_RET() break +#define T0_RET() goto t0_next dp = ((t0_context *)t0ctx)->dp; rp = ((t0_context *)t0ctx)->rp; ip = ((t0_context *)t0ctx)->ip; + goto t0_next; for (;;) { uint32_t t0x; - t0x = t0_parse7E_unsigned(&ip); + t0_next: + t0x = T0_NEXT(&ip); if (t0x < T0_INTERPRETED) { switch (t0x) { int32_t t0off;