Fossil

Check-in [1ff19a468d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Comment fixes.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | enhSee
Files: files | file ages | folders
SHA3-256: 1ff19a468d762ebf5c8123b7bf29081ee4137fd83b87aa756feb9434532c8bad
User & Date: mistachkin 2023-05-18 23:24:47.217
Context
2023-05-20
00:25
Some changes for Windows. check-in: 119f971335 user: mistachkin tags: enhSee
2023-05-18
23:24
Comment fixes. check-in: 1ff19a468d user: mistachkin tags: enhSee
21:15
Enhancements to SEE integration. check-in: d72ab72962 user: mistachkin tags: enhSee
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
** key available.
*/
int db_have_saved_encryption_key(){
  return db_is_valid_saved_encryption_key(zSavedKey, savedKeySize);
}

/*
** This function returns non-zero if the specified saved database encryption
** key is valid.
*/
int db_is_valid_saved_encryption_key(const char *p, size_t n){
  if( p==0 ) return 0;
  if( n==0 ) return 0;
  if( p[0]==0 ) return 0;
  return 1;
}







|
|







1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
** key available.
*/
int db_have_saved_encryption_key(){
  return db_is_valid_saved_encryption_key(zSavedKey, savedKeySize);
}

/*
** This function returns non-zero if the specified database encryption key
** is valid.
*/
int db_is_valid_saved_encryption_key(const char *p, size_t n){
  if( p==0 ) return 0;
  if( n==0 ) return 0;
  if( p[0]==0 ) return 0;
  return 1;
}
1701
1702
1703
1704
1705
1706
1707
1708

1709
1710
1711
1712
1713
1714
1715

/*
** WEBPAGE: setseekey
**
** Sets the sets the saved database encryption key to one that gets passed
** via the "key" query string parameter.  If the saved database encryption
** key has already been set, does nothing.  This web page does not produce
** any output on success or failure.

**
** Query parameters:
**
**   key                 The string to set as the saved database encryption
**                       key.
*/
void db_set_see_key_page(void){







|
>







1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716

/*
** WEBPAGE: setseekey
**
** Sets the sets the saved database encryption key to one that gets passed
** via the "key" query string parameter.  If the saved database encryption
** key has already been set, does nothing.  This web page does not produce
** any output on success or failure.  No permissions are required and none
** are checked (partially due to lack of encrypted database access).
**
** Query parameters:
**
**   key                 The string to set as the saved database encryption
**                       key.
*/
void db_set_see_key_page(void){
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
  }
  blob_reset(&key);
}

/*
** WEBPAGE: unsetseekey
**
** Unsets the saved database encryption key to zeros.  If the saved database
** encryption key has already been set, does nothing.  This web page does not
** produce any output on success or failure.
*/
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







|
|
|







1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
  }
  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
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
#else
    fossil_panic("db_write_saved_encryption_key_to_process unsupported");
#endif
  }
}

/*
** This function zero the saved database encryption key in the specified
** Fossil parent process.  This is only necessary (or functional) on
** Windows or Linux.
*/
static void db_zero_saved_encryption_key_in_process(
  PID_T processId, /* Identifier for Fossil parent process. */
  LPVOID pAddress, /* Pointer to saved key buffer in the parent process. */
  SIZE_T nSize     /* Size of saved key buffer in the parent process. */







|







1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
#else
    fossil_panic("db_write_saved_encryption_key_to_process unsupported");
#endif
  }
}

/*
** This function zeros the saved database encryption key in the specified
** Fossil parent process.  This is only necessary (or functional) on
** Windows or Linux.
*/
static void db_zero_saved_encryption_key_in_process(
  PID_T processId, /* Identifier for Fossil parent process. */
  LPVOID pAddress, /* Pointer to saved key buffer in the parent process. */
  SIZE_T nSize     /* Size of saved key buffer in the parent process. */