Bug 261506. Handle binary keys up to 128k

This commit is contained in:
Jim Norman 2007-04-05 21:33:47 +00:00
parent 5b7948b5d2
commit 0bfc0a3063
6 changed files with 4256 additions and 4271 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Apr 5 15:30:41 MDT 2007 - jnorman@novell.com
- Bug 261506. Support binary keys up to 128k
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Apr 2 14:19:58 MDT 2007 - jnorman@novell.com Mon Apr 2 14:19:58 MDT 2007 - jnorman@novell.com

View File

@ -170,6 +170,7 @@ static SS_UTF8_T SSCS_LOCAL_REMOTE_KEY_CHAIN_ID[] = {"SSCS_LOCAL_REMOTE_KEY_CHA
#define NSSCS_MID_SECRET_BUF_LEN 32768 //* (4K-128)to match server #define NSSCS_MID_SECRET_BUF_LEN 32768 //* (4K-128)to match server
#define NSSCS_MAX_SECRET_BUF_LEN 60416 //* (59K)to match server #define NSSCS_MAX_SECRET_BUF_LEN 60416 //* (59K)to match server
#define NSSCS_MAX_PWORD_HINT_LEN 128 //* maximum hint (bytes) #define NSSCS_MAX_PWORD_HINT_LEN 128 //* maximum hint (bytes)
#define NSSCS_MAX_BINARY_VALUE_LEN 128*1024 //* Max for binary values (bytes)
#define NSSCS_MAX_KEYCHAIN_ID_LEN 256 //* in bytes including NULL #define NSSCS_MAX_KEYCHAIN_ID_LEN 256 //* in bytes including NULL

View File

@ -34,6 +34,7 @@ typedef uint8_t Byte;
// Used for global buffers. // Used for global buffers.
#define MIN_REQUEST_BUF_LEN 32*1024 #define MIN_REQUEST_BUF_LEN 32*1024
#define MIN_REPLY_BUF_LEN 32*1024 #define MIN_REPLY_BUF_LEN 32*1024
#define MAX_BINARY_KEY_LEN 256*1024
#ifdef SSCS_LINUX_PLAT_F #ifdef SSCS_LINUX_PLAT_F
#include "sscs_unx_ipc_client.h" #include "sscs_unx_ipc_client.h"

View File

@ -178,6 +178,7 @@ int ipc_unx_read(int fd, Byte *pData, int bytes)
int bytesToRead = 0; // Keep track of number of bytes to read int bytesToRead = 0; // Keep track of number of bytes to read
int bytesRead = 0; // Number of bytes read int bytesRead = 0; // Number of bytes read
int totalBytesRead = 0;
int retVal = 0; int retVal = 0;
for(bytesToRead = bytes; bytesToRead;) for(bytesToRead = bytes; bytesToRead;)
@ -194,9 +195,10 @@ int ipc_unx_read(int fd, Byte *pData, int bytes)
} }
bytesToRead -= bytesRead; bytesToRead -= bytesRead;
pData += bytesRead; pData += bytesRead;
totalBytesRead += bytesRead;
} }
} }
return bytesRead; return totalBytesRead;
} }
//#endif //#endif

File diff suppressed because it is too large Load Diff

View File

@ -1747,7 +1747,7 @@ miCASAWriteBinaryKey
return(NSSCS_E_BUFFER_LEN); return(NSSCS_E_BUFFER_LEN);
} }
if ((keyLen > NSSCS_MAX_SECRET_ID_LEN/4) || (*valLen > NSSCS_MAX_SECRET_BUF_LEN/4)) if ((keyLen > NSSCS_MAX_SECRET_ID_LEN/4) || (*valLen > NSSCS_MAX_BINARY_VALUE_LEN))
{ {
return(NSSCS_E_BUFFER_LEN); return(NSSCS_E_BUFFER_LEN);
} }
@ -3800,4 +3800,4 @@ miCASAMergeCache
return rcode; return rcode;
/* ############################### CODE ENDS HERE ############################# */ /* ############################### CODE ENDS HERE ############################# */
} // end of miCASAIsSecretPersistent } // end of miCASAIsSecretPersistent