l2tp-ipsec-vpn/0000775000175000017500000000000012040201227013775 5ustar wejaegerwejaegerl2tp-ipsec-vpn/changelog0000664000175000017500000001513012040201227015647 0ustar wejaegerwejaeger1.0.9 - fixed bug removes files that were installed by another package (Closes: #684962) 1.0.8 - fixed bug wrong email address choosen as username in EAP TLS authentication - now caching EAP-TLS autentication certificate in /etc/ipsec.d/certs directory 1.0.7 - to be compatible with more linux distributions use service command instead of invoke-rc.d command to start and stop runlevel services - corrected wrong desktop check - corrected platform specific qt includes - in Makefile configure the appropriate qmake command (qmake or qmake-qt4) - fixed FTBFS because gcc-4.7 no longer includes unistd.h - fixed bug connection editor crashes on selecting a certificate or private key from smart card (LP: #975822) - fixed bug trayicon doesn't scale properly (LP: #98616) - provided a separate error status icon 1.0.6 - transfered writing files connectionName.info and defaultgateway.info to L2tpIPsecVpnControlDaemon 1.0.5 - unified runtime path, no longer using /var/tmp/L2tpIPsecVpn - enhanced install Makefile to create a world writable runtime directory - enhanced uninstall Makefile to remove runtime files and directories - chanaged debian copyright file to conform to the new official 1.0 Format - debian watch file is now working correct 1.0.4 - pure L2TP VPN without IPSEC encryption is now possible - disable connection names in context menu when there is no default gateway - enabled i18n and added German translation - enabled size grip for all dialogs - check which graphical su command (gksudo, beesu or kdesudo) is available when starting connection editor - added postrm maintainer script to delete all configuration and runtime files on purge - fixed bug unable to add static routes (LP: #932591) - fixed bug If no smartcard is inserted the insert smartcard dialog is not shown (LP: ##941740) - fixed bug Smartcard inserted event is not detected (LP: #941741) - fixed bug Invalid private key file is written when importing PKCS#12 certificate bundle (LP: #941743) - fixed bug Running Pluto is not detected (LP: #941746) - fixed bug xl2tpd overrides and ipparam settings (LP: #95152) 1.0.3 - added timestamp to connection information log - fixed bug pre-shared key containing double quote not handled properly (LP: #881987) 1.0.2 - fixed bug No connection names in context menu when using unity desktop (LP: #877083) - fixed bug Unable to successfully install/upgrade (LP: #818294) - fixed bug L2tpIPsecVpn core dumps (LP: #845845) - fixed bug copy and paste pre-shared key does not truncate trailing CR/LF (LP: #853020) - fixed bug System tray icon disappears sometimes (LP: #791471) 1.0.1 - Makefile: * clean target did not delete all generated files * added clobber and uninstall target - Renamed targets in Qt test project files 1.0.0 - fixed bug when connecting ipsec auto --up is occasionally started before pluto is running or has added the connection (LP: #781498) - fixed bug ipsec setup start failed (LP: #793542) - added menu entry to start applet - Debian Mainainer scrips * added VCS fields to control file * changed long description in control file * added gksu dependency in control file * corrected format link in copyright file * made url of Source file in copyright file version independent * used user owning the old PID to restart applet in postinst file * removed postrm file 0.9.9 - added help button to all dialogs - added a tab to the ConnectionInformation dialog to show various connection information and connection statistics - Animated system tray icon when connecting or disconnecting - Certificates to be used for IPsec rsasig authentication can now be imported from a PKCS#12 certificate bundle - Debian package installer: start / restart applet after installation or upgrade - Spitted context menu. Now connection specific action are in a separate connection menu which is activated by a left click on the system tray icon - fixed bug dial-up to network interfaces (PPPn) are not automatically detected (LP: #741430) - fixed bug disconnection of physical network interface not detected if 'Use default gateway on the remote network' is selected in PPP -> IP setting -> Routes configuration for the VPN connection (LP: #750000) - fixed bug manager applet no longer started automatically after upgrading it (LP: #750174) - fixed bug connection editor has wrong button layout (LP: #759510) - fixed bug invalid version string in .desktop files (LP: #759515) - fixed bug network interface monitor does not set netmask for address and route entries (LP: #761036) - fixed bug icon not available to other users (LP: #761216) 0.9.8 - no longer depends on ppp-2.4.5-eaptls-mppe package. It is optional and only needed if one wants to use PPP EAP-TLS authentication - No longer depends on OpenSC, any PKCS11 library can be used and is dynamically loaded - Increased retry attempts to detect a system tray from 10 to 30 - Use QT's QSslCertificate class instead of OpenSSL library calls - Show also certificate serial number in tool tips of certificate selection dialogs - Added preferences button in connection editor dialog - Removed apply button in connection editor dialog - Fixed bug don't insist on overwriting /etc/resolv.conf 0.9.7 - When connecting, now calling 'ipsec auto --ready' before calling 'ipsec auto --up' to avoid occasional need --listen before --initiate error 0.9.6 - Fixed missing execute rights for L2tpIPsecVpn-down script - Now using /var/run/pluto/ipsec.info instead of /var/run/pluto/pluto.pid for testing if ipsec service is started - Fixed delayed display of disconnected status 0.9.5 - Fixed bug successful connection not recognized by client if ip address of ipsec gateway and ip address of remote PPP are different 0.9.4 - Less restrictive IPsec default configuration removed esp=3des-sha1, ikelifetime=8h, ike=3des-sha1-modp1024, keylife=24h - Increased PPP interface is up check time from 20 to 30 seconds - Ensuring a clean starting state before every connection attempt - A domain name is now allowed as Remote Server (IPsec peer) - Fixed looping packets bug, in cases where ip addresses of remote IPsec server and PPP server are different 0.9.3 - Fixed broken password callback in Maverick series - Fixed asking to insert smart card for non EAP authentications - Fixed read only edit field for private key passphrase in connection editor (PPP tab, EAP properties) - Fixed missing host's ID when writing ipsec PSK secrets - Connection Information dialog is now modeless - Enabled password callback for CHAP authentication 0.9.2 - Start of l2tp-ipsec-vpn project. l2tp-ipsec-vpn/nls/0000775000175000017500000000000012040201227014571 5ustar wejaegerwejaegerl2tp-ipsec-vpn/nls/L2tpIPsecVpn_de.ts0000664000175000017500000017641312040201227020056 0ustar wejaegerwejaeger AdvancedSettingsDialog Advanced Settings Erweiterte Einstellungen Compression Komprimierung Allow &BSD data compression &BSD-Komprimierung erlauben Allow &Deflate data compression &Deflate-Komprimierung erlauben Use TCP &header compression TCP-&Headerkomprimierung verwenden Echo Echo Send PPP &echo packets Sende PPP-&Echo Pakete - Advanced Settings - Erweiterte Einstellungen CertificateImportDialog Import Certificate Dialog Zertifikat Importieren Full path to PKCS12 (*.p12, *.pfx) encoded certificate bundle file to import Geben Sie hier den vollständigen Pfad zu der PKCS12 (*.p12, *.pfx) Zertifikatdatei ein die Sie importieren möchten PKCS12 File: PKCS12 Datei: If checked. the imported certificate is automatically selected as IPsec authentication certificate Wenn angekreutzt, dann wird das importierte Zertifikat automatisch als IPsec-Authentifizierungszertifikat verwendet Use this certificate for IPsec authentication Verwende dieses Zertifikat zur IPsec-Authentifizierung Private key passphrase: Kennwort für den privaten Schlüssel: Enter the passphrase that shall be used to encrypt the imported private key Geben Sie das Kennwort ein, dass zur Verschlüsselung des importierten privaten Schlüssels benutzt werden soll Verify private key passphrase: Kennwort bestätigen: Type the private key passphrase again to confirm Geben Sie zur Bestätigung das Kennwort für den privaten Schlüssel erneut ein PKSC#12 certificate bundle (*.p12 *.pfx) PKCS#12 Zertifikatsdatei (*.p12 *.pfx) Choose the PKCS12 certificate bundle to import ... Wählen Sie die zu importierende PKCS12 Zertifikatsdatei aus ... Passphrase Entry Dialog Kennwort Eingabe Please enter the passphrase that was used to encrypt this certificate bundle: Geben Sie bitte das Kennwort ein, das zur Verschlüsselung dieses Zertifikates benutzt wurde: Content: Inhalt: certificate Zertifikat issued by ausgestellt von private key Privater Schlüssel %n root certificate(s) %n Stammzertifikat %n Stammzertifikate certificate file Zertifikatedatei private key file Private Schlüssel Datei root certificate file Stammzertifikatsdatei Error: Fehler: A Eine already exists. Do you want to replace it? existiert bereits. Möchten Sie diese ersetzen? The Die already exists in gibt es bereits in . Replacing it will overwrite its contents. Ersetzen dieser Datei überschreibt deren Inhalt. Importing certificates ... Zertifikate werden importiert ... ConnectionEditorDialog VPN Connections VPN Verbindungen &Add ... &Hinzufügen ... &Edit ... &Bearbeiten ... &Delete ... &Löschen ... &Preferences ... &Voreinstellungen ... You need to reconnect for your changes to take effect! Sie müssen sich erneut Verbinden, damit die Änderungen wirksam werden! Apply settings Einstellungen übernehmen You do not have the permission to apply settings Sie haben kein ausreichende Berechtigung um die Einstellungen übernehmen zu können New Connection Neue Verbindung Connection name: Verbindungsname: A connection with name '%1' already exists Eine Verbindung mit dem namen '%1' existiert bereits The provided name '%1' contains invalid characters. Name must start with a letter and may contain only letters, digits, periods, underscores, and hyphens. Maximum length is 30. Der eingegebene Name '%1' enthält ungültige Zeichen. Der Name muss mit einem Buchstaben beginnen und darf nur Buchstaben, Zahlen, Punkte, Unterstriche und Bindestriche enthalten. Die Länge darf 30 Zeichen nicht überschreiten. You do not have the permission to add a connection Sie haben kein ausreichende Berechtigung zum Hinzufügen eine neuen Verbindung Edit Connection Verbindung bearbeiten You do not have the permission to edit a connection Sie haben kein ausreichende Berechtigung zum Bearbeiten der Verbindung Delete Connection Verbindung löschen Are you sure you wish to delete the connection '%1'? Sind Sie sicher, dass Sie die Verbindung '%1' löschen möchten? You do not have the permission to remmove a connection Sie haben kein ausreichende Berechtigung zum Löschen einer Verbindung ConnectionInformationDialog L2TP IPSec VPN L2TP IPSec VPN Info Info Remote Server: Server-Adresse: PtP Interface: PtP Schnittstelle: Destination Address: Ziel-Adresse: IP Address: IP-Adresse: Subnet Mask: Subnetmaske: Primary DNS: Ester Namensserver: Secondary DNS: Zweiter Namensserver: Tenary DNS: Dritter Namensserver: Statistics ... Statistik ... Internet Interface: Internet Schnitstelle: Internet Interface Gateway: Internet Gateway: Logs Ereignisse ConnectionManager &Disconnect Verbindung &trennen &Edit Connections ... Verbindungen &bearbeiten ... Connection &Information &Verbindungsinformationen &About &Info &Quit Bee&nden About %1 Info %1 Notification area applet for managing your L2tp over IPsec virtual private network connections. Ein Applet für das Benachrichtigungsfeld, mit dem Sie L2tp/IPsec VPN Verbindungen verwalten können. Click to establish a vpn connection to '%1' Hier klicken um eine VPN Verbindung zu %1 herzustellen ConnectionSettingsDialog Connection Settings Einstellungen für Verbindungen Connection &name: Verbindungs&name: Connect &automatically Verbindung &automatisch herstellen IPsec IPsec &Remote Server: &Server-Adresse: IPv4 address or domain name of the remote access server that you want to connect to. Examples: 1.2.3.4 ipsec.server.edu IPv4 Adresse oder Domänennamen des Einwahlservers. Beispiele; 1.2.3.4 ipsec.server.edu Server &Identity: Server &Kennung: Leave empty if you don't want to check peers's identity, otherwise enter the peer's identity This is mostly a distinguished name like 'CN=cisco-fcs-ber'. Wenn Sie die Server-Kennung nicht prüfen wollen, lassen Sie dieses Feld leer, ansonsten geben Sie die Sev er-Kennung ein. Die Server-Kennung ist meistens ein eindeutiger Name wie z.B. 'CN=cisco-fcs-ber'. Use &pre-shared key for authentication &vereinbarten Schlüssel zur Authentifizierung verwenden Use &Certificate for authentication &Zertifikat zur Authentisierung verwenden Private &key: &Privater Schlüssel: Full path to a X.509 pem encoded private key file Vollständiger Pfad zu einer X.509 PEM kodierten privaten Schlüssel Datei Passphrase: Kennwort: Import ... Importieren ... L2TP L2TP If checked, l2tpd will attempt to redial if the call get disconected. Wenn angekreutzt und die Verbinung unterbrochen wird, versucht der L2TP Dämon eine erneute Einwahl. Redial Einwahl-Wiederholung If Checked, the length bit present in the l2tp packet payload will be used. Wenn angejreutzt, wird das im L2TP Paket vorhandene Längenbit verwendet. Length bit Längenbit Timeout: Zeitüberschreitung: Wait N seconds before redial. The redial option must be set to yes to use this option. Warte N Sekunden bis zum nächsten Einwahlversuch. Die Option Einwahl-Wiederholung muss markiert sein, damit dise Option wirksam wird. Attempts: Versuche: Will give up redial tries after N attempts. Beende Einwahl-Wiederholugs nach N Versuchen. PPP PPP With this option set, pppd will agree to authenticate itself to the peer exclusively using EAP. Wenn Sie diese Option ankreutzen, wird sich der PPP Dämon ausschließlich über das EAP Protokoll authentifizieren. Use Extensible Authentication Protocol (EAP) Verwende das Extensible-Authentication Protocol (EAP) Properties ... Eigenschaften ... Allow these protocols Gestatte folgende Protokolle Unencrypted password (PAP) Unverschlüsseltes Passwort (PAP) With this option set, pppd will agree to authenticate itself to the peer using PAP. Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer PAP Authentifizierung zustimmen. Challenge Authentication Protocol (CHAP) Challenge Authentication Protocol (CHAP) With this option set, pppd will agree to authenticate itself to the peer using CHAP. Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer CHAP Authentifizierung zustimmen. Microsoft CHAP (MS-Chap) Microsoft CHAP (MS-Chap) With this option set, pppd will agree to authenticate itself to the peer using MS-CHAP. Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer MS-CHAP Authentifizierung zustimmen. Microsoft CHAP Version 2 (MS-CHAPv2) Microsoft CHAP Version 2 (MS-CHAPv2) With this option set, pppd will agree to authenticate itself to the peer using MS-CHAPv2. Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer Microsoft CHAP Version 2 (MS-CHAPv2) Authentifizierung zustimmen. User name: Benutzername: Set the name used for authenticating the local system to the remote access server. Geben Sie hier den Benutzername ein, der verwendet werden soll, um das Lokale System beim Zugangsserver zu authentifizieren. Password: Passwort: Enter your password. If left empty you'll be ask each time you try to establish a connection. Geben Sie hier Ihr Passwort ein. Wenn Sie dieses Feld leer lassen, dann werden Sie bei jedem Verbindungsversuch nach dem Passwort gefragt. Peer authentication ... Peer-Athentifizierung ... IP settings ... IP Einstellungen ... Advanced ... Erweitert ... &Disable IPSEC Encryption IPSEC Verschlüsselung a&usschalten Choose private key ... Wählen SIe eine private Schlüssel Datei aus ... PEM private keys (*.pem) PEM private Schlüssel Dateien (*.pem) ConnectionsModel Name Name EapSettingsDialog EAP settings EAP Einstellungen When connecting Beim Herstellen der Verbindung Use my smart card Eigene Smartcard verwenden Use a certificate on this computer Zertifikat auf diesem Computer verwenden User certificate: Benutzer Zertifikat: Full path to a X.509 encoded personal certificate file Vollständiger Pfad zu einer X-509 Zertifikatdatei Private key: Privater Schlüssel: Full path to a X.509 pem encoded private key file Vollständiger Pfad zu einer X.509 PEM kodierten privaten Schlüssel Datei Passphrase: Kennwort: Enter the PIN or passphrase for your private key. If left empty you'll be ask each time you try to establish a connection. Geben Sie die PIN oder das Kennwort für Ihren Privaten Schlüssel ein. Wenn Sie keine PIN oder kein Kennwort eingeben, werden Sie vor jedem Verbindungsveruch nach der PIN oder dem Kennwort gefragt. CA Certificate: Stammzertifikate: Full path to a X.509 pem encoded Certificate Authority certificate file Vollständiger Pfad zu einer X-509 Stammzertifikatdatei - EAP Settings - EAP Einstellungen Choose your personal certificate ... Wählen Sie Ihr personliches Zertifikat ... PEM certificates (*.pem) PEM Zertifikate (*.pem) Choose your private key ... Wählen Sie Ihren privaten Schlüssel ... PEM private keys (*.pem) PEM private Schlüssel Dateien (*.pem) Choose a Certificate Authority certificate ... Wähle Sie eine Stammzertifikate-Datei ... InterfaceStatisticsDialog Interface Statistics Statistik Transmitted bytes: Übertragenen Bytes: Transmitted packets: Übertragenen Pakete: Transmission errors: Übertragungsfehler: Received bytes: Empfangenen Bytes: Received packets: Empfangenen Pakete: Reception errors: Empfangsfehler: Connected since: Verbunden seit: Connection time: Verbindungszeit: Collisions: Kollisionen: Days Tage IpSettingsDialog IpSettingsDialog IP-Einstellungen If checked the peer is asked for up to 2 DNS server addresses, otherwise provide the desired primary and secundary DNS server addresses manually in the edit boxes below. Wenn angekreutzt werden bis zu zwei DNS Server Adressen automatisch bezogen, ansonsten geben Sie bitte die bevorzugte- und die alternative DNS Server Adresse manuell ein. Obtain DNS server addresses automatically DNS Server Adresse automatisch beziehen Preferred DNS server: Bevorzugter DNS Server: Ip addresses of preferred domain name server used to resolve host names. Address must be entered as IPv4 address. Example: 1.2.3.4 IP Adresse des bevorzugten Domän-Namensserver. Adresse muss in IPv4 schreibweise eingegeben werden. Beispiel: 1.2.3.4 Ip addresses of alternate domain name server used to resolve host names. Address must be entered as IPv4 address. Example: 1.2.3.4 IP Adresse des alternativen Domän-Namensserver. Adresse muss in IPv4 schreibweise eingegeben werden. Beispiel: 1.2.3.4 Alternate DNS server: Alternativer DNS Server: Search domains: Standardsuchdomänen: Domains used when resolving hostnames. Use spaces to separate multiple domains. Domain-Namen, nach denen beim Übersetzen von Hostnamen gesucht werden soll. Trennen Sie mehrere Domänen durch Leerzeichen. Routes ... Routen ... - Ip Settings - Ip Einstellungen L2tpIPsecVpnApplication I couldn't find any graphical SU command (gksudo, beesu or kdesudo). Kein graphisches SU kommando ((gksudo, beesu or kdesudo) gefunden. PeerAuthenticationDialog PeerAuthenticationDialog Peer-Authentifizierung Remote name: Server-Kennung: Set the assumed name of the remote system for authentication purposes. If not empty, the name reported by the peer is checked against this name and connection will be refused if the reported name is different. Geben Sie hier die erwartete Kennung des Einwahlservers zu authentifizierungszwecken ein. Wenn sie dieses Feld nicht leer lassen, wird die eingegebene Kennung mit der Kennung die der Einwahlserver meldet verglichen und die Verbindung verweigert, wenn die gemeldete und die eingegebne Kennung unterschiedlich sind. - Peer Authentication Settings - Peer Authentifizierungseinstellungen Pkcs12 Writing certificate to Speicheren des Zertifikat in failed fehlgeschlagen No certificate found Keine Zertifikatdatei gefunden Writing root certificate to Speichern des Stammzertifikates in Writing private key to Speichern des privaten Schlüssels in No private key found Keine private Schlüsseldatei gefunden Wrong passphrase Falsches Kennwort Parse PKCS#12 file Analysieren der PKCS#12 Datei The file Die Datei is not a valid PKCS#12 certificate bundle ist keine gültige PKCS#12 Zertifikatdatei PppRoutesModel Address Adresse Netmask Netzmaske Comment Bemerkung PreferencesEditorDialog Preferences Voreinstellungen OpenSSL OpenSSL Engine &ID: Engine &ID: Unique identifier for OpenSSL engine Eindeutige Kennung der OpenSSL-Engine &Engine Path: &Engine Pfad: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Full path to a shared library implementing the <a href="http://www.openssl.org/docs/crypto/engine.html"><span style=" text-decoration: underline; color:#0000ff;">OpenSSL engine interface</span></a></p></body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vollständiger Pfad zu einer gemeinsam benutzten Bibliothek,welche die <a href="http://www.openssl.org/docs/crypto/engine.html"><span style=" text-decoration: underline; color:#0000ff;">OpenSSL Engine Snittstelle</span></a> implementiert</p></body></html> &PKCS 11 Path: &PKCS 11 Pfad: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Full path to a shared library implementing the <a href="http://www.rsa.com/rsalabs/node.asp?id=2133"><span style=" text-decoration: underline; color:#0000ff;">Cryptographic Token Interface</span></a></p></body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vollständiger Pfad zu einer gemeinsam benutzten Bibliothek,welche die <a href="http://www.rsa.com/rsalabs/node.asp?id=2133"><span style=" text-decoration: underline; color:#0000ff;">Cryptographic Token Shnittstelle</span></a> implementiert</p></body></html> Choose path of engine library ... Wählen Sie den Pfad für die Engine-Bibliothek ... Choose path of PKCS11 library ... Wählen Sie den Pfad für die PKCS11-Bibliothek ... QObject I couldn't detect any system tray on this system. Ich konnte keine Systemleiste auf diesem System erkennen. No smart card reader found. Kein Smartcard Lesegerät gefunden. Not Connected Nicht verbunden Click to show details Klicken Sie hier zur Anzeige von Details Connecting to Verbinden mit Disconnecting from Verbindung trennen Connected to Verbunden mit Error %1 occurred when disconnecting from Fehler %1 ist aufgetreten beim Trennen der Verbindung zu Error %1 occurred when connecting to Fehler %1 ist aufgetreten beim verbinden mit Failed to open configuration file '%1'. Konnte Konfigurationsdatei '%1' nicht öffnen. Failed to backup file '%1'. Konnte Datei '%1' nicht sichern. Failed to create directory '%1'. Konnte das Verzeichnis '%1' nicht anlegen. Failed to expand template '%1'. Konnte Vorlage '%1' nicht expandieren. Failed to get template '%1'. Konnte Vorlage '%1' nicht finden. Failed to open template file ':/templates/%1.tpl'. Konnte Vorlagedatei '/templates/%1.tpl' nicht öffnen. An error occurred while writing Fehler beim Schreiben der Datei No such connection: '%1'. Den Verbindungsnamen '%1' gibt es nicht. Dynamic library files (*.dll) Dynamische Binliotheksdateien (*.dll) Shared library files (*.so) Dynamische Binliotheksdateien (*.so) I couldn't load PKCS11 library %1. Konnte PKCS11 Bibliothek %1 nicht laden. %1 is not a valid OpenSSL engine library. %1 ist keine gültige OpenSSL Engine-Bibliothek. %1 must not be empty. Feld %1 darf nicht leer sein. Please insert your smart card ... Legen Sie bitte Ihre Smartcard ein ... Out of Memory Kein freier Speicher mehr verfügbar Please enter your PIN: Geben Sie bitte Ihre PIN ein: Please enter your passphrase: Geben Sie bitte Ihr Kennwort ein: Please enter your password: Geben Sie bitte Ihr Passwort ein: RouteSettingsDialog RouteSettingsDialog Routen-Einstellungen Add Hinzufügen Delete ... Löschen ... route packages with the destination addresses listed here through the PPP tunnel. Leite Pakete mit den hier gelisteten Zieladressen durch den PPP Tunnel. Use following explicit routes to intranet locations (split tunneling) Verwende folgende expliziten Routen (Split-Tunnel-Steuerung) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Based on the <span style=" font-weight:600;">Use default gateway on remote network</span> setting, one of the following occurs when the VPN connection is active: </p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When the <span style=" font-weight:600;">Use default gateway on remote network</span> check box is cleared, Internet locations are reachable and intranet locations are not reachable, except for those matching the network ID of the Internet address class of the assigned IP address. </li> <li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When the<span style=" font-weight:600;"> Use default gateway on remote network</span> check box is selected (the default setting), all intranet locations are reachable and Internet locations are not reachable, except for the address of the VPN server and locations available through other routes. </li></ul></body></html> Use default gateway on the remote network Verwende Standard-Gateway Edit routes for VPN connection Routen für VPN Verbindung bearbeiten Delete Route Route löschen Are you sure you wish to delete the route '%1'? Sind Sie sicher, dass Sie Route '%1' löschen wollen? SmartCardObjectsDialog SmartCardObjectsDialog Smartcard Objekte VPNControlTask A critical error occurred Es ist ein kritischer Fehler aufgetreten L2tpIPsecVpnControlDaemon is not started L2tpIPsecVpnControlDaemon ist nicht gestartet Create vpn syslog pipe command failed with exit code: %1 Das Kommando zum Erzeugen eine Syslog-Pipe is fehlgeschlagen. Rückgabewert %1 l2tp-ipsec-vpn/nls/L2tpIPsecVpn_de.qm0000664000175000017500000011545312040201227020042 0ustar wejaegerwejaeger .z#C-9,;MxhB~&x y-w,$h}#pe](c~_KE*a(.@ICf"DRBn[U~~3hBLr9y/6~NEn_+$6+NSU@O*$SI2F>D2KVL6^$a5eqJ=raD[ RwɖZ8ib UT`^ꉚ&p`.@#tFB* |8@)4n"yZ"= uI r%IZ7 )+FOP5~3-8$*6*O\hޟUdS^f?n}zx*^3hJi&3ӌSSk Auf d,sIk-F.NEBm8eWJGAf=s.`wQY @>> 4+ @ kS) lf% vǎ ~| z>( nG @d [@ W$W ~ ,RO 9:P >G L? _BjG d d<i& {H 4$    Nh >7 ^0 9L ^ 3*]  n 5 "n'_ aT) o']3 q%  Df W C> ʓ,- 'i 'a G<K t%I* z}  ' . #3 Ύ1 . s.? ͐"# : P { /gT zac 3I] 5.H 5M 57L JF W%x `Z tP ji 9< X) N) j ; ^Vѓfr,3&]U^9:v˅f=nTKWFe{ED5J^ĕtV UgJOD%ZZR.`?Sc5/Q2Ni4- Erweiterte Einstellungen - Advanced SettingsAdvancedSettingsDialog0Erweiterte EinstellungenAdvanced SettingsAdvancedSettingsDialog6&BSD-Komprimierung erlaubenAllow &BSD data compressionAdvancedSettingsDialog>&Deflate-Komprimierung erlaubenAllow &Deflate data compressionAdvancedSettingsDialogKomprimierung CompressionAdvancedSettingsDialog,Sende PPP-&Echo PaketeSend PPP &echo packetsAdvancedSettingsDialogDTCP-&Headerkomprimierung verwendenUse TCP &header compressionAdvancedSettingsDialog$%n Stammzertifikat&%n Stammzertifikate%n root certificate(s)CertificateImportDialog`Ersetzen dieser Datei berschreibt deren Inhalt.+. Replacing it will overwrite its contents.CertificateImportDialogEineACertificateImportDialog~Whlen Sie die zu importierende PKCS12 Zertifikatsdatei aus ...2Choose the PKCS12 certificate bundle to import ...CertificateImportDialogInhalt:Content:CertificateImportDialogGeben Sie das Kennwort ein, dass zur Verschlsselung des importierten privaten Schlssels benutzt werden sollKEnter the passphrase that shall be used to encrypt the imported private keyCertificateImportDialogFehler:Error:CertificateImportDialogGeben Sie hier den vollstndigen Pfad zu der PKCS12 (*.p12, *.pfx) Zertifikatdatei ein die Sie importieren mchtenLFull path to PKCS12 (*.p12, *.pfx) encoded certificate bundle file to importCertificateImportDialogWenn angekreutzt, dann wird das importierte Zertifikat automatisch als IPsec-Authentifizierungszertifikat verwendetcIf checked. the imported certificate is automatically selected as IPsec authentication certificate CertificateImportDialog,Zertifikat ImportierenImport Certificate DialogCertificateImportDialogBZertifikate werden importiert ...Importing certificates ...CertificateImportDialogPKCS12 Datei: PKCS12 File:CertificateImportDialogLPKCS#12 Zertifikatsdatei (*.p12 *.pfx)(PKSC#12 certificate bundle (*.p12 *.pfx)CertificateImportDialog Kennwort EingabePassphrase Entry DialogCertificateImportDialogGeben Sie bitte das Kennwort ein, das zur Verschlsselung dieses Zertifikates benutzt wurde:MPlease enter the passphrase that was used to encrypt this certificate bundle:CertificateImportDialogHKennwort fr den privaten Schlssel:Private key passphrase:CertificateImportDialogDieTheCertificateImportDialogGeben Sie zur Besttigung das Kennwort fr den privaten Schlssel erneut ein0Type the private key passphrase again to confirmCertificateImportDialoglVerwende dieses Zertifikat zur IPsec-Authentifizierung-Use this certificate for IPsec authenticationCertificateImportDialog(Kennwort besttigen:Verify private key passphrase:CertificateImportDialog$gibt es bereits inalready exists inCertificateImportDialog\existiert bereits. Mchten Sie diese ersetzen?+already exists. Do you want to replace it?CertificateImportDialogZertifikat certificateCertificateImportDialog Zertifikatedateicertificate fileCertificateImportDialogausgestellt von issued byCertificateImportDialog$Privater Schlssel private keyCertificateImportDialog.Private Schlssel Dateiprivate key fileCertificateImportDialog*Stammzertifikatsdateiroot certificate fileCertificateImportDialog&Hinzufgen ...&Add ...ConnectionEditorDialog&Lschen ... &Delete ...ConnectionEditorDialog&Bearbeiten ... &Edit ...ConnectionEditorDialog*&Voreinstellungen ...&Preferences ...ConnectionEditorDialoghEine Verbindung mit dem namen '%1' existiert bereits*A connection with name '%1' already existsConnectionEditorDialog0Einstellungen bernehmenApply settingsConnectionEditorDialog|Sind Sie sicher, dass Sie die Verbindung '%1' lschen mchten?4Are you sure you wish to delete the connection '%1'?ConnectionEditorDialog Verbindungsname:Connection name:ConnectionEditorDialog$Verbindung lschenDelete ConnectionConnectionEditorDialog*Verbindung bearbeitenEdit ConnectionConnectionEditorDialogNeue VerbindungNew ConnectionConnectionEditorDialogDer eingegebene Name '%1' enthlt ungltige Zeichen. Der Name muss mit einem Buchstaben beginnen und darf nur Buchstaben, Zahlen, Punkte, Unterstriche und Bindestriche enthalten. Die Lnge darf 30 Zeichen nicht berschreiten.The provided name '%1' contains invalid characters. Name must start with a letter and may contain only letters, digits, periods, underscores, and hyphens. Maximum length is 30.ConnectionEditorDialog VPN VerbindungenVPN ConnectionsConnectionEditorDialogSie haben kein ausreichende Berechtigung zum Hinzufgen eine neuen Verbindung2You do not have the permission to add a connectionConnectionEditorDialogSie haben kein ausreichende Berechtigung um die Einstellungen bernehmen zu knnen0You do not have the permission to apply settingsConnectionEditorDialogSie haben kein ausreichende Berechtigung zum Bearbeiten der Verbindung3You do not have the permission to edit a connectionConnectionEditorDialogSie haben kein ausreichende Berechtigung zum Lschen einer Verbindung6You do not have the permission to remmove a connectionConnectionEditorDialogSie mssen sich erneut Verbinden, damit die nderungen wirksam werden!6You need to reconnect for your changes to take effect!ConnectionEditorDialogZiel-Adresse:Destination Address:ConnectionInformationDialogIP-Adresse: IP Address:ConnectionInformationDialog"Internet Gateway:Internet Interface Gateway:ConnectionInformationDialog,Internet Schnitstelle:Internet Interface:ConnectionInformationDialogEreignisseLogsConnectionInformationDialog&Ester Namensserver: Primary DNS:ConnectionInformationDialog$PtP Schnittstelle:PtP Interface:ConnectionInformationDialogServer-Adresse:Remote Server:ConnectionInformationDialog*Zweiter Namensserver:Secondary DNS:ConnectionInformationDialogStatistik ...Statistics ...ConnectionInformationDialogSubnetmaske: Subnet Mask:ConnectionInformationDialog*Dritter Namensserver: Tenary DNS:ConnectionInformationDialog &Info&AboutConnectionManager&Verbindung &trennen &DisconnectConnectionManager8Verbindungen &bearbeiten ...&Edit Connections ...ConnectionManagerBee&nden&QuitConnectionManagerInfo %1About %1ConnectionManagerlHier klicken um eine VPN Verbindung zu %1 herzustellen+Click to establish a vpn connection to '%1'ConnectionManager2&VerbindungsinformationenConnection &InformationConnectionManagerEin Applet fr das Benachrichtigungsfeld, mit dem Sie L2tp/IPsec VPN Verbindungen verwalten knnen._Notification area applet for managing your L2tp over IPsec virtual private network connections.ConnectionManagerDIPSEC Verschlsselung a&usschalten&Disable IPSEC EncryptionConnectionSettingsDialog &Server-Adresse:&Remote Server:ConnectionSettingsDialogErweitert ... Advanced ...ConnectionSettingsDialog8Gestatte folgende ProtokolleAllow these protocolsConnectionSettingsDialogVersuche: Attempts:ConnectionSettingsDialog^Whlen SIe eine private Schlssel Datei aus ...Choose private key ...ConnectionSettingsDialogDVerbindung &automatisch herstellenConnect &automaticallyConnectionSettingsDialog"Verbindungs&name:Connection &name:ConnectionSettingsDialog<Einstellungen fr VerbindungenConnection SettingsConnectionSettingsDialogGeben Sie hier Ihr Passwort ein. Wenn Sie dieses Feld leer lassen, dann werden Sie bei jedem Verbindungsversuch nach dem Passwort gefragt.^Enter your password. If left empty you'll be ask each time you try to establish a connection.ConnectionSettingsDialogVollstndiger Pfad zu einer X.509 PEM kodierten privaten Schlssel Datei1Full path to a X.509 pem encoded private key fileConnectionSettingsDialog(IP Einstellungen ...IP settings ...ConnectionSettingsDialogIPv4 Adresse oder Domnennamen des Einwahlservers. Beispiele; 1.2.3.4 ipsec.server.eduxIPv4 address or domain name of the remote access server that you want to connect to. Examples: 1.2.3.4 ipsec.server.eduConnectionSettingsDialogWenn angejreutzt, wird das im L2TP Paket vorhandene Lngenbit verwendet.KIf Checked, the length bit present in the l2tp packet payload will be used.ConnectionSettingsDialogWenn angekreutzt und die Verbinung unterbrochen wird, versucht der L2TP Dmon eine erneute Einwahl.EIf checked, l2tpd will attempt to redial if the call get disconected.ConnectionSettingsDialogImportieren ... Import ...ConnectionSettingsDialogWenn Sie die Server-Kennung nicht prfen wollen, lassen Sie dieses Feld leer, ansonsten geben Sie die Sev er-Kennung ein. Die Server-Kennung ist meistens ein eindeutiger Name wie z.B. 'CN=cisco-fcs-ber'.Leave empty if you don't want to check peers's identity, otherwise enter the peer's identity This is mostly a distinguished name like 'CN=cisco-fcs-ber'.ConnectionSettingsDialogLngenbit Length bitConnectionSettingsDialogJPEM private Schlssel Dateien (*.pem)PEM private keys (*.pem)ConnectionSettingsDialogKennwort: Passphrase:ConnectionSettingsDialogPasswort: Password:ConnectionSettingsDialog2Peer-Athentifizierung ...Peer authentication ...ConnectionSettingsDialog(&Privater Schlssel: Private &key:ConnectionSettingsDialog"Eigenschaften ...Properties ...ConnectionSettingsDialog(Einwahl-WiederholungRedialConnectionSettingsDialog Server &Kennung:Server &Identity:ConnectionSettingsDialogGeben Sie hier den Benutzername ein, der verwendet werden soll, um das Lokale System beim Zugangsserver zu authentifizieren.RSet the name used for authenticating the local system to the remote access server.ConnectionSettingsDialog&Zeitberschreitung:Timeout:ConnectionSettingsDialog@Unverschlsseltes Passwort (PAP)Unencrypted password (PAP)ConnectionSettingsDialogR&Zertifikat zur Authentisierung verwenden#Use &Certificate for authenticationConnectionSettingsDialogn&vereinbarten Schlssel zur Authentifizierung verwenden&Use &pre-shared key for authenticationConnectionSettingsDialogjVerwende das Extensible-Authentication Protocol (EAP),Use Extensible Authentication Protocol (EAP)ConnectionSettingsDialogBenutzername: User name:ConnectionSettingsDialog Warte N Sekunden bis zum nchsten Einwahlversuch. Die Option Einwahl-Wiederholung muss markiert sein, damit dise Option wirksam wird.VWait N seconds before redial. The redial option must be set to yes to use this option.ConnectionSettingsDialogZBeende Einwahl-Wiederholugs nach N Versuchen.+Will give up redial tries after N attempts.ConnectionSettingsDialogWenn Sie diese Option ankreutzen, wird sich der PPP Dmon ausschlielich ber das EAP Protokoll authentifizieren._With this option set, pppd will agree to authenticate itself to the peer exclusively using EAP.ConnectionSettingsDialogWenn Sie diese Option ankreutzen, wird der PPP Dmon einer CHAP Authentifizierung zustimmen.TWith this option set, pppd will agree to authenticate itself to the peer using CHAP.ConnectionSettingsDialogWenn Sie diese Option ankreutzen, wird der PPP Dmon einer MS-CHAP Authentifizierung zustimmen.WWith this option set, pppd will agree to authenticate itself to the peer using MS-CHAP.ConnectionSettingsDialogWenn Sie diese Option ankreutzen, wird der PPP Dmon einer Microsoft CHAP Version 2 (MS-CHAPv2) Authentifizierung zustimmen.YWith this option set, pppd will agree to authenticate itself to the peer using MS-CHAPv2.ConnectionSettingsDialogWenn Sie diese Option ankreutzen, wird der PPP Dmon einer PAP Authentifizierung zustimmen.SWith this option set, pppd will agree to authenticate itself to the peer using PAP.ConnectionSettingsDialog&- EAP Einstellungen - EAP SettingsEapSettingsDialog"Stammzertifikate:CA Certificate:EapSettingsDialogRWhle Sie eine Stammzertifikate-Datei ....Choose a Certificate Authority certificate ...EapSettingsDialogTWhlen Sie Ihr personliches Zertifikat ...$Choose your personal certificate ...EapSettingsDialogNWhlen Sie Ihren privaten Schlssel ...Choose your private key ...EapSettingsDialog"EAP Einstellungen EAP settingsEapSettingsDialogGeben Sie die PIN oder das Kennwort fr Ihren Privaten Schlssel ein. Wenn Sie keine PIN oder kein Kennwort eingeben, werden Sie vor jedem Verbindungsveruch nach der PIN oder dem Kennwort gefragt.{Enter the PIN or passphrase for your private key. If left empty you'll be ask each time you try to establish a connection.EapSettingsDialogbVollstndiger Pfad zu einer X-509 Zertifikatdatei6Full path to a X.509 encoded personal certificate fileEapSettingsDialoglVollstndiger Pfad zu einer X-509 StammzertifikatdateiGFull path to a X.509 pem encoded Certificate Authority certificate fileEapSettingsDialogVollstndiger Pfad zu einer X.509 PEM kodierten privaten Schlssel Datei1Full path to a X.509 pem encoded private key fileEapSettingsDialog.PEM Zertifikate (*.pem)PEM certificates (*.pem)EapSettingsDialogJPEM private Schlssel Dateien (*.pem)PEM private keys (*.pem)EapSettingsDialogKennwort: Passphrase:EapSettingsDialog&Privater Schlssel: Private key:EapSettingsDialogPZertifikat auf diesem Computer verwenden"Use a certificate on this computerEapSettingsDialog4Eigene Smartcard verwendenUse my smart cardEapSettingsDialog(Benutzer Zertifikat:User certificate:EapSettingsDialog<Beim Herstellen der VerbindungWhen connectingEapSettingsDialogKollisionen: Collisions:InterfaceStatisticsDialogVerbunden seit:Connected since:InterfaceStatisticsDialog Verbindungszeit:Connection time:InterfaceStatisticsDialogTageDaysInterfaceStatisticsDialogStatistikInterface StatisticsInterfaceStatisticsDialog$Empfangenen Bytes:Received bytes:InterfaceStatisticsDialog&Empfangenen Pakete:Received packets:InterfaceStatisticsDialogEmpfangsfehler:Reception errors:InterfaceStatisticsDialog&bertragungsfehler:Transmission errors:InterfaceStatisticsDialog&bertragenen Bytes:Transmitted bytes:InterfaceStatisticsDialog(bertragenen Pakete:Transmitted packets:InterfaceStatisticsDialog$- Ip Einstellungen - Ip SettingsIpSettingsDialog0Alternativer DNS Server:Alternate DNS server:IpSettingsDialogDomain-Namen, nach denen beim bersetzen von Hostnamen gesucht werden soll. Trennen Sie mehrere Domnen durch Leerzeichen.ODomains used when resolving hostnames. Use spaces to separate multiple domains.IpSettingsDialogTWenn angekreutzt werden bis zu zwei DNS Server Adressen automatisch bezogen, ansonsten geben Sie bitte die bevorzugte- und die alternative DNS Server Adresse manuell ein.If checked the peer is asked for up to 2 DNS server addresses, otherwise provide the desired primary and secundary DNS server addresses manually in the edit boxes below.IpSettingsDialogIP Adresse des alternativen Domn-Namensserver. Adresse muss in IPv4 schreibweise eingegeben werden. Beispiel: 1.2.3.4Ip addresses of alternate domain name server used to resolve host names. Address must be entered as IPv4 address. Example: 1.2.3.4IpSettingsDialogIP Adresse des bevorzugten Domn-Namensserver. Adresse muss in IPv4 schreibweise eingegeben werden. Beispiel: 1.2.3.4Ip addresses of preferred domain name server used to resolve host names. Address must be entered as IPv4 address. Example: 1.2.3.4IpSettingsDialog IP-EinstellungenIpSettingsDialogIpSettingsDialogNDNS Server Adresse automatisch beziehen)Obtain DNS server addresses automaticallyIpSettingsDialog.Bevorzugter DNS Server:Preferred DNS server:IpSettingsDialogRouten ... Routes ...IpSettingsDialog(Standardsuchdomnen:Search domains:IpSettingsDialogKein graphisches SU kommando ((gksudo, beesu or kdesudo) gefunden.DI couldn't find any graphical SU command (gksudo, beesu or kdesudo).L2tpIPsecVpnApplicationL- Peer Authentifizierungseinstellungen - Peer Authentication SettingsPeerAuthenticationDialog,Peer-AuthentifizierungPeerAuthenticationDialogPeerAuthenticationDialogServer-Kennung: Remote name:PeerAuthenticationDialogtGeben Sie hier die erwartete Kennung des Einwahlservers zu authentifizierungszwecken ein. Wenn sie dieses Feld nicht leer lassen, wird die eingegebene Kennung mit der Kennung die der Einwahlserver meldet verglichen und die Verbindung verweigert, wenn die gemeldete und die eingegebne Kennung unterschiedlich sind.Set the assumed name of the remote system for authentication purposes. If not empty, the name reported by the peer is checked against this name and connection will be refused if the reported name is different.PeerAuthenticationDialog<Keine Zertifikatdatei gefundenNo certificate foundPkcs12JKeine private Schlsseldatei gefundenNo private key foundPkcs12:Analysieren der PKCS#12 DateiParse PKCS#12 filePkcs12Die DateiThe filePkcs128Speicheren des Zertifikat inWriting certificate toPkcs12HSpeichern des privaten Schlssels inWriting private key toPkcs12DSpeichern des Stammzertifikates inWriting root certificate toPkcs12"Falsches KennwortWrong passphrasePkcs12fehlgeschlagenfailedPkcs12Rist keine gltige PKCS#12 Zertifikatdatei)is not a valid PKCS#12 certificate bundlePkcs12AdresseAddressPppRoutesModelBemerkungCommentPppRoutesModelNetzmaskeNetmaskPppRoutesModel&Engine Pfad: &Engine Path:PreferencesEditorDialog&PKCS 11 Pfad:&PKCS 11 Path:PreferencesEditorDialogH<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vollstndiger Pfad zu einer gemeinsam benutzten Bibliothek,welche die <a href="http://www.openssl.org/docs/crypto/engine.html"><span style=" text-decoration: underline; color:#0000ff;">OpenSSL Engine Snittstelle</span></a> implementiert</p></body></html>}

Full path to a shared library implementing the OpenSSL engine interface

PreferencesEditorDialogN<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Vollstndiger Pfad zu einer gemeinsam benutzten Bibliothek,welche die <a href="http://www.rsa.com/rsalabs/node.asp?id=2133"><span style=" text-decoration: underline; color:#0000ff;">Cryptographic Token Shnittstelle</span></a> implementiert</p></body></html>

Full path to a shared library implementing the Cryptographic Token Interface

PreferencesEditorDialogbWhlen Sie den Pfad fr die PKCS11-Bibliothek ...!Choose path of PKCS11 library ...PreferencesEditorDialogbWhlen Sie den Pfad fr die Engine-Bibliothek ...!Choose path of engine library ...PreferencesEditorDialog Voreinstellungen PreferencesPreferencesEditorDialogJEindeutige Kennung der OpenSSL-Engine$Unique identifier for OpenSSL enginePreferencesEditorDialog^%1 ist keine gltige OpenSSL Engine-Bibliothek.)%1 is not a valid OpenSSL engine library.QObject:Feld %1 darf nicht leer sein.%1 must not be empty.QObject>Fehler beim Schreiben der Datei An error occurred while writing QObjectPKlicken Sie hier zur Anzeige von DetailsClick to show detailsQObjectVerbunden mit  Connected to QObjectVerbinden mit Connecting to QObject&Verbindung trennen Disconnecting from QObjectJDynamische Binliotheksdateien (*.dll)Dynamic library files (*.dll)QObjectZFehler %1 ist aufgetreten beim verbinden mit %Error %1 occurred when connecting to QObjectrFehler %1 ist aufgetreten beim Trennen der Verbindung zu *Error %1 occurred when disconnecting from QObject@Konnte Datei '%1' nicht sichern.Failed to backup file '%1'.QObjectTKonnte das Verzeichnis '%1' nicht anlegen. Failed to create directory '%1'.QObjectLKonnte Vorlage '%1' nicht expandieren.Failed to expand template '%1'.QObjectBKonnte Vorlage '%1' nicht finden.Failed to get template '%1'.QObjectZKonnte Konfigurationsdatei '%1' nicht ffnen.'Failed to open configuration file '%1'.QObjectlKonnte Vorlagedatei '/templates/%1.tpl' nicht ffnen.2Failed to open template file ':/templates/%1.tpl'.QObjectrIch konnte keine Systemleiste auf diesem System erkennen.1I couldn't detect any system tray on this system.QObjectPKonnte PKCS11 Bibliothek %1 nicht laden."I couldn't load PKCS11 library %1.QObjectDKein Smartcard Lesegert gefunden.No smart card reader found.QObjectPDen Verbindungsnamen '%1' gibt es nicht.No such connection: '%1'.QObjectNicht verbunden Not ConnectedQObjectFKein freier Speicher mehr verfgbar Out of MemoryQObject:Geben Sie bitte Ihre PIN ein:Please enter your PIN:QObjectBGeben Sie bitte Ihr Kennwort ein:Please enter your passphrase:QObjectBGeben Sie bitte Ihr Passwort ein:Please enter your password:QObjectLLegen Sie bitte Ihre Smartcard ein ...!Please insert your smart card ...QObjectHDynamische Binliotheksdateien (*.so)Shared library files (*.so)QObjectHinzufgenAddRouteSettingsDialoghSind Sie sicher, dass Sie Route '%1' lschen wollen?/Are you sure you wish to delete the route '%1'?RouteSettingsDialogLschen ... Delete ...RouteSettingsDialogRoute lschen Delete RouteRouteSettingsDialogHRouten fr VPN Verbindung bearbeitenEdit routes for VPN connection RouteSettingsDialog(Routen-EinstellungenRouteSettingsDialogRouteSettingsDialog2Verwende Standard-Gateway)Use default gateway on the remote networkRouteSettingsDialogxVerwende folgende expliziten Routen (Split-Tunnel-Steuerung)EUse following explicit routes to intranet locations (split tunneling)RouteSettingsDialogLeite Pakete mit den hier gelisteten Zieladressen durch den PPP Tunnel.Qroute packages with the destination addresses listed here through the PPP tunnel.RouteSettingsDialog"Smartcard ObjekteSmartCardObjectsDialogSmartCardObjectsDialogPEs ist ein kritischer Fehler aufgetretenA critical error occurredVPNControlTaskDas Kommando zum Erzeugen eine Syslog-Pipe is fehlgeschlagen. Rckgabewert %18Create vpn syslog pipe command failed with exit code: %1VPNControlTaskZL2tpIPsecVpnControlDaemon ist nicht gestartet(L2tpIPsecVpnControlDaemon is not startedVPNControlTask/'/;?MU^ht}InterfaceStatisticsDialogCertificateImportDialogPeerAuthenticationDialogPppRoutesModelConnectionEditorDialogPkcs12ConnectionInformationDialogVPNControlTaskConnectionManagerRouteSettingsDialogL2tpIPsecVpnApplicationEapSettingsDialogQObjectIpSettingsDialogAdvancedSettingsDialogConnectionSettingsDialogPreferencesEditorDialogSmartCardObjectsDialogl2tp-ipsec-vpn/nls/de.po0000664000175000017500000013011112040201227015516 0ustar wejaegerwejaegermsgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Language: de_DE\n" "X-Qt-Contexts: true\n" #: ../src/dialogs/AdvancedSettingsDialog.ui:14 msgctxt "AdvancedSettingsDialog|" msgid "Advanced Settings" msgstr "Erweiterte Einstellungen" #: ../src/dialogs/AdvancedSettingsDialog.ui:27 msgctxt "AdvancedSettingsDialog|" msgid "Compression" msgstr "Komprimierung" #: ../src/dialogs/AdvancedSettingsDialog.ui:33 msgctxt "AdvancedSettingsDialog|" msgid "Allow &BSD data compression" msgstr "&BSD-Komprimierung erlauben" #: ../src/dialogs/AdvancedSettingsDialog.ui:40 msgctxt "AdvancedSettingsDialog|" msgid "Allow &Deflate data compression" msgstr "&Deflate-Komprimierung erlauben" #: ../src/dialogs/AdvancedSettingsDialog.ui:47 msgctxt "AdvancedSettingsDialog|" msgid "Use TCP &header compression" msgstr "TCP-&Headerkomprimierung verwenden" #: ../src/dialogs/AdvancedSettingsDialog.ui:57 msgctxt "AdvancedSettingsDialog|" msgid "Echo" msgstr "Echo" #: ../src/dialogs/AdvancedSettingsDialog.ui:63 msgctxt "AdvancedSettingsDialog|" msgid "Send PPP &echo packets" msgstr "Sende PPP-&Echo Pakete" #: ../src/dialogs/AdvancedSettingsDialog.cpp:33 msgctxt "AdvancedSettingsDialog|" msgid " - Advanced Settings" msgstr "- Erweiterte Einstellungen" #: ../src/dialogs/CertificateImportDialog.ui:14 msgctxt "CertificateImportDialog|" msgid "Import Certificate Dialog" msgstr "Zertifikat Importieren" #: ../src/dialogs/CertificateImportDialog.ui:36 msgctxt "CertificateImportDialog|" msgid "" "Full path to PKCS12 (*.p12, *.pfx) encoded certificate bundle file to import" msgstr "" "Geben Sie hier den vollständigen Pfad zu der PKCS12 (*.p12, *.pfx) " "Zertifikatdatei ein die Sie importieren möchten" #: ../src/dialogs/CertificateImportDialog.ui:91 msgctxt "CertificateImportDialog|" msgid "PKCS12 File:" msgstr "PKCS12 Datei:" #: ../src/dialogs/CertificateImportDialog.ui:101 msgctxt "CertificateImportDialog|" msgid "" "If checked. the imported certificate is automatically selected as IPsec " "authentication certificate " msgstr "" "Wenn angekreutzt, dann wird das importierte Zertifikat automatisch als " "IPsec-Authentifizierungszertifikat verwendet" #: ../src/dialogs/CertificateImportDialog.ui:104 msgctxt "CertificateImportDialog|" msgid "Use this certificate for IPsec authentication" msgstr "Verwende dieses Zertifikat zur IPsec-Authentifizierung" #: ../src/dialogs/CertificateImportDialog.ui:126 msgctxt "CertificateImportDialog|" msgid "Private key passphrase:" msgstr "Kennwort für den privaten Schlüssel:" #: ../src/dialogs/CertificateImportDialog.ui:133 msgctxt "CertificateImportDialog|" msgid "" "Enter the passphrase that shall be used to encrypt the imported private key" msgstr "" "Geben Sie das Kennwort ein, dass zur Verschlüsselung des importierten " "privaten Schlüssels benutzt werden soll" #: ../src/dialogs/CertificateImportDialog.ui:143 msgctxt "CertificateImportDialog|" msgid "Verify private key passphrase:" msgstr "Kennwort bestätigen:" #: ../src/dialogs/CertificateImportDialog.ui:150 msgctxt "CertificateImportDialog|" msgid "Type the private key passphrase again to confirm" msgstr "" "Geben Sie zur Bestätigung das Kennwort für den privaten Schlüssel erneut ein" #: ../src/dialogs/CertificateImportDialog.cpp:110 msgctxt "CertificateImportDialog|" msgid "PKSC#12 certificate bundle (*.p12 *.pfx)" msgstr "PKCS#12 Zertifikatsdatei (*.p12 *.pfx)" #: ../src/dialogs/CertificateImportDialog.cpp:110 msgctxt "CertificateImportDialog|" msgid "Choose the PKCS12 certificate bundle to import ..." msgstr "Wählen Sie die zu importierende PKCS12 Zertifikatsdatei aus ..." #: ../src/dialogs/CertificateImportDialog.cpp:119 msgctxt "CertificateImportDialog|" msgid "Passphrase Entry Dialog" msgstr "Kennwort Eingabe" #: ../src/dialogs/CertificateImportDialog.cpp:119 msgctxt "CertificateImportDialog|" msgid "" "Please enter the passphrase that was used to encrypt this certificate bundle:" msgstr "" "Geben Sie bitte das Kennwort ein, das zur Verschlüsselung dieses " "Zertifikates benutzt wurde:" #: ../src/dialogs/CertificateImportDialog.cpp:135 msgctxt "CertificateImportDialog|" msgid "Content:" msgstr "Inhalt:" #: ../src/dialogs/CertificateImportDialog.cpp:136 msgctxt "CertificateImportDialog|" msgid "certificate" msgstr "Zertifikat" #: ../src/dialogs/CertificateImportDialog.cpp:136 msgctxt "CertificateImportDialog|" msgid "issued by" msgstr "ausgestellt von" #: ../src/dialogs/CertificateImportDialog.cpp:139 msgctxt "CertificateImportDialog|" msgid "private key" msgstr "Privater Schlüssel" #: ../src/dialogs/CertificateImportDialog.cpp:141 #, qt-format msgctxt "CertificateImportDialog|" msgid "%n root certificate(s)" msgid_plural "%n root certificate(s)" msgstr[0] "%n Stammzertifikat" msgstr[1] "%n Stammzertifikate" #: ../src/dialogs/CertificateImportDialog.cpp:188 msgctxt "CertificateImportDialog|" msgid "certificate file" msgstr "Zertifikatedatei" #: ../src/dialogs/CertificateImportDialog.cpp:195 msgctxt "CertificateImportDialog|" msgid "private key file" msgstr "Private Schlüssel Datei" #: ../src/dialogs/CertificateImportDialog.cpp:201 msgctxt "CertificateImportDialog|" msgid "root certificate file" msgstr "Stammzertifikatsdatei" #: ../src/dialogs/CertificateImportDialog.cpp:212 msgctxt "CertificateImportDialog|" msgid "Error:" msgstr "Fehler:" #: ../src/dialogs/CertificateImportDialog.cpp:225 msgctxt "CertificateImportDialog|" msgid "A" msgstr "Eine" #: ../src/dialogs/CertificateImportDialog.cpp:225 msgctxt "CertificateImportDialog|" msgid "already exists. Do you want to replace it?" msgstr "existiert bereits. Möchten Sie diese ersetzen?" #: ../src/dialogs/CertificateImportDialog.cpp:227 msgctxt "CertificateImportDialog|" msgid "The" msgstr "Die" #: ../src/dialogs/CertificateImportDialog.cpp:227 msgctxt "CertificateImportDialog|" msgid "already exists in" msgstr "gibt es bereits in" #: ../src/dialogs/CertificateImportDialog.cpp:227 msgctxt "CertificateImportDialog|" msgid ". Replacing it will overwrite its contents." msgstr "Ersetzen dieser Datei überschreibt deren Inhalt." #: ../src/dialogs/CertificateImportDialog.cpp:230 msgctxt "CertificateImportDialog|" msgid "Importing certificates ..." msgstr "Zertifikate werden importiert ..." #: ../src/dialogs/ConnectionEditorDialog.ui:14 msgctxt "ConnectionEditorDialog|" msgid "VPN Connections" msgstr "VPN Verbindungen" #: ../src/dialogs/ConnectionEditorDialog.ui:33 msgctxt "ConnectionEditorDialog|" msgid "&Add ..." msgstr "&Hinzufügen ..." #: ../src/dialogs/ConnectionEditorDialog.ui:43 msgctxt "ConnectionEditorDialog|" msgid "&Edit ..." msgstr "&Bearbeiten ..." #: ../src/dialogs/ConnectionEditorDialog.ui:56 msgctxt "ConnectionEditorDialog|" msgid "&Delete ..." msgstr "&Löschen ..." #: ../src/dialogs/ConnectionEditorDialog.ui:112 msgctxt "ConnectionEditorDialog|" msgid "&Preferences ..." msgstr "&Voreinstellungen ..." #: ../src/dialogs/ConnectionEditorDialog.cpp:107 msgctxt "ConnectionEditorDialog|" msgid "You need to reconnect for your changes to take effect!" msgstr "Sie müssen sich erneut Verbinden, damit die Änderungen wirksam werden!" #: ../src/dialogs/ConnectionEditorDialog.cpp:153 msgctxt "ConnectionEditorDialog|" msgid "Apply settings" msgstr "Einstellungen übernehmen" #: ../src/dialogs/ConnectionEditorDialog.cpp:153 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to apply settings" msgstr "" "Sie haben kein ausreichende Berechtigung um die Einstellungen übernehmen zu " "können" #: ../src/dialogs/ConnectionEditorDialog.cpp:176 #: ../src/dialogs/ConnectionEditorDialog.cpp:212 msgctxt "ConnectionEditorDialog|" msgid "New Connection" msgstr "Neue Verbindung" #: ../src/dialogs/ConnectionEditorDialog.cpp:183 msgctxt "ConnectionEditorDialog|" msgid "Connection name:" msgstr "Verbindungsname:" #: ../src/dialogs/ConnectionEditorDialog.cpp:198 #, qt-format msgctxt "ConnectionEditorDialog|" msgid "A connection with name '%1' already exists" msgstr "Eine Verbindung mit dem namen '%1' existiert bereits" #: ../src/dialogs/ConnectionEditorDialog.cpp:202 #, qt-format msgctxt "ConnectionEditorDialog|" msgid "" "The provided name '%1' contains invalid characters.\n" "\n" "Name must start with a letter and may contain only letters, digits, periods, " "underscores, and hyphens.\n" "Maximum length is 30." msgstr "" "Der eingegebene Name '%1' enthält ungültige Zeichen.\n" "\n" "Der Name muss mit einem Buchstaben beginnen und darf nur Buchstaben, Zahlen, " "Punkte, Unterstriche und Bindestriche enthalten.\n" "Die Länge darf 30 Zeichen nicht überschreiten." #: ../src/dialogs/ConnectionEditorDialog.cpp:212 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to add a connection" msgstr "" "Sie haben kein ausreichende Berechtigung zum Hinzufügen eine neuen Verbindung" #: ../src/dialogs/ConnectionEditorDialog.cpp:232 msgctxt "ConnectionEditorDialog|" msgid "Edit Connection" msgstr "Verbindung bearbeiten" #: ../src/dialogs/ConnectionEditorDialog.cpp:232 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to edit a connection" msgstr "Sie haben kein ausreichende Berechtigung zum Bearbeiten der Verbindung" #: ../src/dialogs/ConnectionEditorDialog.cpp:247 #: ../src/dialogs/ConnectionEditorDialog.cpp:264 msgctxt "ConnectionEditorDialog|" msgid "Delete Connection" msgstr "Verbindung löschen" #: ../src/dialogs/ConnectionEditorDialog.cpp:247 #, qt-format msgctxt "ConnectionEditorDialog|" msgid "Are you sure you wish to delete the connection '%1'?" msgstr "Sind Sie sicher, dass Sie die Verbindung '%1' löschen möchten?" #: ../src/dialogs/ConnectionEditorDialog.cpp:264 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to remmove a connection" msgstr "Sie haben kein ausreichende Berechtigung zum Löschen einer Verbindung" #: ../src/dialogs/ConnectionInformationDialog.ui:20 msgctxt "ConnectionInformationDialog|" msgid "L2TP IPSec VPN" msgstr "L2TP IPSec VPN" #: ../src/dialogs/ConnectionInformationDialog.ui:33 msgctxt "ConnectionInformationDialog|" msgid "Info" msgstr "Info" #: ../src/dialogs/ConnectionInformationDialog.ui:39 msgctxt "ConnectionInformationDialog|" msgid "Remote Server:" msgstr "Server-Adresse:" #: ../src/dialogs/ConnectionInformationDialog.ui:59 msgctxt "ConnectionInformationDialog|" msgid "PtP Interface:" msgstr "PtP Schnittstelle:" #: ../src/dialogs/ConnectionInformationDialog.ui:79 msgctxt "ConnectionInformationDialog|" msgid "Destination Address:" msgstr "Ziel-Adresse:" #: ../src/dialogs/ConnectionInformationDialog.ui:99 msgctxt "ConnectionInformationDialog|" msgid "IP Address:" msgstr "IP-Adresse:" #: ../src/dialogs/ConnectionInformationDialog.ui:119 msgctxt "ConnectionInformationDialog|" msgid "Subnet Mask:" msgstr "Subnetmaske:" #: ../src/dialogs/ConnectionInformationDialog.ui:133 msgctxt "ConnectionInformationDialog|" msgid "Primary DNS:" msgstr "Ester Namensserver:" #: ../src/dialogs/ConnectionInformationDialog.ui:153 msgctxt "ConnectionInformationDialog|" msgid "Secondary DNS:" msgstr "Zweiter Namensserver:" #: ../src/dialogs/ConnectionInformationDialog.ui:173 msgctxt "ConnectionInformationDialog|" msgid "Tenary DNS:" msgstr "Dritter Namensserver:" #: ../src/dialogs/ConnectionInformationDialog.ui:196 msgctxt "ConnectionInformationDialog|" msgid "Statistics ..." msgstr "Statistik ..." #: ../src/dialogs/ConnectionInformationDialog.ui:206 msgctxt "ConnectionInformationDialog|" msgid "Internet Interface:" msgstr "Internet Schnitstelle:" #: ../src/dialogs/ConnectionInformationDialog.ui:220 msgctxt "ConnectionInformationDialog|" msgid "Internet Interface Gateway:" msgstr "Internet Gateway:" #: ../src/dialogs/ConnectionInformationDialog.ui:235 msgctxt "ConnectionInformationDialog|" msgid "Logs" msgstr "Ereignisse" #: ../src/ConnectionManager.cpp:140 msgctxt "ConnectionManager|" msgid "&Disconnect" msgstr "Verbindung &trennen" #: ../src/ConnectionManager.cpp:141 msgctxt "ConnectionManager|" msgid "&Edit Connections ..." msgstr "Verbindungen &bearbeiten ..." #: ../src/ConnectionManager.cpp:142 msgctxt "ConnectionManager|" msgid "Connection &Information" msgstr "&Verbindungsinformationen" #: ../src/ConnectionManager.cpp:143 msgctxt "ConnectionManager|" msgid "&About" msgstr "&Info" #: ../src/ConnectionManager.cpp:144 msgctxt "ConnectionManager|" msgid "&Quit" msgstr "Bee&nden" #: ../src/ConnectionManager.cpp:316 #, qt-format msgctxt "ConnectionManager|" msgid "About %1" msgstr "Info %1" #: ../src/ConnectionManager.cpp:318 msgctxt "ConnectionManager|" msgid "" "Notification area applet for managing your L2tp over IPsec virtual private " "network connections." msgstr "" "Ein Applet für das Benachrichtigungsfeld, mit dem Sie L2tp/IPsec VPN " "Verbindungen verwalten können." #: ../src/ConnectionManager.cpp:451 #, qt-format msgctxt "ConnectionManager|" msgid "Click to establish a vpn connection to '%1'" msgstr "Hier klicken um eine VPN Verbindung zu %1 herzustellen" #: ../src/dialogs/ConnectionSettingsDialog.ui:14 msgctxt "ConnectionSettingsDialog|" msgid "Connection Settings" msgstr "Einstellungen für Verbindungen" #: ../src/dialogs/ConnectionSettingsDialog.ui:32 msgctxt "ConnectionSettingsDialog|" msgid "Connection &name:" msgstr "Verbindungs&name:" #: ../src/dialogs/ConnectionSettingsDialog.ui:63 msgctxt "ConnectionSettingsDialog|" msgid "Connect &automatically" msgstr "Verbindung &automatisch herstellen" #: ../src/dialogs/ConnectionSettingsDialog.ui:86 msgctxt "ConnectionSettingsDialog|" msgid "IPsec" msgstr "IPsec" #: ../src/dialogs/ConnectionSettingsDialog.ui:109 msgctxt "ConnectionSettingsDialog|" msgid "&Remote Server:" msgstr "&Server-Adresse:" #: ../src/dialogs/ConnectionSettingsDialog.ui:131 msgctxt "ConnectionSettingsDialog|" msgid "" "IPv4 address or domain name of the remote access server that you want to " "connect to.\n" "\n" "Examples:\n" "1.2.3.4\n" "ipsec.server.edu" msgstr "" "IPv4 Adresse oder Domänennamen des Einwahlservers.\n" "\n" "Beispiele;\n" "1.2.3.4\n" "ipsec.server.edu" #: ../src/dialogs/ConnectionSettingsDialog.ui:142 msgctxt "ConnectionSettingsDialog|" msgid "Server &Identity:" msgstr "Server &Kennung:" #: ../src/dialogs/ConnectionSettingsDialog.ui:161 msgctxt "ConnectionSettingsDialog|" msgid "" "Leave empty if you don't want to check peers's identity,\n" "otherwise enter the peer's identity \n" "\n" "This is mostly a distinguished name like 'CN=cisco-fcs-ber'." msgstr "" "Wenn Sie die Server-Kennung nicht prüfen wollen, lassen Sie dieses Feld " "leer, ansonsten geben Sie die Sev er-Kennung ein.\n" "\n" "Die Server-Kennung ist meistens ein eindeutiger Name wie z.B. " "'CN=cisco-fcs-ber'." #: ../src/dialogs/ConnectionSettingsDialog.ui:173 msgctxt "ConnectionSettingsDialog|" msgid "Use &pre-shared key for authentication" msgstr "&vereinbarten Schlüssel zur Authentifizierung verwenden" #: ../src/dialogs/ConnectionSettingsDialog.ui:193 msgctxt "ConnectionSettingsDialog|" msgid "Use &Certificate for authentication" msgstr "&Zertifikat zur Authentisierung verwenden" #: ../src/dialogs/ConnectionSettingsDialog.ui:228 msgctxt "ConnectionSettingsDialog|" msgid "Private &key:" msgstr "&Privater Schlüssel:" #: ../src/dialogs/ConnectionSettingsDialog.ui:238 msgctxt "ConnectionSettingsDialog|" msgid "Full path to a X.509 pem encoded private key file" msgstr "" "Vollständiger Pfad zu einer X.509 PEM kodierten privaten Schlüssel Datei" #: ../src/dialogs/ConnectionSettingsDialog.ui:248 msgctxt "ConnectionSettingsDialog|" msgid "Passphrase:" msgstr "Kennwort:" #: ../src/dialogs/ConnectionSettingsDialog.ui:285 msgctxt "ConnectionSettingsDialog|" msgid "Import ..." msgstr "Importieren ..." #: ../src/dialogs/ConnectionSettingsDialog.ui:296 msgctxt "ConnectionSettingsDialog|" msgid "L2TP" msgstr "L2TP" #: ../src/dialogs/ConnectionSettingsDialog.ui:302 msgctxt "ConnectionSettingsDialog|" msgid "If checked, l2tpd will attempt to redial if the call get disconected." msgstr "" "Wenn angekreutzt und die Verbinung unterbrochen wird, versucht der L2TP " "Dämon eine erneute Einwahl." #: ../src/dialogs/ConnectionSettingsDialog.ui:305 msgctxt "ConnectionSettingsDialog|" msgid "Redial" msgstr "Einwahl-Wiederholung" #: ../src/dialogs/ConnectionSettingsDialog.ui:318 msgctxt "ConnectionSettingsDialog|" msgid "" "If Checked, the length bit present in the l2tp packet payload will be used." msgstr "" "Wenn angejreutzt, wird das im L2TP Paket vorhandene Längenbit verwendet." #: ../src/dialogs/ConnectionSettingsDialog.ui:321 msgctxt "ConnectionSettingsDialog|" msgid "Length bit" msgstr "Längenbit" #: ../src/dialogs/ConnectionSettingsDialog.ui:345 msgctxt "ConnectionSettingsDialog|" msgid "Timeout:" msgstr "Zeitüberschreitung:" #: ../src/dialogs/ConnectionSettingsDialog.ui:364 msgctxt "ConnectionSettingsDialog|" msgid "" "Wait N seconds before redial. The redial option must be set to yes to use " "this option." msgstr "" "Warte N Sekunden bis zum nächsten Einwahlversuch. Die Option " "Einwahl-Wiederholung muss markiert sein, damit dise Option wirksam wird." #: ../src/dialogs/ConnectionSettingsDialog.ui:380 msgctxt "ConnectionSettingsDialog|" msgid "Attempts:" msgstr "Versuche:" #: ../src/dialogs/ConnectionSettingsDialog.ui:402 msgctxt "ConnectionSettingsDialog|" msgid "Will give up redial tries after N attempts." msgstr "Beende Einwahl-Wiederholugs nach N Versuchen." #: ../src/dialogs/ConnectionSettingsDialog.ui:415 msgctxt "ConnectionSettingsDialog|" msgid "PPP" msgstr "PPP" #: ../src/dialogs/ConnectionSettingsDialog.ui:421 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "exclusively using EAP." msgstr "" "Wenn Sie diese Option ankreutzen, wird sich der PPP Dämon ausschließlich " "über das EAP Protokoll authentifizieren." #: ../src/dialogs/ConnectionSettingsDialog.ui:424 msgctxt "ConnectionSettingsDialog|" msgid "Use Extensible Authentication Protocol (EAP)" msgstr "Verwende das Extensible-Authentication Protocol (EAP)" #: ../src/dialogs/ConnectionSettingsDialog.ui:434 msgctxt "ConnectionSettingsDialog|" msgid "Properties ..." msgstr "Eigenschaften ..." #: ../src/dialogs/ConnectionSettingsDialog.ui:441 msgctxt "ConnectionSettingsDialog|" msgid "Allow these protocols" msgstr "Gestatte folgende Protokolle" #: ../src/dialogs/ConnectionSettingsDialog.ui:449 msgctxt "ConnectionSettingsDialog|" msgid "Unencrypted password (PAP)" msgstr "Unverschlüsseltes Passwort (PAP)" #: ../src/dialogs/ConnectionSettingsDialog.ui:452 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using PAP." msgstr "" "Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer PAP " "Authentifizierung zustimmen." #: ../src/dialogs/ConnectionSettingsDialog.ui:460 msgctxt "ConnectionSettingsDialog|" msgid "Challenge Authentication Protocol (CHAP)" msgstr "Challenge Authentication Protocol (CHAP)" #: ../src/dialogs/ConnectionSettingsDialog.ui:463 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using CHAP." msgstr "" "Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer CHAP " "Authentifizierung zustimmen." #: ../src/dialogs/ConnectionSettingsDialog.ui:471 msgctxt "ConnectionSettingsDialog|" msgid "Microsoft CHAP (MS-Chap)" msgstr "Microsoft CHAP (MS-Chap)" #: ../src/dialogs/ConnectionSettingsDialog.ui:474 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using MS-CHAP." msgstr "" "Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer MS-CHAP " "Authentifizierung zustimmen." #: ../src/dialogs/ConnectionSettingsDialog.ui:482 msgctxt "ConnectionSettingsDialog|" msgid "Microsoft CHAP Version 2 (MS-CHAPv2)" msgstr "Microsoft CHAP Version 2 (MS-CHAPv2)" #: ../src/dialogs/ConnectionSettingsDialog.ui:485 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using MS-CHAPv2." msgstr "" "Wenn Sie diese Option ankreutzen, wird der PPP Dämon einer Microsoft CHAP " "Version 2 (MS-CHAPv2) Authentifizierung zustimmen." #: ../src/dialogs/ConnectionSettingsDialog.ui:505 msgctxt "ConnectionSettingsDialog|" msgid "User name:" msgstr "Benutzername:" #: ../src/dialogs/ConnectionSettingsDialog.ui:515 msgctxt "ConnectionSettingsDialog|" msgid "" "Set the name used for authenticating the local system to the remote access " "server." msgstr "" "Geben Sie hier den Benutzername ein, der verwendet werden soll, um das " "Lokale System beim Zugangsserver zu authentifizieren." #: ../src/dialogs/ConnectionSettingsDialog.ui:522 msgctxt "ConnectionSettingsDialog|" msgid "Password:" msgstr "Passwort:" #: ../src/dialogs/ConnectionSettingsDialog.ui:532 msgctxt "ConnectionSettingsDialog|" msgid "" "Enter your password.\n" "\n" "If left empty you'll be ask each time you try to establish a connection." msgstr "" "Geben Sie hier Ihr Passwort ein. Wenn Sie dieses Feld leer lassen, dann " "werden Sie bei jedem Verbindungsversuch nach dem Passwort gefragt." #: ../src/dialogs/ConnectionSettingsDialog.ui:547 msgctxt "ConnectionSettingsDialog|" msgid "Peer authentication ..." msgstr "Peer-Athentifizierung ..." #: ../src/dialogs/ConnectionSettingsDialog.ui:554 msgctxt "ConnectionSettingsDialog|" msgid "IP settings ..." msgstr "IP Einstellungen ..." #: ../src/dialogs/ConnectionSettingsDialog.ui:561 msgctxt "ConnectionSettingsDialog|" msgid "Advanced ..." msgstr "Erweitert ..." #: ../src/dialogs/ConnectionSettingsDialog.ui:579 msgctxt "ConnectionSettingsDialog|" msgid "&Disable IPSEC Encryption" msgstr "IPSEC Verschlüsselung a&usschalten" #: ../src/dialogs/ConnectionSettingsDialog.cpp:182 msgctxt "ConnectionSettingsDialog|" msgid "Choose private key ..." msgstr "Wählen SIe eine private Schlüssel Datei aus ..." #: ../src/dialogs/ConnectionSettingsDialog.cpp:182 msgctxt "ConnectionSettingsDialog|" msgid "PEM private keys (*.pem)" msgstr "PEM private Schlüssel Dateien (*.pem)" #: ../src/models/ConnectionsModel.cpp:74 msgctxt "ConnectionsModel|" msgid "Name" msgstr "Name" #: ../src/dialogs/EapSettingsDialog.ui:14 msgctxt "EapSettingsDialog|" msgid "EAP settings" msgstr "EAP Einstellungen" #: ../src/dialogs/EapSettingsDialog.ui:33 msgctxt "EapSettingsDialog|" msgid "When connecting" msgstr "Beim Herstellen der Verbindung" #: ../src/dialogs/EapSettingsDialog.ui:39 msgctxt "EapSettingsDialog|" msgid "Use my smart card" msgstr "Eigene Smartcard verwenden" #: ../src/dialogs/EapSettingsDialog.ui:46 msgctxt "EapSettingsDialog|" msgid "Use a certificate on this computer" msgstr "Zertifikat auf diesem Computer verwenden" #: ../src/dialogs/EapSettingsDialog.ui:71 msgctxt "EapSettingsDialog|" msgid "User certificate:" msgstr "Benutzer Zertifikat:" #: ../src/dialogs/EapSettingsDialog.ui:81 msgctxt "EapSettingsDialog|" msgid "Full path to a X.509 encoded personal certificate file" msgstr "Vollständiger Pfad zu einer X-509 Zertifikatdatei" #: ../src/dialogs/EapSettingsDialog.ui:102 msgctxt "EapSettingsDialog|" msgid "Private key:" msgstr "Privater Schlüssel:" #: ../src/dialogs/EapSettingsDialog.ui:112 msgctxt "EapSettingsDialog|" msgid "Full path to a X.509 pem encoded private key file" msgstr "" "Vollständiger Pfad zu einer X.509 PEM kodierten privaten Schlüssel Datei" #: ../src/dialogs/EapSettingsDialog.ui:136 msgctxt "EapSettingsDialog|" msgid "Passphrase:" msgstr "Kennwort:" #: ../src/dialogs/EapSettingsDialog.ui:146 msgctxt "EapSettingsDialog|" msgid "" "Enter the PIN or passphrase for your private key.\n" "\n" "If left empty you'll be ask each time you try to establish a connection." msgstr "" "Geben Sie die PIN oder das Kennwort für Ihren Privaten Schlüssel ein.\n" "\n" "Wenn Sie keine PIN oder kein Kennwort eingeben, werden Sie vor jedem " "Verbindungsveruch nach der PIN oder dem Kennwort gefragt." #: ../src/dialogs/EapSettingsDialog.ui:179 msgctxt "EapSettingsDialog|" msgid "CA Certificate:" msgstr "Stammzertifikate:" #: ../src/dialogs/EapSettingsDialog.ui:189 msgctxt "EapSettingsDialog|" msgid "Full path to a X.509 pem encoded Certificate Authority certificate file" msgstr "Vollständiger Pfad zu einer X-509 Stammzertifikatdatei" #: ../src/dialogs/EapSettingsDialog.cpp:40 msgctxt "EapSettingsDialog|" msgid " - EAP Settings" msgstr "- EAP Einstellungen" #: ../src/dialogs/EapSettingsDialog.cpp:78 #: ../src/dialogs/EapSettingsDialog.cpp:87 msgctxt "EapSettingsDialog|" msgid "Choose your personal certificate ..." msgstr "Wählen Sie Ihr personliches Zertifikat ..." #: ../src/dialogs/EapSettingsDialog.cpp:87 #: ../src/dialogs/EapSettingsDialog.cpp:117 msgctxt "EapSettingsDialog|" msgid "PEM certificates (*.pem)" msgstr "PEM Zertifikate (*.pem)" #: ../src/dialogs/EapSettingsDialog.cpp:102 #: ../src/dialogs/EapSettingsDialog.cpp:108 msgctxt "EapSettingsDialog|" msgid "Choose your private key ..." msgstr "Wählen Sie Ihren privaten Schlüssel ..." #: ../src/dialogs/EapSettingsDialog.cpp:108 msgctxt "EapSettingsDialog|" msgid "PEM private keys (*.pem)" msgstr "PEM private Schlüssel Dateien (*.pem)" #: ../src/dialogs/EapSettingsDialog.cpp:117 msgctxt "EapSettingsDialog|" msgid "Choose a Certificate Authority certificate ..." msgstr "Wähle Sie eine Stammzertifikate-Datei ..." #: ../src/dialogs/InterfaceStatisticsDialog.ui:14 msgctxt "InterfaceStatisticsDialog|" msgid "Interface Statistics" msgstr "Statistik" #: ../src/dialogs/InterfaceStatisticsDialog.ui:30 msgctxt "InterfaceStatisticsDialog|" msgid "Transmitted bytes:" msgstr "Übertragenen Bytes:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:44 msgctxt "InterfaceStatisticsDialog|" msgid "Transmitted packets:" msgstr "Übertragenen Pakete:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:58 msgctxt "InterfaceStatisticsDialog|" msgid "Transmission errors:" msgstr "Übertragungsfehler:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:88 msgctxt "InterfaceStatisticsDialog|" msgid "Received bytes:" msgstr "Empfangenen Bytes:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:102 msgctxt "InterfaceStatisticsDialog|" msgid "Received packets:" msgstr "Empfangenen Pakete:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:116 msgctxt "InterfaceStatisticsDialog|" msgid "Reception errors:" msgstr "Empfangsfehler:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:146 msgctxt "InterfaceStatisticsDialog|" msgid "Connected since:" msgstr "Verbunden seit:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:160 msgctxt "InterfaceStatisticsDialog|" msgid "Connection time:" msgstr "Verbindungszeit:" #: ../src/dialogs/InterfaceStatisticsDialog.ui:197 msgctxt "InterfaceStatisticsDialog|" msgid "Collisions:" msgstr "Kollisionen:" #: ../src/dialogs/InterfaceStatisticsDialog.cpp:89 msgctxt "InterfaceStatisticsDialog|" msgid "Days" msgstr "Tage" #: ../src/dialogs/IpSettingsDialog.ui:14 msgctxt "IpSettingsDialog|" msgid "IpSettingsDialog" msgstr "IP-Einstellungen" #: ../src/dialogs/IpSettingsDialog.ui:36 msgctxt "IpSettingsDialog|" msgid "" "If checked the peer is asked for up to 2 DNS server addresses, otherwise " "provide the desired primary and secundary DNS server addresses manually in " "the edit boxes below." msgstr "" "Wenn angekreutzt werden bis zu zwei DNS Server Adressen automatisch bezogen, " "ansonsten geben Sie bitte die bevorzugte- und die alternative DNS Server " "Adresse manuell ein." #: ../src/dialogs/IpSettingsDialog.ui:39 msgctxt "IpSettingsDialog|" msgid "Obtain DNS server addresses automatically" msgstr "DNS Server Adresse automatisch beziehen" #: ../src/dialogs/IpSettingsDialog.ui:52 msgctxt "IpSettingsDialog|" msgid "Preferred DNS server:" msgstr "Bevorzugter DNS Server:" #: ../src/dialogs/IpSettingsDialog.ui:68 msgctxt "IpSettingsDialog|" msgid "" "Ip addresses of preferred domain name server used to resolve host names. " "Address must be entered as IPv4 address.\n" "\n" "Example:\n" "1.2.3.4" msgstr "" "IP Adresse des bevorzugten Domän-Namensserver. Adresse muss in IPv4 " "schreibweise eingegeben werden.\n" "\n" "Beispiel:\n" "1.2.3.4" #: ../src/dialogs/IpSettingsDialog.ui:94 msgctxt "IpSettingsDialog|" msgid "" "Ip addresses of alternate domain name server used to resolve host names. " "Address must be entered as IPv4 address.\n" "\n" "Example:\n" "1.2.3.4" msgstr "" "IP Adresse des alternativen Domän-Namensserver. Adresse muss in IPv4 " "schreibweise eingegeben werden.\n" "\n" "Beispiel:\n" "1.2.3.4" #: ../src/dialogs/IpSettingsDialog.ui:84 msgctxt "IpSettingsDialog|" msgid "Alternate DNS server:" msgstr "Alternativer DNS Server:" #: ../src/dialogs/IpSettingsDialog.ui:110 msgctxt "IpSettingsDialog|" msgid "Search domains:" msgstr "Standardsuchdomänen:" #: ../src/dialogs/IpSettingsDialog.ui:120 msgctxt "IpSettingsDialog|" msgid "" "Domains used when resolving hostnames.\n" "Use spaces to separate multiple domains." msgstr "" "Domain-Namen, nach denen beim Übersetzen von Hostnamen gesucht werden soll.\n" "Trennen Sie mehrere Domänen durch Leerzeichen." #: ../src/dialogs/IpSettingsDialog.ui:143 msgctxt "IpSettingsDialog|" msgid "Routes ..." msgstr "Routen ..." #: ../src/dialogs/IpSettingsDialog.cpp:34 msgctxt "IpSettingsDialog|" msgid " - Ip Settings" msgstr "- Ip Einstellungen" #: ../src/L2tpIPsecVpnApplication.cpp:107 msgctxt "L2tpIPsecVpnApplication|" msgid "I couldn't find any graphical SU command (gksudo, beesu or kdesudo)." msgstr "Kein graphisches SU kommando ((gksudo, beesu or kdesudo) gefunden." #: ../src/dialogs/PeerAuthenticationDialog.ui:14 msgctxt "PeerAuthenticationDialog|" msgid "PeerAuthenticationDialog" msgstr "Peer-Authentifizierung" #: ../src/dialogs/PeerAuthenticationDialog.ui:32 msgctxt "PeerAuthenticationDialog|" msgid "Remote name:" msgstr "Server-Kennung:" #: ../src/dialogs/PeerAuthenticationDialog.ui:42 msgctxt "PeerAuthenticationDialog|" msgid "" "Set the assumed name of the remote system for authentication purposes.\n" "\n" "If not empty, the name reported by the peer is checked against this name and " "connection will be refused if the reported name is different." msgstr "" "Geben Sie hier die erwartete Kennung des Einwahlservers zu " "authentifizierungszwecken ein.\n" "\n" "Wenn sie dieses Feld nicht leer lassen, wird die eingegebene Kennung mit der " "Kennung die der Einwahlserver meldet verglichen und die Verbindung " "verweigert, wenn die gemeldete und die eingegebne Kennung unterschiedlich " "sind." #: ../src/dialogs/PeerAuthenticationDialog.cpp:33 msgctxt "PeerAuthenticationDialog|" msgid " - Peer Authentication Settings" msgstr "- Peer Authentifizierungseinstellungen" #: ../src/util/Pkcs12.cpp:110 msgctxt "Pkcs12|" msgid "Writing certificate to" msgstr "Speicheren des Zertifikat in" #: ../src/util/Pkcs12.cpp:110 ../src/util/Pkcs12.cpp:140 #: ../src/util/Pkcs12.cpp:171 ../src/util/Pkcs12.cpp:206 msgctxt "Pkcs12|" msgid "failed" msgstr "fehlgeschlagen" #: ../src/util/Pkcs12.cpp:118 msgctxt "Pkcs12|" msgid "No certificate found" msgstr "Keine Zertifikatdatei gefunden" #: ../src/util/Pkcs12.cpp:140 msgctxt "Pkcs12|" msgid "Writing root certificate to" msgstr "Speichern des Stammzertifikates in" #: ../src/util/Pkcs12.cpp:171 msgctxt "Pkcs12|" msgid "Writing private key to" msgstr "Speichern des privaten Schlüssels in" #: ../src/util/Pkcs12.cpp:179 msgctxt "Pkcs12|" msgid "No private key found" msgstr "Keine private Schlüsseldatei gefunden" #: ../src/util/Pkcs12.cpp:204 msgctxt "Pkcs12|" msgid "Wrong passphrase" msgstr "Falsches Kennwort" #: ../src/util/Pkcs12.cpp:206 msgctxt "Pkcs12|" msgid "Parse PKCS#12 file" msgstr "Analysieren der PKCS#12 Datei" #: ../src/util/Pkcs12.cpp:220 msgctxt "Pkcs12|" msgid "The file" msgstr "Die Datei" #: ../src/util/Pkcs12.cpp:220 msgctxt "Pkcs12|" msgid "is not a valid PKCS#12 certificate bundle" msgstr "ist keine gültige PKCS#12 Zertifikatdatei" #: ../src/models/PppRoutesModel.cpp:115 msgctxt "PppRoutesModel|" msgid "Address" msgstr "Adresse" #: ../src/models/PppRoutesModel.cpp:119 msgctxt "PppRoutesModel|" msgid "Netmask" msgstr "Netzmaske" #: ../src/models/PppRoutesModel.cpp:123 msgctxt "PppRoutesModel|" msgid "Comment" msgstr "Bemerkung" #: ../src/dialogs/PreferencesEditorDialog.ui:14 msgctxt "PreferencesEditorDialog|" msgid "Preferences" msgstr "Voreinstellungen" #: ../src/dialogs/PreferencesEditorDialog.ui:31 msgctxt "PreferencesEditorDialog|" msgid "OpenSSL" msgstr "OpenSSL" #: ../src/dialogs/PreferencesEditorDialog.ui:37 msgctxt "PreferencesEditorDialog|" msgid "Engine &ID:" msgstr "Engine &ID:" #: ../src/dialogs/PreferencesEditorDialog.ui:47 #: ../src/dialogs/PreferencesEditorDialog.ui:50 msgctxt "PreferencesEditorDialog|" msgid "Unique identifier for OpenSSL engine" msgstr "Eindeutige Kennung der OpenSSL-Engine" #: ../src/dialogs/PreferencesEditorDialog.ui:57 msgctxt "PreferencesEditorDialog|" msgid "&Engine Path:" msgstr "&Engine Pfad:" #: ../src/dialogs/PreferencesEditorDialog.ui:67 #: ../src/dialogs/PreferencesEditorDialog.ui:74 msgctxt "PreferencesEditorDialog|" msgid "" "\n" "\n" "

Full path to a " "shared library implementing the OpenSSL engine " "interface

" msgstr "" "\n" "\n" "

Vollständiger Pfad " "zu einer gemeinsam benutzten Bibliothek,welche die OpenSSL Engine " "Snittstelle implementiert

" #: ../src/dialogs/PreferencesEditorDialog.ui:99 msgctxt "PreferencesEditorDialog|" msgid "&PKCS 11 Path:" msgstr "&PKCS 11 Pfad:" #: ../src/dialogs/PreferencesEditorDialog.ui:109 #: ../src/dialogs/PreferencesEditorDialog.ui:116 msgctxt "PreferencesEditorDialog|" msgid "" "\n" "\n" "

Full path to a " "shared library implementing the Cryptographic Token " "Interface

" msgstr "" "\n" "\n" "

Vollständiger Pfad " "zu einer gemeinsam benutzten Bibliothek,welche die Cryptographic Token " "Shnittstelle implementiert

" #: ../src/dialogs/PreferencesEditorDialog.cpp:69 msgctxt "PreferencesEditorDialog|" msgid "Choose path of engine library ..." msgstr "Wählen Sie den Pfad für die Engine-Bibliothek ..." #: ../src/dialogs/PreferencesEditorDialog.cpp:79 msgctxt "PreferencesEditorDialog|" msgid "Choose path of PKCS11 library ..." msgstr "Wählen Sie den Pfad für die PKCS11-Bibliothek ..." #: ../src/ConnectionManager.cpp:133 msgctxt "QObject|" msgid "I couldn't detect any system tray on this system." msgstr "Ich konnte keine Systemleiste auf diesem System erkennen." #: ../src/ConnectionManager.cpp:249 msgctxt "QObject|" msgid "No smart card reader found." msgstr "Kein Smartcard Lesegerät gefunden." #: ../src/ConnectionState.cpp:74 msgctxt "QObject|" msgid "Not Connected" msgstr "Nicht verbunden" #: ../src/ConnectionState.cpp:74 ../src/ConnectionState.cpp:82 #: ../src/ConnectionState.cpp:101 ../src/ConnectionState.cpp:120 #: ../src/ConnectionState.cpp:128 msgctxt "QObject|" msgid "Click to show details" msgstr "Klicken Sie hier zur Anzeige von Details" #: ../src/ConnectionState.cpp:82 msgctxt "QObject|" msgid "Connecting to " msgstr "Verbinden mit " #: ../src/ConnectionState.cpp:101 msgctxt "QObject|" msgid "Disconnecting from " msgstr "Verbindung trennen " #: ../src/ConnectionState.cpp:120 msgctxt "QObject|" msgid "Connected to " msgstr "Verbunden mit " #: ../src/ConnectionState.cpp:128 #, qt-format msgctxt "QObject|" msgid "Error %1 occurred when disconnecting from " msgstr "Fehler %1 ist aufgetreten beim Trennen der Verbindung zu " #: ../src/ConnectionState.cpp:128 #, qt-format msgctxt "QObject|" msgid "Error %1 occurred when connecting to " msgstr "Fehler %1 ist aufgetreten beim verbinden mit " #: ../src/conf/AbstractConfWriter.cpp:147 #, qt-format msgctxt "QObject|" msgid "Failed to open configuration file '%1'." msgstr "Konnte Konfigurationsdatei '%1' nicht öffnen." #: ../src/conf/AbstractConfWriter.cpp:150 #, qt-format msgctxt "QObject|" msgid "Failed to backup file '%1'." msgstr "Konnte Datei '%1' nicht sichern." #: ../src/conf/AbstractConfWriter.cpp:153 #, qt-format msgctxt "QObject|" msgid "Failed to create directory '%1'." msgstr "Konnte das Verzeichnis '%1' nicht anlegen." #: ../src/conf/AbstractConfWriter.cpp:156 #, qt-format msgctxt "QObject|" msgid "Failed to expand template '%1'." msgstr "Konnte Vorlage '%1' nicht expandieren." #: ../src/conf/AbstractConfWriter.cpp:159 #, qt-format msgctxt "QObject|" msgid "Failed to get template '%1'." msgstr "Konnte Vorlage '%1' nicht finden." #: ../src/conf/AbstractConfWriter.cpp:174 #, qt-format msgctxt "QObject|" msgid "Failed to open template file ':/templates/%1.tpl'." msgstr "Konnte Vorlagedatei '/templates/%1.tpl' nicht öffnen." #: ../src/conf/ConfWriter.cpp:83 msgctxt "QObject|" msgid "An error occurred while writing " msgstr "Fehler beim Schreiben der Datei" #: ../src/conf/IPsecConfWriter.cpp:75 #: ../src/conf/IPsecSecretsConfWriter.cpp:102 ../src/conf/L2tpConfWriter.cpp:85 #: ../src/conf/PppDownScriptWriter.cpp:68 ../src/conf/PppUpScriptWriter.cpp:85 #, qt-format msgctxt "QObject|" msgid "No such connection: '%1'." msgstr "Den Verbindungsnamen '%1' gibt es nicht." #: ../src/dialogs/PreferencesEditorDialog.cpp:42 msgctxt "QObject|" msgid "Dynamic library files (*.dll)" msgstr "Dynamische Binliotheksdateien (*.dll)" #: ../src/dialogs/PreferencesEditorDialog.cpp:45 msgctxt "QObject|" msgid "Shared library files (*.so)" msgstr "Dynamische Binliotheksdateien (*.so)" #: ../src/dialogs/PreferencesEditorDialog.cpp:118 ../src/main.cpp:119 #, qt-format msgctxt "QObject|" msgid "I couldn't load PKCS11 library %1." msgstr "Konnte PKCS11 Bibliothek %1 nicht laden." #: ../src/dialogs/PreferencesEditorDialog.cpp:123 #, qt-format msgctxt "QObject|" msgid "%1 is not a valid OpenSSL engine library." msgstr "%1 ist keine gültige OpenSSL Engine-Bibliothek." #: ../src/dialogs/PreferencesEditorDialog.cpp:126 #: ../src/dialogs/PreferencesEditorDialog.cpp:129 #: ../src/dialogs/PreferencesEditorDialog.cpp:132 #, qt-format msgctxt "QObject|" msgid "%1 must not be empty." msgstr "Feld %1 darf nicht leer sein." #: ../src/pkcs11/SmartCardState.cpp:35 msgctxt "QObject|" msgid "Please insert your smart card ..." msgstr "Legen Sie bitte Ihre Smartcard ein ..." #: ../src/util/ErrorEx.h:70 msgctxt "QObject|" msgid "Out of Memory" msgstr "Kein freier Speicher mehr verfügbar" #: ../src/util/SecretsChecker.cpp:80 msgctxt "QObject|" msgid "Please enter your PIN:" msgstr "Geben Sie bitte Ihre PIN ein:" #: ../src/util/SecretsChecker.cpp:82 msgctxt "QObject|" msgid "Please enter your passphrase:" msgstr "Geben Sie bitte Ihr Kennwort ein:" #: ../src/util/SecretsChecker.cpp:88 msgctxt "QObject|" msgid "Please enter your password:" msgstr "Geben Sie bitte Ihr Passwort ein:" #: ../src/dialogs/RouteSettingsDialog.ui:14 msgctxt "RouteSettingsDialog|" msgid "RouteSettingsDialog" msgstr "Routen-Einstellungen" #: ../src/dialogs/RouteSettingsDialog.ui:42 msgctxt "RouteSettingsDialog|" msgid "Add" msgstr "Hinzufügen" #: ../src/dialogs/RouteSettingsDialog.ui:52 msgctxt "RouteSettingsDialog|" msgid "Delete ..." msgstr "Löschen ..." #: ../src/dialogs/RouteSettingsDialog.ui:65 msgctxt "RouteSettingsDialog|" msgid "" "route packages with the destination addresses listed here through the PPP " "tunnel." msgstr "" "Leite Pakete mit den hier gelisteten Zieladressen durch den PPP Tunnel." #: ../src/dialogs/RouteSettingsDialog.ui:82 msgctxt "RouteSettingsDialog|" msgid "Use following explicit routes to intranet locations (split tunneling)" msgstr "Verwende folgende expliziten Routen (Split-Tunnel-Steuerung)" #: ../src/dialogs/RouteSettingsDialog.ui:89 msgctxt "RouteSettingsDialog|" msgid "" "\n" "\n" "

Based on the Use default gateway on remote network " "setting, one of the following occurs when the VPN connection is active: " "

\n" "" msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:98 msgctxt "RouteSettingsDialog|" msgid "Use default gateway on the remote network" msgstr "Verwende Standard-Gateway" #: ../src/dialogs/RouteSettingsDialog.cpp:48 msgctxt "RouteSettingsDialog|" msgid "Edit routes for VPN connection " msgstr "Routen für VPN Verbindung bearbeiten" #: ../src/dialogs/RouteSettingsDialog.cpp:79 msgctxt "RouteSettingsDialog|" msgid "Delete Route" msgstr "Route löschen" #: ../src/dialogs/RouteSettingsDialog.cpp:79 #, qt-format msgctxt "RouteSettingsDialog|" msgid "Are you sure you wish to delete the route '%1'?" msgstr "Sind Sie sicher, dass Sie Route '%1' löschen wollen?" #: ../src/dialogs/SmartCardObjectsDialog.ui:14 msgctxt "SmartCardObjectsDialog|" msgid "SmartCardObjectsDialog" msgstr "Smartcard Objekte" #: ../src/VPNControlTask.cpp:518 ../src/VPNControlTask.cpp:520 msgctxt "VPNControlTask|" msgid "A critical error occurred" msgstr "Es ist ein kritischer Fehler aufgetreten" #: ../src/VPNControlTask.cpp:518 msgctxt "VPNControlTask|" msgid "L2tpIPsecVpnControlDaemon is not started" msgstr "L2tpIPsecVpnControlDaemon ist nicht gestartet" #: ../src/VPNControlTask.cpp:520 #, qt-format msgctxt "VPNControlTask|" msgid "Create vpn syslog pipe command failed with exit code: %1" msgstr "" "Das Kommando zum Erzeugen eine Syslog-Pipe is fehlgeschlagen. Rückgabewert %1" l2tp-ipsec-vpn/nls/nls.pot0000664000175000017500000010323512040201227016115 0ustar wejaegerwejaegermsgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Language: de_DE\n" "X-Qt-Contexts: true\n" #: ../src/dialogs/AdvancedSettingsDialog.ui:14 msgctxt "AdvancedSettingsDialog|" msgid "Advanced Settings" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.ui:27 msgctxt "AdvancedSettingsDialog|" msgid "Compression" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.ui:33 msgctxt "AdvancedSettingsDialog|" msgid "Allow &BSD data compression" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.ui:40 msgctxt "AdvancedSettingsDialog|" msgid "Allow &Deflate data compression" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.ui:47 msgctxt "AdvancedSettingsDialog|" msgid "Use TCP &header compression" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.ui:57 msgctxt "AdvancedSettingsDialog|" msgid "Echo" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.ui:63 msgctxt "AdvancedSettingsDialog|" msgid "Send PPP &echo packets" msgstr "" #: ../src/dialogs/AdvancedSettingsDialog.cpp:33 msgctxt "AdvancedSettingsDialog|" msgid " - Advanced Settings" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:14 msgctxt "CertificateImportDialog|" msgid "Import Certificate Dialog" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:36 msgctxt "CertificateImportDialog|" msgid "" "Full path to PKCS12 (*.p12, *.pfx) encoded certificate bundle file to import" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:91 msgctxt "CertificateImportDialog|" msgid "PKCS12 File:" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:101 msgctxt "CertificateImportDialog|" msgid "" "If checked. the imported certificate is automatically selected as IPsec " "authentication certificate " msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:104 msgctxt "CertificateImportDialog|" msgid "Use this certificate for IPsec authentication" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:126 msgctxt "CertificateImportDialog|" msgid "Private key passphrase:" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:133 msgctxt "CertificateImportDialog|" msgid "" "Enter the passphrase that shall be used to encrypt the imported private key" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:143 msgctxt "CertificateImportDialog|" msgid "Verify private key passphrase:" msgstr "" #: ../src/dialogs/CertificateImportDialog.ui:150 msgctxt "CertificateImportDialog|" msgid "Type the private key passphrase again to confirm" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:110 msgctxt "CertificateImportDialog|" msgid "PKSC#12 certificate bundle (*.p12 *.pfx)" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:110 msgctxt "CertificateImportDialog|" msgid "Choose the PKCS12 certificate bundle to import ..." msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:119 msgctxt "CertificateImportDialog|" msgid "Passphrase Entry Dialog" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:119 msgctxt "CertificateImportDialog|" msgid "" "Please enter the passphrase that was used to encrypt this certificate bundle:" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:135 msgctxt "CertificateImportDialog|" msgid "Content:" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:136 msgctxt "CertificateImportDialog|" msgid "certificate" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:136 msgctxt "CertificateImportDialog|" msgid "issued by" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:139 msgctxt "CertificateImportDialog|" msgid "private key" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:141 #, qt-format msgctxt "CertificateImportDialog|" msgid "%n root certificate(s)" msgid_plural "%n root certificate(s)" msgstr[0] "" #: ../src/dialogs/CertificateImportDialog.cpp:188 msgctxt "CertificateImportDialog|" msgid "certificate file" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:195 msgctxt "CertificateImportDialog|" msgid "private key file" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:201 msgctxt "CertificateImportDialog|" msgid "root certificate file" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:212 msgctxt "CertificateImportDialog|" msgid "Error:" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:225 msgctxt "CertificateImportDialog|" msgid "A" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:225 msgctxt "CertificateImportDialog|" msgid "already exists. Do you want to replace it?" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:227 msgctxt "CertificateImportDialog|" msgid "The" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:227 msgctxt "CertificateImportDialog|" msgid "already exists in" msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:227 msgctxt "CertificateImportDialog|" msgid ". Replacing it will overwrite its contents." msgstr "" #: ../src/dialogs/CertificateImportDialog.cpp:230 msgctxt "CertificateImportDialog|" msgid "Importing certificates ..." msgstr "" #: ../src/dialogs/ConnectionEditorDialog.ui:14 msgctxt "ConnectionEditorDialog|" msgid "VPN Connections" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.ui:33 msgctxt "ConnectionEditorDialog|" msgid "&Add ..." msgstr "" #: ../src/dialogs/ConnectionEditorDialog.ui:43 msgctxt "ConnectionEditorDialog|" msgid "&Edit ..." msgstr "" #: ../src/dialogs/ConnectionEditorDialog.ui:56 msgctxt "ConnectionEditorDialog|" msgid "&Delete ..." msgstr "" #: ../src/dialogs/ConnectionEditorDialog.ui:112 msgctxt "ConnectionEditorDialog|" msgid "&Preferences ..." msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:107 msgctxt "ConnectionEditorDialog|" msgid "You need to reconnect for your changes to take effect!" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:153 msgctxt "ConnectionEditorDialog|" msgid "Apply settings" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:153 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to apply settings" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:176 #: ../src/dialogs/ConnectionEditorDialog.cpp:212 msgctxt "ConnectionEditorDialog|" msgid "New Connection" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:183 msgctxt "ConnectionEditorDialog|" msgid "Connection name:" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:198 #, qt-format msgctxt "ConnectionEditorDialog|" msgid "A connection with name '%1' already exists" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:202 #, qt-format msgctxt "ConnectionEditorDialog|" msgid "" "The provided name '%1' contains invalid characters.\n" "\n" "Name must start with a letter and may contain only letters, digits, periods, " "underscores, and hyphens.\n" "Maximum length is 30." msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:212 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to add a connection" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:232 msgctxt "ConnectionEditorDialog|" msgid "Edit Connection" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:232 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to edit a connection" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:247 #: ../src/dialogs/ConnectionEditorDialog.cpp:264 msgctxt "ConnectionEditorDialog|" msgid "Delete Connection" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:247 #, qt-format msgctxt "ConnectionEditorDialog|" msgid "Are you sure you wish to delete the connection '%1'?" msgstr "" #: ../src/dialogs/ConnectionEditorDialog.cpp:264 msgctxt "ConnectionEditorDialog|" msgid "You do not have the permission to remmove a connection" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:20 msgctxt "ConnectionInformationDialog|" msgid "L2TP IPSec VPN" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:33 msgctxt "ConnectionInformationDialog|" msgid "Info" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:39 msgctxt "ConnectionInformationDialog|" msgid "Remote Server:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:59 msgctxt "ConnectionInformationDialog|" msgid "PtP Interface:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:79 msgctxt "ConnectionInformationDialog|" msgid "Destination Address:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:99 msgctxt "ConnectionInformationDialog|" msgid "IP Address:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:119 msgctxt "ConnectionInformationDialog|" msgid "Subnet Mask:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:133 msgctxt "ConnectionInformationDialog|" msgid "Primary DNS:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:153 msgctxt "ConnectionInformationDialog|" msgid "Secondary DNS:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:173 msgctxt "ConnectionInformationDialog|" msgid "Tenary DNS:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:196 msgctxt "ConnectionInformationDialog|" msgid "Statistics ..." msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:206 msgctxt "ConnectionInformationDialog|" msgid "Internet Interface:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:220 msgctxt "ConnectionInformationDialog|" msgid "Internet Interface Gateway:" msgstr "" #: ../src/dialogs/ConnectionInformationDialog.ui:235 msgctxt "ConnectionInformationDialog|" msgid "Logs" msgstr "" #: ../src/ConnectionManager.cpp:140 msgctxt "ConnectionManager|" msgid "&Disconnect" msgstr "" #: ../src/ConnectionManager.cpp:141 msgctxt "ConnectionManager|" msgid "&Edit Connections ..." msgstr "" #: ../src/ConnectionManager.cpp:142 msgctxt "ConnectionManager|" msgid "Connection &Information" msgstr "" #: ../src/ConnectionManager.cpp:143 msgctxt "ConnectionManager|" msgid "&About" msgstr "" #: ../src/ConnectionManager.cpp:144 msgctxt "ConnectionManager|" msgid "&Quit" msgstr "" #: ../src/ConnectionManager.cpp:316 #, qt-format msgctxt "ConnectionManager|" msgid "About %1" msgstr "" #: ../src/ConnectionManager.cpp:318 msgctxt "ConnectionManager|" msgid "" "Notification area applet for managing your L2tp over IPsec virtual private " "network connections." msgstr "" #: ../src/ConnectionManager.cpp:451 #, qt-format msgctxt "ConnectionManager|" msgid "Click to establish a vpn connection to '%1'" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:14 msgctxt "ConnectionSettingsDialog|" msgid "Connection Settings" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:32 msgctxt "ConnectionSettingsDialog|" msgid "Connection &name:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:63 msgctxt "ConnectionSettingsDialog|" msgid "Connect &automatically" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:86 msgctxt "ConnectionSettingsDialog|" msgid "IPsec" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:109 msgctxt "ConnectionSettingsDialog|" msgid "&Remote Server:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:131 msgctxt "ConnectionSettingsDialog|" msgid "" "IPv4 address or domain name of the remote access server that you want to " "connect to.\n" "\n" "Examples:\n" "1.2.3.4\n" "ipsec.server.edu" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:142 msgctxt "ConnectionSettingsDialog|" msgid "Server &Identity:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:161 msgctxt "ConnectionSettingsDialog|" msgid "" "Leave empty if you don't want to check peers's identity,\n" "otherwise enter the peer's identity \n" "\n" "This is mostly a distinguished name like 'CN=cisco-fcs-ber'." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:173 msgctxt "ConnectionSettingsDialog|" msgid "Use &pre-shared key for authentication" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:193 msgctxt "ConnectionSettingsDialog|" msgid "Use &Certificate for authentication" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:228 msgctxt "ConnectionSettingsDialog|" msgid "Private &key:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:238 msgctxt "ConnectionSettingsDialog|" msgid "Full path to a X.509 pem encoded private key file" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:248 msgctxt "ConnectionSettingsDialog|" msgid "Passphrase:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:285 msgctxt "ConnectionSettingsDialog|" msgid "Import ..." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:296 msgctxt "ConnectionSettingsDialog|" msgid "L2TP" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:302 msgctxt "ConnectionSettingsDialog|" msgid "If checked, l2tpd will attempt to redial if the call get disconected." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:305 msgctxt "ConnectionSettingsDialog|" msgid "Redial" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:318 msgctxt "ConnectionSettingsDialog|" msgid "" "If Checked, the length bit present in the l2tp packet payload will be used." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:321 msgctxt "ConnectionSettingsDialog|" msgid "Length bit" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:345 msgctxt "ConnectionSettingsDialog|" msgid "Timeout:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:364 msgctxt "ConnectionSettingsDialog|" msgid "" "Wait N seconds before redial. The redial option must be set to yes to use " "this option." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:380 msgctxt "ConnectionSettingsDialog|" msgid "Attempts:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:402 msgctxt "ConnectionSettingsDialog|" msgid "Will give up redial tries after N attempts." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:415 msgctxt "ConnectionSettingsDialog|" msgid "PPP" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:421 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "exclusively using EAP." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:424 msgctxt "ConnectionSettingsDialog|" msgid "Use Extensible Authentication Protocol (EAP)" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:434 msgctxt "ConnectionSettingsDialog|" msgid "Properties ..." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:441 msgctxt "ConnectionSettingsDialog|" msgid "Allow these protocols" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:449 msgctxt "ConnectionSettingsDialog|" msgid "Unencrypted password (PAP)" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:452 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using PAP." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:460 msgctxt "ConnectionSettingsDialog|" msgid "Challenge Authentication Protocol (CHAP)" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:463 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using CHAP." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:471 msgctxt "ConnectionSettingsDialog|" msgid "Microsoft CHAP (MS-Chap)" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:474 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using MS-CHAP." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:482 msgctxt "ConnectionSettingsDialog|" msgid "Microsoft CHAP Version 2 (MS-CHAPv2)" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:485 msgctxt "ConnectionSettingsDialog|" msgid "" "With this option set, pppd will agree to authenticate itself to the peer " "using MS-CHAPv2." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:505 msgctxt "ConnectionSettingsDialog|" msgid "User name:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:515 msgctxt "ConnectionSettingsDialog|" msgid "" "Set the name used for authenticating the local system to the remote access " "server." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:522 msgctxt "ConnectionSettingsDialog|" msgid "Password:" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:532 msgctxt "ConnectionSettingsDialog|" msgid "" "Enter your password.\n" "\n" "If left empty you'll be ask each time you try to establish a connection." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:547 msgctxt "ConnectionSettingsDialog|" msgid "Peer authentication ..." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:554 msgctxt "ConnectionSettingsDialog|" msgid "IP settings ..." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:561 msgctxt "ConnectionSettingsDialog|" msgid "Advanced ..." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.ui:579 msgctxt "ConnectionSettingsDialog|" msgid "&Disable IPSEC Encryption" msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.cpp:182 msgctxt "ConnectionSettingsDialog|" msgid "Choose private key ..." msgstr "" #: ../src/dialogs/ConnectionSettingsDialog.cpp:182 msgctxt "ConnectionSettingsDialog|" msgid "PEM private keys (*.pem)" msgstr "" #: ../src/models/ConnectionsModel.cpp:74 msgctxt "ConnectionsModel|" msgid "Name" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:14 msgctxt "EapSettingsDialog|" msgid "EAP settings" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:33 msgctxt "EapSettingsDialog|" msgid "When connecting" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:39 msgctxt "EapSettingsDialog|" msgid "Use my smart card" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:46 msgctxt "EapSettingsDialog|" msgid "Use a certificate on this computer" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:71 msgctxt "EapSettingsDialog|" msgid "User certificate:" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:81 msgctxt "EapSettingsDialog|" msgid "Full path to a X.509 encoded personal certificate file" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:102 msgctxt "EapSettingsDialog|" msgid "Private key:" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:112 msgctxt "EapSettingsDialog|" msgid "Full path to a X.509 pem encoded private key file" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:136 msgctxt "EapSettingsDialog|" msgid "Passphrase:" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:146 msgctxt "EapSettingsDialog|" msgid "" "Enter the PIN or passphrase for your private key.\n" "\n" "If left empty you'll be ask each time you try to establish a connection." msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:179 msgctxt "EapSettingsDialog|" msgid "CA Certificate:" msgstr "" #: ../src/dialogs/EapSettingsDialog.ui:189 msgctxt "EapSettingsDialog|" msgid "Full path to a X.509 pem encoded Certificate Authority certificate file" msgstr "" #: ../src/dialogs/EapSettingsDialog.cpp:40 msgctxt "EapSettingsDialog|" msgid " - EAP Settings" msgstr "" #: ../src/dialogs/EapSettingsDialog.cpp:78 #: ../src/dialogs/EapSettingsDialog.cpp:87 msgctxt "EapSettingsDialog|" msgid "Choose your personal certificate ..." msgstr "" #: ../src/dialogs/EapSettingsDialog.cpp:87 #: ../src/dialogs/EapSettingsDialog.cpp:117 msgctxt "EapSettingsDialog|" msgid "PEM certificates (*.pem)" msgstr "" #: ../src/dialogs/EapSettingsDialog.cpp:102 #: ../src/dialogs/EapSettingsDialog.cpp:108 msgctxt "EapSettingsDialog|" msgid "Choose your private key ..." msgstr "" #: ../src/dialogs/EapSettingsDialog.cpp:108 msgctxt "EapSettingsDialog|" msgid "PEM private keys (*.pem)" msgstr "" #: ../src/dialogs/EapSettingsDialog.cpp:117 msgctxt "EapSettingsDialog|" msgid "Choose a Certificate Authority certificate ..." msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:14 msgctxt "InterfaceStatisticsDialog|" msgid "Interface Statistics" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:30 msgctxt "InterfaceStatisticsDialog|" msgid "Transmitted bytes:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:44 msgctxt "InterfaceStatisticsDialog|" msgid "Transmitted packets:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:58 msgctxt "InterfaceStatisticsDialog|" msgid "Transmission errors:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:88 msgctxt "InterfaceStatisticsDialog|" msgid "Received bytes:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:102 msgctxt "InterfaceStatisticsDialog|" msgid "Received packets:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:116 msgctxt "InterfaceStatisticsDialog|" msgid "Reception errors:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:146 msgctxt "InterfaceStatisticsDialog|" msgid "Connected since:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:160 msgctxt "InterfaceStatisticsDialog|" msgid "Connection time:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.ui:197 msgctxt "InterfaceStatisticsDialog|" msgid "Collisions:" msgstr "" #: ../src/dialogs/InterfaceStatisticsDialog.cpp:89 msgctxt "InterfaceStatisticsDialog|" msgid "Days" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:14 msgctxt "IpSettingsDialog|" msgid "IpSettingsDialog" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:36 msgctxt "IpSettingsDialog|" msgid "" "If checked the peer is asked for up to 2 DNS server addresses, otherwise " "provide the desired primary and secundary DNS server addresses manually in " "the edit boxes below." msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:39 msgctxt "IpSettingsDialog|" msgid "Obtain DNS server addresses automatically" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:52 msgctxt "IpSettingsDialog|" msgid "Preferred DNS server:" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:68 msgctxt "IpSettingsDialog|" msgid "" "Ip addresses of preferred domain name server used to resolve host names. " "Address must be entered as IPv4 address.\n" "\n" "Example:\n" "1.2.3.4" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:94 msgctxt "IpSettingsDialog|" msgid "" "Ip addresses of alternate domain name server used to resolve host names. " "Address must be entered as IPv4 address.\n" "\n" "Example:\n" "1.2.3.4" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:84 msgctxt "IpSettingsDialog|" msgid "Alternate DNS server:" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:110 msgctxt "IpSettingsDialog|" msgid "Search domains:" msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:120 msgctxt "IpSettingsDialog|" msgid "" "Domains used when resolving hostnames.\n" "Use spaces to separate multiple domains." msgstr "" #: ../src/dialogs/IpSettingsDialog.ui:143 msgctxt "IpSettingsDialog|" msgid "Routes ..." msgstr "" #: ../src/dialogs/IpSettingsDialog.cpp:34 msgctxt "IpSettingsDialog|" msgid " - Ip Settings" msgstr "" #: ../src/L2tpIPsecVpnApplication.cpp:107 msgctxt "L2tpIPsecVpnApplication|" msgid "I couldn't find any graphical SU command (gksudo, beesu or kdesudo)." msgstr "" #: ../src/dialogs/PeerAuthenticationDialog.ui:14 msgctxt "PeerAuthenticationDialog|" msgid "PeerAuthenticationDialog" msgstr "" #: ../src/dialogs/PeerAuthenticationDialog.ui:32 msgctxt "PeerAuthenticationDialog|" msgid "Remote name:" msgstr "" #: ../src/dialogs/PeerAuthenticationDialog.ui:42 msgctxt "PeerAuthenticationDialog|" msgid "" "Set the assumed name of the remote system for authentication purposes.\n" "\n" "If not empty, the name reported by the peer is checked against this name and " "connection will be refused if the reported name is different." msgstr "" #: ../src/dialogs/PeerAuthenticationDialog.cpp:33 msgctxt "PeerAuthenticationDialog|" msgid " - Peer Authentication Settings" msgstr "" #: ../src/util/Pkcs12.cpp:110 msgctxt "Pkcs12|" msgid "Writing certificate to" msgstr "" #: ../src/util/Pkcs12.cpp:110 ../src/util/Pkcs12.cpp:140 #: ../src/util/Pkcs12.cpp:171 ../src/util/Pkcs12.cpp:206 msgctxt "Pkcs12|" msgid "failed" msgstr "" #: ../src/util/Pkcs12.cpp:118 msgctxt "Pkcs12|" msgid "No certificate found" msgstr "" #: ../src/util/Pkcs12.cpp:140 msgctxt "Pkcs12|" msgid "Writing root certificate to" msgstr "" #: ../src/util/Pkcs12.cpp:171 msgctxt "Pkcs12|" msgid "Writing private key to" msgstr "" #: ../src/util/Pkcs12.cpp:179 msgctxt "Pkcs12|" msgid "No private key found" msgstr "" #: ../src/util/Pkcs12.cpp:204 msgctxt "Pkcs12|" msgid "Wrong passphrase" msgstr "" #: ../src/util/Pkcs12.cpp:206 msgctxt "Pkcs12|" msgid "Parse PKCS#12 file" msgstr "" #: ../src/util/Pkcs12.cpp:220 msgctxt "Pkcs12|" msgid "The file" msgstr "" #: ../src/util/Pkcs12.cpp:220 msgctxt "Pkcs12|" msgid "is not a valid PKCS#12 certificate bundle" msgstr "" #: ../src/models/PppRoutesModel.cpp:115 msgctxt "PppRoutesModel|" msgid "Address" msgstr "" #: ../src/models/PppRoutesModel.cpp:119 msgctxt "PppRoutesModel|" msgid "Netmask" msgstr "" #: ../src/models/PppRoutesModel.cpp:123 msgctxt "PppRoutesModel|" msgid "Comment" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:14 msgctxt "PreferencesEditorDialog|" msgid "Preferences" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:31 msgctxt "PreferencesEditorDialog|" msgid "OpenSSL" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:37 msgctxt "PreferencesEditorDialog|" msgid "Engine &ID:" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:47 #: ../src/dialogs/PreferencesEditorDialog.ui:50 msgctxt "PreferencesEditorDialog|" msgid "Unique identifier for OpenSSL engine" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:57 msgctxt "PreferencesEditorDialog|" msgid "&Engine Path:" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:67 #: ../src/dialogs/PreferencesEditorDialog.ui:74 msgctxt "PreferencesEditorDialog|" msgid "" "\n" "\n" "

Full path to a " "shared library implementing the OpenSSL engine " "interface

" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:99 msgctxt "PreferencesEditorDialog|" msgid "&PKCS 11 Path:" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.ui:109 #: ../src/dialogs/PreferencesEditorDialog.ui:116 msgctxt "PreferencesEditorDialog|" msgid "" "\n" "\n" "

Full path to a " "shared library implementing the Cryptographic Token " "Interface

" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:69 msgctxt "PreferencesEditorDialog|" msgid "Choose path of engine library ..." msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:79 msgctxt "PreferencesEditorDialog|" msgid "Choose path of PKCS11 library ..." msgstr "" #: ../src/ConnectionManager.cpp:133 msgctxt "QObject|" msgid "I couldn't detect any system tray on this system." msgstr "" #: ../src/ConnectionManager.cpp:249 msgctxt "QObject|" msgid "No smart card reader found." msgstr "" #: ../src/ConnectionState.cpp:74 msgctxt "QObject|" msgid "Not Connected" msgstr "" #: ../src/ConnectionState.cpp:74 ../src/ConnectionState.cpp:82 #: ../src/ConnectionState.cpp:101 ../src/ConnectionState.cpp:120 #: ../src/ConnectionState.cpp:128 msgctxt "QObject|" msgid "Click to show details" msgstr "" #: ../src/ConnectionState.cpp:82 msgctxt "QObject|" msgid "Connecting to " msgstr "" #: ../src/ConnectionState.cpp:101 msgctxt "QObject|" msgid "Disconnecting from " msgstr "" #: ../src/ConnectionState.cpp:120 msgctxt "QObject|" msgid "Connected to " msgstr "" #: ../src/ConnectionState.cpp:128 #, qt-format msgctxt "QObject|" msgid "Error %1 occurred when disconnecting from " msgstr "" #: ../src/ConnectionState.cpp:128 #, qt-format msgctxt "QObject|" msgid "Error %1 occurred when connecting to " msgstr "" #: ../src/conf/AbstractConfWriter.cpp:147 #, qt-format msgctxt "QObject|" msgid "Failed to open configuration file '%1'." msgstr "" #: ../src/conf/AbstractConfWriter.cpp:150 #, qt-format msgctxt "QObject|" msgid "Failed to backup file '%1'." msgstr "" #: ../src/conf/AbstractConfWriter.cpp:153 #, qt-format msgctxt "QObject|" msgid "Failed to create directory '%1'." msgstr "" #: ../src/conf/AbstractConfWriter.cpp:156 #, qt-format msgctxt "QObject|" msgid "Failed to expand template '%1'." msgstr "" #: ../src/conf/AbstractConfWriter.cpp:159 #, qt-format msgctxt "QObject|" msgid "Failed to get template '%1'." msgstr "" #: ../src/conf/AbstractConfWriter.cpp:174 #, qt-format msgctxt "QObject|" msgid "Failed to open template file ':/templates/%1.tpl'." msgstr "" #: ../src/conf/ConfWriter.cpp:83 msgctxt "QObject|" msgid "An error occurred while writing " msgstr "" #: ../src/conf/IPsecConfWriter.cpp:75 #: ../src/conf/IPsecSecretsConfWriter.cpp:102 ../src/conf/L2tpConfWriter.cpp:85 #: ../src/conf/PppDownScriptWriter.cpp:68 ../src/conf/PppUpScriptWriter.cpp:85 #, qt-format msgctxt "QObject|" msgid "No such connection: '%1'." msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:42 msgctxt "QObject|" msgid "Dynamic library files (*.dll)" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:45 msgctxt "QObject|" msgid "Shared library files (*.so)" msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:118 ../src/main.cpp:119 #, qt-format msgctxt "QObject|" msgid "I couldn't load PKCS11 library %1." msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:123 #, qt-format msgctxt "QObject|" msgid "%1 is not a valid OpenSSL engine library." msgstr "" #: ../src/dialogs/PreferencesEditorDialog.cpp:126 #: ../src/dialogs/PreferencesEditorDialog.cpp:129 #: ../src/dialogs/PreferencesEditorDialog.cpp:132 #, qt-format msgctxt "QObject|" msgid "%1 must not be empty." msgstr "" #: ../src/pkcs11/SmartCardState.cpp:35 msgctxt "QObject|" msgid "Please insert your smart card ..." msgstr "" #: ../src/util/ErrorEx.h:70 msgctxt "QObject|" msgid "Out of Memory" msgstr "" #: ../src/util/SecretsChecker.cpp:80 msgctxt "QObject|" msgid "Please enter your PIN:" msgstr "" #: ../src/util/SecretsChecker.cpp:82 msgctxt "QObject|" msgid "Please enter your passphrase:" msgstr "" #: ../src/util/SecretsChecker.cpp:88 msgctxt "QObject|" msgid "Please enter your password:" msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:14 msgctxt "RouteSettingsDialog|" msgid "RouteSettingsDialog" msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:42 msgctxt "RouteSettingsDialog|" msgid "Add" msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:52 msgctxt "RouteSettingsDialog|" msgid "Delete ..." msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:65 msgctxt "RouteSettingsDialog|" msgid "" "route packages with the destination addresses listed here through the PPP " "tunnel." msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:82 msgctxt "RouteSettingsDialog|" msgid "Use following explicit routes to intranet locations (split tunneling)" msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:89 msgctxt "RouteSettingsDialog|" msgid "" "\n" "\n" "

Based on the Use default gateway on remote network " "setting, one of the following occurs when the VPN connection is active: " "

\n" "" msgstr "" #: ../src/dialogs/RouteSettingsDialog.ui:98 msgctxt "RouteSettingsDialog|" msgid "Use default gateway on the remote network" msgstr "" #: ../src/dialogs/RouteSettingsDialog.cpp:48 msgctxt "RouteSettingsDialog|" msgid "Edit routes for VPN connection " msgstr "" #: ../src/dialogs/RouteSettingsDialog.cpp:79 msgctxt "RouteSettingsDialog|" msgid "Delete Route" msgstr "" #: ../src/dialogs/RouteSettingsDialog.cpp:79 #, qt-format msgctxt "RouteSettingsDialog|" msgid "Are you sure you wish to delete the route '%1'?" msgstr "" #: ../src/dialogs/SmartCardObjectsDialog.ui:14 msgctxt "SmartCardObjectsDialog|" msgid "SmartCardObjectsDialog" msgstr "" #: ../src/VPNControlTask.cpp:518 ../src/VPNControlTask.cpp:520 msgctxt "VPNControlTask|" msgid "A critical error occurred" msgstr "" #: ../src/VPNControlTask.cpp:518 msgctxt "VPNControlTask|" msgid "L2tpIPsecVpnControlDaemon is not started" msgstr "" #: ../src/VPNControlTask.cpp:520 #, qt-format msgctxt "VPNControlTask|" msgid "Create vpn syslog pipe command failed with exit code: %1" msgstr "" l2tp-ipsec-vpn/GPL0000664000175000017500000010437412040201227014353 0ustar wejaegerwejaeger GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . l2tp-ipsec-vpn/docs/0000775000175000017500000000000012040201227014725 5ustar wejaegerwejaegerl2tp-ipsec-vpn/docs/Doxyfile0000664000175000017500000020401212040201227016432 0ustar wejaegerwejaeger# Doxyfile 1.6.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "L2TP over IPsec VPN Manager" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 1.0.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = /home/wejaeger/DEVELOP/Java/projects/L2tpIPsecVpn/docs/api # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set # FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = /home/wejaeger/DEVELOP/Java/projects/L2tpIPsecVpn/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.d \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.idl \ *.odl \ *.cs \ *.php \ *.php3 \ *.inc \ *.m \ *.mm \ *.dox \ *.py \ *.f90 \ *.f \ *.vhd \ *.vhdl # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = YES # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvances is that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = YES # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = YES # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES l2tp-ipsec-vpn/docs/L2tpIPsecVpn.10000664000175000017500000000337612040201227017251 0ustar wejaegerwejaeger.TH L2tpIPsecVpn 1 "11 Oct 2012" "version 1.0.9" .SH NAME \fBL2tpIPsecVpn\fP \- L2tp over IPsec VPN Manager applet for the GNOME Desktop .SH SYNOPSIS .B L2tpIPsecVpn [\fIoptions\fR] .SH DESCRIPTION This GUI is not a network manager plugin. However, it provides a systray icon in the indicator applet from which a non privileged user can establish and bring down L2TP over IPsec VPN connections. From there the user can add, remove and edit vpn connections. Editing allows configuring various options for IPsec, L2TP and PPP. Among others, the user can configure eg. the gateway, the use of either PSK or a certificate for authentication, various L2TP options as redial- timeout and attempts and of course all important PPP options. It also allows you to configure PPP for tunnel splitting because you can add routes as you want. When applying your settings, all necessary configuration files are written accordingly (ipsec.conf, xl2tp.conf, options.xl2tpd, opensc.conf up and down scripts ...). It relies on Openswan and xl2tp packages as the underlying protocol handlers. You can also use certificates on your local machine or, if e.g. OpenSC is installed and configured, even on a smart card to handle PPP authentication. The GUI automatically detects when network interfaces are going up or down and can (if so configured) automatically establish or close VPN connections. .LP .SH OPTIONS .TP \fBstartConnectionEditor\fR Starts the connection editor dialog. .TP \fBapplySettings\fR Write configuration files according to the connection settings, must be started with root privileges, ie use gksudo as non root user. .TP \fBdeleteAllConfFiles\fR Delete all configuration files, must be started with root privileges, ie use gksudo as non root user. .SH AUTHORS Werner Jaeger l2tp-ipsec-vpn/build/0000775000175000017500000000000012040201225015072 5ustar wejaegerwejaegerl2tp-ipsec-vpn/tests/0000775000175000017500000000000012040201225015135 5ustar wejaegerwejaegerl2tp-ipsec-vpn/tests/data/0000775000175000017500000000000012040201225016046 5ustar wejaegerwejaegerl2tp-ipsec-vpn/tests/data/test.p120000664000175000017500000000657512040201225017366 0ustar wejaegerwejaeger0 y0 ? *H  0 ,0 (0 ' *H  0 0  *H 0 *H  0+1_#> 2N)&%4&{Xo9;QZ)e ,X~Ss8I Q+.ُ@<&4RuS7%*FyvʢE50*[`#M˝p~u-lǦƜp+-zft "|Ŝ% )AW8ix!j㹉OyjqR،"Z]'<hs!J8%&NpSF"r ɛvޝ* Bᨁ*(_8i. Pg).UqFAIqS|pQb/I@6bc>MƳSߛhˍMVwE]AtXDe%R|@zbr+˔޵;0""Md_%|WW%psE1 ?"?~Չ ΁rKBͺ:=WpZ/tHfr8fjzV'QFZ /׉A$`蓽"g=^ X$՟SzRFUd^A, NhQ9gxOFu`m6+3Lێa<>9Wi W/y%47SԨ-S'bCb20"~I$LP5϶U(T%JRZR B#@Ƥ r}Z+$JNL('>)3{n;n(v'3@"4KEU>eh W`' 5ߑg$ݶض ji13|Q̸e˪G4!cOa% ZP 7kNZ6z@7a ` nT/Lz1C|0.?e A0".b<>"Emc5 %[rC&uwyVSepf$]=mҗexY>H'i2}PRڊ$_bJږ'|%"jJ1G;TljvQH53;ueꋬH_nיw@ ڱ9鱝8g!uo)5AeDm,w}qhn⧠:vY [ R&rmp!OjM|f('lTW/grqŬzX9O"Fnu.}CQY_n{RWL^O#r杻(쯝[$q$C܆oьd*ZN²V6 ovw]B'gʤCp*H'y=,T3O{x(3"ɊC+YeHȇ\iUy>VEw8: -âl/327f}d$~3VKv ˪/c,qz_ejǨ(s /BWDEj0V8#Ir)N ,9PZ:X Ǚ%ï6-Ki/M">ikzNWY6j"V@m龜6+vc$KxA(pDȤs&\gׂrJ|&B!$+^Ŏ 3SMGw뷷$7 cx'Ӡq[IltNTX)jgc?(RjhhK#)c8L+8>By߳Sy$.SeoV|ag\',{4{}/awed zɐp.kx|jK&R MNط' zڟu@-Kl]FG"șYT24v]˗/[YL@_c>$HlY3)}A)Tu ea[Ì1=Tǵ'w^||.>bHl(KM\CÑ[X5X֤MGlS[hR`}G$AgOT[B]oQDNWg$)S)Ņ@j5E>&q" "&Q7Q@X4/ p-*FIEC4.RZ7S>{؞{w(dO/@(b7s9&?ڈ}i}knɪY<6e[Q]Y&2!뭕:B7-9C{Zv~8H<4|lqۛ2H $4p^YKA1، :*%+#4.hdAg1%0# *H  1"H\ {*[?IM010!0 +At-1z}^cS@+|dl2tp-ipsec-vpn/tests/data/invalid.p120000664000175000017500000003717612040201225020036 0ustar wejaegerwejaeger0000000: 30c2 820a 0102 0103 30c2 8209 c387 0609 1.......0....... 0000010: 2ac2 8648 c286 c3b7 0d01 0701 c2a0 c282 *..H............ 0000020: 09c2 b804 c282 09c2 b430 c282 09c2 b030 .........0.....0 0000030: c282 06c2 af06 092a c286 48c2 86c3 b70d .......*..H..... 0000040: 0107 06c2 a0c2 8206 c2a0 30c2 8206 c29c ..........0..... 0000050: 0201 0030 c282 06c2 9506 092a c286 48c2 ...0.......*..H. 0000060: 86c3 b70d 0107 0130 1c06 0a2a c286 48c2 .......0...*..H. 0000070: 86c3 b70d 010c 0106 300e 0408 c2b7 c2a9 ........0....... 0000080: c28e 38c3 b0c2 83c2 bcc2 b902 0208 00c2 ..8............. 0000090: 80c2 8206 68c3 b833 2bc3 a637 c39f 3ac3 ....h..3+..7..:. 00000a0: 8a01 67c3 987a c381 1fc2 a44e c381 c3aa ..g..z.....N.... 00000b0: c283 c29a 674a 57c2 857a c2b4 7b2e c3ae ....gJW..z..{... 00000c0: c28c 1e5c 31c3 8d73 0408 c298 197d 1f5b ...\1..s.....}.[ 00000d0: c2ad 17c3 8cc3 8913 c384 c3a4 c38b c2a6 ................ 00000e0: 06c3 b211 c39a 50c2 b6c3 8709 c2a1 c2a4 ......P......... 00000f0: 4bc2 9510 2006 c397 c29a c38f c2bc 1714 K... ........... 0000100: c292 5f13 25c2 8ac3 b302 576d c2a3 0b00 .._.%.....Wm.... 0000110: c3bb c3b4 735e c38e 05c2 ad3e c299 3e50 ....s^.....>..>P 0000120: c3ad c2a0 53c3 bf1f 225a c3ba c380 c3b5 ....S..."Z...... 0000130: 7307 00c2 98c3 8756 c3b0 23c3 9228 0b1b s......V..#..(.. 0000140: c28c 4168 c383 0b1a 2d2b c29b 07c2 b1c3 ..Ah....-+...... 0000150: bd2a c2ac 7343 4109 c395 43c3 8ac2 a3c3 .*..sCA...C..... 0000160: b32d 57c2 a907 c3bc 22c2 8dc3 8bc3 8004 .-W....."....... 0000170: c39d 72c3 a25d 01c3 8051 c2b1 c3bb 08c2 ..r..]...Q...... 0000180: 8978 4f79 c288 1fc2 9716 c3bd c280 c29f .xOy............ 0000190: c38d 5428 611a c3b3 c2a3 0ec2 a4c3 8f3a ..T(a..........: 00001a0: c2b9 c39d c29a 26c2 9dc2 bfc3 b0c3 a4c2 ......&......... 00001b0: ad6d c28d 007e c28c c39e c3b1 c2b2 c381 .m...~.......... 00001c0: 0456 c3b2 7ec3 bcc2 a252 6102 c39d 6f3d .V..~....Ra...o= 00001d0: c3be 6bc2 af1e 42c2 9129 42c2 a756 c39a ..k...B..)B..V.. 00001e0: c3b4 c2b0 c2be 66c2 96c3 a6c3 9ec2 bac2 ......f......... 00001f0: abc3 aac2 a2c3 bbc3 83c2 aec3 b906 08c3 ................ 0000200: 9cc3 8ec2 aac2 9cc3 8ac2 816a 143a c38a ...........j.:.. 0000210: 637d 36c2 91c2 8e53 31c2 8950 67c3 8fc3 c}6....S1..Pg... 0000220: 93c2 a479 58c2 a9c2 b8c3 b53d 38c2 b4c2 ...yX......=8... 0000230: 8979 3446 c3be c389 2b0a c3b6 33c3 a047 .y4F....+...3..G 0000240: c2b7 c29a c393 2e69 0b13 34c2 9d71 c386 .......i..4..q.. 0000250: c382 c3bd 480b 78c2 a8c3 84c3 8cc2 bf6b ....H.x........k 0000260: c2ba 5dc2 9f3a c3a0 18c3 867b 6f7f 5ac3 ..]..:.....{o.Z. 0000270: 811a 67c2 aec3 900e 16c3 84c2 a75e c28c ..g..........^.. 0000280: 403d c281 c2b0 c29e 7fc3 8474 c29b c3ae @=.........t.... 0000290: 14c2 972c 57c3 b64c c285 c2a0 05c2 9130 ...,W..L.......0 00002a0: 0b30 2fc3 b83b 5d18 6260 c28d c2a8 c38f .0/..;].b`...... 00002b0: 11c2 adc3 8ec2 9416 5a2a 1e3b c385 5562 ........Z*.;..Ub 00002c0: c2af 77c3 b9c3 a82a c299 5d7b 25c2 9bc2 ..w....*..]{%... 00002d0: abc3 bcc3 83c3 b75e c3a9 c3b0 c3b0 5301 .......^......S. 00002e0: 595a 2629 176b 6d49 c3b8 3731 67c3 91c3 YZ&).kmI..71g... 00002f0: 8cc2 bbc3 9e5a 5a7e 3a42 4a47 c38e c296 .....ZZ~:BJG.... 0000300: 6e2e c290 20c3 adc3 952c c282 5f11 c2be n... ....,.._... 0000310: c2b0 7a33 c399 294c c388 15c3 865c 45c3 ..z3..)L.....\E. 0000320: 8f34 17c2 bec3 8ec2 b3c2 9fc3 aec2 ab49 .4.............I 0000330: c280 c395 c292 c2bc 5253 c3b3 141f 6373 ........RS....cs 0000340: c2b4 c2ad c2a7 46c2 b5c3 8f5f c2b0 1d6a ......F...._...j 0000350: c291 214e 78c3 be11 5f0f 5dc2 a33d 74c3 ..!Nx..._.]..=t. 0000360: bcc2 b936 04c3 8c43 c395 0e36 c3a8 0dc2 ...6...C...6.... 0000370: a4c2 9d17 150d c3ae c390 c280 c3bc c3a3 ................ 0000380: 51c3 9067 c2af 12c2 88c2 bcc2 aec2 8045 Q..g...........E 0000390: 1cc3 a36c c39f c380 c397 7006 c39a c285 ...l......p..... 00003a0: 4f65 12c3 b0c3 aec3 adc2 adc3 a80e c285 Oe.............. 00003b0: 1ac2 bdc2 8f6f c2a3 15c3 975f 3dc3 8730 .....o....._=..0 00003c0: 700a c298 3506 166a 192c c3aa c2a8 c391 p...5..j.,...... 00003d0: 36c3 abc2 8103 c3b4 485e 02c3 b6c2 b4c3 6.......H^...... 00003e0: 81c3 bbc3 bcc3 b8c3 9ec3 9923 1fc2 ab66 ...........#...f 00003f0: 4804 7fc2 a77b 102b 2f5c 35c2 92c2 8a17 H....{.+/\5..... 0000400: 41c2 a4c2 bfc3 9a73 5a0a 292b c3a8 c397 A......sZ.)+.... 0000410: c382 c2a6 c298 c28f 5cc3 89c3 9e49 c289 ........\....I.. 0000420: 0945 041b c3a8 c3ae 7e51 7bc2 9618 48c2 .E......~Q{...H. 0000430: 94c3 91c3 9d73 6019 c384 c2a9 65c3 b5c3 .....s`.....e... 0000440: aec2 9d62 4b41 c39a 65c3 a355 c3a2 c38a ...bKA..e..U.... 0000450: 56c3 b441 7b16 5c50 c2a0 c280 1bc3 b9c3 V..A{.\P........ 0000460: a7c3 88c3 bf04 c39a 0e55 c38c c2ad c287 .........U...... 0000470: 79c2 93c2 a134 7ac2 8074 c2a2 09c3 a1c3 y....4z..t...... 0000480: a320 c29d c387 c295 00c3 b3c3 8dc3 8f34 . .............4 0000490: 2ec3 8ac2 a65f c3b4 1322 68c2 bcc3 9426 ....._..."h....& 00004a0: 10c2 bdc3 86c3 9805 346a c2ab c3bb c29a ........4j...... 00004b0: c393 3f73 0b29 c283 0cc3 af2c c3b7 c2b8 ..?s.).....,.... 00004c0: 4ac2 b001 607e 3dc2 a2c3 ad41 7837 54c3 J...`~=....Ax7T. 00004d0: 9264 2fc3 a418 0221 c3a0 c2b6 0236 c29d .d/....!.....6.. 00004e0: 76c3 8609 c3a7 30c3 acc3 95c3 aa7b 6454 v.....0......{dT 00004f0: 5d7e 4961 0957 c29d c2a0 6666 2f23 c3a6 ]~Ia.W....ff/#.. 0000500: c289 5f7d c28f 2f68 c2a0 c2bb c29b c39d .._}../h........ 0000510: c29d c398 7ac2 a635 c3a6 c3ab 65c2 9f3d ....z..5....e..= 0000520: c28e 142b 0551 c3a0 4577 6bc3 9e23 c292 ...+.Q..Ewk..#.. 0000530: c392 47c2 89c2 a96f c290 c394 c3b0 07c3 ..G....o........ 0000540: 9462 c280 21c2 9f31 c3a1 0339 17c3 a448 .b..!..1...9...H 0000550: c2aa c2a0 c3b4 c285 c28f c2a7 c3bc c386 ................ 0000560: c28d 5d5f 651b 27c2 b9c2 a7c2 bac2 97c3 ..]_e.'......... 0000570: 88c2 9a1d 4d46 0526 c2b7 581b 0c28 28c3 ....MF.&..X..((. 0000580: 9929 7f14 c2bd 664b 284c 0f45 3c36 6bc2 .)....fK(L.E<6k. 0000590: a5c3 88c3 9c7c c287 c38e c397 c3a2 284c .....|........(L 00005a0: c393 55c3 83c2 adc3 b763 1ec3 84c3 b721 ..U......c.....! 00005b0: 5fc2 8fc2 a206 c39a c28b c283 c3b9 09c2 _............... 00005c0: 8dc2 8bc3 9452 c3a3 c2b1 14c2 bec2 b9c2 .....R.......... 00005d0: 9f04 c386 c284 c283 042f c2a3 c38c c3b6 ........./...... 00005e0: c2a3 5fc3 84c2 a952 c3ac 38c3 bec3 bac3 .._....R..8..... 00005f0: 873e 743f c287 57c3 be00 40c2 89c2 99c3 .>t?..W...@..... 0000600: 914b c3ab 7a5b 781c c3a7 c299 720d c380 .K..z[x.....r... 0000610: 1dc2 8711 5829 c3b9 72c3 a661 4d37 c293 ....X)..r..aM7.. 0000620: c381 29c2 8642 71c2 aa3a 4378 c294 6cc3 ..)..Bq..:Cx..l. 0000630: 8dc3 a774 4ac2 933d c29f c2a4 c2b3 c382 ...tJ..=........ 0000640: 7258 c2ae c380 c3aa 44c2 8e44 0ac2 9bc3 rX......D..D.... 0000650: ae6c 31c2 986e c2b9 c2b1 c295 1cc2 94c2 .l1..n.......... 0000660: b2c2 8ac3 8559 660f c2b4 c3b0 43c3 af05 .....Yf.....C... 0000670: c382 c394 c3b6 c2be 5604 c2b9 6d0d 7dc3 ........V...m.}. 0000680: 9a69 72c3 b80f c286 551e c29a 35c2 a8c2 .ir.....U...5... 0000690: b50d c3a4 2a5a c296 c2b1 3b1d 5140 23c2 ....*Z....;.Q@#. 00006a0: 85c3 a82b 4443 47c3 adc3 ae40 59c2 bc6a ...+DCG....@Y..j 00006b0: 33c3 983f c2b6 c293 1b07 c3bf 1756 c283 3..?.........V.. 00006c0: c3a5 7210 c3b8 29c2 81c2 b077 c2ae c283 ..r...)....w.... 00006d0: 2bc3 8b36 2dc3 a7c3 a505 c396 c2a3 2146 +..6-.........!F 00006e0: c3a2 40c3 a44c 52c2 9a61 c284 4fc3 8946 ..@..LR..a..O..F 00006f0: c381 166a c39b 72c2 9bc3 9632 7e2d 40c3 ...j..r....2~-@. 0000700: b850 44c2 9478 3dc2 a0c2 88c3 b667 c286 .PD..x=......g.. 0000710: c29e c293 c395 6a6c 04c3 86c3 b77d c3b5 ......jl.....}.. 0000720: c2bf c3a8 c391 c299 686c c397 4a18 5d2f ........hl..J.]/ 0000730: 1000 c3aa c39c c3bd 69c2 80c3 8203 5c38 ........i.....\8 0000740: c2af 60c3 8fc3 b8c3 b30e c2a1 5945 c298 ..`.........YE.. 0000750: c2ad c2b4 c384 c383 c2a8 c3be c38f 0a04 ................ 0000760: 3fc3 8a7c c3b3 c383 7ec2 940f c3ad 491b ?..|....~.....I. 0000770: c3b7 c39c c2ad 312b c2be 14c3 89c3 bfc2 ......1+........ 0000780: 9fc3 b14f c3a6 c28a c2be c3be c394 1204 ...O............ 0000790: 7867 6d68 c389 2fc2 9146 c387 c3b4 7858 xgmh../..F....xX 00007a0: 05c2 abc2 a9c2 a04e 0bc3 9932 3432 c295 .......N...242.. 00007b0: c38f 4114 1cc2 910a c2bd c2bc c383 c285 ..A............. 00007c0: c2b6 c2ae 77c2 807a 27c3 9a5a c393 c390 ....w..z'..Z.... 00007d0: 4314 c3af 2438 c2b2 3714 6cc3 8fc2 b910 C...$8..7.l..... 00007e0: 57c2 a7c2 b4c2 8455 c297 c2ad 5cc2 8403 W......U....\... 00007f0: 5ac3 bc09 38c3 9e76 2cc2 ab74 711d c38b Z...8..v,..tq... 0000800: 383b 2e3f c3b0 c2be 7f74 11c3 a13a c2be 8;.?.....t...:.. 0000810: c392 c2ba c3af 28c2 b924 2222 c387 c2a5 ......(..$"".... 0000820: 7ec2 ab6a c281 c395 c2b1 71c3 a978 01c3 ~..j......q..x.. 0000830: 9a34 5cc3 96c2 99c3 92c2 be6e c2a5 c39a .4\........n.... 0000840: 6655 c283 c280 c2a5 5ec2 8dc3 995f c2ac fU......^...._.. 0000850: 12c2 acc2 acc2 a71b 5ec3 a11f 3817 c29f ........^...8... 0000860: c28d c3b3 434c c29a 4ac2 a22e c38f c381 ....CL..J....... 0000870: c2b1 c2ad c287 6fc3 be72 c3bb c3b0 c2b4 ......o..r...... 0000880: c3b7 67c2 90c3 b4c3 a9c2 ae63 c294 c38f ..g........c.... 0000890: c29c 2a73 5072 162a c399 c294 c387 c3a3 ..*sPr.*........ 00008a0: 1ec2 95c3 a5c3 bb43 7c13 2ec2 b1c2 a1c3 .......C|....... 00008b0: 995f c2b9 c2b2 4e76 c29a 442d 01c2 b1c3 ._....Nv..D-.... 00008c0: 8267 c3b6 63c3 8bc3 8a1a 1bc2 96c3 99c3 .g..c........... 00008d0: 84c3 9c6c 2405 c3aa 75c2 87c3 8755 c2b2 ...l$...u....U.. 00008e0: 2cc2 9825 c286 50c3 bd19 c2a3 c3b4 385e ,..%..P.......8^ 00008f0: c28c c2ba c3b2 c3b6 43c3 b6c3 94c3 ad78 ........C......x 0000900: 7e23 2333 c3b4 c3b5 c384 782c 1ac3 b5c3 ~##3......x,.... 0000910: af0f 2171 3c3c c3af c2b2 0254 102e 4d00 ..!q<<.....T..M. 0000920: 5534 4013 c284 7e25 63c2 aa4d c28f 6f23 U4@...~%c..M..o# 0000930: 5d28 c383 c380 c3ad c397 c3a6 34c2 b661 ](..........4..a 0000940: 04c3 a071 c299 c2b2 590d c2b0 c3b5 1f00 ...q....Y....... 0000950: c297 44c2 94c3 91c2 9e08 0bc3 a9c2 b657 ..D............W 0000960: c3aa 3cc2 856b 23c2 ad2e 4824 c280 c2b0 ..<..k#...H$.... 0000970: 1bc2 96c3 abc3 a47b c2bf 320b 3825 3b03 .......{..2.8%;. 0000980: c391 c2bc 0d72 0909 c3b5 c3b2 c2b1 3b63 .....r........;c 0000990: 4dc3 8dc3 8772 0ac3 b8c3 bf4a c298 c39a M....r.....J.... 00009a0: c3bc 1fc3 99c3 bec3 8b76 c3b2 60c2 a5c2 .........v..`... 00009b0: a6c3 9a19 06c2 9044 41c2 a77b 4e02 0ec2 .......DA..{N... 00009c0: b1c3 a974 1ac3 bd6d c3bc c3b1 c384 c29f ...t...m........ 00009d0: c3ab c394 3c36 c3a3 533f c3bb c287 2448 ....<6..S?....$H 00009e0: c29c 26c2 8b64 c3b6 3049 7877 c392 6416 ..&..d..0Ixw..d. 00009f0: 566c c28f 17c2 8d46 c387 c396 c3a3 c29c Vl.....F........ 0000a00: 6210 c283 6e7c c3bf c39d 2029 c3ab c2a6 b...n|.... ).... 0000a10: 07c3 aac3 8041 36c2 b5c2 a6c2 8f44 3ec2 .....A6......D>. 0000a20: b64d 32c2 b9c3 a867 30c2 8202 c3b9 0609 .M2....g0....... 0000a30: 2ac2 8648 c286 c3b7 0d01 0701 c2a0 c282 *..H............ 0000a40: 02c3 aa04 c282 02c3 a630 c282 02c3 a230 .........0.....0 0000a50: c282 02c3 9e06 0b2a c286 48c2 86c3 b70d .......*..H..... 0000a60: 010c 0a01 02c2 a0c2 8202 c2a6 30c2 8202 ............0... 0000a70: c2a2 301c 060a 2ac2 8648 c286 c3b7 0d01 ..0...*..H...... 0000a80: 0c01 0330 0e04 08c3 8f46 c289 c39d c3bd ...0.....F...... 0000a90: 5e4d c3b4 0202 0800 04c2 8202 c280 0fc2 ^M.............. 0000aa0: b9c2 9347 37c2 a4c3 9fc2 9c3d c3b5 2127 ...G7......=..!' 0000ab0: 4c27 3e30 2a60 c29c 2b66 251a c3bb c3a7 L'>0*`..+f%..... 0000ac0: c2a5 2e55 3f77 c2bb c39d c29b 40c3 bfc3 ...U?w......@... 0000ad0: 9862 756d 61c2 b5c3 86c2 87c2 9fc3 9dc3 .buma........... 0000ae0: 8052 c291 c2b2 c38c c3ac c29f 7a73 c394 .R..........zs.. 0000af0: 1201 c3b1 c29f c391 c28c 4ec2 ac55 c3bc ..........N..U.. 0000b00: c2b0 c2b6 0c14 c3a8 5d50 3c67 374e 26c2 ........]P. # # Build Unit Tests for Libtool class # TARGET = Pkcs12Tests CONFIG += debug QT = core network INCLUDEPATH=../src SOURCES += tests/src/TestRunner.cpp tests/src/util/Pkcs12Tests.cpp OBJECTS += $$BUILDDIR/Pkcs12.o $$BUILDDIR/CertificateInfo.o LIBS += -lcppunit -lcrypto l2tp-ipsec-vpn/tests/EncSecretsTests.pro0000664000175000017500000000177112040201225020746 0ustar wejaegerwejaeger# $Id$ # # File: EncSecretsTests.pro # Author: Werner Jaeger # # Created on Feb 10, 2011, 4:45 AM # # Copyright 2010 Werner Jaeger. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Build Unit Tests for EncSecrets class # TARGET = EncSecretsTests CONFIG += debug QT = core INCLUDEPATH=../src SOURCES += tests/src/TestRunner.cpp tests/src/util/EncSecretsTests.cpp OBJECTS += $$BUILDDIR/EncSecrets.o LIBS += -lcppunit -lcrypto l2tp-ipsec-vpn/tests/LibtoolTests.pro0000664000175000017500000000201112040201225020300 0ustar wejaegerwejaeger# $Id$ # # File: LibtoolTests.pro # Author: Werner Jaeger # # Created on Feb 10, 2011, 4:45 AM # # Copyright 2010 Werner Jaeger. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Build Unit Tests for Libtool class # TARGET = LibtoolTests CONFIG += debug QT = core gui INCLUDEPATH=../src SOURCES += tests/src/TestRunner.cpp tests/src/util/LibtoolTests.cpp OBJECTS += $$BUILDDIR/Libtool.o $$BUILDDIR/GlobalFunctions.o LIBS += -lcppunit -lltdl l2tp-ipsec-vpn/tests/src/0000775000175000017500000000000012040201225015724 5ustar wejaegerwejaegerl2tp-ipsec-vpn/tests/src/TestRunner.cpp0000664000175000017500000000345012040201225020543 0ustar wejaegerwejaeger/* * $Id: TestRunner.cpp 105 2011-08-16 00:56:38Z werner $ * * File: TestRunner.cpp * Author: wejaeger * * Created on Feb 10, 2011, 3:47:52 aM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include int main() { // Create the event manager and test controller CPPUNIT_NS::TestResult controller; // Add a listener that collects test result CPPUNIT_NS::TestResultCollector result; controller.addListener(&result); // Add a listener that print dots as test run. CPPUNIT_NS::BriefTestProgressListener progress; controller.addListener(&progress); // Add the top suite to the test runner CPPUNIT_NS::TestRunner runner; runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest()); runner.run(controller); // Print test in a compiler compatible format. CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut()); outputter.write(); return(result.wasSuccessful() ? 0 : 1); } l2tp-ipsec-vpn/tests/src/util/0000775000175000017500000000000012040201225016701 5ustar wejaegerwejaegerl2tp-ipsec-vpn/tests/src/util/EncSecretsTests.cpp0000664000175000017500000000312412040201225022466 0ustar wejaegerwejaeger/* * $Id: EncSecretsTests.cpp 45 2011-02-12 00:25:26Z werner $ * * File: EncSecretsTests.cpp * Author: wejaeger * * Created on Jul 28, 2010, 1:05:52 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "util/EncSecrets.h" #include "EncSecretsTests.h" static unsigned char const KEY[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; static unsigned char const IV[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; CPPUNIT_TEST_SUITE_REGISTRATION(EncSecretsTests); EncSecretsTests::EncSecretsTests() { } EncSecretsTests::~EncSecretsTests() { } void EncSecretsTests::setUp() { } void EncSecretsTests::tearDown() { } void EncSecretsTests::testEncryption() { EncSecrets encSecrets(KEY, IV, "Text to encrypt"); CPPUNIT_ASSERT(::strcmp(encSecrets.getbuf(), "kj87Mrf0GmkMZ3GYIrBkPQ==\\n")); } void EncSecretsTests::testDecryption() { EncSecrets encSecrets("kj87Mrf0GmkMZ3GYIrBkPQ==\n"); CPPUNIT_ASSERT(encSecrets.retrieve(KEY, IV) == "Text to encrypt"); } l2tp-ipsec-vpn/tests/src/util/LibtoolTests.cpp0000664000175000017500000000332312040201225022035 0ustar wejaegerwejaeger/* * $Id: LibtoolTests.cpp 105 2011-08-16 00:56:38Z werner $ * * File: LibtoolTests.cpp * Author: wejaeger * * Created on Feb 8, 2011, 1:06:28 PM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "util/Libtool.h" #include "LibtoolTests.h" const char* const VALIDOPENSSLENGINELIB("/usr/lib/engines/engine_pkcs11.so"); const char* const INVALIDOPENSSLENGINELIB("/usr/lib/libc.so"); const QString VALIDOPENSSLENGINELIBSYMBOL("ENGINE_init"); CPPUNIT_TEST_SUITE_REGISTRATION(LibtoolTests); LibtoolTests::LibtoolTests() { } LibtoolTests::~LibtoolTests() { } void LibtoolTests::setUp() { m_pOpenSSLLibrary = new Libtool(VALIDOPENSSLENGINELIB); m_pNonOpenSSLLibrary = new Libtool(INVALIDOPENSSLENGINELIB); } void LibtoolTests::tearDown() { delete m_pOpenSSLLibrary; delete m_pNonOpenSSLLibrary; } void LibtoolTests::testValidOpenSSLLibrary() { CPPUNIT_ASSERT(m_pOpenSSLLibrary->hasSymbol(VALIDOPENSSLENGINELIBSYMBOL)); } void LibtoolTests::testInvalidOpenSSLLibrary() { CPPUNIT_ASSERT(!m_pNonOpenSSLLibrary->hasSymbol(VALIDOPENSSLENGINELIBSYMBOL)); } l2tp-ipsec-vpn/tests/src/util/Pkcs12Tests.cpp0000664000175000017500000001061612040201225021477 0ustar wejaegerwejaeger/* * $Id: Pkcs12Tests.cpp 105 2011-08-16 00:56:38Z werner $ * * File: Pkcs12Tests.cpp * Author: wejaeger * * Created on Apr 8, 2011, 7:41:51 PM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "util/Pkcs12.h" #include "Pkcs12Tests.h" static const char* const VALIDPKCS12FILE("tests/data/test.p12"); static const char* const INVALIDPKCS12FILE("tests/data/invalid.p12"); static const char* const NONEXISTINGPKCS12FILE("tests/data/test2.p12"); static const char* const GOODPASSPHRASE("test"); static const char* const WRONGPASSPHRASE("invalid"); CPPUNIT_TEST_SUITE_REGISTRATION(Pkcs12Tests); Pkcs12Tests::Pkcs12Tests() { } Pkcs12Tests::~Pkcs12Tests() { } void Pkcs12Tests::setUp() { m_pTmpFile = new QTemporaryFile(); if (m_pTmpFile->open()) { m_strTmpFileName = m_pTmpFile->fileName(); m_pTmpFile->close(); } m_pValidPkcs12GoodPassphrase = new Pkcs12(VALIDPKCS12FILE, GOODPASSPHRASE); m_pValidPkcs12WrongPassphrase = new Pkcs12(VALIDPKCS12FILE, WRONGPASSPHRASE); m_pInvalidPkcs12 = new Pkcs12(INVALIDPKCS12FILE, GOODPASSPHRASE); m_pNonExistingPkcs12 = new Pkcs12(NONEXISTINGPKCS12FILE, GOODPASSPHRASE); } void Pkcs12Tests::tearDown() { delete m_pTmpFile; delete m_pValidPkcs12GoodPassphrase; delete m_pValidPkcs12WrongPassphrase; delete m_pInvalidPkcs12; delete m_pNonExistingPkcs12; } void Pkcs12Tests::testParseValidPkcs11GoodPassphrase() { CPPUNIT_ASSERT_MESSAGE(m_pValidPkcs12GoodPassphrase->error().toStdString(), m_pValidPkcs12GoodPassphrase->error().isNull()); CPPUNIT_ASSERT_EQUAL(std::string("Test"), m_pValidPkcs12GoodPassphrase->cn().toStdString()); CPPUNIT_ASSERT_EQUAL(std::string("Test CA"), m_pValidPkcs12GoodPassphrase->issuer().toStdString()); CPPUNIT_ASSERT_EQUAL(std::string("cc:00:6f:2d:f5:fe:7d:dd"), m_pValidPkcs12GoodPassphrase->serialNumber().toStdString()); } void Pkcs12Tests::testParseValidPkcs11WrongPassphrase() { CPPUNIT_ASSERT_EQUAL(std::string("Wrong passphrase"), m_pValidPkcs12WrongPassphrase->error().toStdString()); } void Pkcs12Tests::testParseInvalidPkcs11() { CPPUNIT_ASSERT_EQUAL(std::string("The file tests/data/invalid.p12 is not a valid PKCS#12 certificate bundle"), m_pInvalidPkcs12->error().toStdString()); } void Pkcs12Tests::testParseNonExistingPkcs11() { CPPUNIT_ASSERT_EQUAL(QString(NONEXISTINGPKCS12FILE).toStdString() + std::string(": No such file or directory"), m_pNonExistingPkcs12->error().toStdString()); } void Pkcs12Tests::testCert2Pem() { const bool fSuccess(m_pValidPkcs12GoodPassphrase->cert2Pem(m_strTmpFileName)); CPPUNIT_ASSERT_MESSAGE(m_pValidPkcs12GoodPassphrase->error().toStdString(), fSuccess); if (fSuccess) { m_pTmpFile->open(); const QSslCertificate cert(m_pTmpFile); m_pTmpFile->close(); CPPUNIT_ASSERT(!cert.isNull()); CPPUNIT_ASSERT_MESSAGE(cert.serialNumber().constData(), cert.serialNumber() == "cc:00:6f:2d:f5:fe:7d:dd"); } } void Pkcs12Tests::testCaChain2Pem() { CPPUNIT_ASSERT(m_pValidPkcs12GoodPassphrase->caCerts() == 2); const int iWritten(m_pValidPkcs12GoodPassphrase->caChain2Pem(m_strTmpFileName)); CPPUNIT_ASSERT_MESSAGE(m_pValidPkcs12GoodPassphrase->error().toStdString(), iWritten == m_pValidPkcs12GoodPassphrase->caCerts()); } void Pkcs12Tests::testPrivateKey2Pem() { const bool fSuccess(m_pValidPkcs12GoodPassphrase->privateKey2Pem(m_strTmpFileName, GOODPASSPHRASE)); CPPUNIT_ASSERT_MESSAGE(m_pValidPkcs12GoodPassphrase->error().toStdString(), fSuccess); if (fSuccess) { m_pTmpFile->open(); const QSslKey key(m_pTmpFile, QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, QByteArray(GOODPASSPHRASE)); m_pTmpFile->close(); CPPUNIT_ASSERT(!key.isNull()); CPPUNIT_ASSERT(key.length() == 1024); } } l2tp-ipsec-vpn/tests/src/util/EncSecretsTests.h0000664000175000017500000000247012040201225022136 0ustar wejaegerwejaeger/* * $Id: EncSecretsTests.h 45 2011-02-12 00:25:26Z werner $ * * File: EncSecretsTests.h * Author: wejaeger * * Created on Jul 28, 2010, 1:05:52 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef ENCSECRETSTESTS_H #define ENCSECRETSTESTS_H #include class EncSecretsTests : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(EncSecretsTests); CPPUNIT_TEST(testEncryption); CPPUNIT_TEST(testDecryption); CPPUNIT_TEST_SUITE_END(); public: EncSecretsTests(); virtual ~EncSecretsTests(); void setUp(); void tearDown(); private: void testEncryption(); void testDecryption(); }; #endif /* ENCSECRETSTESTS_H */ l2tp-ipsec-vpn/tests/src/util/Pkcs12Tests.h0000664000175000017500000000372412040201225021146 0ustar wejaegerwejaeger/* * $Id: Pkcs12Tests.h 69 2011-04-12 04:33:22Z werner $ * * File: Pkcs12Tests.h * Author: wejaeger * * Created on Apr 8, 2011, 7:41:52 PM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PKCS12TESTS_H #define PKCS12TESTS_H #include #include class Pkcs12; class QTemporaryFile; class Pkcs12Tests : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(Pkcs12Tests); CPPUNIT_TEST(testParseValidPkcs11GoodPassphrase); CPPUNIT_TEST(testParseValidPkcs11WrongPassphrase); CPPUNIT_TEST(testParseInvalidPkcs11); CPPUNIT_TEST(testParseNonExistingPkcs11); CPPUNIT_TEST(testCert2Pem); CPPUNIT_TEST(testCaChain2Pem); CPPUNIT_TEST(testPrivateKey2Pem); CPPUNIT_TEST_SUITE_END(); public: Pkcs12Tests(); virtual ~Pkcs12Tests(); void setUp(); void tearDown(); private: void testParseValidPkcs11GoodPassphrase(); void testParseValidPkcs11WrongPassphrase(); void testParseInvalidPkcs11(); void testParseNonExistingPkcs11(); void testCert2Pem(); void testCaChain2Pem(); void testPrivateKey2Pem(); QTemporaryFile* m_pTmpFile; QString m_strTmpFileName; Pkcs12* m_pValidPkcs12GoodPassphrase; const Pkcs12* m_pValidPkcs12WrongPassphrase; const Pkcs12* m_pInvalidPkcs12; const Pkcs12* m_pNonExistingPkcs12; }; #endif /* NEWTESTCLASS_H */ l2tp-ipsec-vpn/tests/src/util/LibtoolTests.h0000664000175000017500000000264212040201225021505 0ustar wejaegerwejaeger/* * $Id: LibtoolTests.h 45 2011-02-12 00:25:26Z werner $ * * File: LibtoolTests.h * Author: wejaeger * * Created on Feb 8, 2011, 1:06:29 PM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LIBTOOLTESTS_H #define LIBTOOLTESTS_H #include class Libtool; class LibtoolTests : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(LibtoolTests); CPPUNIT_TEST(testValidOpenSSLLibrary); CPPUNIT_TEST(testInvalidOpenSSLLibrary); CPPUNIT_TEST_SUITE_END(); public: LibtoolTests(); virtual ~LibtoolTests(); void setUp(); void tearDown(); private: void testValidOpenSSLLibrary(); void testInvalidOpenSSLLibrary(); const Libtool* m_pOpenSSLLibrary; const Libtool* m_pNonOpenSSLLibrary; }; #endif /* LIBTOOLTESTS_H */ l2tp-ipsec-vpn/dist/0000775000175000017500000000000012040201225014736 5ustar wejaegerwejaegerl2tp-ipsec-vpn/nbproject/0000775000175000017500000000000012040201225015761 5ustar wejaegerwejaegerl2tp-ipsec-vpn/nbproject/project.properties0000664000175000017500000000000012040201225021533 0ustar wejaegerwejaegerl2tp-ipsec-vpn/nbproject/qt-Release.pro0000664000175000017500000001152112040201225020505 0ustar wejaegerwejaeger# This file is generated automatically. Do not edit. # Use project properties -> Build -> Qt -> Expert -> Custom Definitions. TEMPLATE = app DESTDIR = dist/Release TARGET = L2tpIPsecVpn VERSION = 1.0.9 CONFIG -= debug_and_release app_bundle lib_bundle CONFIG += release PKGCONFIG += QT = core gui network SOURCES += src/dialogs/InterfaceStatisticsDialog.cpp src/conf/PppDownScriptWriter.cpp src/main.cpp src/dialogs/AdvancedSettingsDialog.cpp src/conf/IPsecConfWriter.cpp src/conf/IPsecSecretsConfWriter.cpp src/conf/AbstractConfWriter.cpp src/util/VpnControlDaemonClient.cpp src/dialogs/PeerAuthenticationDialog.cpp src/conf/PppUpScriptWriter.cpp src/util/NetworkInterface.cpp src/dialogs/ConnectionInformationDialog.cpp src/models/IPsecCertificateListModel.cpp src/pkcs11/SmartCardInfo.cpp src/PasswordCallback.cpp src/settings/Preferences.cpp src/dialogs/RouteSettingsDialog.cpp src/conf/PPPConfWriter.cpp src/conf/L2tpConfWriter.cpp src/util/NetworkInterfaceMonitor.cpp src/conf/PppDnsConfWriter.cpp src/ConnectionManager.cpp src/settings/Settings.cpp src/util/Libtool.cpp src/VPNControlTask.cpp src/conf/OpensslConfWriter.cpp src/util/Pkcs12.cpp src/dialogs/CertificateImportDialog.cpp src/dialogs/ConnectionSettingsDialog.cpp src/L2tpIPsecVpnApplication.cpp src/ConnectionEditor.cpp src/models/SmartCardObjectListModel.cpp src/pkcs11/Pkcs11.cpp src/util/EncSecrets.cpp src/conf/ConfWriter.cpp src/pkcs11/SmartCardInsertWaitTask.cpp src/models/PppRoutesModel.cpp src/util/CertificateInfo.cpp src/localpeer/LockedFile.cpp src/conf/GetIPsecInfoScriptWriter.cpp src/localpeer/LocalPeer.cpp src/conf/RSysLogConfWriter.cpp src/dialogs/SmartCardObjectsDialog.cpp src/settings/ConnectionSettings.cpp src/pkcs11/SmartCardState.cpp src/dialogs/EapSettingsDialog.cpp src/ConnectionState.cpp src/dialogs/IpSettingsDialog.cpp src/dialogs/PreferencesEditorDialog.cpp src/util/SecretsChecker.cpp src/pkcs11/Pkcs11Attribute.cpp src/dialogs/ConnectionEditorDialog.cpp src/util/GlobalFunctions.cpp src/models/ConnectionsModel.cpp HEADERS += src/util/EncSecrets.h src/util/NetworkInterfaceMonitor.h src/models/SmartCardObjectListModel.h src/dialogs/InterfaceStatisticsDialog.h src/util/VpnControlDaemonClient.h src/util/ErrorEx.h src/dialogs/RouteSettingsDialog.h src/localpeer/LocalPeer.h src/ConnectionManager.h src/dialogs/IpSettingsDialog.h src/ConnectionEditor.h src/dialogs/AdvancedSettingsDialog.h src/dialogs/CertificateImportDialog.h src/conf/PppDownScriptWriter.h src/util/Pkcs12.h src/conf/ConfWriter.h src/conf/AbstractConfWriter.h src/PasswordCallback.h src/dialogs/PreferencesEditorDialog.h src/util/SecretsChecker.h src/conf/IPsecSecretsConfWriter.h src/VPNControlTask.h src/util/Libtool.h src/settings/Settings.h src/conf/OpensslConfWriter.h src/models/PppRoutesModel.h src/settings/ConnectionSettings.h src/L2tpIPsecVpnApplication.h src/dialogs/SmartCardObjectsDialog.h src/pkcs11/Pkcs11Attribute.h src/dialogs/ConnectionEditorDialog.h src/pkcs11/Pkcs11.h src/conf/IPsecConfWriter.h src/models/ConnectionsModel.h src/settings/Preferences.h src/conf/L2tpConfWriter.h src/dialogs/PeerAuthenticationDialog.h src/pkcs11/pkcs11.h src/dialogs/ConnectionSettingsDialog.h src/conf/GetIPsecInfoScriptWriter.h src/pkcs11/SmartCardInfo.h src/util/CertificateInfo.h src/conf/PppUpScriptWriter.h src/dialogs/EapSettingsDialog.h src/conf/RSysLogConfWriter.h src/pkcs11/SmartCardInsertWaitTask.h src/ConnectionState.h src/localpeer/LockedFile.h src/conf/PPPConfWriter.h src/pkcs11/SmartCardState.h src/conf/PppDnsConfWriter.h src/models/IPsecCertificateListModel.h src/util/NetworkInterface.h src/dialogs/ConnectionInformationDialog.h src/util/GlobalFunctions.h FORMS += src/dialogs/InterfaceStatisticsDialog.ui src/dialogs/PeerAuthenticationDialog.ui src/dialogs/SmartCardObjectsDialog.ui src/dialogs/PreferencesEditorDialog.ui src/dialogs/CertificateImportDialog.ui src/dialogs/ConnectionEditorDialog.ui src/dialogs/ConnectionSettingsDialog.ui src/dialogs/RouteSettingsDialog.ui src/dialogs/EapSettingsDialog.ui src/dialogs/AdvancedSettingsDialog.ui src/dialogs/IpSettingsDialog.ui src/dialogs/ConnectionInformationDialog.ui RESOURCES += resources/L2tpIPsecVpn.qrc TRANSLATIONS += OBJECTS_DIR = build/Release/GNU-Linux-x86 MOC_DIR = src/generated RCC_DIR = src/generated UI_DIR = src/generated QMAKE_CC = gcc QMAKE_CXX = g++ DEFINES += INCLUDEPATH += src LIBS += LIBS+=-lctemplate LIBS+=-lcrypto LIBS+=-lltdl target.path = /usr/bin INSTALLS += target data.path = /usr/share/L2tpIPsecVpn data.files = resources/logo.png INSTALLS += data startupmenu.path = /etc/xdg/autostart startupmenu.files = resources/L2tpIPsecVpn.desktop INSTALLS += startupmenu preferencesmenu.path = /usr/share/applications preferencesmenu.files = resources/L2TP-Ipsec-VPN-Manager.desktop INSTALLS += preferencesmenu networkmenu.path=/usr/share/applications networkmenu.files = resources/L2tpIPsecVpn-Applet.desktop INSTALLS += networkmenu TRANSLATIONS = nls/L2tpIPsecVpn_de.ts l2tp-ipsec-vpn/nbproject/configurations.xml0000664000175000017500000003750312040201225021545 0ustar wejaegerwejaeger src/conf/AbstractConfWriter.h src/dialogs/AdvancedSettingsDialog.h src/dialogs/CertificateImportDialog.h src/util/CertificateInfo.h src/conf/ConfWriter.h src/ConnectionEditor.h src/dialogs/ConnectionEditorDialog.h src/dialogs/ConnectionInformationDialog.h src/ConnectionManager.h src/settings/ConnectionSettings.h src/dialogs/ConnectionSettingsDialog.h src/ConnectionState.h src/models/ConnectionsModel.h src/dialogs/EapSettingsDialog.h src/util/EncSecrets.h src/util/ErrorEx.h src/conf/GetIPsecInfoScriptWriter.h src/util/GlobalFunctions.h src/models/IPsecCertificateListModel.h src/conf/IPsecConfWriter.h src/conf/IPsecSecretsConfWriter.h src/dialogs/InterfaceStatisticsDialog.h src/dialogs/IpSettingsDialog.h src/conf/L2tpConfWriter.h src/L2tpIPsecVpnApplication.h src/util/Libtool.h src/localpeer/LocalPeer.h src/localpeer/LockedFile.h src/util/NetworkInterface.h src/util/NetworkInterfaceMonitor.h src/conf/OpensslConfWriter.h src/conf/PPPConfWriter.h src/PasswordCallback.h src/dialogs/PeerAuthenticationDialog.h src/pkcs11/Pkcs11.h src/pkcs11/Pkcs11Attribute.h src/util/Pkcs12.h src/conf/PppDnsConfWriter.h src/conf/PppDownScriptWriter.h src/models/PppRoutesModel.h src/conf/PppUpScriptWriter.h src/settings/Preferences.h src/dialogs/PreferencesEditorDialog.h src/conf/RSysLogConfWriter.h src/dialogs/RouteSettingsDialog.h src/util/SecretsChecker.h src/settings/Settings.h src/pkcs11/SmartCardInfo.h src/pkcs11/SmartCardInsertWaitTask.h src/models/SmartCardObjectListModel.h src/dialogs/SmartCardObjectsDialog.h src/pkcs11/SmartCardState.h src/VPNControlTask.h src/util/VpnControlDaemonClient.h src/pkcs11/pkcs11.h resources/L2tpIPsecVpn.qrc src/conf/AbstractConfWriter.cpp src/dialogs/AdvancedSettingsDialog.cpp src/dialogs/AdvancedSettingsDialog.ui src/dialogs/CertificateImportDialog.cpp src/dialogs/CertificateImportDialog.ui src/util/CertificateInfo.cpp src/conf/ConfWriter.cpp src/ConnectionEditor.cpp src/dialogs/ConnectionEditorDialog.cpp src/dialogs/ConnectionEditorDialog.ui src/dialogs/ConnectionInformationDialog.cpp src/dialogs/ConnectionInformationDialog.ui src/ConnectionManager.cpp src/settings/ConnectionSettings.cpp src/dialogs/ConnectionSettingsDialog.cpp src/dialogs/ConnectionSettingsDialog.ui src/ConnectionState.cpp src/models/ConnectionsModel.cpp src/dialogs/EapSettingsDialog.cpp src/dialogs/EapSettingsDialog.ui src/util/EncSecrets.cpp src/conf/GetIPsecInfoScriptWriter.cpp src/util/GlobalFunctions.cpp src/models/IPsecCertificateListModel.cpp src/conf/IPsecConfWriter.cpp src/conf/IPsecSecretsConfWriter.cpp src/dialogs/InterfaceStatisticsDialog.cpp src/dialogs/InterfaceStatisticsDialog.ui src/dialogs/IpSettingsDialog.cpp src/dialogs/IpSettingsDialog.ui src/conf/L2tpConfWriter.cpp src/L2tpIPsecVpnApplication.cpp src/util/Libtool.cpp src/localpeer/LocalPeer.cpp src/localpeer/LockedFile.cpp src/util/NetworkInterface.cpp src/util/NetworkInterfaceMonitor.cpp src/conf/OpensslConfWriter.cpp src/conf/PPPConfWriter.cpp src/PasswordCallback.cpp src/dialogs/PeerAuthenticationDialog.cpp src/dialogs/PeerAuthenticationDialog.ui src/pkcs11/Pkcs11.cpp src/pkcs11/Pkcs11Attribute.cpp src/util/Pkcs12.cpp src/conf/PppDnsConfWriter.cpp src/conf/PppDownScriptWriter.cpp src/models/PppRoutesModel.cpp src/conf/PppUpScriptWriter.cpp src/settings/Preferences.cpp src/dialogs/PreferencesEditorDialog.cpp src/dialogs/PreferencesEditorDialog.ui src/conf/RSysLogConfWriter.cpp src/dialogs/RouteSettingsDialog.cpp src/dialogs/RouteSettingsDialog.ui src/util/SecretsChecker.cpp src/settings/Settings.cpp src/pkcs11/SmartCardInfo.cpp src/pkcs11/SmartCardInsertWaitTask.cpp src/models/SmartCardObjectListModel.cpp src/dialogs/SmartCardObjectsDialog.cpp src/dialogs/SmartCardObjectsDialog.ui src/pkcs11/SmartCardState.cpp src/models/SmartCardTokenListModel.cpp src/VPNControlTask.cpp src/util/VpnControlDaemonClient.cpp src/main.cpp Makefile Makefile LOCAL_SOURCES GNU|GNU ${CND_DISTDIR}/${CND_CONF} L2tpIPsecVpn 1.0.9 core gui network src/generated src/generated src/generated LIBS+=-lctemplate LIBS+=-lcrypto LIBS+=-lltdl target.path = /usr/bin INSTALLS += target data.path = /usr/share/L2tpIPsecVpn data.files = resources/logo.png INSTALLS += data startupmenu.path = /etc/xdg/autostart startupmenu.files = resources/L2tpIPsecVpn.desktop INSTALLS += startupmenu preferencesmenu.path = /usr/share/applications preferencesmenu.files = resources/L2TP-Ipsec-VPN-Manager.desktop INSTALLS += preferencesmenu networkmenu.path=/usr/share/applications networkmenu.files = resources/L2tpIPsecVpn-Applet.desktop INSTALLS += networkmenu TRANSLATIONS = nls/L2tpIPsecVpn_de.ts src Tar ${CND_DISTDIR}/${CND_CONF}/package/l2tp-ipsec-vpn-1.0.9.tar ../src /usr/include/qt4 /usr/include/qt4/QtCore -lcppunit build/TestFiles/EncSecretsTests -lcrypto /usr/include/qt4/QtGui build/TestFiles/LibtoolTests -lltdl /usr/include/qt4/QtNetwork build/TestFiles/Pkcs12Tests -lcrypto LOCAL_SOURCES GNU|GNU ${CND_DISTDIR}/${CND_CONF} L2tpIPsecVpn 1.0.9 1 core gui network src/generated src/generated src/generated LIBS+=-lctemplate LIBS+=-lcrypto LIBS+=-lltdl target.path = /usr/bin INSTALLS += target data.path = /usr/share/L2tpIPsecVpn data.files = resources/logo.png INSTALLS += data startupmenu.path = /etc/xdg/autostart startupmenu.files = resources/L2tpIPsecVpn.desktop INSTALLS += startupmenu preferencesmenu.path = /usr/share/applications preferencesmenu.files = resources/L2TP-Ipsec-VPN-Manager.desktop INSTALLS += preferencesmenu networkmenu.path=/usr/share/applications networkmenu.files = resources/L2tpIPsecVpn-Applet.desktop INSTALLS += networkmenu TRANSLATIONS = nls/L2tpIPsecVpn_de.ts src Tar ${CND_DISTDIR}/${CND_CONF}/package/l2tp-ipsec-vpn-1.0.9.tar ../src /usr/include/qt4 /usr/include/qt4/QtCore -lcppunit build/TestFiles/EncSecretsTests -lcrypto /usr/include/qt4/QtGui build/TestFiles/LibtoolTests -lltdl /usr/include/qt4/QtNetwork build/TestFiles/Pkcs12Tests -lcrypto l2tp-ipsec-vpn/nbproject/qt-Debug.pro0000664000175000017500000001151312040201225020154 0ustar wejaegerwejaeger# This file is generated automatically. Do not edit. # Use project properties -> Build -> Qt -> Expert -> Custom Definitions. TEMPLATE = app DESTDIR = dist/Debug TARGET = L2tpIPsecVpn VERSION = 1.0.9 CONFIG -= debug_and_release app_bundle lib_bundle CONFIG += debug PKGCONFIG += QT = core gui network SOURCES += src/dialogs/InterfaceStatisticsDialog.cpp src/conf/PppDownScriptWriter.cpp src/main.cpp src/dialogs/AdvancedSettingsDialog.cpp src/conf/IPsecConfWriter.cpp src/conf/IPsecSecretsConfWriter.cpp src/conf/AbstractConfWriter.cpp src/util/VpnControlDaemonClient.cpp src/dialogs/PeerAuthenticationDialog.cpp src/conf/PppUpScriptWriter.cpp src/util/NetworkInterface.cpp src/dialogs/ConnectionInformationDialog.cpp src/models/IPsecCertificateListModel.cpp src/pkcs11/SmartCardInfo.cpp src/PasswordCallback.cpp src/settings/Preferences.cpp src/dialogs/RouteSettingsDialog.cpp src/conf/PPPConfWriter.cpp src/conf/L2tpConfWriter.cpp src/util/NetworkInterfaceMonitor.cpp src/conf/PppDnsConfWriter.cpp src/ConnectionManager.cpp src/settings/Settings.cpp src/util/Libtool.cpp src/VPNControlTask.cpp src/conf/OpensslConfWriter.cpp src/util/Pkcs12.cpp src/dialogs/CertificateImportDialog.cpp src/dialogs/ConnectionSettingsDialog.cpp src/L2tpIPsecVpnApplication.cpp src/ConnectionEditor.cpp src/models/SmartCardObjectListModel.cpp src/pkcs11/Pkcs11.cpp src/util/EncSecrets.cpp src/conf/ConfWriter.cpp src/pkcs11/SmartCardInsertWaitTask.cpp src/models/PppRoutesModel.cpp src/util/CertificateInfo.cpp src/localpeer/LockedFile.cpp src/conf/GetIPsecInfoScriptWriter.cpp src/localpeer/LocalPeer.cpp src/conf/RSysLogConfWriter.cpp src/dialogs/SmartCardObjectsDialog.cpp src/settings/ConnectionSettings.cpp src/pkcs11/SmartCardState.cpp src/dialogs/EapSettingsDialog.cpp src/ConnectionState.cpp src/dialogs/IpSettingsDialog.cpp src/dialogs/PreferencesEditorDialog.cpp src/util/SecretsChecker.cpp src/pkcs11/Pkcs11Attribute.cpp src/dialogs/ConnectionEditorDialog.cpp src/util/GlobalFunctions.cpp src/models/ConnectionsModel.cpp HEADERS += src/util/EncSecrets.h src/util/NetworkInterfaceMonitor.h src/models/SmartCardObjectListModel.h src/dialogs/InterfaceStatisticsDialog.h src/util/VpnControlDaemonClient.h src/util/ErrorEx.h src/dialogs/RouteSettingsDialog.h src/localpeer/LocalPeer.h src/ConnectionManager.h src/dialogs/IpSettingsDialog.h src/ConnectionEditor.h src/dialogs/AdvancedSettingsDialog.h src/dialogs/CertificateImportDialog.h src/conf/PppDownScriptWriter.h src/util/Pkcs12.h src/conf/ConfWriter.h src/conf/AbstractConfWriter.h src/PasswordCallback.h src/dialogs/PreferencesEditorDialog.h src/util/SecretsChecker.h src/conf/IPsecSecretsConfWriter.h src/VPNControlTask.h src/util/Libtool.h src/settings/Settings.h src/conf/OpensslConfWriter.h src/models/PppRoutesModel.h src/settings/ConnectionSettings.h src/L2tpIPsecVpnApplication.h src/dialogs/SmartCardObjectsDialog.h src/pkcs11/Pkcs11Attribute.h src/dialogs/ConnectionEditorDialog.h src/pkcs11/Pkcs11.h src/conf/IPsecConfWriter.h src/models/ConnectionsModel.h src/settings/Preferences.h src/conf/L2tpConfWriter.h src/dialogs/PeerAuthenticationDialog.h src/pkcs11/pkcs11.h src/dialogs/ConnectionSettingsDialog.h src/conf/GetIPsecInfoScriptWriter.h src/pkcs11/SmartCardInfo.h src/util/CertificateInfo.h src/conf/PppUpScriptWriter.h src/dialogs/EapSettingsDialog.h src/conf/RSysLogConfWriter.h src/pkcs11/SmartCardInsertWaitTask.h src/ConnectionState.h src/localpeer/LockedFile.h src/conf/PPPConfWriter.h src/pkcs11/SmartCardState.h src/conf/PppDnsConfWriter.h src/models/IPsecCertificateListModel.h src/util/NetworkInterface.h src/dialogs/ConnectionInformationDialog.h src/util/GlobalFunctions.h FORMS += src/dialogs/InterfaceStatisticsDialog.ui src/dialogs/PeerAuthenticationDialog.ui src/dialogs/SmartCardObjectsDialog.ui src/dialogs/PreferencesEditorDialog.ui src/dialogs/CertificateImportDialog.ui src/dialogs/ConnectionEditorDialog.ui src/dialogs/ConnectionSettingsDialog.ui src/dialogs/RouteSettingsDialog.ui src/dialogs/EapSettingsDialog.ui src/dialogs/AdvancedSettingsDialog.ui src/dialogs/IpSettingsDialog.ui src/dialogs/ConnectionInformationDialog.ui RESOURCES += resources/L2tpIPsecVpn.qrc TRANSLATIONS += OBJECTS_DIR = build/Debug/GNU-Linux-x86 MOC_DIR = src/generated RCC_DIR = src/generated UI_DIR = src/generated QMAKE_CC = gcc QMAKE_CXX = g++ DEFINES += INCLUDEPATH += src LIBS += LIBS+=-lctemplate LIBS+=-lcrypto LIBS+=-lltdl target.path = /usr/bin INSTALLS += target data.path = /usr/share/L2tpIPsecVpn data.files = resources/logo.png INSTALLS += data startupmenu.path = /etc/xdg/autostart startupmenu.files = resources/L2tpIPsecVpn.desktop INSTALLS += startupmenu preferencesmenu.path = /usr/share/applications preferencesmenu.files = resources/L2TP-Ipsec-VPN-Manager.desktop INSTALLS += preferencesmenu networkmenu.path=/usr/share/applications networkmenu.files = resources/L2tpIPsecVpn-Applet.desktop INSTALLS += networkmenu TRANSLATIONS = nls/L2tpIPsecVpn_de.ts l2tp-ipsec-vpn/nbproject/project.xml0000664000175000017500000000163312040201225020154 0ustar wejaegerwejaeger org.netbeans.modules.cnd.makeproject L2tpIPsecVpn 0 cpp h UTF-8 Debug 4 Release 4 l2tp-ipsec-vpn/src/0000775000175000017500000000000012040201227014564 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/models/0000775000175000017500000000000012040201226016046 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/models/ConnectionsModel.h0000664000175000017500000000355412040201226021471 0ustar wejaegerwejaeger/* * $Id: ConnectionsModel.h 13 2010-09-17 09:12:39Z werner $ * * File: ConnectionsModel.h * Author: Werner Jaeger * * Created on July 18, 2010, 5:30 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONNECTIONSMODEL_H #define CONNECTIONSMODEL_H #include class ConnectionSettings; class ConnectionsModel : public QAbstractTableModel { Q_OBJECT public: typedef enum { Ok, InvalidName, DuplicateName, ReadOnly } Result; explicit ConnectionsModel(QObject* pParent = 0); virtual ~ConnectionsModel(); bool isWriteable() const; int rowCount(const QModelIndex& parent = QModelIndex()) const; int columnCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int iRole = Qt::DisplayRole) const; QVariant headerData(int iSection, Qt::Orientation orientation, int iRole = Qt::DisplayRole) const; Result addRow(const QString& strName, const QModelIndex& parent = QModelIndex()); bool removeRow(int iRow, const QModelIndex& parent = QModelIndex()); private: ConnectionsModel(const ConnectionsModel& orig); ConnectionsModel& operator=(const ConnectionsModel& orig); ConnectionSettings* const m_pSettings; }; #endif /* CONNECTIONSMODEL_H */ l2tp-ipsec-vpn/src/models/SmartCardObjectListModel.cpp0000664000175000017500000001243512040201226023403 0ustar wejaegerwejaeger/* * $Id: SmartCardObjectListModel.cpp 151 2012-08-03 16:42:07Z wejaeger $ * * File: SmartCardObjectListModel.cpp * Author: Werner Jaeger * * Created on August 2, 2010, 5:11 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "pkcs11/Pkcs11.h" #include "util/CertificateInfo.h" #include "pkcs11/SmartCardInfo.h" #include "settings/Preferences.h" #include "SmartCardObjectListModel.h" SmartCardObjectListModel::SmartCardObjectListModel(ObjectType objectType) : m_ObjectType(objectType), m_pSmartCardObjects(new QList()) { readTokens(); } SmartCardObjectListModel::~SmartCardObjectListModel() { if (m_pSmartCardObjects) delete m_pSmartCardObjects; } int SmartCardObjectListModel::rowCount(const QModelIndex& /* parent */) const { return(m_pSmartCardObjects->count()); } QVariant SmartCardObjectListModel::data(const QModelIndex& index, int iRole) const { QVariant ret; if (index.isValid()) { switch (iRole) { case Qt::DisplayRole: ret = value(index.row()).toAscii().constData(); break; case Qt::ToolTipRole: if (m_ObjectType == Certificate) { const QString strEmail = m_pSmartCardObjects->at(index.row())->certificateInfo().email(); const QString strCN = m_pSmartCardObjects->at(index.row())->certificateInfo().cn(); const QString strSN = m_pSmartCardObjects->at(index.row())->certificateInfo().serialNumber(); ret = (strSN.isEmpty() ? "" : "SN=" + strSN + ", ") + (strEmail.isEmpty() ? (strCN.isEmpty() ? "" : "CN=" + strCN) : "User=" + strEmail); } break; case Qt::UserRole: ret = idValue(index.row()).toAscii().constData(); break; case Qt::UserRole + 1: ret = m_pSmartCardObjects->at(index.row())->certificateInfo().email(); break; } } return(ret); } bool SmartCardObjectListModel::storeCert(const QModelIndex& index) const { bool fRet(m_ObjectType == Certificate); if (fRet) fRet = m_pSmartCardObjects->at(index.row())->certificateInfo().toPem(idValue(index.row())); return(fRet); } void SmartCardObjectListModel::readTokens() { if (Pkcs11::loaded()) { Pkcs11 p11; const QList slotList(p11.slotList()); if (slotList.count() > 0) { for (int iSlotId = 0; iSlotId < slotList.count(); iSlotId++) { p11.startSession(slotList.at(iSlotId)); switch (m_ObjectType) { case PublicKey: { const Pkcs11Attlist publicKeyAttributeList(Pkcs11AttrUlong(CKA_CLASS, CKO_PUBLIC_KEY)); const QList publicKeyObjectHandleList(p11.objectList(publicKeyAttributeList)); for (int iObjectHandle = 0; iObjectHandle < publicKeyObjectHandleList.count(); iObjectHandle++) m_pSmartCardObjects->append(new SmartCardInfo(p11, publicKeyObjectHandleList[iObjectHandle])); } break; case Certificate: { Pkcs11Attlist certificateAttributeList(Pkcs11AttrUlong(CKA_CLASS, CKO_CERTIFICATE)); certificateAttributeList << Pkcs11AttrUlong(CKA_CERTIFICATE_TYPE, CKC_X_509); const QList certificateObjectHandleList(p11.objectList(certificateAttributeList)); for (int iObjectHandle = 0; iObjectHandle < certificateObjectHandleList.count(); iObjectHandle++) m_pSmartCardObjects->append(new SmartCardInfo(p11, certificateObjectHandleList[iObjectHandle])); } break; } } } } } QString SmartCardObjectListModel::value(int i) const { QString strRet; if (i < m_pSmartCardObjects->count()) { strRet.append(m_pSmartCardObjects->at(i)->cardLabel()); strRet.append(", " + m_pSmartCardObjects->at(i)->manufacturer()); strRet.append(", " + m_pSmartCardObjects->at(i)->slotId()); strRet.append(", " + m_pSmartCardObjects->at(i)->objectId()); strRet.append(", " + m_pSmartCardObjects->at(i)->objectLabel()); } return(strRet); } QString SmartCardObjectListModel::idValue(int i) const { QString strRet; if (i < m_pSmartCardObjects->count()) { if (objectType() == Certificate) strRet = "/etc/ipsec.d/certs/" + m_pSmartCardObjects->at(i)->objectLabel() + ".pem"; else strRet = Preferences().openSSLSettings().engineId() + ":" + m_pSmartCardObjects->at(i)->slotId() + ":" + m_pSmartCardObjects->at(i)->objectId(); } return(strRet); }l2tp-ipsec-vpn/src/models/ConnectionsModel.cpp0000664000175000017500000000573512040201226022027 0ustar wejaegerwejaeger/* * $Id: ConnectionsModel.cpp 13 2010-09-17 09:12:39Z werner $ * * File: ConnectionsModel.cpp * Author: Werner Jaeger * * Created on July 18, 2010, 5:30 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "ConnectionsModel.h" #include "ConnectionState.h" #include "settings/ConnectionSettings.h" #include "dialogs/ConnectionEditorDialog.h" ConnectionsModel::ConnectionsModel(QObject* pParent) : QAbstractTableModel(pParent), m_pSettings(new ConnectionSettings()) { } ConnectionsModel::~ConnectionsModel() { delete m_pSettings; } bool ConnectionsModel::isWriteable() const { return(m_pSettings->isWriteable()); } int ConnectionsModel::rowCount(const QModelIndex& /* parent */) const { return(m_pSettings->connections()); } int ConnectionsModel::columnCount(const QModelIndex& /* parent */) const { return(1); } QVariant ConnectionsModel::data(const QModelIndex& index, int iRole) const { QVariant ret; if (index.isValid()) { if (iRole == Qt::DisplayRole) ret = m_pSettings->connection(index.row()); else if (iRole == Qt::TextAlignmentRole) ret = int(Qt::AlignLeft | Qt::AlignVCenter); } return(ret); } QVariant ConnectionsModel::headerData(int iSection, Qt::Orientation orientation, int iRole) const { QVariant ret; if (iRole == Qt::DisplayRole && iSection == 0 && orientation == Qt::Horizontal) ret = tr("Name"); return(ret); } ConnectionsModel::Result ConnectionsModel::addRow(const QString& strName, const QModelIndex& parent) { Result result(ConnectionsModel::Ok); const int iRow = m_pSettings->connections(); beginInsertRows(parent, iRow, iRow); switch (m_pSettings->addConnection(strName)) { case ConnectionSettings::DuplicateName: result = ConnectionsModel::DuplicateName; break; case ConnectionSettings::InvalidName: result = ConnectionsModel::InvalidName; break; case ConnectionSettings::ReadOnly: result = ConnectionsModel::ReadOnly; break; case ConnectionSettings::Ok: result = ConnectionsModel::Ok; break; } endInsertRows(); return(result); } bool ConnectionsModel::removeRow(int iRow, const QModelIndex& parent) { bool fRet; beginRemoveRows(parent, iRow, iRow); fRet = m_pSettings->removeConnection(iRow); endRemoveRows(); return(fRet); } l2tp-ipsec-vpn/src/models/PppRoutesModel.cpp0000664000175000017500000000725612040201226021506 0ustar wejaegerwejaeger/* * $Id: PppRoutesModel.cpp 13 2010-09-17 09:12:39Z werner $ * * File: PppRoutesModel.cpp * Author: Werner Jaeger * * Created on August 5, 2010, 1:16 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "PppRoutesModel.h" PppRoutesModel::PppRoutesModel(const QString& strConnectionName, QObject* pParent) : QAbstractTableModel(pParent), m_PppIpSettings(ConnectionSettings().pppSettings(strConnectionName).ipSettings()) { } PppRoutesModel::~PppRoutesModel() { } int PppRoutesModel::rowCount(const QModelIndex& /* parent */) const { return(m_PppIpSettings.routes()); } int PppRoutesModel::columnCount(const QModelIndex& /* parent */) const { return(3); } bool PppRoutesModel::setData(const QModelIndex& index, const QVariant& value, int iRole) { bool fRet = false; if (index.isValid()) { if (iRole == Qt::EditRole) { switch (index.column()) { case 0: fRet = m_PppIpSettings.setRouteAddress(index.row(), value.toString()); break; case 1: fRet = m_PppIpSettings.setRouteNetmask(index.row(), value.toString()); break; case 2: fRet = m_PppIpSettings.setRouteComment(index.row(), value.toString()); break; } } emit dataChanged(index, index); fRet = true; } return(fRet); } QVariant PppRoutesModel::data(const QModelIndex& index, int iRole) const { QVariant ret; if (index.isValid()) { if (iRole == Qt::DisplayRole || iRole == Qt::EditRole) { switch (index.column()) { case 0: ret = m_PppIpSettings.routeAddress(index.row()); break; case 1: ret = m_PppIpSettings.routeNetmask(index.row()); break; case 2: ret = m_PppIpSettings.routeComment(index.row()); break; } } else if (iRole == Qt::TextAlignmentRole) ret = int(Qt::AlignLeft | Qt::AlignVCenter); } return(ret); } QVariant PppRoutesModel::headerData(int iSection, Qt::Orientation orientation, int iRole) const { QVariant ret; if (iRole == Qt::DisplayRole && orientation == Qt::Horizontal) { switch (iSection) { case 0: ret = tr("Address"); break; case 1: ret = tr("Netmask"); break; case 2: ret = tr("Comment"); break; } } return(ret); } Qt::ItemFlags PppRoutesModel::flags(const QModelIndex& index) const { return(QAbstractTableModel::flags(index) | Qt::ItemIsEditable); } bool PppRoutesModel::addRow() { bool fRet = true; const int iRow = m_PppIpSettings.routes(); beginInsertRows(QModelIndex(), iRow, iRow); fRet = m_PppIpSettings.addRoute(); endInsertRows(); return(fRet); } bool PppRoutesModel::removeRow(int iRow) { bool fRet; beginRemoveRows(QModelIndex(), iRow, iRow); fRet = m_PppIpSettings.removeRoute(iRow); endRemoveRows(); return(fRet); } l2tp-ipsec-vpn/src/models/IPsecCertificateListModel.h0000664000175000017500000000365212040201226023210 0ustar wejaegerwejaeger/* * $Id: IPsecCertificateListModel.h 69 2011-04-12 04:33:22Z werner $ * * File: IPsecCertificateListModel.h * Author: Werner Jaeger * * Created on July 27, 2010, 1:50 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef IPSECCERTIFICATELISTMODEL_H #define IPSECCERTIFICATELISTMODEL_H #include class QDir; class IPsecCertificateListModel : public QAbstractListModel { Q_OBJECT public: explicit IPsecCertificateListModel(QObject* pParent = 0); virtual ~IPsecCertificateListModel(); void refresh(); int rowCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int iRole = Qt::DisplayRole) const; bool setData(const QModelIndex& index, const QVariant& qvalue, int iRole = Qt::EditRole); Qt::ItemFlags flags(const QModelIndex& index) const; const QString& selectedCertificateFileName() const; bool select(const QString& strCertificateFileName); private: IPsecCertificateListModel(const IPsecCertificateListModel& orig); IPsecCertificateListModel& operator=(const IPsecCertificateListModel& orig); int indexOf(const QString& strCertificateFileName) const; QString value(int i) const; QDir* const m_pCertificateDirectory; QString m_strSelected; }; #endif /* IPSECCERTIFICATELISTMODEL_H */ l2tp-ipsec-vpn/src/models/IPsecCertificateListModel.cpp0000664000175000017500000000721012040201226023535 0ustar wejaegerwejaeger/* * $Id: IPsecCertificateListModel.cpp 69 2011-04-12 04:33:22Z werner $ * * File: IPsecCertificateListModel.cpp * Author: Werner Jaeger * * Created on July 27, 2010, 1:50 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "util/CertificateInfo.h" #include "IPsecCertificateListModel.h" static const char* const CERTIFICATEPATH = "/etc/ipsec.d/certs"; IPsecCertificateListModel::IPsecCertificateListModel(QObject* pParent) : QAbstractListModel(pParent), m_pCertificateDirectory(new QDir("/etc/ipsec.d/certs")), m_strSelected("") { m_pCertificateDirectory->setFilter(QDir::Files | QDir::NoDotAndDotDot | QDir::Readable); } IPsecCertificateListModel::~IPsecCertificateListModel() { delete m_pCertificateDirectory; } void IPsecCertificateListModel::refresh() { m_pCertificateDirectory->refresh(); emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, 0)); } int IPsecCertificateListModel::rowCount(const QModelIndex& /* parent */) const { return(m_pCertificateDirectory->entryList().size()); } QVariant IPsecCertificateListModel::data(const QModelIndex& index, int iRole) const { QVariant ret; if (index.isValid()) { switch (iRole) { case Qt::DisplayRole: ret = value(index.row()).toAscii().constData(); break; case Qt::ToolTipRole: { const CertificateInfo ci(m_pCertificateDirectory->path() + "/" + value(index.row())); const QString strCN(ci.cn()); const QString strSN(ci.serialNumber()); ret = (strSN.isEmpty() ? "" : "SN=" + strSN + ", ") + "CN=" + strCN; } break; case Qt::CheckStateRole: ret = index.row() == indexOf(m_strSelected); break; } } return(ret); } bool IPsecCertificateListModel::setData(const QModelIndex& index, const QVariant& qvalue, int iRole) { bool fRet = false; if (index.isValid() && iRole == Qt::CheckStateRole) { if (qvalue == Qt::Checked) m_strSelected = value(index.row()); else m_strSelected = ""; fRet = true; emit dataChanged(index, index); } return(fRet); } Qt::ItemFlags IPsecCertificateListModel::flags(const QModelIndex& /* index */) const { return(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable); } const QString& IPsecCertificateListModel::selectedCertificateFileName() const { return(m_strSelected); } bool IPsecCertificateListModel::select(const QString& strCertificateFileName) { return(setData(index(indexOf(strCertificateFileName), 0), Qt::Checked, Qt::CheckStateRole)); } int IPsecCertificateListModel::indexOf(const QString& strCertificateFileName) const { return(QStringList(m_pCertificateDirectory->entryList()).indexOf(strCertificateFileName)); } QString IPsecCertificateListModel::value(int i) const { QString strRet; const QStringList list(m_pCertificateDirectory->entryList()); if (i < list.size()) strRet = list.at(i); return(strRet); }l2tp-ipsec-vpn/src/models/SmartCardObjectListModel.h0000664000175000017500000000354212040201226023047 0ustar wejaegerwejaeger/* * $Id: SmartCardObjectListModel.h 151 2012-08-03 16:42:07Z wejaeger $ * * File: SmartCardObjectListModel.h * Author: Werner Jaeger * * Created on August 2, 2010, 5:11 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SMARTCARDOBJECTLISTMODEL_H #define SMARTCARDOBJECTLISTMODEL_H #include #include class SmartCardInfo; class SmartCardObjectListModel : public QAbstractListModel { Q_OBJECT public: typedef enum { Certificate, PublicKey } ObjectType; explicit SmartCardObjectListModel(ObjectType objectType); virtual ~SmartCardObjectListModel(); int rowCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int iRole = Qt::DisplayRole) const; bool storeCert(const QModelIndex& index) const; const ObjectType& objectType() const { return(m_ObjectType); } private: SmartCardObjectListModel(const SmartCardObjectListModel& orig); SmartCardObjectListModel& operator=(const SmartCardObjectListModel& orig); QString value(int i) const; QString idValue(int i) const; void readTokens(); ObjectType const m_ObjectType; QList* const m_pSmartCardObjects; }; #endif /* SMARTCARDOBJECTLISTMODEL_H */ l2tp-ipsec-vpn/src/models/PppRoutesModel.h0000664000175000017500000000350612040201226021145 0ustar wejaegerwejaeger/* * $Id: PppRoutesModel.h 13 2010-09-17 09:12:39Z werner $ * * File: PppRoutesModel.h * Author: Werner Jaeger * * Created on August 5, 2010, 1:17 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PPPROUTESMODEL_H #define PPPROUTESMODEL_H #include #include "settings/ConnectionSettings.h" class PppRoutesModel : public QAbstractTableModel { Q_OBJECT public: explicit PppRoutesModel(const QString& strConnectionName, QObject* pParent = 0); virtual ~PppRoutesModel(); int rowCount(const QModelIndex& parent = QModelIndex()) const; int columnCount(const QModelIndex& parent = QModelIndex()) const; bool setData(const QModelIndex& index, const QVariant& value, int iRole = Qt::EditRole); QVariant data(const QModelIndex& index, int iRole = Qt::DisplayRole) const; QVariant headerData(int iSection, Qt::Orientation orientation, int iRole = Qt::DisplayRole) const; Qt::ItemFlags flags(const QModelIndex& index) const; bool addRow(); bool removeRow(int iRow); private: PppRoutesModel(const PppRoutesModel& orig); PppRoutesModel& operator=(const PppRoutesModel& orig); const PppIpSettings m_PppIpSettings; }; #endif /* PPPROUTESMODEL_H */ l2tp-ipsec-vpn/src/pkcs11/0000775000175000017500000000000012040201226015665 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/pkcs11/Pkcs11Attribute.h0000664000175000017500000001100312040201226020757 0ustar wejaegerwejaeger/* * $Id: Pkcs11Attribute.h 97 2011-08-01 07:29:28Z werner $ * * File: Pkcs11Attribute.h * Author: Werner Jaeger * * Created on July 31, 2010, 12:20 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PKCS11ATTRIBUTE_H #define PKCS11ATTRIBUTE_H #include #include #include #include "pkcs11.h" class Pkcs11Attlist; class Pkcs11Attribute { public: explicit Pkcs11Attribute(unsigned long ulType); virtual ~Pkcs11Attribute(); const CK_ATTRIBUTE* getAttribute() const { return(&m_Attr); } virtual void store(CK_SESSION_HANDLE ulSessionHandle, CK_OBJECT_HANDLE ulObjectHandle); virtual void load(CK_SESSION_HANDLE ulSessionHandle, CK_OBJECT_HANDLE ulObjectHandle); protected: CK_ATTRIBUTE m_Attr; private: Pkcs11Attribute(const Pkcs11Attribute& orig); Pkcs11Attribute& operator=(const Pkcs11Attribute& orig); friend class Pkcs11Attlist; }; class Pkcs11AttrBool: public Pkcs11Attribute { public: Pkcs11AttrBool(unsigned long ulType, bool fValue = false) : Pkcs11Attribute(ulType) { m_Attr.pValue = &m_cValue; m_Attr.ulValueLen = sizeof(m_cValue); setValue(fValue); } bool getValue() const { return(m_cValue ? true : false); } void setValue(unsigned long ulValue) { m_cValue = ulValue ? 1 : 0; } protected: unsigned char m_cValue; private: Pkcs11AttrBool(const Pkcs11AttrBool& orig); Pkcs11AttrBool& operator=(const Pkcs11AttrBool& orig); }; class Pkcs11AttrUlong: public Pkcs11Attribute { public: Pkcs11AttrUlong(unsigned long ulType, unsigned long ulValue = 0) : Pkcs11Attribute(ulType) { m_Attr.pValue = &m_ulValue; m_Attr.ulValueLen = sizeof(m_ulValue); setValue(ulValue); } unsigned long getValue() const { return(m_ulValue); } void setValue(unsigned long ulValue) { m_ulValue = ulValue; } protected: unsigned long m_ulValue; private: Pkcs11AttrUlong(const Pkcs11AttrBool& orig); Pkcs11AttrUlong& operator=(const Pkcs11AttrBool& orig); }; class Pkcs11AttrData: public Pkcs11Attribute { public: Pkcs11AttrData(unsigned long ulType, const unsigned char* pcValue = NULL, unsigned long ulLen = 0) : Pkcs11Attribute(ulType) { setValue(pcValue, ulLen); } Pkcs11AttrData(unsigned long ulType, QByteArray ba) : Pkcs11Attribute(ulType) { setValue(reinterpret_cast(ba.constData()), ba.size()); } virtual ~Pkcs11AttrData() { if (m_Attr.pValue) ::free(m_Attr.pValue); } unsigned long getValue(const unsigned char** ppChar) const { *ppChar = static_cast(m_Attr.pValue); return(m_Attr.ulValueLen); } QString getText() const { return(::utf82QString(m_Attr.pValue, m_Attr.ulValueLen)); } BIGNUM* getBignum() const { return(::BN_bin2bn(static_cast(m_Attr.pValue), m_Attr.ulValueLen, NULL)); } void load(CK_SESSION_HANDLE ulSessionHandle, CK_OBJECT_HANDLE ulObjectHandle); void setValue(const unsigned char *pc, unsigned long ulLen); private: Pkcs11AttrData(const Pkcs11AttrData& orig); Pkcs11AttrData& operator=(const Pkcs11AttrData& orig); }; class Pkcs11Attlist { public: Pkcs11Attlist() { init(); } explicit Pkcs11Attlist(const Pkcs11Attlist& attrList); explicit Pkcs11Attlist(const Pkcs11Attribute& attr) { init(); addAttribute(attr); } ~Pkcs11Attlist(); unsigned long get(CK_ATTRIBUTE** ppAttributes) const { *ppAttributes = m_pAttributes; return(m_ulAttrLen); } void addAttribute(const Pkcs11Attribute& attribute); void reset(); Pkcs11Attlist &operator << (const Pkcs11Attribute& attribute) { addAttribute(attribute); return(*this); } private: Pkcs11Attlist(const Pkcs11AttrData& orig); Pkcs11Attlist& operator=(const Pkcs11AttrData& orig); void init() { m_ulAttrLen = 0; m_ulAllocLen = 0; m_pAttributes = NULL; } CK_ATTRIBUTE* m_pAttributes; unsigned long m_ulAttrLen; unsigned long m_ulAllocLen; }; #endif /* PKCS11ATTRIBUTE_H */ l2tp-ipsec-vpn/src/pkcs11/SmartCardState.cpp0000664000175000017500000000442212040201226021254 0ustar wejaegerwejaeger/* * $Id: SmartCardState.cpp 133 2012-05-02 09:13:26Z wejaeger $ * * File: SmartCardState.cpp * Author: Werner Jaeger * * Created on July 16, 2010, 10:31 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "pkcs11/Pkcs11.h" #include "SmartCardState.h" #include "SmartCardInsertWaitTask.h" SmartCardState::SmartCardState(QObject* pParent) : QObject(pParent), m_pWaitTask(NULL), m_pMsgBox(new QMessageBox(QMessageBox::Information, QCoreApplication::instance()->applicationName(), QObject::tr("Please insert your smart card ..."), QMessageBox::Cancel)) { } SmartCardState::~SmartCardState() { if (m_pWaitTask) delete m_pWaitTask; if (m_pMsgBox) delete m_pMsgBox; } int SmartCardState::readersAvailable() { int iRet(0); if (Pkcs11::loaded()) { Pkcs11 p11; iRet = p11.slotsAvailable(); } return(iRet); } int SmartCardState::waitForCardPresent() { int iRet(0); if (Pkcs11::loaded()) { Pkcs11 p11; iRet = p11.slotList().count(); if (iRet == 0) { if (m_pWaitTask != NULL) delete m_pWaitTask; m_pWaitTask = new SmartCardInsertWaitTask(p11); connect(m_pWaitTask, SIGNAL(finished()), this, SLOT(waitTaskFinished())); m_pWaitTask->start(); iRet = m_pMsgBox->exec(); if(iRet == QMessageBox::Cancel) { m_pWaitTask->stop(); iRet = 0; } } } return(iRet); } void SmartCardState::waitTaskFinished() { const int iRet(m_pWaitTask->result()); m_pMsgBox->done(iRet); } l2tp-ipsec-vpn/src/pkcs11/SmartCardInfo.h0000664000175000017500000000403012040201226020527 0ustar wejaegerwejaeger/* * $Id: SmartCardInfo.h 13 2010-09-17 09:12:39Z werner $ * * File: SmartCardInfo.h * Author: Werner Jaeger * * Created on August 1, 2010, 2:13 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SMARTCARDINFO_H #define SMARTCARDINFO_H #include class CertificateInfo; class SmartCardInfo { public: SmartCardInfo(const Pkcs11& p11, CK_OBJECT_HANDLE ulObjectHandle); virtual ~SmartCardInfo(); const QString& serialNo() const { return(m_strSerialNo); } const QString& manufacturer() const { return(m_strManufacturer); } const QString& bitLength() const { return(m_strBitLength); } const QString& cardLabel() const { return(m_strCardLabel); } const QString& slotId() const { return(m_strSlotId); } const QString& objectLabel() const { return(m_strObjectLabel); } const QString& objectId() const { return(m_strObjectId); } const CertificateInfo& certificateInfo() const; private: SmartCardInfo(const SmartCardInfo& orig); SmartCardInfo& operator=(const SmartCardInfo& orig); void loadToken(const Pkcs11& p11, CK_OBJECT_HANDLE ulObjectHandle); static QString BNOneLine(const BIGNUM* pBigNumber); QString m_strSerialNo; QString m_strManufacturer; QString m_strBitLength; QString m_strCardLabel; QString m_strSlotId; QString m_strObjectLabel; QString m_strObjectId; CertificateInfo* m_pCertificateInfo; }; #endif /* SMARTCARDINFO_H */ l2tp-ipsec-vpn/src/pkcs11/SmartCardInsertWaitTask.cpp0000664000175000017500000000250512040201226023110 0ustar wejaegerwejaeger/* * $Id: SmartCardInsertWaitTask.cpp 120 2012-03-08 04:57:41Z werner $ * * File: SmartCardInsertWaitTask.cpp * Author: Werner Jaeger * * Created on July 16, 2010, 7:08 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "SmartCardInsertWaitTask.h" #include "pkcs11/Pkcs11.h" SmartCardInsertWaitTask::SmartCardInsertWaitTask(const Pkcs11& pkcs11) : m_pkcs11(pkcs11), m_iRet(0), m_fStop(false) { } SmartCardInsertWaitTask::~SmartCardInsertWaitTask() { } void SmartCardInsertWaitTask::run() { m_fStop = false; if (Pkcs11::loaded()) { do { m_iRet = m_pkcs11.slotList().count(); QThread::sleep(1); } while (m_iRet == 0 && !m_fStop); } } l2tp-ipsec-vpn/src/pkcs11/Pkcs11.h0000664000175000017500000000546512040201226017112 0ustar wejaegerwejaeger/* * $Id: Pkcs11.h 129 2012-04-07 10:15:46Z wejaeger $ * * File: Pkcs11.h * Author: Werner Jaeger * * Created on July 31, 2010, 12:10 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef QPKCS11_H #define QPKCS11_H #include #include #include "util/GlobalFunctions.h" #include "pkcs11.h" #include "Pkcs11Attribute.h" class Pkcs11 { public: Pkcs11(); virtual ~Pkcs11(); QStringList tokenInfo(CK_SLOT_ID ulSlotId) const; QStringList tokenInfo() const; unsigned long slotsAvailable() const; bool protectedAuthenticationPath(CK_SLOT_ID ulSlotId) const; bool protectedAuthenticationPath() const; void startSession(unsigned long ulSlot, bool fRW = false); CK_SLOT_ID slotId() const { return(m_ulSlotId); } QList slotList() const; QList objectList(const Pkcs11Attlist& atts) const; QList mechanismList(unsigned long ulSlot) const; void loadAttribute(Pkcs11Attribute& attribute, CK_OBJECT_HANDLE ulObjectHandle) const; void storeAttribute(Pkcs11Attribute& attribute, CK_OBJECT_HANDLE ulObjectHandle) const; void login(const unsigned char* pcPin, unsigned long ulPinlen, bool fAsSecurityOfficer) const; void logout() const; bool needsLogin(bool fAsSecurityOfficer) const; void setPin(const unsigned char* pcOldPin, unsigned long ulOldPinLen, const unsigned char* pcPin, unsigned long ulPinLen) const; void initPin(const unsigned char* pcPin, unsigned long ulPinLen) const; CK_OBJECT_HANDLE createObject(const Pkcs11Attlist& attrs) const; static bool loadLibrary(const QString& strFilePath, bool fSilent); static bool closeLibrary(const QString& strFilePath, bool fSilent); static void pk11error(const QString& strfunc, int iReturnValue); static bool loaded() { return !!m_p11; }; private: Pkcs11(const Pkcs11& orig); Pkcs11& operator=(const Pkcs11& orig); CK_SESSION_HANDLE m_ulSessionHandle; CK_SLOT_ID m_ulSlotId; CK_OBJECT_HANDLE m_ulObjectHandle; static lt_dlhandle m_pLoadedModuleHandle; static CK_FUNCTION_LIST* m_p11; friend class Pkcs11Attribute; friend class Pkcs11AttrUlong; friend class Pkcs11AttrData; }; #endif /* QPKCS11_H */ l2tp-ipsec-vpn/src/pkcs11/Pkcs11.cpp0000664000175000017500000003351112040201226017436 0ustar wejaegerwejaeger/* * $Id: Pkcs11.cpp 130 2012-04-08 06:18:04Z wejaeger $ * * File: Pkcs11.cpp * Author: Werner Jaeger * * Created on July 31, 2010, 12:10 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "util/ErrorEx.h" #include "Pkcs11.h" CK_FUNCTION_LIST* Pkcs11::m_p11(NULL); lt_dlhandle Pkcs11::m_pLoadedModuleHandle(NULL); Pkcs11::Pkcs11() : m_ulSessionHandle(CK_INVALID_HANDLE), m_ulSlotId(0), m_ulObjectHandle(CK_INVALID_HANDLE) { } Pkcs11::~Pkcs11() { if (m_ulSessionHandle != CK_INVALID_HANDLE && m_p11) m_p11->C_CloseSession(m_ulSessionHandle); } void Pkcs11::startSession(unsigned long ulSlot, bool fRW) { CK_RV rv; const unsigned long ulFlags(CKF_SERIAL_SESSION | (fRW ? CKF_RW_SESSION : 0)); if (m_ulSessionHandle != CK_INVALID_HANDLE) { rv = m_p11->C_CloseSession(m_ulSessionHandle); if (rv != CKR_OK) pk11error("C_CloseSession", rv); } rv = m_p11->C_OpenSession(ulSlot, ulFlags, NULL, NULL, &m_ulSessionHandle); if (rv != CKR_OK) pk11error("C_OpenSession", rv); m_ulSlotId = ulSlot; } unsigned long Pkcs11::slotsAvailable() const { unsigned long ulNumSlots(0L); const CK_RV rv(m_p11->C_GetSlotList(CK_FALSE, NULL_PTR, &ulNumSlots)); if (rv != CKR_OK) pk11error("C_GetSlotList", rv); return(ulNumSlots); } QList Pkcs11::slotList() const { CK_RV rv; CK_SLOT_ID* p11Slots(NULL); QList slotList; unsigned long ulNumSlots(0L); /* This one helps to avoid errors. * Fist time it fails, 2nd time it works */ m_p11->C_GetSlotList(CK_TRUE, p11Slots, &ulNumSlots); while (true) { rv = m_p11->C_GetSlotList(CK_TRUE, p11Slots, &ulNumSlots); if (rv != CKR_OK && rv != CKR_BUFFER_TOO_SMALL) pk11error("C_GetSlotList", rv); if (ulNumSlots == 0) break; if ((rv == CKR_OK) && p11Slots) break; p11Slots = reinterpret_cast(::realloc(p11Slots, ulNumSlots * sizeof (CK_SLOT_ID))); ErrorEx::checkOutOfMemory(p11Slots); } for (unsigned long ul = 0; ul < ulNumSlots; ul++) { CK_SLOT_INFO slotInfo; rv = m_p11->C_GetSlotInfo(p11Slots[ul], &slotInfo); if (rv == CKR_OK) { if ((slotInfo.flags & CKF_TOKEN_PRESENT) == CKF_TOKEN_PRESENT) slotList << p11Slots[ul]; } } if (p11Slots) ::free(p11Slots); return(slotList); } QList Pkcs11::mechanismList(unsigned long ulSlot) const { QList mechanismList; unsigned long ulCount; CK_RV rv(m_p11->C_GetMechanismList(ulSlot, NULL, &ulCount)); if (ulCount != 0) { CK_MECHANISM_TYPE* const pMechanismType(reinterpret_cast(::malloc(ulCount * sizeof(*pMechanismType)))); ErrorEx::checkOutOfMemory(pMechanismType); rv = m_p11->C_GetMechanismList(ulSlot, pMechanismType, &ulCount); if (rv != CKR_OK) pk11error("C_GetMechanismList", rv); for (unsigned ul = 0; ul < ulCount; ul++) mechanismList << pMechanismType[ul]; } return(mechanismList); } void Pkcs11::logout() const { const CK_RV rv(m_p11->C_Logout(m_ulSessionHandle)); if (rv != CKR_OK && rv != CKR_USER_NOT_LOGGED_IN) pk11error("C_Logout", rv); } bool Pkcs11::needsLogin(bool fAsSecurityOfficer) const { bool fRet(true); CK_SESSION_INFO sinfo; const CK_RV rv(m_p11->C_GetSessionInfo(m_ulSessionHandle, &sinfo)); if (rv != CKR_OK) pk11error("C_GetSessionInfo", rv); switch (sinfo.state) { case CKS_RO_PUBLIC_SESSION: case CKS_RW_PUBLIC_SESSION: fRet = true; break; case CKS_RW_SO_FUNCTIONS: if (!fAsSecurityOfficer) { logout(); fRet = true; } else fRet = false; break; case CKS_RO_USER_FUNCTIONS: case CKS_RW_USER_FUNCTIONS: if (fAsSecurityOfficer) { logout(); fRet = true; } else fRet = false; break; } return(fRet); } void Pkcs11::login(const unsigned char* pcPin, unsigned long ulPinlen, bool fAsSecurityOfficer) const { const unsigned long ulUser(fAsSecurityOfficer ? CKU_SO : CKU_USER); const CK_RV rv(m_p11->C_Login(m_ulSessionHandle, ulUser, const_cast(pcPin), ulPinlen)); if (rv != CKR_OK && rv != CKR_USER_ALREADY_LOGGED_IN) pk11error("C_Login", rv); } void Pkcs11::setPin(const unsigned char* pcOldPin, unsigned long ulOldPinLen, const unsigned char* pcPin, unsigned long ulPinLen) const { const CK_RV rv(m_p11->C_SetPIN(m_ulSessionHandle, const_cast(pcOldPin), ulOldPinLen, const_cast(pcPin), ulPinLen)); if (rv != CKR_OK) pk11error("C_SetPIN", rv); } void Pkcs11::initPin(const unsigned char* pcPin, unsigned long ulPinLen) const { const CK_RV rv(m_p11->C_InitPIN(m_ulSessionHandle, const_cast(pcPin), ulPinLen)); if (rv != CKR_OK) pk11error("C_InitPIN", rv); } QStringList Pkcs11::tokenInfo(CK_SLOT_ID ulSlotId) const { CK_TOKEN_INFO tokenInfo; const CK_RV rv(m_p11->C_GetTokenInfo(ulSlotId, &tokenInfo)); if (rv != CKR_OK) pk11error("C_GetTokenInfo", rv); QStringList tokeInfoList; tokeInfoList << ::utf82QString(tokenInfo.label, 32); tokeInfoList << ::utf82QString(tokenInfo.manufacturerID, 32); tokeInfoList << ::utf82QString(tokenInfo.serialNumber, 16); return(tokeInfoList); } QStringList Pkcs11::tokenInfo() const { return(tokenInfo(m_ulSlotId)); } bool Pkcs11::protectedAuthenticationPath(CK_SLOT_ID ulSlotId) const { CK_TOKEN_INFO tokenInfo; const CK_RV rv(m_p11->C_GetTokenInfo(ulSlotId, &tokenInfo)); if (rv != CKR_OK) pk11error("C_GetTokenInfo", rv); return(!!(tokenInfo.flags & CKF_PROTECTED_AUTHENTICATION_PATH)); } bool Pkcs11::protectedAuthenticationPath() const { return(protectedAuthenticationPath(m_ulSlotId)); } void Pkcs11::loadAttribute(Pkcs11Attribute& attribute, CK_OBJECT_HANDLE ulObjectHandle) const { attribute.load(m_ulSessionHandle, ulObjectHandle); } void Pkcs11::storeAttribute(Pkcs11Attribute& attribute, CK_OBJECT_HANDLE ulObjectHandle) const { attribute.store(m_ulSessionHandle, ulObjectHandle); } CK_OBJECT_HANDLE Pkcs11::createObject(const Pkcs11Attlist& attrs) const { CK_ATTRIBUTE *pAttributes; CK_OBJECT_HANDLE ulObjectHandle; const unsigned long ulNum(attrs.get(&pAttributes)); const CK_RV rv(m_p11->C_CreateObject(m_ulSessionHandle, pAttributes, ulNum, &ulObjectHandle)); if (rv != CKR_OK) pk11error("C_CreateObject", rv); return(ulObjectHandle); } QList Pkcs11::objectList(const Pkcs11Attlist& atts) const { QList objectHandleList; CK_ATTRIBUTE* pAttribute; const unsigned long ulNoOfAttributes(atts.get(&pAttribute)); CK_RV rv(m_p11->C_FindObjectsInit(m_ulSessionHandle, pAttribute, ulNoOfAttributes)); if (rv != CKR_OK) pk11error("C_FindObjectsInit", rv); CK_OBJECT_HANDLE aObjectHandles[256]; unsigned long ulLen; do { rv = m_p11->C_FindObjects(m_ulSessionHandle, aObjectHandles, 256, &ulLen); if (rv != CKR_OK) pk11error("C_FindObjects", rv); for (unsigned long ul = 0; ul < ulLen; ul++) objectHandleList += aObjectHandles[ul]; } while (ulLen); rv = m_p11->C_FindObjectsFinal(m_ulSessionHandle); if (rv != CKR_OK) pk11error("C_FindObjectsFinal", rv); return(objectHandleList); } bool Pkcs11::loadLibrary(const QString& strFilePath, bool fSilent) { if (!Pkcs11::closeLibrary(strFilePath, fSilent)) return(false); CK_RV(*c_get_function_list)(CK_FUNCTION_LIST_PTR_PTR); ::lt_dlinit(); if (m_pLoadedModuleHandle) { if (::lt_dlclose(m_pLoadedModuleHandle) < 0) { if (fSilent) return(false); throw ErrorEx("Failed to close PKCS11 library: " + strFilePath); } } if (strFilePath.isEmpty()) { if (fSilent) return(false); throw ErrorEx("PKCS11 library filename empty"); } m_pLoadedModuleHandle = ::lt_dlopen(::string2FileName(strFilePath)); if (m_pLoadedModuleHandle == NULL) { if (fSilent) return(false); throw ErrorEx("Failed to open PKCS11 library: " + strFilePath); } /* Get the list of function pointers */ c_get_function_list = (CK_RV(*)(CK_FUNCTION_LIST_PTR_PTR))lt_dlsym(m_pLoadedModuleHandle, "C_GetFunctionList"); if (c_get_function_list) { if (c_get_function_list(&m_p11) == CKR_OK) { const CK_RV rv(m_p11->C_Initialize(NULL_PTR)); if (rv != CKR_OK) { if (fSilent) return(false); pk11error("C_Initialize", rv); } return(true); } } /* This state is always worth an error ! */ if (::lt_dlclose(m_pLoadedModuleHandle) == 0) m_pLoadedModuleHandle = NULL; if (!fSilent) throw ErrorEx("Failed to open PKCS11 library: " + strFilePath); return(false); } bool Pkcs11::closeLibrary(const QString& strFilePath, bool fSilent) { bool fRet(true); if (m_pLoadedModuleHandle) { m_p11->C_Finalize(NULL_PTR); if (::lt_dlclose(m_pLoadedModuleHandle) < 0) { fRet =false; if (!fSilent) throw ErrorEx("Failed to close PKCS11 library: " + strFilePath); } } m_p11 = NULL; m_pLoadedModuleHandle = NULL; return(fRet); } static const char* CKR2Str(unsigned long ulReturnValue) { #define PK11_ERR(x) case x : return #x; switch (ulReturnValue) { PK11_ERR(CKR_OK) PK11_ERR(CKR_CANCEL) PK11_ERR(CKR_HOST_MEMORY) PK11_ERR(CKR_SLOT_ID_INVALID) PK11_ERR(CKR_GENERAL_ERROR) PK11_ERR(CKR_FUNCTION_FAILED) PK11_ERR(CKR_ARGUMENTS_BAD) PK11_ERR(CKR_NO_EVENT) PK11_ERR(CKR_NEED_TO_CREATE_THREADS) PK11_ERR(CKR_CANT_LOCK) PK11_ERR(CKR_ATTRIBUTE_READ_ONLY) PK11_ERR(CKR_ATTRIBUTE_SENSITIVE) PK11_ERR(CKR_ATTRIBUTE_TYPE_INVALID) PK11_ERR(CKR_ATTRIBUTE_VALUE_INVALID) PK11_ERR(CKR_DATA_INVALID) PK11_ERR(CKR_DATA_LEN_RANGE) PK11_ERR(CKR_DEVICE_ERROR) PK11_ERR(CKR_DEVICE_MEMORY) PK11_ERR(CKR_DEVICE_REMOVED) PK11_ERR(CKR_ENCRYPTED_DATA_INVALID) PK11_ERR(CKR_ENCRYPTED_DATA_LEN_RANGE) PK11_ERR(CKR_FUNCTION_CANCELED) PK11_ERR(CKR_FUNCTION_NOT_PARALLEL) PK11_ERR(CKR_FUNCTION_NOT_SUPPORTED) PK11_ERR(CKR_KEY_HANDLE_INVALID) PK11_ERR(CKR_KEY_SIZE_RANGE) PK11_ERR(CKR_KEY_TYPE_INCONSISTENT) PK11_ERR(CKR_KEY_NOT_NEEDED) PK11_ERR(CKR_KEY_CHANGED) PK11_ERR(CKR_KEY_NEEDED) PK11_ERR(CKR_KEY_INDIGESTIBLE) PK11_ERR(CKR_KEY_FUNCTION_NOT_PERMITTED) PK11_ERR(CKR_KEY_NOT_WRAPPABLE) PK11_ERR(CKR_KEY_UNEXTRACTABLE) PK11_ERR(CKR_MECHANISM_INVALID) PK11_ERR(CKR_MECHANISM_PARAM_INVALID) PK11_ERR(CKR_OBJECT_HANDLE_INVALID) PK11_ERR(CKR_OPERATION_ACTIVE) PK11_ERR(CKR_OPERATION_NOT_INITIALIZED) PK11_ERR(CKR_PIN_INCORRECT) PK11_ERR(CKR_PIN_INVALID) PK11_ERR(CKR_PIN_LEN_RANGE) PK11_ERR(CKR_PIN_EXPIRED) PK11_ERR(CKR_PIN_LOCKED) PK11_ERR(CKR_SESSION_CLOSED) PK11_ERR(CKR_SESSION_COUNT) PK11_ERR(CKR_SESSION_HANDLE_INVALID) PK11_ERR(CKR_SESSION_PARALLEL_NOT_SUPPORTED) PK11_ERR(CKR_SESSION_READ_ONLY) PK11_ERR(CKR_SESSION_EXISTS) PK11_ERR(CKR_SESSION_READ_ONLY_EXISTS) PK11_ERR(CKR_SESSION_READ_WRITE_SO_EXISTS) PK11_ERR(CKR_SIGNATURE_INVALID) PK11_ERR(CKR_SIGNATURE_LEN_RANGE) PK11_ERR(CKR_TEMPLATE_INCOMPLETE) PK11_ERR(CKR_TEMPLATE_INCONSISTENT) PK11_ERR(CKR_TOKEN_NOT_PRESENT) PK11_ERR(CKR_TOKEN_NOT_RECOGNIZED) PK11_ERR(CKR_TOKEN_WRITE_PROTECTED) PK11_ERR(CKR_UNWRAPPING_KEY_HANDLE_INVALID) PK11_ERR(CKR_UNWRAPPING_KEY_SIZE_RANGE) PK11_ERR(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT) PK11_ERR(CKR_USER_ALREADY_LOGGED_IN) PK11_ERR(CKR_USER_NOT_LOGGED_IN) PK11_ERR(CKR_USER_PIN_NOT_INITIALIZED) PK11_ERR(CKR_USER_TYPE_INVALID) PK11_ERR(CKR_USER_ANOTHER_ALREADY_LOGGED_IN) PK11_ERR(CKR_USER_TOO_MANY_TYPES) PK11_ERR(CKR_WRAPPED_KEY_INVALID) PK11_ERR(CKR_WRAPPED_KEY_LEN_RANGE) PK11_ERR(CKR_WRAPPING_KEY_HANDLE_INVALID) PK11_ERR(CKR_WRAPPING_KEY_SIZE_RANGE) PK11_ERR(CKR_WRAPPING_KEY_TYPE_INCONSISTENT) PK11_ERR(CKR_RANDOM_SEED_NOT_SUPPORTED) PK11_ERR(CKR_RANDOM_NO_RNG) PK11_ERR(CKR_DOMAIN_PARAMS_INVALID) PK11_ERR(CKR_BUFFER_TOO_SMALL) PK11_ERR(CKR_SAVED_STATE_INVALID) PK11_ERR(CKR_INFORMATION_SENSITIVE) PK11_ERR(CKR_STATE_UNSAVEABLE) PK11_ERR(CKR_CRYPTOKI_NOT_INITIALIZED) PK11_ERR(CKR_CRYPTOKI_ALREADY_INITIALIZED) PK11_ERR(CKR_MUTEX_BAD) PK11_ERR(CKR_MUTEX_NOT_LOCKED) PK11_ERR(CKR_VENDOR_DEFINED) } return ("unknown PKCS11 error"); } void Pkcs11::pk11error(const QString& strfunc, int iReturnValue) { ErrorEx err("PKCS#11 function " + strfunc + " failed: " + ::CKR2Str(iReturnValue) + "\n"); throw err; } l2tp-ipsec-vpn/src/pkcs11/SmartCardInfo.cpp0000664000175000017500000000555112040201226021073 0ustar wejaegerwejaeger/* * $Id: SmartCardInfo.cpp 36 2011-01-28 08:23:14Z werner $ * * File: SmartCardInfo.cpp * Author: Werner Jaeger * * Created on August 1, 2010, 2:13 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "util/CertificateInfo.h" #include "util/ErrorEx.h" #include "Pkcs11.h" #include "SmartCardInfo.h" SmartCardInfo::SmartCardInfo(const Pkcs11& p11, CK_OBJECT_HANDLE ulObjectHandle) : m_pCertificateInfo(NULL) { loadToken(p11, ulObjectHandle); } SmartCardInfo::~SmartCardInfo() { if (m_pCertificateInfo) delete m_pCertificateInfo; } const CertificateInfo& SmartCardInfo::certificateInfo() const { return(*m_pCertificateInfo); } void SmartCardInfo::loadToken(const Pkcs11& p11, CK_OBJECT_HANDLE ulObjectHandle) { const QStringList tokenInfoList(p11.tokenInfo()); m_strCardLabel = tokenInfoList[0]; m_strManufacturer = tokenInfoList[1]; m_strSerialNo = tokenInfoList[2]; try { Pkcs11AttrUlong bitLengthAttribute(CKA_MODULUS_BITS); p11.loadAttribute(bitLengthAttribute, ulObjectHandle); m_strBitLength.setNum(bitLengthAttribute.getValue()); } catch (ErrorEx &e) { // ignore } Pkcs11AttrData idAttribute(CKA_ID); p11.loadAttribute(idAttribute, ulObjectHandle); m_strObjectId = BNOneLine(idAttribute.getBignum()); try { Pkcs11AttrData objectLabelAttribute(CKA_LABEL); p11.loadAttribute(objectLabelAttribute, ulObjectHandle); m_strObjectLabel = objectLabelAttribute.getText(); } catch (ErrorEx &e) { // ignore } m_strSlotId.setNum(p11.slotId()); Pkcs11AttrData x509ValueAttribute(CKA_VALUE); p11.loadAttribute(x509ValueAttribute, ulObjectHandle); const unsigned char* pcValue; const unsigned long ulLen(x509ValueAttribute.getValue(&pcValue)); if (m_pCertificateInfo) delete m_pCertificateInfo; m_pCertificateInfo = new CertificateInfo(QByteArray::fromRawData(reinterpret_cast(pcValue), ulLen)); } QString SmartCardInfo::BNOneLine(const BIGNUM* pBigNumber) { QString strRet; if (pBigNumber) { char* pcHex = ::BN_bn2hex(pBigNumber); strRet = pcHex; ::CRYPTO_free(pcHex); } return(strRet); } l2tp-ipsec-vpn/src/pkcs11/Pkcs11Attribute.cpp0000664000175000017500000000774412040201226021333 0ustar wejaegerwejaeger/* * $Id: Pkcs11Attribute.cpp 13 2010-09-17 09:12:39Z werner $ * * File: Pkcs11Attribute.cpp * Author: Werner Jaeger * * Created on July 31, 2010, 12:20 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "util/ErrorEx.h" #include "Pkcs11.h" #include "Pkcs11Attribute.h" Pkcs11Attribute::Pkcs11Attribute(unsigned long ulType) { ::memset(&m_Attr, 0, sizeof(m_Attr)); m_Attr.type = ulType; } Pkcs11Attribute::~Pkcs11Attribute() { } void Pkcs11Attribute::load(CK_SESSION_HANDLE ulSessionHandle, CK_OBJECT_HANDLE ulObjectHandle) { const CK_RV rv = Pkcs11::m_p11->C_GetAttributeValue(ulSessionHandle, ulObjectHandle, &m_Attr, 1); if (rv != CKR_OK) Pkcs11::pk11error("C_GetAttribute()", rv); } void Pkcs11Attribute::store(CK_SESSION_HANDLE ulSessionHandle, CK_OBJECT_HANDLE ulObjectHandle) { const CK_RV rv = Pkcs11::m_p11->C_SetAttributeValue(ulSessionHandle, ulObjectHandle, &m_Attr, 1); if (rv != CKR_OK) Pkcs11::pk11error("C_SetAttributeValue", rv); } void Pkcs11AttrData::load(CK_SESSION_HANDLE ulSessionHandle, CK_OBJECT_HANDLE ulObjectHandle) { if (m_Attr.pValue) { ::free(m_Attr.pValue); m_Attr.pValue = NULL; } m_Attr.ulValueLen = 0; CK_RV rv = Pkcs11::m_p11->C_GetAttributeValue(ulSessionHandle, ulObjectHandle, &m_Attr, 1); if (rv == CKR_OK) { m_Attr.pValue = ::malloc(m_Attr.ulValueLen +1); ErrorEx::checkOutOfMemory(m_Attr.pValue); rv = Pkcs11::m_p11->C_GetAttributeValue(ulSessionHandle, ulObjectHandle, &m_Attr, 1); if (rv != CKR_OK) Pkcs11::pk11error("C_GetAttributeValue(data)", rv); } else Pkcs11::pk11error("C_GetAttributeValue(data)", rv); } void Pkcs11AttrData::setValue(const unsigned char *pc, unsigned long ulLen) { if (m_Attr.pValue) ::free(m_Attr.pValue); m_Attr.pValue = ::malloc(ulLen); ErrorEx::checkOutOfMemory(m_Attr.pValue); ::memcpy(m_Attr.pValue, pc, ulLen); m_Attr.ulValueLen = ulLen; } Pkcs11Attlist::Pkcs11Attlist(const Pkcs11Attlist &attrList) { m_ulAttrLen = attrList.m_ulAttrLen; m_ulAllocLen = attrList.m_ulAllocLen; if (m_ulAllocLen) { m_pAttributes = reinterpret_cast(::malloc(m_ulAllocLen * sizeof(*m_pAttributes))); ErrorEx::checkOutOfMemory(m_pAttributes); ::memcpy(m_pAttributes, attrList.m_pAttributes, m_ulAttrLen * sizeof(*m_pAttributes)); } for (unsigned long ul = 0; ul < m_ulAttrLen; ul++) { void* p = ::malloc(m_pAttributes[ul].ulValueLen); ErrorEx::checkOutOfMemory(p); ::memcpy(p, m_pAttributes[ul].pValue, m_pAttributes[ul].ulValueLen); } } Pkcs11Attlist::~Pkcs11Attlist() { for (unsigned long ul = 0; ul < m_ulAttrLen; ul++) ::free(m_pAttributes[ul].pValue); if (m_pAttributes) ::free(m_pAttributes); } void Pkcs11Attlist::addAttribute(const Pkcs11Attribute& attribute) { if (m_ulAttrLen == m_ulAllocLen) { m_ulAllocLen = m_ulAllocLen ? m_ulAllocLen * 2 : 16; m_pAttributes = reinterpret_cast(::realloc(m_pAttributes, m_ulAllocLen * sizeof(*m_pAttributes))); ErrorEx::checkOutOfMemory(m_pAttributes); } CK_ATTRIBUTE* const pAttr = m_pAttributes + m_ulAttrLen++; pAttr->type = attribute.m_Attr.type; pAttr->ulValueLen = attribute.m_Attr.ulValueLen; pAttr->pValue = ::malloc(pAttr->ulValueLen); ::memcpy(pAttr->pValue, attribute.m_Attr.pValue, pAttr->ulValueLen); } void Pkcs11Attlist::reset() { for (unsigned long ul = 0; ul < m_ulAttrLen; ul++) ::free(m_pAttributes[ul].pValue); m_ulAttrLen = 0; } l2tp-ipsec-vpn/src/pkcs11/pkcs11.h0000664000175000017500000012502012040201226017140 0ustar wejaegerwejaeger/* pkcs11.h Copyright 2006, 2007 g10 Code GmbH Copyright 2006 Andreas Jellinghaus This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* Please submit changes back to the Scute project at http://www.scute.org/ (or send them to marcus@g10code.com), so that they can be picked up by other projects from there as well. */ /* This file is a modified implementation of the PKCS #11 standard by RSA Security Inc. It is mostly a drop-in replacement, with the following change: This header file does not require any macro definitions by the user (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros for you (if useful, some are missing, let me know if you need more). There is an additional API available that does comply better to the GNU coding standard. It can be switched on by defining CRYPTOKI_GNU before including this header file. For this, the following changes are made to the specification: All structure types are changed to a "struct ck_foo" where CK_FOO is the type name in PKCS #11. All non-structure types are changed to ck_foo_t where CK_FOO is the lowercase version of the type name in PKCS #11. The basic types (CK_ULONG et al.) are removed without substitute. All members of structures are modified in the following way: Type indication prefixes are removed, and underscore characters are inserted before words. Then the result is lowercased. Note that function names are still in the original case, as they need for ABI compatibility. CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use . If CRYPTOKI_COMPAT is defined before including this header file, then none of the API changes above take place, and the API is the one defined by the PKCS #11 standard. */ #ifndef PKCS11_H #define PKCS11_H 1 #if defined(__cplusplus) extern "C" { #endif /* The version of cryptoki we implement. The revision is changed with each modification of this file. If you do not use the "official" version of this file, please consider deleting the revision macro (you may use a macro with a different name to keep track of your versions). */ #define CRYPTOKI_VERSION_MAJOR 2 #define CRYPTOKI_VERSION_MINOR 20 #define CRYPTOKI_VERSION_REVISION 6 /* Compatibility interface is default, unless CRYPTOKI_GNU is given. */ #ifndef CRYPTOKI_GNU #ifndef CRYPTOKI_COMPAT #define CRYPTOKI_COMPAT 1 #endif #endif /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) /* There is a matching pop below. */ #pragma pack(push, cryptoki, 1) #ifdef CRYPTOKI_EXPORTS #define CK_SPEC __declspec(dllexport) #else #define CK_SPEC __declspec(dllimport) #endif #else #define CK_SPEC #endif #ifdef CRYPTOKI_COMPAT /* If we are in compatibility mode, switch all exposed names to the PKCS #11 variant. There are corresponding #undefs below. */ #define ck_flags_t CK_FLAGS #define ck_version _CK_VERSION #define ck_info _CK_INFO #define cryptoki_version cryptokiVersion #define manufacturer_id manufacturerID #define library_description libraryDescription #define library_version libraryVersion #define ck_notification_t CK_NOTIFICATION #define ck_slot_id_t CK_SLOT_ID #define ck_slot_info _CK_SLOT_INFO #define slot_description slotDescription #define hardware_version hardwareVersion #define firmware_version firmwareVersion #define ck_token_info _CK_TOKEN_INFO #define serial_number serialNumber #define max_session_count ulMaxSessionCount #define session_count ulSessionCount #define max_rw_session_count ulMaxRwSessionCount #define rw_session_count ulRwSessionCount #define max_pin_len ulMaxPinLen #define min_pin_len ulMinPinLen #define total_public_memory ulTotalPublicMemory #define free_public_memory ulFreePublicMemory #define total_private_memory ulTotalPrivateMemory #define free_private_memory ulFreePrivateMemory #define utc_time utcTime #define ck_session_handle_t CK_SESSION_HANDLE #define ck_user_type_t CK_USER_TYPE #define ck_state_t CK_STATE #define ck_session_info _CK_SESSION_INFO #define slot_id slotID #define device_error ulDeviceError #define ck_object_handle_t CK_OBJECT_HANDLE #define ck_object_class_t CK_OBJECT_CLASS #define ck_hw_feature_type_t CK_HW_FEATURE_TYPE #define ck_key_type_t CK_KEY_TYPE #define ck_certificate_type_t CK_CERTIFICATE_TYPE #define ck_attribute_type_t CK_ATTRIBUTE_TYPE #define ck_attribute _CK_ATTRIBUTE #define value pValue #define value_len ulValueLen #define ck_date _CK_DATE #define ck_mechanism_type_t CK_MECHANISM_TYPE #define ck_mechanism _CK_MECHANISM #define parameter pParameter #define parameter_len ulParameterLen #define ck_mechanism_info _CK_MECHANISM_INFO #define min_key_size ulMinKeySize #define max_key_size ulMaxKeySize #define ck_rv_t CK_RV #define ck_notify_t CK_NOTIFY #define ck_function_list _CK_FUNCTION_LIST #define ck_createmutex_t CK_CREATEMUTEX #define ck_destroymutex_t CK_DESTROYMUTEX #define ck_lockmutex_t CK_LOCKMUTEX #define ck_unlockmutex_t CK_UNLOCKMUTEX #define ck_c_initialize_args _CK_C_INITIALIZE_ARGS #define create_mutex CreateMutex #define destroy_mutex DestroyMutex #define lock_mutex LockMutex #define unlock_mutex UnlockMutex #define reserved pReserved #endif /* CRYPTOKI_COMPAT */ typedef unsigned long ck_flags_t; struct ck_version { unsigned char major; unsigned char minor; }; struct ck_info { struct ck_version cryptoki_version; unsigned char manufacturer_id[32]; ck_flags_t flags; unsigned char library_description[32]; struct ck_version library_version; }; typedef unsigned long ck_notification_t; #define CKN_SURRENDER (0UL) typedef unsigned long ck_slot_id_t; struct ck_slot_info { unsigned char slot_description[64]; unsigned char manufacturer_id[32]; ck_flags_t flags; struct ck_version hardware_version; struct ck_version firmware_version; }; #define CKF_TOKEN_PRESENT (1UL << 0) #define CKF_REMOVABLE_DEVICE (1UL << 1) #define CKF_HW_SLOT (1UL << 2) #define CKF_ARRAY_ATTRIBUTE (1UL << 30) struct ck_token_info { unsigned char label[32]; unsigned char manufacturer_id[32]; unsigned char model[16]; unsigned char serial_number[16]; ck_flags_t flags; unsigned long max_session_count; unsigned long session_count; unsigned long max_rw_session_count; unsigned long rw_session_count; unsigned long max_pin_len; unsigned long min_pin_len; unsigned long total_public_memory; unsigned long free_public_memory; unsigned long total_private_memory; unsigned long free_private_memory; struct ck_version hardware_version; struct ck_version firmware_version; unsigned char utc_time[16]; }; #define CKF_RNG (1UL << 0) #define CKF_WRITE_PROTECTED (1UL << 1) #define CKF_LOGIN_REQUIRED (1UL << 2) #define CKF_USER_PIN_INITIALIZED (1UL << 3) #define CKF_RESTORE_KEY_NOT_NEEDED (1UL << 5) #define CKF_CLOCK_ON_TOKEN (1UL << 6) #define CKF_PROTECTED_AUTHENTICATION_PATH (1UL << 8) #define CKF_DUAL_CRYPTO_OPERATIONS (1UL << 9) #define CKF_TOKEN_INITIALIZED (1UL << 10) #define CKF_SECONDARY_AUTHENTICATION (1UL << 11) #define CKF_USER_PIN_COUNT_LOW (1UL << 16) #define CKF_USER_PIN_FINAL_TRY (1UL << 17) #define CKF_USER_PIN_LOCKED (1UL << 18) #define CKF_USER_PIN_TO_BE_CHANGED (1UL << 19) #define CKF_SO_PIN_COUNT_LOW (1UL << 20) #define CKF_SO_PIN_FINAL_TRY (1UL << 21) #define CKF_SO_PIN_LOCKED (1UL << 22) #define CKF_SO_PIN_TO_BE_CHANGED (1UL << 23) #define CK_UNAVAILABLE_INFORMATION ((unsigned long) -1) #define CK_EFFECTIVELY_INFINITE (0UL) typedef unsigned long ck_session_handle_t; #define CK_INVALID_HANDLE (0UL) typedef unsigned long ck_user_type_t; #define CKU_SO (0UL) #define CKU_USER (1UL) #define CKU_CONTEXT_SPECIFIC (2UL) typedef unsigned long ck_state_t; #define CKS_RO_PUBLIC_SESSION (0UL) #define CKS_RO_USER_FUNCTIONS (1UL) #define CKS_RW_PUBLIC_SESSION (2UL) #define CKS_RW_USER_FUNCTIONS (3UL) #define CKS_RW_SO_FUNCTIONS (4UL) struct ck_session_info { ck_slot_id_t slot_id; ck_state_t state; ck_flags_t flags; unsigned long device_error; }; #define CKF_RW_SESSION (1UL << 1) #define CKF_SERIAL_SESSION (1UL << 2) typedef unsigned long ck_object_handle_t; typedef unsigned long ck_object_class_t; #define CKO_DATA (0UL) #define CKO_CERTIFICATE (1UL) #define CKO_PUBLIC_KEY (2UL) #define CKO_PRIVATE_KEY (3UL) #define CKO_SECRET_KEY (4UL) #define CKO_HW_FEATURE (5UL) #define CKO_DOMAIN_PARAMETERS (6UL) #define CKO_MECHANISM (7UL) #define CKO_VENDOR_DEFINED (1UL << 31) typedef unsigned long ck_hw_feature_type_t; #define CKH_MONOTONIC_COUNTER (1UL) #define CKH_CLOCK (2UL) #define CKH_USER_INTERFACE (3UL) #define CKH_VENDOR_DEFINED (1UL << 31) typedef unsigned long ck_key_type_t; #define CKK_RSA (0UL) #define CKK_DSA (1UL) #define CKK_DH (2UL) #define CKK_ECDSA (3UL) #define CKK_EC (3UL) #define CKK_X9_42_DH (4UL) #define CKK_KEA (5UL) #define CKK_GENERIC_SECRET (0x10UL) #define CKK_RC2 (0x11UL) #define CKK_RC4 (0x12UL) #define CKK_DES (0x13UL) #define CKK_DES2 (0x14UL) #define CKK_DES3 (0x15UL) #define CKK_CAST (0x16UL) #define CKK_CAST3 (0x17UL) #define CKK_CAST128 (0x18UL) #define CKK_RC5 (0x19UL) #define CKK_IDEA (0x1aUL) #define CKK_SKIPJACK (0x1bUL) #define CKK_BATON (0x1cUL) #define CKK_JUNIPER (0x1dUL) #define CKK_CDMF (0x1eUL) #define CKK_AES (0x1fUL) #define CKK_BLOWFISH (0x20UL) #define CKK_TWOFISH (0x21UL) #define CKK_GOSTR3410 (0x30UL) #define CKK_VENDOR_DEFINED (1UL << 31) typedef unsigned long ck_certificate_type_t; #define CKC_X_509 (0UL) #define CKC_X_509_ATTR_CERT (1UL) #define CKC_WTLS (2UL) #define CKC_VENDOR_DEFINED (1UL << 31) typedef unsigned long ck_attribute_type_t; #define CKA_CLASS (0UL) #define CKA_TOKEN (1UL) #define CKA_PRIVATE (2UL) #define CKA_LABEL (3UL) #define CKA_APPLICATION (0x10UL) #define CKA_VALUE (0x11UL) #define CKA_OBJECT_ID (0x12UL) #define CKA_CERTIFICATE_TYPE (0x80UL) #define CKA_ISSUER (0x81UL) #define CKA_SERIAL_NUMBER (0x82UL) #define CKA_AC_ISSUER (0x83UL) #define CKA_OWNER (0x84UL) #define CKA_ATTR_TYPES (0x85UL) #define CKA_TRUSTED (0x86UL) #define CKA_CERTIFICATE_CATEGORY (0x87UL) #define CKA_JAVA_MIDP_SECURITY_DOMAIN (0x88UL) #define CKA_URL (0x89UL) #define CKA_HASH_OF_SUBJECT_PUBLIC_KEY (0x8aUL) #define CKA_HASH_OF_ISSUER_PUBLIC_KEY (0x8bUL) #define CKA_CHECK_VALUE (0x90UL) #define CKA_KEY_TYPE (0x100UL) #define CKA_SUBJECT (0x101UL) #define CKA_ID (0x102UL) #define CKA_SENSITIVE (0x103UL) #define CKA_ENCRYPT (0x104UL) #define CKA_DECRYPT (0x105UL) #define CKA_WRAP (0x106UL) #define CKA_UNWRAP (0x107UL) #define CKA_SIGN (0x108UL) #define CKA_SIGN_RECOVER (0x109UL) #define CKA_VERIFY (0x10aUL) #define CKA_VERIFY_RECOVER (0x10bUL) #define CKA_DERIVE (0x10cUL) #define CKA_START_DATE (0x110UL) #define CKA_END_DATE (0x111UL) #define CKA_MODULUS (0x120UL) #define CKA_MODULUS_BITS (0x121UL) #define CKA_PUBLIC_EXPONENT (0x122UL) #define CKA_PRIVATE_EXPONENT (0x123UL) #define CKA_PRIME_1 (0x124UL) #define CKA_PRIME_2 (0x125UL) #define CKA_EXPONENT_1 (0x126UL) #define CKA_EXPONENT_2 (0x127UL) #define CKA_COEFFICIENT (0x128UL) #define CKA_PRIME (0x130UL) #define CKA_SUBPRIME (0x131UL) #define CKA_BASE (0x132UL) #define CKA_PRIME_BITS (0x133UL) #define CKA_SUB_PRIME_BITS (0x134UL) #define CKA_VALUE_BITS (0x160UL) #define CKA_VALUE_LEN (0x161UL) #define CKA_EXTRACTABLE (0x162UL) #define CKA_LOCAL (0x163UL) #define CKA_NEVER_EXTRACTABLE (0x164UL) #define CKA_ALWAYS_SENSITIVE (0x165UL) #define CKA_KEY_GEN_MECHANISM (0x166UL) #define CKA_MODIFIABLE (0x170UL) #define CKA_ECDSA_PARAMS (0x180UL) #define CKA_EC_PARAMS (0x180UL) #define CKA_EC_POINT (0x181UL) #define CKA_SECONDARY_AUTH (0x200UL) #define CKA_AUTH_PIN_FLAGS (0x201UL) #define CKA_ALWAYS_AUTHENTICATE (0x202UL) #define CKA_WRAP_WITH_TRUSTED (0x210UL) #define CKA_GOSTR3410_PARAMS (0x250UL) #define CKA_GOSTR3411_PARAMS (0x251UL) #define CKA_GOST28147_PARAMS (0x252UL) #define CKA_HW_FEATURE_TYPE (0x300UL) #define CKA_RESET_ON_INIT (0x301UL) #define CKA_HAS_RESET (0x302UL) #define CKA_PIXEL_X (0x400UL) #define CKA_PIXEL_Y (0x401UL) #define CKA_RESOLUTION (0x402UL) #define CKA_CHAR_ROWS (0x403UL) #define CKA_CHAR_COLUMNS (0x404UL) #define CKA_COLOR (0x405UL) #define CKA_BITS_PER_PIXEL (0x406UL) #define CKA_CHAR_SETS (0x480UL) #define CKA_ENCODING_METHODS (0x481UL) #define CKA_MIME_TYPES (0x482UL) #define CKA_MECHANISM_TYPE (0x500UL) #define CKA_REQUIRED_CMS_ATTRIBUTES (0x501UL) #define CKA_DEFAULT_CMS_ATTRIBUTES (0x502UL) #define CKA_SUPPORTED_CMS_ATTRIBUTES (0x503UL) #define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x211UL) #define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x212UL) #define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x600UL) #define CKA_VENDOR_DEFINED (1UL << 31) struct ck_attribute { ck_attribute_type_t type; void *value; unsigned long value_len; }; struct ck_date { unsigned char year[4]; unsigned char month[2]; unsigned char day[2]; }; typedef unsigned long ck_mechanism_type_t; #define CKM_RSA_PKCS_KEY_PAIR_GEN (0UL) #define CKM_RSA_PKCS (1UL) #define CKM_RSA_9796 (2UL) #define CKM_RSA_X_509 (3UL) #define CKM_MD2_RSA_PKCS (4UL) #define CKM_MD5_RSA_PKCS (5UL) #define CKM_SHA1_RSA_PKCS (6UL) #define CKM_RIPEMD128_RSA_PKCS (7UL) #define CKM_RIPEMD160_RSA_PKCS (8UL) #define CKM_RSA_PKCS_OAEP (9UL) #define CKM_RSA_X9_31_KEY_PAIR_GEN (0xaUL) #define CKM_RSA_X9_31 (0xbUL) #define CKM_SHA1_RSA_X9_31 (0xcUL) #define CKM_RSA_PKCS_PSS (0xdUL) #define CKM_SHA1_RSA_PKCS_PSS (0xeUL) #define CKM_DSA_KEY_PAIR_GEN (0x10UL) #define CKM_DSA (0x11UL) #define CKM_DSA_SHA1 (0x12UL) #define CKM_DH_PKCS_KEY_PAIR_GEN (0x20UL) #define CKM_DH_PKCS_DERIVE (0x21UL) #define CKM_X9_42_DH_KEY_PAIR_GEN (0x30UL) #define CKM_X9_42_DH_DERIVE (0x31UL) #define CKM_X9_42_DH_HYBRID_DERIVE (0x32UL) #define CKM_X9_42_MQV_DERIVE (0x33UL) #define CKM_SHA256_RSA_PKCS (0x40UL) #define CKM_SHA384_RSA_PKCS (0x41UL) #define CKM_SHA512_RSA_PKCS (0x42UL) #define CKM_SHA256_RSA_PKCS_PSS (0x43UL) #define CKM_SHA384_RSA_PKCS_PSS (0x44UL) #define CKM_SHA512_RSA_PKCS_PSS (0x45UL) #define CKM_RC2_KEY_GEN (0x100UL) #define CKM_RC2_ECB (0x101UL) #define CKM_RC2_CBC (0x102UL) #define CKM_RC2_MAC (0x103UL) #define CKM_RC2_MAC_GENERAL (0x104UL) #define CKM_RC2_CBC_PAD (0x105UL) #define CKM_RC4_KEY_GEN (0x110UL) #define CKM_RC4 (0x111UL) #define CKM_DES_KEY_GEN (0x120UL) #define CKM_DES_ECB (0x121UL) #define CKM_DES_CBC (0x122UL) #define CKM_DES_MAC (0x123UL) #define CKM_DES_MAC_GENERAL (0x124UL) #define CKM_DES_CBC_PAD (0x125UL) #define CKM_DES2_KEY_GEN (0x130UL) #define CKM_DES3_KEY_GEN (0x131UL) #define CKM_DES3_ECB (0x132UL) #define CKM_DES3_CBC (0x133UL) #define CKM_DES3_MAC (0x134UL) #define CKM_DES3_MAC_GENERAL (0x135UL) #define CKM_DES3_CBC_PAD (0x136UL) #define CKM_CDMF_KEY_GEN (0x140UL) #define CKM_CDMF_ECB (0x141UL) #define CKM_CDMF_CBC (0x142UL) #define CKM_CDMF_MAC (0x143UL) #define CKM_CDMF_MAC_GENERAL (0x144UL) #define CKM_CDMF_CBC_PAD (0x145UL) #define CKM_MD2 (0x200UL) #define CKM_MD2_HMAC (0x201UL) #define CKM_MD2_HMAC_GENERAL (0x202UL) #define CKM_MD5 (0x210UL) #define CKM_MD5_HMAC (0x211UL) #define CKM_MD5_HMAC_GENERAL (0x212UL) #define CKM_SHA_1 (0x220UL) #define CKM_SHA_1_HMAC (0x221UL) #define CKM_SHA_1_HMAC_GENERAL (0x222UL) #define CKM_RIPEMD128 (0x230UL) #define CKM_RIPEMD128_HMAC (0x231UL) #define CKM_RIPEMD128_HMAC_GENERAL (0x232UL) #define CKM_RIPEMD160 (0x240UL) #define CKM_RIPEMD160_HMAC (0x241UL) #define CKM_RIPEMD160_HMAC_GENERAL (0x242UL) #define CKM_SHA256 (0x250UL) #define CKM_SHA256_HMAC (0x251UL) #define CKM_SHA256_HMAC_GENERAL (0x252UL) #define CKM_SHA384 (0x260UL) #define CKM_SHA384_HMAC (0x261UL) #define CKM_SHA384_HMAC_GENERAL (0x262UL) #define CKM_SHA512 (0x270UL) #define CKM_SHA512_HMAC (0x271UL) #define CKM_SHA512_HMAC_GENERAL (0x272UL) #define CKM_CAST_KEY_GEN (0x300UL) #define CKM_CAST_ECB (0x301UL) #define CKM_CAST_CBC (0x302UL) #define CKM_CAST_MAC (0x303UL) #define CKM_CAST_MAC_GENERAL (0x304UL) #define CKM_CAST_CBC_PAD (0x305UL) #define CKM_CAST3_KEY_GEN (0x310UL) #define CKM_CAST3_ECB (0x311UL) #define CKM_CAST3_CBC (0x312UL) #define CKM_CAST3_MAC (0x313UL) #define CKM_CAST3_MAC_GENERAL (0x314UL) #define CKM_CAST3_CBC_PAD (0x315UL) #define CKM_CAST5_KEY_GEN (0x320UL) #define CKM_CAST128_KEY_GEN (0x320UL) #define CKM_CAST5_ECB (0x321UL) #define CKM_CAST128_ECB (0x321UL) #define CKM_CAST5_CBC (0x322UL) #define CKM_CAST128_CBC (0x322UL) #define CKM_CAST5_MAC (0x323UL) #define CKM_CAST128_MAC (0x323UL) #define CKM_CAST5_MAC_GENERAL (0x324UL) #define CKM_CAST128_MAC_GENERAL (0x324UL) #define CKM_CAST5_CBC_PAD (0x325UL) #define CKM_CAST128_CBC_PAD (0x325UL) #define CKM_RC5_KEY_GEN (0x330UL) #define CKM_RC5_ECB (0x331UL) #define CKM_RC5_CBC (0x332UL) #define CKM_RC5_MAC (0x333UL) #define CKM_RC5_MAC_GENERAL (0x334UL) #define CKM_RC5_CBC_PAD (0x335UL) #define CKM_IDEA_KEY_GEN (0x340UL) #define CKM_IDEA_ECB (0x341UL) #define CKM_IDEA_CBC (0x342UL) #define CKM_IDEA_MAC (0x343UL) #define CKM_IDEA_MAC_GENERAL (0x344UL) #define CKM_IDEA_CBC_PAD (0x345UL) #define CKM_GENERIC_SECRET_KEY_GEN (0x350UL) #define CKM_CONCATENATE_BASE_AND_KEY (0x360UL) #define CKM_CONCATENATE_BASE_AND_DATA (0x362UL) #define CKM_CONCATENATE_DATA_AND_BASE (0x363UL) #define CKM_XOR_BASE_AND_DATA (0x364UL) #define CKM_EXTRACT_KEY_FROM_KEY (0x365UL) #define CKM_SSL3_PRE_MASTER_KEY_GEN (0x370UL) #define CKM_SSL3_MASTER_KEY_DERIVE (0x371UL) #define CKM_SSL3_KEY_AND_MAC_DERIVE (0x372UL) #define CKM_SSL3_MASTER_KEY_DERIVE_DH (0x373UL) #define CKM_TLS_PRE_MASTER_KEY_GEN (0x374UL) #define CKM_TLS_MASTER_KEY_DERIVE (0x375UL) #define CKM_TLS_KEY_AND_MAC_DERIVE (0x376UL) #define CKM_TLS_MASTER_KEY_DERIVE_DH (0x377UL) #define CKM_SSL3_MD5_MAC (0x380UL) #define CKM_SSL3_SHA1_MAC (0x381UL) #define CKM_MD5_KEY_DERIVATION (0x390UL) #define CKM_MD2_KEY_DERIVATION (0x391UL) #define CKM_SHA1_KEY_DERIVATION (0x392UL) #define CKM_PBE_MD2_DES_CBC (0x3a0UL) #define CKM_PBE_MD5_DES_CBC (0x3a1UL) #define CKM_PBE_MD5_CAST_CBC (0x3a2UL) #define CKM_PBE_MD5_CAST3_CBC (0x3a3UL) #define CKM_PBE_MD5_CAST5_CBC (0x3a4UL) #define CKM_PBE_MD5_CAST128_CBC (0x3a4UL) #define CKM_PBE_SHA1_CAST5_CBC (0x3a5UL) #define CKM_PBE_SHA1_CAST128_CBC (0x3a5UL) #define CKM_PBE_SHA1_RC4_128 (0x3a6UL) #define CKM_PBE_SHA1_RC4_40 (0x3a7UL) #define CKM_PBE_SHA1_DES3_EDE_CBC (0x3a8UL) #define CKM_PBE_SHA1_DES2_EDE_CBC (0x3a9UL) #define CKM_PBE_SHA1_RC2_128_CBC (0x3aaUL) #define CKM_PBE_SHA1_RC2_40_CBC (0x3abUL) #define CKM_PKCS5_PBKD2 (0x3b0UL) #define CKM_PBA_SHA1_WITH_SHA1_HMAC (0x3c0UL) #define CKM_KEY_WRAP_LYNKS (0x400UL) #define CKM_KEY_WRAP_SET_OAEP (0x401UL) #define CKM_SKIPJACK_KEY_GEN (0x1000UL) #define CKM_SKIPJACK_ECB64 (0x1001UL) #define CKM_SKIPJACK_CBC64 (0x1002UL) #define CKM_SKIPJACK_OFB64 (0x1003UL) #define CKM_SKIPJACK_CFB64 (0x1004UL) #define CKM_SKIPJACK_CFB32 (0x1005UL) #define CKM_SKIPJACK_CFB16 (0x1006UL) #define CKM_SKIPJACK_CFB8 (0x1007UL) #define CKM_SKIPJACK_WRAP (0x1008UL) #define CKM_SKIPJACK_PRIVATE_WRAP (0x1009UL) #define CKM_SKIPJACK_RELAYX (0x100aUL) #define CKM_KEA_KEY_PAIR_GEN (0x1010UL) #define CKM_KEA_KEY_DERIVE (0x1011UL) #define CKM_FORTEZZA_TIMESTAMP (0x1020UL) #define CKM_BATON_KEY_GEN (0x1030UL) #define CKM_BATON_ECB128 (0x1031UL) #define CKM_BATON_ECB96 (0x1032UL) #define CKM_BATON_CBC128 (0x1033UL) #define CKM_BATON_COUNTER (0x1034UL) #define CKM_BATON_SHUFFLE (0x1035UL) #define CKM_BATON_WRAP (0x1036UL) #define CKM_ECDSA_KEY_PAIR_GEN (0x1040UL) #define CKM_EC_KEY_PAIR_GEN (0x1040UL) #define CKM_ECDSA (0x1041UL) #define CKM_ECDSA_SHA1 (0x1042UL) #define CKM_ECDH1_DERIVE (0x1050UL) #define CKM_ECDH1_COFACTOR_DERIVE (0x1051UL) #define CKM_ECMQV_DERIVE (0x1052UL) #define CKM_JUNIPER_KEY_GEN (0x1060UL) #define CKM_JUNIPER_ECB128 (0x1061UL) #define CKM_JUNIPER_CBC128 (0x1062UL) #define CKM_JUNIPER_COUNTER (0x1063UL) #define CKM_JUNIPER_SHUFFLE (0x1064UL) #define CKM_JUNIPER_WRAP (0x1065UL) #define CKM_FASTHASH (0x1070UL) #define CKM_AES_KEY_GEN (0x1080UL) #define CKM_AES_ECB (0x1081UL) #define CKM_AES_CBC (0x1082UL) #define CKM_AES_MAC (0x1083UL) #define CKM_AES_MAC_GENERAL (0x1084UL) #define CKM_AES_CBC_PAD (0x1085UL) #define CKM_GOSTR3410_KEY_PAIR_GEN (0x1200UL) #define CKM_GOSTR3410 (0x1201UL) #define CKM_GOSTR3410_WITH_GOSTR3411 (0x1202UL) #define CKM_GOSTR3411 (0x1210UL) #define CKM_DSA_PARAMETER_GEN (0x2000UL) #define CKM_DH_PKCS_PARAMETER_GEN (0x2001UL) #define CKM_X9_42_DH_PARAMETER_GEN (0x2002UL) #define CKM_VENDOR_DEFINED (1UL << 31) struct ck_mechanism { ck_mechanism_type_t mechanism; void *parameter; unsigned long parameter_len; }; struct ck_mechanism_info { unsigned long min_key_size; unsigned long max_key_size; ck_flags_t flags; }; #define CKF_HW (1UL << 0) #define CKF_ENCRYPT (1UL << 8) #define CKF_DECRYPT (1UL << 9) #define CKF_DIGEST (1UL << 10) #define CKF_SIGN (1UL << 11) #define CKF_SIGN_RECOVER (1UL << 12) #define CKF_VERIFY (1UL << 13) #define CKF_VERIFY_RECOVER (1UL << 14) #define CKF_GENERATE (1UL << 15) #define CKF_GENERATE_KEY_PAIR (1UL << 16) #define CKF_WRAP (1UL << 17) #define CKF_UNWRAP (1UL << 18) #define CKF_DERIVE (1UL << 19) #define CKF_EXTENSION (1UL << 31) /* Flags for C_WaitForSlotEvent. */ #define CKF_DONT_BLOCK (1UL) typedef unsigned long ck_rv_t; typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session, ck_notification_t event, void *application); /* Forward reference. */ struct ck_function_list; #define _CK_DECLARE_FUNCTION(name, args) \ typedef ck_rv_t (*CK_ ## name) args; \ ck_rv_t CK_SPEC name args _CK_DECLARE_FUNCTION (C_Initialize, (void *init_args)); _CK_DECLARE_FUNCTION (C_Finalize, (void *reserved)); _CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info)); _CK_DECLARE_FUNCTION (C_GetFunctionList, (struct ck_function_list **function_list)); _CK_DECLARE_FUNCTION (C_GetSlotList, (unsigned char token_present, ck_slot_id_t *slot_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetSlotInfo, (ck_slot_id_t slot_id, struct ck_slot_info *info)); _CK_DECLARE_FUNCTION (C_GetTokenInfo, (ck_slot_id_t slot_id, struct ck_token_info *info)); _CK_DECLARE_FUNCTION (C_WaitForSlotEvent, (ck_flags_t flags, ck_slot_id_t *slot, void *reserved)); _CK_DECLARE_FUNCTION (C_GetMechanismList, (ck_slot_id_t slot_id, ck_mechanism_type_t *mechanism_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetMechanismInfo, (ck_slot_id_t slot_id, ck_mechanism_type_t type, struct ck_mechanism_info *info)); _CK_DECLARE_FUNCTION (C_InitToken, (ck_slot_id_t slot_id, unsigned char *pin, unsigned long pin_len, unsigned char *label)); _CK_DECLARE_FUNCTION (C_InitPIN, (ck_session_handle_t session, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_SetPIN, (ck_session_handle_t session, unsigned char *old_pin, unsigned long old_len, unsigned char *new_pin, unsigned long new_len)); _CK_DECLARE_FUNCTION (C_OpenSession, (ck_slot_id_t slot_id, ck_flags_t flags, void *application, ck_notify_t notify, ck_session_handle_t *session)); _CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id)); _CK_DECLARE_FUNCTION (C_GetSessionInfo, (ck_session_handle_t session, struct ck_session_info *info)); _CK_DECLARE_FUNCTION (C_GetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long *operation_state_len)); _CK_DECLARE_FUNCTION (C_SetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long operation_state_len, ck_object_handle_t encryption_key, ck_object_handle_t authentiation_key)); _CK_DECLARE_FUNCTION (C_Login, (ck_session_handle_t session, ck_user_type_t user_type, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CreateObject, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *object)); _CK_DECLARE_FUNCTION (C_CopyObject, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *new_object)); _CK_DECLARE_FUNCTION (C_DestroyObject, (ck_session_handle_t session, ck_object_handle_t object)); _CK_DECLARE_FUNCTION (C_GetObjectSize, (ck_session_handle_t session, ck_object_handle_t object, unsigned long *size)); _CK_DECLARE_FUNCTION (C_GetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_SetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjectsInit, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjects, (ck_session_handle_t session, ck_object_handle_t *object, unsigned long max_object_count, unsigned long *object_count)); _CK_DECLARE_FUNCTION (C_FindObjectsFinal, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_EncryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Encrypt, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *encrypted_data, unsigned long *encrypted_data_len)); _CK_DECLARE_FUNCTION (C_EncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_EncryptFinal, (ck_session_handle_t session, unsigned char *last_encrypted_part, unsigned long *last_encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Decrypt, (ck_session_handle_t session, unsigned char *encrypted_data, unsigned long encrypted_data_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DecryptUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_DecryptFinal, (ck_session_handle_t session, unsigned char *last_part, unsigned long *last_part_len)); _CK_DECLARE_FUNCTION (C_DigestInit, (ck_session_handle_t session, struct ck_mechanism *mechanism)); _CK_DECLARE_FUNCTION (C_Digest, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_DigestUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_DigestKey, (ck_session_handle_t session, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_DigestFinal, (ck_session_handle_t session, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_SignInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Sign, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_SignFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_SignRecover, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_VerifyInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Verify, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_VerifyFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_VerifyRecover, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DigestEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptDigestUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_SignEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_GenerateKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_GenerateKeyPair, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *public_key_template, unsigned long public_key_attribute_count, struct ck_attribute *private_key_template, unsigned long private_key_attribute_count, ck_object_handle_t *public_key, ck_object_handle_t *private_key)); _CK_DECLARE_FUNCTION (C_WrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t wrapping_key, ck_object_handle_t key, unsigned char *wrapped_key, unsigned long *wrapped_key_len)); _CK_DECLARE_FUNCTION (C_UnwrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t unwrapping_key, unsigned char *wrapped_key, unsigned long wrapped_key_len, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_DeriveKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t base_key, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_SeedRandom, (ck_session_handle_t session, unsigned char *seed, unsigned long seed_len)); _CK_DECLARE_FUNCTION (C_GenerateRandom, (ck_session_handle_t session, unsigned char *random_data, unsigned long random_len)); _CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session)); struct ck_function_list { struct ck_version version; CK_C_Initialize C_Initialize; CK_C_Finalize C_Finalize; CK_C_GetInfo C_GetInfo; CK_C_GetFunctionList C_GetFunctionList; CK_C_GetSlotList C_GetSlotList; CK_C_GetSlotInfo C_GetSlotInfo; CK_C_GetTokenInfo C_GetTokenInfo; CK_C_GetMechanismList C_GetMechanismList; CK_C_GetMechanismInfo C_GetMechanismInfo; CK_C_InitToken C_InitToken; CK_C_InitPIN C_InitPIN; CK_C_SetPIN C_SetPIN; CK_C_OpenSession C_OpenSession; CK_C_CloseSession C_CloseSession; CK_C_CloseAllSessions C_CloseAllSessions; CK_C_GetSessionInfo C_GetSessionInfo; CK_C_GetOperationState C_GetOperationState; CK_C_SetOperationState C_SetOperationState; CK_C_Login C_Login; CK_C_Logout C_Logout; CK_C_CreateObject C_CreateObject; CK_C_CopyObject C_CopyObject; CK_C_DestroyObject C_DestroyObject; CK_C_GetObjectSize C_GetObjectSize; CK_C_GetAttributeValue C_GetAttributeValue; CK_C_SetAttributeValue C_SetAttributeValue; CK_C_FindObjectsInit C_FindObjectsInit; CK_C_FindObjects C_FindObjects; CK_C_FindObjectsFinal C_FindObjectsFinal; CK_C_EncryptInit C_EncryptInit; CK_C_Encrypt C_Encrypt; CK_C_EncryptUpdate C_EncryptUpdate; CK_C_EncryptFinal C_EncryptFinal; CK_C_DecryptInit C_DecryptInit; CK_C_Decrypt C_Decrypt; CK_C_DecryptUpdate C_DecryptUpdate; CK_C_DecryptFinal C_DecryptFinal; CK_C_DigestInit C_DigestInit; CK_C_Digest C_Digest; CK_C_DigestUpdate C_DigestUpdate; CK_C_DigestKey C_DigestKey; CK_C_DigestFinal C_DigestFinal; CK_C_SignInit C_SignInit; CK_C_Sign C_Sign; CK_C_SignUpdate C_SignUpdate; CK_C_SignFinal C_SignFinal; CK_C_SignRecoverInit C_SignRecoverInit; CK_C_SignRecover C_SignRecover; CK_C_VerifyInit C_VerifyInit; CK_C_Verify C_Verify; CK_C_VerifyUpdate C_VerifyUpdate; CK_C_VerifyFinal C_VerifyFinal; CK_C_VerifyRecoverInit C_VerifyRecoverInit; CK_C_VerifyRecover C_VerifyRecover; CK_C_DigestEncryptUpdate C_DigestEncryptUpdate; CK_C_DecryptDigestUpdate C_DecryptDigestUpdate; CK_C_SignEncryptUpdate C_SignEncryptUpdate; CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate; CK_C_GenerateKey C_GenerateKey; CK_C_GenerateKeyPair C_GenerateKeyPair; CK_C_WrapKey C_WrapKey; CK_C_UnwrapKey C_UnwrapKey; CK_C_DeriveKey C_DeriveKey; CK_C_SeedRandom C_SeedRandom; CK_C_GenerateRandom C_GenerateRandom; CK_C_GetFunctionStatus C_GetFunctionStatus; CK_C_CancelFunction C_CancelFunction; CK_C_WaitForSlotEvent C_WaitForSlotEvent; }; typedef ck_rv_t (*ck_createmutex_t) (void **mutex); typedef ck_rv_t (*ck_destroymutex_t) (void *mutex); typedef ck_rv_t (*ck_lockmutex_t) (void *mutex); typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex); struct ck_c_initialize_args { ck_createmutex_t create_mutex; ck_destroymutex_t destroy_mutex; ck_lockmutex_t lock_mutex; ck_unlockmutex_t unlock_mutex; ck_flags_t flags; void *reserved; }; #define CKF_LIBRARY_CANT_CREATE_OS_THREADS (1UL << 0) #define CKF_OS_LOCKING_OK (1UL << 1) #define CKR_OK (0UL) #define CKR_CANCEL (1UL) #define CKR_HOST_MEMORY (2UL) #define CKR_SLOT_ID_INVALID (3UL) #define CKR_GENERAL_ERROR (5UL) #define CKR_FUNCTION_FAILED (6UL) #define CKR_ARGUMENTS_BAD (7UL) #define CKR_NO_EVENT (8UL) #define CKR_NEED_TO_CREATE_THREADS (9UL) #define CKR_CANT_LOCK (0xaUL) #define CKR_ATTRIBUTE_READ_ONLY (0x10UL) #define CKR_ATTRIBUTE_SENSITIVE (0x11UL) #define CKR_ATTRIBUTE_TYPE_INVALID (0x12UL) #define CKR_ATTRIBUTE_VALUE_INVALID (0x13UL) #define CKR_DATA_INVALID (0x20UL) #define CKR_DATA_LEN_RANGE (0x21UL) #define CKR_DEVICE_ERROR (0x30UL) #define CKR_DEVICE_MEMORY (0x31UL) #define CKR_DEVICE_REMOVED (0x32UL) #define CKR_ENCRYPTED_DATA_INVALID (0x40UL) #define CKR_ENCRYPTED_DATA_LEN_RANGE (0x41UL) #define CKR_FUNCTION_CANCELED (0x50UL) #define CKR_FUNCTION_NOT_PARALLEL (0x51UL) #define CKR_FUNCTION_NOT_SUPPORTED (0x54UL) #define CKR_KEY_HANDLE_INVALID (0x60UL) #define CKR_KEY_SIZE_RANGE (0x62UL) #define CKR_KEY_TYPE_INCONSISTENT (0x63UL) #define CKR_KEY_NOT_NEEDED (0x64UL) #define CKR_KEY_CHANGED (0x65UL) #define CKR_KEY_NEEDED (0x66UL) #define CKR_KEY_INDIGESTIBLE (0x67UL) #define CKR_KEY_FUNCTION_NOT_PERMITTED (0x68UL) #define CKR_KEY_NOT_WRAPPABLE (0x69UL) #define CKR_KEY_UNEXTRACTABLE (0x6aUL) #define CKR_MECHANISM_INVALID (0x70UL) #define CKR_MECHANISM_PARAM_INVALID (0x71UL) #define CKR_OBJECT_HANDLE_INVALID (0x82UL) #define CKR_OPERATION_ACTIVE (0x90UL) #define CKR_OPERATION_NOT_INITIALIZED (0x91UL) #define CKR_PIN_INCORRECT (0xa0UL) #define CKR_PIN_INVALID (0xa1UL) #define CKR_PIN_LEN_RANGE (0xa2UL) #define CKR_PIN_EXPIRED (0xa3UL) #define CKR_PIN_LOCKED (0xa4UL) #define CKR_SESSION_CLOSED (0xb0UL) #define CKR_SESSION_COUNT (0xb1UL) #define CKR_SESSION_HANDLE_INVALID (0xb3UL) #define CKR_SESSION_PARALLEL_NOT_SUPPORTED (0xb4UL) #define CKR_SESSION_READ_ONLY (0xb5UL) #define CKR_SESSION_EXISTS (0xb6UL) #define CKR_SESSION_READ_ONLY_EXISTS (0xb7UL) #define CKR_SESSION_READ_WRITE_SO_EXISTS (0xb8UL) #define CKR_SIGNATURE_INVALID (0xc0UL) #define CKR_SIGNATURE_LEN_RANGE (0xc1UL) #define CKR_TEMPLATE_INCOMPLETE (0xd0UL) #define CKR_TEMPLATE_INCONSISTENT (0xd1UL) #define CKR_TOKEN_NOT_PRESENT (0xe0UL) #define CKR_TOKEN_NOT_RECOGNIZED (0xe1UL) #define CKR_TOKEN_WRITE_PROTECTED (0xe2UL) #define CKR_UNWRAPPING_KEY_HANDLE_INVALID (0xf0UL) #define CKR_UNWRAPPING_KEY_SIZE_RANGE (0xf1UL) #define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT (0xf2UL) #define CKR_USER_ALREADY_LOGGED_IN (0x100UL) #define CKR_USER_NOT_LOGGED_IN (0x101UL) #define CKR_USER_PIN_NOT_INITIALIZED (0x102UL) #define CKR_USER_TYPE_INVALID (0x103UL) #define CKR_USER_ANOTHER_ALREADY_LOGGED_IN (0x104UL) #define CKR_USER_TOO_MANY_TYPES (0x105UL) #define CKR_WRAPPED_KEY_INVALID (0x110UL) #define CKR_WRAPPED_KEY_LEN_RANGE (0x112UL) #define CKR_WRAPPING_KEY_HANDLE_INVALID (0x113UL) #define CKR_WRAPPING_KEY_SIZE_RANGE (0x114UL) #define CKR_WRAPPING_KEY_TYPE_INCONSISTENT (0x115UL) #define CKR_RANDOM_SEED_NOT_SUPPORTED (0x120UL) #define CKR_RANDOM_NO_RNG (0x121UL) #define CKR_DOMAIN_PARAMS_INVALID (0x130UL) #define CKR_BUFFER_TOO_SMALL (0x150UL) #define CKR_SAVED_STATE_INVALID (0x160UL) #define CKR_INFORMATION_SENSITIVE (0x170UL) #define CKR_STATE_UNSAVEABLE (0x180UL) #define CKR_CRYPTOKI_NOT_INITIALIZED (0x190UL) #define CKR_CRYPTOKI_ALREADY_INITIALIZED (0x191UL) #define CKR_MUTEX_BAD (0x1a0UL) #define CKR_MUTEX_NOT_LOCKED (0x1a1UL) #define CKR_FUNCTION_REJECTED (0x200UL) #define CKR_VENDOR_DEFINED (1UL << 31) /* Compatibility layer. */ #ifdef CRYPTOKI_COMPAT #undef CK_DEFINE_FUNCTION #define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name /* For NULL. */ #include typedef unsigned char CK_BYTE; typedef unsigned char CK_CHAR; typedef unsigned char CK_UTF8CHAR; typedef unsigned char CK_BBOOL; typedef unsigned long int CK_ULONG; typedef long int CK_LONG; typedef CK_BYTE *CK_BYTE_PTR; typedef CK_CHAR *CK_CHAR_PTR; typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR; typedef CK_ULONG *CK_ULONG_PTR; typedef void *CK_VOID_PTR; typedef void **CK_VOID_PTR_PTR; #define CK_FALSE 0 #define CK_TRUE 1 #ifndef CK_DISABLE_TRUE_FALSE #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #endif typedef struct ck_version CK_VERSION; typedef struct ck_version *CK_VERSION_PTR; typedef struct ck_info CK_INFO; typedef struct ck_info *CK_INFO_PTR; typedef ck_slot_id_t *CK_SLOT_ID_PTR; typedef struct ck_slot_info CK_SLOT_INFO; typedef struct ck_slot_info *CK_SLOT_INFO_PTR; typedef struct ck_token_info CK_TOKEN_INFO; typedef struct ck_token_info *CK_TOKEN_INFO_PTR; typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR; typedef struct ck_session_info CK_SESSION_INFO; typedef struct ck_session_info *CK_SESSION_INFO_PTR; typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR; typedef ck_object_class_t *CK_OBJECT_CLASS_PTR; typedef struct ck_attribute CK_ATTRIBUTE; typedef struct ck_attribute *CK_ATTRIBUTE_PTR; typedef struct ck_date CK_DATE; typedef struct ck_date *CK_DATE_PTR; typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR; typedef struct ck_mechanism CK_MECHANISM; typedef struct ck_mechanism *CK_MECHANISM_PTR; typedef struct ck_mechanism_info CK_MECHANISM_INFO; typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR; typedef struct ck_function_list CK_FUNCTION_LIST; typedef struct ck_function_list *CK_FUNCTION_LIST_PTR; typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR; typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS; typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR; #define NULL_PTR NULL /* Delete the helper macros defined at the top of the file. */ #undef ck_flags_t #undef ck_version #undef ck_info #undef cryptoki_version #undef manufacturer_id #undef library_description #undef library_version #undef ck_notification_t #undef ck_slot_id_t #undef ck_slot_info #undef slot_description #undef hardware_version #undef firmware_version #undef ck_token_info #undef serial_number #undef max_session_count #undef session_count #undef max_rw_session_count #undef rw_session_count #undef max_pin_len #undef min_pin_len #undef total_public_memory #undef free_public_memory #undef total_private_memory #undef free_private_memory #undef utc_time #undef ck_session_handle_t #undef ck_user_type_t #undef ck_state_t #undef ck_session_info #undef slot_id #undef device_error #undef ck_object_handle_t #undef ck_object_class_t #undef ck_hw_feature_type_t #undef ck_key_type_t #undef ck_certificate_type_t #undef ck_attribute_type_t #undef ck_attribute #undef value #undef value_len #undef ck_date #undef ck_mechanism_type_t #undef ck_mechanism #undef parameter #undef parameter_len #undef ck_mechanism_info #undef min_key_size #undef max_key_size #undef ck_rv_t #undef ck_notify_t #undef ck_function_list #undef ck_createmutex_t #undef ck_destroymutex_t #undef ck_lockmutex_t #undef ck_unlockmutex_t #undef ck_c_initialize_args #undef create_mutex #undef destroy_mutex #undef lock_mutex #undef unlock_mutex #undef reserved #endif /* CRYPTOKI_COMPAT */ /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) #pragma pack(pop, cryptoki) #endif #if defined(__cplusplus) } #endif #endif /* PKCS11_H */ l2tp-ipsec-vpn/src/pkcs11/SmartCardInsertWaitTask.h0000664000175000017500000000271312040201226022556 0ustar wejaegerwejaeger/* * $Id: SmartCardInsertWaitTask.h 35 2011-01-28 01:43:49Z werner $ * * File: SmartCardInsertWaitTask.h * Author: Werner Jaeger * * Created on July 16, 2010, 7:08 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SMARTCARDINSERTWAITTASK_H #define SMARTCARDINSERTWAITTASK_H #include class Pkcs11; class SmartCardInsertWaitTask : public QThread { public: SmartCardInsertWaitTask(const Pkcs11& pkcs11); virtual ~SmartCardInsertWaitTask(); void run(); void stop() { m_fStop = true; wait(); } int result() const { return(m_iRet); } private: SmartCardInsertWaitTask(const SmartCardInsertWaitTask& orig); SmartCardInsertWaitTask& operator=(const SmartCardInsertWaitTask& orig); const Pkcs11& m_pkcs11; int m_iRet; volatile bool m_fStop; }; #endif /* SMARTCARDINSERTWAITTASK_H */ l2tp-ipsec-vpn/src/pkcs11/SmartCardState.h0000664000175000017500000000267112040201226020725 0ustar wejaegerwejaeger/* * $Id: SmartCardState.h 35 2011-01-28 01:43:49Z werner $ * * File: SmartCardState.h * Author: Werner Jaeger * * Created on July 16, 2010, 10:31 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SMARTCARDSTATE_H #define SMARTCARDSTATE_H #include class SmartCardInsertWaitTask; class QMessageBox; class SmartCardState : public QObject { Q_OBJECT public: explicit SmartCardState(QObject* pParent = 0); virtual ~SmartCardState(); int readersAvailable(); int waitForCardPresent(); signals: void cardInserted(); private slots: void waitTaskFinished(); private: SmartCardState(const SmartCardState& orig); SmartCardState& operator=(const SmartCardState& orig); SmartCardInsertWaitTask* m_pWaitTask; QMessageBox* m_pMsgBox; }; #endif /* SMARTCARDSTATE_H */ l2tp-ipsec-vpn/src/VPNControlTask.h0000664000175000017500000000524112040201227017566 0ustar wejaegerwejaeger/* * $Id: VPNControlTask.h 139 2012-05-08 18:07:50Z wejaeger $ * * File: VPNControlTask.h * Author: Werner Jaeger * * Created on July 8, 2010, 5:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef VPNCONTROLTASK_H #define VPNCONTROLTASK_H #include #include "VpnClientConnection.h" class QFile; class QByteArray; class QTextStream; class QSocketNotifier; class VpnControlDaemonClient; class VPNControlTask : public QThread { Q_OBJECT public: enum Action {Connect, Disconnect}; explicit VPNControlTask(QObject* pParent); virtual ~VPNControlTask(); void run(); bool stop(unsigned long iWaitMiliSeconds); void setConnectionName(const QString& strConnectionName); const QString& connectionName() const; void setAction(Action action); Action action() const; int restartPcscDaemon(); qint64 readLogLine(char* data, qint64 iMaxSize); qint64 readErrorLine(char* data, qint64 iMaxSize); signals: void readyReadLog(); void commandOutputReceived(const QString& strOutputLine); void errorMessageEmited(int iErrorCode); private slots: void readyReadVpnLogPipe(); void onResult(int iReturnCode, const QString& stCommand); void onCommandOutput(const QString& strOutputLine); private: VPNControlTask(const VPNControlTask& orig); VPNControlTask& operator=(const VPNControlTask& orig); bool createControlClient(); void deleteControlClient(); void runConnect(); void runDisconnect(); void runAndWait(VpnClientConnection::Command iCommand, const QString strArguments = ""); void emitErrorMsg(const QString& strErrorContext); void clearVpnLogPipe(); static bool plutoIsRunning(); VpnControlDaemonClient* m_pControlClient; QString m_strConnectionName; Action m_Action; volatile int m_iReturnCode; volatile bool m_fIPSecConnectionAdded; volatile bool m_fIPSecConnectionIsUp; QByteArray* const m_pByteArray; QTextStream* const m_pErrorStream; QSocketNotifier* m_pVpnLogPipeNotifier; static QFile m_vpnLogPipe; }; #endif /* VPNCONTROLTASK_H */ l2tp-ipsec-vpn/src/settings/0000775000175000017500000000000012040201226016423 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/settings/ConnectionSettings.h0000664000175000017500000002004212040201226022412 0ustar wejaegerwejaeger/* * $Id: ConnectionSettings.h 129 2012-04-07 10:15:46Z wejaeger $ * * File: ConnectionSettings.h * Author: Werner Jaeger * * Created on July 22, 2010, 10:14 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONNECTIONSETTINGS_H #define CONNECTIONSETTINGS_H #include "Settings.h" class QHostAddress; class CommonSettings; class IPSecSettings; class L2tpSettings; class PppSettings; class PppEapSettings; class PppIpSettings; class ConnectionSettings : public Settings { public: typedef enum { Ok, InvalidName, DuplicateName, ReadOnly } Result; ConnectionSettings(); virtual ~ConnectionSettings(); int connections() const; QString connection(int iConnectionNo) const; Result addConnection(const QString& strName) const; bool removeConnection(int iConnectionNo) const; QString gateway(const QString& strName) const; CommonSettings commonSettings(const QString& strName) const; IPSecSettings ipsecSettings(const QString& strName) const; L2tpSettings l2tpSettings(const QString& strName) const; PppSettings pppSettings(const QString& strName) const; int deleteAllConfFiles(); protected: explicit ConnectionSettings(int iConnectionNo); ConnectionSettings(const ConnectionSettings& orig); int connectionNo() const { return(m_iConnectionNo); } bool setValue(const QString& strValue, const QString& strPath) const; QString getStringValue(const QString& strPath) const; bool setSecret(const QString& strValue, const QString& strPath) const; QString getSecret(const QString& strPath) const; bool setValue(int iValue, const QString& strPath) const; int getIntValue(const QString& strPath, int iDefault = 0) const; bool setValue(bool fValue, const QString& strPath) const; bool getBoolValue(const QString& strPath, bool fDefault = false) const; bool setRouteProperty(const QString& strValue, int iRow, const QString& strPropertyName) const; QString routeProperty(int iRow, const QString& strPropertyName) const; private: ConnectionSettings& operator=(const ConnectionSettings& orig); int connection(const QString& strName) const; bool containsConnection(const QString& strName) const; Result validateName(const QString& strName) const; const int m_iConnectionNo; }; class CommonSettings : public ConnectionSettings { public: virtual ~CommonSettings() {} bool setAutoConnect(bool fAutoConnect) const; bool autoConnect() const; bool setDisableIPSecEncryption(bool fDisableIPSecEncryption) const; bool disableIPSecEncryption() const; private: explicit CommonSettings(int iConnectionNo) : ConnectionSettings(iConnectionNo) {} CommonSettings& operator=(const CommonSettings& orig); friend class ConnectionSettings; }; class IPSecSettings : public ConnectionSettings { public: virtual ~IPSecSettings() {} bool setGateway(const QString& strGateway) const; QString gateway() const; bool setIdentity(const QString& strIdentity) const; QString identity() const; bool setPreSharedKey(const QString& strPsk) const; QString preSharedKey() const; bool setCertificateFileName(const QString& strFileName) const; QString certificateFileName() const; bool setPrivateKeyFilePath(const QString& strFilePath) const; QString privateKeyFilePath() const; bool setPrivateKeyPassphrase(const QString& strPassphrase) const; QString privateKeyPassphrase() const; bool setAuthBy(const QString& strAuthBy) const; QString authBy() const; private: explicit IPSecSettings(int iConnectionNo) : ConnectionSettings(iConnectionNo) {} IPSecSettings& operator=(const IPSecSettings& orig); friend class ConnectionSettings; }; class L2tpSettings : public ConnectionSettings { public: virtual ~L2tpSettings() {} bool setLengthBit(bool fEnable) const; bool lengthBit() const; bool setRedial(bool fEnable) const; bool redial() const; bool setRedialTimeout(int iTimeout) const; int redialTimeout() const; bool setRedialAttempts(int iAttempts) const; int redialAttempts() const; private: explicit L2tpSettings(int iConnectionNo) : ConnectionSettings(iConnectionNo) {} L2tpSettings& operator=(const L2tpSettings& orig); friend class ConnectionSettings; }; class PppSettings : public ConnectionSettings { public: virtual ~PppSettings() {} PppEapSettings eapSettings() const; PppIpSettings ipSettings() const; bool setRefuseChap(bool fRefuse) const; bool refuseChap() const; bool setRefuseMsChap(bool fRefuse) const; bool refuseMsChap() const; bool setRefuseMsChapV2(bool fRefuse) const; bool refuseMsChapV2() const; bool setRefuseEap(bool fRefuse) const; bool refuseEap() const; bool setRefusePap(bool fRefuse) const; bool refusePap() const; bool setUserName(const QString& strUserName) const; QString userName() const; bool setPassword(const QString& strPassword) const; QString password() const; bool setRemoteName(const QString& strRemoteName) const; QString remoteName() const; // advanced settings bool setNoBSDCompression(bool fSet) const; bool noBSDCompression() const; bool setNoDeflate(bool fSet) const; bool noDeflate() const; bool setNoVj(bool fSet) const; bool noVj() const; bool setLcpEchoInterval(int iInterval) const; int lcpEchoInterval() const; private: explicit PppSettings(int iConnectionNo) : ConnectionSettings(iConnectionNo) {} PppSettings& operator=(const PppSettings& orig); friend class PppEapSettings; friend class PppIpSettings; friend class ConnectionSettings; }; class PppEapSettings : public PppSettings { public: virtual ~PppEapSettings() {} bool setUseSmartCard(bool fUse) const; bool useSmartCard() const; bool setCertificatePath(const QString& strCertificatePath) const; QString certificatePath() const; bool setPrivateKeyPath(const QString& strPrivateKeyPath) const; QString privateKeyPath() const; bool setPrivateKeyPassword(const QString& strPrivateKeyPassword) const; QString privateKeyPassword() const; bool setCaCertificatePath(const QString& strCaCertificatePath) const; QString caCertificatePath() const; private: explicit PppEapSettings(int iConnectionNo) : PppSettings(iConnectionNo) {} PppEapSettings& operator=(const PppEapSettings& orig); friend class PppSettings; }; class PppIpSettings : public PppSettings { public: virtual ~PppIpSettings() {} bool setUsePeerDns(bool fUse) const; bool usePeerDns() const; bool setPreferredDnsServerAddress(const QString& strPreferredDnsServerAddress) const; QString preferredDnsServerAddress() const; bool setAlternateDnsServerAddress(const QString& strAlternateDnsServerAddress) const; QString alternateDnsServerAddress() const; bool setSearchDomains(const QString& strSearchDomains) const; QString searchDomains() const; bool setUseDefaultGateway(bool fUse) const; bool useDefaultGateway() const; int routes() const; bool setRouteAddress(int iRow, const QString& strAddress) const; QString routeAddress(int iRow) const; bool setRouteNetmask(int iRow, const QString& strNetMask) const; QString routeNetmask(int iRow) const; bool setRouteComment(int iRow, const QString& strComment) const; QString routeComment(int iRow) const; bool addRoute() const; bool removeRoute(int iRow) const; private: explicit PppIpSettings(int iConnectionNo) : PppSettings(iConnectionNo) {} PppIpSettings& operator=(const PppIpSettings& orig); friend class PppSettings; }; #endif /* CONNECTIONSETTINGS_H */ l2tp-ipsec-vpn/src/settings/Preferences.h0000664000175000017500000000315412040201226021040 0ustar wejaegerwejaeger/* * $Id: Preferences.h 38 2011-02-05 02:01:47Z werner $ * * File: Preferences.h * Author: Werner Jaeger * * Created on August 9, 2010, 12:12 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PREFERENCES_H #define PREFERENCES_H #include "Settings.h" class OpenSSLSettings; class Preferences : public Settings { public: Preferences(); virtual ~Preferences(); OpenSSLSettings openSSLSettings() const; private: Preferences& operator=(const Preferences& orig); }; class OpenSSLSettings : public Preferences { public: virtual ~OpenSSLSettings() {} bool setEnginePath(const QString& strEnginePath) const; QString enginePath() const; bool setPkcs11Path(const QString& strModulePath) const; QString pkcs11Path() const; bool setEngineId(const QString& strEngineId) const; QString engineId() const; private: OpenSSLSettings() {} OpenSSLSettings& operator=(const OpenSSLSettings& orig); friend class Preferences; }; #endif /* PREFERENCES_H */ l2tp-ipsec-vpn/src/settings/Settings.h0000664000175000017500000000272412040201226020401 0ustar wejaegerwejaeger/* * $Id: Settings.h 47 2011-02-13 02:40:16Z werner $ * * File: Settings.h * Author: Werner Jaeger * * Created on August 9, 2010, 11:36 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SETTINGS_H #define SETTINGS_H #include #include #include class Settings { public: bool isWriteable() const; void clearChanged(); bool hasChanged() const; protected: Settings(); virtual ~Settings(); QSettings* qSettings() const { return(m_Settings.data()); } bool removeArrayItem(const QString& strArrayName, int iIndex) const; private: Settings& operator=(const Settings& orig); QDateTime lastModified() const; static QSettings* configureQSettings(); QSharedPointer const m_Settings; QDateTime m_PreviouslyLastModified; }; #endif /* SETTINGS_H */ l2tp-ipsec-vpn/src/settings/Preferences.cpp0000664000175000017500000000617512040201226021401 0ustar wejaegerwejaeger/* * $Id: Preferences.cpp 47 2011-02-13 02:40:16Z werner $ * * File: Preferences.cpp * Author: Werner Jaeger * * Created on August 9, 2010, 12:12 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "Preferences.h" #if defined(_WIN32) || defined(USE_CYGWIN) static const char* const EngineDefaultLibrary = "engine_pkcs11.dll"; static const char* const PKCS11DefaultLibrary = "opensc-pkcs11.dll"; #else static const char* const EngineDefaultLibrary = "/usr/lib/engines/engine_pkcs11.so"; static const char* const PKCS11DefaultLibrary = "/usr/lib/opensc-pkcs11.so"; #endif static const char* const DefaultEngineId = "pkcs11"; static const QString PREFERENCES = "Preferences"; static const QString OPENSSL = "OpenSSL"; static const QString ENGINEPATH = PREFERENCES + '/' + OPENSSL + '/' + "enginePath"; static const QString PKCS11PATH = PREFERENCES + '/' + OPENSSL + '/' + "pkcs11Path"; static const QString ENGINEID = PREFERENCES + '/' + OPENSSL + '/' + "engineId"; Preferences::Preferences() { } Preferences::~Preferences() { } OpenSSLSettings Preferences::openSSLSettings() const { return(OpenSSLSettings()); } bool OpenSSLSettings::setEnginePath(const QString& strEnginePath) const { if (strEnginePath != EngineDefaultLibrary) { if (qSettings()->value(ENGINEPATH) != strEnginePath) qSettings()->setValue(ENGINEPATH, strEnginePath); } else qSettings()->remove(ENGINEPATH); return(true); } QString OpenSSLSettings::enginePath() const { return(qSettings()->value(ENGINEPATH, QFile(EngineDefaultLibrary).exists() ? EngineDefaultLibrary : "").toString()); } bool OpenSSLSettings::setPkcs11Path(const QString& strModulePath) const { if (strModulePath != PKCS11DefaultLibrary) { if (qSettings()->value(PKCS11PATH) != strModulePath) qSettings()->setValue(PKCS11PATH, strModulePath); } else qSettings()->remove(PKCS11PATH); return(true); } QString OpenSSLSettings::pkcs11Path() const { return(qSettings()->value(PKCS11PATH, QFile(PKCS11DefaultLibrary).exists() ? PKCS11DefaultLibrary : "").toString()); } bool OpenSSLSettings::setEngineId(const QString& strEngineId) const { if (strEngineId != DefaultEngineId) { if (qSettings()->value(ENGINEID) != strEngineId) qSettings()->setValue(ENGINEID, strEngineId); } else qSettings()->remove(ENGINEID); return(true); } QString OpenSSLSettings::engineId() const { return(qSettings()->value(ENGINEID, DefaultEngineId).toString()); } l2tp-ipsec-vpn/src/settings/ConnectionSettings.cpp0000664000175000017500000005562412040201226022763 0ustar wejaegerwejaeger/* * $Id: ConnectionSettings.cpp 153 2012-10-11 04:47:46Z wejaeger $ * * File: ConnectionSettings.cpp * Author: Werner Jaeger * * Created on July 22, 2010, 10:14 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include "conf/ConfWriter.h" #include "models/ConnectionsModel.h" #include "util/EncSecrets.h" #include "ConnectionSettings.h" static unsigned char const KEY[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; static unsigned char const IV[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; static const char* const VALIDNAMEPATTERN = "^[a-zA-Z][0-9a-zA-Z\\-\\._]{0,29}$"; /** Arrays*/ static const QString CONNECTIONS = "Connections"; static const QString ROUTES = "Routes"; /** Groups */ static const QString COMMON = "Common"; static const QString IPSEC = "IPSec"; static const QString L2TP = "L2tp"; static const QString PPP = "Ppp"; static const QString EAP = "Ppp/Eap"; static const QString IP = "Ppp/Ip"; /** properties */ static const QString NAME = "name"; static const QString AUTOCONNECT = "auoConnect"; static const QString DISABLEIPSECENCRYPTION = "disableIPSecEncryption"; static const QString GATEWAY = "gateway"; static const QString IDENTITY = "identity"; static const QString USERNAME = "userName"; static const QString PASSWORD = "password"; static const QString REQUIREAUTH = "requireAuthentication"; static const QString CHAP = "chap"; static const QString PAP = "pap"; static const QString LENGTHBIT = "lengthBit"; static const QString REDIAL = "redial"; static const QString REDIALTIMEOUT = "redialTimeout"; static const QString REDIALATTEMPTS = "redialAttempts"; static const QString PSK = "psk"; static const QString CERTFN = "certFileName"; static const QString PRIVATEKEYFILEPATH = "privateKeyFilePath"; static const QString PRIVATEKEYPASSPHRASE = "privateKeyPassphrase"; static const QString AUTHBY = "authBy"; static const QString REFUSECHAP = "refuseChap"; static const QString REFUSEMSCHAP = "refuseMsChap"; static const QString REFUSEMSCHAPV2 = "refuseMsChapV2"; static const QString REFUSEEAP = "refuseEap"; static const QString REFUSEPAP = "refusePap"; static const QString REMOTENAME = "remoteName"; static const QString NODSDCOMP = "nobsdcomp"; static const QString NODEFLATE = "nodeflate"; static const QString NOVJ = "novj"; static const QString LCPECHOINTERVAL = "lcpEchoInterval"; static const QString USESMARTCARD = "useSmartCard"; static const QString CERTIFICATEPATH = "certificatePath"; static const QString PRIVATEKEYPATH = "privateKeyPath"; static const QString PRIVATEKEYPASSWORD = "privateKeyPassword"; static const QString CACERTIFICATEPATH = "caCertificatePath"; static const QString IPADDRESS = "ipAddress"; static const QString IPNETMASK = "ipNetMask"; static const QString COMMENT = "comment"; static const QString USEPEERDNS = "usePeerDns"; static const QString PREFERREDDNSSERVERADDRESS = "preferredDnsServerAddress"; static const QString ALTERNATEDNSSERVERADDRESS = "alternateDnsServerAddress"; static const QString SEARCHDOMAINS = "searchDomains"; static const QString USEDEFAULTGATEWAY = "useDefaultGateway"; ConnectionSettings::ConnectionSettings() : m_iConnectionNo(-1) { } ConnectionSettings::ConnectionSettings(int iConnectionNo) : m_iConnectionNo(iConnectionNo) { } ConnectionSettings::ConnectionSettings(const ConnectionSettings& orig) : Settings(), m_iConnectionNo(orig.connectionNo()) { } ConnectionSettings::~ConnectionSettings() { } int ConnectionSettings::connections() const { const int iSize(qSettings()->beginReadArray(CONNECTIONS)); qSettings()->endArray(); return(iSize); } ConnectionSettings::Result ConnectionSettings::addConnection(const QString& strName) const { const Result result(qSettings()->isWritable() ? validateName(strName): ReadOnly); if (result == Ok) { const int iSize(connections()); qSettings()->beginWriteArray(CONNECTIONS); qSettings()->setArrayIndex(iSize); qSettings()->setValue(NAME, strName); qSettings()->endArray(); } return(result); } bool ConnectionSettings::removeConnection(int iConnectionNo) const { bool fRet(iConnectionNo < connections() && qSettings()->isWritable()); if (fRet) { QFile pppOptFile(ConfWriter::fileName(ConfWriter::PPP, connection(iConnectionNo))); if (pppOptFile.exists()) pppOptFile.remove(); QFile pppDnsFile(ConfWriter::fileName(ConfWriter::PPPDNSCONF, QCoreApplication::instance()->objectName() + "-" + connection(iConnectionNo))); if (pppDnsFile.exists()) pppDnsFile.remove(); fRet = ConnectionSettings::removeArrayItem(CONNECTIONS, iConnectionNo); } return(fRet); } QString ConnectionSettings::gateway(const QString& strName) const { return(ipsecSettings(strName).gateway()); } CommonSettings ConnectionSettings::commonSettings(const QString& strName) const { return(CommonSettings(connection(strName))); } IPSecSettings ConnectionSettings::ipsecSettings(const QString& strName) const { return(IPSecSettings(connection(strName))); } L2tpSettings ConnectionSettings::l2tpSettings(const QString& strName) const { return(L2tpSettings(connection(strName))); } PppSettings ConnectionSettings::pppSettings(const QString& strName) const { return(PppSettings(connection(strName))); } int ConnectionSettings::deleteAllConfFiles() { int iRet(0); if (ConnectionsModel().isWriteable()) { for (int i = 0; i < ConfWriter::END; i++) { const ConfWriter::Conf conf(static_cast(i)); if (conf != ConfWriter::IPsec && conf != ConfWriter::L2TP && conf != ConfWriter::IPsecSECRET) { const QString strConfFile(ConfWriter::fileName(conf)); if (QFile::exists(strConfFile)) QFile::remove(strConfFile); } } const int iConnections(connections()); for (int i = 0; i < iConnections; i++) { const QString strConnectionName(connection(i)); QFile::remove(ConfWriter::fileName(ConfWriter::PPP, strConnectionName)); const QString strDNSConfInstance(QCoreApplication::instance()->objectName() + "-" +strConnectionName); QFile::remove(ConfWriter::fileName(ConfWriter::PPPDNSCONF, strDNSConfInstance)); } } else iRet = -1; return(iRet); } QString ConnectionSettings::connection(int iConnectionNo) const { QString strRet; const int iSize(qSettings()->beginReadArray(CONNECTIONS)); if (iConnectionNo < iSize) { qSettings()->setArrayIndex(iConnectionNo); strRet = qSettings()->value(NAME).toString(); } qSettings()->endArray(); return(strRet); } int ConnectionSettings::connection(const QString& strName) const { int iRet; bool fFound(false); const int iSize(qSettings()->beginReadArray(CONNECTIONS)); for (iRet = 0; !fFound && iRet < iSize; iRet++) { qSettings()->setArrayIndex(iRet); if (qSettings()->value(NAME, "") == strName) fFound = true; } qSettings()->endArray(); return(fFound ? iRet - 1 : -1); } ConnectionSettings::Result ConnectionSettings::validateName(const QString& strName) const { Result result(connection(strName) >=0 ? DuplicateName : Ok); if (result == Ok) { QRegExp rx(VALIDNAMEPATTERN); if (!rx.exactMatch(strName)) result = InvalidName; } return(result); } /*********** helpers ***************/ bool ConnectionSettings::setValue(const QString& strValue, const QString& strPath) const { const bool fRet(m_iConnectionNo >= 0 && qSettings()->isWritable()); if (fRet) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); if (qSettings()->value(strPath) != strValue.trimmed()) qSettings()->setValue(strPath, strValue.trimmed()); qSettings()->endArray(); } return(fRet); } QString ConnectionSettings::getStringValue(const QString& strPath) const { QString strRet; if (m_iConnectionNo >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); strRet = qSettings()->value(strPath, "").toString(); qSettings()->endArray(); } return(strRet); } bool ConnectionSettings::setSecret(const QString& strValue, const QString& strPath) const { const bool fRet(m_iConnectionNo >= 0 && qSettings()->isWritable()); if (fRet) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); EncSecrets secrets(KEY, IV, strValue.trimmed().toAscii().constData()); if (qSettings()->value(strPath) != secrets.getbuf()) qSettings()->setValue(strPath, secrets.getbuf()); qSettings()->endArray(); } return(fRet); } QString ConnectionSettings::getSecret(const QString& strPath) const { QString strRet; if (m_iConnectionNo >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); strRet = qSettings()->value(strPath, "").toString(); EncSecrets secrets(strRet.toAscii().constData()); strRet = secrets.retrieve(KEY, IV); qSettings()->endArray(); } return(strRet); } bool ConnectionSettings::setValue(int iValue, const QString& strPath) const { const bool fRet(m_iConnectionNo >= 0 && qSettings()->isWritable()); if (fRet) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); if (qSettings()->value(strPath) != iValue) qSettings()->setValue(strPath, iValue); qSettings()->endArray(); } return(fRet); } int ConnectionSettings::getIntValue(const QString& strPath, int iDefault) const { int iRet(0); if (m_iConnectionNo >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); iRet = qSettings()->value(strPath, iDefault).toInt(NULL); qSettings()->endArray(); } return(iRet); } bool ConnectionSettings::setValue(bool fValue, const QString& strPath) const { const bool fRet(m_iConnectionNo >= 0 && qSettings()->isWritable()); if (fRet) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); if (qSettings()->value(strPath) != fValue) qSettings()->setValue(strPath, fValue); qSettings()->endArray(); } return(fRet); } bool ConnectionSettings::getBoolValue(const QString& strPath, bool fDefault) const { bool fRet(false); if (m_iConnectionNo >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); fRet = qSettings()->value(strPath, fDefault).toBool(); qSettings()->endArray(); } return(fRet); } bool ConnectionSettings::setRouteProperty(const QString& strValue, int iRow, const QString& strPropertyName) const { bool fRet(m_iConnectionNo >= 0 && qSettings()->isWritable()); if (fRet) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); qSettings()->beginGroup(IP); const int iSize(qSettings()->beginReadArray(ROUTES)); if (iRow < iSize) { qSettings()->setArrayIndex(iRow); if (qSettings()->value(strPropertyName) != strValue) qSettings()->setValue(strPropertyName, strValue); } else fRet = false; qSettings()->endArray(); qSettings()->endGroup(); qSettings()->endArray(); } return(fRet); } QString ConnectionSettings::routeProperty(int iRow, const QString& strPropertyName) const { QString strRet; if (m_iConnectionNo >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(m_iConnectionNo); qSettings()->beginGroup(IP); const int iSize(qSettings()->beginReadArray(ROUTES)); if (iRow < iSize) { qSettings()->setArrayIndex(iRow); strRet = qSettings()->value(strPropertyName).toString(); } qSettings()->endArray(); qSettings()->endGroup(); qSettings()->endArray(); } return(strRet); } /********** Common settings ************/ bool CommonSettings::setAutoConnect(bool fAutoConnect) const { return(setValue(fAutoConnect, COMMON + '/' + AUTOCONNECT)); } bool CommonSettings::autoConnect() const { return(getBoolValue(COMMON + '/' + AUTOCONNECT)); } bool CommonSettings::setDisableIPSecEncryption(bool fDisableIPSecEncryption) const { return(setValue(fDisableIPSecEncryption, COMMON + '/' + DISABLEIPSECENCRYPTION)); } bool CommonSettings::disableIPSecEncryption() const { return(getBoolValue(COMMON + '/' + DISABLEIPSECENCRYPTION)); } /********** IPsec ************/ bool IPSecSettings::setGateway(const QString& strGateway) const { return(setValue(strGateway, IPSEC + '/' + GATEWAY)); } QString IPSecSettings::gateway() const { return(getStringValue(IPSEC + '/' + GATEWAY)); } bool IPSecSettings::setIdentity(const QString& strIdentity) const { return(setValue(strIdentity, IPSEC + '/' + IDENTITY)); } QString IPSecSettings::identity() const { return(getStringValue(IPSEC + '/' + IDENTITY)); } bool IPSecSettings::setPreSharedKey(const QString& strPsk) const { return(setSecret(strPsk, IPSEC + '/' + PSK)); } QString IPSecSettings::preSharedKey() const { return(getSecret(IPSEC + '/' + PSK)); } bool IPSecSettings::setCertificateFileName(const QString& strFileName) const { return(setValue(strFileName, IPSEC + '/' + CERTFN)); } QString IPSecSettings::certificateFileName() const { return(getStringValue(IPSEC + '/' + CERTFN)); } bool IPSecSettings::setPrivateKeyFilePath(const QString& strFilePath) const { return(setValue(strFilePath, IPSEC + '/' + PRIVATEKEYFILEPATH)); } QString IPSecSettings::privateKeyFilePath() const { return(getStringValue(IPSEC + '/' + PRIVATEKEYFILEPATH)); } bool IPSecSettings::setPrivateKeyPassphrase(const QString& strPassphrase) const { return(setSecret(strPassphrase, IPSEC + '/' + PRIVATEKEYPASSPHRASE)); } QString IPSecSettings::privateKeyPassphrase() const { return(getSecret(IPSEC + '/' + PRIVATEKEYPASSPHRASE)); } bool IPSecSettings::setAuthBy(const QString& strAuthBy) const { return(setValue(strAuthBy, IPSEC + '/' + AUTHBY)); } QString IPSecSettings::authBy() const { return(getStringValue(IPSEC + '/' + AUTHBY)); } /********** L2tp ************/ bool L2tpSettings::setLengthBit(bool fEnable) const { return(setValue(fEnable, L2TP + '/' + LENGTHBIT)); } bool L2tpSettings::lengthBit() const { return(getBoolValue(L2TP + '/' + LENGTHBIT)); } bool L2tpSettings::setRedial(bool fEnable) const { return(setValue(fEnable, L2TP + '/' + REDIAL)); } bool L2tpSettings::redial() const { return(getBoolValue(L2TP + '/' + REDIAL)); } bool L2tpSettings::setRedialTimeout(int iTimeout) const { return(setValue(iTimeout, L2TP + '/' + REDIALTIMEOUT)); } int L2tpSettings::redialTimeout() const { return(getIntValue(L2TP + '/' + REDIALTIMEOUT)); } bool L2tpSettings::setRedialAttempts(int iAttempts) const { return(setValue(iAttempts, L2TP + '/' + REDIALATTEMPTS)); } int L2tpSettings::redialAttempts() const { return(getIntValue(L2TP + '/' + REDIALATTEMPTS)); } /********** PPP ************/ PppEapSettings PppSettings::eapSettings() const { return(PppEapSettings(connectionNo())); } PppIpSettings PppSettings::ipSettings() const { return(PppIpSettings(connectionNo())); } bool PppSettings::setRefuseChap(bool fRefuse) const { return(setValue(fRefuse, PPP + '/' + REFUSECHAP)); } bool PppSettings::refuseChap() const { return(getBoolValue(PPP + '/' + REFUSECHAP)); } bool PppSettings::setRefuseMsChap(bool fRefuse) const { return(setValue(fRefuse, PPP + '/' + REFUSEMSCHAP)); } bool PppSettings::refuseMsChap() const { return(getBoolValue(PPP + '/' + REFUSEMSCHAP)); } bool PppSettings::setRefuseMsChapV2(bool fRefuse) const { return(setValue(fRefuse, PPP + '/' + REFUSEMSCHAPV2)); } bool PppSettings::refuseMsChapV2() const { return(getBoolValue(PPP + '/' + REFUSEMSCHAPV2)); } bool PppSettings::setRefuseEap(bool fRefuse) const { return(setValue(fRefuse, PPP + '/' + REFUSEEAP)); } bool PppSettings::refuseEap() const { return(getBoolValue(PPP + '/' + REFUSEEAP)); } bool PppSettings::setRefusePap(bool fRefuse) const { return(setValue(fRefuse, PPP + '/' + REFUSEPAP)); } bool PppSettings::refusePap() const { return(getBoolValue(PPP + '/' + REFUSEPAP)); } bool PppSettings::setUserName(const QString& strUserName) const { return(setValue(strUserName, PPP + '/' + USERNAME)); } QString PppSettings::userName() const { return(getStringValue(PPP + '/' + USERNAME)); } bool PppSettings::setPassword(const QString& strPassword) const { return(setSecret(strPassword, PPP + '/' + PASSWORD)); } QString PppSettings::password() const { return(getSecret(PPP + '/' + PASSWORD)); } bool PppSettings::setRemoteName(const QString& strRemoteName) const { return(setValue(strRemoteName, PPP + '/' + REMOTENAME)); } QString PppSettings::remoteName() const { return(getStringValue(PPP + '/' + REMOTENAME)); } bool PppSettings::setNoBSDCompression(bool fSet) const { return(setValue(fSet, PPP + '/' + NODSDCOMP)); } bool PppSettings::noBSDCompression() const { return(getBoolValue(PPP + '/' + NODSDCOMP)); } bool PppSettings::setNoDeflate(bool fSet) const { return(setValue(fSet, PPP + '/' + NODEFLATE)); } bool PppSettings::noDeflate() const { return(getBoolValue(PPP + '/' + NODEFLATE)); } bool PppSettings::setNoVj(bool fSet) const { return(setValue(fSet, PPP + '/' + NOVJ)); } bool PppSettings::noVj() const { return(getBoolValue(PPP + '/' + NOVJ)); } bool PppSettings::setLcpEchoInterval(int iInterval) const { return(setValue(iInterval, PPP + '/' + LCPECHOINTERVAL)); } int PppSettings::lcpEchoInterval() const { return(getIntValue(PPP + '/' + LCPECHOINTERVAL, -1)); } /********** EAP ************/ bool PppEapSettings::setUseSmartCard(bool fUse) const { return(setValue(fUse, EAP + '/' + USESMARTCARD)); } bool PppEapSettings::useSmartCard() const { return(getBoolValue(EAP + '/' + USESMARTCARD)); } bool PppEapSettings::setCertificatePath(const QString& strCertificatePath) const { return(setValue(strCertificatePath, EAP + '/' + CERTIFICATEPATH)); } QString PppEapSettings::certificatePath() const { return(getStringValue(EAP + '/' + CERTIFICATEPATH)); } bool PppEapSettings::setPrivateKeyPath(const QString& strPrivateKeyPath) const { return(setValue(strPrivateKeyPath, EAP + '/' + PRIVATEKEYPATH)); } QString PppEapSettings::privateKeyPath() const { return(getStringValue(EAP + '/' + PRIVATEKEYPATH)); } bool PppEapSettings::setPrivateKeyPassword(const QString& strPrivateKeyPassword) const { return(setSecret(strPrivateKeyPassword, EAP + '/' + PRIVATEKEYPASSWORD)); } QString PppEapSettings::privateKeyPassword() const { return(getSecret(EAP + '/' + PRIVATEKEYPASSWORD)); } bool PppEapSettings::setCaCertificatePath(const QString& strCaCertificatePath) const { return(setValue(strCaCertificatePath, EAP + '/' + CACERTIFICATEPATH)); } QString PppEapSettings::caCertificatePath() const { return(getStringValue(EAP + '/' + CACERTIFICATEPATH)); } /*********** IP *************/ bool PppIpSettings::setUsePeerDns(bool fUse) const { return(setValue(fUse, IP + '/' + USEPEERDNS)); } bool PppIpSettings::usePeerDns() const { return(getBoolValue(IP + '/' + USEPEERDNS)); } bool PppIpSettings::setPreferredDnsServerAddress(const QString& strPreferredDnsServerAddress) const { return(setValue(strPreferredDnsServerAddress, IP + '/' + PREFERREDDNSSERVERADDRESS)); } QString PppIpSettings::preferredDnsServerAddress() const { return(getStringValue(IP + '/' + PREFERREDDNSSERVERADDRESS)); } bool PppIpSettings::setAlternateDnsServerAddress(const QString& strAlternateDnsServerAddress) const { return(setValue(strAlternateDnsServerAddress, IP + '/' + ALTERNATEDNSSERVERADDRESS)); } QString PppIpSettings::alternateDnsServerAddress() const { return(getStringValue(IP + '/' + ALTERNATEDNSSERVERADDRESS)); } bool PppIpSettings::setSearchDomains(const QString& strSearchDomains) const { return(setValue(strSearchDomains, IP + '/' + SEARCHDOMAINS)); } QString PppIpSettings::searchDomains() const { return(getStringValue(IP + '/' + SEARCHDOMAINS)); } bool PppIpSettings::setUseDefaultGateway(bool fUse) const { return(setValue(fUse, IP + '/' + USEDEFAULTGATEWAY)); } bool PppIpSettings::useDefaultGateway() const { return(getBoolValue(IP + '/' + USEDEFAULTGATEWAY, true)); } int PppIpSettings::routes() const { int iSize(0); if (connectionNo() >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(connectionNo()); qSettings()->beginGroup(IP); iSize = qSettings()->beginReadArray(ROUTES); qSettings()->endArray(); qSettings()->endGroup(); qSettings()->endArray(); } return(iSize); } bool PppIpSettings::setRouteAddress(int iRow, const QString& strAddress) const { return(setRouteProperty(strAddress, iRow, IPADDRESS)); } QString PppIpSettings::routeAddress(int iRow) const { return(routeProperty(iRow, IPADDRESS)); } bool PppIpSettings::setRouteNetmask(int iRow, const QString& strNetMask) const { return(setRouteProperty(strNetMask, iRow, IPNETMASK)); } QString PppIpSettings::routeNetmask(int iRow) const { return(routeProperty(iRow, IPNETMASK)); } bool PppIpSettings::setRouteComment(int iRow, const QString& strComment) const { return(setRouteProperty(strComment, iRow, COMMENT)); } QString PppIpSettings::routeComment(int iRow) const { return(routeProperty(iRow, COMMENT)); } bool PppIpSettings::addRoute() const { bool fAdded(false); if (connectionNo() >= 0) { const int iSize(routes()); qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(connectionNo()); qSettings()->beginGroup(IP); qSettings()->beginWriteArray(ROUTES); qSettings()->setArrayIndex(iSize); qSettings()->setValue(IPADDRESS, ""); qSettings()->setValue(IPNETMASK, ""); qSettings()->endArray(); qSettings()->endGroup(); qSettings()->endArray(); fAdded = true; } return(fAdded); } bool PppIpSettings::removeRoute(int iRow) const { bool fRemoved(false); if (connectionNo() >= 0) { qSettings()->beginReadArray(CONNECTIONS); qSettings()->setArrayIndex(connectionNo()); qSettings()->beginGroup(IP); fRemoved = ConnectionSettings::removeArrayItem(ROUTES, iRow); qSettings()->endGroup(); qSettings()->endArray(); } return(fRemoved); } l2tp-ipsec-vpn/src/settings/Settings.cpp0000664000175000017500000000614212040201226020732 0ustar wejaegerwejaeger/* * $Id: Settings.cpp 47 2011-02-13 02:40:16Z werner $ * * File: Settings.cpp * Author: Werner Jaeger * * Created on August 9, 2010, 11:36 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "Settings.h" Settings::Settings() : m_Settings(configureQSettings()), m_PreviouslyLastModified(lastModified()) { } Settings::~Settings() { } bool Settings::isWriteable() const { return(qSettings()->isWritable()); } void Settings::clearChanged() { m_PreviouslyLastModified = lastModified(); } bool Settings::hasChanged() const { return(m_PreviouslyLastModified < lastModified()); } /** * Unfortunately QSettings does not provide a method to remove array elements. * * So, we have to read in all keys and values of the named array section, delete * the whole array section and write it out again, omitting the deleted * row. We also have to take care to adapt the array indices after the deleted * row and to write finally the new size entry. */ bool Settings::removeArrayItem(const QString& strArrayName, int iIndex) const { bool fRet = false; qSettings()->beginReadArray(strArrayName); const QStringList keys(qSettings()->allKeys()); QStringList values; if (iIndex < keys.size()) { for (int i = 0; i < keys.size(); i++) values.insert(i, qSettings()->value(keys.at(i)).toString()); qSettings()->endArray(); qSettings()->beginGroup(strArrayName); qSettings()->remove(""); const QChar cIndex2Remove(iIndex + 1 + 48); QChar cIndex2Write; for (int i = 0; i < keys.size(); i++) { const QString& strKey = keys.at(i); const QChar cIndex2Read(strKey.at(0)); if (cIndex2Read.isDigit()) { if (cIndex2Read != cIndex2Remove) { cIndex2Write = cIndex2Read > cIndex2Remove ? QChar(cIndex2Read.digitValue() - 1 + 48) : QChar(cIndex2Read.digitValue() + 48); qSettings()->setValue(cIndex2Write + strKey.mid(1), values.at(i)); } } } qSettings()->setValue("size", QString(cIndex2Write)); qSettings()->endGroup(); fRet = true; } return(fRet); } QDateTime Settings::lastModified() const { return(QFileInfo(qSettings()->fileName()).lastModified()); } QSettings* Settings::configureQSettings() { return(new QSettings(QSettings::SystemScope, QCoreApplication::organizationName(), QCoreApplication::applicationName())); } l2tp-ipsec-vpn/src/PasswordCallback.h0000664000175000017500000000241412040201227020155 0ustar wejaegerwejaeger/* * $Id: PasswordCallback.h 24 2010-10-07 12:35:00Z werner $ * * File: PasswordCallback.h * Author: Werner Jaeger * * Created on September 1, 2010, 4:20 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PASSWORDCALLBACK_H #define PASSWORDCALLBACK_H class L2tpIPsecVpnApplication; class PasswordCallback { public: PasswordCallback(L2tpIPsecVpnApplication& application); virtual ~PasswordCallback(); int exec() const; private: PasswordCallback(const PasswordCallback& orig); PasswordCallback& operator=(const PasswordCallback& orig); L2tpIPsecVpnApplication& m_Application; }; #endif /* PASSWORDCALLBACK_H */ l2tp-ipsec-vpn/src/ConnectionEditor.h0000664000175000017500000000305012040201227020201 0ustar wejaegerwejaeger/* * $Id: ConnectionEditor.h 13 2010-09-17 09:12:39Z werner $ * * File: ConnectionEditor.h * Author: Werner Jaeger * * Created on August 30, 2010, 12:59 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONNECTIONEDITOR_H #define CONNECTIONEDITOR_H #include class L2tpIPsecVpnApplication; class ConnectionEditorDialog; class ConnectionEditor : public QObject { Q_OBJECT public: explicit ConnectionEditor(L2tpIPsecVpnApplication& application, QObject* pParent = 0); virtual ~ConnectionEditor(); int exec(); private slots: void onConnectionAdded(const QString& strName); void onConnectionRemoved(const QString& strName); private: ConnectionEditor(const ConnectionEditor& orig); ConnectionEditor& operator=(const ConnectionEditor& orig); L2tpIPsecVpnApplication& m_Application; ConnectionEditorDialog* const m_pConnectionEditorDialog; }; #endif /* CONNECTIONEDITOR_H */ l2tp-ipsec-vpn/src/VpnClientConnection.h0000664000175000017500000000610412040201227020660 0ustar wejaegerwejaeger/* * $Id: VpnClientConnection.h 125 2012-03-12 14:06:09Z werner $ * * File: VpnClientConnection.h * Author: Werner Jaeger * * Created on August 26, 2010, 8:26 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef VPNCLIENTCONNECTION_H #define VPNCLIENTCONNECTION_H #include #include class QTextStream; class QLocalSocket; class VpnClientConnection : public QObject { Q_OBJECT public: enum Command { CMD_START_PCSCD, CMD_STOP_PCSCD, CMD_START_IPSECD, CMD_STOP_IPSECD, CMD_START_L2TPD, CMD_STOP_L2TPD, CMD_START_RSYSLOGD, CMD_STOP_RSYSLOGD, CMD_IPSEC_READY, CMD_IPSEC_UP, CMD_IPSEC_DOWN, CMD_IPSEC_REREAD, CMD_L2TP_CONNECT, CMD_L2TP_DISCONNECT, CMD_CREATE_VPN_LOGPIPE, CMD_WRITE_CONNECTIONNAME_INFO, CMD_WRITE_DEFAULT_GATEWAY_INFO, CMD_QUIT, CMD_UNKNOWN }; enum ResponseType { RESULT, OUTPUT, INFORMATION, UNKNOWN }; enum ResponseResult { OK = 0, ERR_UNKNOWN_CMD = 90, ERR_INALID_NO_OF_ARGUMENTS = 91, ERR_COMMAND_FAILED_TO_START = 92, ERR_COMMAND_CRASHED_AFTER_START = 93, ERR_COMMAND_TIMEDOUT = 94, ERR_COMMAND_FAILED_TO_READ_FROM_PROCESS = 95, ERR_COMMAND_FAILED_TO_WRITE_TO_PROCESS = 96, ERR_COMMAND_FAILED_WITH_UNKNOW_ERROR = 97, ERR_WRITE_PIPE = 200, ERR_OPEN_PIPE = 210, ERR_CREATE_VPN_LOG_PIPE = 220, ERR_CHMOD_VPN_LOG_PIPE = 221, ERR_CHOWN_VPN_LOG_PIPE = 222, ERR_START_SYSLOG_DAEMON = 223, }; enum ResponseInformation { CLOSED }; VpnClientConnection(QLocalSocket* pSocket, QObject* pParent = NULL); virtual ~VpnClientConnection(); private slots: void readyRead(); void readyReadStandardOutput(); void onCommandError(QProcess::ProcessError iError); void onCommandFinished(int iExitCode); private: VpnClientConnection(const VpnClientConnection& orig); VpnClientConnection& operator=(const VpnClientConnection& orig); bool send(ResponseType responseType, ResponseResult resultCode, const QString& strCommand); bool send(ResponseType responseType, ResponseInformation responseInformation); bool send(ResponseType responseType, const QString& strOutputline); QTextStream* const m_pStream; QLocalSocket* const m_pSocket; QProcess* const m_pProcess; QString m_strActiveCommand; }; #endif /* VPNCLIENTCONNECTION_H */ l2tp-ipsec-vpn/src/ConnectionState.h0000664000175000017500000001022712040201227020037 0ustar wejaegerwejaeger/* * $Id: ConnectionState.h 68 2011-04-08 02:50:25Z werner $ * * File: ConnectionState.h * Author: Werner Jaeger * * Created on July 8, 2010, 10:35 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONNECTIONSTATE_H #define CONNECTIONSTATE_H #include #include "util/NetworkInterface.h" class QSystemTrayIcon; class QIcon; class QString; class QMovie; class ConnectionState : public QObject { Q_OBJECT public: enum State {NotConnected, Connecting, Disconnecting, Connected, Error}; ConnectionState(QSystemTrayIcon* pTrayIcon, const QString& strHostName, const QString& strMsgTitle, const QString& strMsgBody, const QIcon& icon, const QSystemTrayIcon::MessageIcon& msgIcon, const NetworkInterface& ptpInterface = NetworkInterface::null); virtual ~ConnectionState(); virtual bool isState(State state) const = 0; const QString& hostName() const; const QString& msgTitle() const; const QString& msgBody() const; const QIcon& icon() const; const QSystemTrayIcon::MessageIcon& msgIcon() const; const NetworkInterface& ptpInterface() const; protected: QSystemTrayIcon* trayIcon() const { return(m_pTrayIcon); } private: ConnectionState(const ConnectionState& orig); ConnectionState& operator=(const ConnectionState& orig); QSystemTrayIcon* const m_pTrayIcon; const QString m_strHostName; const QString m_strMsgTitle; const QString m_strMsgBody; const QIcon m_Icon; const QSystemTrayIcon::MessageIcon m_MsgIcon; const NetworkInterface m_PtpInterface; }; class NotConnected : public ConnectionState { public: NotConnected(QSystemTrayIcon* pTrayIcon); virtual ~NotConnected(); virtual bool isState(State state) const { return(state == ConnectionState::NotConnected ? true : false); } private: NotConnected(const NotConnected& orig); NotConnected& operator=(const NotConnected& orig); }; class Connecting : public ConnectionState { Q_OBJECT public: Connecting(QSystemTrayIcon* pTrayIcon, const QString& strHostName); virtual ~Connecting(); virtual bool isState(State state) const { return(state == ConnectionState::Connecting ? true : false); } private slots: void onFrameChanged() const; private: Connecting(const Connecting& orig); Connecting& operator=(const Connecting& orig); QMovie* const m_pMovie; }; class Disconnecting : public ConnectionState { Q_OBJECT public: Disconnecting(QSystemTrayIcon* pTrayIcon, const QString& strHostName); virtual ~Disconnecting(); virtual bool isState(State state) const { return(state == ConnectionState::Disconnecting ? true : false); } private slots: void onFrameChanged() const; private: Disconnecting(const Disconnecting& orig); Disconnecting& operator=(const Disconnecting& orig); QMovie* const m_pMovie; }; class Connected : public ConnectionState { public: Connected(QSystemTrayIcon* pTrayIcon, const QString& strHostName, const NetworkInterface& ptpInterface); virtual ~Connected(); virtual bool isState(State state) const { return(state == ConnectionState::Connected ? true : false); } private: Connected(const Connected& orig); Connected& operator=(const Connected& orig); }; class Error : public ConnectionState { public: Error(QSystemTrayIcon* pTrayIcon, const QString& strHostName, int iReturnCocde, bool fDisconnecting); virtual ~Error(); virtual bool isState(State state) const { return(state == ConnectionState::Error ? true : false); } private: Error(const Error& orig); Error& operator=(const Error& orig); }; #endif /* CONNECTIONSTATE_H */ l2tp-ipsec-vpn/src/PasswordCallback.cpp0000664000175000017500000000361712040201227020516 0ustar wejaegerwejaeger/* * $Id: PasswordCallback.cpp 144 2012-05-21 07:31:37Z wejaeger $ * * File: PasswordCallback.cpp * Author: Werner Jaeger * * Created on September 1, 2010, 4:20 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include // #include #include #include #include "settings/ConnectionSettings.h" #include "util/SecretsChecker.h" #include "L2tpIPsecVpnApplication.h" #include "PasswordCallback.h" PasswordCallback::PasswordCallback(L2tpIPsecVpnApplication& application) : m_Application(application) { } PasswordCallback::~PasswordCallback() { } int PasswordCallback::exec() const { // ::syslog(LOG_DEBUG|LOG_AUTH, "%s", "Executing password callback"); int iRet(1); const QString strPassword(SecretsChecker::getSecret(m_Application.argv()[1])); if (!strPassword.isNull()) { const int iPwdLength = strPassword.length(); const int iPwdFileDescriptor = ::atoi(m_Application.argv()[3]); if (iPwdFileDescriptor >= 0) { const int iWritten = ::write(iPwdFileDescriptor, strPassword.toAscii().constData(), iPwdLength); if (iWritten == iPwdLength) { // ::syslog(LOG_DEBUG|LOG_AUTH, "%s", "Password found"); iRet = 0; } } } return(iRet); } l2tp-ipsec-vpn/src/ConnectionManager.h0000664000175000017500000000707112040201227020334 0ustar wejaegerwejaeger/* * $Id: ConnectionManager.h 115 2012-01-24 23:58:29Z werner $ * * File: ConnectionManager.h * Author: Werner Jaeger * * Created on July 7, 2010, 5:44 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _CONNECTIONMANAGER_H #define _CONNECTIONMANAGER_H #include #include #include #include "util/NetworkInterface.h" class QSystemTrayIcon; class ConnectionState; class VPNControlTask; class ConnectionInformationDialog; class QAction; class QTimer; class L2tpIPsecVpnApplication; class ConnectionManager : public QObject { Q_OBJECT public: explicit ConnectionManager(L2tpIPsecVpnApplication& application, QObject* pParent = 0); virtual ~ConnectionManager(); int exec(); private slots: void vpnConnect(QAction* pAction); void vpnDisconnect(bool fDontChangeStatus = false); void editConnections() const; void showConnectionInformation() const; void about() const; void iconActivated(QSystemTrayIcon::ActivationReason reason); void showMessage(); void messageClicked(); void detectConnectionState(); void onVpnTaskOutput(const QString& strOutputLine); void onVpnTaskReadyReadLog(); void onVpnTaskErrorMsg(int iErrorCode); void onVpnTaskTimeout(); void onVpnTaskFinished(); void onConnectionAdded(const QString& strName); void onConnectionRemoved(const QString& strName); void onRouteAdded(NetworkInterface interface, unsigned int iPriority); void onRouteDeleted(NetworkInterface interface, unsigned int iPriority); void onPtpInterfaceIsUpAnRunning(NetworkInterface interface); void onPtpInterfaceIsGoingDown(NetworkInterface interface); void onCheckPtpInterfaceIsUp(); void onCheckPtpInterfaceIsDown(); private: typedef QList ActionList; typedef QPair ConnectionInfo; typedef enum { DISC, EDIT, INFO, ABOUT, QUIT } ActionType; ConnectionManager(const ConnectionManager& orig); ConnectionManager& operator=(const ConnectionManager& orig); void createActions(); void createTrayIcon(); void updateContextMenu(bool fStatusChanged); void vpnConnect(const QString& strConnectionName); void enableAllConnections(bool fEnable) const; void connected(const QString& strConnectionName, const NetworkInterface& ptpInterface); void disConnected(); void error(int iErrorCode); ConnectionInfo connectionNameOfUpAndRunningPtpInterface() const; QAction* action(ActionType type) const; static QString connectionName(const NetworkInterface& interface, int iRetry = 1); ConnectionInformationDialog* const m_pConnectionInformation; QTimer* const m_pTimeout; ActionList* const m_pActions; L2tpIPsecVpnApplication& m_Application; ConnectionState* m_pState; QSystemTrayIcon* m_pTrayIcon; QMenu* m_pTrayIconMenu; VPNControlTask* m_pVPNControlTask; volatile bool m_fIsExecuting; volatile bool m_fRoutePriorityIsChanging; }; #endif /* _CONNECTIONMANAGER_H */ l2tp-ipsec-vpn/src/util/0000775000175000017500000000000012040201227015541 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/util/VpnControlDaemonClient.cpp0000664000175000017500000001452012040201227022636 0ustar wejaegerwejaeger/* * $Id: VpnControlDaemonClient.cpp 13 2010-09-17 09:12:39Z werner $ * * File: VpnControlDaemonClient.cpp * Author: Werner Jaeger * * Created on August 26, 2010, 12:48 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "VpnControlDaemonClient.h" #include "VPNControlTask.h" static const char* const KEY = "L2tpIPsecVpnControlDaemon"; VpnControlDaemonClient::VpnControlDaemonClient(QObject* pParent) : QObject(pParent), m_pStream(new QTextStream), m_pSocket(new QLocalSocket) { m_pStream->setDevice(m_pSocket); connect(m_pSocket, SIGNAL(connected()), SLOT(onConnected())); connect(m_pSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), SLOT(onDisconnected())); connect(m_pSocket, SIGNAL(disconnected()), SLOT(onDisconnected())); connect(m_pSocket, SIGNAL(readyRead()), SLOT(onReadyRead())); } VpnControlDaemonClient::VpnControlDaemonClient(bool /* fSynchronous */) : QObject(NULL), m_pStream(new QTextStream), m_pSocket(new QLocalSocket) { m_pStream->setDevice(m_pSocket); connect(m_pSocket, SIGNAL(connected()), SLOT(onConnected())); connect(m_pSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), SLOT(onDisconnected())); connect(m_pSocket, SIGNAL(disconnected()), SLOT(onDisconnected())); } VpnControlDaemonClient::~VpnControlDaemonClient() { delete m_pSocket; delete m_pStream; } void VpnControlDaemonClient::connectToServer() { m_pSocket->abort(); m_pSocket->connectToServer(KEY); } bool VpnControlDaemonClient::waitForConnected(int iMiliSeconds) { return(m_pSocket->waitForConnected(iMiliSeconds)); } bool VpnControlDaemonClient::start(VpnClientConnection::Command iCommand, const QString& strArguments) { bool fRet(false); if (m_pSocket->state() == QLocalSocket::ConnectedState) { if (strArguments.isNull()) m_pSocket->write((QString::number(iCommand) + '\n').toAscii().constData()); else m_pSocket->write((QString::number(iCommand) + " " + strArguments + '\n').toAscii().constData()); fRet = true; } return(fRet); } int VpnControlDaemonClient::execute(VpnClientConnection::Command iCommand, const QString& strArguments) { int iRet(1); VpnControlDaemonClient client(true); client.connectToServer(); if (client.waitForConnected()) { if (client.start(iCommand, strArguments)) iRet = client.waitForResult(); } return(iRet); } void VpnControlDaemonClient::exit() { if (start(VpnClientConnection::CMD_QUIT)) { m_pSocket->waitForBytesWritten(); m_pSocket->disconnectFromServer(); } } void VpnControlDaemonClient::leave() { m_pSocket->disconnectFromServer(); } void VpnControlDaemonClient::onConnected() { emit notifyConnected(); } void VpnControlDaemonClient::onDisconnected() { emit notifyDisconnected(); } void VpnControlDaemonClient::onReadyRead() { readResponse(); } int VpnControlDaemonClient::waitForResult() { int iRet(500); while (m_pSocket->waitForReadyRead()) { const Result result = readResponse(); if (result.type == VpnClientConnection::RESULT) { iRet = result.iReturnCode; break; } } return(iRet); } VpnControlDaemonClient::Result VpnControlDaemonClient::readResponse() { Result result; result.type = VpnClientConnection::UNKNOWN; if (m_pSocket->canReadLine()) { QString strResponseLine; while ((strResponseLine = m_pStream->readLine()).length() > 0) { const QStringList strResponseParts(strResponseLine.split(' ', QString::SkipEmptyParts)); const int iParts(strResponseParts.count()); if (iParts > 1) { bool fIsResponseType; const unsigned int iResponseType = strResponseParts[0].toUInt(&fIsResponseType); Q_ASSERT(fIsResponseType); if (fIsResponseType) { switch (iResponseType) { case VpnClientConnection::RESULT: { bool fIsReturnCode; const int iReturnCode(strResponseParts[1].toUInt(&fIsReturnCode)); Q_ASSERT(fIsReturnCode); Q_ASSERT(iParts > 2); if (fIsReturnCode) { const QString strCommand(strResponseLine.mid(strResponseLine.indexOf(strResponseParts[2]))); emit notifyResult(iReturnCode, strCommand); result.iReturnCode = iReturnCode; result.type = VpnClientConnection::RESULT; } } break; case VpnClientConnection::OUTPUT: emit notifyCommandOutput(strResponseLine.mid(strResponseLine.indexOf(' ') + 1)); result.iReturnCode = 0; result.type = VpnClientConnection::OUTPUT; break; case VpnClientConnection::INFORMATION: { bool fIsInformation; const int iInformation(strResponseParts[1].toUInt(&fIsInformation)); Q_ASSERT(fIsInformation); if (fIsInformation && iInformation == VpnClientConnection::CLOSED) m_pSocket->disconnectFromServer(); result.iReturnCode = VpnClientConnection::CLOSED; result.type = VpnClientConnection::INFORMATION; } break; default: // either server changed protocol and we missed this or a malicious software sends us messages Q_ASSERT(false); } } } } } return(result); }l2tp-ipsec-vpn/src/util/VpnControlDaemonClient.h0000664000175000017500000000435212040201227022305 0ustar wejaegerwejaeger/* * $Id: VpnControlDaemonClient.h 13 2010-09-17 09:12:39Z werner $ * * File: VpnControlDaemonClient.h * Author: Werner Jaeger * * Created on August 26, 2010, 12:48 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef VPNCONTROLDAEMONCLIENT_H #define VPNCONTROLDAEMONCLIENT_H #include #include "VpnClientConnection.h" class QTextStream; class QLocalSocket; class VpnControlDaemonClient : public QObject { Q_OBJECT public: explicit VpnControlDaemonClient(QObject* pParent = NULL); virtual ~VpnControlDaemonClient(); void connectToServer(); bool waitForConnected(int iMiliSeconds = 30000); bool start(VpnClientConnection::Command iCommand, const QString& strArguments = QString::null); static int execute(VpnClientConnection::Command iCommand, const QString& strArguments = QString::null); signals: void notifyConnected(); void notifyDisconnected(); void notifyResult(int iReturnCode, const QString& strCommand); void notifyCommandOutput(const QString& strOutputLine); public slots: void exit(); void leave(); private slots: void onConnected(); void onDisconnected(); void onReadyRead(); private: explicit VpnControlDaemonClient(bool fSynchronous); VpnControlDaemonClient(const VpnControlDaemonClient& orig); VpnControlDaemonClient& operator=(const VpnControlDaemonClient& orig); int waitForResult(); struct Result { int iReturnCode; VpnClientConnection::ResponseType type; }; Result readResponse(); QTextStream* const m_pStream; QPointer const m_pSocket; }; #endif /* VPNCONTROLDAEMONCLIENT_H */ l2tp-ipsec-vpn/src/util/EncSecrets.h0000664000175000017500000000333612040201227017755 0ustar wejaegerwejaeger/* * $Id: EncSecrets.h 13 2010-09-17 09:12:39Z werner $ * * File: EncSecrets.h * Author: Werner Jaeger * * Created on July 28, 2010, 10:48 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef ENCSECRETS_H #define ENCSECRETS_H #include class EncSecrets { public: EncSecrets(const unsigned char acKey[16], const unsigned char acIv[8], const char* pcAscbuf); EncSecrets(const char* pcB64buf); virtual ~EncSecrets(); const char* getbuf(void) const; QString retrieve(const unsigned char acKey[16], const unsigned char acIv[8]); private: EncSecrets(const EncSecrets& orig); EncSecrets& operator=(const EncSecrets& orig); int encode(const unsigned char* pcBfbuf, int iOutlen); int decode(unsigned char* pcBfbuf); static int encrypt(const char* pcAscbuf, const unsigned char acIv[8], const unsigned char acKey[16], unsigned char* pcBfbuf); static int decrypt(const unsigned char* pcBfbuf, int iTotal, char* pcAscbuf, const unsigned char acKey[16], const unsigned char acIv[8]); unsigned char* m_pcB64buf; int m_iBufferSize; }; #endif /* ENCSECRETS_H */ l2tp-ipsec-vpn/src/util/NetworkInterface.h0000664000175000017500000001737012040201227021174 0ustar wejaegerwejaeger/* * $Id: NetworkInterface.h 129 2012-04-07 10:15:46Z wejaeger $ * * File: NetworkInterface.h * Author: Werner Jaeger * * Created on July 12, 2010, 9:10 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef NETWORKINTERFACE_H #define NETWORKINTERFACE_H #include #include #include #include #include #include class NetworkInterface { public: class Statistic { private: typedef std::vector Headers; typedef std::map Values; public: class ReceivedData { public: long long bytes() const { return(m_ReceivedValues.count("bytes") ? m_ReceivedValues.at("bytes") : 0); } long long packets() const { return(m_ReceivedValues.count("packets") ? m_ReceivedValues.at("packets") : 0); } long long errs() const { return(m_ReceivedValues.count("errs") ? m_ReceivedValues.at("errs") : 0); } long long drop() const { return(m_ReceivedValues.count("drop") ? m_ReceivedValues.at("drop") : 0); } long long fifo() const { return(m_ReceivedValues.count("fifo") ? m_ReceivedValues.at("fifo") : 0); } long long frame() const { return(m_ReceivedValues.count("frame") ? m_ReceivedValues.at("frame") : 0); } long long compressed() const { return(m_ReceivedValues.count("compressed") ? m_ReceivedValues.at("compressed") : 0); } long long multicast() const { return(m_ReceivedValues.count("multicast") ? m_ReceivedValues.at("multicast") : 0); } private: ReceivedData(const Values& receivedValues) : m_ReceivedValues(receivedValues) {} ReceivedData(const ReceivedData& orig); ReceivedData& operator=(const ReceivedData& orig); const Values m_ReceivedValues; friend class Statistic; }; class TransmittedData { public: long long bytes() const { return(m_TransmittedValues.count("bytes") ? m_TransmittedValues.at("bytes") : 0); } long long packets() const { return(m_TransmittedValues.count("packets") ? m_TransmittedValues.at("packets") : 0); } long long errs() const { return(m_TransmittedValues.count("errs") ? m_TransmittedValues.at("errs") : 0); } long long drop() const { return(m_TransmittedValues.count("drop") ? m_TransmittedValues.at("drop") : 0); } long long fifo() const { return(m_TransmittedValues.count("fifo") ? m_TransmittedValues.at("fifo") : 0); } long long colls() const { return(m_TransmittedValues.count("colls") ? m_TransmittedValues.at("colls") : 0); } long long carrier() const { return(m_TransmittedValues.count("carrier") ? m_TransmittedValues.at("carrier") : 0); } long long compressed() const { return(m_TransmittedValues.count("compressed") ? m_TransmittedValues.at("compressed") : 0); } private: TransmittedData(const Values& transmittedValues) : m_TransmittedValues(transmittedValues) {} TransmittedData(const TransmittedData& orig); TransmittedData& operator=(const TransmittedData& orig); const Values m_TransmittedValues; friend class Statistic; }; const ReceivedData& received() const { return(m_ReceivedData); } const TransmittedData& transmitted() const { return(m_TransmittedData); } private: Statistic(const Values& receivedValues, const Values& transmittedValues) : m_ReceivedData(receivedValues), m_TransmittedData(transmittedValues) {} Statistic& operator=(const Statistic& orig); const ReceivedData m_ReceivedData; const TransmittedData m_TransmittedData; friend class NetworkInterface; }; class DefaultGatewayInfo { public: DefaultGatewayInfo(const std::string& strInterfaceName, const std::string& strGateway, const std::string& strIPAddress) : m_strInterfaceName(strInterfaceName), m_strGateway(strGateway), m_strIPAddress(strIPAddress) {} const std::string& interfaceName() const { return(m_strInterfaceName); } const std::string& gateway() const { return(m_strGateway); } const std::string& ipAddress() const { return(m_strIPAddress); } private: const std::string m_strInterfaceName; const std::string m_strGateway; const std::string m_strIPAddress; }; typedef std::map InterfaceMap; typedef std::pair InterfaceMapEntry; typedef std::vector AddressEntries; typedef std::vector RouteEntries; typedef unsigned long uint32; enum InterfaceFlag { IsUp = 0x1, IsRunning = 0x2, CanBroadcast = 0x4, IsLoopBack = 0x8, IsPointToPoint = 0x10, CanMulticast = 0x20 }; Q_DECLARE_FLAGS(InterfaceFlags, InterfaceFlag) NetworkInterface() : m_strName(""), m_iIndex(0), m_Flags(0), m_AddressEntries(std::vector()), m_RouteEntries(std::vector()) {} NetworkInterface(const NetworkInterface& orig); bool operator==(const NetworkInterface& other) const; virtual ~NetworkInterface() {} const std::string& name() const { return(m_strName); } unsigned int index() const { return(m_iIndex); } InterfaceFlags flags() const { return(m_Flags); } bool isNull() const { return(m_strName.empty()); } bool isPtP() const { return(m_Flags & IsPointToPoint); } bool hasDefaultGateway() const; bool isDefaultGateway() const; const AddressEntries& addressEntries() const { return(m_AddressEntries); } void clearAddressEntries(void) { m_AddressEntries.clear(); } const AddressEntries& routeEntries() const { return(m_RouteEntries); } void clearRouteEntries(void) { m_RouteEntries.clear(); } static InterfaceMap pointToPointInterfaces(void); static InterfaceMap defaultGateway(void); static QStringList dns(void); static Statistic statistic(const std::string& strInterfaceName); static DefaultGatewayInfo defaultGatewayInfo(); static bool writeDefaultGatewayInfo(); static const NetworkInterface null; private: NetworkInterface(const char* const cstrName, int iIndex, uint iRawFlags) : m_strName(cstrName), m_iIndex(iIndex), m_Flags(convertFlags(iRawFlags)), m_AddressEntries(std::vector()), m_RouteEntries(std::vector()) {} NetworkInterface& operator=(const NetworkInterface& orig); void addAddressEntry(const QNetworkAddressEntry& addressEntry) { m_AddressEntries.push_back(addressEntry); } bool removeAddressEntry(const QNetworkAddressEntry& addressEntry); void addRouteEntry(const QNetworkAddressEntry& routeEntry) { m_RouteEntries.push_back(routeEntry); } bool removeRouteEntry(const QNetworkAddressEntry& routeEntry); void setFlags(uint iRawFlags) { m_Flags = convertFlags(iRawFlags); } static InterfaceFlags convertFlags(uint iRawFlags); static std::string ipAddress(const std::string& strInterfaceName); const std::string m_strName; const unsigned int m_iIndex; InterfaceFlags m_Flags; std::vector m_AddressEntries; std::vector m_RouteEntries; friend class NetworkInterfaceMonitor; }; #endif /* NETWORKINTERFACE_H */ l2tp-ipsec-vpn/src/util/Libtool.cpp0000664000175000017500000000313712040201227017655 0ustar wejaegerwejaeger/* * $Id: Libtool.cpp 45 2011-02-12 00:25:26Z werner $ * * File: Libtool.cpp * Author: wejaeger * * Created on February 8, 2011, 1:27 PM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "util/GlobalFunctions.h" #include "Libtool.h" Libtool::Libtool(const QString& strLibraryFilePath) : m_pLoadedModuleHandle(Libtool::init(strLibraryFilePath)) { } Libtool::~Libtool() { exit(); } bool Libtool::hasSymbol(const QString& strSymbolName) const { return(loaded() && !!::lt_dlsym(m_pLoadedModuleHandle, strSymbolName.toAscii().constData())); } void Libtool::exit() const { ::lt_dlexit(); if (m_pLoadedModuleHandle) ::lt_dlclose(m_pLoadedModuleHandle); } lt_dlhandle Libtool::init(const QString& strLibraryFilePath) { lt_dlhandle pModuleHandle(NULL); if (::lt_dlinit() == 0 && !strLibraryFilePath.isEmpty()) pModuleHandle = ::lt_dlopen(::string2FileName(strLibraryFilePath)); return(pModuleHandle); } l2tp-ipsec-vpn/src/util/EncSecrets.cpp0000664000175000017500000001241412040201227020305 0ustar wejaegerwejaeger/* * $Id: EncSecrets.cpp 13 2010-09-17 09:12:39Z werner $ * * File: EncSecrets.cpp * Author: Werner Jaeger * * Created on July 28, 2010, 10:48 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include // strlen, bzero #include // Enc*(), Dec*() #include "EncSecrets.h" /** * Stores a base64 encoded blowfish encrypted buffer. * * Very useful to store small buffers, like passwords, into files. It also * seems to be working very well even for larger buffers. * * This document was last updated at \today (GMT -1). */ /** * 1st constructor, used for encrypting/encoding. * * #acKey# is the 16 bytes blowfish encryption key, #acIv# is the 8 bytes * random number initialization vector, #pcAscbuf# is is the buffer to be * encrypted/encoded. */ EncSecrets::EncSecrets(const unsigned char acKey[16], const unsigned char acIv[8], const char* pcAscbuf) { // Allocates enough amount of memory to be used by the buffer. m_iBufferSize = (2 * ::strlen(pcAscbuf)) > 32 ? 2 * ::strlen(pcAscbuf) : 32; m_pcB64buf = static_cast(::malloc(m_iBufferSize)); unsigned char* const pcBfbuf = static_cast(::malloc(m_iBufferSize)); const int iOutlen = EncSecrets::encrypt(pcAscbuf, acIv, acKey, pcBfbuf); encode(pcBfbuf, iOutlen); ::bzero(pcBfbuf, m_iBufferSize); ::free(pcBfbuf); } /** * 2nd constructor, used for decoding/decrypting. * * #pcB64buf# is an already base64 encoded blowfish encrypted buffer. */ EncSecrets::EncSecrets(const char* pcB64buf) { // Allocates enough amount of memory to be used by the buffer. m_iBufferSize = ::strlen(pcB64buf); m_pcB64buf = static_cast(::malloc(m_iBufferSize + 1)); for(int i = 0; i < m_iBufferSize; i++) m_pcB64buf[i] = pcB64buf[i]; m_pcB64buf[m_iBufferSize] = '\0'; } EncSecrets::~EncSecrets() { ::bzero(m_pcB64buf, m_iBufferSize); ::free(m_pcB64buf); } /** * Returns base64 encoded buffer. */ const char* EncSecrets::getbuf(void) const { return(reinterpret_cast(m_pcB64buf)); } /** * Returns decoded/decrypted string. * * #acKey# is the blowfish encryption key and #acIv# is * the random number initialization vector used to decrypt. */ QString EncSecrets::retrieve(const unsigned char acKey[16], const unsigned char acIv[8]) { unsigned char* const pcBfbuf = static_cast(::malloc(m_iBufferSize)); char* const pcAscbuf = static_cast(::malloc(m_iBufferSize)); const int iTotal = decode(pcBfbuf); const int iOutLen = ::EncSecrets::decrypt(pcBfbuf, iTotal, pcAscbuf, acKey, acIv); const QString strRet = QString::fromAscii(pcAscbuf, iOutLen); ::free(pcBfbuf); ::free(pcAscbuf); return(strRet); } // Base64 encodes pcBfbuf. int EncSecrets::encode(const unsigned char* pcBfbuf, int iOutlen) { EVP_ENCODE_CTX ectx; int iLen, iTotal = 0; ::EVP_EncodeInit(&ectx); ::EVP_EncodeUpdate(&ectx, m_pcB64buf, &iLen, pcBfbuf, iOutlen); iTotal += iLen; ::EVP_EncodeFinal(&ectx, m_pcB64buf + iLen, &iLen); iTotal += iLen; return(iTotal); } // Base64 decodification. int EncSecrets::decode(unsigned char* pcBfbuf) { EVP_ENCODE_CTX ectx; int iLen, iTotal = 0; ::EVP_DecodeInit(&ectx); ::EVP_DecodeUpdate(&ectx, pcBfbuf, &iLen, m_pcB64buf, ::strlen(reinterpret_cast(m_pcB64buf))); iTotal += iLen; ::EVP_DecodeFinal(&ectx, pcBfbuf + iLen, &iLen); iTotal += iLen; return(iTotal); } // Blowfish encrypts pcAscbuf into pcBfbuf. int EncSecrets::encrypt(const char* pcAscbuf, const unsigned char acIv[8], const unsigned char acKey[16], unsigned char* pcBfbuf) { EVP_CIPHER_CTX ctx; int iOutlen = 0; int iTmplen; ::EVP_CIPHER_CTX_init(&ctx); ::EVP_EncryptInit_ex(&ctx, ::EVP_bf_cbc(), NULL, acKey, acIv); if(::EVP_EncryptUpdate(&ctx, pcBfbuf, &iOutlen, reinterpret_cast(pcAscbuf), ::strlen(pcAscbuf))) { if(::EVP_EncryptFinal_ex(&ctx, pcBfbuf + iOutlen, &iTmplen)) iOutlen += iTmplen; } ::EVP_CIPHER_CTX_cleanup(&ctx); return(iOutlen); } // Blowfish decryption. int EncSecrets::decrypt(const unsigned char* pcBfbuf, int iTotal, char* pcAscbuf, const unsigned char acKey[16], const unsigned char acIv[8]) { EVP_CIPHER_CTX ctx; int iOutlen = 0; int iTmplen; ::EVP_CIPHER_CTX_init(&ctx); ::EVP_DecryptInit_ex(&ctx, ::EVP_bf_cbc(), NULL, acKey, acIv); if(::EVP_DecryptUpdate(&ctx, reinterpret_cast(pcAscbuf), &iOutlen, pcBfbuf, iTotal)) { if(::EVP_DecryptFinal(&ctx, reinterpret_cast(pcAscbuf + iOutlen), &iTmplen)) iOutlen += iTmplen; } ::EVP_CIPHER_CTX_cleanup(&ctx); return(iOutlen); } l2tp-ipsec-vpn/src/util/SecretsChecker.cpp0000664000175000017500000001231512040201227021144 0ustar wejaegerwejaeger/* * $Id: SecretsChecker.cpp 38 2011-02-05 02:01:47Z werner $ * * File: SecretsChecker.cpp * Author: wejaeger * * Created on October 3, 2010, 8:50 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "settings/ConnectionSettings.h" #include "settings/Preferences.h" #include "util/EncSecrets.h" #include "SecretsChecker.h" #include "VPNControlTask.h" static unsigned char const KEY[] = { 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; static unsigned char const IV[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; /*! * \class SecretsChecker * * \brief Checks if all secrets for a given conection name are available. */ /*! * Creates a new SecretsChecker object for the given connection name. */ SecretsChecker::SecretsChecker(const QString& strConnectionName) : m_strConnectionName(strConnectionName) { } SecretsChecker::~SecretsChecker() { } /*! * \brief Makes sure all needed secrets are available. * * Tests if needed secrets are stored in the settings of the given connection * name. * * If a secret is not stored a dialog is opened to ask for it, and the secret * is temporarily stored. * * \return false if secret is not stored in the connection settings and user * cancled the dialog when asked for the secret, true otherwise. */ bool SecretsChecker::check() const { bool fOk(true); const PppSettings pppSettings(ConnectionSettings().pppSettings(m_strConnectionName)); if (!pppSettings.refuseEap()) { const PppEapSettings eapSettings(pppSettings.eapSettings()); if (eapSettings.privateKeyPassword().isEmpty()) { if (eapSettings.privateKeyPath().startsWith(Preferences().openSSLSettings().engineId())) fOk = promptAndStoreSecret(QCoreApplication::applicationName(), QObject::tr("Please enter your PIN:"), pppSettings); else fOk = promptAndStoreSecret(QCoreApplication::applicationName(), QObject::tr("Please enter your passphrase:"), pppSettings); } } else { if (pppSettings.password().isEmpty()) fOk = promptAndStoreSecret(QCoreApplication::applicationName(), QObject::tr("Please enter your password:"), pppSettings); } return(fOk); } /*! * \brief Retrieves the clear text secret for the given identity. * * \param strIdentity as provided by the ppp passprompt.so plugin as argv[1]. * * \return the secret or a QString::null if failed to retrieve. */ QString SecretsChecker::getSecret(const QString& strIdentity) { const ConnectionSettings settings; const int iConnections = settings.connections(); QString strSecret; if (iConnections > 0) { for (int i = 0; strSecret.isNull() && i < iConnections; i++) { const QString strConnectionName(settings.connection(i)); const PppSettings pppSettings(settings.pppSettings(strConnectionName)); const PppEapSettings eapSettings(pppSettings.eapSettings()); if (eapSettings.privateKeyPath() == strIdentity) { strSecret = eapSettings.privateKeyPassword(); if (strSecret.isEmpty()) strSecret = readSecret(pppSettings); } else if (pppSettings.userName() == strIdentity) { strSecret = pppSettings.password(); if (strSecret.isEmpty()) strSecret = readSecret(pppSettings); } } } return(strSecret); } bool SecretsChecker::promptAndStoreSecret(const QString& strTitle, const QString& strLabel, const PppSettings& pppSettings) { bool fOk; const QString strPassword = QInputDialog::getText(NULL, strTitle, strLabel, QLineEdit::Password, "", &fOk); if (fOk) { QFile secretsFile(getSecretsFilePath(pppSettings)); fOk = secretsFile.open(QIODevice::WriteOnly); if (fOk) { EncSecrets secrets(KEY, IV, strPassword.toAscii().constData()); fOk = secretsFile.write(secrets.getbuf()) != -1; } } return(fOk); } QString SecretsChecker::readSecret(const PppSettings& pppSettings) { QString strSecret; QFile secretsFile(getSecretsFilePath(pppSettings)); if (secretsFile.exists()) { if (secretsFile.open(QIODevice::ReadOnly)) { QByteArray abSecret(secretsFile.readAll()); EncSecrets secrets(abSecret.data()); strSecret = secrets.retrieve(KEY, IV); } secretsFile.remove(); } return(strSecret); } QString SecretsChecker::getSecretsFilePath(const PppSettings& pppSettings) { return(QString(QDir(QDir::tempPath()).absolutePath() + QLatin1Char('/') + pppSettings.userName())); }l2tp-ipsec-vpn/src/util/NetworkInterfaceMonitor.cpp0000664000175000017500000004530212040201227023073 0ustar wejaegerwejaeger/* * $Id: NetworkInterfaceMonitor.cpp 144 2012-05-21 07:31:37Z wejaeger $ * * File: NetworkInterfaceMonitor.cpp * Author: Werner Jaeger * * Created on August 13, 2010, 8:01 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ //#include #include #include #include #include #include #include #include "NetworkInterfaceMonitor.h" #include "NetworkInterface.h" NetworkInterfaceMonitor* NetworkInterfaceMonitor::m_pInstance = 0; NetworkInterfaceMonitor::NetworkInterfaceMonitor() : m_iSocket(-1) { } NetworkInterfaceMonitor::~NetworkInterfaceMonitor() { if (m_pInstance) delete m_pInstance; } NetworkInterfaceMonitor* NetworkInterfaceMonitor::instance() { if (!m_pInstance) m_pInstance = new NetworkInterfaceMonitor(); return (m_pInstance); } void NetworkInterfaceMonitor::subscribe(const QObject* pSubscriber) { if (pSubscriber && !m_Subscribers.contains(pSubscriber)) { m_Subscribers.append(pSubscriber); connect(this, SIGNAL(routeAdded(NetworkInterface, unsigned int)), pSubscriber, SLOT(onRouteAdded(NetworkInterface, unsigned int))); connect(this, SIGNAL(routeDeleted(NetworkInterface, unsigned int)), pSubscriber, SLOT(onRouteDeleted(NetworkInterface, unsigned int))); connect(this, SIGNAL(ptpInterfaceIsUpAnRunning(NetworkInterface)), pSubscriber, SLOT(onPtpInterfaceIsUpAnRunning(NetworkInterface))); connect(this, SIGNAL(ptpInterfaceIsGoingDown(NetworkInterface)), pSubscriber, SLOT(onPtpInterfaceIsGoingDown(NetworkInterface))); } } void NetworkInterfaceMonitor::unSubscribe(const QObject* pSubscriber) { if (pSubscriber) { if (m_Subscribers.removeOne(pSubscriber)) { disconnect(this, SIGNAL(routeAdded(NetworkInterface, unsigned int)), pSubscriber, SLOT(onRouteAdded(NetworkInterface, unsigned int))); disconnect(this, SIGNAL(routeDeleted(NetworkInterface, unsigned int)), pSubscriber, SLOT(onRouteDeleted(NetworkInterface, unsigned int))); disconnect(this, SIGNAL(ptpInterfaceIsUpAnRunning(NetworkInterface)), pSubscriber, SLOT(onPtpInterfaceIsUpAnRunning(NetworkInterface))); disconnect(this, SIGNAL(ptpInterfaceIsGoingDown(NetworkInterface)), pSubscriber, SLOT(onPtpInterfaceIsGoingDown(NetworkInterface))); } } } void NetworkInterfaceMonitor::run() { // qDebug() << "Starting NetworkInterfaceMonitor thread"; m_iSocket = ::socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (m_iSocket != -1) { // qDebug() << "Socket" << m_iSocket << "created."; struct sockaddr_nl addr; ::bzero(&addr, sizeof(addr)); addr.nl_family = AF_NETLINK; addr.nl_pid = ::getpid(); addr.nl_groups = RTMGRP_IPV4_ROUTE | RTMGRP_IPV6_ROUTE | RTMGRP_LINK | RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR; if (::bind(m_iSocket, reinterpret_cast(&addr), sizeof(addr)) != -1) { m_Interfaces = NetworkInterface::pointToPointInterfaces(); ssize_t iLen; char acBuffer[1024]; while (m_iSocket != -1) { struct nlmsghdr* pNetLinkMessageHeader = reinterpret_cast(acBuffer); if ((iLen = ::recv(m_iSocket, pNetLinkMessageHeader, sizeof(acBuffer), 0)) > 0) { // outer loop: loops thru all the NETLINK headers for (bool fStop = false; !fStop && NLMSG_OK(pNetLinkMessageHeader, static_cast<__u32>(iLen)); pNetLinkMessageHeader = NLMSG_NEXT(pNetLinkMessageHeader, iLen)) { // qDebug() << "Netlink message received:" << "size =" << iLen << "type =" << pNetLinkMessageHeader->nlmsg_type; switch (pNetLinkMessageHeader->nlmsg_type) { case NLMSG_DONE: // qDebug() << "Netlink multipart message DONE"; fStop = true; break; case NLMSG_ERROR: // qDebug() << "Netlink message ERROR"; fStop = true; break; default: if (pNetLinkMessageHeader->nlmsg_type == RTM_NEWROUTE || pNetLinkMessageHeader->nlmsg_type == RTM_DELROUTE) handleRoutingMessage(pNetLinkMessageHeader); else if (pNetLinkMessageHeader->nlmsg_type == RTM_NEWLINK || pNetLinkMessageHeader->nlmsg_type == RTM_DELLINK) handleInterfaceInfoMessage(pNetLinkMessageHeader); else if (pNetLinkMessageHeader->nlmsg_type == RTM_NEWADDR || pNetLinkMessageHeader->nlmsg_type == RTM_DELADDR) handleAddressMessage(pNetLinkMessageHeader); break; } } // qDebug() << "Netlink message DONE"; pNetLinkMessageHeader = reinterpret_cast(acBuffer); } // else // qDebug() << "recv returned" << iLen; } // qDebug() << "Leaving receive loop"; } else qCritical("Failed to bind netlink socket"); } else qCritical("Failed to create a new netlink socket."); // qDebug() << "Leaving NetworkInterfaceMonitor thread"; } void NetworkInterfaceMonitor::stop() { if (m_iSocket != -1) { // qDebug() << "Stopping NetworkInterfaceMonitor thread"; ::shutdown(m_iSocket, SHUT_RDWR); m_iSocket = -1; terminate(); wait(); } } void NetworkInterfaceMonitor::handleRoutingMessage(struct nlmsghdr* pNetLinkMessageHeader) { // get route entry header struct rtmsg * const pRouteMessage = reinterpret_cast(NLMSG_DATA(pNetLinkMessageHeader)); // qDebug() << "Routing message:" << "dst len =" << pRouteMessage->rtm_dst_len << "family =" << pRouteMessage->rtm_family << "flags =" << pRouteMessage->rtm_flags << "protocol =" << pRouteMessage->rtm_protocol << "scope =" << pRouteMessage->rtm_scope << "src len =" << pRouteMessage->rtm_src_len << "table =" << pRouteMessage->rtm_table << "tos =" << pRouteMessage->rtm_tos << "type =" << pRouteMessage->rtm_type; // we are only concerned about the main route table if (pRouteMessage->rtm_table == RT_TABLE_MAIN) { // fields to hold content of an entry of the route table char acInterfaceName[IFNAMSIZ], acDsts[INET6_ADDRSTRLEN], acGws[INET6_ADDRSTRLEN]; uint32_t iPriority = 0; // init all the field ::bzero(acInterfaceName, sizeof (acInterfaceName)); ::bzero(acDsts, sizeof(acDsts)); ::bzero(acGws, sizeof(acGws)); // inner loop: loop thru all the attributes of one route entry struct rtattr* pRoutingAttributes = RTM_RTA(pRouteMessage); int iPayloadLength = RTM_PAYLOAD(pNetLinkMessageHeader); while (iPayloadLength && RTA_OK(pRoutingAttributes, iPayloadLength)) { // qDebug() << "Routing attribute: type =" << pRoutingAttributes->rta_type << "len =" << pRoutingAttributes->rta_len; switch (pRoutingAttributes->rta_type) { case RTA_DST: // destination IPv4 or IPv6 address ::inet_ntop(pRouteMessage->rtm_family, RTA_DATA(pRoutingAttributes), acDsts, INET6_ADDRSTRLEN); break; case RTA_GATEWAY: // next hop IPv4 or IPv6 address ::inet_ntop(pRouteMessage->rtm_family, RTA_DATA(pRoutingAttributes), acGws, INET6_ADDRSTRLEN); break; case RTA_PRIORITY: // metric iPriority = *reinterpret_cast(RTA_DATA(pRoutingAttributes)); break; case RTA_OIF: // unique ID associated with the network interface ::if_indextoname(*reinterpret_cast(RTA_DATA(pRoutingAttributes)), acInterfaceName); break; default: break; } pRoutingAttributes = RTA_NEXT(pRoutingAttributes, iPayloadLength); } NetworkInterface::InterfaceMap::iterator itInterfaces = m_Interfaces.find(acInterfaceName); if (itInterfaces == m_Interfaces.end()) { const NetworkInterface::InterfaceMapEntry entry(std::make_pair(acInterfaceName, NetworkInterface(acInterfaceName, ::if_nametoindex(acInterfaceName), IFF_UP | IFF_RUNNING))); itInterfaces = m_Interfaces.insert(entry).first; } QNetworkAddressEntry routeEntry; routeEntry.setIp(QHostAddress(acDsts)); routeEntry.setPrefixLength(pRouteMessage->rtm_dst_len); routeEntry.setBroadcast(QHostAddress(acGws)); (*itInterfaces).second.clearRouteEntries(); (*itInterfaces).second.addRouteEntry(routeEntry); if (pNetLinkMessageHeader->nlmsg_type == RTM_NEWROUTE) { // qDebug() << "Route added:" << "IF =" << acInterfaceName << "DST =" << acDsts << "GW =" << acGws << "Priority =" << iPriority; emit routeAdded((*itInterfaces).second, iPriority); } else { // qDebug() << "Route deleted:" << "IF =" << acInterfaceName << "DST =" << acDsts << "GW =" << acGws << "Priority =" << iPriority; emit routeDeleted((*itInterfaces).second, iPriority); } } } void NetworkInterfaceMonitor::handleInterfaceInfoMessage(struct nlmsghdr* pNetLinkMessageHeader) { // get interface info header struct ifinfomsg * const pInterfaceInfoMessage = reinterpret_cast(NLMSG_DATA(pNetLinkMessageHeader)); // strings to hold content of an entry of the route table char acInterfaceName[IFNAMSIZ]; // init all the strings ::bzero(acInterfaceName, sizeof (acInterfaceName)); ::if_indextoname(pInterfaceInfoMessage->ifi_index, acInterfaceName); // qDebug() << "Interface info message:" << "name =" << acInterfaceName << "family =" << pInterfaceInfoMessage->ifi_family << "device type =" << pInterfaceInfoMessage->ifi_type << "interface index =" << pInterfaceInfoMessage->ifi_index << "device flags =" << pInterfaceInfoMessage->ifi_flags << "change mask =" << pInterfaceInfoMessage->ifi_change; #ifndef QT_NO_DEBUG // debugFlags(pInterfaceInfoMessage->ifi_flags); #endif // inner loop: loop thru all the attributes of one interface info entry struct rtattr* pInterfaceAttributes = IFLA_RTA(pInterfaceInfoMessage); int iPayloadLength = IFLA_PAYLOAD(pNetLinkMessageHeader); while (iPayloadLength && RTA_OK(pInterfaceAttributes, iPayloadLength)) { // qDebug() << "Interface attribute: type =" << pInterfaceAttributes->rta_type << "len =" << pInterfaceAttributes->rta_len; const int iAddressLen = RTA_PAYLOAD(pInterfaceAttributes); // qDebug() << "Payload length =" << iAddressLen; switch (pInterfaceAttributes->rta_type) { case IFLA_ADDRESS: // MAC address break; case IFLA_BROADCAST: //2 struct sockaddr_ll addr; ::bzero(&addr, sizeof(addr)); ::memcpy(addr.sll_addr, RTA_DATA(pInterfaceAttributes), iAddressLen); addr.sll_family = AF_PACKET; addr.sll_ifindex = pInterfaceInfoMessage->ifi_family; addr.sll_halen = iAddressLen; addr.sll_hatype = pInterfaceInfoMessage->ifi_type; break; case IFLA_IFNAME: // 3 if (::strlen(acInterfaceName) == 0) ::strcpy(acInterfaceName, reinterpret_cast(RTA_DATA(pInterfaceAttributes))); break; case IFLA_MTU: // 4 case IFLA_QDISC: // 6 case IFLA_STATS: // 7 case IFLA_PROTINFO: // 12 case IFLA_TXQLEN: // 13 case IFLA_MAP: // 14 case IFLA_OPERSTATE: // 16 case IFLA_LINKMODE: // 17 break; } pInterfaceAttributes = RTA_NEXT(pInterfaceAttributes, iPayloadLength); } if (pNetLinkMessageHeader->nlmsg_type == RTM_NEWLINK && (pInterfaceInfoMessage->ifi_flags & IFF_POINTOPOINT)) { const NetworkInterface::InterfaceMap::iterator itInterfaces = m_Interfaces.find(acInterfaceName); if (itInterfaces != m_Interfaces.end()) { const NetworkInterface::InterfaceFlags oldFlags((*itInterfaces).second.flags()); (*itInterfaces).second.setFlags(pInterfaceInfoMessage->ifi_flags); if ((pInterfaceInfoMessage->ifi_flags & IFF_UP) && (pInterfaceInfoMessage->ifi_flags & IFF_RUNNING) && !(oldFlags.testFlag(NetworkInterface::IsUp) && oldFlags.testFlag(NetworkInterface::IsRunning))) { // qDebug() << "Interface" << acInterfaceName << "is up and running"; emit ptpInterfaceIsUpAnRunning((*itInterfaces).second); } if (oldFlags.testFlag(NetworkInterface::IsUp) && oldFlags.testFlag(NetworkInterface::IsRunning) && !((pInterfaceInfoMessage->ifi_flags & IFF_UP) && (pInterfaceInfoMessage->ifi_flags & IFF_RUNNING))) { // qDebug() << "Interface" << acInterfaceName << "is going down"; emit ptpInterfaceIsGoingDown((*itInterfaces).second); } } else { // qDebug() << "Interface" << acInterfaceName << "added"; const NetworkInterface::InterfaceMapEntry entry(std::make_pair(acInterfaceName, NetworkInterface(acInterfaceName, pInterfaceInfoMessage->ifi_index, pInterfaceInfoMessage->ifi_flags))); m_Interfaces.insert(entry); } } else if (pNetLinkMessageHeader->nlmsg_type == RTM_DELLINK && pInterfaceInfoMessage->ifi_flags & IFF_POINTOPOINT) { const NetworkInterface::InterfaceMap::iterator itInterfaces = m_Interfaces.find(acInterfaceName); if (itInterfaces != m_Interfaces.end()) { // qDebug() << "Interface" << acInterfaceName << "deleted"; m_Interfaces.erase(itInterfaces); } } } void NetworkInterfaceMonitor::handleAddressMessage(struct nlmsghdr* pNetLinkMessageHeader) { struct ifaddrmsg* const pInterfaceAddressMessage = reinterpret_cast(NLMSG_DATA(pNetLinkMessageHeader)); // qDebug() << "Address message: family =" << pInterfaceAddressMessage->ifa_family << "flags =" << pInterfaceAddressMessage->ifa_flags << "index =" << pInterfaceAddressMessage->ifa_index << "prefix len =" << pInterfaceAddressMessage->ifa_prefixlen << "scope =" << pInterfaceAddressMessage->ifa_scope; // strings to hold content of an entry of the route table char acInterfaceName[IFNAMSIZ], acIp[INET6_ADDRSTRLEN], acBroadcast[INET6_ADDRSTRLEN]; // init all the strings ::bzero(acInterfaceName, sizeof (acInterfaceName)); ::bzero(acIp, sizeof(acIp)); ::bzero(acBroadcast, sizeof(acBroadcast)); ::if_indextoname(pInterfaceAddressMessage->ifa_index, acInterfaceName); // inner loop: loop thru all the attributes of one address entry struct rtattr* pAddressAttributes = IFA_RTA(pInterfaceAddressMessage); int iPayloadLength = IFA_PAYLOAD(pNetLinkMessageHeader); while (iPayloadLength && RTA_OK(pAddressAttributes, iPayloadLength)) { // qDebug() << "Address attribute: type =" << pAddressAttributes->rta_type << "len =" << pAddressAttributes->rta_len; switch (pAddressAttributes->rta_type) { case IFA_ADDRESS: // 1 ::inet_ntop(pInterfaceAddressMessage->ifa_family, RTA_DATA(pAddressAttributes), acBroadcast, INET6_ADDRSTRLEN); break; case IFA_LOCAL: // 2 ::inet_ntop(pInterfaceAddressMessage->ifa_family, RTA_DATA(pAddressAttributes), acIp, INET6_ADDRSTRLEN); break; case IFA_LABEL: // 3 break; case IFA_BROADCAST: // 4 break; case IFA_ANYCAST: // 5 break; case IFA_CACHEINFO: // 6 break; case IFA_MULTICAST: // 7 break; } pAddressAttributes = RTA_NEXT(pAddressAttributes, iPayloadLength); } NetworkInterface::InterfaceMap::iterator itInterfaces = m_Interfaces.find(acInterfaceName); if (itInterfaces == m_Interfaces.end()) { const NetworkInterface::InterfaceMapEntry entry(std::make_pair(acInterfaceName, NetworkInterface(acInterfaceName, ::if_nametoindex(acInterfaceName), IFF_UP | IFF_RUNNING))); itInterfaces = m_Interfaces.insert(entry).first; } QNetworkAddressEntry addressEntry; addressEntry.setIp(QHostAddress(acIp)); addressEntry.setPrefixLength(pInterfaceAddressMessage->ifa_prefixlen); addressEntry.setBroadcast(QHostAddress(acBroadcast)); (*itInterfaces).second.clearAddressEntries(); (*itInterfaces).second.addAddressEntry(addressEntry); // if (pNetLinkMessageHeader->nlmsg_type == RTM_NEWADDR) // qDebug() << "Address added:" << "IF =" << acInterfaceName << "IP =" << acIp << "Broadcast =" << acBroadcast; // else // qDebug() << "Address deleted:" << "IF =" << acInterfaceName << "IP =" << acIp << "Broad =" << acBroadcast; } #ifndef QT_NO_DEBUG void NetworkInterfaceMonitor::debugFlags(unsigned iFlags) { if (iFlags & IFF_UP) qDebug() << "Interface" << "is Up"; if (iFlags & IFF_BROADCAST) qDebug() << "Interface" << "broadcast address is valid"; if (iFlags & IFF_DEBUG) qDebug() << "Interface" << "debug is turned on"; if (iFlags & IFF_LOOPBACK) qDebug() << "Interface" << "is loop back"; if (iFlags & IFF_POINTOPOINT) qDebug() << "Interface" << "is Ptp"; if (iFlags & IFF_NOTRAILERS) qDebug() << "Interface" << "avoid trailers"; if (iFlags & IFF_RUNNING) qDebug() << "Interface" << "is running"; if (iFlags & IFF_NOARP) qDebug() << "Interface" << "has no address resolution protocol"; if (iFlags & IFF_PROMISC) qDebug() << "Interface" << "is in promiscous mode"; if (iFlags & IFF_ALLMULTI) qDebug() << "Interface" << "receives all multicast packets"; if (iFlags & IFF_MASTER) qDebug() << "Interface" << "is master of a load balancer"; if (iFlags & IFF_SLAVE) qDebug() << "Interface" << "is slave of a load balancer"; if (iFlags & IFF_MULTICAST) qDebug() << "Interface" << "supports multicast"; if (iFlags & IFF_PORTSEL) qDebug() << "Interface" << "can set media type"; if (iFlags & IFF_AUTOMEDIA) qDebug() << "Interface" << "auto media select is active"; if (iFlags & IFF_DYNAMIC) qDebug() << "Interface" << "is a dialup device with changing addresses"; } #endif l2tp-ipsec-vpn/src/util/CertificateInfo.h0000664000175000017500000000334712040201227020757 0ustar wejaegerwejaeger/* * $Id: CertificateInfo.h 151 2012-08-03 16:42:07Z wejaeger $ * * File: CertificateInfo.h * Author: Werner Jaeger * * Created on July 27, 2010, 6:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CERTIFICATEINFO_H #define CERTIFICATEINFO_H #include class QSslCertificate; class CertificateInfo { public: explicit CertificateInfo(const QString& strFilePath); explicit CertificateInfo(const QByteArray& data); virtual ~CertificateInfo(); QString path() const; QString fileName() const; QString filePath() const; bool isReadable() const; QString serialNumber() const; QString cn() const; QString issuer() const; QString email() const; bool toPem(const QString& strPemFilePath) const; private: CertificateInfo(const CertificateInfo& orig); CertificateInfo& operator=(const CertificateInfo& orig); QString alternateSubjectName(const QSsl::AlternateNameEntryType type) const; static QSslCertificate* readCert(const QString& strFilePath); QString m_strFilePath; QSslCertificate* const m_pQSslCertificate; }; #endif /* CERTIFICATEINFO_H */ l2tp-ipsec-vpn/src/util/ErrorEx.h0000664000175000017500000000332112040201227017277 0ustar wejaegerwejaeger/* * $Id: ErrorEx.h 13 2010-09-17 09:12:39Z werner $ * * File: ErrorEx.h * Author: Werner Jaeger * * Created on July 31, 2010, 4:30 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef ERROREX_H #define ERROREX_H #include #include class ErrorEx { public: ErrorEx(QString strText, QString strClassName = "") { m_strMsg = strText; if (!strClassName.isEmpty()) m_strMsg += " (" + strClassName + ")"; } ErrorEx(const ErrorEx& errorEx) { m_strMsg = errorEx.m_strMsg; } virtual ~ErrorEx() {} void appendString(QString strText) { m_strMsg = m_strMsg + " " + strText; } QString getString() const { return(m_strMsg); } const char* getCString() const { return(m_strMsg.toAscii()); } bool isEmpty() const { return(m_strMsg.isEmpty()); } static void checkOutOfMemory(const void* pVoid) { if (!pVoid) throw ErrorEx(QObject::tr("Out of Memory")); } private: ErrorEx& operator=(const ErrorEx& orig); QString m_strMsg; }; #endif /* ERROREX_H */ l2tp-ipsec-vpn/src/util/GlobalFunctions.h0000664000175000017500000000256612040201227021014 0ustar wejaegerwejaeger/* * $Id: GlobalFunctions.h 64 2011-04-05 03:39:39Z werner $ * * File: GlobalFunctions.h * Author: Werner Jaeger * * Created on July 31, 2010, 7:28 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef GLOBALFUNCTIONS_H #define GLOBALFUNCTIONS_H #include class QRegExp; const QRegExp& ipv4ValidationRE(); const QRegExp& ipValidationRE(); const QRegExp& gatewayValidationRE(); const QRegExp& hostNameValidationRE(); const QRegExp& hostNameListValidationRE(); QString utf82QString(const void* vpValue, unsigned long ulLen); QByteArray fileName2ByteArray(const QString& strFileName); const char* string2FileName(const QString& strFileNme); void showHelp(const QString& strFragment = QString::null); #endif /* GLOBALFUNCTIONS_H */ l2tp-ipsec-vpn/src/util/NetworkInterfaceMonitor.h0000664000175000017500000000434412040201227022541 0ustar wejaegerwejaeger/* * $Id: NetworkInterfaceMonitor.h 13 2010-09-17 09:12:39Z werner $ * * File: NetworkInterfaceMonitor.h * Author: Werner Jaeger * * Created on August 13, 2010, 8:01 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef NETWORKINTERFACEMONITOR_H #define NETWORKINTERFACEMONITOR_H #include #include #include "NetworkInterface.h" class NetworkInterfaceMonitor : public QThread { Q_OBJECT public: virtual ~NetworkInterfaceMonitor(); void run(); void stop(); void subscribe(const QObject* pSubscriber); void unSubscribe(const QObject* pSubscriber); static NetworkInterfaceMonitor* instance(); protected: NetworkInterfaceMonitor(); signals: void routeAdded(NetworkInterface interface, unsigned int iPriority) const; void routeDeleted(NetworkInterface interface, unsigned int iPriority) const; void ptpInterfaceIsUpAnRunning(NetworkInterface interface) const; void ptpInterfaceIsGoingDown(NetworkInterface interface) const; private: NetworkInterfaceMonitor(const NetworkInterfaceMonitor& orig); NetworkInterfaceMonitor& operator=(const NetworkInterfaceMonitor& orig); void handleRoutingMessage(struct nlmsghdr* pNetLinkMessageHeader); void handleInterfaceInfoMessage(struct nlmsghdr* pNetLinkMessageHeader); void handleAddressMessage(struct nlmsghdr* pNetLinkMessageHeader); #ifndef QT_NO_DEBUG static void debugFlags(unsigned iFlags); #endif QList m_Subscribers; int m_iSocket; NetworkInterface::InterfaceMap m_Interfaces; static NetworkInterfaceMonitor* m_pInstance; }; #endif /* NETWORKINTERFACEMONITOR_H */ l2tp-ipsec-vpn/src/util/CertificateInfo.cpp0000664000175000017500000000702112040201227021303 0ustar wejaegerwejaeger/* * $Id: CertificateInfo.cpp 151 2012-08-03 16:42:07Z wejaeger $ * * File: CertificateInfo.cpp * Author: Werner Jaeger * * Created on July 27, 2010, 6:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include "CertificateInfo.h" CertificateInfo::CertificateInfo(const QString& strFilePath) : m_strFilePath(strFilePath), m_pQSslCertificate(readCert(strFilePath)) { } CertificateInfo::CertificateInfo(const QByteArray& data) : m_strFilePath(""), m_pQSslCertificate(new QSslCertificate(data, QSsl::Der)) { } CertificateInfo::~CertificateInfo() { if (m_pQSslCertificate) delete m_pQSslCertificate; } QString CertificateInfo::path() const { return(QFileInfo(m_strFilePath).path()); } QString CertificateInfo::fileName() const { return(QFileInfo(m_strFilePath).fileName()); } QString CertificateInfo::filePath() const { return(m_strFilePath); } bool CertificateInfo::isReadable() const { return(m_pQSslCertificate && !m_pQSslCertificate->isNull()); } QString CertificateInfo::serialNumber() const { QString strRet; if (isReadable()) strRet = m_pQSslCertificate->serialNumber(); return(strRet); } QString CertificateInfo::cn() const { QString strRet; if (isReadable()) strRet = m_pQSslCertificate->subjectInfo(QSslCertificate::CommonName); return(strRet); } QString CertificateInfo::issuer() const { QString strRet; if (isReadable()) strRet = m_pQSslCertificate->issuerInfo(QSslCertificate::CommonName); return(strRet); } QString CertificateInfo::email() const { QString strRet; if (isReadable()) { const QByteArray tag("emailAddress"); strRet = m_pQSslCertificate->subjectInfo(tag); if (strRet.isNull()) strRet = alternateSubjectName(QSsl::EmailEntry); } return(strRet); } bool CertificateInfo::toPem(const QString& strPemFilePath) const { QFile pemFile(strPemFilePath); bool fRet(pemFile.open(QFile::WriteOnly)); if (fRet) { fRet = (pemFile.write(m_pQSslCertificate->toPem()) != -1); pemFile.close(); } return(fRet); } QString CertificateInfo::alternateSubjectName(const QSsl::AlternateNameEntryType type) const { QString strRet; if (isReadable()) { const QMultiMap alternateSubjectNames(m_pQSslCertificate->alternateSubjectNames()); const QMultiMap::iterator it(alternateSubjectNames.constFind(type)); if (it != alternateSubjectNames.end()) strRet = it.value(); } return(strRet); } QSslCertificate* CertificateInfo::readCert(const QString& strFilePath) { QFile file(strFilePath); file.open(QFile::ReadOnly); QSslCertificate* pQSslCertificate(new QSslCertificate(&file)); file.close(); return(pQSslCertificate); }l2tp-ipsec-vpn/src/util/Libtool.h0000664000175000017500000000252012040201227017315 0ustar wejaegerwejaeger/* * $Id: Libtool.h 45 2011-02-12 00:25:26Z werner $ * * File: Libtool.h * Author: wejaeger * * Created on February 8, 2011, 1:27 PM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LIBTOOL_H #define LIBTOOL_H class QString; struct lt__handle; class Libtool { public: Libtool(const QString& strLibraryFilePath); virtual ~Libtool(); bool hasSymbol(const QString& strSymbolName) const; private: Libtool(const Libtool& orig); Libtool& operator=(const Libtool& orig); bool loaded() const { return !!m_pLoadedModuleHandle; }; void exit() const; static lt__handle* init(const QString& strLibraryFilePath); lt__handle* const m_pLoadedModuleHandle; }; #endif /* LIBTOOL_H */ l2tp-ipsec-vpn/src/util/Pkcs12.h0000664000175000017500000000363312040201227016762 0ustar wejaegerwejaeger/* * $Id: Pkcs12.h 76 2011-04-16 07:11:33Z werner $ * * File: Pkcs12.h * Author: wejaeger * * Created on April 8, 2011, 11:48 AM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PKCS12_H #define PKCS12_H #include #include #include class CertificateInfo; class Pkcs12 : public QObject { public: Pkcs12(const QString& strFilenamePath, const QString& strPassphrase); virtual ~Pkcs12(); const QString& error() const { return(m_strError); } const QString issuer() const; const QString cn() const; const QString serialNumber() const; bool hasPrivateKey() const { return(m_pKey); } int caCerts() const { return(::sk_num(reinterpret_cast(m_pAdditionalCerts))); } bool cert2Pem(const QString& strFilenamePath); int caChain2Pem(const QString& strFilenamePath); bool privateKey2Pem(const QString& strFilenamePath, const QString& strPassphrase); private: Pkcs12(const Pkcs12& orig); Pkcs12& operator=(const Pkcs12& orig); void parse(const QString& strFilenamePath, const QString& strPassphrase); PKCS12* m_p12Cert; EVP_PKEY* m_pKey; X509* m_pX509Cert; STACK_OF(X509)* m_pAdditionalCerts; QString m_strError; const CertificateInfo* m_pCertificateInfo; }; #endif /* PKCS12_H */ l2tp-ipsec-vpn/src/util/NetworkInterface.cpp0000664000175000017500000002761212040201227021527 0ustar wejaegerwejaeger/* * $Id: NetworkInterface.cpp 129 2012-04-07 10:15:46Z wejaeger $ * * File: NetworkInterface.cpp * Author: Werner Jaeger * * Created on July 12, 2010, 6:07 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ //#include #include #include #include #include #include #include #include #include #include "util/VpnControlDaemonClient.h" #include "NetworkInterface.h" const char* const pcProcNetDevPath("/proc/net/dev"); const char* const pcDefaultGatewayInfoPath("/var/run/L2tpIPsecVpnControlDaemon/defaultgateway.info"); const NetworkInterface NetworkInterface::null(NetworkInterface("", 0, 0)); NetworkInterface::NetworkInterface(const NetworkInterface& orig) : m_strName(orig.m_strName), m_iIndex(orig.m_iIndex), m_Flags(orig.m_Flags), m_AddressEntries(orig.m_AddressEntries), m_RouteEntries(orig.m_RouteEntries) { } bool NetworkInterface::operator==(const NetworkInterface& other) const { return(m_strName.compare(other.m_strName) == 0); } bool NetworkInterface::hasDefaultGateway() const { bool fRet = false; AddressEntries::const_iterator it(m_RouteEntries.begin()); for (; !fRet && it != m_RouteEntries.end(); it++) fRet = (*it).ip().isNull();// && !(*it).broadcast().isNull(); return(fRet); } bool NetworkInterface::isDefaultGateway() const { return(NetworkInterface::defaultGatewayInfo().interfaceName().compare(m_strName) == 0); } bool NetworkInterface::removeAddressEntry(const QNetworkAddressEntry& addressEntry) { bool fFound = false; AddressEntries::iterator it(m_AddressEntries.begin()); while (!fFound && it != m_AddressEntries.end()) { if ((*it++) == addressEntry) { fFound = true; it = m_AddressEntries.erase(it); } } return(fFound); } bool NetworkInterface::removeRouteEntry(const QNetworkAddressEntry& routeEntry) { bool fFound = false; AddressEntries::iterator it(m_RouteEntries.begin()); while (!fFound && it != m_RouteEntries.end()) { if ((*it++) == routeEntry) { fFound = true; it = m_RouteEntries.erase(it); } } return(fFound); } NetworkInterface::InterfaceMap NetworkInterface::pointToPointInterfaces(void) { InterfaceMap interfaces; struct ifaddrs* pInterfaceAddresses; if (::getifaddrs(&pInterfaceAddresses) == 0) { for (const struct ifaddrs* pIter = pInterfaceAddresses; pIter != NULL; pIter = pIter->ifa_next) { if (pIter->ifa_addr && (pIter->ifa_addr->sa_family == AF_INET || pIter->ifa_addr->sa_family == AF_INET6) && pIter->ifa_flags & IFF_POINTOPOINT && pIter->ifa_flags & IFF_RUNNING) { const InterfaceMapEntry entry(std::make_pair(pIter->ifa_name, NetworkInterface(pIter->ifa_name, ::if_nametoindex(pIter->ifa_name), pIter->ifa_flags))); std::pair ret = interfaces.insert(entry); QNetworkAddressEntry addressEntry; addressEntry.setIp(QHostAddress(pIter->ifa_addr)); if (pIter->ifa_netmask != NULL) addressEntry.setNetmask(QHostAddress(pIter->ifa_netmask)); if (pIter->ifa_dstaddr) addressEntry.setBroadcast(QHostAddress(pIter->ifa_dstaddr)); (*ret.first).second.addAddressEntry(addressEntry); } } ::freeifaddrs(pInterfaceAddresses); } return(interfaces); } NetworkInterface::InterfaceMap NetworkInterface::defaultGateway(void) { InterfaceMap interfaces; using namespace std; string strInterfaceName; uint32 iDestinationAddress = -1; uint32 iGatewayAddress = -1; ifstream route("/proc/net/route", ios::in); while (iDestinationAddress && route) { string strLine; getline(route, strLine); // qDebug() << "NetworkInterface::defaultGateway: route entry:" << strLine.c_str(); istringstream strFormat(strLine); strFormat >> strInterfaceName >> hex >> iDestinationAddress >> hex >> iGatewayAddress ; if (!strFormat.good() || iGatewayAddress == 0) iDestinationAddress = -1; } if (iDestinationAddress == 0 && !strInterfaceName.empty()) { // qDebug() << "NetworkInterface::defaultGateway: found default gateway on interface" << strInterfaceName.c_str() << "dest Addr =" << iDestinationAddress << "gateway =" << iGatewayAddress; const InterfaceMapEntry entry(std::make_pair(strInterfaceName, NetworkInterface(strInterfaceName.c_str(), ::if_nametoindex(strInterfaceName.c_str()), IFF_UP | IFF_RUNNING))); std::pair ret = interfaces.insert(entry); QNetworkAddressEntry routeEntry; routeEntry.setIp(QHostAddress(be32toh(iDestinationAddress))); routeEntry.setNetmask(QHostAddress()); routeEntry.setBroadcast(QHostAddress(be32toh(iGatewayAddress))); (*ret.first).second.addRouteEntry(routeEntry); } return(interfaces); } QStringList NetworkInterface::dns(void) { using namespace std; QStringList list; ifstream resolv("/etc/resolv.conf", ios::in); while (resolv) { string strLine; getline(resolv, strLine); if (strLine.length() > 0) { istringstream strFormat(strLine); string strKey; string strValue; strFormat >> strKey >> strValue; if (strKey == "nameserver") list.append(strValue.c_str()); } } return(list); } NetworkInterface::Statistic NetworkInterface::statistic(const std::string& strInterfaceName) { using namespace std; Statistic::Values receivedValues; Statistic::Values transmittedValues; ifstream statStream(pcProcNetDevPath, ios::in); string strLine; // read first header line if (statStream) getline(statStream, strLine); // read second header line if (statStream) { getline(statStream, strLine); string::size_type firstPipe(strLine.find('|') + 1); string::size_type secondPipe(strLine.rfind('|')); // there must be two pipe characters separating received part from transmitted part if (firstPipe != string::npos && secondPipe != string::npos) { Statistic::Headers receivedHeaders; string strReceivedHeaders(strLine.substr(firstPipe, secondPipe -firstPipe)); istringstream formatReceived(strReceivedHeaders); while (formatReceived) { string strText; formatReceived >> strText; if (!strText.empty()) receivedHeaders.push_back(strText); } Statistic::Headers transmittedHeaders; string strTransmittedHeaders(strLine.substr(secondPipe + 1)); istringstream formatTransmitted(strTransmittedHeaders); while (formatTransmitted) { string strText; formatTransmitted >> strText; if (!strText.empty()) transmittedHeaders.push_back(strText); } bool fDone(false); while (statStream && !fDone) { getline(statStream, strLine); string::size_type colonFound(strLine.find(':')); // there must be a colon as separator for the interface name if (colonFound != string::npos) { istringstream format(strLine.replace(colonFound, 1, " ")); string strName; format >> strName; if (strName == strInterfaceName) { long long lVal; for (Statistic::Headers::size_type i = 0; i < receivedHeaders.size() && format; i++) { format >> lVal; receivedValues.insert(std::make_pair(receivedHeaders.at(i), lVal)); } for (Statistic::Headers::size_type i = 0; i < transmittedHeaders.size() && format; i++) { format >> lVal; transmittedValues.insert(std::make_pair(transmittedHeaders.at(i), lVal)); } fDone = true; } } } } } return(Statistic(receivedValues, transmittedValues)); } NetworkInterface::DefaultGatewayInfo NetworkInterface::defaultGatewayInfo() { using namespace std; string strInterfaceName; string strGateway; string strIPAddress; ifstream defaultGatewayInfo(pcDefaultGatewayInfoPath, ios::in); while (defaultGatewayInfo) { string strLine; getline(defaultGatewayInfo, strLine); if (strLine.length() > 0) { istringstream strFormat(strLine.replace(strLine.find('='), 1, " ")); string strKey; string strValue; strFormat >> strKey >> strValue; if (strKey == "defaultroutephys") strInterfaceName = strValue; else if (strKey == "defaultrouteaddr") strIPAddress = strValue; else if (strKey == "defaultroutenexthop") strGateway = strValue; } } return(DefaultGatewayInfo(strInterfaceName, strGateway, strIPAddress)); } bool NetworkInterface::writeDefaultGatewayInfo() { bool fRet(false); const InterfaceMap defInterfaces(defaultGateway()); if (defInterfaces.size() > 0) { const NetworkInterface nif((*defInterfaces.begin()).second); if (nif.routeEntries().size() > 0) { using namespace std; const QNetworkAddressEntry ae(nif.routeEntries()[0]); stringstream strDefaultGatewayInfo; strDefaultGatewayInfo << "defaultroutephys=" << nif.m_strName << '\3'; strDefaultGatewayInfo << "defaultroutevirt=none" << '\3'; strDefaultGatewayInfo << "defaultrouteaddr=" << ipAddress(nif.m_strName) << '\3'; strDefaultGatewayInfo << "defaultroutenexthop=" << ae.broadcast().toString().toStdString() << '\3'; if (!strDefaultGatewayInfo.fail()) { int iRet(VpnControlDaemonClient::execute(VpnClientConnection::CMD_WRITE_DEFAULT_GATEWAY_INFO, QString::fromStdString(strDefaultGatewayInfo.str()))); fRet = (iRet == 0); } } } return(fRet); } NetworkInterface::InterfaceFlags NetworkInterface::convertFlags(uint iRawFlags) { InterfaceFlags flags = InterfaceFlag(0); flags |= (iRawFlags & IFF_UP) ? IsUp : InterfaceFlag(0); flags |= (iRawFlags & IFF_RUNNING) ? IsRunning : InterfaceFlag(0); flags |= (iRawFlags & IFF_BROADCAST) ? CanBroadcast : InterfaceFlag(0); flags |= (iRawFlags & IFF_LOOPBACK) ? IsLoopBack : InterfaceFlag(0); flags |= (iRawFlags & IFF_POINTOPOINT) ? IsPointToPoint : InterfaceFlag(0); flags |= (iRawFlags & IFF_MULTICAST) ? CanMulticast : InterfaceFlag(0); return(flags); } std::string NetworkInterface::ipAddress(const std::string& strInterfaceName) { std::string strIpAddress; struct ifaddrs* pInterfaceAddresses; if (::getifaddrs(&pInterfaceAddresses) == 0) { for (const struct ifaddrs* pIter = pInterfaceAddresses; pIter != NULL && strIpAddress.empty(); pIter = pIter->ifa_next) { if (pIter->ifa_addr && (pIter->ifa_addr->sa_family == AF_INET || pIter->ifa_addr->sa_family == AF_INET6)) { if (strInterfaceName.compare(pIter->ifa_name) == 0) strIpAddress = QHostAddress(pIter->ifa_addr).toString().toStdString(); } } ::freeifaddrs(pInterfaceAddresses); } return(strIpAddress); } l2tp-ipsec-vpn/src/util/SecretsChecker.h0000664000175000017500000000312712040201227020612 0ustar wejaegerwejaeger/* * $Id: SecretsChecker.h 24 2010-10-07 12:35:00Z werner $ * * File: SecretsChecker.h * Author: wejaeger * * Created on October 3, 2010, 8:50 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SECRETSCHECKER_H #define SECRETSCHECKER_H #include #include class PppSettings; class PppEapSettings; class SecretsChecker { public: explicit SecretsChecker(const QString& strConnectionName); virtual ~SecretsChecker(); bool check() const; static QString getSecret(const QString& strIdentity); private: SecretsChecker(const SecretsChecker& orig); SecretsChecker& operator=(const SecretsChecker& orig); static bool promptAndStoreSecret(const QString& strTitle, const QString& strLabel, const PppSettings& pppSettings); static QString readSecret(const PppSettings& pppSettings); static QString getSecretsFilePath(const PppSettings& pppSettings); const QString& m_strConnectionName; }; #endif /* SECRETSCHECKER_H */ l2tp-ipsec-vpn/src/util/Pkcs12.cpp0000664000175000017500000001370512040201227017316 0ustar wejaegerwejaeger/* * $Id: Pkcs12.cpp 119 2012-03-02 10:11:22Z werner $ * * File: Pkcs12.cpp * Author: wejaeger * * Created on April 8, 2011, 11:48 AM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "pkcs11/Pkcs11.h" #include "CertificateInfo.h" #include "Pkcs12.h" /*! \class Pkcs12 \brief The Pkcs12 class is for manipulating certificate bundles in PKCS#12 fomat. A PKCS#12 file contains the certificate, private key and all the intermediate certificate's in a certificate chain and is encrypted with a password. */ static int passwordCallback(char* pcBuf, int iSize, int /* iRwFlag */, void* pvPassword) { ::strncpy(pcBuf, reinterpret_cast(pvPassword), iSize); pcBuf[iSize - 1] = '\0'; return(::strlen(pcBuf)); } Pkcs12::Pkcs12(const QString& strFilenamePath, const QString& strPassphrase) : m_p12Cert(NULL), m_pKey(NULL), m_pX509Cert(NULL), m_pAdditionalCerts(NULL), m_strError(QString::null), m_pCertificateInfo(NULL) { parse(strFilenamePath, strPassphrase); } Pkcs12::~Pkcs12() { ::sk_X509_pop_free(m_pAdditionalCerts, ::X509_free); ::X509_free(m_pX509Cert); ::EVP_PKEY_free(m_pKey); ::PKCS12_free(m_p12Cert); if (m_pCertificateInfo) delete m_pCertificateInfo; } const QString Pkcs12::issuer() const { QString strIssuer; if (m_pCertificateInfo) strIssuer = m_pCertificateInfo->issuer(); return(strIssuer); } const QString Pkcs12::cn() const { QString strCN; if (m_pCertificateInfo) strCN = m_pCertificateInfo->cn(); return(strCN); } const QString Pkcs12::serialNumber() const { QString strSN; if (m_pCertificateInfo) strSN = m_pCertificateInfo->serialNumber(); return(strSN); } bool Pkcs12::cert2Pem(const QString& strFilenamePath) { bool fRet(false); if (m_pX509Cert) { FILE* const pPemFile(::fopen(strFilenamePath.toUtf8().constData(), "wb")); if (pPemFile) { if (::PEM_write_X509(pPemFile, m_pX509Cert)) fRet = true; else m_strError = tr("Writing certificate to") + "" + strFilenamePath + "" + tr("failed"); ::fclose(pPemFile); } else m_strError = strFilenamePath + ": " + ::strerror(errno); } else m_strError = tr("No certificate found"); return(fRet); } int Pkcs12::caChain2Pem(const QString& strFilenamePath) { int iRet(0); const int iNoOfRootCerts(caCerts()); if (iNoOfRootCerts > 0) { FILE* const pPemFile(::fopen(strFilenamePath.toUtf8().constData(), "wb")); if (pPemFile) { for (X509* pX509 = sk_X509_value(m_pAdditionalCerts, iRet); iRet != -1 && pX509; iRet++) { if (!::PEM_write_X509(pPemFile, pX509)) { iRet = -1; m_strError = tr("Writing root certificate to") + "" + strFilenamePath + "" + tr("failed"); } pX509 = sk_X509_value(m_pAdditionalCerts, iRet + 1); } ::fclose(pPemFile); } else { iRet = -1; m_strError = strFilenamePath + ": " + ::strerror(errno); } } return(iRet); } bool Pkcs12::privateKey2Pem(const QString& strFilenamePath, const QString& strPassphrase) { bool fRet(false); if (m_pKey) { FILE* const pPemFile(::fopen(strFilenamePath.toUtf8().constData(), "wb")); if (pPemFile) { if (::PEM_write_RSAPrivateKey(pPemFile, m_pKey->pkey.rsa, ::EVP_des_ede3_cbc(), NULL, 0, passwordCallback, strPassphrase.toUtf8().data())) fRet = true; else m_strError = tr("Writing private key to") + "" + strFilenamePath + "" + tr("failed"); ::fclose(pPemFile); } else m_strError = strFilenamePath + ": " + ::strerror(errno); } else m_strError = tr("No private key found"); return(fRet); } void Pkcs12::parse(const QString& strFilenamePath, const QString& strPassphrase) { FILE* const pP12File(::fopen(strFilenamePath.toUtf8().constData(), "rb")); if (pP12File) { ::ERR_clear_error(); ::OPENSSL_add_all_algorithms_noconf(); m_p12Cert = ::d2i_PKCS12_fp(pP12File, NULL); ::fclose(pP12File); if (m_p12Cert) { if (!::PKCS12_parse(m_p12Cert, strPassphrase.toUtf8().constData(), &m_pKey, &m_pX509Cert, &m_pAdditionalCerts)) { m_pAdditionalCerts = NULL; const unsigned long lErr(::ERR_get_error()); if (ERR_GET_LIB(lErr) == ERR_LIB_PKCS12 && ERR_GET_FUNC(lErr) == PKCS12_F_PKCS12_PARSE && ERR_GET_REASON(lErr) == PKCS12_R_MAC_VERIFY_FAILURE) m_strError = tr("Wrong passphrase"); else m_strError = tr("Parse PKCS#12 file") + " " + strFilenamePath + " " + tr("failed"); } else if (m_pX509Cert) { unsigned char* pcCert = NULL; const int iLen(::i2d_X509(m_pX509Cert, &pcCert)); if (iLen >= 0) m_pCertificateInfo = new CertificateInfo(QByteArray::fromRawData(reinterpret_cast(pcCert), iLen)); ::OPENSSL_free(pcCert); } } else m_strError = tr("The file") + " " + strFilenamePath + " " + tr("is not a valid PKCS#12 certificate bundle"); } else m_strError = strFilenamePath + ": " + ::strerror(errno); } l2tp-ipsec-vpn/src/util/GlobalFunctions.cpp0000664000175000017500000000727712040201227021353 0ustar wejaegerwejaeger/* * $Id: GlobalFunctions.cpp 64 2011-04-05 03:39:39Z werner $ * * File: GlobalFunctions.cpp * Author: Werner Jaeger * * Created on July 31, 2010, 7:28 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "GlobalFunctions.h" static QString HOSTNAMEPATTERN("([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}"); static QString IPV4PATTERN("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)"); static QString IPPATTERN("\\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\\d|[01]?\\d{1,2})(\\.(25[0-5]|2[0-4]\\d|[01]?\\d{1,2})){3})))(%.+)?\\s*"); static const QRegExp REVALIDGATEWAY(QString("^") + QString("(") + HOSTNAMEPATTERN + ")|(" + IPV4PATTERN + ")" + "$"); static const QRegExp REVALIDIPV4("^" + IPV4PATTERN + "$"); static const QRegExp REVALIDIP("^" + IPPATTERN + "$"); static const QRegExp REVALIDHOSTNAME("^" + HOSTNAMEPATTERN + "$"); static const QRegExp REVALIDHOSTNAMELIST("^" + HOSTNAMEPATTERN + "(?:\\s+" + HOSTNAMEPATTERN + ")*$"); const QRegExp& ipv4ValidationRE() { return(REVALIDIPV4); } const QRegExp& ipValidationRE() { return(REVALIDIP); } const QRegExp& gatewayValidationRE() { return(REVALIDGATEWAY); } const QRegExp& hostNameValidationRE() { return(REVALIDHOSTNAME); } const QRegExp& hostNameListValidationRE() { return(REVALIDHOSTNAMELIST); } QString utf82QString(const void* vpValue, unsigned long ulLen) { const QString str(QString::fromUtf8(static_cast(vpValue), ulLen)); return(str.trimmed()); } QByteArray fileName2ByteArray(const QString& strFileName) { #ifdef WIN32 return(strFileName.toLocal8Bit()); #else return(strFileName.toUtf8()); #endif } const char* string2FileName(const QString& strFileNme) { return(fileName2ByteArray(strFileNme).constData()); } void showHelp(const QString& strFragment) { QUrl url("http://wiki.l2tpipsecvpn.tuxfamily.org/wiki/index.php?title=Main_Page"); if (!strFragment.isNull()) url.setFragment(strFragment); QDesktopServices::openUrl(url); } l2tp-ipsec-vpn/src/localpeer/0000775000175000017500000000000012040201226016531 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/localpeer/LockedFile.cpp0000664000175000017500000001024612040201226021241 0ustar wejaegerwejaeger/* * $Id: LockedFile.cpp 146 2012-05-28 11:37:01Z wejaeger $ * * File: LockedFile.cpp * Author: Werner Jaeger * * Created on September 2, 2010, 6:42 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include "LockedFile.h" LockedFile::LockedFile() : QFile(), m_LockMode(NoLock) { } LockedFile::LockedFile(const QString& strName) : QFile(strName), m_LockMode(NoLock) { } LockedFile::~LockedFile() { if (isOpen()) unlock(); } bool LockedFile::open(OpenMode mode) { bool fRet(false); if (!(mode & QIODevice::Truncate)) { fRet = QFile::open(mode); const char* const pcSudoUid(::getenv("SUDO_UID")); if (fRet && pcSudoUid) { const uid_t uiUid(::strtol(pcSudoUid, NULL, 0)); if (uiUid) { const char* const pcSudoGid(::getenv("SUDO_GID")); const uid_t uiGid(pcSudoGid ? ::strtol(pcSudoGid, NULL, 0) : 0); if (::chown(fileName().toUtf8().constData(), uiUid, uiGid) != 0) { fRet = false; qWarning("LockedFile::open(): Failed to chown() lock file with uid %d and gid %d.", uiUid, uiGid); } } } else if (fRet) { const char* const pcUser(::getenv("USER")); if (pcUser) { const struct passwd* pPasswd(::getpwnam(pcUser)); if (pPasswd) { if (::chown(fileName().toUtf8().constData(), pPasswd->pw_uid, pPasswd->pw_gid) != 0) { fRet = false; qWarning("LockedFile::open(): Failed to chown() lock file with uid %d and gid %d.", pPasswd->pw_uid, pPasswd->pw_gid); } } } } } else qWarning("LockedFile::open(): Truncate mode not allowed."); return(fRet); } bool LockedFile::lock(LockMode mode, bool fBlock) { bool fRet(false); if (isOpen()) { if (mode != NoLock) { if (mode != m_LockMode) { if (m_LockMode != NoLock) unlock(); struct flock fl; fl.l_whence = SEEK_SET; fl.l_start = 0; fl.l_len = 0; fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK; if (::fcntl(handle(), fBlock ? F_SETLKW : F_SETLK, &fl) != -1) { m_LockMode = mode; fRet = true; } else { if (errno != EINTR && errno != EAGAIN) qWarning("LockedFile::lock(): fcntl: %s", ::strerror(errno)); } } else fRet = true; } else fRet = unlock(); } else qWarning("LockedFile::lock(): file is not opened"); return(fRet); } bool LockedFile::unlock() { bool fRet(false); if (isOpen()) { if (isLocked()) { struct flock fl; fl.l_whence = SEEK_SET; fl.l_start = 0; fl.l_len = 0; fl.l_type = F_UNLCK; if (::fcntl(handle(), F_SETLKW, &fl) != -1) { m_LockMode = NoLock; fRet = true; } else qWarning("LockedFile::lock(): fcntl: %s", ::strerror(errno)); } else fRet = true; } else qWarning("LockedFile::unlock(): file is not opened"); return(fRet); } bool LockedFile::isLocked() const { return(m_LockMode != NoLock); } LockedFile::LockMode LockedFile::lockMode() const { return(m_LockMode); }l2tp-ipsec-vpn/src/localpeer/LocalPeer.cpp0000664000175000017500000001300412040201226021101 0ustar wejaegerwejaeger/* * $Id: LocalPeer.cpp 146 2012-05-28 11:37:01Z wejaeger $ * * File: LocalPeer.cpp * Author: Werner Jaeger * * Created on September 2, 2010, 5:47 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include "LocalPeer.h" static const char* const APPNAME("L2tpIPsecVpn"); const char* LocalPeer::m_pcAck = "ack"; LocalPeer::LocalPeer(QObject* pParent, const QString& strAppId) : QObject(pParent), m_strApplicationId(strAppId), m_pServer(new QLocalServer()) { QString strPrefix(m_strApplicationId); if (m_strApplicationId.isEmpty()) { m_strApplicationId = QCoreApplication::applicationFilePath(); strPrefix = m_strApplicationId.section(QLatin1Char('/'), -1); } strPrefix.remove(QRegExp("[^a-zA-Z]")); strPrefix.truncate(6); QByteArray abApplicationId(m_strApplicationId.toUtf8()); quint16 iNum = qChecksum(abApplicationId.constData(), abApplicationId.size()); m_strSocketName = QLatin1String(APPNAME) + "-" + strPrefix + QLatin1Char('-') + QString::number(iNum, 16) + QLatin1Char('-') + hexUid(); QString strLockName(QDir(QDir::tempPath()).absolutePath() + QLatin1Char('/') + m_strSocketName + QLatin1String("-lockfile")); m_LockedFile.setFileName(strLockName); m_LockedFile.open(QIODevice::ReadWrite); } LocalPeer::~LocalPeer() { delete m_pServer; } bool LocalPeer::isClient() { bool fRet(false); if (!m_LockedFile.isLocked()) { if (m_LockedFile.lock(LockedFile::WriteLock, false)) { bool fIsListening(m_pServer->listen(m_strSocketName)); // ### Workaround if (!fIsListening && m_pServer->serverError() == QAbstractSocket::AddressInUseError) { QFile::remove(QDir::cleanPath(QDir::tempPath())+QLatin1Char('/') + m_strSocketName); fIsListening = m_pServer->listen(m_strSocketName); } if (!fIsListening) qWarning() << APPNAME << ": listen on local socket failed; " << qPrintable(m_pServer->errorString()); QObject::connect(m_pServer, SIGNAL(newConnection()), SLOT(receiveConnection())); } else fRet = true; } return(fRet); } QString LocalPeer::applicationId() const { return (m_strApplicationId); } bool LocalPeer::sendMessage(const QString& strMessage, int iTimeout) { bool fRet(false); if (isClient()) { QLocalSocket socket; for (int i = 0; i < 2; i++) { // Try twice, in case the other instance is just starting up socket.connectToServer(m_strSocketName); fRet = socket.waitForConnected(iTimeout / 2); if (fRet || i) break; const int iMiliSeconds = 250; const struct timespec ts = { iMiliSeconds / 1000, (iMiliSeconds % 1000) * 1000 * 1000 }; nanosleep(&ts, NULL); } if (fRet) { QByteArray abMsg(strMessage.toUtf8()); QDataStream ds(&socket); ds.writeBytes(abMsg.constData(), abMsg.size()); fRet = socket.waitForBytesWritten(iTimeout); fRet &= socket.waitForReadyRead(iTimeout); // wait for ack fRet &= (socket.read(qstrlen(m_pcAck)) == m_pcAck); } } return(fRet); } void LocalPeer::receiveConnection() { QLocalSocket* const pSocket = m_pServer->nextPendingConnection(); if (pSocket) { while (pSocket->bytesAvailable() < static_cast(sizeof(quint32))) pSocket->waitForReadyRead(); QDataStream ds(pSocket); QByteArray abMsg; quint32 iRemaining; ds >> iRemaining; abMsg.resize(iRemaining); int iGot(0); char* pcMsgBuf = abMsg.data(); do { iGot = ds.readRawData(pcMsgBuf, iRemaining); iRemaining -= iGot; pcMsgBuf += iGot; } while (iRemaining && iGot >= 0 && pSocket->waitForReadyRead(2000)); if (iGot >= 0) { QString strMessage(QString::fromUtf8(abMsg)); pSocket->write(m_pcAck, qstrlen(m_pcAck)); pSocket->waitForBytesWritten(1000); delete pSocket; emit messageReceived(strMessage); //### (might take a long time to return) } else { qWarning() << APPNAME << ": Message reception failed" << pSocket->errorString(); delete pSocket; } } } QString LocalPeer::hexUid() { QString strHexUid(QString::number(::getuid(), 16)); const char* const pcSudoUid(::getenv("SUDO_UID")); if (pcSudoUid) { const int uiSudoUid(::strtol(pcSudoUid, NULL, 0)); if (uiSudoUid) strHexUid = QString::number(uiSudoUid, 16); } else { const char* const pcUser(::getenv("USER")); if (pcUser) { const struct passwd* pPasswd(::getpwnam(pcUser)); if (pPasswd) strHexUid = QString::number(pPasswd->pw_uid, 16); } } return(strHexUid); } l2tp-ipsec-vpn/src/localpeer/LockedFile.h0000664000175000017500000000256112040201226020707 0ustar wejaegerwejaeger/* * $Id: LockedFile.h 13 2010-09-17 09:12:39Z werner $ * * File: LockedFile.h * Author: Werner Jaeger * * Created on September 2, 2010, 6:42 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #ifndef LOCKEDFILE_H #define LOCKEDFILE_H class LockedFile : public QFile { public: enum LockMode { NoLock = 0, ReadLock, WriteLock }; LockedFile(); LockedFile(const QString &strName); virtual ~LockedFile(); bool open(OpenMode mode); bool lock(LockMode mode, bool fBlock = true); bool unlock(); bool isLocked() const; LockMode lockMode() const; private: LockedFile(const LockedFile& orig); LockedFile& operator=(const LockedFile& orig); LockMode m_LockMode; }; #endif /* LOCKEDFILE_H */ l2tp-ipsec-vpn/src/localpeer/LocalPeer.h0000664000175000017500000000316312040201226020553 0ustar wejaegerwejaeger/* * $Id: LocalPeer.h 75 2011-04-15 08:00:25Z werner $ * * File: LocalPeer.h * Author: Werner Jaeger * * Created on September 2, 2010, 5:47 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LOCALPEER_H #define LOCALPEER_H #include #include "LockedFile.h" class QLocalServer; class LocalPeer : public QObject { Q_OBJECT public: LocalPeer(QObject* pParent = NULL, const QString& strAppId = QString()); virtual ~LocalPeer(); bool isClient(); QString applicationId() const; bool sendMessage(const QString &strMessage, int iTimeout); signals: void messageReceived(const QString& strMessage); protected slots: void receiveConnection(); protected: private: LocalPeer(const LocalPeer& orig); LocalPeer& operator=(const LocalPeer& orig); static QString hexUid(); QString m_strApplicationId; QString m_strSocketName; QLocalServer* const m_pServer; LockedFile m_LockedFile; static const char* m_pcAck; }; #endif /* LOCALPEER_H */ l2tp-ipsec-vpn/src/L2tpIPsecVpnApplication.h0000664000175000017500000000472712040201227021364 0ustar wejaegerwejaeger/* * $Id: L2tpIPsecVpnApplication.h 130 2012-04-08 06:18:04Z wejaeger $ * * File: L2tpIPsecVpnApplication.h * Author: Werner Jaeger * * Created on August 9, 2010, 2:29 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef L2TPIPSECVPNAPPLICATION_H #define L2TPIPSECVPNAPPLICATION_H #include class ConnectionManager; class QProcess; class LocalPeer; class L2tpIPsecVpnApplication : public QApplication { Q_OBJECT public: enum APPLICATIONMODE { CONNECTION_MANAGER, CONNECTION_EDITOR, CONNECTION_EDITOR_STARTER, APPLYSETTINGS, DELETEALLCONFFILES, PASSWORD_CALLBACK }; L2tpIPsecVpnApplication(int& iArgc, char** ppArgv, APPLICATIONMODE appMode); virtual ~L2tpIPsecVpnApplication(); // reimplemented from QApplication so we can throw exceptions in slots virtual bool notify(QObject* pReceiver, QEvent* pEvent); bool isRunning(); APPLICATIONMODE mode() const; bool sendConnectionAddedMessage(const QString& strConnectionName); bool sendConnectionRemovedMessage(const QString& strConnectionName); int startConnectionEditorDialog(bool fDetached = false) const; static APPLICATIONMODE parseCmdLine(int& iArgc, char** ppArgv); static QString getGrahicalSUCmdLine(); signals: void connectionAdded(const QString& strConnectionName); void connectionRemoved(const QString& strConnectionName); void connectionEditorDialogClosed(int iExitCode); private slots: void onMessageReceived(const QString& strMessage); void onConnectionEditorDialogClosed(int iExitCode); private: L2tpIPsecVpnApplication(const L2tpIPsecVpnApplication& orig); L2tpIPsecVpnApplication & operator=(const L2tpIPsecVpnApplication& orig); const APPLICATIONMODE m_Mode; QProcess* const m_pProcess; LocalPeer* const m_pLocalPeer; }; #endif /* L2TPIPSECVPNAPPLICATION_H */ l2tp-ipsec-vpn/src/VPNControlTask.cpp0000664000175000017500000004441712040201227020131 0ustar wejaegerwejaeger/* * $Id: VPNControlTask.cpp 143 2012-05-11 10:33:15Z wejaeger $ * * File: VPNControlTask.cpp * Author: Werner Jaeger * * Created on July 8, 2010, 5:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include //#include #include #include #include "conf/ConfWriter.h" #include "settings/ConnectionSettings.h" #include "util/VpnControlDaemonClient.h" #include "VPNControlTask.h" #include "ConnectionManager.h" static const QFile xl2tpdPid("/var/run/xl2tpd.pid"); static const char* const strVpnLogPipeName("/var/log/l2tpipsecvpn.pipe"); static const char* const PROCDIR("/proc/"); static const QRegExp RE_LOG_SPLITLINE("\\s(?=\\w+\\[\\d+\\]\\:\\s)"); static const QRegExp RE_LOG_CAP_CERTIFICATEID("\\'(\\d\\:\\d{1,3})\\'"); static const QString STR_LOG_MATCH_IPSEC_CONNECTIONADDED("added connection description "); static const char* const STR_LOG_MATCH_IPSECSAESTABLISHED("IPsec SA established"); static const char* const STR_LOG_MATCH_CERTIFICATELOADERROR("Error loading certificate"); static const char* const STR_LOG_MATCH_AUTHFAILURE("Authentication failure"); static const char* const STR_LOG_MATCH_AUTHFAILED("LCP terminated by peer (Authentication failed)"); static const char* const STR_LOG_MATCH_NO_DATA("No data from BIO_read"); static const char* const STR_LOG_MATCH_PEERAUTHFAILED("but I couldn't find any suitable secret (password) for it to use to do so."); static const char* const STR_CONNECT_TIMEOUT("(Timeout)"); static const int ERR_INTERRUPTED(98); static const int ERR_CONNECTING_TO_CONTROL_DAEMON(99); static const int ERR_FAILED_TO_SET_DEFAULT_GATEWAY_INFO(230); static const int ERR_IPSEC_SA_NOT_ESTABLISHED(300); static const int ERR_LOADING_CERTIFICATE(400); static const int ERR_AUTHENTICATION_FAILED(404); static const int ERR_WRONG_CERTIFICATE(405); static const int ERR_NO_SECRET_FOUND(406); static const int ERR_CONNECT_TIMEOUT(410); QFile VPNControlTask::m_vpnLogPipe(strVpnLogPipeName); VPNControlTask::VPNControlTask(QObject* pParent) : QThread(pParent), m_pControlClient(new VpnControlDaemonClient), m_Action(Connect), m_iReturnCode(0), m_fIPSecConnectionAdded(false), m_fIPSecConnectionIsUp(false), m_pByteArray(new QByteArray()), m_pErrorStream(new QTextStream(m_pByteArray)) { clearVpnLogPipe(); if (!m_vpnLogPipe.open(QIODevice::ReadWrite | QIODevice::Text)) qWarning("Warning: VPNControlTask: Failed to open pipe %s", strVpnLogPipeName); ::fcntl(m_vpnLogPipe.handle(), F_SETFL, O_NONBLOCK); m_pVpnLogPipeNotifier = new QSocketNotifier(m_vpnLogPipe.handle(), QSocketNotifier::Read, pParent); connect(m_pVpnLogPipeNotifier, SIGNAL(activated(int)), SLOT(readyReadVpnLogPipe())); } VPNControlTask::~VPNControlTask() { deleteControlClient(); delete m_pErrorStream; delete m_pByteArray; delete m_pVpnLogPipeNotifier; m_vpnLogPipe.close(); } void VPNControlTask::setConnectionName(const QString& strConnectionName) { m_strConnectionName = strConnectionName; } const QString& VPNControlTask::connectionName() const { return(m_strConnectionName); } VPNControlTask::Action VPNControlTask::action() const { return(m_Action); } void VPNControlTask::setAction(Action action) { m_Action = action; } int VPNControlTask::restartPcscDaemon() { // qDebug() << "VPNControlTask::restartPcscDaemon()";connectionName if (createControlClient()) { m_iReturnCode = 0; runAndWait(VpnClientConnection::CMD_START_PCSCD); runAndWait(VpnClientConnection::CMD_STOP_PCSCD); sleep(2); } deleteControlClient(); // qDebug() << "VPNControlTask::restartPcscDaemon() -> finished"; return(m_iReturnCode); } void VPNControlTask::run() { // qDebug() << "VPNControlTask::run()"; if (createControlClient()) { m_pByteArray->clear(); m_pErrorStream->reset(); m_pErrorStream->resetStatus(); m_iReturnCode = 0; m_fIPSecConnectionAdded = false; m_fIPSecConnectionIsUp = false; switch (m_Action) { case Connect: runConnect(); break; case Disconnect: runDisconnect(); break; } } deleteControlClient(); // qDebug() << "VPNControlTask::run() -> finished"; } /*! * \brief Tries to stop this running thread. * * \param iWaitMiliSeconds wait at most this time. * \return true if the thread was stopped successfully, false otherwise. */ bool VPNControlTask::stop(unsigned long iWaitMiliSeconds) { m_iReturnCode = ERR_INTERRUPTED; exit(ERR_INTERRUPTED); return(wait(iWaitMiliSeconds)); } bool VPNControlTask::createControlClient() { deleteControlClient(); m_pControlClient = new VpnControlDaemonClient; connect(m_pControlClient, SIGNAL(notifyResult(int, const QString&)), SLOT(onResult(int, const QString&))); connect(m_pControlClient, SIGNAL(notifyCommandOutput(const QString&)), SLOT(onCommandOutput(const QString&))); m_pControlClient->connectToServer(); const bool fConnected(m_pControlClient->waitForConnected()); if (!fConnected) { m_iReturnCode = ERR_CONNECTING_TO_CONTROL_DAEMON; emitErrorMsg(""); } return(fConnected); } void VPNControlTask::deleteControlClient() { if (m_pControlClient != NULL) { m_pControlClient->leave(); m_pControlClient->deleteLater(); m_pControlClient = NULL; } } void VPNControlTask::runConnect() { // qDebug() << "VPNControlTask::runConnect()"; const CommonSettings commonSettings(ConnectionSettings().commonSettings(m_strConnectionName)); if (VPNControlTask::plutoIsRunning()) { runAndWait(VpnClientConnection::CMD_STOP_IPSECD); while (VPNControlTask::plutoIsRunning()) sleep(1); } if (xl2tpdPid.exists()) runAndWait(VpnClientConnection::CMD_STOP_L2TPD); if (!NetworkInterface::writeDefaultGatewayInfo()) { m_iReturnCode = ERR_FAILED_TO_SET_DEFAULT_GATEWAY_INFO; emitErrorMsg(""); } else if (!commonSettings.disableIPSecEncryption()) runAndWait(VpnClientConnection::CMD_START_IPSECD); if (m_iReturnCode == 0) runAndWait(VpnClientConnection::CMD_WRITE_CONNECTIONNAME_INFO, m_strConnectionName); if (m_iReturnCode == 0) { runAndWait(VpnClientConnection::CMD_START_L2TPD); if (m_iReturnCode == 0) { if (!commonSettings.disableIPSecEncryption()) { if (!m_fIPSecConnectionAdded) exec(); // avoid need --listen before --initiate error runAndWait(VpnClientConnection::CMD_IPSEC_READY); if (m_iReturnCode == 0) { runAndWait(VpnClientConnection::CMD_IPSEC_UP, m_strConnectionName); if (m_iReturnCode == 0 && !m_fIPSecConnectionIsUp) { m_iReturnCode = ERR_IPSEC_SA_NOT_ESTABLISHED; emitErrorMsg("IPsec"); } if (m_iReturnCode == 0) { sleep(1); runAndWait(VpnClientConnection::CMD_L2TP_CONNECT, m_strConnectionName); } } } else { sleep(1); runAndWait(VpnClientConnection::CMD_L2TP_CONNECT, m_strConnectionName); } } } // qDebug() << "VPNControlTask::runConnect() -> finished"; } void VPNControlTask::runDisconnect() { // qDebug() << "VPNControlTask::runDisconnect()"; const CommonSettings commonSettings(ConnectionSettings().commonSettings(m_strConnectionName)); if (xl2tpdPid.exists()) runAndWait(VpnClientConnection::CMD_STOP_L2TPD); if (m_iReturnCode == 0 && !commonSettings.disableIPSecEncryption()) runAndWait(VpnClientConnection::CMD_STOP_IPSECD); // qDebug() << "VPNControlTask::runDisconnect() -> finished"; } void VPNControlTask::runAndWait(VpnClientConnection::Command iCommand, const QString strArguments) { // qDebug() << "VPNControlTask::runAndWait(Command" << iCommand << ", const QString&" << strArguments << ")"; if (!m_pControlClient->start(iCommand, strArguments)) { m_iReturnCode = ERR_CONNECTING_TO_CONTROL_DAEMON; emitErrorMsg(""); } else exec(); // qDebug() << "VPNControlTask::runAndWait(Command" << iCommand << ", const QString&" << strArguments << ") -> finished"; } qint64 VPNControlTask::readLogLine(char* data, qint64 iMaxSize) { // qDebug() << "VPNControlTask::readLogLine()"; qint64 iRet(m_vpnLogPipe.readLine(data, iMaxSize)); if (iRet > 0) { const QString strLine(data); const QStringList astrParts(strLine.split(RE_LOG_SPLITLINE)); ::strcpy(data, astrParts.last().toAscii().data()); iRet = ::strlen(data); if (::strstr(data, STR_LOG_MATCH_CERTIFICATELOADERROR) != NULL) { m_iReturnCode = ERR_LOADING_CERTIFICATE; if (RE_LOG_CAP_CERTIFICATEID.indexIn(data) > 0) emitErrorMsg(RE_LOG_CAP_CERTIFICATEID.cap(1)); else emitErrorMsg("unknown"); } if (::strstr(data, STR_LOG_MATCH_AUTHFAILED) != NULL || ::strstr(data, STR_LOG_MATCH_AUTHFAILURE) != NULL) { m_iReturnCode = ERR_AUTHENTICATION_FAILED; emitErrorMsg(connectionName()); } else if (::strstr(data, STR_LOG_MATCH_NO_DATA)) { m_iReturnCode = ERR_WRONG_CERTIFICATE; emitErrorMsg(connectionName()); } else if (::strstr(data, STR_LOG_MATCH_PEERAUTHFAILED)) { m_iReturnCode = ERR_NO_SECRET_FOUND; emitErrorMsg(connectionName()); } else if (::strstr(data, STR_CONNECT_TIMEOUT)) { m_iReturnCode = ERR_CONNECT_TIMEOUT; emitErrorMsg(connectionName()); } else if (!m_fIPSecConnectionAdded) { m_fIPSecConnectionAdded = strLine.contains(STR_LOG_MATCH_IPSEC_CONNECTIONADDED + "\"" + connectionName() + "\""); if (m_fIPSecConnectionAdded) onResult(0, ""); } } // qDebug() << "VPNControlTask::readLogLine() -> finished with" << iRet; return(iRet); } qint64 VPNControlTask::readErrorLine(char* data, qint64 iMaxSize) { // qDebug() << "VPNControlTask::readErrorLine()"; qint64 iRet(-1); QString strLine(m_pErrorStream->readLine(iMaxSize)); if (!strLine.isNull()) { strLine.append("\n"); ::strcpy(data, strLine.toAscii().data()); iRet = ::strlen(data); } // qDebug() << "VPNControlTask::readErrorLine() -> finished with" << iRet; return(iRet); } void VPNControlTask::readyReadVpnLogPipe() { emit readyReadLog(); } void VPNControlTask::onResult(int iReturnCode, const QString& strCommand) { // qDebug() << "VPNControlTask::onResult(int" << iReturnCode << ", const String&" << strCommand << ")"; m_iReturnCode = iReturnCode; exit(iReturnCode); if (iReturnCode != 0) emitErrorMsg(strCommand); // qDebug() << "VPNControlTask::onResult(int" << iReturnCode << ", const String&" << strCommand << ") -> finished"; } void VPNControlTask::onCommandOutput(const QString& strOutputLine) { // qDebug() << "VPNControlTask::onCommandOutput(const String&" << strOutputLine << ")"; if (!m_fIPSecConnectionIsUp) m_fIPSecConnectionIsUp = strOutputLine.contains(STR_LOG_MATCH_IPSECSAESTABLISHED); emit commandOutputReceived(strOutputLine); // qDebug() << "VPNControlTask::onCommandOutput(const String&" << strOutputLine << ") --> finished"; } void VPNControlTask::emitErrorMsg(const QString& strErrorContext) { // qDebug() << "VPNControlTask::emitErrorMsg(const QString&" << strErrorContext << ")"; const qint64 iPos(m_pErrorStream->pos()); *m_pErrorStream << "[ERROR" << qSetFieldWidth(5) << right << m_iReturnCode << reset << "] "; switch (m_iReturnCode) { case VpnClientConnection::CMD_UNKNOWN: *m_pErrorStream << "L2tpIPsecVpnControlDaemon did not recognize the command sent"; break; case VpnClientConnection::ERR_INALID_NO_OF_ARGUMENTS: *m_pErrorStream << "L2tpIPsecVpnControlDaemon is complained about the number of arguments in command '" << strErrorContext << "'"; break; case VpnClientConnection::ERR_COMMAND_FAILED_TO_START: *m_pErrorStream << "L2tpIPsecVpnControlDaemon: command '" << strErrorContext << "' failed to start"; break; case VpnClientConnection::ERR_COMMAND_CRASHED_AFTER_START: *m_pErrorStream << "L2tpIPsecVpnControlDaemon: command '" << strErrorContext << "' crashed after starting successfully"; break; case VpnClientConnection::ERR_COMMAND_TIMEDOUT: *m_pErrorStream << "L2tpIPsecVpnControlDaemon: command '" << strErrorContext << "' timed out"; break; case VpnClientConnection::ERR_COMMAND_FAILED_TO_READ_FROM_PROCESS: *m_pErrorStream << "L2tpIPsecVpnControlDaemon: command '" << strErrorContext << "' an error occurred when attempting to read from the process"; break; case VpnClientConnection::ERR_COMMAND_FAILED_TO_WRITE_TO_PROCESS: *m_pErrorStream << "L2tpIPsecVpnControlDaemon: command '" << strErrorContext << "' an error occurred when attempting to write to the process"; break; case VpnClientConnection::ERR_COMMAND_FAILED_WITH_UNKNOW_ERROR: *m_pErrorStream << "L2tpIPsecVpnControlDaemon: command '" << strErrorContext << "' an unknown error occurred"; break; case ERR_CONNECTING_TO_CONTROL_DAEMON: *m_pErrorStream << "L2tpIPsecVpnControlDaemon is either not started or connection to it failed"; break; case VpnClientConnection::ERR_WRITE_PIPE: *m_pErrorStream << "Failed to write command '" << strErrorContext << "' to l2tp-control"; break; case VpnClientConnection::ERR_OPEN_PIPE: *m_pErrorStream << "Failed to open l2tp control file '" << strErrorContext << "'"; break; case VpnClientConnection::ERR_CREATE_VPN_LOG_PIPE: case VpnClientConnection::ERR_CHMOD_VPN_LOG_PIPE: case VpnClientConnection::ERR_CHOWN_VPN_LOG_PIPE: *m_pErrorStream << "Failed to open l2tp ipsec vpn log file '" << strErrorContext << "'"; break; case VpnClientConnection::ERR_START_SYSLOG_DAEMON: *m_pErrorStream << "Failed to start syslog daemon '" << strErrorContext << "'"; break; case ERR_FAILED_TO_SET_DEFAULT_GATEWAY_INFO: *m_pErrorStream << "No default gateway found or failed to write default gateway information '" << strErrorContext << "'"; break; case ERR_IPSEC_SA_NOT_ESTABLISHED: *m_pErrorStream << "'" << strErrorContext << "' failed to negotiate or establish security associations"; break; case ERR_LOADING_CERTIFICATE: *m_pErrorStream << "Error loading certificate with id '" << strErrorContext << "'"; break; case ERR_AUTHENTICATION_FAILED: *m_pErrorStream << "Authentication failed: closing connection to '" << strErrorContext << "'"; break; case ERR_WRONG_CERTIFICATE: *m_pErrorStream << "Peer did not accept certificate sent from smart card: closing connection to '" << strErrorContext << "'"; break; case ERR_NO_SECRET_FOUND: *m_pErrorStream << "No secret found to authenticate '" << strErrorContext << "'"; break; case ERR_CONNECT_TIMEOUT: *m_pErrorStream << "Connection attempt to '" << strErrorContext << "' timed out"; break; default: *m_pErrorStream << "Command '" << strErrorContext << "' failed and exited with given error code"; break; } m_pErrorStream->flush(); m_pErrorStream->seek(iPos); emit errorMessageEmited(m_iReturnCode); // qDebug() << "VPNControlTask::emitErrorMsg(const QString&" << strErrorContext << ") -> finished"; } void VPNControlTask::clearVpnLogPipe() { const int iVpnPipeFileDescriptor(::open(m_vpnLogPipe.fileName().toAscii().data(), O_RDONLY | O_NONBLOCK)); if (iVpnPipeFileDescriptor != -1) { char* buf[1024]; int iNoRead; do iNoRead = ::read(iVpnPipeFileDescriptor, buf, sizeof(buf)); while (iNoRead > 0); ::close(iVpnPipeFileDescriptor); } else { const int iResult(VpnControlDaemonClient::execute(VpnClientConnection::CMD_CREATE_VPN_LOGPIPE, m_vpnLogPipe.fileName())); if (iResult != VpnClientConnection::OK) { if (iResult == 1) QMessageBox::critical(NULL, tr("A critical error occurred"), tr("L2tpIPsecVpnControlDaemon is not started")); else QMessageBox::critical(NULL, tr("A critical error occurred"), tr("Create vpn syslog pipe command failed with exit code: %1").arg(iResult)); } } } /** * Lookup /proc to see if pluto is running **/ bool VPNControlTask::plutoIsRunning() { const uint uiUid(0); QFileInfoList procList(QDir(PROCDIR).entryInfoList(QDir::AllDirs|QDir::NoDotAndDotDot)); bool fDone(false); for (QFileInfoList::const_iterator procIt(procList.constBegin()); !fDone && procIt != procList.constEnd(); procIt++) { bool fOk(false); QString strPid((*procIt).fileName()); strPid.toUInt(&fOk); if (fOk) // pid must be numeric, ignore every thing else { // is this process owned by the user if (uiUid == (*procIt).ownerId()) { // we have a valid pid // open the cmdline file to determine what's the name of the process running QFile cmdLineFile(PROCDIR + strPid + "/cmdline"); if (cmdLineFile.open(QFile::ReadOnly)) { const QString strCli(cmdLineFile.readAll()); if (strCli.startsWith("pluto")) fDone = true; } else qWarning() << "Failed to open proc command line file" << cmdLineFile.fileName(); } } } return(fDone); } l2tp-ipsec-vpn/src/generated/0000775000175000017500000000000012040201226016521 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/main.cpp0000664000175000017500000001572512040201227016226 0ustar wejaegerwejaeger/* * $Id: main.cpp 149 2012-05-29 08:42:45Z wejaeger $ * * File: main.cpp * Author: Werner Jaeger * * Created on July 7, 2010, 5:40 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include "pkcs11/Pkcs11.h" #include "settings/ConnectionSettings.h" #include "settings/Preferences.h" #include "ConnectionManager.h" #include "ConnectionEditor.h" #include "PasswordCallback.h" #include "L2tpIPsecVpnApplication.h" static const char* const DESKTOP_SESSION("DESKTOP_SESSION"); static const char* const PROCDIR("/proc/"); static void checkDesktop(); static uint effectiveUid(); void messageOutput(QtMsgType type, const char* pcMsg); int main(int iArgc, char* pcArgv[]) { qInstallMsgHandler(messageOutput); const L2tpIPsecVpnApplication::APPLICATIONMODE mode(L2tpIPsecVpnApplication::parseCmdLine(iArgc, pcArgv)); if (mode != L2tpIPsecVpnApplication::PASSWORD_CALLBACK && mode != L2tpIPsecVpnApplication::APPLYSETTINGS && mode != L2tpIPsecVpnApplication::DELETEALLCONFFILES) checkDesktop(); L2tpIPsecVpnApplication app(iArgc, pcArgv, mode); const QString strLocale(QLocale::system().name()); QTranslator translator; translator.load(QString(":/nls/") + strLocale); app.installTranslator(&translator); int iRet(0); if (app.mode() == L2tpIPsecVpnApplication::CONNECTION_EDITOR || app.mode() == L2tpIPsecVpnApplication::CONNECTION_EDITOR_STARTER || app.mode() == L2tpIPsecVpnApplication::APPLYSETTINGS || app.mode() == L2tpIPsecVpnApplication::DELETEALLCONFFILES || app.mode() == L2tpIPsecVpnApplication::PASSWORD_CALLBACK || !app.isRunning()) { Q_INIT_RESOURCE(L2tpIPsecVpn); const QString strPkcs11Lib(Preferences().openSSLSettings().pkcs11Path()); if (!Pkcs11::loaded()) { if (!strPkcs11Lib.isEmpty()) iRet = Pkcs11::loadLibrary(strPkcs11Lib, true) ? 0 : 2; } if (iRet == 0) { switch (app.mode()) { case L2tpIPsecVpnApplication::CONNECTION_MANAGER: { ConnectionManager manager(app); iRet = manager.exec(); } break; case L2tpIPsecVpnApplication::APPLYSETTINGS: case L2tpIPsecVpnApplication::CONNECTION_EDITOR: { ConnectionEditor connectionEditor(app); iRet = connectionEditor.exec(); } break; case L2tpIPsecVpnApplication::PASSWORD_CALLBACK: { PasswordCallback callback(app); iRet = callback.exec(); } break; case L2tpIPsecVpnApplication::CONNECTION_EDITOR_STARTER: iRet = app.startConnectionEditorDialog(true); break; case L2tpIPsecVpnApplication::DELETEALLCONFFILES: iRet = ConnectionSettings().deleteAllConfFiles(); break; default: Q_ASSERT(false); break; } Pkcs11::closeLibrary(strPkcs11Lib, true); } else QMessageBox::critical(NULL, app.applicationName(), QObject::tr("I couldn't load PKCS11 library %1.").arg(Preferences().openSSLSettings().pkcs11Path())); } return(iRet); } void messageOutput(QtMsgType type, const char* pcMsg) { switch (type) { case QtDebugMsg: #ifndef QT_NO_DEBUG ::syslog(LOG_DEBUG, "%s", pcMsg); #endif break; case QtWarningMsg: ::syslog(LOG_WARNING, "%s", pcMsg); break; case QtCriticalMsg: ::syslog(LOG_CRIT, "%s", pcMsg); break; case QtFatalMsg: ::syslog(LOG_EMERG, "%s", pcMsg); abort(); } } /** * If no windows manager is set, * probe the environment to automatically guess one. **/ static void checkDesktop() { // if no desktop is given, look if one is passed via command line const char* const pcDesktopSession(::getenv(DESKTOP_SESSION)); if (!pcDesktopSession) { // no desktop is set and no desktop is given on the command line. // most likely we are called via sudo // try to test for at least very well known running desktop managers const uint uiUid(effectiveUid()); QFileInfoList procList(QDir(PROCDIR).entryInfoList(QDir::AllDirs|QDir::NoDotAndDotDot)); bool fDone(false); for (QFileInfoList::const_iterator procIt(procList.constBegin()); !fDone && procIt != procList.constEnd(); procIt++) { bool fOk(false); QString strPid((*procIt).fileName()); strPid.toUInt(&fOk); if (fOk) // pid must be numeric, ignore every thing else { // is this process owned by the user if (uiUid == (*procIt).ownerId()) { // we have a valid pid // open the cmdline file to determine what's the name of the process running QFile cmdLineFile(PROCDIR + strPid + "/comm"); if (cmdLineFile.open(QFile::ReadOnly)) { const QString strCli(cmdLineFile.readAll()); if (strCli.startsWith("gnome-session")) { fDone = true; ::setenv(DESKTOP_SESSION, "gnome", 0); } else if (strCli.startsWith("ksmserver")) { fDone = true; ::setenv(DESKTOP_SESSION, "kde", 0); } else if (strCli.startsWith("xfce4-session")) { fDone = true; ::setenv(DESKTOP_SESSION, "xfce", 0); } } else qWarning() << "Failed to open proc command line file" << cmdLineFile.fileName(); } } } } } static uint effectiveUid() { uint uiUid(::getuid()); const char* const pcSudoUid(::getenv("SUDO_UID")); if (pcSudoUid) { const uid_t uiSudoUid(::strtol(pcSudoUid, NULL, 0)); if (uiSudoUid) uiUid = uiSudoUid; } else { const char* const pcUser(::getenv("USER")); if (pcUser) { const struct passwd* pPasswd(::getpwnam(pcUser)); if (pPasswd) uiUid = pPasswd->pw_uid; } } return(uiUid); } l2tp-ipsec-vpn/src/ConnectionState.cpp0000664000175000017500000001035112040201227020370 0ustar wejaegerwejaeger/* * $Id: ConnectionState.cpp 132 2012-04-24 06:04:01Z wejaeger $ * * File: ConnectionState.cpp * Author: Werner Jaeger * * Created on July 8, 2010, 10:35 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "ConnectionManager.h" #include "ConnectionState.h" ConnectionState::ConnectionState(QSystemTrayIcon* pTrayIcon, const QString& strHostName, const QString& strMsgTitle, const QString& strMsgBody, const QIcon& icon, const QSystemTrayIcon::MessageIcon& msgIcon, const NetworkInterface& ptpInterface) : m_pTrayIcon(pTrayIcon), m_strHostName(strHostName), m_strMsgTitle(strMsgTitle), m_strMsgBody(strMsgBody), m_Icon(icon), m_MsgIcon(msgIcon), m_PtpInterface(ptpInterface) { if (pTrayIcon) { pTrayIcon->setIcon(icon); pTrayIcon->setToolTip(strMsgTitle); } } ConnectionState::~ConnectionState() { } const QString& ConnectionState::hostName() const { return(m_strHostName); } const QString& ConnectionState::msgTitle() const { return(m_strMsgTitle); } const QString& ConnectionState::msgBody() const { return(m_strMsgBody); } const QIcon& ConnectionState::icon() const { return(m_Icon); } const QSystemTrayIcon::MessageIcon& ConnectionState::msgIcon() const { return(m_MsgIcon); } const NetworkInterface& ConnectionState::ptpInterface() const { return(m_PtpInterface); } NotConnected::NotConnected(QSystemTrayIcon* pTrayIcon) : ConnectionState(pTrayIcon, "", QObject::tr("Not Connected"), QObject::tr("Click to show details"), QIcon(":/images/connectNo"), QSystemTrayIcon::Warning) { } NotConnected::~NotConnected() { } Connecting::Connecting(QSystemTrayIcon* pTrayIcon, const QString& strHostName) : ConnectionState(pTrayIcon, strHostName, QObject::tr("Connecting to ") + strHostName + " ...", QObject::tr("Click to show details"), QIcon(":/images/busy"), QSystemTrayIcon::Information), m_pMovie(new QMovie(":/images/busy")) { connect(m_pMovie, SIGNAL(frameChanged(int)), SLOT(onFrameChanged())); if (m_pMovie->isValid()) m_pMovie->start(); } Connecting::~Connecting() { delete m_pMovie; } void Connecting::onFrameChanged() const { if (trayIcon()) trayIcon()->setIcon(QIcon(m_pMovie->currentPixmap())); } Disconnecting::Disconnecting(QSystemTrayIcon* pTrayIcon, const QString& strHostName) : ConnectionState(pTrayIcon, strHostName, QObject::tr("Disconnecting from ") + strHostName + " ...", QObject::tr("Click to show details"), QIcon(":/images/busy"), QSystemTrayIcon::Information), m_pMovie(new QMovie(":/images/busy")) { connect(m_pMovie, SIGNAL(frameChanged(int)), SLOT(onFrameChanged())); if (m_pMovie->isValid()) m_pMovie->start(); } Disconnecting::~Disconnecting() { delete m_pMovie; } void Disconnecting::onFrameChanged() const { if (trayIcon()) trayIcon()->setIcon(QIcon(m_pMovie->currentPixmap())); } Connected::Connected(QSystemTrayIcon* pTrayIcon, const QString& strHostName, const NetworkInterface& ptpInterface) : ConnectionState(pTrayIcon, strHostName, QObject::tr("Connected to ") + strHostName, QObject::tr("Click to show details"), QIcon(":/images/connectEstablished"), QSystemTrayIcon::Information, ptpInterface) { } Connected::~Connected() { } Error::Error(QSystemTrayIcon* pTrayIcon, const QString& strHostName, int iReturnCode, bool fDisconnecting) : ConnectionState(pTrayIcon, strHostName, (fDisconnecting ? QObject::tr("Error %1 occurred when disconnecting from ").arg(iReturnCode) : QObject::tr("Error %1 occurred when connecting to ").arg(iReturnCode)) + strHostName, QObject::tr("Click to show details"), QIcon(":/images/connectError"), QSystemTrayIcon::Critical) { } Error::~Error() { } l2tp-ipsec-vpn/src/dialogs/0000775000175000017500000000000012040201226016205 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/dialogs/PeerAuthenticationDialog.ui0000664000175000017500000000523212040201226023461 0ustar wejaegerwejaeger PeerAuthenticationDialog 0 0 417 103 PeerAuthenticationDialog true QFrame::StyledPanel QFrame::Raised Remote name: m_pRemoteNameEdit Set the assumed name of the remote system for authentication purposes. If not empty, the name reported by the peer is checked against this name and connection will be refused if the reported name is different. Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok m_pRemoteNameEdit m_pButtonBox m_pButtonBox accepted() PeerAuthenticationDialog accept() 248 254 157 274 m_pButtonBox rejected() PeerAuthenticationDialog reject() 316 260 286 274 l2tp-ipsec-vpn/src/dialogs/PreferencesEditorDialog.cpp0000664000175000017500000001324012040201226023441 0ustar wejaegerwejaeger/* * $Id: PreferencesEditorDialog.cpp 129 2012-04-07 10:15:46Z wejaeger $ * * File: PreferencesEditorDialog.cpp * Author: wejaeger * * Created on February 4, 2011, 11:21 AM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "pkcs11/Pkcs11.h" #include "settings/Preferences.h" #include "util/ErrorEx.h" #include "util/GlobalFunctions.h" #include "util/Libtool.h" #include "PreferencesEditorDialog.h" static const QString VALIDOPENSSLENGINELIBSYMBOL("ENGINE_init"); static const QString ENGINEIDPATTERN("[a-zA-Z0-9]{0,20}"); static const QRegExp REENGINID("^" + ENGINEIDPATTERN + "$"); #if defined(_WIN32) || defined(USE_CYGWIN) static const QString DEFLIBPATH("/WINDOWS/system32"); static const QString LIBFILTER(QObject::tr("Dynamic library files (*.dll)")); #else static const QString DEFLIBPATH("/usr/lib"); static const QString LIBFILTER(QObject::tr("Shared library files (*.so)")); #endif PreferencesEditorDialog::PreferencesEditorDialog(QWidget* pParent) : QDialog(pParent) { m_Widget.setupUi(this); m_Widget.m_pEngineIDLineEdit->setValidator(new QRegExpValidator(REENGINID, this)); connect(m_Widget.m_pEnginePathPushButton, SIGNAL(clicked()), SLOT(onEnginePath())); connect(m_Widget.m_pPkcs11PathPushButton, SIGNAL(clicked()), SLOT(onPkcs11Path())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); readSettings(); } PreferencesEditorDialog::~PreferencesEditorDialog() { } void PreferencesEditorDialog::onEnginePath() { const OpenSSLSettings settings(Preferences().openSSLSettings()); const QString strEnginePath(QFileDialog::getOpenFileName(this, tr("Choose path of engine library ..."), settings.enginePath().isEmpty() ? DEFLIBPATH : settings.enginePath(), LIBFILTER)); if (!strEnginePath.isNull()) m_Widget.m_pEnginePathLineEdit->setText(strEnginePath); } void PreferencesEditorDialog::onPkcs11Path() { const OpenSSLSettings settings(Preferences().openSSLSettings()); const QString strPkcs11Path(QFileDialog::getOpenFileName(this, tr("Choose path of PKCS11 library ..."), settings.pkcs11Path().isEmpty() ? DEFLIBPATH : settings.pkcs11Path(), LIBFILTER)); if (!strPkcs11Path.isNull()) m_Widget.m_pPkcs11PathLineEdit->setText(strPkcs11Path); } void PreferencesEditorDialog::onHelpRequested() const { ::showHelp("Editing_preferences"); } void PreferencesEditorDialog::accept() { const QString strPkcs11Lib(m_Widget.m_pPkcs11PathLineEdit->text()); const QString strCurrentPkcs11Lib(Preferences().openSSLSettings().pkcs11Path()); if (!m_Widget.m_pEngineIDLineEdit->text().isEmpty()) { if (!m_Widget.m_pEnginePathLineEdit->text().isEmpty()) { if (!strPkcs11Lib.isEmpty()) { if (Libtool(m_Widget.m_pEnginePathLineEdit->text()).hasSymbol(VALIDOPENSSLENGINELIBSYMBOL)) { try { if (strPkcs11Lib != strCurrentPkcs11Lib) Pkcs11::loadLibrary(strPkcs11Lib, false); writeSettings(); QDialog::accept(); } catch (const ErrorEx& error) { QMessageBox::critical(NULL, QCoreApplication::applicationName(), error.getString()); if (!strCurrentPkcs11Lib.isEmpty() && !Pkcs11::loaded()) { if (!Pkcs11::loadLibrary(strCurrentPkcs11Lib, true)) QMessageBox::critical(NULL, QCoreApplication::applicationName(), QObject::tr("I couldn't load PKCS11 library %1.").arg(strCurrentPkcs11Lib)); } } } else QMessageBox::critical(NULL, QCoreApplication::applicationName(), QObject::tr("%1 is not a valid OpenSSL engine library.").arg(m_Widget.m_pEnginePathLineEdit->text())); } else QMessageBox::critical(NULL, QCoreApplication::applicationName(), QObject::tr("%1 must not be empty.").arg(m_Widget.m_pPkcs11PathLabel->text())); } else QMessageBox::critical(NULL, QCoreApplication::applicationName(), QObject::tr("%1 must not be empty.").arg(m_Widget.m_pEnginPathLabel->text())); } else QMessageBox::critical(NULL, QCoreApplication::applicationName(), QObject::tr("%1 must not be empty.").arg(m_Widget.m_pEngineIdLabel->text())); } void PreferencesEditorDialog::readSettings() const { const OpenSSLSettings settings(Preferences().openSSLSettings()); m_Widget.m_pEngineIDLineEdit->setText(settings.engineId()); m_Widget.m_pEnginePathLineEdit->setText(settings.enginePath()); m_Widget.m_pPkcs11PathLineEdit->setText(settings.pkcs11Path()); } bool PreferencesEditorDialog::writeSettings() const { const OpenSSLSettings settings(Preferences().openSSLSettings()); bool fRet(settings.setEngineId(m_Widget.m_pEngineIDLineEdit->text())); if (fRet) fRet = settings.setEnginePath(m_Widget.m_pEnginePathLineEdit->text()); if (fRet) fRet = settings.setPkcs11Path(m_Widget.m_pPkcs11PathLineEdit->text()); return(fRet); } l2tp-ipsec-vpn/src/dialogs/CertificateImportDialog.cpp0000664000175000017500000001732012040201226023451 0ustar wejaegerwejaeger/* * $Id: CertificateImportDialog.cpp 129 2012-04-07 10:15:46Z wejaeger $ * * File: CertificateImportDialog.cpp * Author: wejaeger * * Created on April 11, 2011, 11:58 AM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include "util/GlobalFunctions.h" #include "util/Pkcs12.h" #include "CertificateImportDialog.h" #include "pkcs11/SmartCardState.h" static const QString IPSECCERTSPATH("/etc/ipsec.d/certs/"); static const QString IPSECPRIVATEKEYPATH("/etc/ipsec.d/private/"); static const QString IPSECCACERTSPATH("/etc/ipsec.d/cacerts/"); static const QString PEMEXT(".pem"); CertificateImportDialog::CertificateImportDialog(QWidget* pParent) : QDialog(pParent), m_pPkcs12(NULL) { m_Widget.setupUi(this); QPalette infoTextEditPalette(m_Widget.m_pInfoTextEdit->palette()); infoTextEditPalette.setColor(QPalette::Base, palette().color(backgroundRole())); m_Widget.m_pInfoTextEdit->setPalette(infoTextEditPalette); onValidateInput(); connect(m_Widget.m_pBrowseFilePushButton, SIGNAL(clicked()), SLOT(onCertificate())); connect(m_Widget.m_pPrivateKeyPassphraseEdit, SIGNAL(textChanged(const QString &)), SLOT(onValidateInput())); connect(m_Widget.m_pVerifyPrivateKeyPassphraseEdit, SIGNAL(textChanged(const QString &)), SLOT(onValidateInput())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); } CertificateImportDialog::~CertificateImportDialog() { if (m_pPkcs12) delete m_pPkcs12; } const QString CertificateImportDialog::certificateFilename() const { return(isInputValid() ? m_pPkcs12->cn() + PEMEXT : QString::null); } const QString CertificateImportDialog::certificateFilenamePath() const { return(IPSECCERTSPATH + certificateFilename()); } const QString CertificateImportDialog::privateKeyFilename() const { return(isInputValid() ? m_pPkcs12->cn() + PEMEXT : QString::null); } const QString CertificateImportDialog::privateKeyFilenamePath() const { return(IPSECPRIVATEKEYPATH + privateKeyFilename()); } const QString CertificateImportDialog::caCertificateFilename() const { return(isInputValid() ? m_pPkcs12->issuer() + PEMEXT : QString::null); } const QString CertificateImportDialog::caCertificateFilenamePath() const { return(IPSECCACERTSPATH + caCertificateFilename()); } const QString CertificateImportDialog::passPhrase() const { return(m_Widget.m_pPrivateKeyPassphraseEdit->text()); } bool CertificateImportDialog::useAsAuthenticationCertificate() const { return(m_Widget.m_pSeletAutomaticallyCheckBox->isChecked()); } void CertificateImportDialog::onHelpRequested() const { ::showHelp("Import_PKCS12_certificate_bundle"); } void CertificateImportDialog::onCertificate() { const QString strPkcs12FileNamePath(QFileDialog::getOpenFileName(this, tr("Choose the PKCS12 certificate bundle to import ..."), QDir::homePath(), tr("PKSC#12 certificate bundle (*.p12 *.pfx)"))); if (!strPkcs12FileNamePath.isNull()) { m_Widget.m_pFileEdit->setText(strPkcs12FileNamePath); bool fOk(true); QString strPassphrase; while (fOk && strPassphrase.isNull()) strPassphrase = QInputDialog::getText(this, tr("Passphrase Entry Dialog"), tr("Please enter the passphrase that was used to encrypt this certificate bundle:"), QLineEdit::Password, QString(), &fOk); if (fOk && !strPassphrase.isEmpty()) { m_Widget.m_pInfoTextEdit->clear(); if (m_pPkcs12) { delete m_pPkcs12; m_pPkcs12 = NULL; } m_pPkcs12 = new Pkcs12(strPkcs12FileNamePath, strPassphrase); if (m_pPkcs12->error().isNull()) { m_Widget.m_pInfoTextEdit->insertHtml("" + tr("Content:") + "
"); m_Widget.m_pInfoTextEdit->insertHtml("1 " + tr("certificate") + " " + m_pPkcs12->cn() + " " + tr("issued by") + " " + m_pPkcs12->issuer() + "
"); if (m_pPkcs12->hasPrivateKey()) m_Widget.m_pInfoTextEdit->insertHtml("1 " + tr("private key") + "
"); m_Widget.m_pInfoTextEdit->insertHtml(tr("%n root certificate(s)", "", m_pPkcs12->caCerts())); m_Widget.m_pPrivateKeyPassphraseEdit->setFocus(); } else showError(); } } onValidateInput(); } void CertificateImportDialog::onValidateInput() const { if (isInputValid()) m_Widget.m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(true); else m_Widget.m_pButtonBox->button(QDialogButtonBox::Ok)->setDisabled(true); } void CertificateImportDialog::accept() { if (isInputValid()) { if (writePems()) QDialog::accept(); else showError(); } } bool CertificateImportDialog::isInputValid() const { const QString strPassphrase(m_Widget.m_pPrivateKeyPassphraseEdit->text()); const QString strVerifyPassphrase(m_Widget.m_pVerifyPrivateKeyPassphraseEdit->text()); bool fRet(m_pPkcs12 && m_pPkcs12->error().isNull() && !strPassphrase.isEmpty() && strPassphrase == strVerifyPassphrase); return(fRet); } bool CertificateImportDialog::writePems() const { bool fRet(false); if (isInputValid()) { if (checkIfFileExistAndConfirmOverwrite(certificateFilenamePath(), tr("certificate file"))) fRet = m_pPkcs12->cert2Pem(certificateFilenamePath()); else fRet = true; if (fRet) { if (checkIfFileExistAndConfirmOverwrite(privateKeyFilenamePath(), tr("private key file"))) fRet = m_pPkcs12->privateKey2Pem(privateKeyFilenamePath(), m_Widget.m_pPrivateKeyPassphraseEdit->text()); } if (fRet && m_pPkcs12->caCerts() > 0) { if (checkIfFileExistAndConfirmOverwrite(caCertificateFilenamePath(), tr("root certificate file"))) fRet = (m_pPkcs12->caChain2Pem(caCertificateFilenamePath()) == m_pPkcs12->caCerts()); } } return(fRet); } void CertificateImportDialog::showError() { m_Widget.m_pInfoTextEdit->clear(); m_Widget.m_pInfoTextEdit->insertHtml("" + tr("Error:") + "
"); m_Widget.m_pInfoTextEdit->insertHtml("
" + m_pPkcs12->error() + "
"); } bool CertificateImportDialog::checkIfFileExistAndConfirmOverwrite(const QString& strFilenamePath, const QString& strType) const { bool fRet(true); QDir dir(strFilenamePath); const QFile file(strFilenamePath); if (file.exists()) { const QString strText(tr("A") + " " + strType + " " + "named" + " \"" + dir.dirName() + "\" " + tr("already exists. Do you want to replace it?")); dir.cdUp(); const QString strInformativeText(tr("The") + " " + strType + " " + tr("already exists in") + " \"" + dir.path() + "\" " + tr(". Replacing it will overwrite its contents.")); QMessageBox msgBox; msgBox.setWindowTitle(tr("Importing certificates ...")); msgBox.setText(strText); msgBox.setInformativeText(strInformativeText); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); if (msgBox.exec() != QMessageBox::Yes) fRet = false; } return(fRet); } l2tp-ipsec-vpn/src/dialogs/InterfaceStatisticsDialog.ui0000664000175000017500000001433512040201226023645 0ustar wejaegerwejaeger InterfaceStatisticsDialog 0 0 400 300 Interface Statistics :/images/connectEstablished:/images/connectEstablished true QFormLayout::AllNonFixedFieldsGrow Transmitted bytes: Transmitted packets: Transmission errors: Qt::Vertical QSizePolicy::Fixed 20 20 Received bytes: Received packets: Reception errors: Qt::Vertical QSizePolicy::Fixed 20 20 Connected since: Connection time: Qt::Horizontal QDialogButtonBox::Close Qt::Vertical 20 10000 Collisions: m_pButtonBox accepted() InterfaceStatisticsDialog accept() 248 254 157 274 m_pButtonBox rejected() InterfaceStatisticsDialog reject() 316 260 286 274 l2tp-ipsec-vpn/src/dialogs/ConnectionEditorDialog.ui0000664000175000017500000001041412040201226023132 0ustar wejaegerwejaeger ConnectionEditorDialog 0 0 397 246 VPN Connections :/images/connectEstablished:/images/connectEstablished true 9 8 &Add ... false &Edit ... false true &Delete ... false 0 0 Qt::WheelFocus QAbstractItemView::NoEditTriggers false false true false 0 0 150 36 150 36 &Preferences ... false QDialogButtonBox::Close|QDialogButtonBox::Help m_pConnections doubleClicked(QModelIndex) m_pEdit click() 151 105 345 57 m_pButtonBox rejected() ConnectionEditorDialog accept() 151 223 198 122 l2tp-ipsec-vpn/src/dialogs/SmartCardObjectsDialog.ui0000664000175000017500000000436712040201226023070 0ustar wejaegerwejaeger SmartCardObjectsDialog 0 0 400 300 SmartCardObjectsDialog :/images/configure:/images/configure true Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SmartCardObjectsDialog accept() 248 254 157 274 buttonBox rejected() SmartCardObjectsDialog reject() 316 260 286 274 m_pSmartCardObjectsListView doubleClicked(QModelIndex) SmartCardObjectsDialog accept() 199 133 199 149 l2tp-ipsec-vpn/src/dialogs/IpSettingsDialog.ui0000664000175000017500000001752012040201226021762 0ustar wejaegerwejaeger IpSettingsDialog 0 0 400 300 IpSettingsDialog :/images/configure:/images/configure true QFrame::Box QFrame::Sunken If checked the peer is asked for up to 2 DNS server addresses, otherwise provide the desired primary and secundary DNS server addresses manually in the edit boxes below. Obtain DNS server addresses automatically 0 0 Preferred DNS server: m_pPrimaryDNSServersEdit 0 0 Ip addresses of preferred domain name server used to resolve host names. Address must be entered as IPv4 address. Example: 1.2.3.4 0 0 Alternate DNS server: m_pSecundaryDNSServersEdit Ip addresses of alternate domain name server used to resolve host names. Address must be entered as IPv4 address. Example: 1.2.3.4 0 0 Search domains: m_pSearchDomainsEdit Domains used when resolving hostnames. Use spaces to separate multiple domains. 0 0 85 27 Qt::LeftToRight Routes ... false Qt::Vertical 20 23 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok m_pAutomaticDNSCheckBox m_pPrimaryDNSServersEdit m_pSecundaryDNSServersEdit m_pSearchDomainsEdit m_pRoutesButton m_pButtonBox m_pButtonBox accepted() IpSettingsDialog accept() 257 290 157 274 m_pButtonBox rejected() IpSettingsDialog reject() 325 290 286 274 m_pAutomaticDNSCheckBox toggled(bool) m_pPrimaryDNSServersEdit setDisabled(bool) 199 28 267 56 m_pAutomaticDNSCheckBox toggled(bool) m_pSecundaryDNSServersEdit setDisabled(bool) 199 28 267 85 m_pAutomaticDNSCheckBox toggled(bool) m_pSearchDomainsEdit setDisabled(bool) 199 28 267 114 l2tp-ipsec-vpn/src/dialogs/PreferencesEditorDialog.ui0000664000175000017500000002162512040201226023302 0ustar wejaegerwejaeger PreferencesEditorDialog 0 0 451 208 Preferences :/images/configure:/images/configure true 0 OpenSSL Engine &ID: m_pEngineIDLineEdit Unique identifier for OpenSSL engine Unique identifier for OpenSSL engine &Engine Path: m_pEnginePathLineEdit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Full path to a shared library implementing the <a href="http://www.openssl.org/docs/crypto/engine.html"><span style=" text-decoration: underline; color:#0000ff;">OpenSSL engine interface</span></a></p></body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Full path to a shared library implementing the <a href="http://www.openssl.org/docs/crypto/engine.html"><span style=" text-decoration: underline; color:#0000ff;">OpenSSL engine interface</span></a></p></body></html> true :/images/search:/images/search &PKCS 11 Path: m_pPkcs11PathLineEdit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Full path to a shared library implementing the <a href="http://www.rsa.com/rsalabs/node.asp?id=2133"><span style=" text-decoration: underline; color:#0000ff;">Cryptographic Token Interface</span></a></p></body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Full path to a shared library implementing the <a href="http://www.rsa.com/rsalabs/node.asp?id=2133"><span style=" text-decoration: underline; color:#0000ff;">Cryptographic Token Interface</span></a></p></body></html> true :/images/search:/images/search Qt::Vertical 20 40 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok m_pTabWidget m_pEngineIDLineEdit m_pEnginePathLineEdit m_pEnginePathPushButton m_pPkcs11PathLineEdit m_pPkcs11PathPushButton m_pButtonBox m_pButtonBox accepted() PreferencesEditorDialog accept() 248 254 157 274 m_pButtonBox rejected() PreferencesEditorDialog reject() 316 260 286 274 l2tp-ipsec-vpn/src/dialogs/InterfaceStatisticsDialog.cpp0000664000175000017500000001043412040201226024006 0ustar wejaegerwejaeger/* * $Id: InterfaceStatisticsDialog.cpp 133 2012-05-02 09:13:26Z wejaeger $ * * File: InterfaceStatisticsDialog.cpp * Author: wejaeger * * Created on April 7, 2011, 11:52 AM * * Copyright 2010-2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "util/NetworkInterface.h" #include "InterfaceStatisticsDialog.h" static const long long KILO(1024); static const long long MEGA(KILO * KILO); static const long long GIGA(MEGA * MEGA); InterfaceStatisticsDialog::InterfaceStatisticsDialog(const QString& strInterfaceName,QWidget* pParent) : QDialog(pParent), m_strInterfaceName(strInterfaceName), m_iConectedSince(InterfaceStatisticsDialog::connectedSince(strInterfaceName)), m_pTimer(new QTimer()) { m_Widget.setupUi(this); connect(m_pTimer, SIGNAL(timeout()), SLOT(onUpdateStatistic())); if (m_iConectedSince > 0) { QDateTime connectedSince; connectedSince.setTime_t(m_iConectedSince); m_Widget.m_pSince->setText(QLocale::system().toString(connectedSince, QLocale::ShortFormat)); } onUpdateStatistic(); m_pTimer->start(1000); } InterfaceStatisticsDialog::~InterfaceStatisticsDialog() { m_pTimer->stop(); delete m_pTimer; } void InterfaceStatisticsDialog::onUpdateStatistic() const { const NetworkInterface::Statistic statistic(NetworkInterface::statistic(m_strInterfaceName.toStdString())); m_Widget.m_pTransmittedBytes->setText(InterfaceStatisticsDialog::formatBytes(statistic.transmitted().bytes())); m_Widget.m_pTransmittedPackets->setText(QString::number(statistic.transmitted().packets())); m_Widget.m_pTransmissionErrors->setText(QString::number(statistic.transmitted().errs())); m_Widget.m_pCollisions->setText(QString::number(statistic.transmitted().colls())); m_Widget.m_pReceivedBytes->setText(InterfaceStatisticsDialog::formatBytes(statistic.received().bytes())); m_Widget.m_pReceivedPackets->setText(QString::number(statistic.received().packets())); m_Widget.m_pReceptionErrors->setText(QString::number(statistic.received().errs())); m_Widget.m_pConnectionTime->setText(connectionTime()); } const QString InterfaceStatisticsDialog::connectionTime() const { QString strRet; if (m_iConectedSince > 0) { const qint64 lElapsed(QDateTime::currentDateTime().toTime_t() - m_iConectedSince); const QString strSeconds(QString::number((lElapsed) % 60)); const QString strMinutes(QString::number((lElapsed / 60) % 60)); const QString stHours(QString::number((lElapsed / 3600) % 24)); const QString stHDays(QString::number(lElapsed / 86400)); strRet = (stHDays.toLong() > 0 ? stHDays + " " + tr("Days") + " " : "") + (stHours.length() == 1 ? "0" + stHours : stHours) + ":" + (strMinutes.length() == 1 ? "0" + strMinutes : strMinutes) + ":" + (strSeconds.length() == 1 ? "0" + strSeconds : strSeconds); } return(strRet); } const QString InterfaceStatisticsDialog::formatBytes(const long long lBytes) { QString strRet; const QLocale locale(QLocale::system()); if (lBytes < KILO) strRet = locale.toString(lBytes); else if (lBytes < MEGA) strRet = locale.toString(static_cast(lBytes) / KILO, 'f', 3) + " KB"; else if (lBytes < GIGA) strRet = locale.toString(static_cast(lBytes) / MEGA, 'f', 3) + " MB"; else strRet = locale.toString(static_cast(lBytes) / GIGA, 'f', 3) + " GB"; return(strRet); } qint64 InterfaceStatisticsDialog::connectedSince(const QString& strInterfaceName) { const QFileInfo info("/var/run/" + strInterfaceName + ".pid"); return(info.exists() ? info.lastModified().toTime_t() : 0); }l2tp-ipsec-vpn/src/dialogs/RouteSettingsDialog.ui0000664000175000017500000001530712040201226022511 0ustar wejaegerwejaeger RouteSettingsDialog 0 0 439 248 RouteSettingsDialog :/images/configure:/images/configure true 9 15 9 9 9 Add false Delete ... false Qt::WheelFocus route packages with the destination addresses listed here through the PPP tunnel. Qt::Horizontal QDialogButtonBox::Help|QDialogButtonBox::Ok Use following explicit routes to intranet locations (split tunneling) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Based on the <span style=" font-weight:600;">Use default gateway on remote network</span> setting, one of the following occurs when the VPN connection is active: </p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When the <span style=" font-weight:600;">Use default gateway on remote network</span> check box is cleared, Internet locations are reachable and intranet locations are not reachable, except for those matching the network ID of the Internet address class of the assigned IP address. </li> <li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When the<span style=" font-weight:600;"> Use default gateway on remote network</span> check box is selected (the default setting), all intranet locations are reachable and Internet locations are not reachable, except for the address of the VPN server and locations available through other routes. </li></ul></body></html> Use default gateway on the remote network m_pUseDefaultGatewayRadioButton m_pUseExplicitRoutesRadioButton m_pRoutesTableView m_pAddButton m_pDeleteButton m_pButtonBox m_pButtonBox accepted() RouteSettingsDialog accept() 227 226 157 247 m_pButtonBox rejected() RouteSettingsDialog accept() 295 232 286 247 m_pUseDefaultGatewayRadioButton toggled(bool) m_pAddButton setDisabled(bool) 219 24 387 86 m_pUseDefaultGatewayRadioButton toggled(bool) m_pDeleteButton setDisabled(bool) 219 24 387 122 m_pUseDefaultGatewayRadioButton toggled(bool) m_pRoutesTableView setDisabled(bool) 219 24 172 137 l2tp-ipsec-vpn/src/dialogs/PeerAuthenticationDialog.cpp0000664000175000017500000000412312040201226023624 0ustar wejaegerwejaeger/* * $Id: PeerAuthenticationDialog.cpp 64 2011-04-05 03:39:39Z werner $ * * File: PeerAuthenticationDialog.cpp * Author: Werner Jaeger * * Created on August 5, 2010, 11:19 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "settings/ConnectionSettings.h" #include "util/GlobalFunctions.h" #include "PeerAuthenticationDialog.h" PeerAuthenticationDialog::PeerAuthenticationDialog(const QString& strConnectionName, QWidget* pParent) : QDialog(pParent), m_strConnectionName(strConnectionName) { m_Widget.setupUi(this); setWindowTitle(strConnectionName + tr(" - Peer Authentication Settings")); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); readSettings(); } PeerAuthenticationDialog::~PeerAuthenticationDialog() { } void PeerAuthenticationDialog::readSettings() const { const ConnectionSettings settings; const PppSettings pppSettings = settings.pppSettings(m_strConnectionName); m_Widget.m_pRemoteNameEdit->setText(pppSettings.remoteName()); } bool PeerAuthenticationDialog::writeSettings() const { const ConnectionSettings settings; const PppSettings pppSettings = settings.pppSettings(m_strConnectionName); bool fRet = pppSettings.setRemoteName(m_Widget.m_pRemoteNameEdit->text()); return(fRet); } void PeerAuthenticationDialog::onHelpRequested() const { ::showHelp("Configure_Peer_authentication"); } void PeerAuthenticationDialog::accept() { writeSettings(); QDialog::accept(); } l2tp-ipsec-vpn/src/dialogs/ConnectionEditorDialog.h0000664000175000017500000000377412040201226022757 0ustar wejaegerwejaeger/* * $Id: ConnectionEditorDialog.h 86 2011-04-20 05:27:21Z werner $ * * File: ConnectionEditorDialog.h * Author: Werner Jaeger * * Created on July 18, 2010, 1:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _CONNECTIONEDITORDIALOG_H #define _CONNECTIONEDITORDIALOG_H #include "ui_ConnectionEditorDialog.h" class ConnectionsModel; class ConnectionSettings; class ConnectionEditorDialog : public QDialog { Q_OBJECT public: explicit ConnectionEditorDialog(QWidget* pParent = 0); virtual ~ConnectionEditorDialog(); static bool applySettings(ConnectionsModel* pConnectionsModel, ConnectionSettings* pConnectionSettings, const QString strMsgBoxTitle = QString::null, QWidget* pFocus = NULL); signals: void connectionAdded(const QString& strName); void connectionRemoved(const QString& strName); private slots: void onHelpRequested() const; void accept(); void reject(); void editPreferences(); void addConnection(); void editConnection(); void removeConnection(); private: ConnectionEditorDialog(const ConnectionEditorDialog& orig); ConnectionEditorDialog& operator=(const ConnectionEditorDialog& orig); void enableDeleteAndEdit(bool fEnable); Ui::ConnectionEditorDialog m_Widget; ConnectionsModel* const m_pConnectionsModel; ConnectionSettings* const m_pConnectionSettings; }; #endif /* _CONNECTIONEDITORDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/EapSettingsDialog.cpp0000664000175000017500000001460712040201226022267 0ustar wejaegerwejaeger/* * $Id: EapSettingsDialog.cpp 69 2011-04-12 04:33:22Z werner $ * * File: EapSettingsDialog.cpp * Author: Werner Jaeger * * Created on July 29, 2010, 2:48 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "pkcs11/Pkcs11.h" #include "util/CertificateInfo.h" #include "util/GlobalFunctions.h" #include "settings/ConnectionSettings.h" #include "ConnectionSettingsDialog.h" #include "SmartCardObjectsDialog.h" #include "EapSettingsDialog.h" EapSettingsDialog::EapSettingsDialog(const QString& strConnectionName, QWidget* pParent) : QDialog(pParent), m_strConnectionName(strConnectionName) { m_Widget.setupUi(this); setWindowTitle(strConnectionName + tr(" - EAP Settings")); connect(m_Widget.m_pUseCertificateRadioButton, SIGNAL(toggled(bool)), SLOT(onUseCertificateRadioButtonToggled(bool))); connect(m_Widget.m_pBrowseCertificateButton, SIGNAL(clicked()), SLOT(onCertificate())); connect(m_Widget.m_pBrowsePrivateKeyButton, SIGNAL(clicked()), SLOT(onPrivateKey())); connect(m_Widget.m_pBrowseCaCertificateButton, SIGNAL(clicked()), SLOT(onCaCertificate())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); readSettings(); } EapSettingsDialog::~EapSettingsDialog() { } void EapSettingsDialog::onUseCertificateRadioButtonToggled(bool fChecked) { PppEapSettings eapSettings(ConnectionSettings().pppSettings(m_strConnectionName).eapSettings()); if ((!fChecked && eapSettings.useSmartCard()) || (fChecked && !eapSettings.useSmartCard())) { m_Widget.m_pCertificateEdit->setText(eapSettings.certificatePath()); m_Widget.m_pPrivateKeyEdit->setText(eapSettings.privateKeyPath()); m_Widget.m_pPrivateKeyPwdEdit->setText(eapSettings.privateKeyPassword()); } else { m_Widget.m_pCertificateEdit->setText(""); m_Widget.m_pPrivateKeyEdit->setText(""); m_Widget.m_pPrivateKeyPwdEdit->setText(""); } } void EapSettingsDialog::onCertificate() { if (m_Widget.m_pUseSmartCardRadioButton->isChecked()) { SmartCardObjectsDialog dialog(SmartCardObjectListModel::Certificate); dialog.setWindowTitle(tr("Choose your personal certificate ...")); if (dialog.exec() == QDialog::Accepted) { m_Widget.m_pCertificateEdit->setText(dialog.selectedItem()); m_strUserName = dialog.selectedUserName(); } } else { const QString strCertPath(QFileDialog::getOpenFileName(this, tr("Choose your personal certificate ..."), QDir::homePath(), tr("PEM certificates (*.pem)"))); if (!strCertPath.isNull()) { m_Widget.m_pCertificateEdit->setText(strCertPath); m_strUserName = CertificateInfo(strCertPath).email(); } } } void EapSettingsDialog::onPrivateKey() { if (m_Widget.m_pUseSmartCardRadioButton->isChecked()) { SmartCardObjectsDialog dialog(SmartCardObjectListModel::PublicKey); dialog.setWindowTitle(tr("Choose your private key ...")); if (dialog.exec() == QDialog::Accepted) m_Widget.m_pPrivateKeyEdit->setText(dialog.selectedItem()); } else { const QString strPrivateKeyPath(QFileDialog::getOpenFileName(this, tr("Choose your private key ..."), QString(), tr("PEM private keys (*.pem)"))); if (!strPrivateKeyPath.isNull()) m_Widget.m_pPrivateKeyEdit->setText(strPrivateKeyPath); } } void EapSettingsDialog::onCaCertificate() { const QString strCaCertPath(QFileDialog::getOpenFileName(this, tr("Choose a Certificate Authority certificate ..."), QString(), tr("PEM certificates (*.pem)"))); if (!strCaCertPath.isNull()) m_Widget.m_pCaCertificateEdit->setText(strCaCertPath); } void EapSettingsDialog::readSettings() { const ConnectionSettings settings; const PppSettings pppSettings(settings.pppSettings(m_strConnectionName)); const PppEapSettings eapSettings = pppSettings.eapSettings(); if (!Pkcs11::loaded()) { m_Widget.m_pUseSmartCardRadioButton->setDisabled(true); if (eapSettings.useSmartCard()) { eapSettings.setUseSmartCard(false); eapSettings.setCertificatePath(""); eapSettings.setPrivateKeyPath(""); eapSettings.setPrivateKeyPassword(""); } } if (eapSettings.useSmartCard()) { m_Widget.m_pUseSmartCardRadioButton->setChecked(true); m_Widget.m_pUseCertificateRadioButton->setChecked(false); } else { m_Widget.m_pUseSmartCardRadioButton->setChecked(false); m_Widget.m_pUseCertificateRadioButton->setChecked(true); } m_Widget.m_pCertificateEdit->setText(eapSettings.certificatePath()); m_Widget.m_pPrivateKeyEdit->setText(eapSettings.privateKeyPath()); m_Widget.m_pPrivateKeyPwdEdit->setText(eapSettings.privateKeyPassword()); m_Widget.m_pCaCertificateEdit->setText(eapSettings.caCertificatePath()); m_strUserName = pppSettings.userName(); } bool EapSettingsDialog::writeSettings() const { const ConnectionSettings settings; const PppSettings pppSettings(settings.pppSettings(m_strConnectionName)); const PppEapSettings eapSettings(pppSettings.eapSettings()); bool fRet(eapSettings.setUseSmartCard(m_Widget.m_pUseSmartCardRadioButton->isChecked())); if (fRet) fRet = eapSettings.setCertificatePath(m_Widget.m_pCertificateEdit->text()); if (fRet) fRet = eapSettings.setPrivateKeyPath(m_Widget.m_pPrivateKeyEdit->text()); if (fRet) fRet = eapSettings.setPrivateKeyPassword(m_Widget.m_pPrivateKeyPwdEdit->text()); if (fRet) fRet = eapSettings.setCaCertificatePath(m_Widget.m_pCaCertificateEdit->text()); if (fRet) fRet = pppSettings.setUserName(m_strUserName); return(fRet); } void EapSettingsDialog::onHelpRequested() const { ::showHelp("Configure_EAP_TLS_.28certificate.29_authentication"); } void EapSettingsDialog::accept() { writeSettings(); QDialog::accept(); } l2tp-ipsec-vpn/src/dialogs/ConnectionInformationDialog.h0000664000175000017500000000340312040201226024003 0ustar wejaegerwejaeger/* * $Id: ConnectionInformationDialog.h 112 2011-12-26 03:00:40Z werner $ * * File: ConnectionInformationDialog.h * Author: Werner Jaeger * * Created on July 18, 2010, 3:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONNECTIONINFORMATIONDIALOG_H #define CONNECTIONINFORMATIONDIALOG_H #include "ui_ConnectionInformationDialog.h" class ConnectionState; class ConnectionInformationDialog : public QDialog { Q_OBJECT public: explicit ConnectionInformationDialog(QWidget* pParent = 0); virtual ~ConnectionInformationDialog(); void clearLog() { m_Widget.m_pTextEdit->clear(); } void appendLogPlainText(const char* pcText); void appendLogColorText(const QColor& color, const char* pcText); public slots: void onConectionStateChanged(const ConnectionState* pNewState, const QString& strConnectionName); private slots: void onStatistics() const; private: ConnectionInformationDialog(const ConnectionInformationDialog& orig); ConnectionInformationDialog& operator=(const ConnectionInformationDialog& orig); Ui::ConnectionInformationDialog m_Widget; }; #endif /* CONNECTIONINFORMATIONDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/SmartCardObjectsDialog.cpp0000664000175000017500000000455612040201226023235 0ustar wejaegerwejaeger/* * $Id: SmartCardObjectsDialog.cpp 151 2012-08-03 16:42:07Z wejaeger $ * * File: SmartCardObjectsDialog.cpp * Author: Werner Jaeger * * Created on August 2, 2010, 6:56 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "SmartCardObjectsDialog.h" SmartCardObjectsDialog::SmartCardObjectsDialog(SmartCardObjectListModel::ObjectType objectType, QWidget* pParent) : QDialog(pParent), m_pModel(new SmartCardObjectListModel(objectType)) { m_Widget.setupUi(this); m_Widget.m_pSmartCardObjectsListView->setModel(m_pModel); } SmartCardObjectsDialog::~SmartCardObjectsDialog() { delete m_pModel; } const QString SmartCardObjectsDialog::selectedItem() const { QString strItem; const QModelIndex currentIndex(m_Widget.m_pSmartCardObjectsListView->currentIndex()); if (currentIndex.isValid()) strItem = m_pModel->data(currentIndex, Qt::UserRole).toString(); return(strItem); } const QString SmartCardObjectsDialog::selectedUserName() const { QString strUserName; const QModelIndex currentIndex(m_Widget.m_pSmartCardObjectsListView->currentIndex()); if (currentIndex.isValid()) strUserName = m_pModel->data(currentIndex, Qt::UserRole + 1).toString(); return(strUserName); } void SmartCardObjectsDialog::accept() { if (m_pModel->objectType() == SmartCardObjectListModel::Certificate) { const QModelIndex currentIndex(m_Widget.m_pSmartCardObjectsListView->currentIndex()); if (currentIndex.isValid()) { if (m_pModel->storeCert(currentIndex)) QDialog::accept(); else QMessageBox::critical(NULL, windowTitle(), tr("Failed to write certificate file '%1'.").arg(selectedItem())); } } else QDialog::accept(); } l2tp-ipsec-vpn/src/dialogs/RouteSettingsDialog.cpp0000664000175000017500000001076712040201226022663 0ustar wejaegerwejaeger/* * $Id: RouteSettingsDialog.cpp 64 2011-04-05 03:39:39Z werner $ * * File: RouteSettingsDialog.cpp * Author: Werner Jaeger * * Created on August 5, 2010, 4:17 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "models/PppRoutesModel.h" #include "util/GlobalFunctions.h" #include "RouteSettingsDialog.h" RouteSettingsDialog::RouteSettingsDialog(const QString& strConnectionName, QWidget* pParent) : QDialog(pParent), m_strConnectionName(strConnectionName), m_pRoutesModel(new PppRoutesModel(strConnectionName)) { m_Widget.setupUi(this); m_Widget.m_pRoutesTableView->setModel(m_pRoutesModel); m_Widget.m_pRoutesTableView->horizontalHeader()->setStretchLastSection(true); m_Widget.m_pRoutesTableView->setSelectionBehavior(QAbstractItemView::SelectRows); connect(m_Widget.m_pAddButton, SIGNAL(clicked()), SLOT(addRoute())); connect(m_Widget.m_pDeleteButton, SIGNAL(clicked()), SLOT(removeRoute())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); if (m_pRoutesModel->rowCount() > 0) m_Widget.m_pRoutesTableView->setCurrentIndex(m_pRoutesModel->index(0, 0)); else m_Widget.m_pDeleteButton->setEnabled(false); setWindowTitle(tr("Edit routes for VPN connection ") + strConnectionName); readSettings(); } RouteSettingsDialog::~RouteSettingsDialog() { delete m_pRoutesModel; } void RouteSettingsDialog::addRoute() const { const int iRow = m_pRoutesModel->rowCount(); if (m_pRoutesModel->addRow()) { m_Widget.m_pRoutesTableView->setCurrentIndex(m_pRoutesModel->index(iRow, 0)); m_Widget.m_pDeleteButton->setEnabled(true); } m_Widget.m_pRoutesTableView->setFocus(); } void RouteSettingsDialog::removeRoute() const { const QModelIndex index = m_Widget.m_pRoutesTableView->currentIndex(); if (index.row() >= 0) { const QString strAddress = m_pRoutesModel->data(m_pRoutesModel->index(index.row(), 0), Qt::DisplayRole).toString(); if (QMessageBox::question(NULL, tr("Delete Route"), tr("Are you sure you wish to delete the route '%1'?").arg(strAddress), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { if (m_pRoutesModel->removeRow(index.row())) { const int iRows = m_pRoutesModel->rowCount(); if (index.row() < iRows) m_Widget.m_pRoutesTableView->setCurrentIndex(m_pRoutesModel->index(index.row(), 0)); else if (iRows > 0) m_Widget.m_pRoutesTableView->setCurrentIndex(m_pRoutesModel->index(index.row() - 1, 0)); m_Widget.m_pDeleteButton->setEnabled(iRows > 0); } } } m_Widget.m_pRoutesTableView->setFocus(); } void RouteSettingsDialog::onHelpRequested() const { ::showHelp("Configure_routes"); } void RouteSettingsDialog::accept() { writeSettings(); QDialog::accept(); } void RouteSettingsDialog::readSettings() const { const PppIpSettings ipSettings = ConnectionSettings().pppSettings(m_strConnectionName).ipSettings(); if (ipSettings.useDefaultGateway()) { m_Widget.m_pUseDefaultGatewayRadioButton->setChecked(true); m_Widget.m_pUseExplicitRoutesRadioButton->setChecked(false); m_Widget.m_pAddButton->setDisabled(true); m_Widget.m_pDeleteButton->setDisabled(true); m_Widget.m_pRoutesTableView->setDisabled(true); } else { m_Widget.m_pUseDefaultGatewayRadioButton->setChecked(false); m_Widget.m_pUseExplicitRoutesRadioButton->setChecked(true); m_Widget.m_pAddButton->setEnabled(true); m_Widget.m_pDeleteButton->setEnabled(true); m_Widget.m_pRoutesTableView->setEnabled(true); } } bool RouteSettingsDialog::writeSettings() const { const PppIpSettings ipSettings = ConnectionSettings().pppSettings(m_strConnectionName).ipSettings(); return(ipSettings.setUseDefaultGateway(m_Widget.m_pUseDefaultGatewayRadioButton->isChecked())); }l2tp-ipsec-vpn/src/dialogs/CertificateImportDialog.h0000664000175000017500000000410212040201226023110 0ustar wejaegerwejaeger/* * $Id: CertificateImportDialog.h 129 2012-04-07 10:15:46Z wejaeger $ * * File: CertificateImportDialog.h * Author: wejaeger * * Created on April 11, 2011, 11:58 AM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _CERTIFICATEIMPORTDIALOG_H #define _CERTIFICATEIMPORTDIALOG_H #include "ui_CertificateImportDialog.h" class Pkcs12; class QString; class CertificateImportDialog : public QDialog { Q_OBJECT public: CertificateImportDialog(QWidget* pParent = 0); virtual ~CertificateImportDialog(); const QString certificateFilename() const; const QString certificateFilenamePath() const; const QString privateKeyFilename() const; const QString privateKeyFilenamePath() const; const QString caCertificateFilename() const; const QString caCertificateFilenamePath() const; const QString passPhrase() const; bool useAsAuthenticationCertificate() const; private slots: void onHelpRequested() const; void onCertificate(); void onValidateInput() const; void accept(); private: CertificateImportDialog(const CertificateImportDialog& orig); CertificateImportDialog& operator=(const CertificateImportDialog& orig); bool isInputValid() const; bool writePems() const; void showError(); bool checkIfFileExistAndConfirmOverwrite(const QString& strFilenamePath, const QString& strType) const; Ui::CertificateImportDialog m_Widget; Pkcs12* m_pPkcs12; }; #endif /* _CERTIFICATEIMPORTDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/ConnectionSettingsDialog.cpp0000664000175000017500000003146412040201226023661 0ustar wejaegerwejaeger/* * $Id: ConnectionSettingsDialog.cpp 114 2012-01-22 05:07:35Z werner $ * * File: ConnectionSettingsDialog.cpp * Author: Werner Jaeger * * Created on July 21, 2010, 5:27 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "settings/ConnectionSettings.h" #include "models/ConnectionsModel.h" #include "models/IPsecCertificateListModel.h" #include "util/GlobalFunctions.h" #include "PeerAuthenticationDialog.h" #include "IpSettingsDialog.h" #include "EapSettingsDialog.h" #include "AdvancedSettingsDialog.h" #include "CertificateImportDialog.h" #include "ConnectionSettingsDialog.h" static const char* const RSASIG("rsasig"); static const char* const SECRET("secret"); static const char* const IPSECPRIVATEKEYPATH("/etc/ipsec.d/private"); ConnectionSettingsDialog::ConnectionSettingsDialog(const QString& strConnectionName, QWidget* pParent) : QDialog(pParent), m_strConnectionName(strConnectionName), m_pCertificateListModel(new IPsecCertificateListModel()) { m_Widget.setupUi(this); m_Widget.m_pIPsecCertificateListView->setModel(m_pCertificateListModel); m_Widget.m_pConnectionNameEdit->setText(strConnectionName); m_Widget.m_pIPsecGatewayEdit->setValidator(new QRegExpValidator(::gatewayValidationRE(), this)); m_Widget.m_pTabWidget->setCurrentIndex(0); connect(m_Widget.m_pIPsecUseCertificateRadioButton, SIGNAL(toggled(bool)), SLOT(onUseIPsecCertificateRadioButtonToggled(bool))); connect(m_Widget.m_pIPsecBrowsePrivateKeyButton, SIGNAL(clicked()), SLOT(onPrivateKey())); connect(m_Widget.m_pPppPropertiesButton, SIGNAL(clicked()), SLOT(onEapProperties())); connect(m_Widget.m_pPppPeerAuthenticationButton, SIGNAL(clicked()), SLOT(onPeerAuthentication())); connect(m_Widget.m_pPppIpSettingsButton, SIGNAL(clicked()), SLOT(onIpSettings())); connect(m_Widget.m_pPppAdvancedButton, SIGNAL(clicked()), SLOT(onAdvancedSettings())); connect(m_Widget.m_pPppUseEAPRadioButton, SIGNAL(toggled(bool)), SLOT(onUseEapRadioButtonToggled(bool))); connect(m_Widget.m_pImportPushButton, SIGNAL(clicked()), SLOT(onImport())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); readSettings(); } ConnectionSettingsDialog::~ConnectionSettingsDialog() { delete m_pCertificateListModel; } void ConnectionSettingsDialog::onHelpRequested() const { switch (m_Widget.m_pTabWidget->currentIndex()) { case 0: ::showHelp("Configure_IPsec_options"); break; case 1: ::showHelp("Configure_L2TP_options"); break; case 2: ::showHelp("Configure_PPP_options"); break; default: ::showHelp("Configuring_a_connection"); } } void ConnectionSettingsDialog::accept() { writeSettings(); QDialog::accept(); } void ConnectionSettingsDialog::readSettings() const { const ConnectionSettings settings; readCommonSettings(CommonSettings(settings.commonSettings(m_strConnectionName))); readIPSecSettings(IPSecSettings(settings.ipsecSettings(m_strConnectionName))); readL2tpSettings(L2tpSettings(settings.l2tpSettings(m_strConnectionName))); readPppSettings(PppSettings(settings.pppSettings(m_strConnectionName))); } bool ConnectionSettingsDialog::writeSettings() const { const ConnectionSettings settings; bool fRet(writeCommonSetting((settings.commonSettings(m_strConnectionName)))); if (fRet) fRet = writeIPsecSetting((settings.ipsecSettings(m_strConnectionName))); if (fRet) fRet = writeL2tpSettings((settings.l2tpSettings(m_strConnectionName))); if (fRet) fRet = writePppSettings((settings.pppSettings(m_strConnectionName))); return(fRet); } void ConnectionSettingsDialog::onEapProperties()const { EapSettingsDialog eapSettings(m_strConnectionName); if (eapSettings.exec() == QDialog::Accepted) readSettings(); } void ConnectionSettingsDialog::onPeerAuthentication() const { PeerAuthenticationDialog peerAuthentication(m_strConnectionName); peerAuthentication.exec(); } void ConnectionSettingsDialog::onIpSettings() const { IpSettingsDialog ipsecSettings(m_strConnectionName); ipsecSettings.exec(); } void ConnectionSettingsDialog::onAdvancedSettings() const { AdvancedSettingsDialog advancedSettings(m_strConnectionName); advancedSettings.exec(); } void ConnectionSettingsDialog::onUseIPsecCertificateRadioButtonToggled(bool fEnable) { if (fEnable) { m_Widget.m_pIPsecCertificateListView->setEnabled(true); m_Widget.m_pIPsecPrivateKeyFrame->setEnabled(true); m_Widget.m_pIPsecPreSharedKeyEdit->setEnabled(false); } else { m_Widget.m_pIPsecCertificateListView->setEnabled(false); m_Widget.m_pIPsecPrivateKeyFrame->setEnabled(false); m_Widget.m_pIPsecPreSharedKeyEdit->setEnabled(true); } } void ConnectionSettingsDialog::onUseEapRadioButtonToggled(bool fEnabled) { if (fEnabled) { m_Widget.m_pPppPropertiesButton->setEnabled(true); m_Widget.m_pPppAllowProtocolsListWidget->setEnabled(false); m_Widget.m_pPppUserNameEdit->setEnabled(false); m_Widget.m_pPppPwdEdit->setEnabled(false); } else { m_Widget.m_pPppPropertiesButton->setEnabled(false); m_Widget.m_pPppAllowProtocolsListWidget->setEnabled(true); m_Widget.m_pPppUserNameEdit->setEnabled(true); m_Widget.m_pPppPwdEdit->setEnabled(true); } } void ConnectionSettingsDialog::onPrivateKey() { const QString strPrivateKeyPath(QFileDialog::getOpenFileName(this, tr("Choose private key ..."), IPSECPRIVATEKEYPATH, tr("PEM private keys (*.pem)"))); if (!strPrivateKeyPath.isNull()) m_Widget.m_pIPsecPrivateKeyFileEdit->setText(strPrivateKeyPath); } void ConnectionSettingsDialog::onImport() { CertificateImportDialog importDialog; if (importDialog.exec() == QDialog::Accepted) { m_pCertificateListModel->refresh(); if (importDialog.useAsAuthenticationCertificate()) { m_pCertificateListModel->select(importDialog.certificateFilename()); m_Widget.m_pIPsecPrivateKeyFileEdit->setText(importDialog.privateKeyFilenamePath()); m_Widget.m_pIPsecPassphraseEdit->setText(importDialog.passPhrase()); } } } void ConnectionSettingsDialog::readCommonSettings(const CommonSettings& commonSettings) const { m_Widget.m_pConnectAutomatically->setChecked(commonSettings.autoConnect()); m_Widget.m_pDisableIPSecEncryption->setChecked(commonSettings.disableIPSecEncryption()); } void ConnectionSettingsDialog::readIPSecSettings(const IPSecSettings& ipsecSettings) const { m_Widget.m_pIPsecGatewayEdit->setText(ipsecSettings.gateway()); m_Widget.m_pIPsecIdentityEdit->setText(ipsecSettings.identity()); const QString strAuthBy(ipsecSettings.authBy()); if (RSASIG == strAuthBy) { m_Widget.m_pIPsecUsePreSharedKeyRadioButton->setChecked(false); m_Widget.m_pIPsecUseCertificateRadioButton->setChecked(true); m_Widget.m_pIPsecPreSharedKeyEdit->setEnabled(false); m_Widget.m_pIPsecCertificateListView->setEnabled(true); m_Widget.m_pIPsecPrivateKeyFrame->setEnabled(true); } else { m_Widget.m_pIPsecUsePreSharedKeyRadioButton->setChecked(true); m_Widget.m_pIPsecUseCertificateRadioButton->setChecked(false); m_Widget.m_pIPsecPreSharedKeyEdit->setEnabled(true); m_Widget.m_pIPsecCertificateListView->setEnabled(false); m_Widget.m_pIPsecPrivateKeyFrame->setEnabled(false); } m_Widget.m_pIPsecPreSharedKeyEdit->setText(ipsecSettings.preSharedKey()); m_pCertificateListModel->select(ipsecSettings.certificateFileName()); m_Widget.m_pIPsecPrivateKeyFileEdit->setText(ipsecSettings.privateKeyFilePath()); m_Widget.m_pIPsecPassphraseEdit->setText(ipsecSettings.privateKeyPassphrase()); } void ConnectionSettingsDialog::readL2tpSettings(const L2tpSettings& l2tpSettings) const { m_Widget.m_pL2tpLengthBitCheckBox->setCheckState(l2tpSettings.lengthBit() == true ? Qt::Checked : Qt::Unchecked); const bool fRedial = l2tpSettings.redial(); m_Widget.m_pL2tpRedialCheckBox->setCheckState(fRedial ? Qt::Checked : Qt::Unchecked); m_Widget.m_pL2tpRedialTimeoutSpinBox->setValue(l2tpSettings.redialTimeout()); m_Widget.m_pL2tpRedialTimeoutSpinBox->setEnabled(fRedial); m_Widget.m_pL2tpRedialAttemptsSpinBox->setValue(l2tpSettings.redialAttempts()); m_Widget.m_pL2tpRedialAttemptsSpinBox->setEnabled(fRedial); } void ConnectionSettingsDialog::readPppSettings(const PppSettings& pppSettings) const { if (!pppSettings.refuseEap()) { m_Widget.m_pPppAllowProtocolsRadioButton->setChecked(false); m_Widget.m_pPppUseEAPRadioButton->setChecked(true); m_Widget.m_pPppAllowProtocolsListWidget->setEnabled(false); m_Widget.m_pPppPropertiesButton->setEnabled(true); m_Widget.m_pPppUserNameEdit->setEnabled(false); m_Widget.m_pPppPwdEdit->setEnabled(false); } else { m_Widget.m_pPppAllowProtocolsRadioButton->setChecked(true); m_Widget.m_pPppUseEAPRadioButton->setChecked(false); m_Widget.m_pPppAllowProtocolsListWidget->setEnabled(true); m_Widget.m_pPppPropertiesButton->setEnabled(false); m_Widget.m_pPppUserNameEdit->setEnabled(true); m_Widget.m_pPppPwdEdit->setEnabled(true); } m_Widget.m_pPppAllowProtocolsListWidget->item(0)->setCheckState(!pppSettings.refusePap() ? Qt::Checked : Qt::Unchecked); m_Widget.m_pPppAllowProtocolsListWidget->item(1)->setCheckState(!pppSettings.refuseChap() ? Qt::Checked : Qt::Unchecked); m_Widget.m_pPppAllowProtocolsListWidget->item(2)->setCheckState(!pppSettings.refuseMsChap() ? Qt::Checked : Qt::Unchecked); m_Widget.m_pPppAllowProtocolsListWidget->item(3)->setCheckState(!pppSettings.refuseMsChapV2() ? Qt::Checked : Qt::Unchecked); m_Widget.m_pPppUserNameEdit->setText(pppSettings.userName()); m_Widget.m_pPppPwdEdit->setText(pppSettings.password()); } bool ConnectionSettingsDialog::writeCommonSetting(const CommonSettings& commonSettings) const { bool fRet(commonSettings.setAutoConnect(m_Widget.m_pConnectAutomatically->isChecked())); if (fRet) fRet = commonSettings.setDisableIPSecEncryption(m_Widget.m_pDisableIPSecEncryption->isChecked()); return(fRet); } bool ConnectionSettingsDialog::writeIPsecSetting(const IPSecSettings& ipsecSettings) const { bool fRet(ipsecSettings.setGateway(m_Widget.m_pIPsecGatewayEdit->text())); if (fRet) fRet = ipsecSettings.setIdentity(m_Widget.m_pIPsecIdentityEdit->text()); if (fRet) fRet = ipsecSettings.setAuthBy(m_Widget.m_pIPsecUseCertificateRadioButton->isChecked() ? RSASIG : SECRET); if (fRet) fRet = ipsecSettings.setPreSharedKey(m_Widget.m_pIPsecPreSharedKeyEdit->text()); if (fRet) fRet = ipsecSettings.setCertificateFileName(m_pCertificateListModel->selectedCertificateFileName()); if (fRet) fRet = ipsecSettings.setPrivateKeyFilePath(m_Widget.m_pIPsecPrivateKeyFileEdit->text()); if (fRet) fRet = ipsecSettings.setPrivateKeyPassphrase(m_Widget.m_pIPsecPassphraseEdit->text()); return(fRet); } bool ConnectionSettingsDialog::writeL2tpSettings(const L2tpSettings& l2tpSettings) const { bool fRet(l2tpSettings.setLengthBit(m_Widget.m_pL2tpLengthBitCheckBox->checkState())); if (fRet) fRet = l2tpSettings.setRedial(m_Widget.m_pL2tpRedialCheckBox->checkState()); if (fRet) fRet = l2tpSettings.setRedialTimeout(m_Widget.m_pL2tpRedialTimeoutSpinBox->value()); if (fRet) fRet = l2tpSettings.setRedialAttempts(m_Widget.m_pL2tpRedialAttemptsSpinBox->value()); return(fRet); } bool ConnectionSettingsDialog::writePppSettings(const PppSettings& pppSettings) const { bool fRet(pppSettings.setRefuseEap(!m_Widget.m_pPppUseEAPRadioButton->isChecked())); if (fRet) fRet = pppSettings.setRefusePap(m_Widget.m_pPppAllowProtocolsListWidget->item(0)->checkState() == Qt::Checked ? false : true); if (fRet) fRet = pppSettings.setRefuseChap(m_Widget.m_pPppAllowProtocolsListWidget->item(1)->checkState() == Qt::Checked ? false : true); if (fRet) fRet = pppSettings.setRefuseMsChap(m_Widget.m_pPppAllowProtocolsListWidget->item(2)->checkState() == Qt::Checked ? false : true); if (fRet) fRet = pppSettings.setRefuseMsChapV2(m_Widget.m_pPppAllowProtocolsListWidget->item(3)->checkState() == Qt::Checked ? false : true); if (fRet) fRet = pppSettings.setUserName(m_Widget.m_pPppUserNameEdit->text()); if (fRet) fRet = pppSettings.setPassword(m_Widget.m_pPppPwdEdit->text()); return(fRet); } l2tp-ipsec-vpn/src/dialogs/ConnectionSettingsDialog.h0000664000175000017500000000505412040201226023322 0ustar wejaegerwejaeger/* * $Id: ConnectionSettingsDialog.h 69 2011-04-12 04:33:22Z werner $ * * File: ConnectionSettingsDialog.h * Author: Werner Jaeger * * Created on July 21, 2010, 5:27 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _CONNECTIONSETTINGSDIALOG_H #define _CONNECTIONSETTINGSDIALOG_H #include "ui_ConnectionSettingsDialog.h" class CommonSettings; class IPSecSettings; class L2tpSettings; class PppSettings; class IPsecCertificateListModel; class ConnectionSettingsDialog : public QDialog { Q_OBJECT public: ConnectionSettingsDialog(const QString& strConnectionName, QWidget* pParent = 0); virtual ~ConnectionSettingsDialog(); private slots: void onHelpRequested() const; void accept(); void readSettings() const; bool writeSettings() const; void onEapProperties() const; void onPeerAuthentication() const; void onIpSettings() const; void onAdvancedSettings() const; void onUseIPsecCertificateRadioButtonToggled(bool fEnable); void onUseEapRadioButtonToggled(bool fEnabled); void onPrivateKey(); void onImport(); private: ConnectionSettingsDialog(const ConnectionSettingsDialog& orig); ConnectionSettingsDialog& operator=(const ConnectionSettingsDialog& orig); void readCommonSettings(const CommonSettings& commonSettings) const; void readIPSecSettings(const IPSecSettings& ipsecSettings) const; void readL2tpSettings(const L2tpSettings& l2tpSettings) const; void readPppSettings(const PppSettings& pppSettings) const; bool writeCommonSetting(const CommonSettings& commonSettings) const; bool writeIPsecSetting(const IPSecSettings& ipsecSettings) const; bool writeL2tpSettings(const L2tpSettings& l2tpSettings) const; bool writePppSettings(const PppSettings& pppSettings) const; Ui::ConnectionSettingsDialog m_Widget; const QString m_strConnectionName; IPsecCertificateListModel* const m_pCertificateListModel; }; #endif /* _CONNECTIONSETTINGSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/ConnectionInformationDialog.cpp0000664000175000017500000001027012040201226024336 0ustar wejaegerwejaeger/* * $Id: ConnectionInformationDialog.cpp 129 2012-04-07 10:15:46Z wejaeger $ * * File: ConnectionInformationDialog.cpp * Author: Werner Jaeger * * Created on July 18, 2010, 3:37 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "ConnectionState.h" #include "ConnectionManager.h" #include "InterfaceStatisticsDialog.h" #include "ConnectionInformationDialog.h" ConnectionInformationDialog::ConnectionInformationDialog(QWidget* pParent) : QDialog(pParent) { m_Widget.setupUi(this); connect(m_Widget.m_pStatisticsPushButton, SIGNAL(clicked()), SLOT(onStatistics())); } ConnectionInformationDialog::~ConnectionInformationDialog() { } void ConnectionInformationDialog::appendLogPlainText(const char* pcText) { const QString strText(pcText); const int iPos(strText.indexOf("ipsec__plutorun")); m_Widget.m_pTextEdit->insertPlainText(QDateTime::currentDateTime().toString("MMM dd hh:mm:ss.zzz") + " " + strText.mid((iPos == -1 ? 0 : iPos))); } void ConnectionInformationDialog::appendLogColorText(const QColor& color, const char* pcText) { const QColor currentColor(m_Widget.m_pTextEdit->textColor()); if (pcText) { m_Widget.m_pTextEdit->setTextColor(color); appendLogPlainText(pcText); m_Widget.m_pTextEdit->setTextColor(currentColor); } } void ConnectionInformationDialog::onConectionStateChanged(const ConnectionState* pNewState, const QString& strConnectionName) { if (pNewState) { setWindowIcon(pNewState->icon()); if (pNewState->isState(ConnectionState::Connected)) { const NetworkInterface interface(pNewState->ptpInterface()); const NetworkInterface::AddressEntries addressEntries(interface.addressEntries()); const NetworkInterface::DefaultGatewayInfo internetInterfaceInfo(NetworkInterface::defaultGatewayInfo()); m_Widget.m_pTabWidget->setCurrentIndex(0); m_Widget.m_pTabWidget->setTabEnabled(0, true); m_Widget.m_pTabWidget->setTabText(0, strConnectionName); m_Widget.m_pGateway->setText(pNewState->hostName()); m_Widget.m_pInternetInterfaceName->setText(internetInterfaceInfo.interfaceName().c_str()); m_Widget.m_pInternetInterfaceGateway->setText(internetInterfaceInfo.gateway().c_str()); m_Widget.m_pInterfaceName->setText(interface.name().c_str()); if (!addressEntries.empty()) { m_Widget.m_pRemoteHost->setText(addressEntries[0].broadcast().toString()); m_Widget.m_pIPAddress->setText(addressEntries[0].ip().toString()); m_Widget.m_pSubnetMask->setText(addressEntries[0].netmask().toString()); } else { m_Widget.m_pRemoteHost->setText(""); m_Widget.m_pIPAddress->setText(""); m_Widget.m_pSubnetMask->setText(""); } const QStringList dns(NetworkInterface::dns()); if (dns.size() > 0) { m_Widget.m_pPrimaryDNS->setText(dns.at(0)); if (dns.size() > 1) { m_Widget.m_pSecondaryDNS->setText(dns.at(1)); if (dns.size() > 2) m_Widget.m_pTenaryDNS->setText(dns.at(2)); } } } else { m_Widget.m_pTabWidget->setCurrentIndex(1); m_Widget.m_pTabWidget->setTabEnabled(0, false); m_Widget.m_pTabWidget->setTabText(0, pNewState->msgTitle()); } } } void ConnectionInformationDialog::onStatistics() const { InterfaceStatisticsDialog interfaceStatistics(m_Widget.m_pInterfaceName->text()); interfaceStatistics.exec(); }l2tp-ipsec-vpn/src/dialogs/IpSettingsDialog.cpp0000664000175000017500000000705412040201226022130 0ustar wejaegerwejaeger/* * $Id: IpSettingsDialog.cpp 64 2011-04-05 03:39:39Z werner $ * * File: IpSettingsDialog.cpp * Author: Werner Jaeger * * Created on August 20, 2010, 9:59 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "util/GlobalFunctions.h" #include "settings/ConnectionSettings.h" #include "RouteSettingsDialog.h" #include "IpSettingsDialog.h" IpSettingsDialog::IpSettingsDialog(const QString& strConnectionName, QWidget* pParent) : QDialog(pParent), m_strConnectionName(strConnectionName) { m_Widget.setupUi(this); setWindowTitle(strConnectionName + tr(" - Ip Settings")); m_Widget.m_pPrimaryDNSServersEdit->setValidator(new QRegExpValidator(::ipv4ValidationRE(), this)); m_Widget.m_pSecundaryDNSServersEdit->setValidator(new QRegExpValidator(::ipv4ValidationRE(), this)); m_Widget.m_pSearchDomainsEdit->setValidator(new QRegExpValidator(::hostNameListValidationRE(), this)); connect(m_Widget.m_pRoutesButton, SIGNAL(clicked()), SLOT(onRouteSettings())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); readSettings(); } IpSettingsDialog::~IpSettingsDialog() { } void IpSettingsDialog::onRouteSettings() const { RouteSettingsDialog routeSettings(m_strConnectionName); routeSettings.exec(); } void IpSettingsDialog::onHelpRequested() const { ::showHelp("Configure_IP_settings"); } void IpSettingsDialog::accept() { writeSettings(); QDialog::accept(); } void IpSettingsDialog::readSettings() const { const ConnectionSettings settings; const PppIpSettings ipSettings = settings.pppSettings(m_strConnectionName).ipSettings(); if (ipSettings.usePeerDns()) { m_Widget.m_pAutomaticDNSCheckBox->setChecked(true); m_Widget.m_pPrimaryDNSServersEdit->setDisabled(true); m_Widget.m_pSecundaryDNSServersEdit->setDisabled(true); m_Widget.m_pSearchDomainsEdit->setDisabled(true); } else { m_Widget.m_pAutomaticDNSCheckBox->setChecked(false); m_Widget.m_pPrimaryDNSServersEdit->setEnabled(true); m_Widget.m_pSecundaryDNSServersEdit->setEnabled(true); m_Widget.m_pSearchDomainsEdit->setEnabled(true); } m_Widget.m_pPrimaryDNSServersEdit->setText(ipSettings.preferredDnsServerAddress()); m_Widget.m_pSecundaryDNSServersEdit->setText(ipSettings.alternateDnsServerAddress()); m_Widget.m_pSearchDomainsEdit->setText(ipSettings.searchDomains()); } bool IpSettingsDialog::writeSettings() const { const ConnectionSettings settings; const PppIpSettings ipSettings = settings.pppSettings(m_strConnectionName).ipSettings(); bool fRet = ipSettings.setUsePeerDns(m_Widget.m_pAutomaticDNSCheckBox->isChecked()); if (fRet) fRet = ipSettings.setPreferredDnsServerAddress(m_Widget.m_pPrimaryDNSServersEdit->text()); if (fRet) fRet = ipSettings.setAlternateDnsServerAddress(m_Widget.m_pSecundaryDNSServersEdit->text()); if (fRet) fRet = ipSettings.setSearchDomains(m_Widget.m_pSearchDomainsEdit->text()); return(fRet); }l2tp-ipsec-vpn/src/dialogs/ConnectionEditorDialog.cpp0000664000175000017500000002302312040201226023277 0ustar wejaegerwejaeger/* * $Id: ConnectionEditorDialog.cpp 120 2012-03-08 04:57:41Z werner $ * * File: ConnectionEditorDialog.cpp * Author: Werner Jaeger * * Created on July 18, 2010, 1:09 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "conf/ConfWriter.h" #include "models/ConnectionsModel.h" #include "settings/ConnectionSettings.h" #include "settings/Preferences.h" #include "util/GlobalFunctions.h" #include "ConnectionSettingsDialog.h" #include "ConnectionEditorDialog.h" #include "PreferencesEditorDialog.h" ConnectionEditorDialog::ConnectionEditorDialog(QWidget* pParent) : QDialog(pParent), m_pConnectionsModel(new ConnectionsModel()), m_pConnectionSettings(new ConnectionSettings()) { m_Widget.setupUi(this); m_Widget.m_pConnections->setModel(m_pConnectionsModel); m_Widget.m_pConnections->horizontalHeader()->setStretchLastSection(true); m_Widget.m_pConnections->setSelectionBehavior(QAbstractItemView::SelectRows); connect(m_Widget.m_pPreferencesCommandLinkButton, SIGNAL(clicked()), this, SLOT(editPreferences())); connect(m_Widget.m_pAdd, SIGNAL(clicked()), SLOT(addConnection())); connect(m_Widget.m_pEdit, SIGNAL(clicked()), SLOT(editConnection())); connect(m_Widget.m_pDelete, SIGNAL(clicked()), SLOT(removeConnection())); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); if (m_pConnectionsModel->rowCount() > 0) m_Widget.m_pConnections->setCurrentIndex(m_pConnectionsModel->index(0, 0)); else enableDeleteAndEdit(false); m_Widget.m_pConnections->setFocus(); m_pConnectionSettings->clearChanged(); } ConnectionEditorDialog::~ConnectionEditorDialog() { delete m_pConnectionsModel; delete m_pConnectionSettings; } void ConnectionEditorDialog::onHelpRequested() const { ::showHelp("Installing_L2TP_over_IPsec_VPN_Manager"); } void ConnectionEditorDialog::accept() { if (m_pConnectionSettings->hasChanged()) { applySettings(m_pConnectionsModel, m_pConnectionSettings, windowTitle(), m_Widget.m_pConnections); m_pConnectionSettings->clearChanged(); } QDialog::accept(); } void ConnectionEditorDialog::reject() { if (m_pConnectionSettings->hasChanged()) { applySettings(m_pConnectionsModel, m_pConnectionSettings, windowTitle(), m_Widget.m_pConnections); m_pConnectionSettings->clearChanged(); } QDialog::reject(); } bool ConnectionEditorDialog::applySettings(ConnectionsModel* pConnectionsModel, ConnectionSettings* pConnectionSettings, const QString strMsgBoxTitle, QWidget* pFocus) { const OpenSSLSettings openSSLSettings(Preferences().openSSLSettings()); const int iConnections(pConnectionSettings->connections()); bool fRet(true); if (iConnections > 0) { if (pConnectionsModel->isWriteable()) { if (pFocus) QMessageBox::information(NULL, strMsgBoxTitle, tr("You need to reconnect for your changes to take effect!")); fRet = ConfWriter::write(ConfWriter::IPsec); if (fRet) fRet = ConfWriter::write(ConfWriter::IPsecSECRET); if (fRet) fRet = ConfWriter::write(ConfWriter::L2TP); for (int i = 0; fRet && i < iConnections; i++) { const QString strConnectionName(pConnectionSettings->connection(i)); fRet = ConfWriter::write(ConfWriter::PPP, strConnectionName); if (fRet) { const QString strDNSConfInstance(QCoreApplication::instance()->objectName() + "-" +strConnectionName); const QString strDNSConfFile(ConfWriter::fileName(ConfWriter::PPPDNSCONF, strDNSConfInstance)); const PppIpSettings ipSettings(pConnectionSettings->pppSettings(strConnectionName).ipSettings()); if (ipSettings.usePeerDns() || (ipSettings.alternateDnsServerAddress().isEmpty() && ipSettings.preferredDnsServerAddress().isEmpty() && ipSettings.searchDomains().isEmpty())) { if (QFile::exists(strDNSConfFile)) QFile::remove(strDNSConfFile); } else fRet = ConfWriter::write(ConfWriter::PPPDNSCONF, strDNSConfInstance); } } if (fRet) fRet = ConfWriter::write(ConfWriter::PPPUPSCRIPT); if (fRet) fRet = ConfWriter::write(ConfWriter::PPPDOWNSCRIPT); if (fRet) fRet = ConfWriter::write(ConfWriter::GETIPSECINFO); if (fRet) fRet = ConfWriter::write(ConfWriter::RSYSLOG); if (fRet) { if (openSSLSettings.enginePath().isEmpty() || openSSLSettings.pkcs11Path().isEmpty() || openSSLSettings.engineId().isEmpty()) { const QString strOpenSSLConfFile(ConfWriter::fileName(ConfWriter::OPENSSL)); if (QFile::exists(strOpenSSLConfFile)) QFile::remove(strOpenSSLConfFile); } else fRet = ConfWriter::write(ConfWriter::OPENSSL); } } else { if (pFocus) QMessageBox::critical(NULL, tr("Apply settings"), tr("You do not have the permission to apply settings")); fRet = false; } } if (pFocus) pFocus->setFocus(); return(fRet); } void ConnectionEditorDialog::editPreferences() { PreferencesEditorDialog preferences; preferences.exec(); m_Widget.m_pConnections->setFocus(); } void ConnectionEditorDialog::addConnection() { if (m_pConnectionsModel->isWriteable()) { const QString strTitle(tr("New Connection")); QString strName(""); bool fOk = true; ConnectionsModel::Result result(ConnectionsModel::InvalidName); while (fOk && result != ConnectionsModel::Ok) { strName = QInputDialog::getText(this, strTitle, tr("Connection name:"), QLineEdit::Normal, strName, &fOk); if (fOk) { const int iRow = m_pConnectionsModel->rowCount(); result = m_pConnectionsModel->addRow(strName); switch (result) { case ConnectionsModel::Ok: m_Widget.m_pConnections->setCurrentIndex(m_pConnectionsModel->index(iRow, 0)); enableDeleteAndEdit(true); emit connectionAdded(strName); break; case ConnectionsModel::DuplicateName: QMessageBox::critical(this, strTitle, tr("A connection with name '%1' already exists").arg(strName)); break; case ConnectionsModel::InvalidName: QMessageBox::critical(this, strTitle, tr("The provided name '%1' contains invalid characters.\n\nName must start with a letter and may contain only letters, digits, periods, underscores, and hyphens.\nMaximum length is 30.").arg(strName)); break; default: break; } } } } else QMessageBox::critical(this, tr("New Connection"), tr("You do not have the permission to add a connection")); m_Widget.m_pConnections->setFocus(); } void ConnectionEditorDialog::editConnection() { if (m_pConnectionsModel->isWriteable()) { const QModelIndex index = m_Widget.m_pConnections->currentIndex(); if (index.row() >= 0) { const QString strName = m_pConnectionsModel->data(index, Qt::DisplayRole).toString(); ConnectionSettingsDialog settings(strName); settings.exec(); } } else QMessageBox::critical(this, tr("Edit Connection"), tr("You do not have the permission to edit a connection")); m_Widget.m_pConnections->setFocus(); } void ConnectionEditorDialog::removeConnection() { if (m_pConnectionsModel->isWriteable()) { const QModelIndex index = m_Widget.m_pConnections->currentIndex(); if (index.row() >= 0) { const QString strName = m_pConnectionsModel->data(index, Qt::DisplayRole).toString(); if (QMessageBox::question(this, tr("Delete Connection"), tr("Are you sure you wish to delete the connection '%1'?").arg(strName), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { if (m_pConnectionsModel->removeRow(index.row())) { const int iRows = m_pConnectionsModel->rowCount(); if (index.row() < iRows) m_Widget.m_pConnections->setCurrentIndex(m_pConnectionsModel->index(index.row(), 0)); else if (iRows > 0) m_Widget.m_pConnections->setCurrentIndex(m_pConnectionsModel->index(index.row() - 1, 0)); enableDeleteAndEdit(iRows > 0); emit connectionRemoved(strName); } } } } else QMessageBox::critical(this, tr("Delete Connection"), tr("You do not have the permission to remmove a connection")); m_Widget.m_pConnections->setFocus(); } void ConnectionEditorDialog::enableDeleteAndEdit(bool fEnable) { m_Widget.m_pDelete->setEnabled(fEnable); m_Widget.m_pEdit->setEnabled(fEnable); } l2tp-ipsec-vpn/src/dialogs/ConnectionInformationDialog.ui0000664000175000017500000002113212040201226024170 0ustar wejaegerwejaeger ConnectionInformationDialog 0 0 479 379 0 0 L2TP IPSec VPN true 0 Info Remote Server: 0 0 PtP Interface: 0 0 Destination Address: 0 0 IP Address: 0 0 Subnet Mask: Primary DNS: 0 0 Secondary DNS: 0 0 Tenary DNS: 85 27 Qt::RightToLeft Statistics ... false Internet Interface: Internet Interface Gateway: Logs true 0 0 Qt::Horizontal QDialogButtonBox::Close m_pTabWidget m_pStatisticsPushButton m_pButtonBox m_pTextEdit m_pButtonBox clicked(QAbstractButton*) ConnectionInformationDialog close() 248 254 157 274 l2tp-ipsec-vpn/src/dialogs/InterfaceStatisticsDialog.h0000664000175000017500000000337512040201226023461 0ustar wejaegerwejaeger/* * $Id: InterfaceStatisticsDialog.h 67 2011-04-07 15:38:50Z werner $ * * File: InterfaceStatisticsDialog.h * Author: wejaeger * * Created on April 7, 2011, 11:52 AM * * Copyright 2010-2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _INTERFACESTATISTICSDIALOG_H #define _INTERFACESTATISTICSDIALOG_H #include #include "ui_InterfaceStatisticsDialog.h" class QTimer; class InterfaceStatisticsDialog : public QDialog { Q_OBJECT public: InterfaceStatisticsDialog(const QString& strInterfaceName, QWidget* pParent = 0); virtual ~InterfaceStatisticsDialog(); private slots: void onUpdateStatistic() const; private: InterfaceStatisticsDialog(const InterfaceStatisticsDialog& orig); InterfaceStatisticsDialog& operator=(const InterfaceStatisticsDialog& orig); const QString connectionTime() const; static const QString formatBytes(const long long lBytes); static qint64 connectedSince(const QString& strInterfaceName); const QString m_strInterfaceName; const uint m_iConectedSince; QTimer* const m_pTimer; Ui::InterfaceStatisticsDialog m_Widget; }; #endif /* _INTERFACESTATISTICSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/AdvancedSettingsDialog.h0000664000175000017500000000303012040201226022720 0ustar wejaegerwejaeger/* * $Id: AdvancedSettingsDialog.h 64 2011-04-05 03:39:39Z werner $ * * File: AdvancedSettingsDialog.h * Author: wejaeger * * Created on September 18, 2010, 4:21 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _ADVANCEDSETTINGSDIALOG_H #define _ADVANCEDSETTINGSDIALOG_H #include "ui_AdvancedSettingsDialog.h" class AdvancedSettingsDialog : public QDialog { Q_OBJECT public: AdvancedSettingsDialog(const QString& strConnectionName, QWidget* pParent = 0); virtual ~AdvancedSettingsDialog(); private slots: void onHelpRequested() const; void accept(); private: AdvancedSettingsDialog(const AdvancedSettingsDialog& orig); AdvancedSettingsDialog& operator=(const AdvancedSettingsDialog& orig); void readSettings() const; bool writeSettings() const; Ui::AdvancedSettingsDialog m_Widget; const QString m_strConnectionName; }; #endif /* _ADVANCEDSETTINGSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/CertificateImportDialog.ui0000664000175000017500000001475012040201226023310 0ustar wejaegerwejaeger CertificateImportDialog 0 0 515 297 Import Certificate Dialog :/images/configure:/images/configure true QFrame::Box QFrame::Sunken Full path to PKCS12 (*.p12, *.pfx) encoded certificate bundle file to import true :/images/search:/images/search 0 0 0 80 16777215 16777215 true QFrame::NoFrame QFrame::Plain true PKCS12 File: m_pFileEdit If checked. the imported certificate is automatically selected as IPsec authentication certificate Use this certificate for IPsec authentication true QFrame::Box QFrame::Sunken Private key passphrase: Enter the passphrase that shall be used to encrypt the imported private key QLineEdit::Password Verify private key passphrase: Type the private key passphrase again to confirm QLineEdit::Password Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok m_pFileEdit m_pBrowseFilePushButton m_pSeletAutomaticallyCheckBox m_pInfoTextEdit m_pPrivateKeyPassphraseEdit m_pVerifyPrivateKeyPassphraseEdit m_pButtonBox m_pButtonBox accepted() CertificateImportDialog accept() 248 254 157 274 m_pButtonBox rejected() CertificateImportDialog reject() 316 260 286 274 l2tp-ipsec-vpn/src/dialogs/ConnectionSettingsDialog.ui0000664000175000017500000005512412040201226023513 0ustar wejaegerwejaeger ConnectionSettingsDialog 0 0 451 478 Connection Settings :/images/configure:/images/configure true QFormLayout::AllNonFixedFieldsGrow Connection &name: Qt::AutoText m_pConnectionNameEdit false false 30 true Connect &automatically Qt::StrongFocus QTabWidget::North QTabWidget::Rounded 0 Qt::StrongFocus IPsec QFormLayout::AllNonFixedFieldsGrow 6 0 10 &Remote Server: Qt::AutoText m_pIPsecGatewayEdit 0 0 Qt::StrongFocus IPv4 address or domain name of the remote access server that you want to connect to. Examples: 1.2.3.4 ipsec.server.edu Server &Identity: m_pIPsecIdentityEdit 0 0 Qt::StrongFocus Leave empty if you don't want to check peers's identity, otherwise enter the peer's identity This is mostly a distinguished name like 'CN=cisco-fcs-ber'. Use &pre-shared key for authentication true true QLineEdit::PasswordEchoOnEdit Use &Certificate for authentication 0 0 0 23 true QFrame::Box QFrame::Sunken Private &key: m_pIPsecPrivateKeyFileEdit Full path to a X.509 pem encoded private key file true Passphrase: m_pIPsecPassphraseEdit QLineEdit::Password 36 27 :/images/search:/images/search Import ... Qt::StrongFocus L2TP If checked, l2tpd will attempt to redial if the call get disconected. Redial 0 0 If Checked, the length bit present in the l2tp packet payload will be used. Length bit true QLayout::SetDefaultConstraint QFormLayout::AllNonFixedFieldsGrow 0 0 Timeout: m_pL2tpRedialTimeoutSpinBox false 0 0 Wait N seconds before redial. The redial option must be set to yes to use this option. 300 0 0 Attempts: m_pL2tpRedialAttemptsSpinBox false 0 0 Qt::WheelFocus Will give up redial tries after N attempts. Qt::StrongFocus PPP With this option set, pppd will agree to authenticate itself to the peer exclusively using EAP. Use Extensible Authentication Protocol (EAP) true Properties ... Allow these protocols Unencrypted password (PAP) With this option set, pppd will agree to authenticate itself to the peer using PAP. Unchecked Challenge Authentication Protocol (CHAP) With this option set, pppd will agree to authenticate itself to the peer using CHAP. Unchecked Microsoft CHAP (MS-Chap) With this option set, pppd will agree to authenticate itself to the peer using MS-CHAP. Unchecked Microsoft CHAP Version 2 (MS-CHAPv2) With this option set, pppd will agree to authenticate itself to the peer using MS-CHAPv2. Unchecked QFrame::Box QFrame::Sunken User name: m_pPppUserNameEdit Set the name used for authenticating the local system to the remote access server. Password: m_pPppPwdEdit Enter your password. If left empty you'll be ask each time you try to establish a connection. QLineEdit::Password Peer authentication ... IP settings ... Advanced ... QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok &Disable IPSEC Encryption m_pConnectionNameEdit m_pConnectAutomatically m_pDisableIPSecEncryption m_pTabWidget m_pIPsecGatewayEdit m_pIPsecIdentityEdit m_pIPsecUsePreSharedKeyRadioButton m_pIPsecPreSharedKeyEdit m_pIPsecUseCertificateRadioButton m_pIPsecCertificateListView m_pImportPushButton m_pIPsecPrivateKeyFileEdit m_pIPsecBrowsePrivateKeyButton m_pIPsecPassphraseEdit m_pL2tpRedialCheckBox m_pL2tpRedialTimeoutSpinBox m_pL2tpRedialAttemptsSpinBox m_pL2tpLengthBitCheckBox m_pPppUseEAPRadioButton m_pPppPropertiesButton m_pPppAllowProtocolsRadioButton m_pPppAllowProtocolsListWidget m_pPppUserNameEdit m_pPppPwdEdit m_pPppPeerAuthenticationButton m_pPppIpSettingsButton m_pPppAdvancedButton m_pButtonBox m_pL2tpRedialCheckBox clicked(bool) m_pL2tpRedialAttemptsSpinBox setEnabled(bool) 101 103 119 139 m_pL2tpRedialCheckBox clicked(bool) m_pL2tpRedialTimeoutSpinBox setEnabled(bool) 101 103 119 139 m_pButtonBox accepted() ConnectionSettingsDialog accept() 222 417 225 219 m_pButtonBox rejected() ConnectionSettingsDialog reject() 222 417 225 219 l2tp-ipsec-vpn/src/dialogs/PreferencesEditorDialog.h0000664000175000017500000000302512040201226023106 0ustar wejaegerwejaeger/* * $Id: PreferencesEditorDialog.h 64 2011-04-05 03:39:39Z werner $ * * File: PreferencesEditorDialog.h * Author: wejaeger * * Created on February 4, 2011, 11:21 AM * * Copyright 2011 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _PREFERENCESEDITORDIALOG_H #define _PREFERENCESEDITORDIALOG_H #include "ui_PreferencesEditorDialog.h" class PreferencesEditorDialog : public QDialog { Q_OBJECT public: explicit PreferencesEditorDialog(QWidget* pParent = 0); virtual ~PreferencesEditorDialog(); private slots: void onEnginePath(); void onPkcs11Path(); void onHelpRequested() const; void accept(); void readSettings() const; bool writeSettings() const; private: PreferencesEditorDialog(const PreferencesEditorDialog& orig); PreferencesEditorDialog& operator=(const PreferencesEditorDialog& orig); Ui::PreferencesEditorDialog m_Widget; }; #endif /* _PREFERENCESEDITORDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/EapSettingsDialog.h0000664000175000017500000000316612040201226021732 0ustar wejaegerwejaeger/* * $Id: EapSettingsDialog.h 64 2011-04-05 03:39:39Z werner $ * * File: EapSettingsDialog.h * Author: Werner Jaeger * * Created on July 29, 2010, 2:48 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _EAPSETTINGSDIALOG_H #define _EAPSETTINGSDIALOG_H #include "ui_EapSettingsDialog.h" class EapSettingsDialog : public QDialog { Q_OBJECT public: explicit EapSettingsDialog(const QString& strConnectionName, QWidget* pParent = 0); virtual ~EapSettingsDialog(); private slots: void onUseCertificateRadioButtonToggled(bool fChecked); void onCertificate(); void onPrivateKey(); void onCaCertificate(); void readSettings(); bool writeSettings() const; void onHelpRequested() const; void accept(); private: EapSettingsDialog(const EapSettingsDialog& orig); EapSettingsDialog& operator=(const EapSettingsDialog& orig); Ui::EapSettingsDialog m_Widget; const QString m_strConnectionName; QString m_strUserName; }; #endif /* _EAPSETTINGSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/AdvancedSettingsDialog.ui0000664000175000017500000000674012040201226023121 0ustar wejaegerwejaeger AdvancedSettingsDialog 0 0 305 221 Advanced Settings :/images/configure:/images/configure true Compression Allow &BSD data compression Allow &Deflate data compression Use TCP &header compression Echo Send PPP &echo packets Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok true m_pAllowBSDCompressionCheckBox m_pAllowDeflateCompressionCheckBox m_pUseTCPHeaderCompressionCheckBox m_pSendEchoCheckBox m_pButtonBox m_pButtonBox accepted() AdvancedSettingsDialog accept() 248 254 157 274 m_pButtonBox rejected() AdvancedSettingsDialog reject() 316 260 286 274 l2tp-ipsec-vpn/src/dialogs/PeerAuthenticationDialog.h0000664000175000017500000000307712040201226023300 0ustar wejaegerwejaeger/* * $Id: PeerAuthenticationDialog.h 64 2011-04-05 03:39:39Z werner $ * * File: PeerAuthenticationDialog.h * Author: Werner Jaeger * * Created on August 5, 2010, 11:19 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _PEERAUTHENTICATIONDIALOG_H #define _PEERAUTHENTICATIONDIALOG_H #include "ui_PeerAuthenticationDialog.h" class PeerAuthenticationDialog : public QDialog { Q_OBJECT public: explicit PeerAuthenticationDialog(const QString& strConnectionName, QWidget* pParent = 0); virtual ~PeerAuthenticationDialog(); private slots: void readSettings() const; bool writeSettings() const; void onHelpRequested() const; void accept(); private: PeerAuthenticationDialog(const PeerAuthenticationDialog& orig); PeerAuthenticationDialog& operator=(const PeerAuthenticationDialog& orig); Ui::PeerAuthenticationDialog m_Widget; const QString m_strConnectionName; }; #endif /* _PEERAUTHENTICATIONDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/SmartCardObjectsDialog.h0000664000175000017500000000313512040201226022672 0ustar wejaegerwejaeger/* * $Id: SmartCardObjectsDialog.h 151 2012-08-03 16:42:07Z wejaeger $ * * File: SmartCardObjectsDialog.h * Author: Werner Jaeger * * Created on August 2, 2010, 6:56 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _SMARTCARDOBJECTSDIALOG_H #define _SMARTCARDOBJECTSDIALOG_H #include "models/SmartCardObjectListModel.h" #include "ui_SmartCardObjectsDialog.h" class SmartCardObjectsDialog : public QDialog { Q_OBJECT public: explicit SmartCardObjectsDialog(SmartCardObjectListModel::ObjectType objectType, QWidget* pParent = 0); virtual ~SmartCardObjectsDialog(); const QString selectedItem() const; const QString selectedUserName() const; private slots: void accept(); private: SmartCardObjectsDialog(const SmartCardObjectsDialog& orig); SmartCardObjectsDialog& operator=(const SmartCardObjectsDialog& orig); Ui::SmartCardObjectsDialog m_Widget; SmartCardObjectListModel* const m_pModel; }; #endif /* _SMARTCARDOBJECTSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/RouteSettingsDialog.h0000664000175000017500000000315212040201226022316 0ustar wejaegerwejaeger/* * $Id: RouteSettingsDialog.h 64 2011-04-05 03:39:39Z werner $ * * File: RouteSettingsDialog.h * Author: Werner Jaeger * * Created on August 5, 2010, 4:17 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _ROUTESETTINGSDIALOG_H #define _ROUTESETTINGSDIALOG_H #include "ui_RouteSettingsDialog.h" class PppRoutesModel; class RouteSettingsDialog : public QDialog { Q_OBJECT public: explicit RouteSettingsDialog(const QString& strConnectionName, QWidget* pParent = 0); virtual ~RouteSettingsDialog(); private slots: void addRoute() const; void removeRoute() const; void onHelpRequested() const; void accept(); private: RouteSettingsDialog(const RouteSettingsDialog& orig); RouteSettingsDialog& operator=(const RouteSettingsDialog& orig); void readSettings() const; bool writeSettings() const; Ui::RouteSettingsDialog m_Widget; const QString m_strConnectionName; PppRoutesModel* m_pRoutesModel; }; #endif /* _ROUTESETTINGSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/IpSettingsDialog.h0000664000175000017500000000275312040201226021576 0ustar wejaegerwejaeger/* * $Id: IpSettingsDialog.h 64 2011-04-05 03:39:39Z werner $ * * File: IpSettingsDialog.h * Author: Werner Jaeger * * Created on August 20, 2010, 9:59 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _IPSETTINGSDIALOG_H #define _IPSETTINGSDIALOG_H #include "ui_IpSettingsDialog.h" class IpSettingsDialog : public QDialog { Q_OBJECT public: IpSettingsDialog(const QString& strConnectionName, QWidget* pParent = 0); virtual ~IpSettingsDialog(); private slots: void onRouteSettings() const; void onHelpRequested() const; void accept(); private: IpSettingsDialog(const IpSettingsDialog& orig); IpSettingsDialog& operator=(const IpSettingsDialog& orig); void readSettings() const; bool writeSettings() const; Ui::IpSettingsDialog m_Widget; const QString m_strConnectionName; }; #endif /* _IPSECSETTINGSDIALOG_H */ l2tp-ipsec-vpn/src/dialogs/AdvancedSettingsDialog.cpp0000664000175000017500000000512412040201226023261 0ustar wejaegerwejaeger/* * $Id: AdvancedSettingsDialog.cpp 64 2011-04-05 03:39:39Z werner $ * * File: AdvancedSettingsDialog.cpp * Author: wejaeger * * Created on September 18, 2010, 4:21 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "settings/ConnectionSettings.h" #include "util/GlobalFunctions.h" #include "AdvancedSettingsDialog.h" AdvancedSettingsDialog::AdvancedSettingsDialog(const QString& strConnectionName, QWidget* pParent) : QDialog(pParent), m_strConnectionName(strConnectionName) { m_Widget.setupUi(this); setWindowTitle(strConnectionName + tr(" - Advanced Settings")); connect(m_Widget.m_pButtonBox, SIGNAL(helpRequested()), SLOT(onHelpRequested())); readSettings(); } AdvancedSettingsDialog::~AdvancedSettingsDialog() { } void AdvancedSettingsDialog::onHelpRequested() const { ::showHelp("Configure_advanced_settings"); } void AdvancedSettingsDialog::accept() { writeSettings(); QDialog::accept(); } void AdvancedSettingsDialog::readSettings() const { const PppSettings pppSettings(ConnectionSettings().pppSettings(m_strConnectionName)); m_Widget.m_pAllowBSDCompressionCheckBox->setChecked(!pppSettings.noBSDCompression()); m_Widget.m_pAllowDeflateCompressionCheckBox->setChecked(!pppSettings.noDeflate()); m_Widget.m_pUseTCPHeaderCompressionCheckBox->setChecked(!pppSettings.noVj()); m_Widget.m_pSendEchoCheckBox->setChecked(pppSettings.lcpEchoInterval() != 0); } bool AdvancedSettingsDialog::writeSettings() const { const PppSettings pppSettings(ConnectionSettings().pppSettings(m_strConnectionName)); bool fRet = pppSettings.setNoBSDCompression(!m_Widget.m_pAllowBSDCompressionCheckBox->isChecked()); if (fRet) fRet = pppSettings.setNoDeflate(!m_Widget.m_pAllowDeflateCompressionCheckBox->isChecked()); if (fRet) fRet = pppSettings.setNoVj(!m_Widget.m_pUseTCPHeaderCompressionCheckBox->isChecked()); if (fRet) fRet = pppSettings.setLcpEchoInterval(m_Widget.m_pSendEchoCheckBox->isChecked() ? -1 : 0); return(fRet); } l2tp-ipsec-vpn/src/dialogs/EapSettingsDialog.ui0000664000175000017500000002021112040201226022106 0ustar wejaegerwejaeger EapSettingsDialog 0 0 502 318 EAP settings :/images/configure:/images/configure true 0 0 When connecting Use my smart card Use a certificate on this computer 0 0 QFrame::Box QFrame::Sunken User certificate: m_pCertificateEdit Full path to a X.509 encoded personal certificate file true :/images/search:/images/search Private key: m_pPrivateKeyEdit Full path to a X.509 pem encoded private key file true :/images/search:/images/search false Passphrase: m_pPrivateKeyPwdEdit Enter the PIN or passphrase for your private key. If left empty you'll be ask each time you try to establish a connection. QLineEdit::Password false 0 0 QFrame::Box QFrame::Sunken CA Certificate: m_pCaCertificateEdit Full path to a X.509 pem encoded Certificate Authority certificate file true :/images/search:/images/search false Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok m_pUseSmartCardRadioButton m_pUseCertificateRadioButton m_pCertificateEdit m_pBrowseCertificateButton m_pPrivateKeyEdit m_pBrowsePrivateKeyButton m_pPrivateKeyPwdEdit m_pCaCertificateEdit m_pBrowseCaCertificateButton m_pButtonBox m_pButtonBox accepted() EapSettingsDialog accept() 243 291 234 220 m_pButtonBox rejected() EapSettingsDialog reject() 243 291 234 220 l2tp-ipsec-vpn/src/conf/0000775000175000017500000000000012040201226015510 5ustar wejaegerwejaegerl2tp-ipsec-vpn/src/conf/GetIPsecInfoScriptWriter.h0000664000175000017500000000257112040201226022527 0ustar wejaegerwejaeger/* * $Id: GetIPsecInfoScriptWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: GetIPsecInfoScriptWriter.h * Author: Werner Jaeger * * Created on August 6, 2010, 11:58 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef GETIPSECINFOSCRIPTWRITER_H #define GETIPSECINFOSCRIPTWRITER_H #include "AbstractConfWriter.h" class GetIPsecInfoScriptWriter : public AbstractConfWriter { public: GetIPsecInfoScriptWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~GetIPsecInfoScriptWriter() {} protected: void fill() {} private: GetIPsecInfoScriptWriter(const GetIPsecInfoScriptWriter& orig); GetIPsecInfoScriptWriter& operator=(const GetIPsecInfoScriptWriter& orig); }; #endif /* GETIPSECINFOSCRIPTWRITER_H */ l2tp-ipsec-vpn/src/conf/OpensslConfWriter.h0000664000175000017500000000244212040201226021311 0ustar wejaegerwejaeger/* * $Id: OpensslConfWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: OpensslConfWriter.h * Author: Werner Jaeger * * Created on August 7, 2010, 4:52 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef OPENSSLCONFWRITER_H #define OPENSSLCONFWRITER_H #include "AbstractConfWriter.h" class OpensslConfWriter : public AbstractConfWriter { public: OpensslConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~OpensslConfWriter() {} protected: void fill(); private: OpensslConfWriter(const OpensslConfWriter& orig); OpensslConfWriter& operator=(const OpensslConfWriter& orig); }; #endif /* OPENSSLCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/PPPConfWriter.cpp0000664000175000017500000001112712040201226020660 0ustar wejaegerwejaeger/* * $Id: PPPConfWriter.cpp 43 2011-02-05 20:18:05Z werner $ * * File: PPPConfWriter.cpp * Author: Werner Jaeger * * Created on July 27, 2010, 8:50 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "settings/ConnectionSettings.h" #include "PPPConfWriter.h" static const char* const REFUSE_SECTION = "REFUSE_SECTION"; static const char* const CERT_SECTION = "CERT_SECTION"; static const char* const REFUSEEAPLINE = "refuse-eap"; static const char* const REFUSEPAPLINE = "refuse-pap"; static const char* const REFUSECHAPLINE = "refuse-chap"; static const char* const REFUSEMSCHAPLINE = "refuse-mschap"; static const char* const REFUSEMSCHAPV2LINE = "refuse-mschap-v2"; static const char* const USEPEERDNSLINE = "usepeerdns"; static const char* const NOBSDCOMPLINE = "nobsdcomp"; static const char* const NODEFLATELINE = "nodeflate"; static const char* const NOVJLINE = "novj"; static const char* const LCPECHOINTERVALLINE = "lcp-echo-interval "; static const QString CERTLINE = "cert "; static const QString CALINE = "ca "; static const QString KEYLINE = "key "; static const char* const IPPARAM = "IPPARAM"; static const char* const REMOTENAME = "REMOTENAME"; static const char* const NAME = "NAME"; static const char* const USEPEERDNS = "USEPEERDNS"; static const char* const NOBSDCOMP = "NOBSDCOMP"; static const char* const NODEFLATE = "NODEFLATE"; static const char* const NOVJ = "NOVJ"; static const char* const LCPECHOINTERVAL = "LCPECHOINTERVAL"; static const char* const REFUSEPROTOCOL = "REFUSEPROTOCOL"; static const char* const CERTENTRY = "CERTENTRY"; PPPConfWriter::PPPConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } PPPConfWriter::~PPPConfWriter() { } void PPPConfWriter::fill() { dictionary()->SetValue(IPPARAM, (QCoreApplication::instance()->objectName() + "-" + instance()).toAscii().constData()); const PppSettings pppSettings = ConnectionSettings().pppSettings(instance()); dictionary()->SetValue(REMOTENAME, pppSettings.remoteName().toAscii().constData()); dictionary()->SetValue(NAME, pppSettings.userName().toAscii().constData()); if (pppSettings.ipSettings().usePeerDns()) dictionary()->SetValue(USEPEERDNS, USEPEERDNSLINE); if (pppSettings.noBSDCompression()) dictionary()->SetValue(NOBSDCOMP, NOBSDCOMPLINE); if (pppSettings.noDeflate()) dictionary()->SetValue(NODEFLATE, NODEFLATELINE); if (pppSettings.noVj()) dictionary()->SetValue(NOVJ, NOVJLINE); if (pppSettings.lcpEchoInterval() != -1) dictionary()->SetValue(LCPECHOINTERVAL, QString(LCPECHOINTERVALLINE + QString::number(pppSettings.lcpEchoInterval())).toAscii().constData()); const bool fRefuseEap = pppSettings.refuseEap(); if (fRefuseEap) addRefuseEntry(REFUSEEAPLINE); if (!fRefuseEap || pppSettings.refusePap()) addRefuseEntry(REFUSEPAPLINE); if (!fRefuseEap || pppSettings.refuseChap()) addRefuseEntry(REFUSECHAPLINE); if (!fRefuseEap || pppSettings.refuseMsChap()) addRefuseEntry(REFUSEMSCHAPLINE); if (!fRefuseEap || pppSettings.refuseMsChapV2()) addRefuseEntry(REFUSEMSCHAPV2LINE); const PppEapSettings eapSettings = pppSettings.eapSettings(); if (!eapSettings.certificatePath().isEmpty()) addCertEntry((CERTLINE + "\"" + eapSettings.certificatePath() + "\"").toAscii().constData()); if (!eapSettings.caCertificatePath().isEmpty()) addCertEntry((CALINE + "\"" + eapSettings.caCertificatePath() + "\"").toAscii().constData()); if (!eapSettings.privateKeyPath().isEmpty()) addCertEntry((KEYLINE + "\"" + eapSettings.privateKeyPath() + "\"").toAscii().constData()); } void PPPConfWriter::addRefuseEntry(const QString& strRefuse) const { dictionary()->AddSectionDictionary(REFUSE_SECTION)->SetValue(REFUSEPROTOCOL, strRefuse.toAscii().constData()); } void PPPConfWriter::addCertEntry(const QString& strCertEntry) const { dictionary()->AddSectionDictionary(CERT_SECTION)->SetValue(CERTENTRY, strCertEntry.toAscii().constData()); } l2tp-ipsec-vpn/src/conf/IPsecConfWriter.h0000664000175000017500000000240712040201226020672 0ustar wejaegerwejaeger/* * $Id: IPsecConfWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: IPsecConfWriter.h * Author: Werner Jaeger * * Created on July 23, 2010, 6:52 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef IPSECCONFWRITER_H #define IPSECCONFWRITER_H #include "AbstractConfWriter.h" class IPsecConfWriter : public AbstractConfWriter { public: IPsecConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~IPsecConfWriter(); protected: void fill(); private: IPsecConfWriter(const IPsecConfWriter& orig); IPsecConfWriter& operator=(const IPsecConfWriter& orig); }; #endif /* IPSECCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/AbstractConfWriter.cpp0000664000175000017500000001366512040201226021775 0ustar wejaegerwejaeger/* * $Id: AbstractConfWriter.cpp 110 2011-10-22 12:02:21Z werner $ * * File: AbstractConfWriter.cpp * Author: Werner Jaeger * * Created on July 23, 2010, 8:43 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include "AbstractConfWriter.h" #include "VPNControlTask.h" #include "pkcs11/SmartCardState.h" static const char* const FILENAME = "FILENAME"; static const char* const CREATIONDATE = "CREATIONDATE"; static const char* const APPNAME = "APPNAME"; static const char* const APPVERSION = "APPVERSION"; static const char* const APPPFILEPATH = "APPPFILEPATH"; AbstractConfWriter::AbstractConfWriter(const QString& strTemplateKey, const QString& strWriteTo, FileType type) : m_strTemplateKey(strTemplateKey), m_strWriteTo(strWriteTo), m_Type(type), m_strInstance(QString("")), m_strFileName(strWriteTo), m_pDictionary(NULL), m_fTemplatesInitialized(false) { } AbstractConfWriter::~AbstractConfWriter() { if (m_pDictionary) delete m_pDictionary; } const QString& AbstractConfWriter::write() { readTemplate(m_strTemplateKey); if (m_strLastErrorMsg.isEmpty()) { newDictionary(); fill(); save(); } return(m_strLastErrorMsg); } const QString& AbstractConfWriter::instance() const { return(m_strInstance); } void AbstractConfWriter::setInstance(const QString& strInstance) { m_strInstance = strInstance.isNull() ? "" : strInstance; const QFileInfo fileInfo(m_strWriteTo); m_strFileName = m_strInstance.trimmed().isEmpty() ? m_strWriteTo : fileInfo.path() + "/" + m_strInstance + (fileInfo.fileName().isEmpty() ? "" : "." + fileInfo.fileName()); } const QString& AbstractConfWriter::fileName() const { return(m_strFileName); } void AbstractConfWriter::addErrorMsg(const QString& strErrorMsg) { m_strLastErrorMsg.append(strErrorMsg + '\n'); } void AbstractConfWriter::save() { dictionary()->SetValue(FILENAME, fileName().toAscii().constData()); dictionary()->SetValue(CREATIONDATE, QDateTime::currentDateTime().toString().toAscii().constData()); dictionary()->SetValue(APPNAME, QCoreApplication::instance()->applicationName().toAscii().constData()); dictionary()->SetValue(APPVERSION, QCoreApplication::instance()->applicationVersion().toAscii().constData()); dictionary()->SetValue(APPPFILEPATH, QCoreApplication::instance()->applicationFilePath().toAscii().constData()); std::string strOut; ctemplate::Template* const pTpl = ctemplate::Template::GetTemplate(templateKey().toAscii().constData(), ctemplate::DO_NOT_STRIP); if (pTpl) { if (pTpl->Expand(&strOut, dictionary())) { // ctemplate::ExpandTemplate(key().toAscii().constData(), ctemplate::DO_NOT_STRIP, dictionary(), &strOut); QFile outFile(fileName()); QDir outFileDir(QFileInfo(outFile).absoluteDir()); bool fOk(true); if (!outFileDir.exists()) { const QString strDirName(outFileDir.dirName()); outFileDir.cdUp(); fOk = outFileDir.mkpath(strDirName); } if (fOk) { // if (outFile.exists()) // fOk = outFile.copy(fileName() + "." + QDateTime::currentDateTime().toString("yyyyMMddhhmmss").toAscii().constData() + ".~"); if (fOk) { if (outFile.open(QIODevice::WriteOnly | QIODevice::Text)) { switch (m_Type) { case EXECUTABLE: outFile.setPermissions(outFile.permissions() | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther); break; case SECRET: outFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner); break; default: ; } QTextStream out(&outFile); out << strOut.data(); outFile.close(); } else addErrorMsg(QObject::tr("Failed to open configuration file '%1'.").arg(outFile.fileName())); } else addErrorMsg(QObject::tr("Failed to backup file '%1'.").arg(outFile.fileName())); } else addErrorMsg(QObject::tr("Failed to create directory '%1'.").arg(outFileDir.absolutePath())); } else addErrorMsg(QObject::tr("Failed to expand template '%1'.").arg(templateKey())); } else addErrorMsg(QObject::tr("Failed to get template '%1'.").arg(templateKey())); } void AbstractConfWriter::readTemplate(const QString& strKey) { if (!m_fTemplatesInitialized) { const QResource rsc(":/templates/" + strKey + ".tpl"); if (rsc.isValid()) { ctemplate::Template::StringToTemplateCache(m_strTemplateKey.toStdString(), QString(reinterpret_cast(rsc.data())).toStdString()); m_fTemplatesInitialized = true; } else addErrorMsg(QObject::tr("Failed to open template file ':/templates/%1.tpl'.").arg(strKey)); } } void AbstractConfWriter::newDictionary() { if (m_pDictionary) delete m_pDictionary; m_pDictionary = new ctemplate::TemplateDictionary(m_strTemplateKey.toAscii().constData()); } l2tp-ipsec-vpn/src/conf/IPsecSecretsConfWriter.h0000664000175000017500000000253412040201226022224 0ustar wejaegerwejaeger/* * $Id: IPsecSecretsConfWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: IPsecSecretsConfWriter.h * Author: Werner Jaeger * * Created on August 8, 2010, 6:15 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef IPSECSECRETSCONFWRITER_H #define IPSECSECRETSCONFWRITER_H #include "AbstractConfWriter.h" class IPsecSecretsConfWriter : public AbstractConfWriter { public: IPsecSecretsConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~IPsecSecretsConfWriter(); protected: void fill(); private: IPsecSecretsConfWriter(const IPsecSecretsConfWriter& orig); IPsecSecretsConfWriter& operator=(const IPsecSecretsConfWriter& orig); }; #endif /* IPSECSECRETSCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/PPPConfWriter.h0000664000175000017500000000254112040201226020325 0ustar wejaegerwejaeger/* * $Id: PPPConfWriter.h 42 2011-02-05 07:08:01Z werner $ * * File: PPPConfWriter.h * Author: Werner Jaeger * * Created on July 27, 2010, 8:50 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PPPCONFWRITER_H #define PPPCONFWRITER_H #include "AbstractConfWriter.h" class PPPConfWriter : public AbstractConfWriter { public: PPPConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~PPPConfWriter(); protected: void fill(); private: PPPConfWriter(const PPPConfWriter& orig); PPPConfWriter& operator=(const PPPConfWriter& orig); void addRefuseEntry(const QString& strRefuse) const; void addCertEntry(const QString& strCertEntry) const; }; #endif /* PPPCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/L2tpConfWriter.cpp0000664000175000017500000000611312040201226021041 0ustar wejaegerwejaeger/* * $Id: L2tpConfWriter.cpp 13 2010-09-17 09:12:39Z werner $ * * File: L2tpConfWriter.cpp * Author: Werner Jaeger * * Created on July 25, 2010, 5:37 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "settings/ConnectionSettings.h" #include "ConfWriter.h" #include "L2tpConfWriter.h" static const char* const YES = "yes"; static const char* const NO = "no"; static const char* const REDIALTIMEOUTLINE = "redial timeout = %u"; static const char* const REDIALATTEMPTSLINE = "max redials = %u"; static const char* const LAC_SECTION = "LAC_SECTION"; static const char* const NAME = "NAME"; static const char* const GATEWAY = "GATEWAY"; static const char* const PPPOPTFILE = "PPPOPTFILE"; static const char* const LENGTHBIT = "LENGTHBIT"; static const char* const REDIAL = "REDIAL"; static const char* const REDIALTIMEOUT = "REDIALTIMEOUT"; static const char* const REDIALATTEMPTS = "REDIALATTEMPTS"; L2tpConfWriter::L2tpConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } L2tpConfWriter::~L2tpConfWriter() { } void L2tpConfWriter::fill() { const ConnectionSettings settings; const int iConnections = settings.connections(); for (int i = 0; i < iConnections; i++) { ctemplate::TemplateDictionary* const pLacSection = dictionary()->AddSectionDictionary(LAC_SECTION); const QString strName(settings.connection(i)); if (!strName.isEmpty()) { const IPSecSettings ipsecSetting(settings.ipsecSettings(strName)); const L2tpSettings l2tpSetting(settings.l2tpSettings(strName)); pLacSection->SetValue(NAME, strName.toAscii().constData()); pLacSection->SetValue(GATEWAY, ipsecSetting.gateway().toAscii().constData()); pLacSection->SetValue(PPPOPTFILE, ConfWriter::fileName(ConfWriter::PPP, strName).toAscii().constData()); pLacSection->SetValue(LENGTHBIT, l2tpSetting.lengthBit() ? YES : NO); if (l2tpSetting.redial()) { pLacSection->SetValue(REDIAL, YES); pLacSection->SetFormattedValue(REDIALTIMEOUT, REDIALTIMEOUTLINE, l2tpSetting.redialTimeout()); pLacSection->SetFormattedValue(REDIALATTEMPTS, REDIALATTEMPTSLINE, l2tpSetting.redialAttempts()); } else pLacSection->SetValue(REDIAL, NO); } else addErrorMsg(QObject::tr("No such connection: '%1'.").arg(strName)); } } l2tp-ipsec-vpn/src/conf/PppDnsConfWriter.cpp0000664000175000017500000000442512040201226021430 0ustar wejaegerwejaeger/* * $Id: PppDnsConfWriter.cpp 13 2010-09-17 09:12:39Z werner $ * * File: PppDnsConfWriter.cpp * Author: Werner Jaeger * * Created on August 21, 2010, 6:43 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "settings/ConnectionSettings.h" #include "PppDnsConfWriter.h" static const char* const DNS_SECTION = "DNS_SECTION"; static const char* const SEARCH_SECTION = "SEARCH_SECTION"; static const char* const IPADDRESS = "IPADDRESS"; static const char* const SEARCHLIST = "SEARCHLIST"; PppDnsConfWriter::PppDnsConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } void PppDnsConfWriter::fill() { QString strInstance(instance()); const QString strConnectionName(strInstance.replace(QCoreApplication::instance()->objectName() + "-", "")); const PppSettings pppSettings = ConnectionSettings().pppSettings(strConnectionName); const PppIpSettings ipSettings(pppSettings.ipSettings()); const bool fUsePeerDns = ipSettings.usePeerDns(); if (!fUsePeerDns && !ipSettings.preferredDnsServerAddress().isEmpty()) dictionary()->AddSectionDictionary(DNS_SECTION)->SetValue(IPADDRESS, ipSettings.preferredDnsServerAddress().toAscii().constData()); if (!fUsePeerDns && !ipSettings.alternateDnsServerAddress().isEmpty()) dictionary()->AddSectionDictionary(DNS_SECTION)->SetValue(IPADDRESS, ipSettings.alternateDnsServerAddress().toAscii().constData()); if (!fUsePeerDns && !ipSettings.searchDomains().isEmpty()) dictionary()->AddSectionDictionary(SEARCH_SECTION)->SetValue(SEARCHLIST, ipSettings.searchDomains().toAscii().constData()); } l2tp-ipsec-vpn/src/conf/PppDnsConfWriter.h0000664000175000017500000000242712040201226021075 0ustar wejaegerwejaeger/* * $Id: PppDnsConfWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: PppDnsConfWriter.h * Author: Werner Jaeger * * Created on August 21, 2010, 6:43 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PPPDNSCONFWRITER_H #define PPPDNSCONFWRITER_H #include "AbstractConfWriter.h" class PppDnsConfWriter : public AbstractConfWriter { public: PppDnsConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~PppDnsConfWriter() {} protected: void fill(); private: PppDnsConfWriter(const PppDnsConfWriter& orig); PppDnsConfWriter& operator=(const PppDnsConfWriter& orig); }; #endif /* PPPDNSCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/AbstractConfWriter.h0000664000175000017500000000407012040201226021430 0ustar wejaegerwejaeger/* * $Id: AbstractConfWriter.h 110 2011-10-22 12:02:21Z werner $ * * File: AbstractConfWriter.h * Author: Werner Jaeger * * Created on July 23, 2010, 8:43 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef ABSTRACTCONFWRITER_H #define ABSTRACTCONFWRITER_H #include #include class AbstractConfWriter { public: const QString& write(); const QString& instance() const; void setInstance(const QString& strInstance); const QString& fileName() const; protected: typedef enum { NORMAL, EXECUTABLE, SECRET } FileType; AbstractConfWriter(const QString& strTemplateKey, const QString& strWriteTo, FileType type = NORMAL); virtual ~AbstractConfWriter(); const QString& templateKey() const { return(m_strTemplateKey); } ctemplate::TemplateDictionary* dictionary() const { return(m_pDictionary); } void addErrorMsg(const QString& strErrorMsg); virtual void fill() = 0; private: AbstractConfWriter(const AbstractConfWriter& orig); AbstractConfWriter& operator=(const AbstractConfWriter& orig); void save(); void readTemplate(const QString& strKey); void newDictionary(); const QString m_strTemplateKey; const QString m_strWriteTo; const FileType m_Type; QString m_strInstance; QString m_strFileName; ctemplate::TemplateDictionary* m_pDictionary; QString m_strLastErrorMsg; bool m_fTemplatesInitialized; }; #endif /* ABSTRACTCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/PppUpScriptWriter.cpp0000664000175000017500000000675212040201226021654 0ustar wejaegerwejaeger/* * $Id: PppUpScriptWriter.cpp 26 2010-10-19 06:05:47Z werner $ * * File: PppUpScriptWriter.cpp * Author: Werner Jaeger * * Created on August 6, 2010, 1:18 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "conf/ConfWriter.h" #include "settings/ConnectionSettings.h" #include "PppUpScriptWriter.h" static const char* const CONN_SECTION = "CONN_SECTION"; static const char* const ROUTE_SECTION = "ROUTE_SECTION"; static const char* const DEFAULT_GATEWAY_SECTION = "DEFAULT_GATEWAY_SECTION"; static const char* const OBJECTNAME = "OBJECTNAME"; static const char* const GETIPSECINFOLIB = "GETIPSECINFOLIB"; static const char* const GATEWAY = "GATEWAY"; static const char* const IPPARAM = "IPPARAM"; static const char* const IPADDRESS = "IPADDRESS"; static const char* const IPNETMASK = "IPNETMASK"; PppUpScriptWriter::PppUpScriptWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo, AbstractConfWriter::EXECUTABLE) { } void PppUpScriptWriter::fill() { dictionary()->SetValue(OBJECTNAME, QCoreApplication::instance()->objectName().toAscii().constData()); dictionary()->SetValue(GETIPSECINFOLIB, ConfWriter::fileName(ConfWriter::GETIPSECINFO).toAscii().constData()); const ConnectionSettings settings; const int iConnections = settings.connections(); for (int i = 0; i < iConnections; i++) { ctemplate::TemplateDictionary* const pConnection = dictionary()->AddSectionDictionary(CONN_SECTION); const QString strName(settings.connection(i)); if (!strName.isEmpty()) { pConnection->SetValue(IPPARAM, (QCoreApplication::instance()->objectName() + "-" + strName).toAscii().constData()); pConnection->SetValue(GATEWAY, settings.ipsecSettings(strName).gateway().toAscii().constData()); const PppIpSettings ipSetting(settings.pppSettings(strName).ipSettings()); if (!ipSetting.useDefaultGateway()) { ctemplate::TemplateDictionary* const pDefaultRoute = pConnection->AddSectionDictionary(ROUTE_SECTION); pDefaultRoute->SetValue(IPADDRESS, "`echo \"${PPP_LOCAL}\" | cut -d'.' -f1`.0.0.0"); pDefaultRoute->SetValue(IPNETMASK, "255.0.0.0"); const int iRoutes = ipSetting.routes(); for (int j = 0; j < iRoutes; j++) { ctemplate::TemplateDictionary* const pRoute = pConnection->AddSectionDictionary(ROUTE_SECTION); pRoute->SetValue(IPADDRESS, ipSetting.routeAddress(j).toAscii().constData()); pRoute->SetValue(IPNETMASK, ipSetting.routeNetmask(j).toAscii().constData()); } } else pConnection->AddSectionDictionary(DEFAULT_GATEWAY_SECTION); } else addErrorMsg(QObject::tr("No such connection: '%1'.").arg(strName)); } } l2tp-ipsec-vpn/src/conf/OpensslConfWriter.cpp0000664000175000017500000000311112040201226021636 0ustar wejaegerwejaeger/* * $Id: OpensslConfWriter.cpp 92 2011-06-17 05:54:54Z werner $ * * File: OpensslConfWriter.cpp * Author: Werner Jaeger * * Created on August 7, 2010, 4:52 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "settings/Preferences.h" #include "OpensslConfWriter.h" static const char* const ENGINEID = "ENGINEID"; static const char* const DYNAMICPATH = "DYNAMICPATH"; static const char* const MODULEPATH = "MODULEPATH"; OpensslConfWriter::OpensslConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } void OpensslConfWriter::fill() { const OpenSSLSettings opensslSettings(Preferences().openSSLSettings()); dictionary()->SetValue(ENGINEID, opensslSettings.engineId().toAscii().constData()); dictionary()->SetValue(DYNAMICPATH, opensslSettings.enginePath().toAscii().constData()); dictionary()->SetValue(MODULEPATH, opensslSettings.pkcs11Path().toAscii().constData()); } l2tp-ipsec-vpn/src/conf/RSysLogConfWriter.cpp0000664000175000017500000000201512040201226021557 0ustar wejaegerwejaeger/* * $Id: RSysLogConfWriter.cpp 13 2010-09-17 09:12:39Z werner $ * * File: RSysLogConfWriter.cpp * Author: Werner Jaeger * * Created on July 24, 2010, 9:41 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "RSysLogConfWriter.h" RSysLogConfWriter::RSysLogConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } l2tp-ipsec-vpn/src/conf/L2tpConfWriter.h0000664000175000017500000000237312040201226020512 0ustar wejaegerwejaeger/* * $Id: L2tpConfWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: L2tpConfWriter.h * Author: Werner Jaeger * * Created on July 25, 2010, 5:37 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef L2TPCONFWRITER_H #define L2TPCONFWRITER_H #include "AbstractConfWriter.h" class L2tpConfWriter : public AbstractConfWriter { public: L2tpConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~L2tpConfWriter(); protected: void fill(); private: L2tpConfWriter(const L2tpConfWriter& orig); L2tpConfWriter& operator=(const L2tpConfWriter& orig); }; #endif /* L2TPCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/RSysLogConfWriter.h0000664000175000017500000000244312040201226021231 0ustar wejaegerwejaeger/* * $Id: RSysLogConfWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: RSysLogConfWriter.h * Author: Werner Jaeger * * Created on July 24, 2010, 9:41 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef RSYSLOGCONFWRITER_H #define RSYSLOGCONFWRITER_H #include "AbstractConfWriter.h" class RSysLogConfWriter : public AbstractConfWriter { public: RSysLogConfWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~RSysLogConfWriter() {} protected: void fill() {} private: RSysLogConfWriter(const RSysLogConfWriter& orig); RSysLogConfWriter& operator=(const RSysLogConfWriter& orig); }; #endif /* RSYSLOGCONFWRITER_H */ l2tp-ipsec-vpn/src/conf/IPsecSecretsConfWriter.cpp0000664000175000017500000000734212040201226022561 0ustar wejaegerwejaeger/* * $Id: IPsecSecretsConfWriter.cpp 114 2012-01-22 05:07:35Z werner $ * * File: IPsecSecretsConfWriter.cpp * Author: Werner Jaeger * * Created on August 8, 2010, 6:15 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "settings/ConnectionSettings.h" #include "IPsecSecretsConfWriter.h" static const char* const AUTHBYRSASIG = "rsasig"; static const char* const AUTHBYPSK = "secret"; static const char* const CONN_SECTION = "CONN_SECTION"; static const char* const INDICES = "INDICES"; static const char* const KEYTYPE = "KEYTYPE"; static const char* const KEY = "KEY"; static const char* const PASSPHRASE = "PASSPHRASE"; static const char* const PSKKEYTYPE = "PSK"; static const char* const RSAKEYTYPE = "RSA"; static const QString ANY("%any"); IPsecSecretsConfWriter::IPsecSecretsConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo, AbstractConfWriter::SECRET) { } IPsecSecretsConfWriter::~IPsecSecretsConfWriter() { } void IPsecSecretsConfWriter::fill() { const ConnectionSettings settings; const int iConnections = settings.connections(); for (int i = 0; i < iConnections; i++) { const QString strName(settings.connection(i)); if (!strName.isEmpty()) { if (!settings.commonSettings(strName).disableIPSecEncryption()) { ctemplate::TemplateDictionary* const pConnection = dictionary()->AddSectionDictionary(CONN_SECTION); const IPSecSettings ipsecSetting(settings.ipsecSettings(strName)); const QString strGateway(ipsecSetting.gateway()); if (!strGateway.isEmpty()) { if (strGateway.at(0).isNumber()) { if (ipsecSetting.authBy() == AUTHBYRSASIG) pConnection->SetValue(INDICES, strGateway.toAscii().constData()); else pConnection->SetValue(INDICES, QString(ANY + " " + strGateway).toAscii().constData()); } else { if (ipsecSetting.authBy() == AUTHBYRSASIG) pConnection->SetValue(INDICES, QString("@" + strGateway).toAscii().constData()); else pConnection->SetValue(INDICES, QString(ANY + " @" + strGateway).toAscii().constData()); } } if (ipsecSetting.authBy() == AUTHBYRSASIG) { pConnection->SetValue(KEYTYPE, RSAKEYTYPE); pConnection->SetValue(KEY, QString('"' + ipsecSetting.privateKeyFilePath() + '"').toAscii().constData()); pConnection->SetValue(PASSPHRASE, QString('"' + ipsecSetting.privateKeyPassphrase() + '"').toAscii().constData()); } else { pConnection->SetValue(KEYTYPE, PSKKEYTYPE); pConnection->SetValue(KEY, QString("0t" + ipsecSetting.preSharedKey()).toAscii().constData()); } } } else addErrorMsg(QObject::tr("No such connection: '%1'.").arg(strName)); } } l2tp-ipsec-vpn/src/conf/IPsecConfWriter.cpp0000664000175000017500000000526612040201226021233 0ustar wejaegerwejaeger/* * $Id: IPsecConfWriter.cpp 114 2012-01-22 05:07:35Z werner $ * * File: IPsecConfWriter.cpp * Author: Werner Jaeger * * Created on July 23, 2010, 6:52 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include "settings/ConnectionSettings.h" #include "IPsecConfWriter.h" static const char* const RSASIG = "rsasig"; static const char* const LEFTCERTLINE = "leftcert=\"%s\""; static const char* const CONN_SECTION = "CONN_SECTION"; static const char* const NAME = "NAME"; static const char* const GATEWAY = "GATEWAY"; static const char* const IDENTITY = "IDENTITY"; static const char* const AUTHBY = "AUTHBY"; static const char* const LEFTCERT = "LEFTCERT"; IPsecConfWriter::IPsecConfWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } IPsecConfWriter::~IPsecConfWriter() { } void IPsecConfWriter::fill() { const ConnectionSettings settings; const int iConnections = settings.connections(); for (int i = 0; i < iConnections; i++) { const QString strName(settings.connection(i)); if (!strName.isEmpty()) { if (!settings.commonSettings(strName).disableIPSecEncryption()) { ctemplate::TemplateDictionary* const pConnection = dictionary()->AddSectionDictionary(CONN_SECTION); const IPSecSettings ipsecSetting(settings.ipsecSettings(strName)); pConnection->SetValue(NAME, strName.toAscii().constData()); pConnection->SetValue(GATEWAY, ipsecSetting.gateway().toAscii().constData()); pConnection->SetValue(IDENTITY, ipsecSetting.identity().toAscii().constData()); pConnection->SetValue(AUTHBY, ipsecSetting.authBy().toAscii().constData()); if (ipsecSetting.authBy() == RSASIG) pConnection->SetFormattedValue(LEFTCERT, LEFTCERTLINE, ipsecSetting.certificateFileName().toAscii().constData()); } } else addErrorMsg(QObject::tr("No such connection: '%1'.").arg(strName)); } } l2tp-ipsec-vpn/src/conf/PppUpScriptWriter.h0000664000175000017500000000244212040201226021311 0ustar wejaegerwejaeger/* * $Id: PppUpScriptWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: PppUpScriptWriter.h * Author: Werner Jaeger * * Created on August 6, 2010, 1:18 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PPPUPSCRIPTWRITER_H #define PPPUPSCRIPTWRITER_H #include "AbstractConfWriter.h" class PppUpScriptWriter : public AbstractConfWriter { public: PppUpScriptWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~PppUpScriptWriter() {} protected: void fill(); private: PppUpScriptWriter(const PppUpScriptWriter& orig); PppUpScriptWriter& operator=(const PppUpScriptWriter& orig); }; #endif /* PPPUPSCRIPTWRITER_H */ l2tp-ipsec-vpn/src/conf/GetIPsecInfoScriptWriter.cpp0000664000175000017500000000206312040201226023056 0ustar wejaegerwejaeger/* * $Id: GetIPsecInfoScriptWriter.cpp 13 2010-09-17 09:12:39Z werner $ * * File: GetIPsecInfoScriptWriter.cpp * Author: Werner Jaeger * * Created on August 6, 2010, 11:58 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "GetIPsecInfoScriptWriter.h" GetIPsecInfoScriptWriter::GetIPsecInfoScriptWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo) { } l2tp-ipsec-vpn/src/conf/PppDownScriptWriter.h0000664000175000017500000000247212040201226021637 0ustar wejaegerwejaeger/* * $Id: PppDownScriptWriter.h 13 2010-09-17 09:12:39Z werner $ * * File: PppDownScriptWriter.h * Author: Werner Jaeger * * Created on August 6, 2010, 1:28 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PPPDOWNSCRIPTWRITER_H #define PPPDOWNSCRIPTWRITER_H #include "AbstractConfWriter.h" class PppDownScriptWriter : public AbstractConfWriter { public: PppDownScriptWriter(const QString& strTemplateKey, const QString& strWriteTo); virtual ~PppDownScriptWriter() {} protected: void fill(); private: PppDownScriptWriter(const PppDownScriptWriter& orig); PppDownScriptWriter& operator=(const PppDownScriptWriter& orig); }; #endif /* PPPDOWNSCRIPTWRITER_H */ l2tp-ipsec-vpn/src/conf/ConfWriter.h0000664000175000017500000000252112040201226017743 0ustar wejaegerwejaeger/* * $Id: ConfWriter.h 120 2012-03-08 04:57:41Z werner $ * * File: ConfWriter.h * Author: Werner Jaeger * * Created on July 23, 2010, 9:14 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CONFWRITER_H #define CONFWRITER_H class ConfWriter { public: typedef enum { IPsec, L2TP, PPP, RSYSLOG, GETIPSECINFO, PPPUPSCRIPT, PPPDNSCONF, PPPDOWNSCRIPT, OPENSSL, IPsecSECRET, END} Conf; static bool write(Conf conf, const QString& strInstance = ""); static const QString& fileName(Conf conf, const QString& strInstance = ""); private: ConfWriter(); virtual ~ConfWriter(); ConfWriter(const ConfWriter& orig); ConfWriter& operator=(const ConfWriter& orig); }; #endif /* CONFWRITER_H */ l2tp-ipsec-vpn/src/conf/ConfWriter.cpp0000664000175000017500000000676712040201226020316 0ustar wejaegerwejaeger/* * $Id: ConfWriter.cpp 13 2010-09-17 09:12:39Z werner $ * * File: ConfWriter.cpp * Author: Werner Jaeger * * Created on July 23, 2010, 9:14 AM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "IPsecConfWriter.h" #include "IPsecSecretsConfWriter.h" #include "L2tpConfWriter.h" #include "PPPConfWriter.h" #include "RSysLogConfWriter.h" #include "GetIPsecInfoScriptWriter.h" #include "PppUpScriptWriter.h" #include "PppDownScriptWriter.h" #include "OpensslConfWriter.h" #include "ConfWriter.h" #include "IPsecSecretsConfWriter.h" #include "PppDnsConfWriter.h" struct { const char* pKey; QString strPath; } static WRITERARG[] = { {"ipsec.conf", "/etc/ipsec.conf"}, {"xl2tpd.conf", "/etc/xl2tpd/xl2tpd.conf"}, {"options.xl2tpd", "/etc/ppp/options.xl2tpd"}, {"30-l2tp-ipsec-vpn.conf", "/etc/rsyslog.d/30-l2tp-ipsec-vpn.conf"}, {"getIPSecInfo.lib", "/etc/ppp/getIPSecInfo.lib"}, {"L2tpIPsecVpn-up", "/etc/ppp/ip-up.d/L2tpIPsecVpn-up"}, {"L2tpIPsecVpn-dns", "/etc/ppp/resolv/"}, {"L2tpIPsecVpn-down", "/etc/ppp/ip-down.d/L2tpIPsecVpn-down"}, {"openssl.cnf", "/etc/ppp/openssl.cnf"}, {"ipsec.secrets", "/etc/ipsec.secrets"} }; static AbstractConfWriter* WRITER[] = { new IPsecConfWriter(WRITERARG[ConfWriter::IPsec].pKey, WRITERARG[ConfWriter::IPsec].strPath), new L2tpConfWriter(WRITERARG[ConfWriter::L2TP].pKey, WRITERARG[ConfWriter::L2TP].strPath), new PPPConfWriter(WRITERARG[ConfWriter::PPP].pKey, WRITERARG[ConfWriter::PPP].strPath), new RSysLogConfWriter(WRITERARG[ConfWriter::RSYSLOG].pKey, WRITERARG[ConfWriter::RSYSLOG].strPath), new GetIPsecInfoScriptWriter(WRITERARG[ConfWriter::GETIPSECINFO].pKey, WRITERARG[ConfWriter::GETIPSECINFO].strPath), new PppUpScriptWriter(WRITERARG[ConfWriter::PPPUPSCRIPT].pKey, WRITERARG[ConfWriter::PPPUPSCRIPT].strPath), new PppDnsConfWriter(WRITERARG[ConfWriter::PPPDNSCONF].pKey, WRITERARG[ConfWriter::PPPDNSCONF].strPath), new PppDownScriptWriter(WRITERARG[ConfWriter::PPPDOWNSCRIPT].pKey, WRITERARG[ConfWriter::PPPDOWNSCRIPT].strPath), new OpensslConfWriter(WRITERARG[ConfWriter::OPENSSL].pKey, WRITERARG[ConfWriter::OPENSSL].strPath), new IPsecSecretsConfWriter(WRITERARG[ConfWriter::IPsecSECRET].pKey, WRITERARG[ConfWriter::IPsecSECRET].strPath) }; bool ConfWriter::write(Conf conf, const QString& strInstance) { bool fRet = false; AbstractConfWriter* const writer = WRITER[conf]; writer->setInstance(strInstance); const QString strError(writer->write()); if (strError.isEmpty()) fRet = true; else QMessageBox::critical(NULL, QObject::tr("An error occurred while writing ") + WRITERARG[conf].strPath, strError); return(fRet); } const QString& ConfWriter::fileName(Conf conf, const QString& strInstance) { AbstractConfWriter* const writer = WRITER[conf]; writer->setInstance(strInstance); return(writer->fileName()); } l2tp-ipsec-vpn/src/conf/PppDownScriptWriter.cpp0000664000175000017500000000517012040201226022170 0ustar wejaegerwejaeger/* * $Id: PppDownScriptWriter.cpp 30 2010-11-27 23:22:37Z werner $ * * File: PppDownScriptWriter.cpp * Author: Werner Jaeger * * Created on August 6, 2010, 1:28 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "settings/ConnectionSettings.h" #include "ConfWriter.h" #include "PppDownScriptWriter.h" static const char* const CONN_SECTION = "CONN_SECTION"; static const char* const DEFAULT_GATEWAY_SECTION = "DEFAULT_GATEWAY_SECTION"; static const char* const OBJECTNAME = "OBJECTNAME"; static const char* const GETIPSECINFOLIB = "GETIPSECINFOLIB"; static const char* const GATEWAY = "GATEWAY"; static const char* const IPPARAM = "IPPARAM"; PppDownScriptWriter::PppDownScriptWriter(const QString& strTemplateKey, const QString& strWriteTo) : AbstractConfWriter(strTemplateKey, strWriteTo, AbstractConfWriter::EXECUTABLE) { } void PppDownScriptWriter::fill() { dictionary()->SetValue(OBJECTNAME, QCoreApplication::instance()->objectName().toAscii().constData()); dictionary()->SetValue(GETIPSECINFOLIB, ConfWriter::fileName(ConfWriter::GETIPSECINFO).toAscii().constData()); const ConnectionSettings settings; const int iConnections = settings.connections(); for (int i = 0; i < iConnections; i++) { const QString strName(settings.connection(i)); if (!strName.isEmpty()) { const PppIpSettings ipSetting(settings.pppSettings(strName).ipSettings()); ctemplate::TemplateDictionary* const pConnection = dictionary()->AddSectionDictionary(CONN_SECTION); pConnection->SetValue(IPPARAM, (QCoreApplication::instance()->objectName() + "-" + strName).toAscii().constData()); pConnection->SetValue(GATEWAY, settings.ipsecSettings(strName).gateway().toAscii().constData()); if (ipSetting.useDefaultGateway()) pConnection->AddSectionDictionary(DEFAULT_GATEWAY_SECTION); } else addErrorMsg(QObject::tr("No such connection: '%1'.").arg(strName)); } } l2tp-ipsec-vpn/src/ConnectionEditor.cpp0000664000175000017500000000470612040201227020545 0ustar wejaegerwejaeger/* * $Id: ConnectionEditor.cpp 87 2011-04-20 09:21:12Z werner $ * * File: ConnectionEditor.cpp * Author: Werner Jaeger * * Created on August 30, 2010, 12:59 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "dialogs/ConnectionEditorDialog.h" #include "models/ConnectionsModel.h" #include "settings/ConnectionSettings.h" #include "L2tpIPsecVpnApplication.h" #include "ConnectionEditor.h" ConnectionEditor::ConnectionEditor(L2tpIPsecVpnApplication& application, QObject* pParent) : QObject(pParent), m_Application(application), m_pConnectionEditorDialog(application.mode() == L2tpIPsecVpnApplication::APPLYSETTINGS ? NULL : new ConnectionEditorDialog) { if (m_pConnectionEditorDialog) { connect(m_pConnectionEditorDialog, SIGNAL(connectionAdded(const QString&)), this, SLOT(onConnectionAdded(const QString&))); connect(m_pConnectionEditorDialog, SIGNAL(connectionRemoved(const QString&)), this, SLOT(onConnectionRemoved(const QString&))); } } ConnectionEditor::~ConnectionEditor() { if (m_pConnectionEditorDialog) delete m_pConnectionEditorDialog; } int ConnectionEditor::exec() { int iRet(0); if (!m_pConnectionEditorDialog) { ConnectionsModel* pConnectionsModel(new ConnectionsModel()); ConnectionSettings* pConnectionSettings(new ConnectionSettings()); iRet = (ConnectionEditorDialog::applySettings(pConnectionsModel, pConnectionSettings) ? 0 : 1); delete pConnectionsModel; delete pConnectionSettings; } else iRet = (m_pConnectionEditorDialog->exec() == QDialog::Accepted ? 0 : 1); return(iRet); } void ConnectionEditor::onConnectionAdded(const QString& strName) { m_Application.sendConnectionAddedMessage(strName); } void ConnectionEditor::onConnectionRemoved(const QString& strName) { m_Application.sendConnectionRemovedMessage(strName); } l2tp-ipsec-vpn/src/L2tpIPsecVpnApplication.cpp0000664000175000017500000001507312040201227021713 0ustar wejaegerwejaeger/* * $Id: L2tpIPsecVpnApplication.cpp 153 2012-10-11 04:47:46Z wejaeger $ * * File: L2tpIPsecVpnApplication.cpp * Author: Werner Jaeger * * Created on August 9, 2010, 2:29 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include "localpeer/LocalPeer.h" #include "util/ErrorEx.h" #include "ConnectionManager.h" #include "L2tpIPsecVpnApplication.h" #include "ConnectionEditor.h" static const char* const DESKTOP_SESSION("DESKTOP_SESSION"); static const char* const CONNECTIONEDITOR_CMD_SWITCH("connectionEditor"); static const char* const START_CONNECTIONEDITOR_CMD_SWITCH("startConnectionEditor"); static const char* const APPLYSETTINGS_CMD_SWITCH("applySettings"); static const char* const DELETALLCONFFILES_CMD_SWITCH("deleteAllConfFiles"); static QString const DESKTOP_SESSION_CMD_SWITCH("desktopSession"); static QString const APPLICATIONNAME("L2TP IPsec VPN Manager"); static QString const CONNECTION_ADDED_MSG_PREFIX("connectionAdded:"); static QString const CONNECTION_REMOVED_MSG_PREFIX("connectionRemoved:"); L2tpIPsecVpnApplication::L2tpIPsecVpnApplication(int& iArgc, char** ppArgv, APPLICATIONMODE appMode) : QApplication(iArgc, ppArgv, appMode != PASSWORD_CALLBACK && appMode != APPLYSETTINGS && appMode != DELETEALLCONFFILES), m_Mode(appMode), m_pProcess(new QProcess), m_pLocalPeer(new LocalPeer()) { setOrganizationName("WernerJaeger"); setOrganizationDomain("wejaeger.com"); setApplicationName(APPLICATIONNAME); setApplicationVersion("1.0.9"); setObjectName("L2tpIPsecVpn"); qRegisterMetaType("NetworkInterface"); qRegisterMetaType("QAbstractSocket::SocketState"); connect(m_pLocalPeer, SIGNAL(messageReceived(const QString&)), SLOT(onMessageReceived(const QString&))); connect(m_pProcess, SIGNAL(finished(int)), this, SLOT(onConnectionEditorDialogClosed(int))); if (mode() == CONNECTION_MANAGER) setQuitOnLastWindowClosed(false); } L2tpIPsecVpnApplication::~L2tpIPsecVpnApplication() { delete m_pLocalPeer; delete m_pProcess; } bool L2tpIPsecVpnApplication::notify(QObject* pReceiver, QEvent* pEvent) { bool fRet(false); try { fRet = QApplication::notify(pReceiver, pEvent); } catch(const ErrorEx& e) { qCritical() << "Exception thrown:" << e.getString(); QMessageBox::critical(NULL, applicationName(), e.getString()); } return(fRet); } bool L2tpIPsecVpnApplication::isRunning() { return(m_pLocalPeer->isClient()); } L2tpIPsecVpnApplication::APPLICATIONMODE L2tpIPsecVpnApplication::mode() const { return(m_Mode); } bool L2tpIPsecVpnApplication::sendConnectionAddedMessage(const QString& strConnectionName) { return(m_pLocalPeer->sendMessage(CONNECTION_ADDED_MSG_PREFIX + strConnectionName, 5000)); } bool L2tpIPsecVpnApplication::sendConnectionRemovedMessage(const QString& strConnectionName) { return(m_pLocalPeer->sendMessage(CONNECTION_REMOVED_MSG_PREFIX + strConnectionName, 5000)); } int L2tpIPsecVpnApplication::startConnectionEditorDialog(bool fDetached) const { int iRet(0); const char* const pcDesktopSession(::getenv(DESKTOP_SESSION)); const QString strSu(L2tpIPsecVpnApplication::getGrahicalSUCmdLine()); if (!strSu.isEmpty()) { const QString strProgram(strSu + arguments()[0] + " " + CONNECTIONEDITOR_CMD_SWITCH + " " + (pcDesktopSession ? DESKTOP_SESSION_CMD_SWITCH + " " + pcDesktopSession : "")); if (fDetached) iRet = !QProcess::startDetached(strProgram); else m_pProcess->start(strProgram); } else { QMessageBox::critical(NULL, applicationName(), tr("I couldn't find any graphical SU command (gksudo, beesu kdesudo or kdesu).")); iRet = -1; } return(iRet); } void L2tpIPsecVpnApplication::onMessageReceived(const QString& strMessage) { if (strMessage.startsWith(CONNECTION_ADDED_MSG_PREFIX)) emit connectionAdded(strMessage.mid(strMessage.indexOf(':') + 1)); else if (strMessage.startsWith(CONNECTION_REMOVED_MSG_PREFIX)) emit connectionRemoved(strMessage.mid(strMessage.indexOf(':') + 1)); } void L2tpIPsecVpnApplication::onConnectionEditorDialogClosed(int iExitCode) { emit connectionEditorDialogClosed(iExitCode); } L2tpIPsecVpnApplication::APPLICATIONMODE L2tpIPsecVpnApplication::parseCmdLine(int& iArgc, char* pcArgv[]) { APPLICATIONMODE retMode(CONNECTION_MANAGER); int iQtArgs(0); bool fDone(false); for (int i(1); !fDone && i < iArgc; i++) { if (::strcmp(pcArgv[i], CONNECTIONEDITOR_CMD_SWITCH) == 0) { if (i + 2 < iArgc && DESKTOP_SESSION_CMD_SWITCH == pcArgv[i + 1]) ::setenv(DESKTOP_SESSION, pcArgv[i + 2], 0); retMode = CONNECTION_EDITOR; fDone = true; } else if (::strcmp(pcArgv[i], START_CONNECTIONEDITOR_CMD_SWITCH) == 0) { retMode = CONNECTION_EDITOR_STARTER; fDone = true; } else if (::strcmp(pcArgv[i], APPLYSETTINGS_CMD_SWITCH) == 0) { retMode = APPLYSETTINGS; fDone = true; } else if (::strcmp(pcArgv[i], DELETALLCONFFILES_CMD_SWITCH) == 0) { retMode = DELETEALLCONFFILES; fDone = true; } else if (pcArgv[i][0] == '-') iQtArgs++; } if ((iArgc - iQtArgs) == 4 && retMode == CONNECTION_MANAGER) retMode = PASSWORD_CALLBACK; return(retMode); } QString L2tpIPsecVpnApplication::getGrahicalSUCmdLine() { QString strRet(""); if (QFile::exists("/usr/bin/beesu")) { const char* const pcUser(::getenv("USER")); if (pcUser) strRet = "beesu -m export USER=" + QString(pcUser) + "; "; else strRet = "beesu -m "; } else if (QFile::exists("/usr/bin/gksudo")) strRet = "gksudo -D \"" + APPLICATIONNAME + "\" "; else if (QFile::exists("/usr/bin/kdesudo")) strRet = "kdesudo "; else if (QFile::exists("/usr/bin/kdesu")) strRet = "kdesu "; return(strRet); } l2tp-ipsec-vpn/src/ConnectionManager.cpp0000664000175000017500000005424012040201227020667 0ustar wejaegerwejaeger/* * $Id: ConnectionManager.cpp 144 2012-05-21 07:31:37Z wejaeger $ * * File: ConnectionManager.cpp * Author: Werner Jaeger * * Created on July 7, 2010, 5:44 PM * * Copyright 2010 Werner Jaeger. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include //#include #include "pkcs11/SmartCardState.h" #include "util/NetworkInterfaceMonitor.h" #include "util/SecretsChecker.h" #include "dialogs/ConnectionEditorDialog.h" #include "dialogs/ConnectionInformationDialog.h" #include "settings/ConnectionSettings.h" #include "L2tpIPsecVpnApplication.h" #include "ConnectionState.h" #include "VPNControlTask.h" #include "ConnectionManager.h" /*! \class ConnectionManager \brief The ConnectionManager class manages L2TP over IPsec VPN connections. */ /*! Creates a new ConnectionManager object. */ static const int PTPINTERFACE_CHECK_UP_TIME(30000); static const int PTPINTERFACE_CHECK_DOWN_TIME(30000); static const int VPN_TASK_TIMOUT(80000); static const QString strRuntimePath("/var/run/L2tpIPsecVpnControlDaemon/"); static const char* const strAbout( "

Copyright © 2010-2012 Werner Jaeger

" "

Help

" "

Website

" ); ConnectionManager::ConnectionManager(L2tpIPsecVpnApplication& application, QObject* pParent) : QObject(pParent), m_pConnectionInformation(new ConnectionInformationDialog()), m_pTimeout(new QTimer), m_pActions(new ActionList()), m_Application(application), m_pState(new NotConnected(NULL)), m_fIsExecuting(false), m_fRoutePriorityIsChanging(false) { connect(&m_Application, SIGNAL(connectionAdded(const QString&)), SLOT(onConnectionAdded(const QString&))); connect(&m_Application, SIGNAL(connectionRemoved(const QString&)), SLOT(onConnectionRemoved(const QString&))); m_pTimeout->setInterval(VPN_TASK_TIMOUT); m_pTimeout->setSingleShot(true); connect(m_pTimeout, SIGNAL(timeout()), SLOT(onVpnTaskTimeout())); createActions(); m_pVPNControlTask = new VPNControlTask(this); connect(m_pVPNControlTask, SIGNAL(commandOutputReceived(const QString&)), SLOT(onVpnTaskOutput(const QString&))); connect(m_pVPNControlTask, SIGNAL(readyReadLog()), SLOT(onVpnTaskReadyReadLog())); connect(m_pVPNControlTask, SIGNAL(errorMessageEmited(int)), SLOT(onVpnTaskErrorMsg(int))); connect(m_pVPNControlTask, SIGNAL(finished()), SLOT(onVpnTaskFinished())); } /*! Frees the resources associated with this ConnectionManager object. */ ConnectionManager::~ConnectionManager() { NetworkInterfaceMonitor::instance()->stop(); delete m_pConnectionInformation; while (!m_pActions->isEmpty()) delete m_pActions->takeFirst(); delete m_pTimeout; delete m_pActions; delete m_pState; delete m_pTrayIcon; delete m_pTrayIconMenu; delete m_pVPNControlTask; } int ConnectionManager::exec() { int iRet(1); // at startup it might last few seconds until a tray is available, lets try a view times before giving up for (int i = 0; iRet != 0 && i < 30; i++) { if (QSystemTrayIcon::isSystemTrayAvailable()) iRet = 0; else ::sleep(1); } if (iRet == 0) { createTrayIcon(); updateContextMenu(true); const ConnectionSettings settings; const int iSize = settings.connections(); for (int i = 0; i < iSize; i++) onConnectionAdded(settings.connection(i)); m_pTrayIcon->show(); QTimer::singleShot(100, this, SLOT(detectConnectionState())); iRet = m_Application.exec(); } else QMessageBox::critical(NULL, m_Application.applicationName(), QObject::tr("I couldn't detect any system tray on this system.")); return(iRet); } void ConnectionManager::createActions() { m_pActions->insert(DISC, new QAction(tr("&Disconnect"), this)); m_pActions->insert(EDIT, new QAction(tr("&Edit Connections ..."), this)); m_pActions->insert(INFO, new QAction(tr("Connection &Information"), this)); m_pActions->insert(ABOUT, new QAction(tr("&About"), this)); m_pActions->insert(QUIT, new QAction(tr("&Quit"), this)); connect(action(DISC), SIGNAL(triggered()), SLOT(vpnDisconnect())); connect(action(EDIT), SIGNAL(triggered()), SLOT(editConnections())); connect(action(INFO), SIGNAL(triggered()), SLOT(showConnectionInformation())); connect(action(ABOUT), SIGNAL(triggered()), SLOT(about())); connect(action(QUIT), SIGNAL(triggered()), &m_Application, SLOT(quit())); } void ConnectionManager::createTrayIcon() { m_pTrayIconMenu = new QMenu(); m_pTrayIconMenu->addAction(action(DISC)); m_pTrayIconMenu->addSeparator(); m_pTrayIconMenu->addAction(action(EDIT)); m_pTrayIconMenu->addAction(action(INFO)); m_pTrayIconMenu->addSeparator(); m_pTrayIconMenu->addAction(action(ABOUT)); m_pTrayIconMenu->addSeparator(); m_pTrayIconMenu->addAction(action(QUIT)); m_pTrayIcon = new QSystemTrayIcon(this); m_pTrayIcon->setContextMenu(m_pTrayIconMenu); m_pState = new NotConnected(m_pTrayIcon); connect(m_pTrayIconMenu, SIGNAL(triggered(QAction*)), SLOT(vpnConnect(QAction*))); connect(m_pTrayIcon, SIGNAL(messageClicked()), SLOT(messageClicked())); connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); } void ConnectionManager::updateContextMenu(bool fStatusChanged) { if (m_pState->isState(ConnectionState::Connected)) { enableAllConnections(false); action(DISC)->setEnabled(true); } else if (m_pState->isState(ConnectionState::Connecting)) { enableAllConnections(false); action(DISC)->setEnabled(true); } else if (m_pState->isState(ConnectionState::Disconnecting)) { enableAllConnections(false); action(DISC)->setEnabled(false); } else if (m_pState->isState(ConnectionState::Error)) { enableAllConnections(true); action(DISC)->setEnabled(NetworkInterface::defaultGateway().size() == 1); } else { enableAllConnections(NetworkInterface::defaultGateway().size() == 1); action(DISC)->setEnabled(false); } if (fStatusChanged) { m_pConnectionInformation->onConectionStateChanged(m_pState, m_pVPNControlTask->connectionName()); showMessage(); } } void ConnectionManager::vpnConnect(const QString& strConnectionName) { // qDebug() << "ConnectionManager::vpnConnect(const QString&" << strConnectionName << ")"; if (!m_fIsExecuting) { const SecretsChecker secrets(strConnectionName); if (secrets.check()) { const PppSettings pppSettings(ConnectionSettings().pppSettings(strConnectionName)); const bool fUseSmartCard = !pppSettings.refuseEap() && pppSettings.eapSettings().useSmartCard(); m_pConnectionInformation->clearLog(); SmartCardState sc; if (fUseSmartCard && sc.readersAvailable() <= 0) m_pVPNControlTask->restartPcscDaemon(); if (!fUseSmartCard || sc.readersAvailable() > 0) { if (!fUseSmartCard || sc.waitForCardPresent() > 0) { const QString strGateway(ConnectionSettings().gateway(strConnectionName)); delete m_pState; m_pState = new Connecting(m_pTrayIcon, strGateway); updateContextMenu(true); m_pVPNControlTask->setConnectionName(strConnectionName); m_pVPNControlTask->setAction(VPNControlTask::Connect); m_pVPNControlTask->start(); m_fIsExecuting = true; m_pTimeout->start(); QTimer::singleShot(PTPINTERFACE_CHECK_UP_TIME, this, SLOT(onCheckPtpInterfaceIsUp())); } } else QMessageBox::critical(NULL, qApp->applicationName(), QObject::tr("No smart card reader found.")); } } // qDebug() << "ConnectionManager::vpnConnect(const QString&" << strConnectionName << ") -> finished"; } void ConnectionManager::vpnConnect(QAction* pAction) { if (m_pTrayIconMenu && pAction) { if (!pAction->data().isNull()) vpnConnect(pAction->data().toString()); } } void ConnectionManager::vpnDisconnect(bool fDontChangeStatus) { // qDebug() << "ConnectionManager::vpnDisconnect(bool" << fDontChangeStatus << ")"; if (!m_fIsExecuting) { if (!fDontChangeStatus) { const ConnectionSettings settings; const QString strGateway(settings.gateway(m_pVPNControlTask->connectionName())); delete m_pState; m_pState = new Disconnecting(m_pTrayIcon, strGateway); updateContextMenu(true); } m_pVPNControlTask->setAction(VPNControlTask::Disconnect); m_pVPNControlTask->start(); m_fIsExecuting = true; m_pTimeout->start(); QTimer::singleShot(PTPINTERFACE_CHECK_DOWN_TIME, this, SLOT(onCheckPtpInterfaceIsDown())); } // qDebug() << "ConnectionManager::vpnDisconnect(bool" << fDontChangeStatus << ") -> finished"; } void ConnectionManager::editConnections() const { m_Application.startConnectionEditorDialog(); } void ConnectionManager::showConnectionInformation() const { m_pConnectionInformation->show(); if (!m_pConnectionInformation->isActiveWindow()) { m_pConnectionInformation->activateWindow(); m_pConnectionInformation->raise(); } } void ConnectionManager::about() const { QIcon logo; logo.addFile(QString::fromUtf8(":/images/logo"), QSize(), QIcon::Normal, QIcon::Off); QMessageBox about; about.setWindowIcon(logo); about.setWindowTitle(tr("About %1").arg(L2tpIPsecVpnApplication::applicationName())); about.setText("" + L2tpIPsecVpnApplication::applicationName() + " " + L2tpIPsecVpnApplication::applicationVersion() + ""); about.setInformativeText("

" + tr("Notification area applet for managing your L2tp over IPsec virtual private network connections.") + "

" + strAbout); about.setStandardButtons(QMessageBox::Close); about.exec(); } void ConnectionManager::iconActivated(QSystemTrayIcon::ActivationReason reason) { switch (reason) { case QSystemTrayIcon::MiddleClick: showMessage(); break; case QSystemTrayIcon::Context: updateContextMenu(false); break; case QSystemTrayIcon::Trigger: updateContextMenu(false); m_pTrayIconMenu->popup(QCursor::pos()); break; default: ; } } void ConnectionManager::showMessage() { m_pTrayIcon->showMessage(m_pState->msgTitle(), m_pState->msgBody(), m_pState->msgIcon(), 5 * 1000); } void ConnectionManager::messageClicked() { showConnectionInformation(); } void ConnectionManager::detectConnectionState() { const ConnectionInfo connectionInfo(connectionNameOfUpAndRunningPtpInterface()); if (!connectionInfo.first.isNull()) { if (NetworkInterface::writeDefaultGatewayInfo()) connected(connectionInfo.first, connectionInfo.second); else vpnDisconnect(true); } else onRouteAdded(NetworkInterface::null, 0); NetworkInterfaceMonitor::instance()->subscribe(this); NetworkInterfaceMonitor::instance()->start(); } void ConnectionManager::onVpnTaskOutput(const QString& strOutputLine) { // qDebug() << "ConnectionManager::onVpnTaskOutput(const QString&" << strOutputLine << ")"; if (strOutputLine.trimmed().length() > 0) m_pConnectionInformation->appendLogPlainText((strOutputLine + '\n').toAscii().constData()); // qDebug() << "ConnectionManager::onVpnTaskOutput(const QString&" << strOutputLine << ") -> finished"; } void ConnectionManager::onVpnTaskReadyReadLog() { // qDebug() << "ConnectionManager::onVpnTaskReadyReadLog()"; char acBuf[1024]; qint64 iRet; do { iRet = m_pVPNControlTask->readLogLine(acBuf, sizeof(acBuf)); if (iRet > 0) m_pConnectionInformation->appendLogPlainText(acBuf); } while (iRet != -1); // qDebug() << "ConnectionManager::onVpnTaskReadyReadLog() -> finished"; } void ConnectionManager::onVpnTaskErrorMsg(int iErrorCode) { // qDebug() << "ConnectionManager::onVpnTaskErrorMsg(int" << iErrorCode << ")"; char acBuf[1024]; const qint64 iLineLength = m_pVPNControlTask->readErrorLine(acBuf, sizeof(acBuf)); if (iLineLength > 0) { m_pConnectionInformation->appendLogColorText(QColor(255, 0, 0), acBuf); error(iErrorCode); } // qDebug() << "ConnectionManager::onVpnTaskErrorMsg(int" << iErrorCode << ") -> finished"; } void ConnectionManager::onVpnTaskTimeout() { // qDebug() << "ConnectionManager::onVpnTaskTimeout()"; if (m_fIsExecuting) { m_pConnectionInformation->appendLogColorText(QColor(255, 0, 0), "Last command timed out\n"); m_fIsExecuting = !m_pVPNControlTask->stop(1000); if ((m_pState->isState(ConnectionState::Connecting) || m_pState->isState(ConnectionState::Disconnecting))) error(500); } // qDebug() << "ConnectionManager::onVpnTaskTimeout() -> finished"; } void ConnectionManager::onVpnTaskFinished() { // qDebug() << "ConnectionManager::onVpnTaskFinished()"; m_pTimeout->stop(); m_fIsExecuting = false; // qDebug() << "ConnectionManager::onVpnTaskFinished() -> finished"; } void ConnectionManager::onConnectionAdded(const QString& strName) { // qDebug() << "ConnectionManager::onConnectionAdded(const QString&" << strName << ")"; if (m_pTrayIconMenu && m_pActions) { m_pActions->append(new QAction(strName, this)); m_pActions->last()->setData(strName); m_pActions->last()->setToolTip(tr("Click to establish a vpn connection to '%1'").arg(strName)); if (m_pState->isState(ConnectionState::NotConnected) || m_pState->isState(ConnectionState::Error)) m_pActions->last()->setEnabled(true); else m_pActions->last()->setEnabled(false); m_pTrayIconMenu->insertAction(action(DISC), m_pActions->last()); } // qDebug() << "ConnectionManager::onConnectionAdded(const QString&" << strName << ") -> finished"; } void ConnectionManager::onConnectionRemoved(const QString& strName) { // qDebug() << "ConnectionManager::onConnectionRemoved(const QString&" << strName << ")"; if (m_pTrayIconMenu && m_pActions) { QAction* pAction = NULL; for (int i = QUIT + 1; !pAction && i < m_pActions->size(); i++) { if (m_pActions->at(i)->text() == strName) pAction = m_pActions->at(i); } if (pAction) { m_pTrayIconMenu->removeAction(pAction); m_pActions->removeAll(pAction); delete pAction; } } // qDebug() << "ConnectionManager::onConnectionRemoved(const QString&" << strName << ") -> finished"; } void ConnectionManager::onRouteAdded(NetworkInterface interface, unsigned int iPriority) { // qDebug() << "ConnectionManager::onRouteAdded(" << interface.name().c_str() << ", " << iPriority << ")"; if (iPriority != 100) { if (!m_fRoutePriorityIsChanging) { bool fHasDefaultGateway = false; if (!interface.isNull()) fHasDefaultGateway = interface.hasDefaultGateway(); else fHasDefaultGateway = NetworkInterface::defaultGateway().size() == 1; if (m_pState && (m_pState->isState(ConnectionState::NotConnected) || m_pState->isState(ConnectionState::Error)) && fHasDefaultGateway) { // qDebug() << "ConnectionManager::onRouteAdded: found default gateway"; ConnectionSettings settings; const int iConnections = settings.connections(); bool fDone = false; for (int i = 0; !fDone && i < iConnections; i++) { const QString strName = settings.connection(i); if (settings.commonSettings(strName).autoConnect()) { fDone = true; vpnConnect(strName); } } } } else m_fRoutePriorityIsChanging = false; } else m_fRoutePriorityIsChanging = true; // qDebug() << "ConnectionManager::onRouteAdded(" << interface.name().c_str() << ", " << iPriority << ") -> finished"; } void ConnectionManager::onRouteDeleted(NetworkInterface interface, unsigned int iPriority) { // qDebug() << "ConnectionManager::onRouteDeleted(" << interface.name().c_str() << ", " << iPriority << ")"; if (iPriority != 100) { if (!m_fRoutePriorityIsChanging) { if (m_pState && m_pState->isState(ConnectionState::Connected) && interface.isDefaultGateway() && !interface.hasDefaultGateway()) vpnDisconnect(); } else m_fRoutePriorityIsChanging = false; } else m_fRoutePriorityIsChanging = true; // qDebug() << "ConnectionManager::onRouteDeleted(" << interface.name().c_str() << ") -> finished"; } void ConnectionManager::onPtpInterfaceIsUpAnRunning(NetworkInterface interface) { // qDebug() << "ConnectionManager::onPtpInterfaceIsUpAnRunning(" << interface.name().c_str() << ")"; if (m_pState->isState(ConnectionState::Connecting) || m_pState->isState(ConnectionState::NotConnected)) { const QString strConnectionName(ConnectionManager::connectionName(interface, 5)); if (!strConnectionName.isNull()) connected(strConnectionName, interface); } // qDebug() << "ConnectionManager::onPtpInterfaceIsUpAnRunning(" << interface.name().c_str() << ", " << iPriority << ") -> finished"; } void ConnectionManager::onPtpInterfaceIsGoingDown(NetworkInterface interface) { // qDebug() << "ConnectionManager::onPtpInterfaceIsGoingDown(" << interface.name().c_str() << ")"; if ((m_pState->isState(ConnectionState::Connected) || m_pState->isState(ConnectionState::Disconnecting))) { const QString strConnectionName(ConnectionManager::connectionName(interface)); if (!strConnectionName.isNull()) disConnected(); } if (m_pState && m_pState->isState(ConnectionState::Connected) && interface.isDefaultGateway()) vpnDisconnect(); // qDebug() << "ConnectionManager::onPtpInterfaceIsGoingDown(" << interface.name().c_str() << ") -> finished"; } void ConnectionManager::onCheckPtpInterfaceIsUp() { if (!m_fIsExecuting && m_pState->isState(ConnectionState::Connecting)) { const ConnectionInfo connectionInfo(connectionNameOfUpAndRunningPtpInterface()); if (connectionInfo.first.isNull()) disConnected(); else connected(connectionInfo.first, connectionInfo.second); } } void ConnectionManager::onCheckPtpInterfaceIsDown() { if (!m_fIsExecuting && m_pState->isState(ConnectionState::Disconnecting)) { const ConnectionInfo connectionInfo(connectionNameOfUpAndRunningPtpInterface()); if (connectionInfo.first.isNull()) disConnected(); else connected(connectionInfo.first, connectionInfo.second); } } QAction* ConnectionManager::action(ActionType type) const { return(m_pActions != NULL ? m_pActions->at(type) : NULL); } void ConnectionManager::enableAllConnections(bool fEnable) const { for (int i = QUIT + 1; i < m_pActions->size(); i++) m_pActions->at(i)->setEnabled(fEnable); } void ConnectionManager::connected(const QString& strConnectionName, const NetworkInterface& ptpInterface) { const QString strGateway(ConnectionSettings().gateway(strConnectionName)); m_pVPNControlTask->setConnectionName(strConnectionName); delete m_pState; m_pState = new Connected(m_pTrayIcon, strGateway, ptpInterface); updateContextMenu(true); } void ConnectionManager::disConnected() { delete m_pState; m_pState = new NotConnected(m_pTrayIcon); updateContextMenu(true); } void ConnectionManager::error(int iErrorCode) { if (!m_pState->isState(ConnectionState::NotConnected)) { const ConnectionSettings settings; const QString strGateway(settings.ipsecSettings(m_pVPNControlTask->connectionName()).gateway()); const bool fDisconnecting(!m_pState->isState(ConnectionState::Connecting)); delete m_pState; m_pState = new Error(m_pTrayIcon, strGateway, iErrorCode, fDisconnecting); updateContextMenu(true); vpnDisconnect(true); } } ConnectionManager::ConnectionInfo ConnectionManager::connectionNameOfUpAndRunningPtpInterface() const { QString strConnectionName; NetworkInterface::InterfaceMap interfaces = NetworkInterface::pointToPointInterfaces(); NetworkInterface::InterfaceMap::const_iterator itInterfaces = interfaces.begin(); for (; strConnectionName.isNull() && itInterfaces != interfaces.end(); ++itInterfaces) strConnectionName = ConnectionManager::connectionName((*itInterfaces).second); return(ConnectionInfo(strConnectionName, strConnectionName.isNull() ? NetworkInterface::null : (*--itInterfaces).second)); } QString ConnectionManager::connectionName(const NetworkInterface& interface, int iRetry) { QString strConnectionName; const NetworkInterface::AddressEntries addressEntries(interface.addressEntries()); NetworkInterface::AddressEntries::const_iterator addressIterator(addressEntries.begin()); for (bool fFound = false; !fFound && addressIterator != addressEntries.end(); addressIterator++) { QFile connectionNameMap(strRuntimePath + (*addressIterator).broadcast().toString()); for (int i = 0; !fFound && i < iRetry; i++) { if (connectionNameMap.exists()) { if (connectionNameMap.open(QFile::ReadOnly)) { strConnectionName = connectionNameMap.readLine(); if (!strConnectionName.isEmpty()) fFound = true; connectionNameMap.close(); } } else ::sleep(1); } } return(strConnectionName.trimmed()); } l2tp-ipsec-vpn/Makefile0000664000175000017500000001522112040201227015436 0ustar wejaegerwejaeger# # $Id: Makefile 144 2012-05-21 07:31:37Z wejaeger $ # # File: Makefile # Author: Werner Jaeger # # Created on August 4, 2011, 3:17 PM # # Copyright 2011 Werner Jaeger. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # QMAKE := $(shell if [ -f /usr/bin/qmake ]; then echo "qmake"; else echo "qmake-qt4"; fi) # default configuration is release DEFAULTCONF=Release # Active Configuration CONF ?= ${DEFAULTCONF} # All Configurations ALLCONFS=Debug Release # various directories BUILDDIR = build/${CONF} GENDIR = src/generated DOCDIR = docs/api DISTDIR = dist/${CONF} TESTDIR = build/TestFiles QMAKE_TARGET = L2tpIPsecVpn # build build: nbproject/qt-${CONF}.mk make -f nbproject/qt-${CONF}.mk ${DISTDIR}/$(QMAKE_TARGET) # install install: nbproject/qt-${CONF}.mk make -f nbproject/qt-${CONF}.mk QMAKE_TARGE=$(QMAKE_TARGET) install @if [ "$${INSTALL_ROOT}" = "" ]; then \ $(QMAKE_TARGET) applySettings || true; \ service rsyslog restart; \ fi # uninstall uninstall: nbproject/qt-${CONF}.mk # if applet is running try to terminate it @PIDS=$$(pidof ${QMAKE_TARGET} || true); \ if [ -n "$${PIDS}" ]; then \ echo "Trying to terminate ${QMAKE_TARGET} applet" >&2; \ kill $${PIDS} || true; \ fi # Remove all generated configuration files @echo "Trying to delete all generated config files" >&2 $(QMAKE_TARGET) deleteAllConfFiles || true # Remove lock files and sockets rm -f $(INSTALL_ROOT)/tmp/$(QMAKE_TARGET)-* # Remove syslog pipe and restart syslog service rm -f $(INSTALL_ROOT)/var/log/l2tpipsecvpn.pipe service rsyslog restart make -f nbproject/qt-${CONF}.mk QMAKE_TARGE=$(QMAKE_TARGET) uninstall lupdate: mv nbproject/qt-${DEFAULTCONF}.pro . lupdate qt-${DEFAULTCONF}.pro mv qt-${DEFAULTCONF}.pro nbproject lrelease: mv nbproject/qt-${DEFAULTCONF}.pro . lrelease -compress -nounfinished -removeidentical qt-${DEFAULTCONF}.pro mv qt-${DEFAULTCONF}.pro nbproject ts2pot: lconvert -if ts -of pot -o nls/nls.pot nls/L2tpIPsecVpn_de.ts ts2po: lconvert -if ts -of po -o nls/de.po nls/L2tpIPsecVpn_de.ts po2ts: lconvert -if po -of ts -o nls/L2tpIPsecVpn_de.ts nls/de.po # clean clean: rm -rf ${BUILDDIR}/* rm -rf ${GENDIR}/* rm -rf ${DOCDIR} rm -rf ${DISTDIR}/* rm -rf ${TESTDIR}/* rm -f nbproject/*.mk rm -f nbproject/*.bash rm -f *.mk # clobber clobber: @for CONF in ${ALLCONFS}; \ do \ make CONF=$${CONF} clean; \ done # run tests test: build build-tests @if [ "${TEST}" = "" ]; \ then \ ${TESTDIR}/LibtoolTests || true; \ ${TESTDIR}/Pkcs12Tests || true; \ ${TESTDIR}/EncSecretsTests || true; \ else \ ./${TEST} || true; \ fi srccheck: cppcheck -q -I src -I ${GENDIR} --enable=all src # help help: @echo "This makefile supports the following configurations:" @echo " ${ALLCONFS} (default = ${DEFAULTCONF})" @echo "" @echo "and the following targets:" @echo " build (default target)" @echo " clean" @echo " clobber" @echo " srccheck" @echo " install" @echo " uninstall" @echo " lupdate" @echo " lrelease" @echo " ts2pot" @echo " ts2po" @echo " po2ts" @echo " test" @echo " help" @echo "" @echo "Makefile Usage:" @echo " make [CONF=] build" @echo " make [CONF=] clean" @echo " make clobber" @echo " make [CONF=] [INSTALL_ROOT=] install" @echo " make [INSTALL_ROOT=] uninstall" @echo " make lupdate" @echo " make lrelease" @echo " make ts2pot" @echo " make ts2po" @echo " make po2ts" @echo " make test" @echo " make help" @echo "" @echo "Target 'build' will build a specific configuration." @echo "Target 'clean' will remove all built files from a specific configuration." @echo "Target 'clobber' will remove all built files from all configurations" @echo "Target 'srccheck' performs a static source code check using cppcheck" @echo "Target 'install' will install a specific configuration of the program" @echo " in [INSTALL_ROOT]/usr/bin/" @echo "Target 'uninstall' will uninstall the program from [INSTALL_ROOT]/usr/bin/" @echo "Target 'lupdate' reads the project file, finds the translatable strings in the specified source, header and interface files, and updates the translation files (.ts files) specified in it." @echo "Target 'lrelease' reads the project file and converts the translation files (.ts files) specified in it into Qt message files (.qm files) used by the application to translate." @echo "Target 'ts2pot' converts a translation file (.ts file) to a GNU Portable Object Template File (.pot file)." @echo "Target 'ts2po' converts all translation files (.ts files) to GNU Portable Object Files (.po files)." @echo "Target 'po2ts' converts all GNU Portable Object Files (.po files) to translation files (.ts files)." @echo "Target 'test' will run the test suite." @echo "Target 'help' prints this message" @echo "" build-tests: nbproject/qt-EncSecretsTests.mk nbproject/qt-LibtoolTests.mk nbproject/qt-Pkcs12Tests.mk make -f nbproject/qt-EncSecretsTests.mk ${TESTDIR}/EncSecretsTests make -f nbproject/qt-LibtoolTests.mk ${TESTDIR}/LibtoolTests make -f nbproject/qt-Pkcs12Tests.mk ${TESTDIR}/Pkcs12Tests nbproject/qt-EncSecretsTests.mk: tests/EncSecretsTests.pro ${QMAKE} -o qttmp-EncSecretsTests.mk "BUILDDIR=${BUILDDIR}" "OBJECTS_DIR=${TESTDIR}" "DESTDIR=${TESTDIR}" tests/EncSecretsTests.pro mv -f qttmp-EncSecretsTests.mk nbproject/qt-EncSecretsTests.mk nbproject/qt-LibtoolTests.mk: tests/EncSecretsTests.pro ${QMAKE} -o qttmp-LibtoolTests.mk "BUILDDIR=${BUILDDIR}" "OBJECTS_DIR=${TESTDIR}" "DESTDIR=${TESTDIR}" tests/LibtoolTests.pro mv -f qttmp-LibtoolTests.mk nbproject/qt-LibtoolTests.mk nbproject/qt-Pkcs12Tests.mk: tests/Pkcs12Tests.pro ${QMAKE} -o qttmp-Pkcs12Tests.mk "BUILDDIR=${BUILDDIR}" "OBJECTS_DIR=${TESTDIR}" "DESTDIR=${TESTDIR}" tests/Pkcs12Tests.pro mv -f qttmp-Pkcs12Tests.mk nbproject/qt-Pkcs12Tests.mk nbproject/qt-${CONF}.mk: nbproject/qt-${CONF}.pro ${QMAKE} -o qttmp-${CONF}.mk -after "OBJECTS_DIR=${BUILDDIR}" "DESTDIR=${DISTDIR}" nbproject/qt-${CONF}.pro mv -f qttmp-${CONF}.mk nbproject/qt-${CONF}.mk l2tp-ipsec-vpn/resources/0000775000175000017500000000000012040201227016007 5ustar wejaegerwejaegerl2tp-ipsec-vpn/resources/logo.png0000664000175000017500000000654712040201227017471 0ustar wejaegerwejaegerPNG  IHDR00WsBIT|d pHYs B4tEXtSoftwareMacromedia Fireworks 8hx IDAThՙ{u?Ǿﵽ`o0`cpZԔ6R6I&JZ )ȥQ*Uh'ZMjT6&JD4j$ӒbҠP,w{g~`.6isΜ9͈#?΢O"8]j˧qժO\*}IMj4 >R~Q6ڵlt#oDEuǎ/ -𦩩G#ǎŇ schVMNh"r`>^޽^OVuS|r˯sUky[߹~uV^{uOGޜ&Dt:ꪵ\r 5ffsfAeTu-~oS΁17g?N/=eOg1ilt3kܿXؿ}ط׼Pwロ7C A{\nIe>]%Y '{>x-_Z?u?/_5u5,BW<@8tݺ[cӲl,8+;ȋ5_BZo|;v,Yk?rm?;;<߿`abgbĖ9Ԏ^?jrrV˰%/,t.TR:--.84CkkqQ&V`i L (C:޸P6#)2)AfXBA%%%:uK# Y~wV:+6HZ"YPi!5Mt@%D ^@P(RYgYx1;;qq|$Hp<*'YGVB!xٕ"|y|IhD{UDB Z B"AHT GsP{t77K, D*rh !H,-Ӄҡ:׀c  6" _?&9U$ YH@'RW?aX[P 2iABb D) d2HY@J9*rǽK S($4Ⱥ´Z x 3B&"^# +~BVW|]ug y<>G,B>{7fI  "C`<#($< P0D68;sȁ%Q1Ts9D(^{sdWt.@I1dP~ߝ[*@A6FQCmtsXEWObV!ux,R@`i;YƐU}!إ~,g@,A+1c[JM<ÀS+ Qe>9EhÂvaq>շ<`277gno>m۶Y:|pngRZYFn|_3O)QIHB*l!DmmPޡb":!xyON8ѫ O+o<ݴzf2<֭[3~zƍYB6S[2E&}ټ_e_fL3crip1E*Q E (4&BJgy:&{属c/d:6ltMgB{nZ:MӴeYz=Ȳ$8bm"H&DJ,K!HKJ( tRJBp뜳N)UJu.ȲB@sNm۶9#]viB,˴1F}-P{)P9$ J)C!e^wιO>gff\wygZ1#G9%ƻ$IENDB`l2tp-ipsec-vpn/resources/ipsec.conf.tpl0000664000175000017500000000147612040201227020567 0ustar wejaegerwejaeger# {{FILENAME}} - Openswan IPsec configuration file # $Id$ # Manual: ipsec.conf(5) # Created: {{CREATIONDATE}} # by: The {{APPNAME}} application version {{APPVERSION}} # # WARNING! All changes made in this file will be lost! version 2.0 # conforms to second version of ipsec.conf specification config setup # plutodebug="parsing emitting control private" plutodebug=none strictcrlpolicy=no nat_traversal=yes interfaces=%defaultroute oe=off # which IPsec stack to use. netkey,klips,mast,auto or none protostack=netkey conn %default keyingtries=3 pfs=no rekey=yes type=transport left=%defaultroute leftprotoport=17/1701 rightprotoport=17/1701 # Add connections here. {{#CONN_SECTION}} conn {{NAME}} authby={{AUTHBY}} {{LEFTCERT}} right={{GATEWAY}} rightid="{{IDENTITY}}" auto=add {{/CONN_SECTION}}l2tp-ipsec-vpn/resources/L2TP-Ipsec-VPN-Manager.desktop0000664000175000017500000000050312040201227023173 0ustar wejaegerwejaeger[Desktop Entry] Name=L2TP Ipsec VPN Manager Exec=L2tpIPsecVpn startConnectionEditor Comment=Manage and change your L2TP IPsec VPN connection settings Icon=/usr/share/L2tpIPsecVpn/logo.png Type=Application Terminal=false StartupNotify=false Categories=GNOME;GTK;Settings;X-SuSE-ControlCenter-System;X-GNOME-NetworkSettings; l2tp-ipsec-vpn/resources/busy.gif0000664000175000017500000000155312040201227017464 0ustar wejaegerwejaegerGIF89a888&&&֨vvvfff䘘HHHVVV! NETSCAPE2.0!Built with GIF Movie Gear 4.0!Made by AjaxLoad.info! ,P di0l!*`Ƒ5و[<iP),IZ$bH85&x5k <yB! ,h GҌh*ਨ@$E}eh @ LcQGBP5 <5UdQ+"g0Ak#A nI0$K7 H,-t*E-``1@C7h/1f\)&!;l2tp-ipsec-vpn/resources/L2tpIPsecVpn.qrc0000664000175000017500000000240212040201227020745 0ustar wejaegerwejaeger configure.png busy.gif connectEstablished.png connectError.png connectNo.png search.png logo.png ipsec.conf.tpl 30-l2tp-ipsec-vpn.conf.tpl xl2tpd.conf.tpl options.xl2tpd.tpl getIPSecInfo.lib.tpl L2tpIPsecVpn-up.tpl L2tpIPsecVpn-dns.tpl L2tpIPsecVpn-down.tpl openssl.cnf.tpl ipsec.secrets.tpl ../nls/L2tpIPsecVpn_de.qm l2tp-ipsec-vpn/resources/search.png0000664000175000017500000000145612040201227017770 0ustar wejaegerwejaegerPNG  IHDR(-SsBITO pHYsu85tEXtSoftwarewww.inkscape.org<nPLTExxx&&& &&&'''"""$$$&&&'''(((***---1$1113334'5558,"886>+!K"LLLPPPT2T@4TTTW2WUT___```aaaeeefVHo_Po`PrqqttturpyhY|||~=B ~|Z6F eEc3@|m .v5@`0ιTF! $O5qDV_;՝a"TCuqTBfg!:O-k-+O] *`YkbKͲ?f]\aP ;X-vy2v0%p#\>velDFӴ~`!`6,T_\ݽ%1w`p0srj%ǾCNʆIENDB`l2tp-ipsec-vpn/resources/xl2tpd.conf.tpl0000664000175000017500000000105312040201227020670 0ustar wejaegerwejaeger; {{FILENAME}} - configuration file for use with L2TP over IPsec. ; $Id$ ; Manual: xl2tpd.conf(5) ; Created: {{CREATIONDATE}} ; by: The {{APPNAME}} application version {{APPVERSION}} ; ; WARNING! All changes made in this file will be lost! [global] ; listen-addr = 192.168.178.28 debug avp = no debug network = no debug packet = no debug state = no debug tunnel = no {{#LAC_SECTION}} [lac {{NAME}}] lns = {{GATEWAY}} pppoptfile = {{PPPOPTFILE}} length bit = {{LENGTHBIT}} redial = {{REDIAL}} {{REDIALTIMEOUT}} {{REDIALATTEMPTS}} {{/LAC_SECTION}} l2tp-ipsec-vpn/resources/L2tpIPsecVpn-down.tpl0000664000175000017500000000243412040201227021731 0ustar wejaegerwejaeger#!/bin/sh -e # # {{FILENAME}} # $Id$ # # This script is called by /etc/ppp/ip-down after pppd has brought down the link # to delete connection specific routes. # # Created: {{CREATIONDATE}} # by: The {{APPNAME}} application version {{APPVERSION}} # # WARNING! All changes made in this file will be lost! # # PPP_IFACE="$IFNAME" PPP_TTY="$DEVICE" PPP_SPEED="$SPEED" PPP_LOCAL="$IPLOCAL" PPP_REMOTE="$IPREMOTE" PPP_IPPARAM="$6" if test -f /var/run/L2tpIPsecVpnControlDaemon/connectionName.info; then PPP_IPPARAM={{OBJECTNAME}}-$(cat /var/run/L2tpIPsecVpnControlDaemon/connectionName.info) fi echo "{{FILENAME}} called with PPP_IPPARAM=$PPP_IPPARAM" # exit if PPP_IPPARAM is not set or does not start with "{{OBJECTNAME}}" if [ ! `echo $PPP_IPPARAM | grep "{{OBJECTNAME}}"` ]; then exit 0 fi . {{GETIPSECINFOLIB}} if test -f /var/run/L2tpIPsecVpnControlDaemon/${PPP_REMOTE} ; then rm -f /var/run/L2tpIPsecVpnControlDaemon/${PPP_REMOTE} fi case $PPP_IPPARAM in {{#CONN_SECTION}} "{{IPPARAM}}" ) /sbin/route del -host {{GATEWAY}} gw ${DFLT_GWY} ${EXT_INTF}{{#DEFAULT_GATEWAY_SECTION}} /sbin/route del -net 0.0.0.0 gw ${DFLT_GWY} metric 100 dev ${EXT_INTF} /sbin/route add -net 0.0.0.0 gw ${DFLT_GWY} metric 0 dev ${EXT_INTF}{{/DEFAULT_GATEWAY_SECTION}} ;; {{/CONN_SECTION}} esac l2tp-ipsec-vpn/resources/L2tpIPsecVpn-Applet.desktop0000664000175000017500000000030612040201227023055 0ustar wejaegerwejaeger[Desktop Entry] Type=Application Terminal=false Name=L2TP Ipsec VPN Applet Comment=Control your L2TP IPsec VPN connections Exec=L2tpIPsecVpn Icon=/usr/share/L2tpIPsecVpn/logo.png Categories=Network;l2tp-ipsec-vpn/resources/getIPSecInfo.lib.tpl0000664000175000017500000000131112040201227021550 0ustar wejaegerwejaeger# {{FILENAME}} # $Id$ # Read file /var/run/L2tpIPsecVpnControlDaemon/defaultgateway.info and assign two shell variables # EXT_INTF (network interface e.g. eth0 or wlan0) # DFLT_GWY (default gateway e.g. 192.168.178.1) # # used by shell scripts /etc/ppp/ip-up.d/L2tpIPsecVpn-up and # /etc/ppp/ip-down.d/L2tpIPsecVpn-down # Created: {{CREATIONDATE}} # by: The {{APPNAME}} application version {{APPVERSION}} # # WARNING! All changes made in this file will be lost! # exec 3&- l2tp-ipsec-vpn/resources/L2tpIPsecVpn-up.tpl0000664000175000017500000000310212040201227021377 0ustar wejaegerwejaeger#!/bin/sh -e # # {{FILENAME}} # $Id$ # # This script is called by /etc/ppp/ip-up after pppd has established the link # to add routes for given connections. # # Created: {{CREATIONDATE}} # by: The {{APPNAME}} application version {{APPVERSION}} # # WARNING! All changes made in this file will be lost! # # PPP_IFACE="$IFNAME" PPP_TTY="$DEVICE" PPP_SPEED="$SPEED" PPP_LOCAL="$IPLOCAL" PPP_REMOTE="$IPREMOTE" PPP_IPPARAM="$6" if test -f /var/run/L2tpIPsecVpnControlDaemon/connectionName.info; then PPP_IPPARAM={{OBJECTNAME}}-$(cat /var/run/L2tpIPsecVpnControlDaemon/connectionName.info) fi echo "{{FILENAME}} called with PPP_IPPARAM=$PPP_IPPARAM" # exit if PPP_IPPARAM is not set or does not start with "{{OBJECTNAME}}" if [ ! `echo $PPP_IPPARAM | grep "{{OBJECTNAME}}"` ]; then exit 0 fi . {{GETIPSECINFOLIB}} # remember remote PPP address for given connection name echo "${PPP_IPPARAM}" | cut -d'-' -f2 > /var/run/L2tpIPsecVpnControlDaemon/${PPP_REMOTE} chmod go+r /var/run/L2tpIPsecVpnControlDaemon/${PPP_REMOTE} case $PPP_IPPARAM in {{#CONN_SECTION}} "{{IPPARAM}}" ) # direct tunneled packets to the tunnel server /sbin/route add -host {{GATEWAY}} gw ${DFLT_GWY} dev ${EXT_INTF}{{#ROUTE_SECTION}} /sbin/route add -net {{IPADDRESS}} netmask {{IPNETMASK}} dev ${PPP_IFACE}{{/ROUTE_SECTION}}{{#DEFAULT_GATEWAY_SECTION}} /sbin/route add -net 0.0.0.0 dev ${PPP_IFACE} /sbin/route add -net 0.0.0.0 gw ${DFLT_GWY} metric 100 dev ${EXT_INTF} /sbin/route del -net 0.0.0.0 gw ${DFLT_GWY} metric 0 dev ${EXT_INTF}{{/DEFAULT_GATEWAY_SECTION}} ;; {{/CONN_SECTION}} esac l2tp-ipsec-vpn/resources/configure.png0000664000175000017500000000211512040201227020475 0ustar wejaegerwejaegerPNG  IHDRĴl;sRGBbKGD pHYs^tIME2-IDATxڝkLgm)ҕDJiUp ##cv3#\0[6/! .ې6YQܲR41&QT>́&Xd֮J3=?yr?<eZ&1339q4P(xp:z-@ǒH$Bff[B/o}ێQw+/ $o,ŖHkQ4M7QBH.{)kKvLq0l(A_533`XJړh:`iQQQ aamk׭5Mdoox (iT*!#SZX-mll\߰d; Ç kî,Zy/C" hhN#F {%|b=Z6uv=-UUs\joE $+͖&"Gq.Q0nc9нBqn'"2W7_vUMMMa2HpQjxZl{{ E ,6>v;'[?_p'ھ?K p8O{+*6QN~#g4:0 i@"Dyyx^00KKȈʕ#E_jj4%⌫GF.\X i:rp$paIog>I /?IENDB`l2tp-ipsec-vpn/resources/openssl.cnf.tpl0000664000175000017500000000072112040201227020760 0ustar wejaegerwejaeger# {{FILENAME}} - Openssl configuration file # $Id$ # Manual: config(5) # Created: {{CREATIONDATE}} # by: The {{APPNAME}} application version {{APPVERSION}} # # WARNING! All changes made in this file will be lost! # openssl_conf = openssl_def [ openssl_def ] engines = engine_section [ engine_section ] {{ENGINEID}} = {{ENGINEID}}_section [ {{ENGINEID}}_section ] engine_id = {{ENGINEID}} dynamic_path = {{DYNAMICPATH}} MODULE_PATH = {{MODULEPATH}} init=0 l2tp-ipsec-vpn/resources/connectEstablished.png0000664000175000017500000000063012040201227022315 0ustar wejaegerwejaegerPNG  IHDRabKGDC pHYs  ~tIME 6 %IDAT8˝=KP\?. &R "8J*P?_ cn.8֪R ayyν=A:X_V7skP,7/0M W B CbN1 '<b8LydEVzo8Fa{JRfu]?:Gyv*e][m&5MidbRj1en(#˄Q Ya@޶vvM0̝LX|習e|U BIENDB`l2tp-ipsec-vpn/resources/connectError.png0000775000175000017500000000120612040201227021162 0ustar wejaegerwejaegerPNG  IHDRagAMA a pHYs  ~tIME >M'IDAT8ˍ_HQg>d'BK6A@R2+bѕv7]Dta *#.VE $rkt# 3 im͝`ҏ޻hǺ&4 'ЋߺhѩA+VM? *繹H)+V|>`ɬ'M6Wt` #xkd*2·P@ 2ffH6D[s'\F&ER8 }GHUPMs*RJil"O!6qI33mT͜qz.FuJB x^A0 Ok{G: R&S q":59w]$ d,R]. ~mBvA2GYh@45QN[K [ʿ FC_(^z4MRxn'71UVk1RKY̗~ bO IENDB`l2tp-ipsec-vpn/resources/options.xl2tpd.tpl0000664000175000017500000000131012040201227021432 0ustar wejaegerwejaeger# {{FILENAME}} - Options used by PPP when a connection is made by an L2TP daemon # $Id$ # Manual: PPPD(8) # Created: {{CREATIONDATE}} # by: The {{APPNAME}} application version {{APPVERSION}} # # WARNING! All changes made in this file will be lost! #debug #dump #record /var/log/pppd plugin passprompt.so ipcp-accept-local ipcp-accept-remote idle 72000 ktune noproxyarp asyncmap 0 noauth crtscts lock hide-password modem noipx ipparam {{IPPARAM}} promptprog "{{APPPFILEPATH}}" {{#REFUSE_SECTION}}{{REFUSEPROTOCOL}} {{/REFUSE_SECTION}} remotename "{{REMOTENAME}}" name "{{NAME}}" {{#CERT_SECTION}}{{CERTENTRY}} {{/CERT_SECTION}} {{USEPEERDNS}} {{NOBSDCOMP}} {{NODEFLATE}} {{NOVJ}} {{LCPECHOINTERVAL}}