File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ functions = [
151151 " NSS_SetAlgorithmPolicy" ,
152152 " PK11_AEADOp" ,
153153 " PK11_Authenticate" ,
154+ " PK11_CheckUserPassword" ,
154155 " PK11_CipherOp" ,
155156 " PK11_CreateContextBySymKey" ,
156157 " PK11_Decrypt" ,
@@ -195,6 +196,7 @@ functions = [
195196 " PK11_ImportPublicKey" ,
196197 " PK11_ImportSymKey" ,
197198 " PK11_ListFixedKeysInSlot" ,
199+ " PK11_Logout" ,
198200 " PK11_PubDeriveWithKDF" ,
199201 " PK11_ReadRawAttribute" ,
200202 " PK11_ReferenceSlot" ,
Original file line number Diff line number Diff line change @@ -194,6 +194,15 @@ impl Slot {
194194 secstatus_to_res ( unsafe { PK11_Authenticate ( self . ptr , PRBool :: from ( true ) , null_mut ( ) ) } )
195195 }
196196
197+ pub fn check_user_password ( & self , password : & str ) -> Res < ( ) > {
198+ let c_password = std:: ffi:: CString :: new ( password) . map_err ( |_| Error :: String ) ?;
199+ secstatus_to_res ( unsafe { PK11_CheckUserPassword ( self . ptr , c_password. as_ptr ( ) ) } )
200+ }
201+
202+ pub fn logout ( & self ) -> Res < ( ) > {
203+ secstatus_to_res ( unsafe { PK11_Logout ( self . ptr ) } )
204+ }
205+
197206 /// Find a persistent symmetric key on this slot by nickname.
198207 /// Returns `None` if no key with the given nickname exists.
199208 #[ must_use]
You can’t perform that action at this time.
0 commit comments