No Issue - Fixes for building with LLVM 19 included with FreeBSD 13.5. Fix a conflict with libc++ 19 and the old Mozilla (re)alloc macros. LLVM 18+ does not allow std::char_traits<unsigned char> so avoid it. https://bugzilla.mozilla.org/show_bug.cgi?id=1849070 Partial NSS upgrade to replace ByteString with a class. https://bugzilla.mozilla.org/show_bug.cgi?id=1851092

This commit is contained in:
Brian Smith 2025-05-05 13:12:42 -05:00 committed by roytam1
commit e8b3077d4f
3 changed files with 48 additions and 7 deletions

View file

@ -35,7 +35,31 @@ namespace mozilla {
namespace pkix {
namespace test {
typedef std::basic_string<uint8_t> ByteString;
class ByteString : public std::string {
public:
ByteString() {}
ByteString(size_t count, uint8_t value) : std::string(count, char(value)) {}
explicit ByteString(const uint8_t* data)
: std::string(reinterpret_cast<const char*>(data)) {}
ByteString(const uint8_t* data, size_t length)
: std::string(reinterpret_cast<const char*>(data), length) {}
ByteString operator+(const ByteString& rhs) const {
ByteString result = *this;
result.std::string::append(rhs);
return result;
}
const uint8_t* data() const {
return reinterpret_cast<const uint8_t*>(std::string::data());
}
void assign(const uint8_t* data, size_t length) {
std::string::assign(reinterpret_cast<const char*>(data), length);
}
void append(const ByteString& other) { std::string::append(other); }
void append(const uint8_t* data, size_t length) {
std::string::append(reinterpret_cast<const char*>(data), length);
}
void push_back(uint8_t c) { std::string::push_back(char(c)); }
};
inline bool ENCODING_FAILED(const ByteString& bs) { return bs.empty(); }