FreeRDP
smartcardlogon.c File Reference
#include <string.h>
#include <openssl/bio.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/objects.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/utils/smartcardlogon.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, DWORD count)
 
static BOOL treat_sc_cert (SmartcardCertInfo *scCert)
 
static int allocating_sprintf (char **dst, const char *fmt,...)
 
static BOOL build_pkinit_args (const rdpSettings *settings, 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, DWORD *retCount)
 
static BOOL write_pem (const char *file, const char *pem)
 
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, DWORD *retCount)
 
BOOL smartcard_enumerateCerts (const rdpSettings *settings, SmartcardCertInfo ***scCerts, DWORD *retCount, BOOL gateway)
 
static BOOL set_settings_from_smartcard (rdpSettings *settings, size_t 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

◆ allocating_sprintf()

static int allocating_sprintf ( char **  dst,
const char *  fmt,
  ... 
)
static
Here is the caller graph for this function:

◆ build_pkinit_args()

static BOOL build_pkinit_args ( const rdpSettings *  settings,
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_settings_from_smartcard()

static BOOL set_settings_from_smartcard ( rdpSettings *  settings,
size_t  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,
DWORD *  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,
DWORD *  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,
DWORD *  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,
DWORD  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:

◆ write_pem()

static BOOL write_pem ( const char *  file,
const char *  pem 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: