]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth: auth-client - Support sending extra_fields.
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 5 Aug 2020 19:25:12 +0000 (22:25 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 27 Aug 2020 06:20:18 +0000 (06:20 +0000)
src/lib-auth/auth-client-request.c
src/lib-auth/auth-client.h

index 48db7f9d0b41370442e75a2b83394d9726cd936a..bf8b88290130fa9a72d1073c7a6e02006943484f 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
+#include "array.h"
 #include "str.h"
 #include "strescape.h"
 #include "ostream.h"
@@ -97,6 +98,13 @@ static void auth_server_send_new_request(struct auth_client_connection *conn,
                str_append(str, "\tforward_fields=");
                str_append_tabescaped(str, info->forward_fields);
        }
+       if (array_is_created(&info->extra_fields)) {
+               const char *const *fieldp;
+               array_foreach(&info->extra_fields, fieldp) {
+                       str_append_c(str, '\t');
+                       str_append_tabescaped(str, *fieldp);
+               }
+       }
        if (info->initial_resp_base64 != NULL) {
                str_append(str, "\tresp=");
                str_append_tabescaped(str, info->initial_resp_base64);
index 898d744961fb4a18f78604a11c73053c15c22eca..917f9042e28c70a2ff5ba1f0187d1c42dd025455 100644 (file)
@@ -46,6 +46,7 @@ struct auth_request_info {
        const char *local_name;
        const char *client_id;
        const char *forward_fields;
+       ARRAY_TYPE(const_string) extra_fields;
 
        unsigned int ssl_cipher_bits;
        const char *ssl_cipher;