utcTime->Data = d = PORT_Alloc(13);
if (!utcTime->Data)
return SECFailure;
-
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int second;
- if (!CFCalendarDecomposeAbsoluteTime(SecCFCalendarGetZulu(), date, "yMdHms", &year, &month, &day, &hour, &minute, &second))
+ __block int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
+ __block bool result;
+ SecCFCalendarDoWithZuluCalendar(^(CFCalendarRef zuluCalendar) {
+ result = CFCalendarDecomposeAbsoluteTime(zuluCalendar, date, "yMdHms", &year, &month, &day, &hour, &minute, &second);
+ });
+ if (!result)
return SECFailure;
-
/* UTC time does not handle the years before 1950 */
if (year < 1950)
return SECFailure;
SECOidTag pubkAlgTag;
SecAsn1Item signature = { 0 };
OSStatus rv;
- PLArenaPool *poolp, *tmppoolp;
+ PLArenaPool *poolp, *tmppoolp = NULL;
const SECAlgorithmID *algID = NULL;
//CERTSubjectPublicKeyInfo *spki;
#endif
PORT_FreeArena(tmppoolp, PR_FALSE); /* awkward memory management :-( */
+ tmppoolp = 0;
} else {
signature.Length = SecKeyGetSize(privkey, kSecKeySignatureSize);
signature.Data = PORT_ZAlloc(signature.Length);
SECITEM_FreeItem (&signature, PR_FALSE);
if (privkey)
SECKEY_DestroyPrivateKey(privkey);
+ if (tmppoolp)
+ PORT_FreeArena(tmppoolp, PR_FALSE);
return SECFailure;
}