X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Frand%2Frand_vms.c;h=0bfd8ff7e462a3c52be553dbda7206878e932268;hb=32cf5baeae21774db04af2ad2d74567a617c6fec;hp=3e95651e580548f31572d859dc02d03e847ff4a9;hpb=bb5b16a36cf67530c1222297f44b3f661f5105af;p=oweals%2Fopenssl.git diff --git a/crypto/rand/rand_vms.c b/crypto/rand/rand_vms.c index 3e95651e58..0bfd8ff7e4 100644 --- a/crypto/rand/rand_vms.c +++ b/crypto/rand/rand_vms.c @@ -69,6 +69,17 @@ # pragma message disable DOLLARID #endif +/* Use 32-bit pointers almost everywhere. Define the type to which to + * cast a pointer passed to an external function. + */ +#if __INITIAL_POINTER_SIZE == 64 +# define PTR_T __void_ptr64 +# pragma pointer_size save +# pragma pointer_size 32 +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define PTR_T void * +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + static struct items_data_st { short length, code; /* length is amount of bytes */ @@ -101,13 +112,16 @@ int RAND_poll(void) pitem = item; /* Setup */ - while (pitems_data->length) + while (pitems_data->length + && (total_length + pitems_data->length <= 256)) { pitem->length = pitems_data->length; pitem->code = pitems_data->code; - pitem->buffer = (long *)data_buffer[total_length]; + pitem->buffer = (long *)&data_buffer[total_length]; pitem->retlen = 0; total_length += pitems_data->length; + pitems_data++; + pitem++; } pitem->length = pitem->code = 0; @@ -117,16 +131,17 @@ int RAND_poll(void) * However, view the information as only half trustable. */ pid = -1; /* search context */ - while ((status = SYS$GETJPIW(8, &pid, 0, item, iosb, 0, 0)) + while ((status = sys$getjpiw(0, &pid, 0, item, iosb, 0, 0)) != SS$_NOMOREPROC) { if (status == SS$_NORMAL) { - RAND_add(data_buffer, total_length, total_length/2); + RAND_add( (PTR_T)data_buffer, total_length, + total_length/2); } } - SYS$GETTIM(iosb); - RAND_add((unsigned char *)iosb, sizeof(iosb), sizeof(iosb)/2); + sys$gettim(iosb); + RAND_add( (PTR_T)iosb, sizeof(iosb), sizeof(iosb)/2); return 1; }