Skip to content

Replace `base64` crate with `base64ct` crate in `tor-netdoc`

arturomf94 requested to merge arturomf94/arti:tor-netdoc/use-base64ct into main

In issue #154 (closed) we discussed the impracticality of adding the pem-rfc7468 crate as a replacement for the current PEM implementation in tor-netdoc. In particular, the source of its impracticality comes from the fact that RFC 7468 is "too strict", in the sense that it rejects any input that does not have a 64-column-wide text.

As @nickm mentioned in this comment, our best move, considering the above, would be to at least use the base64ct crate. These changes pick-up the work done by @pastly here, with the updated version of base64ct.

Note: it seems that this issue raised by @pastly in the base64ct repo was not actually solved upstream, as we had thought. The alleged fix only worked for padded decodings... However, I've re-raised the issue for this to be extended to unpadded inputs. I will try to work on the extension myself, but, in the meantime, these changes should help.

Merge request reports

Loading