Fossil

Diff
Login

Diff

Differences From Artifact [8fb644d120]:

To Artifact [d90934db0a]:


1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
**   key                 The string to set as the saved database encryption
**                       key.
*/
void db_set_see_key_page(void){
  Blob key;
  const char *zKey;
  if( db_have_saved_encryption_key() ){
    fossil_errorlog("SEE: encryption key was already set\n");
    return;
  }
  zKey = P("key");
  blob_init(&key, 0, 0);
  if( zKey!=0 ){
    PID_T processId;
    blob_set(&key, zKey);
    db_set_saved_encryption_key(&key);
    processId = db_maybe_handle_saved_encryption_key_for_process(
      SEE_KEY_WRITE
    );
    fossil_errorlog("SEE: set encryption key for process %lu, length %u\n",
                    (unsigned long)processId, blob_size(&key));
  }else{
    fossil_errorlog("SEE: no encryption key specified\n");
  }
  blob_reset(&key);
}

/*
** WEBPAGE: unsetseekey
**
** Sets the saved database encryption key to zeros in the current and parent
** Fossil processes.  This web page does not produce any output on success
** or failure.  Setup permission is required.
*/
void db_unset_see_key_page(void){
  PID_T processId;
  login_check_credentials();
  if( !g.perm.Setup ){ login_needed(0); return; }
  processId = db_maybe_handle_saved_encryption_key_for_process(
    SEE_KEY_ZERO
  );
  fossil_errorlog("SEE: unset encryption key for process %lu\n",
                  (unsigned long)processId);
}

/*
** This function reads the saved database encryption key from the
** specified Fossil parent process.  This is only necessary (or
** functional) on Windows or Linux.
*/







|











|
|

|


















|
|







1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
**   key                 The string to set as the saved database encryption
**                       key.
*/
void db_set_see_key_page(void){
  Blob key;
  const char *zKey;
  if( db_have_saved_encryption_key() ){
    fossil_trace("SEE: encryption key was already set\n");
    return;
  }
  zKey = P("key");
  blob_init(&key, 0, 0);
  if( zKey!=0 ){
    PID_T processId;
    blob_set(&key, zKey);
    db_set_saved_encryption_key(&key);
    processId = db_maybe_handle_saved_encryption_key_for_process(
      SEE_KEY_WRITE
    );
    fossil_trace("SEE: set encryption key for process %lu, length %u\n",
                 (unsigned long)processId, blob_size(&key));
  }else{
    fossil_trace("SEE: no encryption key specified\n");
  }
  blob_reset(&key);
}

/*
** WEBPAGE: unsetseekey
**
** Sets the saved database encryption key to zeros in the current and parent
** Fossil processes.  This web page does not produce any output on success
** or failure.  Setup permission is required.
*/
void db_unset_see_key_page(void){
  PID_T processId;
  login_check_credentials();
  if( !g.perm.Setup ){ login_needed(0); return; }
  processId = db_maybe_handle_saved_encryption_key_for_process(
    SEE_KEY_ZERO
  );
  fossil_trace("SEE: unset encryption key for process %lu\n",
               (unsigned long)processId);
}

/*
** This function reads the saved database encryption key from the
** specified Fossil parent process.  This is only necessary (or
** functional) on Windows or Linux.
*/