summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkx <kx@radix.pro>2013-04-04 20:06:28 +0400
committerkx <kx@radix.pro>2013-04-04 20:06:28 +0400
commitd4c2a3368abd330bf5989817a568925dcaa1127f (patch)
tree20b279c6be1ab228094bbd35c94915bdfb71624b
parent429fe7318944b1ec1d1d2518183e3570ab9ba276 (diff)
downloadmodSign-d4c2a3368abd330bf5989817a568925dcaa1127f.tar.xz
Fixed compilation issue00.90
-rw-r--r--modSign.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/modSign.cpp b/modSign.cpp
index 7ab5256..0b4781d 100644
--- a/modSign.cpp
+++ b/modSign.cpp
@@ -78,7 +78,7 @@ int optind = 1,
char *optarg;
//! The usage explanation for header modules
-static const char *usageHeaderString = "Usage:\n\
+#define usageHeaderString "Usage:\n\
modSign <type> [-s <mode>] -e <entry> [-m <info>] [-p <password>]\n\
-c <certFile> <outFile>\n\
<type> header type: NAND | NOR | UART\n\
@@ -87,10 +87,10 @@ static const char *usageHeaderString = "Usage:\n\
-m <info> UBL module start/size info\n\
-p <password> (optional) password for key certificate file\n\
-c <certFile> RSA key certificate file\n\
- <outFile> output file name\n";
+ <outFile> output file name\n"
//! The usage explanation for load/code modules
-static const char *usageLoadString = "Usage:\n\
+#define usageLoadString "Usage:\n\
modSign load [-a <start> -s [1|2|3]] -b <block> -k <keyString>\n\
[-p <password>] -c <certfile> <infile> <outfile>\n\
-a <start> start address of module if self-executing\n\
@@ -103,10 +103,10 @@ static const char *usageLoadString = "Usage:\n\
-p <password> (optional) password for key certificate file\n\
-c <certFile> RSA key certificate file\n\
<inFile> binary input file name\n\
- <outFile> output file name\n";
+ <outFile> output file name\n"
//! The usage explanation for certificate delegation modules
-static const char *usageCertString = "Usage:\n\
+#define usageCertString "Usage:\n\
modSign cert [-f] [-p <password>] -k <keyString> -c <certfile>\n\
[-p <password>] -k <keyString> -d <dCertFile> <outfile>\n\
-f <flag> SK add-on inhibit flag\n\
@@ -114,7 +114,7 @@ static const char *usageCertString = "Usage:\n\
-k <keyString> 32-character hex AES key\n\
-c <certFile> RSA key certificate file\n\
-d <dCertFile> delegate RSA key certificate file\n\
- <outFile> output file name\n";
+ <outFile> output file name\n"
//! User Interface method used during password callback
static UI_METHOD *ui_method = NULL;
@@ -363,7 +363,6 @@ returnType genBootHeader(
int signOffset,
int hdrSize)
{
- int err;
uint32_t sig_len;
uint8_t sig_buf [4096];
EVP_MD_CTX md_ctx;
@@ -371,7 +370,7 @@ returnType genBootHeader(
EVP_SignInit (&md_ctx, EVP_sha1());
EVP_SignUpdate (&md_ctx, pHeader, signOffset);
sig_len = sizeof(sig_buf);
- err = EVP_SignFinal (&md_ctx, sig_buf, (unsigned int *)&sig_len, pkey);
+ (void)EVP_SignFinal (&md_ctx, sig_buf, (unsigned int *)&sig_len, pkey);
if(sig_len == RSASIZE)
copyByteReversed(pHeader+signOffset, (const char *) sig_buf, sig_len);
@@ -401,7 +400,6 @@ returnType genAltKey(
uint8_t *privateKey,
struct alternateKey *header)
{
- int err;
uint32_t sig_len;
uint8_t sig_buf [4096];
EVP_MD_CTX md_ctx;
@@ -411,7 +409,7 @@ returnType genAltKey(
EVP_SignInit (&md_ctx, EVP_sha1());
EVP_SignUpdate (&md_ctx, (char *) header, offsetof(struct alternateKey, hdrSignature));
sig_len = sizeof(sig_buf);
- err = EVP_SignFinal (&md_ctx, sig_buf, (unsigned int *)&sig_len, pkey);
+ (void)EVP_SignFinal (&md_ctx, sig_buf, (unsigned int *)&sig_len, pkey);
if(sig_len == RSASIZE)
copyByteReversed((char *) header->hdrSignature, (const char *) sig_buf, sig_len);
@@ -455,7 +453,6 @@ returnType genCodeHeader(
int codeSize,
int modEntryPt)
{
- int err;
uint32_t sig_len;
uint8_t sig_buf [4096];
EVP_MD_CTX md_ctx;
@@ -474,7 +471,7 @@ returnType genCodeHeader(
EVP_SignInit (&md_ctx, EVP_sha1());
EVP_SignUpdate (&md_ctx, (char *) codeBuf, codeSize + sizeof(struct SL_modInfoHdr));
sig_len = sizeof(sig_buf);
- err = EVP_SignFinal (&md_ctx, sig_buf, (unsigned int *)&sig_len, pkey);
+ (void)EVP_SignFinal (&md_ctx, sig_buf, (unsigned int *)&sig_len, pkey);
if(sig_len == RSASIZE)
copyByteReversed((char *) codeBuf + codeSize + sizeof(struct SL_modInfoHdr),
@@ -528,7 +525,7 @@ int getopt(int nargc, char * const *nargv, const char *ostr)
}
} // option letter okay?
if ((optopt = (int)*place++) == (int)':' ||
- !(oli = strchr(ostr, optopt))) {
+ !(oli = strchr((char *)ostr, optopt))) {
//
// if the user didn't specify '-' as an option,
// assume it means EOF.