X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fx509%2Fasn1.t0;h=ba59252632e9cfc85ee6ab9e6a7b3a9b21206689;hp=1b3313afb4d35759c5122e26fb4812652395c725;hb=05520e8eae3d8c6039e8bcde58741cf4ffb18f1d;hpb=9e71c0673a9f46f82e43125919619f296698292e;ds=sidebyside diff --git a/src/x509/asn1.t0 b/src/x509/asn1.t0 index 1b3313a..ba59252 100644 --- a/src/x509/asn1.t0 +++ b/src/x509/asn1.t0 @@ -198,12 +198,12 @@ cc: set8 ( val addr -- ) { cc: set16 ( val addr -- ) { uint32_t addr = T0_POP(); - *(uint16_t *)((unsigned char *)CTX + addr) = T0_POP(); + *(uint16_t *)(void *)((unsigned char *)CTX + addr) = T0_POP(); } cc: set32 ( val addr -- ) { uint32_t addr = T0_POP(); - *(uint32_t *)((unsigned char *)CTX + addr) = T0_POP(); + *(uint32_t *)(void *)((unsigned char *)CTX + addr) = T0_POP(); } cc: get8 ( addr -- val ) { @@ -213,12 +213,12 @@ cc: get8 ( addr -- val ) { cc: get16 ( addr -- val ) { uint32_t addr = T0_POP(); - T0_PUSH(*(uint16_t *)((unsigned char *)CTX + addr)); + T0_PUSH(*(uint16_t *)(void *)((unsigned char *)CTX + addr)); } cc: get32 ( addr -- val ) { uint32_t addr = T0_POP(); - T0_PUSH(*(uint32_t *)((unsigned char *)CTX + addr)); + T0_PUSH(*(uint32_t *)(void *)((unsigned char *)CTX + addr)); } \ Read an ASN.1 tag. This function returns the "constructed" status @@ -278,13 +278,13 @@ cc: get32 ( addr -- val ) { 0x80 - dup ifnot ERR_X509_INDEFINITE_LENGTH fail then \ Masking out bit 7, this yields the number of bytes over which - \ the value is encoded. Since the total certicate length must + \ the value is encoded. Since the total certificate length must \ fit over 3 bytes (this is a consequence of SSL/TLS message \ format), we can reject big lengths and keep the length in a \ single integer. { n } 0 begin n 0 > while n 1- >n - dup 0xFFFFFF > if ERR_X509_INNER_TRUNC fail then + dup 0x7FFFFF > if ERR_X509_INNER_TRUNC fail then 8 << swap read8 rot + repeat ;