Ignore:
Timestamp:
Feb 7, 2019, 8:36:33 AM (5 years ago)
Author:
coas-nagasima
Message:

wolfsslを3.15.7にバージョンアップ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/src/crl.c

    r352 r372  
    5050{
    5151    WOLFSSL_ENTER("InitCRL");
    52 
     52    if(cm != NULL)
    5353    crl->heap = cm->heap;
     54    else
     55        crl->heap = NULL;
    5456    crl->cm = cm;
    5557    crl->crlList = NULL;
     
    154156
    155157    WOLFSSL_ENTER("FreeCRL");
    156 
    157158    if (crl->monitors[0].path)
    158159        XFREE(crl->monitors[0].path, crl->heap, DYNAMIC_TYPE_CRL_MONITOR);
     
    248249            #endif /* NO_SKID */
    249250                if (ca == NULL) {
     251                    XFREE(sig, crl->heap, DYNAMIC_TYPE_CRL_ENTRY);
     252                    XFREE(tbs, crl->heap, DYNAMIC_TYPE_CRL_ENTRY);
    250253                    WOLFSSL_MSG("Did NOT find CRL issuer CA");
    251254                    return ASN_CRL_NO_SIGNER_E;
     
    301304            if (doNextDate) {
    302305            #ifndef NO_ASN_TIME
    303                 if (!ValidateDate(crle->nextDate,crle->nextDateFormat, AFTER)) {
     306                if (!XVALIDATE_DATE(crle->nextDate,crle->nextDateFormat, AFTER)) {
    304307                    WOLFSSL_MSG("CRL next date is no longer valid");
    305308                    ret = ASN_AFTER_DATE_E;
     
    372375            WOLFSSL_MSG("Issuing missing CRL callback");
    373376            url[0] = '\0';
     377            if (cert->extCrlInfo) {
    374378            if (cert->extCrlInfoSz < (int)sizeof(url) -1 ) {
    375379                XMEMCPY(url, cert->extCrlInfo, cert->extCrlInfoSz);
     
    378382            else  {
    379383                WOLFSSL_MSG("CRL url too long");
     384            }
    380385            }
    381386
     
    441446
    442447    if (type == WOLFSSL_FILETYPE_PEM) {
    443         int eccKey = 0;   /* not used */
    444         EncryptedInfo info;
    445         info.ctx = NULL;
    446 
    447         ret = PemToDer(buff, sz, CRL_TYPE, &der, NULL, &info, &eccKey);
     448    #ifdef WOLFSSL_PEM_TO_DER
     449        ret = PemToDer(buff, sz, CRL_TYPE, &der, NULL, NULL, NULL);
    448450        if (ret == 0) {
    449451            myBuffer = der->buffer;
     
    455457            return -1;
    456458        }
     459    #else
     460        ret = NOT_COMPILED_IN;
     461    #endif
    457462    }
    458463
     
    488493}
    489494
     495#if defined(OPENSSL_EXTRA) && defined(HAVE_CRL)
     496int wolfSSL_X509_STORE_add_crl(WOLFSSL_X509_STORE *store, WOLFSSL_X509_CRL *newcrl)
     497{
     498    CRL_Entry   *crle;
     499    WOLFSSL_CRL *crl;
     500
     501    WOLFSSL_ENTER("wolfSSL_X509_STORE_add_crl");
     502    if (store == NULL || newcrl == NULL)
     503        return BAD_FUNC_ARG;
     504
     505    crl = store->crl;
     506    crle = newcrl->crlList;
     507
     508    if (wc_LockMutex(&crl->crlLock) != 0)
     509    {
     510        WOLFSSL_MSG("wc_LockMutex failed");
     511        return BAD_MUTEX_E;
     512    }
     513    crle->next = crl->crlList;
     514    crl->crlList = crle;
     515    newcrl->crlList = NULL;
     516    wc_UnLockMutex(&crl->crlLock);
     517
     518    WOLFSSL_LEAVE("wolfSSL_X509_STORE_add_crl", WOLFSSL_SUCCESS);
     519   
     520    return WOLFSSL_SUCCESS;
     521}
     522#endif
    490523
    491524#ifdef HAVE_CRL_MONITOR
     
    739772
    740773#ifndef max
    741     static INLINE int max(int a, int b)
     774    static WC_INLINE int max(int a, int b)
    742775    {
    743776        return a > b ? a : b;
     
    10131046        pathBuf = (char*)XMALLOC(pathLen+1, crl->heap,DYNAMIC_TYPE_CRL_MONITOR);
    10141047        if (pathBuf) {
    1015             XSTRNCPY(pathBuf, path, pathLen);
    1016             pathBuf[pathLen] = '\0'; /* Null Terminate */
     1048            XSTRNCPY(pathBuf, path, pathLen+1);
    10171049
    10181050            if (type == WOLFSSL_FILETYPE_PEM) {
Note: See TracChangeset for help on using the changeset viewer.