@@ -428,2 +428,4 @@ # node-tpm2 API Reference | ||
| **Windows caveat:** Raw TBS often rejects this command for **owner-range** indices (`0x01800000`–`0x01BFFFFF`) with `MARSHALLING_ERROR` / `TPM_RC` ~`0xA6`, even when the index exists. Factory indices (e.g. EK cert `0x01c00002`) work. After [`tpm.nv.define`](#tpmnvdefineopts-promisevoid), use the known `size` for read/write — the library falls back to owner auth automatically. | ||
| **Flat equivalent:** [`Tpm.nvReadPublic(handle)`](#tpm-nvreadpublic). | ||
@@ -448,3 +450,3 @@ | ||
| **Destructive / privileged:** Consumes TPM NV space until [`tpm.nv.undefine`](#tpmnvundefinehandle-ownerauth). Refuses EK cert indices. **Not for production laptops without intent.** | ||
| **Destructive / privileged:** Consumes TPM NV space until [`tpm.nv.undefine`](#tpmnvundefinehandle-ownerauth). Refuses EK cert indices. **Not for production laptops without intent.** Windows standard user → **`REQUIRES_ELEVATION`** (re-run Admin PowerShell). | ||
@@ -881,3 +883,3 @@ **Flat equivalent:** [`Tpm.nvDefine(opts)`](#tpm-nvdefine). | ||
| § **`nv.define/undefine`:** Owner authorization required; owner NV range only. Destructive on NV space. | ||
| § **`nv.define/undefine`:** Owner authorization required; owner NV range only. Destructive on NV space. Windows standard user → **`REQUIRES_ELEVATION`**. | ||
@@ -884,0 +886,0 @@ Linux requires read/write on `/dev/tpmrm0`. Windows fleet pattern: provision machine AK once elevated → standard users quote forever. |
@@ -7,2 +7,3 @@ #!/usr/bin/env node | ||
| * Requires owner authorization (often empty password on consumer TPMs). | ||
| * Windows: run elevated (Admin); standard user gets REQUIRES_ELEVATION. | ||
| * | ||
@@ -46,3 +47,3 @@ * Usage: | ||
| await tpm.nv.undefine(handle); | ||
| console.log(' (pre-clean undefine OK or index absent)'); | ||
| console.log(' (pre-clean undefine OK)'); | ||
| } catch { | ||
@@ -55,4 +56,14 @@ console.log(' (pre-clean undefine skipped — index may not exist)'); | ||
| const meta = await tpm.nv.readPublic(handle); | ||
| console.log('PASS nv.readPublic', meta); | ||
| try { | ||
| const meta = await tpm.nv.readPublic(handle); | ||
| console.log('PASS nv.readPublic', meta); | ||
| } catch (err) { | ||
| // Windows raw TBS often blocks NV_ReadPublic for owner-range indices (~0xA6); | ||
| // read/write still work via owner auth fallback in the native layer. | ||
| console.log( | ||
| ' (nv.readPublic skipped:', | ||
| err.code ?? err.message, | ||
| '— continuing with define size)', | ||
| ); | ||
| } | ||
@@ -79,3 +90,4 @@ await tpm.nv.write(handle, payload, 0); | ||
| if (err.tpmRc != null) console.error(' tpmRc:', err.tpmRc); | ||
| if (err.hresult != null) console.error(' hresult:', err.hresult); | ||
| process.exit(1); | ||
| }); |
+52
-52
@@ -80,4 +80,4 @@ // prettier-ignore | ||
| const bindingPackageVersion = require('node-tpm2-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -97,4 +97,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -119,4 +119,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-win32-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -136,4 +136,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-windows-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -154,4 +154,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -171,4 +171,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-windows-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -191,4 +191,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -208,4 +208,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -225,4 +225,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -246,4 +246,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -263,4 +263,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -285,4 +285,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -302,4 +302,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -321,4 +321,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -338,4 +338,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -357,4 +357,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -374,4 +374,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -393,4 +393,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -410,4 +410,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -429,4 +429,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -446,4 +446,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -464,4 +464,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -481,4 +481,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -502,4 +502,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -519,4 +519,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -536,4 +536,4 @@ return binding | ||
| const bindingPackageVersion = require('node-tpm2-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.0.5-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| if (bindingPackageVersion !== '0.0.5-beta.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.0.5-beta.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
@@ -540,0 +540,0 @@ return binding |
+10
-10
| { | ||
| "name": "node-tpm2", | ||
| "version": "0.0.5-beta.0", | ||
| "version": "0.0.5-beta.1", | ||
| "description": "TPM 2.0 attestation for Node.js — prebuilt native bindings, PCR quotes, and fleet-ready Windows PCP keys. No tpm2-tools.", | ||
@@ -84,12 +84,12 @@ "type": "module", | ||
| "optionalDependencies": { | ||
| "node-tpm2-windows-x64-msvc": "0.0.5-beta.0", | ||
| "node-tpm2-windows-arm64-msvc": "0.0.5-beta.0", | ||
| "node-tpm2-linux-x64-gnu": "0.0.5-beta.0", | ||
| "node-tpm2-linux-arm64-gnu": "0.0.5-beta.0", | ||
| "node-tpm2-linux-x64-musl": "0.0.5-beta.0", | ||
| "node-tpm2-linux-arm64-musl": "0.0.5-beta.0", | ||
| "node-tpm2-darwin-arm64": "0.0.5-beta.0", | ||
| "node-tpm2-win32-x64-msvc": "0.0.5-beta.0", | ||
| "node-tpm2-win32-arm64-msvc": "0.0.5-beta.0" | ||
| "node-tpm2-windows-x64-msvc": "0.0.5-beta.1", | ||
| "node-tpm2-windows-arm64-msvc": "0.0.5-beta.1", | ||
| "node-tpm2-linux-x64-gnu": "0.0.5-beta.1", | ||
| "node-tpm2-linux-arm64-gnu": "0.0.5-beta.1", | ||
| "node-tpm2-linux-x64-musl": "0.0.5-beta.1", | ||
| "node-tpm2-linux-arm64-musl": "0.0.5-beta.1", | ||
| "node-tpm2-darwin-arm64": "0.0.5-beta.1", | ||
| "node-tpm2-win32-x64-msvc": "0.0.5-beta.1", | ||
| "node-tpm2-win32-arm64-msvc": "0.0.5-beta.1" | ||
| } | ||
| } |
+4
-2
@@ -226,4 +226,6 @@ # node-tpm2 | ||
| **§ `nv.define/undefine`:** Owner NV range only (`0x01800000`–`0x01BFFFFF`). Requires owner authorization (often empty password). **Consumes NV space** until undefined — use only on test machines or with a chosen index. | ||
| **§ `nv.define/undefine`:** Owner NV range only (`0x01800000`–`0x01BFFFFF`). Requires owner authorization (often empty password). **Consumes NV space** until undefined — use only on test machines or with a chosen index. Windows standard user → **`REQUIRES_ELEVATION`** (same TBS block as `pcr.extend`); run Admin PowerShell. | ||
| **Note:** On Windows, raw TBS may reject `nv.readPublic` for owner-range indices (`TPM_RC` ~`0xA6`) even when define/read/write succeed. Factory indices (`0x01c00002` EK cert) work. After `nv.define`, use the known size for read/write; `examples/nv-smoke.mjs` handles this. | ||
| **† `pcr.extend`:** Linux standard user (prefer indices **16–23** for experiments; avoid **0–7** boot/Secure Boot PCRs). **Windows standard user → `REQUIRES_ELEVATION`** (`TPM_E_COMMAND_BLOCKED` from TBS). Windows Administrator can extend on real hardware (validated). Standard-user failure is not `COMMAND_BLOCKED` — re-run elevated. | ||
@@ -383,3 +385,3 @@ | ||
| | `ACCESS_DENIED` | OS denied device or key access | — | sometimes | Linux: `tss` group; container: pass device | | ||
| | `REQUIRES_ELEVATION` | Windows operation needs Admin/SYSTEM | — | ✓ | Re-run enrollment elevated or as SYSTEM; **`pcr.extend` from standard user** | | ||
| | `REQUIRES_ELEVATION` | Windows operation needs Admin/SYSTEM | — | ✓ | Re-run elevated; **`pcr.extend`** and **`nv.define`/`nv.undefine`** from standard user | | ||
| | `COMMAND_BLOCKED` | Windows TBS blocked raw ordinal (e.g. ActivateCredential) | ✓ | — | Use NCrypt PCP — elevation does not help | | ||
@@ -386,0 +388,0 @@ | `NOT_SUPPORTED` | Feature or PCP capability missing on this platform | — | sometimes | — | |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
143023
0.96%1550
0.78%476
0.42%63
1.61%