We'd like to be able to fully refactor lighttpd's algo_md5 module into safe Rust. This tracking issue covers analysis features that will be required to support that:
[x] Casts from Single to non-SingleQuantity. This may be a bug, possibly with our handling of array.as_mut_ptr(); if the cast's output has PermissionSet::OFFSET (causing it to have non-SingleQuantity), then the input should have that permission as well.
[ ] Investigate to determine why the analysis wants to insert this cast
[ ] void* arguments for local functions. Specifically, MD5_Update takes a pointer to bytes as the argument void* _input.
[ ] Track concrete pointee types through void* and char* casts
[ ] Rewrite argument types from *mut c_void to a more specific safe type
[ ] Rewrite memcpy into copy_from_slice.
[ ] Rewrite memset(&s, 0, sizeof(s)) into zero-initialization of each field of s.
[x] Fix unsupported cast kind: TypeDesc
[ ] Investigate further - which TypeDescs is it failing on?
[x] Fix unlower_map has no origin - possibly fixed by #1020
[x] Figure out why the context pointer is getting OFFSET permission in several functions
[ ] Fix bad cast in MD5_Update's call to li_MD5Transform:
// old:
((*context).buffer).as_mut_ptr() as *const libc::c_uchar
// new:
&*(&mut (((*context).buffer)) as &mut [u8]) as *const libc::c_uchar
The final ... as *const libc::c_uchar should be removed.
We'd like to be able to fully refactor lighttpd's
algo_md5
module into safe Rust. This tracking issue covers analysis features that will be required to support that:Single
to non-Single
Quantity
. This may be a bug, possibly with our handling ofarray.as_mut_ptr()
; if the cast's output hasPermissionSet::OFFSET
(causing it to have non-Single
Quantity
), then the input should have that permission as well.void*
arguments for local functions. Specifically,MD5_Update
takes a pointer to bytes as the argumentvoid* _input
.void*
andchar*
casts*mut c_void
to a more specific safe typememcpy
intocopy_from_slice
.memset(&s, 0, sizeof(s))
into zero-initialization of each field ofs
.unsupported cast kind: TypeDesc
TypeDesc
s is it failing on?unlower_map has no origin
- possibly fixed by #1020context
pointer is gettingOFFSET
permission in several functionsMD5_Update
's call toli_MD5Transform
:The final
... as *const libc::c_uchar
should be removed.