Skip to content

Commit

Permalink
An attempt to fix building, pt. 3
Browse files Browse the repository at this point in the history
  • Loading branch information
xaionaro committed Apr 17, 2021
1 parent 871361b commit ae6f8bc
Show file tree
Hide file tree
Showing 11 changed files with 1,801 additions and 5,163 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ generate:

hacks:
sed -r -e 's/Unsafe\.Pointer/UnsafePointer/' -e 's/chandles C\.TSS2_TCTI_POLL_HANDLE/chandles *C.TSS2_TCTI_POLL_HANDLE/g' -i go_tpm2_tss/cgo_helpers.go
sed -r -e "s/import \"C\"/import \"C\"\nimport (\"fmt\"\n\"runtime\"\n\"sync\"\n\"unsafe\"\n)/g" -i go_tpm2_tss/cgo_helpers.go
sed -r -e 's/TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9\(TSS2_TCTI_CONTEXT\* tctiContext, void\* handles, unsigned long int\* num_handles\)/TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9(TSS2_TCTI_CONTEXT* tctiContext, TSS2_TCTI_POLL_HANDLE* handles, unsigned long int* num_handles)/g' -i go_tpm2_tss/cgo_helpers.[ch]

fmt:
Expand Down
2 changes: 1 addition & 1 deletion c
Submodule c updated 362 files
19 changes: 12 additions & 7 deletions go-tpm2-tss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ GENERATOR:
- tss2-tcti-mssim
- tss2-tcti-device
- tss2-mu
- tss2-fapi
- tss2-tctildr
- tss2-rc
- tss2-sys
- tss2-esys
Includes:
- tss2/tss2_common.h
- tss2/tss2_esys.h
- tss2/tss2_fapi.h
- tss2/tss2_mu.h
- tss2/tss2_rc.h
- tss2/tss2_sys.h
Expand All @@ -38,7 +36,6 @@ PARSER:
SourcesPaths:
- c/include/tss2/tss2_common.h
- c/include/tss2/tss2_esys.h
- c/include/tss2/tss2_fapi.h
- c/include/tss2/tss2_mu.h
- c/include/tss2/tss2_rc.h
- c/include/tss2/tss2_sys.h
Expand All @@ -48,6 +45,7 @@ PARSER:
- c/include/tss2/tss2_tcti_mssim.h
- c/include/tss2/tss2_tcti_tbs.h
- c/include/tss2/tss2_tpm2_types.h
#- c/include/tss2/tss2_fapi.h
#- c/include/tss2/tss2_tcti_swtpm.h
#- c/include/tss2/tss2_tcti_cmd.h
#- c/include/tss2/tss2_tcti_pcap.h
Expand All @@ -62,19 +60,26 @@ TRANSLATOR:
- {target: ".*", tips: [ref, arr, arr, arr, arr]}
MemTips:
- {target: ".*", self: raw}
TypeTips:
function:
- {target: "^TSS2_TCTI_INIT_FUNC", self: plain, tips: [plain, plain, plain, plain]}
Rules:
global:
- {transform: lower}
- {transform: export}
- {action: ignore, from: "^TSS2_ABI_VERSION_CURRENT"}
- {action: ignore, from: "^__flexarr"}
- {action: ignore, from: "^__pthread_cond_s"}
- {action: ignore, from: "^__PTHREAD_RWLOCK_ELISION_EXTRA"}
- {action: ignore, from: "^__GO__"}
- {action: ignore, from: "^__"}
- {action: ignore, from: ".*select.*"}
- {action: ignore, from: "^q.cvt.*"}
- {action: ignore, from: "^str.*"}
- {action: ignore, from: "^(on_|at|)exit.*"}
- {action: ignore, from: "^qsort.*"}
- {action: ignore, from: "^bsearch.*"}
- {action: ignore, from: "^(m|re|c)alloc.*"}
- {action: ignore, from: "^(PRI|SCN)[diouxX].*"}
- {action: ignore, from: "^Tss2_Tcti_Tbs_Init"}
- {action: ignore, from: "^Tss2_MU_TPMU_ENCRYPTED_SECRET_(Marshal|Unmarshal)"}
#- {action: ignore, from: "^TSS2_TCTI_(INFO_FUNC|TRANSMIT_FCN|RECEIVE_FCN|FINALIZE_FCN|CANCEL_FCN|GET_POLL_HANDLES_FCN|SET_LOCALITY_FCN|MAKE_STICKY_FCN|INIT_FUNC).*"}
- {action: accept, from: "^.*"}
const: []
type: []
Expand Down
22 changes: 1 addition & 21 deletions go_tpm2_tss/cgo_helpers.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// License: CC-0

// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 18:18:20 IST.
// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 19:11:08 IST.
// Code generated by https://git.io/c-for-go. DO NOT EDIT.

#include "_cgo_export.h"
Expand Down Expand Up @@ -42,26 +42,6 @@ TSS2_TCTI_INFO* TSS2_TCTI_INFO_FUNC_3ab67cd0() {
return tss2TctiInfoFunc3AB67CD0();
}

unsigned int Fapi_CB_Auth_4bc69268(FAPI_CONTEXT* context, char* description, char** auth, void* userData) {
return fapiCbAuth4BC69268(context, description, auth, userData);
}

unsigned int Fapi_CB_Branch_a8bbee51(FAPI_CONTEXT* context, char* description, char** branchNames, unsigned long int numBranches, unsigned long int* selectedBranch, void* userData) {
return fapiCbBranchA8BBEE51(context, description, branchNames, numBranches, selectedBranch, userData);
}

unsigned int Fapi_CB_Sign_2c66b3cf(FAPI_CONTEXT* context, char* description, char* publicKey, char* publicKeyHint, unsigned int hashAlg, unsigned char* dataToSign, unsigned long int dataToSignSize, unsigned char** signature, unsigned long int* signatureSize, void* userData) {
return fapiCbSign2C66B3CF(context, description, publicKey, publicKeyHint, hashAlg, dataToSign, dataToSignSize, signature, signatureSize, userData);
}

unsigned int Fapi_CB_PolicyAction_d83965a7(FAPI_CONTEXT* context, char* action, void* userData) {
return fapiCbPolicyactionD83965A7(context, action, userData);
}

int __compar_fn_t_60e030d6(void* arg0, void* arg1) {
return _ComparFnT60E030D6(arg0, arg1);
}

char* TSS2_RC_HANDLER_c80e0a42(unsigned int rc) {
return tss2RcHandlerC80E0A42(rc);
}
Expand Down
Loading

0 comments on commit ae6f8bc

Please sign in to comment.