FreeRDP
smartcardlogon.c File Reference
#include <string.h>
#include <winpr/error.h>
#include <winpr/ncrypt.h>
#include <winpr/string.h>
#include <winpr/wlog.h>
#include <winpr/crypto.h>
#include <winpr/path.h>
#include <freerdp/log.h>
#include <freerdp/freerdp.h>
#include <winpr/print.h>
#include <freerdp/utils/smartcardlogon.h>
#include <freerdp/crypto/crypto.h>
#include <openssl/obj_mac.h>

Macros

#define TAG   FREERDP_TAG("smartcardlogon")
 

Functions

static void delete_file (char *path)
 
static void smartcardKeyInfo_Free (SmartcardKeyInfo *key_info)
 
void smartcardCertInfo_Free (SmartcardCertInfo *scCert)
 
void smartcardCertList_Free (SmartcardCertInfo **cert_list, size_t count)
 
static BOOL add_cert_to_list (SmartcardCertInfo ***certInfoList, size_t *count, SmartcardCertInfo *certInfo)
 
static BOOL treat_sc_cert (SmartcardCertInfo *scCert)
 
static BOOL set_info_certificate (SmartcardCertInfo *cert, BYTE *certBytes, DWORD cbCertBytes, const char *userFilter, const char *domainFilter)
 
static BOOL build_pkinit_args (NCRYPT_PROV_HANDLE provider, SmartcardCertInfo *scCert)
 
static BOOL list_provider_keys (const rdpSettings *settings, NCRYPT_PROV_HANDLE provider, LPCWSTR csp, LPCWSTR scope, const char *userFilter, const char *domainFilter, SmartcardCertInfo ***pcerts, size_t *pcount)
 
static BOOL smartcard_hw_enumerateCerts (const rdpSettings *settings, LPCWSTR csp, const char *reader, const char *userFilter, const char *domainFilter, SmartcardCertInfo ***scCerts, size_t *retCount)
 
static char * create_temporary_file (void)
 
static SmartcardCertInfosmartcardCertInfo_New (const char *privKeyPEM, const char *certPEM)
 
static BOOL smartcard_sw_enumerateCerts (const rdpSettings *settings, SmartcardCertInfo ***scCerts, size_t *retCount)
 
BOOL smartcard_enumerateCerts (const rdpSettings *settings, SmartcardCertInfo ***scCerts, size_t *retCount, BOOL gateway)
 
static BOOL set_settings_from_smartcard (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *value)
 
BOOL smartcard_getCert (const rdpContext *context, SmartcardCertInfo **cert, BOOL gateway)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("smartcardlogon")

FreeRDP: A Remote Desktop Protocol Implementation Logging in with smartcards

Copyright 2022 David Fort conta.nosp@m.ct@h.nosp@m.arden.nosp@m.ing-.nosp@m.consu.nosp@m.ltin.nosp@m.g.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ add_cert_to_list()

static BOOL add_cert_to_list ( SmartcardCertInfo ***  certInfoList,
size_t *  count,
SmartcardCertInfo certInfo 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_pkinit_args()

static BOOL build_pkinit_args ( NCRYPT_PROV_HANDLE  provider,
SmartcardCertInfo scCert 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_temporary_file()

static char* create_temporary_file ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete_file()

static void delete_file ( char *  path)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ list_provider_keys()

static BOOL list_provider_keys ( const rdpSettings *  settings,
NCRYPT_PROV_HANDLE  provider,
LPCWSTR  csp,
LPCWSTR  scope,
const char *  userFilter,
const char *  domainFilter,
SmartcardCertInfo ***  pcerts,
size_t *  pcount 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_info_certificate()

static BOOL set_info_certificate ( SmartcardCertInfo cert,
BYTE certBytes,
DWORD  cbCertBytes,
const char *  userFilter,
const char *  domainFilter 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_settings_from_smartcard()

static BOOL set_settings_from_smartcard ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
const char *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcard_enumerateCerts()

BOOL smartcard_enumerateCerts ( const rdpSettings *  settings,
SmartcardCertInfo ***  scCerts,
size_t *  retCount,
BOOL  gateway 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcard_getCert()

BOOL smartcard_getCert ( const rdpContext *  context,
SmartcardCertInfo **  cert,
BOOL  gateway 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcard_hw_enumerateCerts()

static BOOL smartcard_hw_enumerateCerts ( const rdpSettings *  settings,
LPCWSTR  csp,
const char *  reader,
const char *  userFilter,
const char *  domainFilter,
SmartcardCertInfo ***  scCerts,
size_t *  retCount 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcard_sw_enumerateCerts()

static BOOL smartcard_sw_enumerateCerts ( const rdpSettings *  settings,
SmartcardCertInfo ***  scCerts,
size_t *  retCount 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcardCertInfo_Free()

void smartcardCertInfo_Free ( SmartcardCertInfo scCert)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcardCertInfo_New()

static SmartcardCertInfo* smartcardCertInfo_New ( const char *  privKeyPEM,
const char *  certPEM 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcardCertList_Free()

void smartcardCertList_Free ( SmartcardCertInfo **  cert_list,
size_t  count 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smartcardKeyInfo_Free()

static void smartcardKeyInfo_Free ( SmartcardKeyInfo *  key_info)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ treat_sc_cert()

static BOOL treat_sc_cert ( SmartcardCertInfo scCert)
static
Here is the call graph for this function:
Here is the caller graph for this function: