HomePhabricator

modernize DecodeBase{32,64}, reject incorrect base64 in HTTP auth

Description

modernize DecodeBase{32,64}, reject incorrect base64 in HTTP auth

Summary:

Reject incorrect base64 in HTTP auth

In addition, to make sure that no call site ignores the invalid
decoding status, make the pf_invalid argument mandatory.

https://github.com/bitcoin/bitcoin/pull/25001/commits/a4377a0843636eae0aaf698510fc6518582545db

Make DecodeBase{32,64} always return vector, not string

Base32/base64 are mechanisms for encoding binary data. That they'd
decode to a string is just bizarre. The fact that they'd do that
based on the type of input arguments even more so.

https://github.com/bitcoin/bitcoin/pull/25001/commits/a65931e3ce66d87b8f83d67ecdbb46f137e6a670

Make DecodeBase{32,64} return optional instead of taking bool*

https://github.com/bitcoin/bitcoin/pull/25001/commits/78f3ac51b7d073d12da6a3b9b7d80d91e04ce3a7

This is a partial backport of core#25001

Depends on D17148

Test Plan: ninja all check-all bitcoin-fuzzers

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17149

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Apr 9 2022, 03:17
PiRKCommitted on Mon, Nov 18, 10:22
PiRKPushed on Mon, Nov 18, 10:22
Reviewer
Restricted Project
Differential Revision
D17149: modernize DecodeBase{32,64}, reject incorrect base64 in HTTP auth
Parents
rABCdad4fd9df468: Make strencodings functions use string_view
Branches
Unknown
Tags
Unknown