System.Data.SQLite
Check-in [e9bd66e344]
Not logged in

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

Overview
Comment:Fix a rollback bug
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: e9bd66e344678420edc812abd8ed9e757bcba6cd
User & Date: rmsimpson 2006-01-10 23:32:46
Context
2006-01-11
03:22
3.3.0 alpha check-in: d9c4970b26 user: rmsimpson tags: sourceforge
2006-01-10
23:32
Fix a rollback bug check-in: e9bd66e344 user: rmsimpson tags: sourceforge
21:09
CVS codemerge 10-JAN-2006 check-in: 2f0658a242 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SQLite.Interop/crypt.c.

110
111
112
113
114
115
116
117
118
119
120
121
122



123
124
125
126
127

128
129
130
131
132
133
134

// Encrypt/Decrypt functionality, called by pager.c
void sqlite3Codec(void *pArg, void *data, Pgno nPageNum, int nMode)
{
  LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)pArg;
  DWORD dwPageSize;
  LPVOID pvTemp;
  PgHdr *pageHeader;

  if (!pBlock) return;

  // Make sure the page size for the pager is still the same as the page size
  // for the cryptblock.  If the user changed it, we need to adjust!



  pageHeader = DATA_TO_PGHDR(data);
  if (pageHeader->pPager->pageSize != pBlock->dwPageSize)
  {
    // Update the cryptblock to reflect the new page size
    CreateCryptBlock(0, pageHeader->pPager, pBlock);

  }

  /* Block ciphers often need to write extra padding beyond the 
  data block.  We don't have that luxury for a given page of data so
  we must copy the page data to a buffer that IS large enough to hold
  the padding.  We then encrypt the block and write the buffer back to
  the page without the unnecessary padding.







<





>
>
>
|
|
|
|
|
>







110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

// Encrypt/Decrypt functionality, called by pager.c
void sqlite3Codec(void *pArg, void *data, Pgno nPageNum, int nMode)
{
  LPCRYPTBLOCK pBlock = (LPCRYPTBLOCK)pArg;
  DWORD dwPageSize;
  LPVOID pvTemp;


  if (!pBlock) return;

  // Make sure the page size for the pager is still the same as the page size
  // for the cryptblock.  If the user changed it, we need to adjust!
  if (nMode != 2)
  {
    PgHdr *pageHeader;
    pageHeader = DATA_TO_PGHDR(data);
    if (pageHeader->pPager->pageSize != pBlock->dwPageSize)
    {
      // Update the cryptblock to reflect the new page size
      CreateCryptBlock(0, pageHeader->pPager, pBlock);
    }
  }

  /* Block ciphers often need to write extra padding beyond the 
  data block.  We don't have that luxury for a given page of data so
  we must copy the page data to a buffer that IS large enough to hold
  the padding.  We then encrypt the block and write the buffer back to
  the page without the unnecessary padding.