Conversation
'error: function declaration isn't a prototype [-Werror=strict-prototypes]' TrustedComputingGroup/TPM-Internal@dbcbb61 Signed-off-by: Joe Richey <joerichey@google.com>
In OpenSSL, `BIGNUM` is defined as: ```c typedef struct bignum_st BIGNUM; ``` in https://github.com/openssl/openssl/blame/openssl-3.6.0/include/openssl/types.h#L96 This opaque type is defined as ```c struct bignum_st { BN_ULONG *d; int top; int dmax; int neg; int flags; }; ``` in an internal header https://github.com/openssl/openssl/blob/openssl-3.6.0/crypto/bn/bn_local.h#L245-L256 Thus, on every OpenSSL version, we need to check that the definition is unchanged. For OpenSSL 3.6, it is unchanged, so we increment the minimum unsupported version to 3.7. TrustedComputingGroup/TPM-Internal@0b95067 Signed-off-by: Joe Richey <joerichey@google.com>
In C, empty parameter lists require `void` in the declaration. This change also gives `UpgradeNvData` internal linkage as it is not (yet) part of the Platform API. TrustedComputingGroup/TPM-Internal@8b1dc3a Signed-off-by: Joe Richey <joerichey@google.com>
This causes a warning (`-Wnewline-eof`) with some compilers/configurations. For future files, this should be caught by the clang-format presubmit hook. This was generated by running: ```bash sed -i '$a\' **/*.h **/*.c ``` TrustedComputingGroup/TPM-Internal@471cf6f Signed-off-by: Joe Richey <joerichey@google.com>
This was added in C99, and lets us avoid environment specific `ifdef`s. TrustedComputingGroup/TPM-Internal@023eebd Signed-off-by: Joe Richey <joerichey@google.com>
This change: - Makes the formatting consistent by removing helper macros - Adds comments containing the decimal OID for each value - Makes the file easier to read by adding more OID prefix constants - Follows up on a comment to confirm an OID value TrustedComputingGroup/TPM-Internal#451 Signed-off-by: Joe Richey <joerichey@google.com>
This change deletes all the code for CertifyX509 (which was deprecated in the 184 spec). Note that the attribute `TPM_A_OBJECT.x509Sign` sticks around. We anticipate re-using it in the future with a differently designed command. TrustedComputingGroup/TPM-Internal#367 Signed-off-by: Joe Richey <joerichey@google.com>
Similar to `NORETURN`, this uses `FALLTHROUGH` as a placeholder for `[[fallthrough]]` until C23 is supported. TrustedComputingGroup/TPM-Internal#450 Signed-off-by: Joe Richey <joerichey@google.com>
When binding to the reference implementation, while it is convient to have ACT support enabled by default, having two ACTs on by default is very odd. On systems with ACTs, the vast majority will have only one. TrustedComputingGroup/TPM-Internal#524 Signed-off-by: Joe Richey <joerichey@google.com>
| #if defined _POSIX_ | ||
| # define FUNCTION_NAME 0 | ||
| #else | ||
| # define FUNCTION_NAME __FUNCTION__ |
Collaborator
There was a problem hiding this comment.
Not ssure about this. there are some posix-strict implementations. Do they require this? or does the change to C11 change this on POSIX?
| #define TPM_CC_AC_GetCapability (TPM_CC)(0x00000194) | ||
| #define TPM_CC_AC_Send (TPM_CC)(0x00000195) | ||
| #define TPM_CC_Policy_AC_SendSelect (TPM_CC)(0x00000196) | ||
| #define TPM_CC_CertifyX509 (TPM_CC)(0x00000197) |
Collaborator
There was a problem hiding this comment.
At very least we should leave a define that marks 0x197 forever reserved.
| + CC_AC_GetCapability /* 0x00000194 */ \ | ||
| + CC_AC_Send /* 0x00000195 */ \ | ||
| + CC_Policy_AC_SendSelect /* 0x00000196 */ \ | ||
| + CC_CertifyX509 /* 0x00000197 */ \ |
Collaborator
There was a problem hiding this comment.
ditto on reserved placeholder. we don't want anyone to think its a usable gap, or worse "fix" the comments.
| return result; | ||
| } | ||
|
|
||
| #endif // CC_ECDH_KeyGen No newline at end of file |
Collaborator
There was a problem hiding this comment.
could/should we fix all these line ending changes in a single/separate "format-only" change?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See the individual commit messages for more information about each change.
The main thing this does it allow the Reference Code to be built without warnings on C11 and to Support OpenSSL 3.6.
Other that that, there are two functional changes:
TPM2_CertifyX509(deprecated inv184)TPM_RH_ACT_0by default (instead of also enablingTPM_RH_ACT_A)