tls.c (1eb95e1baef852d0971a1dd62a3293cd68f1ec35) tls.c (d5c3e1959cbabe9456bf1d5860ad718c6cd27fb8)
1/*
2 * QEMU migration TLS support
3 *
4 * Copyright (c) 2015 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 20 unchanged lines hidden (view full) ---

29#include "trace.h"
30
31static QCryptoTLSCreds *
32migration_tls_get_creds(MigrationState *s,
33 QCryptoTLSCredsEndpoint endpoint,
34 Error **errp)
35{
36 Object *creds;
1/*
2 * QEMU migration TLS support
3 *
4 * Copyright (c) 2015 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 20 unchanged lines hidden (view full) ---

29#include "trace.h"
30
31static QCryptoTLSCreds *
32migration_tls_get_creds(MigrationState *s,
33 QCryptoTLSCredsEndpoint endpoint,
34 Error **errp)
35{
36 Object *creds;
37 const char *tls_creds = migrate_tls_creds();
37 QCryptoTLSCreds *ret;
38
38 QCryptoTLSCreds *ret;
39
39 creds = object_resolve_path_component(
40 object_get_objects_root(), s->parameters.tls_creds);
40 creds = object_resolve_path_component(object_get_objects_root(), tls_creds);
41 if (!creds) {
41 if (!creds) {
42 error_setg(errp, "No TLS credentials with id '%s'",
43 s->parameters.tls_creds);
42 error_setg(errp, "No TLS credentials with id '%s'", tls_creds);
44 return NULL;
45 }
46 ret = (QCryptoTLSCreds *)object_dynamic_cast(
47 creds, TYPE_QCRYPTO_TLS_CREDS);
48 if (!ret) {
49 error_setg(errp, "Object with id '%s' is not TLS credentials",
43 return NULL;
44 }
45 ret = (QCryptoTLSCreds *)object_dynamic_cast(
46 creds, TYPE_QCRYPTO_TLS_CREDS);
47 if (!ret) {
48 error_setg(errp, "Object with id '%s' is not TLS credentials",
50 s->parameters.tls_creds);
49 tls_creds);
51 return NULL;
52 }
53 if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) {
54 return NULL;
55 }
56
57 return ret;
58}

--- 116 unchanged lines hidden ---
50 return NULL;
51 }
52 if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) {
53 return NULL;
54 }
55
56 return ret;
57}

--- 116 unchanged lines hidden ---