mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
CMS fixes for building with NO_ASN_TIME
This commit is contained in:
committed by
David Garske
parent
448f91b56d
commit
773a81ef6a
@ -1416,12 +1416,12 @@ static int wc_PKCS7_BuildSignedAttributes(PKCS7* pkcs7, ESD* esd,
|
|||||||
const byte* signingTimeOid, word32 signingTimeOidSz,
|
const byte* signingTimeOid, word32 signingTimeOidSz,
|
||||||
byte* signingTime, word32 signingTimeSz)
|
byte* signingTime, word32 signingTimeSz)
|
||||||
{
|
{
|
||||||
int hashSz, timeSz;
|
int hashSz;
|
||||||
time_t tm;
|
|
||||||
|
|
||||||
#ifdef NO_ASN_TIME
|
#ifdef NO_ASN_TIME
|
||||||
PKCS7Attrib cannedAttribs[2];
|
PKCS7Attrib cannedAttribs[2];
|
||||||
#else
|
#else
|
||||||
|
time_t tm;
|
||||||
|
int timeSz;
|
||||||
PKCS7Attrib cannedAttribs[3];
|
PKCS7Attrib cannedAttribs[3];
|
||||||
#endif
|
#endif
|
||||||
word32 cannedAttribsCount;
|
word32 cannedAttribsCount;
|
||||||
@ -1476,6 +1476,12 @@ static int wc_PKCS7_BuildSignedAttributes(PKCS7* pkcs7, ESD* esd,
|
|||||||
pkcs7->signedAttribs, pkcs7->signedAttribsSz);
|
pkcs7->signedAttribs, pkcs7->signedAttribsSz);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NO_ASN_TIME
|
||||||
|
(void)signingTimeOidSz;
|
||||||
|
(void)signingTime;
|
||||||
|
(void)signingTimeSz;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6472,7 +6478,9 @@ int wc_PKCS7_AddRecipient_KEKRI(PKCS7* pkcs7, int keyWrapOID, byte* kek,
|
|||||||
word32 encryptedKeySz;
|
word32 encryptedKeySz;
|
||||||
|
|
||||||
int timeSz = 0;
|
int timeSz = 0;
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
time_t* tm = NULL;
|
time_t* tm = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (pkcs7 == NULL || kek == NULL || keyId == NULL)
|
if (pkcs7 == NULL || kek == NULL || keyId == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
@ -6539,6 +6547,7 @@ int wc_PKCS7_AddRecipient_KEKRI(PKCS7* pkcs7, int keyWrapOID, byte* kek,
|
|||||||
totalSz += (kekIdOctetStrSz + keyIdSz);
|
totalSz += (kekIdOctetStrSz + keyIdSz);
|
||||||
|
|
||||||
/* KEKIdentifier: GeneralizedTime (OPTIONAL) */
|
/* KEKIdentifier: GeneralizedTime (OPTIONAL) */
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
if (timePtr != NULL) {
|
if (timePtr != NULL) {
|
||||||
tm = (time_t*)timePtr;
|
tm = (time_t*)timePtr;
|
||||||
timeSz = GetAsnTimeString(tm, genTime, sizeof(genTime));
|
timeSz = GetAsnTimeString(tm, genTime, sizeof(genTime));
|
||||||
@ -6551,6 +6560,7 @@ int wc_PKCS7_AddRecipient_KEKRI(PKCS7* pkcs7, int keyWrapOID, byte* kek,
|
|||||||
}
|
}
|
||||||
totalSz += timeSz;
|
totalSz += timeSz;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* KEKIdentifier: OtherKeyAttribute SEQ (OPTIONAL) */
|
/* KEKIdentifier: OtherKeyAttribute SEQ (OPTIONAL) */
|
||||||
if (other != NULL && otherSz > 0) {
|
if (other != NULL && otherSz > 0) {
|
||||||
|
Reference in New Issue
Block a user