Mario Pasquali 13 décembre 2001 En collaboration avec:
Vue d ensemble Thèmes traités Windows Smart Card Logon Développement d une DLL GINA Développement d un CSP CryptoAPI 2
Vue d ensemble (2) Winlogon Windows Logon Process GINA Graphical Identification and Authentication Certificates Windows Certificate Store User mode User mode CAPI Cryptographic Applicaton Program Interface CSP Cryptographic Service Provider Software Crypto Library Driver WDM Driver Hardware Crypto Device Kernel mode Hardware 3
Windows Smart Card Logon
Smart Card Logon Introduction Infrastructure à clé publique (PKI) Cartes à puces Mise en œuvre avec etoken d Aladdin 5
Smart Card Logon Configuration Windows 2000 domain controller Certificate Authority Smart Card Enrollment Agent Smart Card Client Server Domain Controller Client Smart Card Client Certification Authority Enrollment Agent 10BaseT 6
Smart Card Logon Kerberos Protocole d authentification Supporté par Windows 2000 Phase d initialisation avec clés symétriques 7
Smart Card Logon Extension PKINIT de Kerberos Client Winlogon (1) S/c Insertion (SAS) PIN (2) (3) GINA LsaLogonUser, PIN Active Directory Smart Card Private User certificate Subject Alternative Name Public PIN Certificate (5) Authenticator Signature (6) Smart Card CSP LSA (4) PIN Kerberos SSP (7) AS request Certif + Authenticator (10) rdnkey(tgt), (8) user@domain pubkey(rndkey), sign KDC (9) User info 8
Introduction à Winlogon et GINA
Intro Winlogon et GINA Contexte Client Winlogon (1) S/c Insertion (SAS) PIN (2) (3) GINA LsaLogonUser, PIN Active Directory Smart Card Private User certificate Subject Alternative Name Public PIN Certificate (5) Authenticator Signature (6) Smart Card CSP LSA (4) PIN Kerberos SSP (7) AS request (8) user@domain Certif + Authenticator (10) rdnkey(tgt), pubkey(rndkey), sign KDC (9) User info 10
Intro Winlogon et GINA Composants de Winlogon Winlogon.exe Premier processus exécuté par le système d exploitation GINA Identification et authentification graphique Gère l intéraction avec l utilisateur Network Providers Donnent accès à divers types de réseaux 11
Intro Winlogon et GINA Winlogon et GINA Tâches de Winlogon Enregistrement de Ctrl-Alt-Del Création des bureaux (desktops) Appel des points d entrée de GINA Tâches de GINA Reconnaissance des SAS spécifiques Authentification de l utilisateur Création du shell utilisateur 12
Développement d une DLL GINA
Développement GINA Objectifs Authentification d un utilisateur dans le domaine local d une station de travail Interfaçage avec du matériel spécifique 14
Développement GINA DLL de traçage Expérience avec GINA Compréhension des points d entrée Principe Winlogon ginalog.dll gina.log msgina.dll 15
Développement GINA Environnement de test Utilisation d un log Win2k Free Visual C++ 6.0 Dev Test Win2k Free GINA Logger 10BaseT 16
Développement GINA Interfaçage avec matériel spécifique Carte de développement USB Informations de logon stockées en mémoire non-volatile de la carte USB SAS spécifiques Insertion de la carte USB Extraction de la carte USB 17
Développement GINA Interfaçage avec matériel spécifique (2) Boot Logged Out Device connection Manual logoff Administrator force Logoff Logged On Device deconnection Device connection Workstation Locked 18
Développement GINA Interfaçage avec matériel spécifique (3) Démonstration (3 min) 19
Développement GINA Conclusion Redémarrages fréquents Machine de test performante conseillée 20
Introduction à CryptoAPI
Intro CryptoAPI Contexte Client Winlogon (1) S/c Insertion (SAS) PIN (2) (3) GINA LsaLogonUser, PIN Active Directory Smart Card Private User certificate Subject Alternative Name Public PIN Certificate (5) Authenticator Signature (6) Smart Card CSP LSA (4) PIN Kerberos SSP (7) AS request (8) user@domain Certif + Authenticator (10) rdnkey(tgt), pubkey(rndkey), sign KDC (9) User info 22
Intro CryptoAPI CryptoAPI Jeu de fonctions cryptographiques Applications indépendantes du matériel CryptoAPI Application A Application B wincrypt.h CryptoSPI CryptoAPI cspdk.h CSP 1 CSP 2 CSP 3 23
Intro CryptoAPI CSP (Cryptographic Service Provider) Fournisseur de services cryptographiques Diverses implémentations Hardware Software Mixed 24
Développement d un CSP CryptoAPI
Développement CSP Objectifs Génération d un certificat Opérations cryptographiques en logiciel avec une librairie cryptographique 26
Développement CSP Déroulement du développement Développement d un squelette Trace de la génération d un certificat Développement des fonctions utilisées Validation des fonctions écrites 27
Développement CSP CSP de traçage Application CAPI Cryptographic Applicaton Program Interface CSP Cryptographic Service Provider 28
Développement CSP Requête de certificat Client Certificate Client CSP PKCS#10 request Server Certificate Authority 29
Développement CSP Requête d un certificat (2) Certificate Client 1. Create the keyset CSP CPAcquireContext 2. Create the key pair CPGenKey 3. Export Exchange Key CPExportKey Exchange Public Key Certificate 4. Hash certificate data CPHashData Hash Data SHA1 5. Sign Hash AddBytes CPSignHash Signature Sign 6. Close the CSP CPReleaseContext 7. PKCS#10 Certificate request Certificate Server Exchange Private Key 30
Développement CSP Implémentation avec OpenSSL Application Wincrypt.h CAPI Cryptographic Applicaton Program Interface Cspdk.h CSP Cryptographic Service Provider Import OpenSSL Export OpenSSL files 31
Développement CSP Implémentation avec OpenSSL Démonstration (7 min) 32
Développement CSP Conclusion Beaucoup de code nécessaire avant de commencer réellement Manque de ressources (documentation, code source, exemples) Futur travail grandement simplifié 33
Général Temps passé sur chaques parties Smart Card Logon = 1 semaine GINA = 3 semaines GinaLog = ½ semaine GinaLib = 1 ½ semaines UsbGina = 1 semaine (1 500 lignes de code) CSP = 7 semaines CspLog = 1 ½ semaines (1 300 lignes de code) Framework = 3 semaines (2 500 lignes de code) Crypto++ = ½ semaine OpenSSL = 1 semaine (framework + 500 lignes de code) Problème format = 1 semaine 34
Questions (10 min)