@@ -76,11 +76,11 @@ public class KeyBlob
7676 {
7777 const string DLLNAME = "wolftpm" ;
7878
79- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_GetNewKeyBlob " ) ]
80- private static extern IntPtr wolfTPM2_GetNewKeyBlob ( ) ;
79+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_NewKeyBlob " ) ]
80+ private static extern IntPtr wolfTPM2_NewKeyBlob ( ) ;
8181
82- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_CleanupKeyBlob " ) ]
83- private static extern int wolfTPM2_CleanupKeyBlob ( IntPtr blob ) ;
82+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_FreeKeyBlob " ) ]
83+ private static extern int wolfTPM2_FreeKeyBlob ( IntPtr blob ) ;
8484
8585 [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_GetKeyBlobAsBuffer" ) ]
8686 private static extern int wolfTPM2_GetKeyBlobAsBuffer ( byte [ ] buffer ,
@@ -93,15 +93,15 @@ private static extern int wolfTPM2_SetKeyBlobFromBuffer(IntPtr key,
9393
9494 public KeyBlob ( )
9595 {
96- keyblob = wolfTPM2_GetNewKeyBlob ( ) ;
96+ keyblob = wolfTPM2_NewKeyBlob ( ) ;
9797 }
9898
9999 ~ KeyBlob ( )
100100 {
101101 if ( keyblob != IntPtr . Zero )
102102 {
103103 // TODO: check return value?
104- wolfTPM2_CleanupKeyBlob ( keyblob ) ;
104+ wolfTPM2_FreeKeyBlob ( keyblob ) ;
105105 }
106106 }
107107
@@ -120,11 +120,11 @@ public class Key
120120 {
121121 const string DLLNAME = "wolftpm" ;
122122
123- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_GetNewKey " ) ]
124- private static extern IntPtr wolfTPM2_GetNewKey ( ) ;
123+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_NewKey " ) ]
124+ private static extern IntPtr wolfTPM2_NewKey ( ) ;
125125
126- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_CleanupKey " ) ]
127- private static extern int wolfTPM2_CleanupKey ( IntPtr key ) ;
126+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_FreeKey " ) ]
127+ private static extern int wolfTPM2_FreeKey ( IntPtr key ) ;
128128
129129 /* ================================================================== */
130130 /* Native Getters and Setters */
@@ -144,15 +144,15 @@ private static extern int wolfTPM2_SetKeyAuthPassword(
144144
145145 public Key ( )
146146 {
147- key = wolfTPM2_GetNewKey ( ) ;
147+ key = wolfTPM2_NewKey ( ) ;
148148 }
149149
150150 ~ Key ( )
151151 {
152152 if ( key != IntPtr . Zero )
153153 {
154154 // TODO: check return value
155- wolfTPM2_CleanupKey ( key ) ;
155+ wolfTPM2_FreeKey ( key ) ;
156156 }
157157 }
158158
@@ -174,21 +174,21 @@ public class Template
174174 {
175175 const string DLLNAME = "wolftpm" ;
176176
177- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_GetNewPublicTemplate " ) ]
178- private static extern IntPtr wolfTPM2_GetNewPublicTemplate ( ) ;
177+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_NewPublicTemplate " ) ]
178+ private static extern IntPtr wolfTPM2_NewPublicTemplate ( ) ;
179179
180- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_CleanupPublicTemplate " ) ]
181- private static extern int wolfTPM2_CleanupPublicTemplate ( IntPtr template ) ;
180+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_FreePublicTemplate " ) ]
181+ private static extern int wolfTPM2_FreePublicTemplate ( IntPtr template ) ;
182182
183183 internal IntPtr template ;
184184 public Template ( )
185185 {
186- template = wolfTPM2_GetNewPublicTemplate ( ) ;
186+ template = wolfTPM2_NewPublicTemplate ( ) ;
187187 }
188188
189189 ~ Template ( )
190190 {
191- wolfTPM2_CleanupPublicTemplate ( template ) ;
191+ wolfTPM2_FreePublicTemplate ( template ) ;
192192 }
193193
194194 /* non-device functions: template and auth */
@@ -225,26 +225,26 @@ public class Session
225225 {
226226 const string DLLNAME = "wolftpm" ;
227227
228- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_GetNewSession " ) ]
229- private static extern IntPtr wolfTPM2_GetNewSession ( ) ;
228+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_NewSession " ) ]
229+ private static extern IntPtr wolfTPM2_NewSession ( ) ;
230230
231- [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_CleanupSession " ) ]
232- private static extern int wolfTPM2_CleanupSession ( IntPtr session ) ;
231+ [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_FreeSession " ) ]
232+ private static extern int wolfTPM2_FreeSession ( IntPtr session ) ;
233233
234234
235235 internal IntPtr session ;
236236
237237 public Session ( )
238238 {
239- session = wolfTPM2_GetNewSession ( ) ;
239+ session = wolfTPM2_NewSession ( ) ;
240240 }
241241
242242 ~ Session ( )
243243 {
244244 if ( session != IntPtr . Zero )
245245 {
246246 // TODO: check return value
247- wolfTPM2_CleanupSession ( session ) ;
247+ wolfTPM2_FreeSession ( session ) ;
248248 }
249249 }
250250
@@ -278,7 +278,7 @@ public Device()
278278 [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_New" ) ]
279279 private static extern IntPtr wolfTPM2_New ( ) ;
280280
281- /* WOLFTPM_API int wolfTPM2_SimpleCleanup (WOLFTPM2_DEV *dev); */
281+ /* WOLFTPM_API int wolfTPM2_Free (WOLFTPM2_DEV *dev); */
282282 [ DllImport ( DLLNAME , EntryPoint = "wolfTPM2_Free" ) ]
283283 private static extern int wolfTPM2_Free ( IntPtr dev ) ;
284284
0 commit comments