Resolve only white space changes on a previously applied patch resolving a
CVE where my version looked slightly different.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Remove the TABLE_DRIVEN_DISPATCH build switch that was set to 'YES'.
Remove code that assumed it to be set to 'NO'.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Upstream has gotten rid of the IS_IMPLEMENTED flag but upstream is also
using compressed lists where each element in the command lists represents
an implemented command. Libtpms does not use compressed lists but we may
have a list with gaps in it due to unimplemented commands where this flag
may be the only one set and help identify an implemented command. However,
since profiles indicate enablement and implementation of commands, and
nearly all tests for the IS_IMPLEMENTED flag are paired with a check on
the profile with RuntimeCommandsCheckEnabled(), we can get rid of tests for
IS_IMPLEMENTED and finally the flag altogether since it is redundant.
Also get rid of NOT_IMPLEMENTED flag that was not used anywhere.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Now that Helpers.c is clean of contributions, change its license to
BSD-2-clause. Change license in some other files as well.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Remove the contributed conditional compilation of a TDES related function
and fields in a structure based on definition of ALG_TDES.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Implement the retrieval of the updated IV in a single function which is
to be called after a symmetric key encryption or decryption operation.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
To get some files into the state so that they can be easily replaced with
the BSD-licensed code, revert:
- spelling changes that were introduced by nicolas.iooss@ledger.fr in
bbd7b75d71. Many of the changes introduced in that change were replaced
in subsequence changes with the original spelling errors in the upstream
code.
- LibreSSL support introduced by orbea <orbea@riseup.net> in 95fff22c9b
and 7310725524.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
TPM_WINDOWS is not set anywhere in the build system and therefore assumed
to not be used. We can get rid of whatever assumed it may have been set.
Also rool back some other changes to Windows-specific code.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reduce the diff with upstream by removing the usage of variable 'irc' and
apply the assert right to the fseek statement.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Upstream uses a cast to 'int', which is not right, since the datatype of
availRAMSpaxe is a UINT32. Therefore, set the cast of the calculation to
UINT32.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
NTC2 vendor commands are not supported. Entirely remove their definition to
reduce diffs with 'upstream'.
Mark CC_Policy_AC_SendSelect as changed by libtpms.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
The forward reference for tpmCryptKeySchedule_t does not need to be
commented. This reduces the diff with 'upstream'.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Upstream defines all marshalling and unmarshalling prototypes in
Marshal_fp.h, inlcuding this header from Marshal.h. Since we have
Unmarshal_fp.h, include it also from Marshal.h. Adapt some other
code to these changes.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Move the block checking for a NULL pointer returned from strndup() up
so that we do not pass the NULL pointer in a call to
RuntimeProfileDedupStrItems().
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Fix a compilation error that newer gcc versions may complain about:
tpm_library.c: In function 'TPMLIB_GetPlaintext':
tpm_library.c:441:11: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
441 | start = strstr(stream, starttag);
| ^
At top level:
cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Fix the retrieval of the updated IV for when OpenSSL >= 3.0 is used.
The previously used OSSL_PARAM_octet_ptr allocated a new buffer and then
returned the IV but this newly allocated buffer did not make it back to
the caller. We have to use OSSL_PARAM_octet_string instead to write the
data into the buffer.
Resolves: https://github.com/stefanberger/libtpms/issues/541
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Due to the license change in the 'new' upstream repo (versus the 'old'
upstream repo), remove the SM4 support contributed under the previous
license. We can remove this since SM4 is not enabled by default.
SM4 support can be re-added under BSD license before the next release.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Due to the license change in the 'new' upstream repo (versus the 'old'
upstream repo), remove the Camellia-192 test cases contributed under the
previous license. The test will be re-added from data generated by the
script src/tpm2/gensymtestdata.sh before the next release.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
With LibreSSL 4.2.0 the THIRTY_TWO_BIT and SIXTY_FOUR_BIT_LONG defines
were removed, but BN_BITS2 has the correct value for RADIX_BITS.
Signed-off-by: orbea <orbea@riseup.net>
The manpages include the current build date, so they are not reproducible.
If defined, use the SOURCE_DATE_EPOCH as defined here:
https://reproducible-builds.org/docs/source-date-epoch/
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>