~ubuntu-branches/debian/sid/rsyslog/sid

« back to all changes in this revision

Viewing changes to runtime/nsd_gtls.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Michael Biebl, Daniel Pocock
  • Date: 2014-03-11 19:52:49 UTC
  • mfrom: (1.1.37)
  • Revision ID: package-import@ubuntu.com-20140311195249-phbsh9be8lebawti
Tags: 7.4.8-1
[ Michael Biebl ]
* New upstream release.
* Update Build-Depends:
  - Bump libestr-dev to (>= 0.1.9).
  - Tighten liblognorm-dev to (<< 1.0.0).
  - Replace libjson0-dev with libjson-c-dev, we no longer need the
    transitional package.
* Bump Standards-Version to 3.9.5. No further changes.

[ Daniel Pocock ]
* Make template parameter not mandatory in mongodb output plugin. Patch
  cherry-picked from upstream Git. (Closes: #740869, #721277)
* Ensure JSON templates are NUL terminated. Patch cherry-picked from
  upstream Git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *
3
3
 * An implementation of the nsd interface for GnuTLS.
4
4
 * 
5
 
 * Copyright (C) 2007, 2008 Rainer Gerhards and Adiscon GmbH.
 
5
 * Copyright (C) 2007-2013 Rainer Gerhards and Adiscon GmbH.
6
6
 *
7
7
 * This file is part of the rsyslog runtime library.
8
8
 *
547
547
        keyFile = glbl.GetDfltNetstrmDrvrKeyFile();
548
548
        dbgprintf("GTLS certificate file: '%s'\n", certFile);
549
549
        dbgprintf("GTLS key file: '%s'\n", keyFile);
 
550
        if(certFile == NULL) {
 
551
                errmsg.LogError(0, RS_RET_CERT_MISSING, "error: certificate file is not set, cannot "
 
552
                                "continue");
 
553
                ABORT_FINALIZE(RS_RET_CERT_MISSING);
 
554
        }
 
555
        if(keyFile == NULL) {
 
556
                errmsg.LogError(0, RS_RET_CERTKEY_MISSING, "error: key file is not set, cannot "
 
557
                                "continue");
 
558
                ABORT_FINALIZE(RS_RET_CERTKEY_MISSING);
 
559
        }
550
560
        CHKgnutls(gnutls_certificate_set_x509_key_file(xcred, (char*)certFile, (char*)keyFile, GNUTLS_X509_FMT_PEM));
551
561
 
552
562
finalize_it:
553
 
        if(iRet != RS_RET_OK) {
 
563
        if(iRet != RS_RET_OK && iRet != RS_RET_CERT_MISSING && iRet != RS_RET_CERTKEY_MISSING) {
554
564
                pGnuErr = gtlsStrerror(gnuRet);
555
565
                errno = 0;
556
566
                errmsg.LogError(0, iRet, "error adding our certificate. GnuTLS error %d, message: '%s', "
580
590
 
581
591
        /* sets the trusted cas file */
582
592
        cafile = glbl.GetDfltNetstrmDrvrCAF();
 
593
        if(cafile == NULL) {
 
594
                errmsg.LogError(0, RS_RET_CA_CERT_MISSING, "error: ca certificate is not set, cannot "
 
595
                                "continue");
 
596
                ABORT_FINALIZE(RS_RET_CA_CERT_MISSING);
 
597
        }
583
598
        dbgprintf("GTLS CA file: '%s'\n", cafile);
584
599
        gnuRet = gnutls_certificate_set_x509_trust_file(xcred, (char*)cafile, GNUTLS_X509_FMT_PEM);
585
600
        if(gnuRet < 0) {