File tree 2 files changed +3
-31
lines changed
2 files changed +3
-31
lines changed Original file line number Diff line number Diff line change @@ -34,35 +34,6 @@ First install latest `tpm2_tools`
34
34
# # install latest tpm2-tools:
35
35
# ### https://github.com/salrashid123/tpm2/tree/master?tab=readme-ov-file#installing-tpm2_tools-golang
36
36
# ### https://tpm2-tools.readthedocs.io/en/latest/INSTALL/
37
-
38
- apt-get update
39
-
40
- apt -y install autoconf-archive libcmocka0 libcmocka-dev procps \
41
- iproute2 build-essential git pkg-config gcc libtool automake \
42
- libssl-dev uthash-dev autoconf doxygen libcurl4-openssl-dev dbus-x11 libglib2.0-dev libjson-c-dev acl
43
-
44
- cd
45
- git clone https://github.com/tpm2-software/tpm2-tss.git
46
- cd tpm2-tss
47
- ./bootstrap
48
- ./configure --with-udevrulesdir=/etc/udev/rules.d
49
- make -j$( nproc)
50
- make install
51
- udevadm control --reload-rules && sudo udevadm trigger
52
- ldconfig
53
-
54
- cd
55
- git clone https://github.com/tpm2-software/tpm2-tools.git
56
- cd tpm2-tools
57
- ./bootstrap
58
- ./configure
59
- make check
60
- make install
61
-
62
- # # install golang
63
- wget https://go.dev/dl/go1.22.3.linux-amd64.tar.gz
64
- rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.3.linux-amd64.tar.gz
65
- export PATH=$PATH :/usr/local/go/bin
66
37
```
67
38
68
39
``` bash
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ func NewTPMCrypto(conf *TPM) (TPM, error) {
89
89
// if an actual device is specified, its externally managed
90
90
// so the auth handle shoud've been initialzied before this
91
91
if conf .TpmDevice != nil {
92
- if conf .AuthHandle == nil || conf . TpmDevice == nil {
92
+ if conf .AuthHandle == nil {
93
93
return TPM {}, fmt .Errorf ("salrashid123/x/oauth2/google: AuthHandle and TpmDevice must be specified" )
94
94
}
95
95
rwr = transport .FromReadWriter (conf .TpmDevice )
@@ -98,7 +98,7 @@ func NewTPMCrypto(conf *TPM) (TPM, error) {
98
98
// otherwise, its a library managed call
99
99
// here we'll open up the tpm and read in the
100
100
// persistent handle
101
- // after enabling for if any password or pcr policies
101
+ // after enabling for if any password or pcr policies, we'll read the public key..then
102
102
// wer'e going to close the tpm after this function call
103
103
rwc , err := OpenTPM (conf .TpmPath )
104
104
if err != nil {
@@ -165,6 +165,7 @@ func NewTPMCrypto(conf *TPM) (TPM, error) {
165
165
166
166
}
167
167
168
+ // todo: we should supply the encrypted session here, if set
168
169
pub , err := tpm2.ReadPublic {
169
170
ObjectHandle : ah .Handle ,
170
171
}.Execute (rwr )
You can’t perform that action at this time.
0 commit comments