[Spread-cvs] commit: r893 - branches/secure_spread_4.4/libspread-util/src
jschultz at spread.org
jschultz at spread.org
Tue Aug 29 15:41:21 EDT 2017
Author: jschultz
Date: 2017-08-29 15:41:19 -0400 (Tue, 29 Aug 2017)
New Revision: 893
Modified:
branches/secure_spread_4.4/libspread-util/src/security.c
Log:
Changes to whitespace and comments.
Modified: branches/secure_spread_4.4/libspread-util/src/security.c
===================================================================
--- branches/secure_spread_4.4/libspread-util/src/security.c 2017-03-01 02:05:31 UTC (rev 892)
+++ branches/secure_spread_4.4/libspread-util/src/security.c 2017-08-29 19:41:19 UTC (rev 893)
@@ -43,7 +43,6 @@
[EnableSecurity=B]
[Cipher=...]
CipherKey=...
- [CipherIV=...]
[HmacMD=...]
HmacKey=...
}]
@@ -56,7 +55,7 @@
CipherKey must be a hex string of the form '1f:40:02:...:32', it
must be the appropriate length for the Cipher and it must be at
least SECURITY_MIN_KEY_SIZE and no more than SECURITY_MAX_KEY_SIZE
- bytes long (defined in security.h).
+ bytes long (defined in spu_security.h).
HmacMD must be a valid SSL message digest name.
@@ -67,9 +66,9 @@
the null (i.e. - do nothing) cipher and HMAC are used.
If EnableSecurity is true and Cipher is not specified, then it
- defaults to DEFAULT_CIPHER (defined in security.h). If
+ defaults to DEFAULT_CIPHER (defined in spu_security.h). If
EnableSecurity is true and HmacMD is not specified, then it defaults
- to DEFAULT_HMAC_MD (defined in security.h).
+ to DEFAULT_HMAC_MD (defined in spu_security.h).
********************************************************************************************/
@@ -190,7 +189,7 @@
/* Err_Str: used to report dynamically built error strings; NOTE: we always use strcat to append */
-static char Err_Str[512] = { 0 };
+static char Err_Str[512];
static char Tmp_Str[512];
/* my_strcasecmp -------------------------------------------------------------------------------
@@ -575,9 +574,7 @@
"The key length (%d) of the Cipher '%s' is smaller than SECURITY_MIN_KEY_SIZE (%d).\n"
"It is deemed too small to be secure.\n",
EVP_CIPHER_key_length(Chosen_Cipher), Chosen_Cipher_Name, SECURITY_MIN_KEY_SIZE);
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -588,9 +585,7 @@
"The key length (%d) of the Cipher '%s' is larger than SECURITY_MAX_KEY_SIZE (%d).\n"
"Please increase this value and recompile.\n",
EVP_CIPHER_key_length(Chosen_Cipher), Chosen_Cipher_Name, SECURITY_MAX_KEY_SIZE);
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -601,9 +596,7 @@
"The block size (%d) of the Cipher '%s' is smaller than SECURITY_MIN_BLOCK_SIZE (%d). "
"It is deemed too small to be secure.\n",
EVP_CIPHER_block_size(Chosen_Cipher), Chosen_Cipher_Name, SECURITY_MIN_BLOCK_SIZE);
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -614,9 +607,7 @@
"The block size (%d) of the Cipher '%s' is larger than SECURITY_MAX_BLOCK_SIZE (%d). "
"Please increase this value (NOTE: larger data overhead per packet) and recompile.\n",
EVP_CIPHER_block_size(Chosen_Cipher), Chosen_Cipher_Name, SECURITY_MAX_BLOCK_SIZE);
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -663,7 +654,6 @@
{
strcat(Err_Str, "Illegal CipherKey specified. ");
strcat(Err_Str, get_parse_hex_errstr(bytesWritten));
-
ret = Err_Str;
goto end;
}
@@ -674,9 +664,7 @@
"The CipherKey you specified is of an incorrect length (%d) for your cipher.\n"
"The correct length key for cipher '%s' is %d.\n",
bytesWritten, Chosen_Cipher_Name, EVP_CIPHER_key_length(Chosen_Cipher));
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -751,9 +739,7 @@
"The key length (%d) of the HmacMD '%s' is smaller than SECURITY_MIN_HMAC_SIZE (%d).\n"
"It is deemed too small to be secure.\n",
EVP_MD_size(Chosen_Hmac_MD), Chosen_Hmac_MD_Name, SECURITY_MIN_HMAC_SIZE);
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -764,9 +750,7 @@
"The key length (%d) of the HmacMD '%s' is larger than SECURITY_MAX_HMAC_SIZE (%d).\n"
"Please increase this value and recompile.\n",
EVP_MD_size(Chosen_Hmac_MD), Chosen_Hmac_MD_Name, SECURITY_MAX_HMAC_SIZE);
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
@@ -813,7 +797,6 @@
{
strcat(Err_Str, "Illegal HmacKey specified. ");
strcat(Err_Str, get_parse_hex_errstr(bytesWritten));
-
ret = Err_Str;
goto end;
}
@@ -824,9 +807,7 @@
"The HmacKey you specified is of the incorrect length (%d) for your HmacMD.\n"
"The correct length key for the HmacMD '%s' is %d.\n",
bytesWritten, Chosen_Hmac_MD_Name, EVP_MD_size(Chosen_Hmac_MD));
-
strcat(Err_Str, Tmp_Str);
-
ret = Err_Str;
goto end;
}
More information about the Spread-cvs
mailing list