Comments (3)
Hi @horver ,
This is because the auth is not set in the case when wolfTPM2_NVCreateAuth
is called and the handle already exists.
The right solution would be to call wolfTPM2_NVReadPublic
first to see if it exists. If it does then you'll need to set the NV handle like this:
nv.handle.hndl = (TPM_HANDLE) 0x01800000;
nv.handle.auth.size = sizeof(gNvAuth) - 1;
XMEMCPY(nv.handle.auth.buffer, gNvAuth, nvhandle.auth.size);
Then call wolfTPM2_NVReadAuth
.
You do bring up a good improvement that could be made to the wrapper, so I've pushed a PR here:
#99
Thanks,
David Garske, wolfSSL
from wolftpm.
Thank you very much for your answer and the quick fix!
Now I understand the mechanism and it works! :)
from wolftpm.
Hi @horver,
This also means, you should handle the return code TPM_RC_NV_DEFINED
in your application not as error case. After #99 the wrapper now sets the auth and you can perform the NVReadAuth.
Of course, you are left with the challenge to know that you are the owner of this NV field. This is why you should check the outcome of NV_ReadAuth to figure if the NV field written matches your auth, thus verifying "aha , this is my field and the value inside is the one i stored" :)
ps: @dgarske nice fix! Simple and quick.
from wolftpm.
Related Issues (20)
- Add TPM 2.0 example for seal and unseal (using PCR) HOT 3
- Add TPM 2.0 Parameter Encryption support HOT 4
- TPM2_GetTag does not return TPM_ST_SESSIONS when required HOT 1
- Expired wolfSSL CA certificate used in examples
- I2C driver for Nuvoton NPCT75x TPM2.0 module HOT 6
- Add a TPM signature verifier example
- Can't clear TPM chip HOT 2
- git commit fails even though no change was made HOT 3
- Build errors
- wolftpm C# wrapper needs to implement IDisposable instead of using Finalizer. HOT 2
- Error handling in C# wrapper HOT 2
- Fix the maximum clock speed for SLB9672
- wolfTPM is not thread-safe (`gActiveTPM` ought to be a thread-local) HOT 5
- Add more examples: TPM2_ActivateCredential() HOT 1
- Software-only implementations of TPM2_Duplicate() and TPM2_MakeCredential() HOT 1
- Response to TCG TPM2.0 Errata ID: TCGVRT0007 and CVE-2023-1017 and CVE-2023-1018 HOT 1
- How to go through wolfTPM2_Init with gdb HOT 7
- Building in MSYS2: undefined reference to `__imp_wolfSSL.._ HOT 10
- keygen -rsa -eh failed with TPM_RC_BAD_AUTH HOT 7
- Stuck in TPM2_Startup(&startupIn) function HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wolftpm.