shorten64 fixes for key-gen/cert-gen
This commit is contained in:
parent
0bbbea20be
commit
01ae0696af
@ -2863,8 +2863,8 @@ int DerToPem(const byte* der, word32 derSz, byte* output, word32 outSz,
|
||||
XSTRNCPY(footer, "-----END RSA PRIVATE KEY-----\n", sizeof(footer));
|
||||
}
|
||||
|
||||
headerLen = XSTRLEN(header);
|
||||
footerLen = XSTRLEN(footer);
|
||||
headerLen = (int)XSTRLEN(header);
|
||||
footerLen = (int)XSTRLEN(footer);
|
||||
|
||||
if (!der || !output)
|
||||
return BAD_FUNC_ARG;
|
||||
@ -3410,7 +3410,7 @@ static int SetName(byte* output, CertName* name)
|
||||
byte set[MAX_SET_SZ];
|
||||
|
||||
int email = i == (NAME_ENTRIES - 1) ? 1 : 0;
|
||||
int strLen = XSTRLEN(nameStr);
|
||||
int strLen = (int)XSTRLEN(nameStr);
|
||||
int thisLen = strLen;
|
||||
int firstSz, secondSz, seqSz, setSz;
|
||||
|
||||
@ -3461,7 +3461,7 @@ static int SetName(byte* output, CertName* name)
|
||||
0x01, 0x09, 0x01, 0x16 };
|
||||
/* email joint id */
|
||||
XMEMCPY(names[i].encoded + idx, EMAIL_OID, sizeof(EMAIL_OID));
|
||||
idx += sizeof(EMAIL_OID);
|
||||
idx += (int)sizeof(EMAIL_OID);
|
||||
}
|
||||
else {
|
||||
/* joint id */
|
||||
|
@ -1491,7 +1491,7 @@ int rsa_test(void)
|
||||
keyFile = fopen("./key.der", "wb");
|
||||
if (!keyFile)
|
||||
return -303;
|
||||
ret = fwrite(der, derSz, 1, keyFile);
|
||||
ret = (int)fwrite(der, derSz, 1, keyFile);
|
||||
fclose(keyFile);
|
||||
|
||||
pemSz = DerToPem(der, derSz, pem, sizeof(pem), PRIVATEKEY_TYPE);
|
||||
@ -1501,7 +1501,7 @@ int rsa_test(void)
|
||||
pemFile = fopen("./key.pem", "wb");
|
||||
if (!pemFile)
|
||||
return -305;
|
||||
ret = fwrite(pem, pemSz, 1, pemFile);
|
||||
ret = (int)fwrite(pem, pemSz, 1, pemFile);
|
||||
fclose(pemFile);
|
||||
|
||||
InitRsaKey(&derIn, 0);
|
||||
@ -1556,7 +1556,7 @@ int rsa_test(void)
|
||||
derFile = fopen("./cert.der", "wb");
|
||||
if (!derFile)
|
||||
return -403;
|
||||
ret = fwrite(derCert, certSz, 1, derFile);
|
||||
ret = (int)fwrite(derCert, certSz, 1, derFile);
|
||||
fclose(derFile);
|
||||
|
||||
pemSz = DerToPem(derCert, certSz, pem, sizeof(pem), CERT_TYPE);
|
||||
@ -1566,7 +1566,7 @@ int rsa_test(void)
|
||||
pemFile = fopen("./cert.pem", "wb");
|
||||
if (!pemFile)
|
||||
return -405;
|
||||
ret = fwrite(pem, pemSz, 1, pemFile);
|
||||
ret = (int)fwrite(pem, pemSz, 1, pemFile);
|
||||
fclose(pemFile);
|
||||
|
||||
|
||||
@ -1634,7 +1634,7 @@ int rsa_test(void)
|
||||
derFile = fopen("./othercert.der", "wb");
|
||||
if (!derFile)
|
||||
return -410;
|
||||
ret = fwrite(derCert, certSz, 1, derFile);
|
||||
ret = (int)fwrite(derCert, certSz, 1, derFile);
|
||||
fclose(derFile);
|
||||
|
||||
pemSz = DerToPem(derCert, certSz, pem, sizeof(pem), CERT_TYPE);
|
||||
@ -1644,7 +1644,7 @@ int rsa_test(void)
|
||||
pemFile = fopen("./othercert.pem", "wb");
|
||||
if (!pemFile)
|
||||
return -412;
|
||||
ret = fwrite(pem, pemSz, 1, pemFile);
|
||||
ret = (int)fwrite(pem, pemSz, 1, pemFile);
|
||||
fclose(pemFile);
|
||||
}
|
||||
#ifdef HAVE_NTRU
|
||||
|
@ -1875,7 +1875,7 @@ int CyaSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz)
|
||||
dynamic = 1;
|
||||
}
|
||||
|
||||
if ( (ret = XFREAD(fileBuf, sz, 1, file)) < 0)
|
||||
if ( (ret = (int)XFREAD(fileBuf, sz, 1, file)) < 0)
|
||||
ret = SSL_BAD_FILE;
|
||||
else
|
||||
ret = PemToDer(fileBuf, sz, CA_TYPE, &converted, 0, &info, &ecc);
|
||||
|
Loading…
Reference in New Issue
Block a user