tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

index.rst (2147B)


      1 .. _mozilla_projects_nss_reference_fc_login:
      2 
      3 FC_Login
      4 ========
      5 
      6 `Name <#name>`__
      7 ~~~~~~~~~~~~~~~~
      8 
      9 .. container::
     10 
     11   ``FC_Login()`` - log a user into a token.
     12 
     13 `Syntax <#syntax>`__
     14 ~~~~~~~~~~~~~~~~~~~~
     15 
     16 .. container::
     17 
     18   .. code::
     19 
     20      CK_RV FC_Login(
     21        CK_SESSION_HANDLE hSession,
     22        CK_USER_TYPE userType,
     23        CK_CHAR_PTR pPin,
     24        CK_ULONG ulPinLen
     25      );
     26 
     27 `Parameters <#parameters>`__
     28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     29 
     30 .. container::
     31 
     32   ``FC_Login()`` takes four parameters:
     33 
     34   ``hSession``
     35      [in] a session handle
     36   ``userType``
     37      [in] the user type (``CKU_SO`` or ``CKU_USER``)
     38   ``pPin``
     39      [in] a pointer that points to the user's PIN
     40   ``ulPinLen``
     41      [in] the length of the PIN
     42 
     43 `Description <#description>`__
     44 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     45 
     46 .. container::
     47 
     48   ``FC_Login()`` logs a user into a token.
     49 
     50   The Security Officer (``CKU_SO``) only logs in to initialize the normal user's PIN. The SO PIN is
     51   the empty string. The NSS cryptographic module doesn't allow the SO to log in if the normal
     52   user's PIN is already initialized.
     53 
     54 .. _return_value:
     55 
     56 `Return value <#return_value>`__
     57 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     58 
     59 .. container::
     60 
     61   ``FC_Login()`` returns the following return codes.
     62 
     63   -  ``CKR_OK``: the user logged in successfully.
     64   -  ``CKR_DEVICE_ERROR``: the token is in the Error state.
     65   -  ``CKR_HOST_MEMORY``: memory allocation failed.
     66   -  ``CKR_PIN_INCORRECT``: the PIN is incorrect.
     67   -  ``CKR_PIN_LEN_RANGE``: the PIN is too long (``ulPinLen`` is greater than 255).
     68 
     69      .. note::
     70 
     71         The function should return ``CKR_PIN_INCORRECT`` in this case.
     72 
     73   -  ``CKR_SESSION_HANDLE_INVALID``: the session handle is invalid.
     74   -  ``CKR_USER_ALREADY_LOGGED_IN``: the user is already logged in.
     75   -  ``CKR_USER_TYPE_INVALID``
     76 
     77      -  The token can't authenticate the user because there is no key database or the user's
     78         password isn't initialized.
     79      -  ``userType`` is ``CKU_SO`` and the normal user's PIN is already initialized.
     80 
     81 .. _see_also:
     82 
     83 `See also <#see_also>`__
     84 ~~~~~~~~~~~~~~~~~~~~~~~~
     85 
     86 .. container::
     87 
     88   -  `NSC_Login </en-US/NSC_Login>`__