From 649527ef8d39fed9791d52dd19bc1f1d21b7d03d Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 2 Feb 2022 13:22:08 +0100 Subject: [PATCH] Fixed const correctness of freerdp_smartcard_list --- client/common/smartcard_cli.c | 2 +- include/freerdp/utils/smartcard_cli.h | 2 +- libfreerdp/core/smartcardlogon.c | 14 +++++++------- libfreerdp/core/smartcardlogon.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/common/smartcard_cli.c b/client/common/smartcard_cli.c index 86668d761..ef2974e6e 100644 --- a/client/common/smartcard_cli.c +++ b/client/common/smartcard_cli.c @@ -19,7 +19,7 @@ #include #include "../../libfreerdp/core/smartcardlogon.h" -BOOL freerdp_smartcard_list(rdpSettings* settings) +BOOL freerdp_smartcard_list(const rdpSettings* settings) { SmartcardCert certs[64] = { 0 }; DWORD i, count; diff --git a/include/freerdp/utils/smartcard_cli.h b/include/freerdp/utils/smartcard_cli.h index ee13a7703..4aec92bce 100644 --- a/include/freerdp/utils/smartcard_cli.h +++ b/include/freerdp/utils/smartcard_cli.h @@ -28,7 +28,7 @@ extern "C" { #endif /* __cplusplus */ - FREERDP_API BOOL freerdp_smartcard_list(rdpSettings* settings); + FREERDP_API BOOL freerdp_smartcard_list(const rdpSettings* settings); #ifdef __cplusplus } diff --git a/libfreerdp/core/smartcardlogon.c b/libfreerdp/core/smartcardlogon.c index 960d117cf..230679049 100644 --- a/libfreerdp/core/smartcardlogon.c +++ b/libfreerdp/core/smartcardlogon.c @@ -127,7 +127,7 @@ static BOOL treat_sc_cert(SmartcardCert* scCert) } #ifndef _WIN32 -static BOOL build_pkinit_args(rdpSettings* settings, SmartcardCert* scCert) +static BOOL build_pkinit_args(const rdpSettings* settings, SmartcardCert* scCert) { /* pkinit args only under windows * PKCS11:module_name=opensc-pkcs11.so @@ -149,9 +149,9 @@ static BOOL build_pkinit_args(rdpSettings* settings, SmartcardCert* scCert) } #endif /* _WIN32 */ -static BOOL smartcard_hw_enumerateCerts(rdpSettings* settings, LPCWSTR csp, const char* reader, - const char* userFilter, SmartcardCert* scCert, DWORD count, - DWORD* retCount) +static BOOL smartcard_hw_enumerateCerts(const rdpSettings* settings, LPCWSTR csp, + const char* reader, const char* userFilter, + SmartcardCert* scCert, DWORD count, DWORD* retCount) { BOOL ret = FALSE; LPWSTR scope = NULL; @@ -333,8 +333,8 @@ out: return ret; } -static BOOL smartcard_sw_enumerateCerts(rdpSettings* settings, SmartcardCert* scCert, DWORD count, - DWORD* retCount) +static BOOL smartcard_sw_enumerateCerts(const rdpSettings* settings, SmartcardCert* scCert, + DWORD count, DWORD* retCount) { size_t sz; @@ -382,7 +382,7 @@ out_error: return FALSE; } -BOOL smartcard_enumerateCerts(rdpSettings* settings, SmartcardCert* scCert, DWORD count, +BOOL smartcard_enumerateCerts(const rdpSettings* settings, SmartcardCert* scCert, DWORD count, DWORD* retCount) { BOOL ret; diff --git a/libfreerdp/core/smartcardlogon.h b/libfreerdp/core/smartcardlogon.h index 49f8391a1..0177634f8 100644 --- a/libfreerdp/core/smartcardlogon.h +++ b/libfreerdp/core/smartcardlogon.h @@ -42,7 +42,7 @@ typedef struct _SmartcardCert SmartcardCert; FREERDP_API void smartcardCert_Free(SmartcardCert* scCert); -FREERDP_API BOOL smartcard_enumerateCerts(rdpSettings* settings, SmartcardCert* scCert, DWORD count, +FREERDP_API BOOL smartcard_enumerateCerts(const rdpSettings* settings, SmartcardCert* scCert, DWORD count, DWORD* retCount); #endif /* LIBFREERDP_CORE_SMARTCARDLOGON_H */