Bug 261506. Handle binary keys up to 128k
This commit is contained in:
		| @@ -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 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -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 | ||||||
|   | |||||||
| @@ -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" | ||||||
|   | |||||||
| @@ -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
											
										
									
								
							| @@ -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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user