summaryrefslogtreecommitdiff
path: root/tests/virnettlshelpers.h
Commit message (Collapse)AuthorAgeFilesLines
* lib: Prefer WITH_* prefix for #if conditionalsMichal Privoznik2020-09-021-1/+1
| | | | | | | | | | | | | Currently, we are mixing: #if HAVE_BLAH with #if WITH_BLAH. Things got way better with Pavel's work on meson, but apparently, mixing these two lead to confusing and easy to miss bugs (see 31fb929eca for instance). While we were forced to use HAVE_ prefix with autotools, we are free to chose our own prefix with meson and since WITH_ prefix appears to be more popular let's use it everywhere. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* tests: use #pragma once in headersJonathon Jongsma2019-06-191-10/+7
| | | | | | Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* Enforce a standard header file guard symbol nameDaniel P. Berrangé2018-12-141-3/+3
| | | | | | | | | | | | | | Require that all headers are guarded by a symbol named LIBVIRT_$FILENAME where $FILENAME is the uppercased filename, with all characters outside a-z changed into '_'. Note we do not use a leading __ because that is technically a namespace reserved for the toolchain. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Fix many mistakes & inconsistencies in header file layoutDaniel P. Berrangé2018-12-141-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a syntax-check script that validates header files use a common layout: /* ...copyright header... */ <one blank line> #ifndef SYMBOL # define SYMBOL ....content.... #endif /* SYMBOL */ For any file ending priv.h, before the #ifndef, we will require a guard to prevent bogus imports: #ifndef SYMBOL_ALLOW # error .... #endif /* SYMBOL_ALLOW */ <one blank line> The many mistakes this script identifies are then fixed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* Remove all Author(s): lines from source file headersDaniel P. Berrangé2018-12-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many files there are header comments that contain an Author: statement, supposedly reflecting who originally wrote the code. In a large collaborative project like libvirt, any non-trivial file will have been modified by a large number of different contributors. IOW, the Author: comments are quickly out of date, omitting people who have made significant contribitions. In some places Author: lines have been added despite the person merely being responsible for creating the file by moving existing code out of another file. IOW, the Author: lines give an incorrect record of authorship. With this all in mind, the comments are useless as a means to identify who to talk to about code in a particular file. Contributors will always be better off using 'git log' and 'git blame' if they need to find the author of a particular bit of code. This commit thus deletes all Author: comments from the source and adds a rule to prevent them reappearing. The Copyright headers are similarly misleading and inaccurate, however, we cannot delete these as they have legal meaning, despite being largely inaccurate. In addition only the copyright holder is permitted to change their respective copyright statement. Reviewed-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* tls: remove support for gnutls 1.x.x, require 2.2.0Daniel P. Berrange2016-06-081-1/+0
| | | | | | | | | | We need to use the gnutls_priority_set_direct method which was not introduced until 2.1.7, so bump version to 2.2.0 which is the first stable release with it included. This release dates from Dec 2007 so it is reasonable to ditch support for the 1.x.x series for gnutls releases entirely. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix parallel runs of TLS test suitesDaniel P. Berrange2013-08-091-4/+2
| | | | | | | Use a separate keyfile name for the two TLS test suites so that they don't clash when running tests in parallel Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix validation of CA certificate chainsDaniel P. Berrange2013-08-081-0/+3
| | | | | | | | | | | The code added to validate CA certificates did not take into account the possibility that the cacert.pem file can contain multiple (concatenated) cert data blocks. Extend the code for loading CA certs to use the gnutls APIs for loading cert lists. Add test cases to check that multi-level trees of certs will validate correctly. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Avoid re-generating certs every timeDaniel P. Berrange2013-08-081-2/+2
| | | | | | | | | Currently every test case in the TLS test suite generates the certs fresh. This is a waste of time, since its parameters don't change across test cases. Create certs once in main method. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Split TLS test into two separate testsDaniel P. Berrange2013-08-081-0/+79
The virnettlscontexttest.c tests both virNetTLSContext and virNetTLSSession functionality. Split into two separate tests, to make the code size more manageable Signed-off-by: Daniel P. Berrange <berrange@redhat.com>