The contents are verified and compared, and both the expected and
actual SHA-1s are printed. If any of the SHA-1s fail, an error code
is returned.
The previous commit, which fixed data copying, was committed before
this commit, though I had already written the SHA-1 code. That's how
I found out the data copying was broken: SHA-1s in the resigned WADs
were completely broken, even though the originals were fine.
TODO: Check how block alignment works with early devkit WADs.
The WADs actually use CA/TMD/Ticket ordering, not CA/Ticket/TMD.
Fixed a copy/paste issue that caused debug certificates to be used
when resigning to retail.
- Determine the key to use when getting the ticket and
TMD issuers.
- Moved the invalid common key index warning from resign_wad()
to print_wad_info().
- New verify_content() function that doesn't do anything yet.
Currently writes the WAD header and certificate chain, including the
extra debug certificate if recrypting as debug.
TODO:
- Write the extra debug certificate when recrypting discs.
- Verify certificate chain ordering for discs. For WADs, it's
CA, ticket, TMD, dev; for discs, it seems to be ticket, CA, TMD.
- Convert early WAD headers to final. This also requires converting
the name, if present, to a footer.
It seems that without the spaces, use of ALIGN() with offsetof() causes
an error in MSVC 2010:
..\..\..\src\librvth\recrypt.cpp(563): error C2102: '&' requires l-value
MSVC Secure Overloads will change strncpy() to strncpy_s(), which
doesn't clear the buffer. Hence, we'll need to explicitly clear
the buffer ourselves.
Note that this shouldn't usually be a problem, since the issuer length
is the same for both retail and debug.
Moved the crypto type, signature type, and signature status enums here.
Renamed them to have RVL_ prefixes instead of RVTH_/RvtH_.
Added functions to convert the enums to strings.
sig_verify(): Wrapper around cert_verify() that returns an RVL_SigType_e
value.
All RVT-H functions that operated directly on an RVT-H obejct are
now member functions.
Moved some accessor functions to the class declaration in rvth.hpp.
rvth_open() and rvth_create_gcm() are now RvtH constructors.
extract_crypt.h, rvth_p.h: Deleted. These declarations are now in
rvth.hpp.
Removed the "rvth_" prefix from some of the source files, since it's
redundant.
Some fixes here and there for memory leaks and/or error correctness.
Remove the TODO and set the bank entry status correctly.
The bank entry status probably isn't too important right now with the
command line rvthtool, but it might be important later with qrvthtool.
- Moved the files to a subdirectory.
- Renamed the files to match the class names.
Renamed various other .c files to .cpp in order to use the new
C++ Reader base class.
This is the first step in porting librvth to C++, which will make it
easier to maintain. For example, it will allow us to add Apploader
DOL verification for encrypted images more easily, since we will be
able to layer a decrypted partition reader, similar to rom-properties.
Renamed many files to .cpp in order to compile as C++.
TODO:
- RefFile's wrapper functions still use errno instead of m_lastError.
- Remove the C compatibility hack later. (`struct RefFile;`)
Based on the same classes from mcrecover.
TODO:
- Add some translations.
- Persistent configuration. I don't think porting mcrecover's ConfigStore
is the right thing to do here.
Forgot to update this when adding the Wii icons earlier.
This should have been done in commit e822d9042f.
([qrvthtool] Added icons for Wii, RVT-R Reader, and RVT-H Reader.)
IDI_APPLICATION is defined in Windows headers as the "default" application
icon, with resource ID 32512.
resource.rc: IDI_QRVTHTOOL, not IDI_KEY_VALID. Besides the fact that this
is wrong (and is a copy/paste error from rom-properties), this caused the
icon to be defined using a name instead of an ID.