|
|
bb7cd1 |
From 61c2661fe7445531f53ef298a98a21ae0278397c Mon Sep 17 00:00:00 2001
|
|
|
bb7cd1 |
From: Sumit Bose <sbose@redhat.com>
|
|
|
bb7cd1 |
Date: Thu, 16 Mar 2017 13:00:48 +0100
|
|
|
bb7cd1 |
Subject: [PATCH 56/60] ssh: add support for certificates from non-default
|
|
|
bb7cd1 |
views
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
bb7cd1 |
---
|
|
|
bb7cd1 |
src/responder/ssh/ssh_reply.c | 20 +++++++++++++++++++-
|
|
|
bb7cd1 |
1 file changed, 19 insertions(+), 1 deletion(-)
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
diff --git a/src/responder/ssh/ssh_reply.c b/src/responder/ssh/ssh_reply.c
|
|
|
bb7cd1 |
index 7093e47253b5687bab387feed5299c2d0841d43c..1bb9d331868cc18488718c24fd82f32af780b525 100644
|
|
|
bb7cd1 |
--- a/src/responder/ssh/ssh_reply.c
|
|
|
bb7cd1 |
+++ b/src/responder/ssh/ssh_reply.c
|
|
|
bb7cd1 |
@@ -204,7 +204,7 @@ ssh_get_output_keys(TALLOC_CTX *mem_ctx,
|
|
|
bb7cd1 |
uint32_t i = 0;
|
|
|
bb7cd1 |
errno_t ret;
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
- elements = talloc_zero_array(mem_ctx, struct ldb_message_element *, 5);
|
|
|
bb7cd1 |
+ elements = talloc_zero_array(mem_ctx, struct ldb_message_element *, 6);
|
|
|
bb7cd1 |
if (elements == NULL) {
|
|
|
bb7cd1 |
return ENOMEM;
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
@@ -244,6 +244,24 @@ ssh_get_output_keys(TALLOC_CTX *mem_ctx,
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
}
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
+ if (DOM_HAS_VIEWS(domain)) {
|
|
|
bb7cd1 |
+ user_cert = ldb_msg_find_element(msg, OVERRIDE_PREFIX SYSDB_USER_CERT);
|
|
|
bb7cd1 |
+ if (user_cert != NULL) {
|
|
|
bb7cd1 |
+ ret = get_valid_certs_keys(elements, ssh_ctx, user_cert,
|
|
|
bb7cd1 |
+ &elements[i]);
|
|
|
bb7cd1 |
+ if (ret != EOK) {
|
|
|
bb7cd1 |
+ DEBUG(SSSDBG_OP_FAILURE, "get_valid_certs_keys failed.\n");
|
|
|
bb7cd1 |
+ goto done;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
+ if (elements[i] != NULL) {
|
|
|
bb7cd1 |
+ elements[i]->flags |= SSS_EL_FLAG_BIN_DATA;
|
|
|
bb7cd1 |
+ num_keys += elements[i]->num_values;
|
|
|
bb7cd1 |
+ i++;
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
+ }
|
|
|
bb7cd1 |
+
|
|
|
bb7cd1 |
*_elements = elements;
|
|
|
bb7cd1 |
*_num_keys = num_keys;
|
|
|
bb7cd1 |
|
|
|
bb7cd1 |
--
|
|
|
bb7cd1 |
2.9.3
|
|
|
bb7cd1 |
|