NSS Shared DB: Difference between revisions

Jump to navigation Jump to search
1,431 bytes added ,  26 January 2008
Line 375: Line 375:


In the shared database design, upgrade is no longer mandatory. Applications  
In the shared database design, upgrade is no longer mandatory. Applications  
may choose to remain using the old DBM database, update to using the new shared database from old DBM databases, or merge your old DBM database into a new location shared by multiple apps. There is still a desire for this update to be automatic, at least as far as the application user is concerned. The following design manages this update.
may choose to continue to use the old DBM database, update to use the new shared database from old DBM databases, or update and merge old DBM database into a new location shared by multiple apps. There is still a desire for this update to be automatic, at least as far as the application user is concerned. The following describe how applications .


To understand the issues of migration to the Shareable Database version of NSS from the traditional (legacy) versions, we group applications that use the new version of NSS into three 'modes' of operation, and into two types for a total of five valid combinations (Mode 1 B is not valid)..  
To understand the issues of migration to the Shareable Database version of NSS from the traditional (legacy) versions, we group applications that use the new version of NSS into three 'modes' of operation, and into two types for a total of five valid combinations (Mode 1 B is not valid)..  
Line 441: Line 441:
First, Mode three applications need to call NSS_InitWithMerge(). This call includes extra parameters needed by NSS to help automatically determine if an update/merge is necessary, and how to accomplish it.
First, Mode three applications need to call NSS_InitWithMerge(). This call includes extra parameters needed by NSS to help automatically determine if an update/merge is necessary, and how to accomplish it.


==== Database Upgrade Underlying Implementation ====
=====Upgrade complications=====
=====Upgrade complications=====


Line 449: Line 450:
In Mode 1, NSS never needs to do an update or a merge.  
In Mode 1, NSS never needs to do an update or a merge.  


  Flow chart of NSS update actions for Mode 3:
  State machine of NSS update actions for Mode 1:
             NSS initialize
 
             NSS_Initialize
                   |
                   |
                   V
                   V
Line 472: Line 474:
the old database on future opens until the update succeeds.
the old database on future opens until the update succeeds.


   Flow chart of NSS update actions for Mode 2:
   State machine of NSS update actions for Mode 2:
             NSS initialize
       
             NSS_Initialize
                   |
                   |
                   V
                   V  
             open shared DB
             open shared DB
                   |
                   |
Line 500: Line 503:
   |              V
   |              V
   |      <  is password  >  no
   |      <  is password  >  no
   |      <    supplied?  >-------> done
   |      <    supplied?  >-------> state= 'not updated' ----> return
   |              |
   |              |
   +--------------+
   +--------------+
                   V
                   V
             update shared DB
             update (and use) shared DB
                   |
                   |
                   V
                   V
Line 511: Line 514:
                   V
                   V
                 done
                 done
                  
------------------------------------------
            PK11_Authenticate
                  |
                  V
          <  is password  >  no
          <    supplied?  >-------> return
                  |
                  V
          <  is state    >  no
          < 'not updated'? >-------> return
                  |
                  V
            update (and use) shared DB
                  |
                  V
            close legacy DB
                  |
                  V
                 done
 
               
 


In Mode 3, the new database may or may not be initialized. For the first mode 3
In Mode 3, the new database may or may not be initialized. For the first mode 3
Line 530: Line 554:


   Flow chart of NSS update actions for Mode 3:
   Flow chart of NSS update actions for Mode 3:
                Start
 
            NSS_Initialize
                   |
                   |
                   V
                   V
Line 549: Line 574:
                   V
                   V
       no  < does legacy DB    >
       no  < does legacy DB    >
   +-------< have a password?  >
   +-------< have a password?  > -
  |              | yes
  |              V
  |  no  < does legacy DB    >
  +-------< have any private  >
  |      < or secret keys?  >
   |              | yes
   |              | yes
   |              V
   |              V
Line 560: Line 580:
   |        until password
   |        until password
   |          is supplied
   |          is supplied
   |              |
   |              +------------- state = "not updated"---- return
  |              V
   |    
  |      <  is password  >  no
  |      <    supplied?  >-------> exception A
   |             |
   +--------------+
   +--------------+
                   V
                   V
Line 571: Line 588:
   |              | yes
   |              | yes
   |              V
   |              V
   |  yes < does shared DB's >
   |         use legacy DB
   +--------< password match  >
  |        until password
   |       < legacy DB's PW?  >
  |          is supplied
   |             | no
  |              +----------- state = "has legacy pwd" --- return
   |             V
  |             
   |         get shared DB  
  +--------------+
   |            password
                  V
   |             |
            update/merge shared DB
   |             V
                  |
   |     is password  > no
                  V
   |     <   supplied?   >-------> exception B
            close legacy DB
   |              |
                  |
                  V
                done
 
---------------------------------------------------------------
 
              PK11_Authenticate
                      |
                      V
              <   is password  > no
              <   supplied?  >-------> return
                      |                 
                      V
"has legacy pw" <                > other
   +------------<  switch state  >--------> done
  |            <               >
  |                  | "not updated"
  |                  |
  |    <    store password     >
   |   < state = "has legacy pw" >
   |                 |
   |                 V
   |       no  < does shared DB   >
   +-----------< have a password?  >
   |                 | yes
   |                 V
   |       yes  < does shared DB's >
  +------------< password match   >
   |           < legacy DB's PW? >
  |                  | no
  |                  +----------- state = "has legacy pwd" --- return
   |
   +--------------+
   +--------------+
                   V
                   V
Line 592: Line 640:
                   V
                   V
                 done
                 done


exception A. Application needs to decide what happens if the legacy password
exception A. Application needs to decide what happens if the legacy password
439

edits

Navigation menu