diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/tests/crypto-tls-x509-helpers.h | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/tests/crypto-tls-x509-helpers.h')
-rw-r--r-- | qemu/tests/crypto-tls-x509-helpers.h | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/qemu/tests/crypto-tls-x509-helpers.h b/qemu/tests/crypto-tls-x509-helpers.h deleted file mode 100644 index 356b49cd5..000000000 --- a/qemu/tests/crypto-tls-x509-helpers.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - * - * Author: Daniel P. Berrange <berrange@redhat.com> - */ - -#include <gnutls/gnutls.h> -#include <gnutls/x509.h> - -#include <gnutls/gnutls.h> -#include <gnutls/x509.h> - -#if !(defined WIN32) && \ - defined(CONFIG_TASN1) && \ - defined(LIBGNUTLS_VERSION_NUMBER) && \ - (LIBGNUTLS_VERSION_NUMBER >= 0x020600) -# define QCRYPTO_HAVE_TLS_TEST_SUPPORT -#endif - -#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT -# include <libtasn1.h> - -# include "qemu-common.h" - -/* - * This contains parameter about how to generate - * certificates. - */ -typedef struct QCryptoTLSTestCertReq QCryptoTLSTestCertReq; -struct QCryptoTLSTestCertReq { - gnutls_x509_crt_t crt; - - const char *filename; - - /* Identifying information */ - const char *country; - const char *cn; - const char *altname1; - const char *altname2; - const char *ipaddr1; - const char *ipaddr2; - - /* Basic constraints */ - bool basicConstraintsEnable; - bool basicConstraintsCritical; - bool basicConstraintsIsCA; - - /* Key usage */ - bool keyUsageEnable; - bool keyUsageCritical; - int keyUsageValue; - - /* Key purpose (aka Extended key usage) */ - bool keyPurposeEnable; - bool keyPurposeCritical; - const char *keyPurposeOID1; - const char *keyPurposeOID2; - - /* zero for current time, or non-zero for hours from now */ - int start_offset; - /* zero for 24 hours from now, or non-zero for hours from now */ - int expire_offset; -}; - -void test_tls_generate_cert(QCryptoTLSTestCertReq *req, - gnutls_x509_crt_t ca); -void test_tls_write_cert_chain(const char *filename, - gnutls_x509_crt_t *certs, - size_t ncerts); -void test_tls_discard_cert(QCryptoTLSTestCertReq *req); - -void test_tls_init(const char *keyfile); -void test_tls_cleanup(const char *keyfile); - -# define TLS_CERT_REQ(varname, cavarname, \ - country, commonname, \ - altname1, altname2, \ - ipaddr1, ipaddr2, \ - basicconsenable, basicconscritical, basicconsca, \ - keyusageenable, keyusagecritical, keyusagevalue, \ - keypurposeenable, keypurposecritical, \ - keypurposeoid1, keypurposeoid2, \ - startoffset, endoffset) \ - static QCryptoTLSTestCertReq varname = { \ - NULL, WORKDIR #varname "-ctx.pem", \ - country, commonname, altname1, altname2, \ - ipaddr1, ipaddr2, \ - basicconsenable, basicconscritical, basicconsca, \ - keyusageenable, keyusagecritical, keyusagevalue, \ - keypurposeenable, keypurposecritical, \ - keypurposeoid1, keypurposeoid2, \ - startoffset, endoffset \ - }; \ - test_tls_generate_cert(&varname, cavarname.crt) - -# define TLS_ROOT_REQ(varname, \ - country, commonname, \ - altname1, altname2, \ - ipaddr1, ipaddr2, \ - basicconsenable, basicconscritical, basicconsca, \ - keyusageenable, keyusagecritical, keyusagevalue, \ - keypurposeenable, keypurposecritical, \ - keypurposeoid1, keypurposeoid2, \ - startoffset, endoffset) \ - static QCryptoTLSTestCertReq varname = { \ - NULL, WORKDIR #varname "-ctx.pem", \ - country, commonname, altname1, altname2, \ - ipaddr1, ipaddr2, \ - basicconsenable, basicconscritical, basicconsca, \ - keyusageenable, keyusagecritical, keyusagevalue, \ - keypurposeenable, keypurposecritical, \ - keypurposeoid1, keypurposeoid2, \ - startoffset, endoffset \ - }; \ - test_tls_generate_cert(&varname, NULL) - -extern const ASN1_ARRAY_TYPE pkix_asn1_tab[]; - -#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */ |