diff --git a/.gitignore b/.gitignore index 662c486..2c19132 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ *.vcxproj.user *.lastcodeanalysissucceeded *.manifest -Temp \ No newline at end of file +Temp +Build \ No newline at end of file diff --git a/README.md b/README.md index 12d8655..f5e75b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # PuTTY CAC - -PuTTY CAC is a fork of PuTTY, a popular Secure Shell (SSH) terminal. PuTTY CAC adds the ability to use the Windows Certificate API (CAPI) or a Public Key Cryptography Standards (PKCS) library to perform SSH public key authentication using a private key associated with a certificate that is stored on a hardware token. +PuTTY CAC is a fork of PuTTY, a popular Secure Shell (SSH) terminal. PuTTY CAC adds the ability to use the Windows Certificate API (CAPI), Public Key Cryptography Standards (PKCS) libraries, or Fast Identity Online (FIDO) keys to perform SSH public key authentication using a private key associated with a certificate that is stored on a hardware token. PuTTY CAC can be used with many types of cryptographic tokens such as Yubikeys and popular smart card models. The 'CAC' in 'PuTTY CAC' refers to Common Access Card, a smart card token used for US Government facilities which was one of the initial drivers for the development of PuTTY CAC. @@ -9,9 +8,10 @@ PuTTY CAC is maintained independently from the US Government by the open source You can download the latest release of PuTTY CAC here: https://github.com/NoMoreFood/putty-cac/releases ## Prerequisites -* Microsoft Windows 7 or Later +* Microsoft Windows 10 or Later * For CAPI support, an appropriate Windows smart card mini-driver must be installed. This is typically provided by the smart card manufacturer although many common hardware tokens are supported by OpenSC. * For PKCS support, a PKCS #11 library (typically a DLL file) is needed to interface with the hardware token. This is typically provided by the smart card manufacturer although many common hardware tokens are supported by OpenSC. +* For FIDO support, a FIDO key supported by Windows 10. ## Usage You can find a basic set of instructions on the usage of United States Government's ID Management website under the 'SSH Using PuTTY-CAC' section: @@ -19,7 +19,15 @@ You can find a basic set of instructions on the usage of United States Governmen https://playbooks.idmanagement.gov/piv/engineer/ssh/ ## Command Line Usage -PuTTY CAC supports the same command line options as PuTTY. In place of a PuTTY key file path for any PuTTY utility, you can specific certificate thumbprint. For example, `putty.exe CAPI:716B8B58D8F2C3A7F98F3F645161B1BF9818B689 ...` will load the noted thumbprint from the Windows certificate store. For certificates from PKCS libraries, the syntax is the similiar with the addition the library following the thumbprint. For example, `PKCS:716B8B58D8F2C3A7F98F3F645161B1BF9818B689=C:\Windows\Library.dll ...`. +PuTTY CAC supports the same command line options as PuTTY with some additional, specialized options for PuTTY CAC specifically. + +In place of a PuTTY key file path for any PuTTY utility, you can specific certificate thumbprint or application identifier. For example: +* Connect to user@host using the certificate with thumbprint '716B8B58D8F2C3A7F98F3F645161B1BF9818B689' the user certificate store: +`putty.exe user@host -i CAPI:716B8B58D8F2C3A7F98F3F645161B1BF9818B689` +* Connect to user@host using the certificate with thumbprint 'B8B58D8F2C3A7F98F3F645161B1BF9818B689716' using PKCS library 'PKCS.dll': +`putty.exe user@host -i PKCS:B8B58D8F2C3A7F98F3F645161B1BF9818B689716=C:\PKCS.dll` +* Connect to user@host using FIDO key identified by 'ssh:MyFidoKey' from PuTTY CAC FIDO key cache: +`putty.exe user@host -i FIDO:ssh:MyFidoKey` PuTTY executables (putty.exe, pageant.exe, psftp.exe) support the following additional command line options. Most of these options are focused on the operation of Pageant and are also settable from its user interface. Once set, these options will apply automatically to subsequent executions unless specifically unset. Settings that filter Pageant certificate selection dialogs will also affect filter certificate selection dialogs in the standard PuTTY application: * Automatically load any compatible CAPI certificates at startup: `-autoload`,`-autoloadoff` @@ -34,13 +42,16 @@ PuTTY executables (putty.exe, pageant.exe, psftp.exe) support the following addi ### Certificates For the purposes of PuTTY CAC, the certificate is simply a convenient way to reference a private/public key pair. If you want to use PuTTY CAC to securely logon to your system and do not have access to a Certificate Authority (CA), the certificate can be self-signed. Conversely, PuTTY CAC can be used in conjunction with managed SSH servers to enforce multifactor authentication. This can be done by ensuring that the OpenSSH authorized_keys file only contains public keys associated with hardware tokens either procedurally or by creating an index of all issued certs and looking them up through OpenSSH directives like AuthorizedKeysCommand. ### Federal Information Processing Standards (FIPS) Compliance -The specific code used to interface with the hardware token utilizes the Microsoft cryptographic libraries which in turn are governed by system-level FIPS settings. However, PuTTY itself utilizes proprietary encryption and hashing for communication which has not undergone evaluation for FIPS compliance or certification. +The specific code used to interface with the hardware token utilizes the Microsoft cryptographic libraries which in turn are governed by system-level FIPS settings (see [Microsoft's website](https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/system-cryptography-use-fips-compliant-algorithms-for-encryption-hashing-and-signing)). Similarly, the hardware token that is used for signing authentication challenges is guaranteed to use FIPS compliant algorithms if the hardware key is FIPS certified; see the hardware token's manufacturer website for more information. PuTTY itself utilizes proprietary encryption and hashing one the SSH session is established which has not undergone evaluation for FIPS compliance or certification. ## Notes On Building PuTTY CAC ### Prerequisites * Visual Studio 2022 with C++ Desktop Application Development * WiX Toolset (to build the MSI files) * Windows PowerShell (to build the MSI/ZIP/Hash files) -### Visual Studio Notes -* Solution File: 'Code\windows\VS2022\putty.sln' +### Building +* Execute 'packager\build.cmd' to create build files +* Visual Studio solution files will be generated under 'build' +### Dependencies +* PuTTYImp is used to import existing FIDO resident keys. This links libfido2 statically; libfido2 and its binary dependencies are included in this repository. All other PuTTY executables have no dependencies other than those included within the Windows operating system and its associated SDKs. diff --git a/binaries/puttycac-0.76u4-installer.msi b/binaries/puttycac-0.76u4-installer.msi deleted file mode 100644 index a45b508..0000000 Binary files a/binaries/puttycac-0.76u4-installer.msi and /dev/null differ diff --git a/binaries/puttycac-0.76u4.zip b/binaries/puttycac-0.76u4.zip deleted file mode 100644 index 64d510f..0000000 Binary files a/binaries/puttycac-0.76u4.zip and /dev/null differ diff --git a/binaries/puttycac-0.77-installer.msi b/binaries/puttycac-0.77-installer.msi new file mode 100644 index 0000000..7ed45a7 Binary files /dev/null and b/binaries/puttycac-0.77-installer.msi differ diff --git a/binaries/puttycac-0.77.zip b/binaries/puttycac-0.77.zip new file mode 100644 index 0000000..6617e4d Binary files /dev/null and b/binaries/puttycac-0.77.zip differ diff --git a/binaries/puttycac-64bit-0.76u4-installer.msi b/binaries/puttycac-64bit-0.76u4-installer.msi deleted file mode 100644 index 2478f58..0000000 Binary files a/binaries/puttycac-64bit-0.76u4-installer.msi and /dev/null differ diff --git a/binaries/puttycac-64bit-0.76u4.zip b/binaries/puttycac-64bit-0.76u4.zip deleted file mode 100644 index ec962f5..0000000 Binary files a/binaries/puttycac-64bit-0.76u4.zip and /dev/null differ diff --git a/binaries/puttycac-64bit-0.77-installer.msi b/binaries/puttycac-64bit-0.77-installer.msi new file mode 100644 index 0000000..0c33ecb Binary files /dev/null and b/binaries/puttycac-64bit-0.77-installer.msi differ diff --git a/binaries/puttycac-64bit-0.77.zip b/binaries/puttycac-64bit-0.77.zip new file mode 100644 index 0000000..c6ecc35 Binary files /dev/null and b/binaries/puttycac-64bit-0.77.zip differ diff --git a/binaries/puttycac-hash.txt b/binaries/puttycac-hash.txt index e07bc08..2da6011 100644 --- a/binaries/puttycac-hash.txt +++ b/binaries/puttycac-hash.txt @@ -1,69 +1,81 @@ Algorithm Hash Path --------- ---- ---- -SHA256 810AC2574AD5A799293A91A530C7BD854C7A059B8146765F717B542D2822BB04 x64\pageant.exe -SHA256 102606D6E5139F86892E2FFBEEFD37790A7DED31C59AFD15E8AC7336F603A353 x64\plink.exe -SHA256 253087455652110E16FC5950980545E215CA23122C72E573F4BC9ED8A517EA94 x64\pscp.exe -SHA256 1C43258344EE5F8373240E74D5D073D5DFD50BC62A4700B241D47FD40FB2BB78 x64\psftp.exe -SHA256 53078EEABC833AD02E64F6A316B450EB319E24E2F00A85BF85EE171F7E29FAE1 x64\putty.exe -SHA256 F21D9E33F5840D2A827FE80847E353B0B60AD14584AD0C062B8C030816280E2E x64\puttygen.exe -SHA256 BD5D719A347777C2515178C0FF45DB6C1EEC4EC9BD452FA1DE751D0F3A981478 x64\puttytel.exe -SHA256 D0196B444AB1E1A5C17FC9D11DA0D9C7D82D9505E690AE1941FACC91540D937C x86\pageant.exe -SHA256 ED6D7EFF07B67B2A9E6DEDE5C6B23AAF7C1628C5FBB51848CE257739F3EAD10A x86\plink.exe -SHA256 4676E86E509E83CA681B3EC5A70C72FB260DEA10FD3C2B50254E438444EEC7CC x86\pscp.exe -SHA256 7386AC28183471668D251DF171E8548E37A5121F04E244576C7DBF22A87DF571 x86\psftp.exe -SHA256 E6A053E0F2AE8734F1A3397B0C258DCE738B3EE801680B14DFA227945AC0CEC0 x86\putty.exe -SHA256 2535331BD97095B92AE487DCB2D6ABC268A21086FBD9795A9E0AD937EC91D6ED x86\puttygen.exe -SHA256 5FAC309CF96E11AA90D79BC0FFED50A14ACBAB80941DFD0F0AC21C7801A03E3F x86\puttytel.exe -SHA256 DC59470E07A7E54E0E24663BD9461FE685E90DC2CA816E17562F70E0892A675B puttycac-0.76u4-installer.msi -SHA256 C43961EE08F380DBED13A11E315DAC1A9B0F6119A5E581332473E49CCBE2114B puttycac-0.76u4.zip -SHA256 401BE068B9EEFDF20B298DEE3B2EF1A48E9B881049514CE7169E4EFC49D7918E puttycac-64bit-0.76u4-installer.msi -SHA256 CD4DB5A25AF46D8084905A25392497AB0066E3972C9AEE571BB7EBDD645BDD84 puttycac-64bit-0.76u4.zip +SHA256 5ED68A803D4F920434CA94875452BDBDCFCBB19139A10C5FDA934F603FC01DC9 x64\pageant.exe +SHA256 0E33651140E5D0474BBD230669E7BD1B87D25769585C66D4D452F6DD9D0DA58E x64\plink.exe +SHA256 3E9402C059D43245942A316850954C512CE31BAB65309DEF6B9EDDE63F59D2E9 x64\pscp.exe +SHA256 16F704A938046058A10EA1A66926895FC8E60A154AD847D854B26AE3F8451D44 x64\psftp.exe +SHA256 9FC2CAF775374DA67A465C90816E4AD5563DF5BFCE62F4DD941D518425B9745C x64\pterm.exe +SHA256 511C56F314B21A6B1C4AF6E4FA6BAAD7B12737F65CA52C533C32E78EAA70B975 x64\putty.exe +SHA256 911C4ADD4E825CBB20FF4E5CFECE0E1D2FA506D1684D6E15455AB4835E5E92D8 x64\puttygen.exe +SHA256 79F71A0B0DC29ACBF7F05EFFA11D8BBB79EAF3D5A8A602CA56F5732C89C58F79 x64\puttyimp.exe +SHA256 91FBD43B6ADE371D47EB1927400DA533A1DCF79FD8C26FA0D052740DD443CE8D x64\puttytel.exe +SHA256 EF253D9AE5CE86BC52598E19B5807EFF356F0A3979FAD622E62E3406C3A7557A x86\pageant.exe +SHA256 D3CB8B2FC74E3A12CB220777E6DF7EA5766C7587B0FF00B9F16627ADD38C278F x86\plink.exe +SHA256 A1C4A607E3CB350B5C855911365AD7ACA85B2135AACF9FDDB44ADC09213DF204 x86\pscp.exe +SHA256 93947E6CF2E07CF3210ACC495C04F0E8B4B0E38B1B832B8664BC9B4AAE3F1C7D x86\psftp.exe +SHA256 4B346B7B94EB7A261724FF885855F5ED912334C5EF531829FEB32F04075BD942 x86\pterm.exe +SHA256 CA3CF7652E31A2BCF8D3858814740A8688D8FF49A426CF5AD95DDE316D8B1223 x86\putty.exe +SHA256 39451F7DD2DC7C8BAD5D6597CF251D3FBE8037E7B535B0A8BE4ADD9526145585 x86\puttygen.exe +SHA256 43D4E1AA70885EBA303ACF321005A62017A4DEBB01A3E5110CDA40A4866EBFFF x86\puttyimp.exe +SHA256 C2A6E5685787B979D23DD414E9D1B5480793988072E1EDB793EC81B26060D25D x86\puttytel.exe +SHA256 E334061768E4D6C425AB9E25EF0862B317E4B88E5C3936AA627C810C83BE17C1 puttycac-0.77-installer.msi +SHA256 5C4D7EA2E1081BE0CCC3A97EA6E6D3E450D1A206FE26A7C48524DA06B097552F puttycac-0.77.zip +SHA256 0F19075A9B2F2021921D339C6EF864AA2AF51AF4378D23307E280DEB8B89135D puttycac-64bit-0.77-installer.msi +SHA256 314C3EEBF6EAB6104DA5C182D62A2D7C9ABF915140CE7610B2D40D245E2CD6A4 puttycac-64bit-0.77.zip Algorithm Hash Path --------- ---- ---- -SHA1 94D6FF56617393F0AEF9B1B4AD98E95CDF4E3EC3 x64\pageant.exe -SHA1 BE77683BFE95E26E1F8D46FF3055B62D65B54895 x64\plink.exe -SHA1 142872FE9EDFC91DE8CF39EA11B36CFED34789A1 x64\pscp.exe -SHA1 A63FCC08898E7CFD3F06565C913D6FF404E7D48E x64\psftp.exe -SHA1 16484DE617D7EB5772CC852910CB44600B2A63EB x64\putty.exe -SHA1 815E7FE11D254796635796ACF56BE1C11AD1FB1B x64\puttygen.exe -SHA1 982C366A097E64422E666FE11ACC9BA525F537E2 x64\puttytel.exe -SHA1 869434760A3CD5A9FFA62AB7D9D37B2F410BDEF3 x86\pageant.exe -SHA1 069EBBED203AC492AAB81652168A9DFFD789C48A x86\plink.exe -SHA1 0CD40B17BE62F6F33C42AEC409B1493E464CB1CC x86\pscp.exe -SHA1 38E66A6530B37C223E694B671D7C4B3C253CE94F x86\psftp.exe -SHA1 D04446283E31CB5C9FACCA3DBF2C9D2A85160720 x86\putty.exe -SHA1 4855453518D4CC1398553B71F95937BD22F6AC17 x86\puttygen.exe -SHA1 C97FFA3992D041B82232D3E82654C8969C2DAE15 x86\puttytel.exe -SHA1 FC973F0B2E1F72CB58E4857E2A0BD66625E8FEE8 puttycac-0.76u4-installer.msi -SHA1 C0D6B345458782075EEB55652CDA9688A000D16E puttycac-0.76u4.zip -SHA1 3DFCE37F5F6AD6474EAF08D3A22F6337192246B7 puttycac-64bit-0.76u4-installer.msi -SHA1 C08D5E69C331D84E66DE5C8435CB0F7B625A0093 puttycac-64bit-0.76u4.zip +SHA1 ED5232F86DB1F1A27D382034730F0A79A80BA209 x64\pageant.exe +SHA1 E4B517C74A10B8A9BDD990AA7DEF9DB7CBE131F7 x64\plink.exe +SHA1 6962D5EECA8F012C78EBF164A78ADECC71D2750E x64\pscp.exe +SHA1 30E5BA67493E134299B68B669EF0BC2F00B6D7AE x64\psftp.exe +SHA1 5C45D65AFE65AB57D56AFA79C89F57284EE09F2D x64\pterm.exe +SHA1 96DE1E301A8739C1F4009211F0027160BBF288BD x64\putty.exe +SHA1 13DD738E72E463FEBF60684D09D4BF9B5338D484 x64\puttygen.exe +SHA1 55B77A9A04C965AAD460F34AFE46BA231FF7B59D x64\puttyimp.exe +SHA1 5B31E6777F3CEC21130866DEFE35F98B095A2A51 x64\puttytel.exe +SHA1 D61BD4826EC40E4635BD868F5CECC2869CBB9789 x86\pageant.exe +SHA1 93712C208BB7E831C7986561867C9DA47DB00C46 x86\plink.exe +SHA1 054C8F1300D5EBB02406E9687D7D2C4D71E752CB x86\pscp.exe +SHA1 2C02CDF40105810E7349A92B70105327F9EEFDDE x86\psftp.exe +SHA1 66C756BAA3E677BFA5BDB1C5789493E5E3AB2C73 x86\pterm.exe +SHA1 776E356B5DDED8FB11BCCC0F2877B22505145166 x86\putty.exe +SHA1 1B23CBEB90F282048928571063966B3846B61A05 x86\puttygen.exe +SHA1 A54CB6BC7F743A60D511718FE653FE9F282BECC8 x86\puttyimp.exe +SHA1 C851B82956FB122622667B07A59919B4CBF4842B x86\puttytel.exe +SHA1 F9FF4D2AA267A32C67F2C3EB15F49C05DF991A86 puttycac-0.77-installer.msi +SHA1 BB5E6B74D609DD657BAB06186F3ED5810BEE671C puttycac-0.77.zip +SHA1 7A68DDCCDD6A8D30FC2A769EA47F7634D6D3BB40 puttycac-64bit-0.77-installer.msi +SHA1 A5F081F049A7F473D9018790164BBB50231E9872 puttycac-64bit-0.77.zip Algorithm Hash Path --------- ---- ---- -MD5 A071EBE267B9E37BF8BA9311467058A4 x64\pageant.exe -MD5 D8E9B5687D6BEBC92A2AE9F086D9BF45 x64\plink.exe -MD5 237E0A70A882187E1BCA19FE616A850D x64\pscp.exe -MD5 6B700FA6EC97B19CEE276476CFB62A0E x64\psftp.exe -MD5 3772794AE4948298549437E56F0EF6B3 x64\putty.exe -MD5 53F2AD53D3C7BA8851247BC49300BB82 x64\puttygen.exe -MD5 D04FF295D65262548AA0E68892E62AF0 x64\puttytel.exe -MD5 2FB16B2CE289CAF59A116BECCDECE1DF x86\pageant.exe -MD5 69DA19485709EC5DD7F075E34FDDF437 x86\plink.exe -MD5 FBAC6B64DF12D5F9164071BC656F9C90 x86\pscp.exe -MD5 E1A4B9D1E386CF68B5D203D8223A747F x86\psftp.exe -MD5 45D15165C805F7C49497F501AFB3EBD1 x86\putty.exe -MD5 54209F5CA2B961D27976B5952B675F3B x86\puttygen.exe -MD5 1EBE2013FEFA9D15ACA3BF8629B2E64B x86\puttytel.exe -MD5 1130B3C2ABCC1562A9F3D9C521410F09 puttycac-0.76u4-installer.msi -MD5 B90F2745D14A6728AB3DC0D00FB349A6 puttycac-0.76u4.zip -MD5 FA278133D2F99262023BBB5733CA2843 puttycac-64bit-0.76u4-installer.msi -MD5 7E9B263E50A101BED77034EEB930243B puttycac-64bit-0.76u4.zip +MD5 BD9AA0CEF8538E4660B58A6560BC3B11 x64\pageant.exe +MD5 C58AB3362172B9C9849AB3DD40C07122 x64\plink.exe +MD5 B5ACA78EBC4E708428AE7361BFE48FCF x64\pscp.exe +MD5 CA629AD2D8D0757351CF088FA1D01092 x64\psftp.exe +MD5 961E7E1A672DE4F4C964AA6BAC83C38D x64\pterm.exe +MD5 32ADD98D0E1A951A90A607C819B57D08 x64\putty.exe +MD5 0FCC46A6521DBEDAFC2F9CC4857DE048 x64\puttygen.exe +MD5 176E50EA37EFBB7AF50909CBD32BD5A2 x64\puttyimp.exe +MD5 DD456AEFAC3F115F01564F6EA2250511 x64\puttytel.exe +MD5 419BF7B46A973B94D52AB3FC4776D862 x86\pageant.exe +MD5 473E377FCCF4ABCC2136798B96DCD876 x86\plink.exe +MD5 1B433982928CAEA91C08C4649B462868 x86\pscp.exe +MD5 EAB48AE5743B6E35A936B116230B7A10 x86\psftp.exe +MD5 6B01C6D77F5808ADDACB1EF9EE0F8C84 x86\pterm.exe +MD5 A04DC1C3FF22611B6A3E1A7FB7D97083 x86\putty.exe +MD5 67B90B53FAE2B8E14A227E292066C706 x86\puttygen.exe +MD5 ED630F4D70B6B5A7CD964C28D43B653F x86\puttyimp.exe +MD5 5E246DE08870900A0255BC08A4C88337 x86\puttytel.exe +MD5 53077F59C66578BABBE54FB8054F2774 puttycac-0.77-installer.msi +MD5 EF08704BFC839363675F986AD1B13457 puttycac-0.77.zip +MD5 EB9B777047CB6C0E773EC20EA3A1D4FE puttycac-64bit-0.77-installer.msi +MD5 426432458D136DC182D3029FFEE4C03E puttycac-64bit-0.77.zip diff --git a/binaries/x64/pageant.exe b/binaries/x64/pageant.exe index f71441e..62bad9a 100644 Binary files a/binaries/x64/pageant.exe and b/binaries/x64/pageant.exe differ diff --git a/binaries/x64/plink.exe b/binaries/x64/plink.exe index a650c34..56ff200 100644 Binary files a/binaries/x64/plink.exe and b/binaries/x64/plink.exe differ diff --git a/binaries/x64/pscp.exe b/binaries/x64/pscp.exe index ec35e29..0247eae 100644 Binary files a/binaries/x64/pscp.exe and b/binaries/x64/pscp.exe differ diff --git a/binaries/x64/psftp.exe b/binaries/x64/psftp.exe index 9a63648..0454731 100644 Binary files a/binaries/x64/psftp.exe and b/binaries/x64/psftp.exe differ diff --git a/binaries/x64/pterm.exe b/binaries/x64/pterm.exe new file mode 100644 index 0000000..99fdb06 Binary files /dev/null and b/binaries/x64/pterm.exe differ diff --git a/binaries/x64/putty.exe b/binaries/x64/putty.exe index 83744af..27892f3 100644 Binary files a/binaries/x64/putty.exe and b/binaries/x64/putty.exe differ diff --git a/binaries/x64/puttygen.exe b/binaries/x64/puttygen.exe index eb352ce..8b21ee4 100644 Binary files a/binaries/x64/puttygen.exe and b/binaries/x64/puttygen.exe differ diff --git a/binaries/x64/puttyimp.exe b/binaries/x64/puttyimp.exe new file mode 100644 index 0000000..a80a81a Binary files /dev/null and b/binaries/x64/puttyimp.exe differ diff --git a/binaries/x64/puttytel.exe b/binaries/x64/puttytel.exe index 7919b65..be9f432 100644 Binary files a/binaries/x64/puttytel.exe and b/binaries/x64/puttytel.exe differ diff --git a/binaries/x86/pageant.exe b/binaries/x86/pageant.exe index 4fc3382..7137357 100644 Binary files a/binaries/x86/pageant.exe and b/binaries/x86/pageant.exe differ diff --git a/binaries/x86/plink.exe b/binaries/x86/plink.exe index 63c745f..1123ecd 100644 Binary files a/binaries/x86/plink.exe and b/binaries/x86/plink.exe differ diff --git a/binaries/x86/pscp.exe b/binaries/x86/pscp.exe index af54659..b496c6c 100644 Binary files a/binaries/x86/pscp.exe and b/binaries/x86/pscp.exe differ diff --git a/binaries/x86/psftp.exe b/binaries/x86/psftp.exe index 6594124..b39df93 100644 Binary files a/binaries/x86/psftp.exe and b/binaries/x86/psftp.exe differ diff --git a/binaries/x86/pterm.exe b/binaries/x86/pterm.exe new file mode 100644 index 0000000..51600d6 Binary files /dev/null and b/binaries/x86/pterm.exe differ diff --git a/binaries/x86/putty.exe b/binaries/x86/putty.exe index b74a90e..44369b5 100644 Binary files a/binaries/x86/putty.exe and b/binaries/x86/putty.exe differ diff --git a/binaries/x86/puttygen.exe b/binaries/x86/puttygen.exe index a8022fe..0895a04 100644 Binary files a/binaries/x86/puttygen.exe and b/binaries/x86/puttygen.exe differ diff --git a/binaries/x86/puttyimp.exe b/binaries/x86/puttyimp.exe new file mode 100644 index 0000000..e5ff2d7 Binary files /dev/null and b/binaries/x86/puttyimp.exe differ diff --git a/binaries/x86/puttytel.exe b/binaries/x86/puttytel.exe index dfff4a3..32173f0 100644 Binary files a/binaries/x86/puttytel.exe and b/binaries/x86/puttytel.exe differ diff --git a/code/.gitignore b/code/.gitignore index 92b7c10..02f4302 100644 --- a/code/.gitignore +++ b/code/.gitignore @@ -1,5 +1,17 @@ *.o *.pyc +*.vcxproj +*.vcxproj.filters +.ninja_deps +.ninja_log +build.ninja +/CMakeCache.txt +CMakeFiles/ +Debug/ +Win32/ +cmake_install.cmake +/shipped.txt +*.dir/ .dirstamp .deps .DS_Store @@ -16,12 +28,10 @@ /*.dsw /*.opt /*.dsp +/*.sln /*.tds /*.td2 /*.map -/Makefile.mgw -/Makefile.vc -/Makefile.lcc /MSVC /*.log /*.GID @@ -49,6 +59,9 @@ /testzlib /cgtest /scctest +/test_host_strfoo +/test_tree234 +/test_wildcard /*.DSA /*.RSA /*.cnt @@ -56,28 +69,10 @@ /.bmake /build.log /build.out -/uxconfig.h /empty.h -/config.status -/Makefile.am -/Makefile.in -/Makefile +Makefile /compile -/config.status -/configure -/stamp-h1 -/aclocal.m4 -/ar-lib -/autom4te.cache -/depcomp -/install-sh -/local -/missing -/uxconfig.in -/uxconfig.in~ -/uxconfig.h -/licence.h -/*.a +*.a /charset/sbcsdat.c /contrib/cygtermd/cygtermd.exe /doc/*.html @@ -86,7 +81,6 @@ /doc/*.hlp /doc/*.gid /doc/*.GID -/doc/*.chm /doc/*.log /doc/*.1 /doc/*.info @@ -102,9 +96,6 @@ /icons/*.icns /icons/*.xpm /icons/*.c -/unix/Makefile.gtk -/unix/Makefile.ux -/unix/Makefile.local /unix/empty.h /unix/plink /unix/pterm @@ -133,14 +124,6 @@ /windows/*.td2 /windows/*.map /windows/*.rcpp -/windows/Makefile.clangcl -/windows/Makefile.mgw -/windows/Makefile.vc -/windows/Makefile.lcc -/windows/MSVC -/windows/DEVCPP -/windows/VS2010 -/windows/VS2012 /windows/*.log /windows/*.GID /windows/local diff --git a/code/Buildscr b/code/Buildscr index f7556f7..bd3aad2 100644 --- a/code/Buildscr +++ b/code/Buildscr @@ -35,7 +35,7 @@ module putty ifeq "$(RELEASE)" "" set Ndate $(!builddate) ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -pe 's/(....)(..)(..)/$$1-$$2-$$3/' > date ifneq "$(Ndate)" "" read Date date -set Epoch 17818 # update this at every release +set Epoch 18136 # update this at every release ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -ne 'use Time::Local; /(....)(..)(..)/ and print timegm(0,0,0,$$3,$$2-1,$$1) / 86400 - $(Epoch)' > days ifneq "$(Ndate)" "" read Days days @@ -55,7 +55,7 @@ ifneq "$(SNAPSHOT)" "" set Puttytextver PuTTY development snapshot $(Date).$(vcs ifneq "$(SNAPSHOT)" "" set Textver Development snapshot $(Date).$(vcsid) ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Puttytextver PuTTY custom build $(Date).$(vcsid) ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Textver Custom build $(Date).$(vcsid) -set Docmakever VERSION="$(Puttytextver)" +in putty/doc do echo "\\versionid $(Puttytextver)" > version.but # Set up the version string for use in the SSH connection greeting. # @@ -74,12 +74,6 @@ ifneq "$(PRERELEASE)" "" set Uxarcsuffix -$(PRERELEASE)~pre$(Ndate).$(vcsid) ifneq "$(SNAPSHOT)" "" set Uxarcsuffix -$(Lastver)-$(Date).$(vcsid) ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Uxarcsuffix -custom-$(Date).$(vcsid) -# Set up the version number for the autoconf system. -ifneq "$(RELEASE)" "" set Autoconfver $(RELEASE) -ifneq "$(PRERELEASE)" "" set Autoconfver $(PRERELEASE)~pre$(Ndate).$(vcsid) -ifneq "$(SNAPSHOT)" "" set Autoconfver $(Lastver)-$(Date).$(vcsid) -ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Autoconfver Custom.$(Date).$(vcsid) - # Set up the filenames for the Windows installers (minus extension, # which goes on later). ifneq "$(RELEASE)" "" set Isuffix $(RELEASE)-installer @@ -122,31 +116,44 @@ ifneq "$(SNAPSHOT)" "" in putty do echo '$#define SNAPSHOT' >> version.h in putty do echo '$#define TEXTVER "$(Textver)"' >> version.h in putty do echo '$#define SSHVER "$(Sshver)"' >> version.h in putty do echo '$#define BINARY_VERSION $(Winvercommas)' >> version.h -in putty do echo '$#define SOURCE_COMMIT "$(vcsfullid)"' >> version.h -# Set up the extra arguments for the main Windows nmake command. The -# user can define XFLAGS and MAKEARGS on the bob command line, to pass -# in extra compile and make options respectively (e.g. to do a -# debugging or Minefield build). -set Makeargs -ifneq "$(XFLAGS)" "" set Makeargs $(Makeargs) XFLAGS="$(XFLAGS)" -ifneq "$(MAKEARGS)" "" set Makeargs $(Makeargs) $(MAKEARGS) +# In cmake/gitcommit.cmake, replace the default output "unavailable" +# with the commit string generated by bob, so that people rebuilding +# the source archive will still get a useful value. +in putty do sed -i '/set(DEFAULT_COMMIT/s/unavailable/$(vcsfullid)/' cmake/gitcommit.cmake + +in . do mkdir docbuild +in docbuild do cmake ../putty/doc +in docbuild do make -j$(nproc) VERBOSE=1 +in putty/doc do cp ../../docbuild/*.1 . +in putty/doc do cp ../../docbuild/puttydoc.txt . +in putty/doc do cp ../../docbuild/putty.chm . +in putty/doc do cp -r ../../docbuild/html . in putty do ./mksrcarc.sh -in putty do ./mkunxarc.sh '$(Autoconfver)' '$(Uxarcsuffix)' $(Docmakever) -in putty do perl mkfiles.pl -in putty/doc do make $(Docmakever) putty.chm -j$(nproc) +in putty do ./mkunxarc.sh '$(Uxarcsuffix)' delegate - # Run the test suite, under self-delegation so that we don't leave any # cruft lying around. This involves doing a build of the Unix tools # (which is a useful double-check anyway to pick up any build failures) -in putty do ./mkauto.sh -in putty do ./configure CC=clang CFLAGS="-fsanitize=address -fsanitize=leak" -in putty do make -j$(nproc) +in putty do cmake . -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS="-fsanitize=address -fsanitize=leak" -DSTRICT=ON +in putty do make -j$(nproc) VERBOSE=1 in putty do python3 test/cryptsuite.py enddelegate +delegate - +# Also, test-build the Windows tools using MinGW. This is important if +# we want the MinGW build to carry on working, partly because of the +# chance of compiler compatibility issues, but mostly because MinGW's +# linker uses Unix-style library search semantics (once down the +# library list), and no other Windows toolchain we build with is that +# picky. So this ensures the Windows library structure continues to +# work in the most difficult circumstance we expect it to encounter. +in putty do cmake . -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw.cmake +in putty do make -j$(nproc) VERBOSE=1 +enddelegate + # Windowsify LICENCE, since it's going in the Windows installers. in putty do perl -i~ -pe 'y/\015//d;s/$$/\015/' LICENCE @@ -165,20 +172,20 @@ mkdir putty/windows/abuild64 # # For the 32-bit ones, we set a subsystem version of 5.01, which # allows the resulting files to still run on Windows XP. -in putty/windows with clangcl32 do Platform=x86 make -f Makefile.clangcl BUILDDIR=build32/ SUBSYSVER=,5.01 $(Makeargs) all -j$(nproc) -in putty/windows with clangcl64 do Platform=x64 make -f Makefile.clangcl BUILDDIR=build64/ $(Makeargs) all -j$(nproc) +in putty/windows/build32 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl32) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" +in putty/windows/build32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 +in putty/windows/build64 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl64) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" +in putty/windows/build64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 # Build experimental Arm Windows binaries. -in putty/windows with clangcl_a32 do Platform=arm make -f Makefile.clangcl BUILDDIR=abuild32/ SUBSYSVER=,5.01 $(Makeargs) all -j$(nproc) -in putty/windows with clangcl_a64 do Platform=arm64 make -f Makefile.clangcl BUILDDIR=abuild64/ $(Makeargs) all -j$(nproc) +in putty/windows/abuild32 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl_a32) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" +in putty/windows/abuild32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 +in putty/windows/abuild64 with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl_a64) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON -DCMAKE_C_FLAGS_RELEASE="/MT /O2" +in putty/windows/abuild64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 -# Remove Windows binaries for the test programs we don't want to ship, -# like testcrypt.exe. (But we still _built_ them, to ensure the build -# worked.) -in putty/windows do make -f Makefile.clangcl BUILDDIR=build32/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=build64/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=abuild32/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=abuild64/ cleantestprogs +# Make a list of the Windows binaries we're going to ship, so that we +# can sign them. +in putty/windows do for subdir in build32 abuild32 build64 abuild64; do sed "s!^!$$subdir/!" $$subdir/shipped.txt; done > to-sign.txt # Code-sign the Windows binaries, if the local bob config provides a # script to do so in a cross-compiling way. We assume here that the @@ -187,17 +194,17 @@ in putty/windows do make -f Makefile.clangcl BUILDDIR=abuild64/ cleantestprogs # take the program name from an .exe's version resource, and that it # can accept multiple .exe or .msi filename arguments and sign them # all in place. -ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ build*/*.exe abuild*/*.exe +ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ $$(cat to-sign.txt) # Make a preliminary set of cryptographic checksums giving the hashes # of these versions of the binaries. We'll make the rest below. in putty do for hash in md5 sha1 sha256 sha512; do for dir_plat in "build32 w32" "build64 w64" "abuild32 wa32" "abuild64 wa64"; do set -- $$dir_plat; (cd windows/$$1 && $${hash}sum *.exe | sed 's!\( \+\)!\1'$$2'/!;s!$$! (installer version)!') >> $${hash}sums.installer; done; done # Build a WiX MSI installer, for each build flavour. -in putty/windows with wixonlinux do candle -arch x86 -dRealPlatform=x86 -dDllOk=yes -dBuilddir=build32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer32.msi -spdb -in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=x64 -dDllOk=yes -dBuilddir=build64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer64.msi -spdb -in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=Arm -dDllOk=no -dBuilddir=abuild32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera32.msi -spdb -in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=Arm64 -dDllOk=no -dBuilddir=abuild64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera64.msi -spdb +in putty/windows with wixonlinux do candle -arch x86 -dRealPlatform=x86 -dDllOk=yes -dBuilddir=build32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer32.msi -spdb +in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=x64 -dDllOk=yes -dBuilddir=build64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installer64.msi -spdb +in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=Arm -dDllOk=no -dBuilddir=abuild32/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera32.msi -spdb +in putty/windows with wixonlinux do candle -arch x64 -dRealPlatform=Arm64 -dDllOk=no -dBuilddir=abuild64/ -dWinver="$(Winver)" -dPuttytextver="$(Puttytextver)" -dHelpFilePath="../../docbuild/putty.chm" installer.wxs && light -ext WixUIExtension -ext WixUtilExtension -sval installer.wixobj -o installera64.msi -spdb # Change the width field for our dialog background image so that it # doesn't stretch across the whole dialog. (WiX's default one does; we @@ -217,19 +224,16 @@ in putty/windows do ./msifixup.py installera64.msi --dialog-bmp-width=123 --plat # Sign the Windows installers. ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ -n "PuTTY Installer" installer32.msi installer64.msi installera32.msi installera64.msi -# Delete the binaries and resource files from the build directories, -# so that we can rebuild them differently. -in putty/windows/build32 do rm -f *.exe *.res *.rcpp -in putty/windows/build64 do rm -f *.exe *.res *.rcpp -in putty/windows/abuild32 do rm -f *.exe *.res *.rcpp -in putty/windows/abuild64 do rm -f *.exe *.res *.rcpp - # Build the standalone binaries, in both 32- and 64-bit flavours. # These differ from the previous set in that they embed the help file. -in putty/windows with clangcl32 do Platform=x86 make -f Makefile.clangcl BUILDDIR=build32/ RCFL=-DEMBED_CHM SUBSYSVER=,5.01 $(Makeargs) all -j$(nproc) -in putty/windows with clangcl64 do Platform=x64 make -f Makefile.clangcl BUILDDIR=build64/ RCFL=-DEMBED_CHM $(Makeargs) all -j$(nproc) -in putty/windows with clangcl_a32 do Platform=arm make -f Makefile.clangcl BUILDDIR=abuild32/ RCFL=-DEMBED_CHM SUBSYSVER=,5.01 $(Makeargs) all -j$(nproc) -in putty/windows with clangcl_a64 do Platform=arm64 make -f Makefile.clangcl BUILDDIR=abuild64/ RCFL=-DEMBED_CHM $(Makeargs) all -j$(nproc) +in putty/windows/build32 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm) +in putty/windows/build32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 +in putty/windows/build64 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm) +in putty/windows/build64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 +in putty/windows/abuild32 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm) +in putty/windows/abuild32 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 +in putty/windows/abuild64 with cmake_at_least_3.20 do cmake . -DPUTTY_EMBEDDED_CHM_FILE=$$(realpath ../../../docbuild/putty.chm) +in putty/windows/abuild64 with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 # Build the 'old' binaries, which should still run on all 32-bit # versions of Windows back to Win95 (but not Win32s). These link @@ -241,55 +245,56 @@ in putty/windows with clangcl_a64 do Platform=arm64 make -f Makefile.clangcl BUI # # There's no installer to go with these, so they must also embed the # help file. -in putty/windows with clangcl32_2003 do Platform=x86 make -f Makefile.clangcl BUILDDIR=buildold/ RCFL=-DEMBED_CHM $(Makeargs) CCTARGET=i386-pc-windows-msvc13.0.0 SUBSYSVER=,4.0 EXTRA_windows=wincrt0.obj EXTRA_console=crt0.obj EXTRA_libs=libcpmt.lib XFLAGS="/arch:IA32 -Wno-pragma-pack" all -j$(nproc) +in putty/windows/buildold with cmake_at_least_3.20 do cmake ../.. -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl32_2003) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPUTTY_LINK_MAPS=ON +in putty/windows/buildold with cmake_at_least_3.20 do make -j$(nproc) VERBOSE=1 -# Remove test programs again. -in putty/windows do make -f Makefile.clangcl BUILDDIR=build32/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=build64/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=abuild32/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=abuild64/ cleantestprogs -in putty/windows do make -f Makefile.clangcl BUILDDIR=buildold/ cleantestprogs +# Regenerate to-sign.txt with the 'old' binaries included. +in putty/windows do for subdir in build32 abuild32 build64 abuild64 buildold; do sed "s!^!$$subdir/!" $$subdir/shipped.txt; done > to-sign.txt # Code-sign the standalone versions of the binaries. -ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ build*/*.exe abuild*/*.exe +ifneq "$(cross_winsigncode)" "" in putty/windows do $(cross_winsigncode) -N -i https://www.chiark.greenend.org.uk/~sgtatham/putty/ $$(cat to-sign.txt) + +# Move the shipped (and signed) binaries into another directory to +# deliver them from, so that we omit testcrypt and its ilk. +in putty/windows do mkdir deliver +in putty/windows do for subdir in build32 abuild32 build64 abuild64 buildold; do mkdir deliver/$$subdir; done +in putty/windows do while read x; do mv $$x deliver/$$x; mv $$x.map deliver/$$x.map; done < to-sign.txt -in putty/doc do make mostlyclean -in putty/doc do make $(Docmakever) -j$(nproc) -in putty/windows/buildold do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../../doc/putty.chm -in putty/windows/build32 do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../../doc/putty.chm -in putty/windows/build64 do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../../doc/putty.chm -in putty/windows/abuild32 do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../../doc/putty.chm -in putty/windows/abuild64 do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../../doc/putty.chm -in putty/doc do zip puttydoc.zip *.html +in putty/windows/deliver/buildold do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm +in putty/windows/deliver/build32 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm +in putty/windows/deliver/build64 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm +in putty/windows/deliver/abuild32 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm +in putty/windows/deliver/abuild64 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm +in docbuild/html do zip puttydoc.zip *.html # Deliver the actual PuTTY release directory into a subdir `putty'. -deliver putty/windows/buildold/*.exe putty/w32old/$@ -deliver putty/windows/buildold/putty.zip putty/w32old/$@ -deliver putty/windows/build32/*.exe putty/w32/$@ -deliver putty/windows/build32/putty.zip putty/w32/$@ -deliver putty/windows/build64/*.exe putty/w64/$@ -deliver putty/windows/build64/putty.zip putty/w64/$@ +deliver putty/windows/deliver/buildold/*.exe putty/w32old/$@ +deliver putty/windows/deliver/buildold/putty.zip putty/w32old/$@ +deliver putty/windows/deliver/build32/*.exe putty/w32/$@ +deliver putty/windows/deliver/build32/putty.zip putty/w32/$@ +deliver putty/windows/deliver/build64/*.exe putty/w64/$@ +deliver putty/windows/deliver/build64/putty.zip putty/w64/$@ deliver putty/windows/installer32.msi putty/w32/$(Ifilename32).msi deliver putty/windows/installer64.msi putty/w64/$(Ifilename64).msi deliver putty/windows/installera32.msi putty/wa32/$(Ifilenamea32).msi deliver putty/windows/installera64.msi putty/wa64/$(Ifilenamea64).msi -deliver putty/windows/abuild32/*.exe putty/wa32/$@ -deliver putty/windows/abuild32/putty.zip putty/wa32/$@ -deliver putty/windows/abuild64/*.exe putty/wa64/$@ -deliver putty/windows/abuild64/putty.zip putty/wa64/$@ -deliver putty/doc/puttydoc.zip putty/$@ -deliver putty/doc/putty.chm putty/$@ -deliver putty/doc/puttydoc.txt putty/$@ -deliver putty/doc/*.html putty/htmldoc/$@ +deliver putty/windows/deliver/abuild32/*.exe putty/wa32/$@ +deliver putty/windows/deliver/abuild32/putty.zip putty/wa32/$@ +deliver putty/windows/deliver/abuild64/*.exe putty/wa64/$@ +deliver putty/windows/deliver/abuild64/putty.zip putty/wa64/$@ +deliver docbuild/html/puttydoc.zip putty/$@ +deliver docbuild/putty.chm putty/$@ +deliver docbuild/puttydoc.txt putty/$@ +deliver docbuild/html/*.html putty/htmldoc/$@ deliver putty/putty-src.zip putty/$@ deliver putty/*.tar.gz putty/$@ # Deliver the map files alongside the `proper' release deliverables. -deliver putty/windows/buildold/*.map maps/w32old/$@ -deliver putty/windows/build32/*.map maps/w32/$@ -deliver putty/windows/build64/*.map maps/w64/$@ -deliver putty/windows/abuild32/*.map maps/wa32/$@ -deliver putty/windows/abuild64/*.map maps/wa64/$@ +deliver putty/windows/deliver/buildold/*.map maps/w32old/$@ +deliver putty/windows/deliver/build32/*.map maps/w32/$@ +deliver putty/windows/deliver/build64/*.map maps/w64/$@ +deliver putty/windows/deliver/abuild32/*.map maps/wa32/$@ +deliver putty/windows/deliver/abuild64/*.map maps/wa64/$@ # Deliver sign.sh, so that whoever has just built PuTTY (the # snapshot scripts or me, depending) can conveniently sign it with diff --git a/code/Buildscr.cv b/code/Buildscr.cv index fab61dc..ab3107f 100644 --- a/code/Buildscr.cv +++ b/code/Buildscr.cv @@ -6,16 +6,12 @@ module putty -# Preparations. -in putty do ./mkfiles.pl -in putty do ./mkauto.sh -in putty/doc do make - # Scan the Unix build, on a 64-bit system to differentiate as much as # possible from the other scan of the cross-platform files. delegate covscan64 - in putty do ./configure - in putty do cov-build --dir cov-int make + in putty do mkdir linbuild + in putty/linbuild do cmake .. + in putty/linbuild do cov-build --dir ../cov-int make -j$(nproc) VERBOSE=1 in putty do tar czvf cov-int.tar.gz cov-int return putty/cov-int.tar.gz enddelegate @@ -25,7 +21,9 @@ enddelegate # Windows scanner for download). delegate covscan32wine in putty do tar xzvf cov-int.tar.gz - in putty/windows do cov-build --dir ../cov-int make -f Makefile.mgw CC=winegcc RC=wrc + in putty do mkdir winbuild + in putty/winbuild do cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-winegcc.cmake + in putty/winbuild do cov-build --dir ../cov-int make -j$(nproc) VERBOSE=1 in putty do tar czvf cov-int.tar.gz cov-int return putty/cov-int.tar.gz enddelegate diff --git a/code/CHECKLST.txt b/code/CHECKLST.txt deleted file mode 100644 index 5e9a7a0..0000000 --- a/code/CHECKLST.txt +++ /dev/null @@ -1,233 +0,0 @@ -Checklists for PuTTY administrative procedures -============================================== - -Going into pre-release stabilisation ------------------------------------- - -When we begin to work towards a release and want to enable -pre-releases on the website: - - - Make a branch whose tip will be the current state of the - pre-release. Regardless of whether the branch is from master or - from a prior release branch, the name of the branch must now be in - the form 'pre-X.YZ', or else the website will fail to link to it - properly in gitweb and the build script will check out the wrong - thing. - - - Edit ~/adm/puttysnap.sh on my build machine to set $prerelver correctly. - - - Edit ~/adm/puttysnap.sh on the master machine to enable pre-release - builds, by changing the 'if false' to 'if true'. - - - Put the website into pre-release mode, by defining prerel_version() - in components/Base.mc to return the upcoming version number. Also - add a news announcement in components/news. (Previous naming - convention has been to name it in the form 'X.YZ-pre.mi'.) - -Things to do during the branch-stabilisation period: - - - Go through the source (including the documentation), and the - website, and review anything tagged with a comment containing the - word XXX-REVIEW-BEFORE-RELEASE. (Any such comments should state - clearly what needs to be done.) - - - Do some testing of the Windows version with Minefield (you can - build a Minefield version using 'bob . XFLAGS=-DMINEFIELD'), and of - the Unix version with valgrind and/or Address Sanitiser. In - particular, any headline features for the release should get a - workout with memory checking enabled! - -Making a release candidate build --------------------------------- - - - Make a directory to hold all the release paraphernalia. I usually - call it ~/src/putty/X.YZ (where X.YZ will stand throughout for the - version number). - - - Inside that directory, clone the PuTTY git repository to a - subdirectory ~/src/putty/X.YZ/putty. Here you can make release- - related commits and tags tentatively, and keep them out of the way - of any 'git push' you might still be doing in other checkouts. - - - Double-check that we have removed anything tagged with a comment - containing the words XXX-REMOVE-BEFORE-RELEASE or - XXX-REVIEW-BEFORE-RELEASE. ('git grep XXX-RE' should only show up - hits in this file itself.) - - - Now update the version numbers and the transcripts in the docs, by - checking out the release branch in the release-specific checkout - and running - - ./release.pl --version=X.YZ --setver - - Then check that the resulting automated git commit has updated the - version number in the following places: - - * putty/LATEST.VER - * putty/doc/plink.but - * putty/doc/pscp.but - - and also check that it has reset the definition of 'Epoch' in - Buildscr. - - - Make the release tag, pointing at the version-update commit we just - generated. - - - If the release is on a branch (which I expect it generally will - be), merge that branch to master. - - - Make a release-candidate build from the release tag, and put the - build.out and build.log files somewhere safe. Normally I store - these inside the ~/src/putty/X.YZ directory, alongside the git - checkout at ~/src/putty/X.YZ/putty, so I'll sit in that checkout - directory and run a command like - - bob -o ../build-X.YZ-rcN.out -l ../build-X.YZ-rcN.log -c X.YZ . RELEASE=X.YZ - - This should generate a basically valid release directory as - `build-X.YZ-rcN.out/putty', and provide link maps and sign.sh - alongside that. - - - Double-check in build-X.YZ-rcN.log that the release was built from - the right git commit. - - - Make a preliminary gpg signature, but don't run the full release- - signing procedure. (We use the presence of a full set of GPG - signatures to distinguish _abandoned_ release candidates from the - one that ended up being the release.) In the 'build.X.YZ-rcN.out' - directory, run - sh sign.sh -r -p putty - which will generate a clearsigned file called - sha512sums-preliminary.gpg _outside_ the 'putty' subdirectory. - - - For my own safety, make the release candidate build read-only. - chmod -R a-w build-X.YZ-rcN.{out,log} - - - Now do some checking of the release binaries, and pass them to the - rest of the team to do some as well. Do at least these things: - * make sure they basically work - * check they report the right version number - * if there's any easily observable behaviour difference between - the release branch and master, arrange to observe it - * test that the Windows installer installs successfully - + on x86 and Arm, and test that putty.exe runs in both cases - * test that the Unix source tarball unpacks and builds - + on at least a reasonably current stable Linux distro, and - also try Debian sid - + test-build with all of GTK 1, 2 and 3 - + test-build with -DNOT_X_WINDOWS - * feed the release-candidate source to Coverity and make sure it - didn't turn up any last-minute problems - * make sure we have a clean run of sctest - * do some testing on a system with a completely clean slate (no - prior saved session data) - -Preparing to make the release ------------------------------ - - - Write a release announcement (basically a summary of the changes - since the last release). Check the draft version into the putty-aux - repository, so the whole team can help wordsmith it if they want to. - - - Update the website, in a local checkout: - * Write a release file in components/releases which identifies the - new version, a section for the Changes page, and a news - announcement for the front page. - + The one thing this can't yet contain is the release date; - that has to be put in at the last minute, when the release - goes live. Fill in 'FIXME', for the moment. - * Disable the pre-release sections of the website (if previously - enabled), by editing prerel_version() in components/Base.mc to - return undef. - - - Update the wishlist, in a local checkout: - * If there are any last-minute wishlist entries (e.g. security - vulnerabilities fixed in the new release), write entries for - them. - * If any other bug fixes have been cherry-picked to the release - branch (so that the wishlist mechanism can't automatically mark - them as fixed in the new release), add appropriate Fixed-in - headers for those. - - - Sign the release in full. In the `build-X.YZ-rcN.out' directory, - re-verify that the preliminary signed checksums file has a correct - signature on it and also matches the files you're about to sign for real: - - gpg -d sha512sums-preliminary.gpg | (cd putty; grep -vF ' (installer version)' | grep . | sha512sum -c) - - If the combined output of that pipeline reports both a good - signature (from the release key) and a successful verification of - all the sha512sums, then all is well and you can do the full - signing (not forgetting that the directory will have been readonly - during the last-minute testing period): - - chmod -R u+w putty - sh sign.sh -r putty # and enter the release key passphrase - chmod -R a-w putty - -The actual release procedure ----------------------------- - -Once all the above preparation is done and the release has been built -locally, this is the procedure for putting it up on the web. - - - Make a final adjustment to your local website changes, filling in - the release date in components/releases/X.YZ.mi. - - - Upload the release itself and its link maps to everywhere it needs - to be, by running this in the build-X.YZ-rcN.out directory: - ../putty/release.pl --version=X.YZ --upload - - - Check that downloads via version-numbered URLs all work: - ../putty/release.pl --version=X.YZ --precheck - If this has trouble accessing chiark's ftp server, that is - unfortunately normal; add --no-ftp and try again. - - - Switch the 'latest' links over to the new release: - * Update the HTTP redirect at the:www/putty/htaccess . - * Update the FTP symlink at chiark:ftp/putty-latest . - - - Now verify that downloads via the 'latest' URLs are all redirected - correctly and work: - ../putty/release.pl --version=X.YZ --postcheck - - - Push all the git repositories: - * run 'git push' in the website checkout - * run 'git push' in the wishlist checkout - * push from the main PuTTY checkout. Typically this one will be - pushing both the release tag and an update to the master branch, - plus removing the pre-release branch, so you'll want some - commands along these lines: - git push origin master # update the master branch - git push origin --tags # should push the new release tag - git push origin :pre-X.YZ # delete the pre-release branch - - - Run ~/adm/puttyweb.sh on thyestes to update the website after all - those git pushes. - - - Check that the unpublished website on thyestes looks sensible. - - - Run webupdate, so that all the changes on thyestes propagate to - chiark. Important to do this _before_ announcing that the release - is available. - - - After running webupdate, run update-rsync on chiark and verify that - the rsync mirror package (~/ftp/putty-website-mirror) contains a - subdirectory for the new version and that the links from its - latest.html point into that subdirectory. - - - Announce the release! - + Construct a release announcement email whose message body is the - announcement written above, and which includes the following - headers: - * Reply-To: - * Subject: PuTTY X.YZ is released - + Mail that release announcement to - . - + Post it to comp.security.ssh. - + Mention it in on mono. - - - Edit the master ~/adm/puttysnap.sh to disable pre-release builds, - if they were previously enabled. - - - Relax (slightly). diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt new file mode 100644 index 0000000..0eb4cf1 --- /dev/null +++ b/code/CMakeLists.txt @@ -0,0 +1,150 @@ +cmake_minimum_required(VERSION 3.7) +project(putty LANGUAGES C) + +include(cmake/setup.cmake) + +# Scan the docs directory first, so that when we start calling +# installed_program(), we'll know if we have man pages available +add_subdirectory(doc) + +add_compile_definitions(HAVE_CMAKE_H) + +include_directories(terminal) + +add_library(utils STATIC + ${GENERATED_COMMIT_C}) +add_dependencies(utils cmake_commit_c) +add_subdirectory(utils) + +add_library(logging OBJECT + logging.c) + +add_library(eventloop STATIC + callback.c timing.c) + +add_library(console STATIC + clicons.c console.c) + +add_library(settings STATIC + cmdline.c settings.c) + +add_library(crypto STATIC + proxy/cproxy.c proxy/sshproxy.c) +add_subdirectory(crypto) + +add_library(network STATIC + stubs/nullplug.c errsock.c logging.c x11disp.c + proxy/proxy.c + proxy/http.c + proxy/socks4.c + proxy/socks5.c + proxy/telnet.c + proxy/local.c + proxy/interactor.c) + +add_library(keygen STATIC + import.c) +add_subdirectory(keygen) + +add_library(agent STATIC + sshpubk.c pageant.c aqsync.c) + +add_library(guiterminal STATIC + terminal/terminal.c terminal/bidi.c + ldisc.c config.c dialog.c + $) + +add_library(noterminal STATIC + stubs/noterm.c ldisc.c) + +add_library(all-backends OBJECT + pinger.c) + +add_library(sftpclient STATIC + psftpcommon.c) +add_subdirectory(ssh) + +add_library(otherbackends STATIC + $ + $) +add_subdirectory(otherbackends) + +add_executable(testcrypt + test/testcrypt.c sshpubk.c ssh/crc-attack-detector.c) +target_link_libraries(testcrypt + keygen crypto utils ${platform_libraries}) + +add_executable(test_host_strfoo + utils/host_strchr_internal.c) +target_compile_definitions(test_host_strfoo PRIVATE TEST) +target_link_libraries(test_host_strfoo utils ${platform_libraries}) + +add_executable(test_decode_utf8 + utils/decode_utf8.c) +target_compile_definitions(test_decode_utf8 PRIVATE TEST) +target_link_libraries(test_decode_utf8 utils ${platform_libraries}) + +add_executable(test_tree234 + utils/tree234.c) +target_compile_definitions(test_tree234 PRIVATE TEST) +target_link_libraries(test_tree234 utils ${platform_libraries}) + +add_executable(test_wildcard + utils/wildcard.c) +target_compile_definitions(test_wildcard PRIVATE TEST) +target_link_libraries(test_wildcard utils ${platform_libraries}) + +add_executable(bidi_gettype + terminal/bidi_gettype.c) +target_link_libraries(bidi_gettype guiterminal utils ${platform_libraries}) + +add_executable(bidi_test + terminal/bidi_test.c) +target_link_libraries(bidi_test guiterminal utils ${platform_libraries}) + +add_executable(plink + ${platform}/plink.c) +# Note: if we ever port Plink to a platform where we can't implement a +# serial backend, this be_list command will need to become platform- +# dependent, so that it only sets the SERIAL option on platforms where +# that backend exists. For the moment, though, we have serial port +# backends for both our platforms, so we can do this unconditionally. +be_list(plink Plink SSH SERIAL OTHERBACKENDS) +target_link_libraries(plink + eventloop noterminal console sshclient otherbackends settings network crypto + utils + ${platform_libraries}) +installed_program(plink) + +add_executable(pscp + pscp.c) +be_list(pscp PSCP SSH) +target_link_libraries(pscp + sftpclient eventloop console sshclient settings network crypto utils + ${platform_libraries}) +installed_program(pscp) + +add_executable(psftp + psftp.c) +be_list(psftp PSFTP SSH) +target_link_libraries(psftp + sftpclient eventloop console sshclient settings network crypto utils + ${platform_libraries}) +installed_program(psftp) + +add_executable(psocks + ${platform}/psocks.c + psocks.c + stubs/norand.c + proxy/nocproxy.c + proxy/nosshproxy.c + ssh/portfwd.c) +target_link_libraries(psocks + eventloop console network utils + ${platform_libraries}) + +foreach(subdir ${platform} ${extra_dirs}) + add_subdirectory(${subdir}) +endforeach() + +configure_file(cmake/cmake.h.in ${GENERATED_SOURCES_DIR}/cmake.h) diff --git a/code/LATEST.VER b/code/LATEST.VER deleted file mode 100644 index 07b41f7..0000000 --- a/code/LATEST.VER +++ /dev/null @@ -1 +0,0 @@ -0.76 diff --git a/code/LICENCE b/code/LICENCE index 0e1df3c..ca9c670 100644 --- a/code/LICENCE +++ b/code/LICENCE @@ -1,4 +1,4 @@ -PuTTY is copyright 1997-2021 Simon Tatham. +PuTTY is copyright 1997-2022 Simon Tatham & Bryan Berns. Portions copyright Robert de Bath, Joris van Rantwijk, Delian Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, @@ -6,7 +6,7 @@ Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn, Colin Watson, Christopher Staite, Lorenz Diener, Christian Brabandt, Jeff Smith, Pavel Kryukov, Maxim Kuznetsov, Svyatoslav Kuzmich, Nico Williams, Viktor Dukhovni, Josh Dersch, Lars Brinkhoff, -and CORE SDI S.A. +Daniel Risacher, Joshua Dantzler, Bryan Berns, and CORE SDI S.A. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files diff --git a/code/Makefile.am b/code/Makefile.am deleted file mode 100644 index faa2af4..0000000 --- a/code/Makefile.am +++ /dev/null @@ -1,459 +0,0 @@ -# Makefile.am for putty under Unix with Autoconf/Automake. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. - -AUTOMAKE_OPTIONS = subdir-objects - -allsources = agentf.c aqsync.c be_all_s.c be_misc.c be_none.c be_nos_s.c \ - be_ssh.c callback.c cgtest.c charset/charset.h \ - charset/enum.c charset/fromucs.c charset/internal.h \ - charset/localenc.c charset/macenc.c charset/mimeenc.c \ - charset/sbcs.c charset/sbcsdat.c charset/slookup.c \ - charset/toucs.c charset/utf8.c charset/xenc.c clicons.c \ - cmdgen.c cmdline.c conf.c config.c console.c console.h \ - cproxy.c defs.h dialog.c dialog.h ecc.c ecc.h errsock.c \ - fuzzterm.c import.c ldisc.c ldisc.h licence.h logging.c \ - mainchan.c marshal.c marshal.h memory.c millerrabin.c \ - minibidi.c misc.c misc.h miscucs.c mpint.c mpint.h mpint_i.h \ - mpunsafe.c mpunsafe.h network.h nocmdline.c nocproxy.c \ - nogss.c norand.c noshare.c noterm.c notiming.c nullplug.c \ - pageant.c pageant.h pgssapi.c pgssapi.h pinger.c pockle.c \ - portfwd.c primecandidate.c proxy.c proxy.h pscp.c psftp.c \ - psftp.h psftpcommon.c psocks.c psocks.h putty.h puttymem.h \ - puttyps.h raw.c rlogin.c scpserver.c sesschan.c sessprep.c \ - settings.c sftp.c sftp.h sftpcommon.c sftpserver.c \ - smallprimes.c ssh.c ssh.h ssh1bpp.c ssh1censor.c \ - ssh1connection-client.c ssh1connection-server.c \ - ssh1connection.c ssh1connection.h ssh1login-server.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection-server.c \ - ssh2connection.c ssh2connection.h ssh2kex-client.c \ - ssh2kex-server.c ssh2transhk.c ssh2transport.c \ - ssh2transport.h ssh2userauth-server.c ssh2userauth.c \ - sshaes.c ssharcf.c sshargon2.c sshauxcrypt.c sshbcrypt.c \ - sshblake2.c sshblowf.c sshblowf.h sshbpp.h sshccp.c \ - sshchan.h sshcommon.c sshcr.h sshcrc.c sshcrcda.c sshdes.c \ - sshdh.c sshdss.c sshdssg.c sshecc.c sshecdsag.c sshgss.h \ - sshgssc.c sshgssc.h sshhmac.c sshkeygen.h sshmac.c sshmd5.c \ - sshppl.h sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c \ - sshrsag.c sshserver.c sshserver.h sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshsignals.h sshttymodes.h \ - sshutils.c sshverstring.c sshzlib.c storage.h stripctrl.c \ - supdup.c telnet.c terminal.c terminal.h testcrypt.c \ - testcrypt.h testsc.c testzlib.c time.c timing.c tree234.c \ - tree234.h unix/gtkapp.c unix/gtkask.c unix/gtkcfg.c \ - unix/gtkcols.c unix/gtkcols.h unix/gtkcomm.c \ - unix/gtkcompat.h unix/gtkdlg.c unix/gtkfont.c unix/gtkfont.h \ - unix/gtkmain.c unix/gtkmisc.c unix/gtkmisc.h unix/gtkwin.c \ - unix/osxlaunch.c unix/procnet.c unix/unix.h unix/ux_x11.c \ - unix/uxagentc.c unix/uxagentsock.c unix/uxcfg.c \ - unix/uxcliloop.c unix/uxcons.c unix/uxfdsock.c unix/uxgen.c \ - unix/uxgss.c unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c \ - unix/uxnoise.c unix/uxpeer.c unix/uxpgnt.c unix/uxplink.c \ - unix/uxpoll.c unix/uxprint.c unix/uxproxy.c unix/uxpsusan.c \ - unix/uxpterm.c unix/uxpty.c unix/uxputty.c unix/uxsel.c \ - unix/uxser.c unix/uxserver.c unix/uxsftp.c \ - unix/uxsftpserver.c unix/uxshare.c unix/uxsignal.c \ - unix/uxsocks.c unix/uxstore.c unix/uxucs.c unix/uxutils.c \ - unix/uxutils.h unix/x11misc.c unix/x11misc.h unix/xkeysym.c \ - unix/xpmptcfg.c unix/xpmpterm.c unix/xpmpucfg.c \ - unix/xpmputty.c utils.c version.c version.h wcwidth.c \ - wildcard.c windows/pageant-rc.h windows/pageant.rc \ - windows/plink.rc windows/pscp.rc windows/psftp.rc \ - windows/putty.rc windows/puttygen-rc.h windows/puttygen.rc \ - windows/puttytel.rc windows/rcstuff.h windows/sizetip.c \ - windows/version.rc2 windows/win_res.h windows/win_res.rc2 \ - windows/wincapi.c windows/wincapi.h windows/wincfg.c \ - windows/wincliloop.c windows/wincons.c windows/winctrls.c \ - windows/windefs.c windows/windlg.c windows/window.c \ - windows/wingss.c windows/winhandl.c windows/winhelp.c \ - windows/winhelp.h windows/winhelp.rc2 windows/winhsock.c \ - windows/winjump.c windows/winmisc.c windows/winmiscs.c \ - windows/winnet.c windows/winnohlp.c windows/winnoise.c \ - windows/winnojmp.c windows/winnpc.c windows/winnps.c \ - windows/winpgen.c windows/winpgnt.c windows/winpgntc.c \ - windows/winplink.c windows/winprint.c windows/winproxy.c \ - windows/winseat.h windows/winsecur.c windows/winsecur.h \ - windows/winselcli.c windows/winselgui.c windows/winser.c \ - windows/winsftp.c windows/winshare.c windows/winsocks.c \ - windows/winstore.c windows/winstuff.h windows/wintime.c \ - windows/winucs.c windows/winutils.c windows/winx11.c \ - x11fwd.c - -if HAVE_GTK -bin_PROGRAMS = plink pscp psftp psusan puttygen pageant pterm putty puttytel -else -bin_PROGRAMS = plink pscp psftp psusan puttygen -endif - -if HAVE_GTK -noinst_PROGRAMS = cgtest fuzzterm osxlaunch psocks testcrypt testsc testzlib \ - uppity ptermapp puttyapp -else -noinst_PROGRAMS = cgtest fuzzterm osxlaunch psocks testcrypt testsc testzlib \ - uppity -endif - -AM_CPPFLAGS = -I$(srcdir)/./ -I$(srcdir)/charset/ -I$(srcdir)/windows/ \ - -I$(srcdir)/unix/ -if HAVE_GTK -AM_CFLAGS = $(GTK_CFLAGS) $(COMPAT) $(XFLAGS) $(WARNINGOPTS) -else -AM_CFLAGS = $(COMPAT) $(XFLAGS) $(WARNINGOPTS) -endif - -libversion_a_SOURCES = version.c -libversion_a_CFLAGS = $(COMPAT) $(XFLAGS) $(WARNINGOPTS) -noinst_LIBRARIES = libversion.a - -cgtest_SOURCES = cgtest.c conf.c console.c ecc.c import.c marshal.c memory.c \ - millerrabin.c misc.c mpint.c mpunsafe.c notiming.c pockle.c \ - primecandidate.c smallprimes.c sshaes.c sshargon2.c \ - sshauxcrypt.c sshbcrypt.c sshblake2.c sshblowf.c sshdes.c \ - sshdss.c sshdssg.c sshecc.c sshecdsag.c sshhmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshsh256.c sshsh512.c sshsha.c sshsha3.c stripctrl.c time.c \ - tree234.c unix/uxcons.c unix/uxgen.c unix/uxmisc.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpoll.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c -cgtest_LDADD = libversion.a - -fuzzterm_SOURCES = be_none.c callback.c charset/fromucs.c charset/localenc.c \ - charset/macenc.c charset/mimeenc.c charset/sbcs.c \ - charset/sbcsdat.c charset/slookup.c charset/toucs.c \ - charset/utf8.c charset/xenc.c conf.c config.c dialog.c \ - fuzzterm.c logging.c marshal.c memory.c minibidi.c misc.c \ - miscucs.c settings.c stripctrl.c terminal.c time.c timing.c \ - tree234.c unix/uxcfg.c unix/uxmisc.c unix/uxnogtk.c \ - unix/uxprint.c unix/uxstore.c unix/uxucs.c utils.c wcwidth.c -fuzzterm_LDADD = libversion.a - -osxlaunch_SOURCES = unix/osxlaunch.c - -if HAVE_GTK -pageant_SOURCES = aqsync.c be_misc.c be_none.c callback.c conf.c console.c \ - ecc.c errsock.c logging.c marshal.c memory.c misc.c mpint.c \ - nocproxy.c nogss.c nullplug.c pageant.c proxy.c settings.c \ - sshaes.c sshargon2.c sshauxcrypt.c sshblake2.c sshdes.c \ - sshdss.c sshecc.c sshhmac.c sshmd5.c sshprng.c sshpubk.c \ - sshrsa.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - stripctrl.c time.c timing.c tree234.c unix/gtkask.c \ - unix/gtkmisc.c unix/ux_x11.c unix/uxagentc.c \ - unix/uxagentsock.c unix/uxcliloop.c unix/uxcons.c \ - unix/uxfdsock.c unix/uxmisc.c unix/uxnet.c unix/uxnoise.c \ - unix/uxpeer.c unix/uxpgnt.c unix/uxpoll.c unix/uxproxy.c \ - unix/uxsel.c unix/uxsignal.c unix/uxstore.c unix/uxutils.c \ - utils.c wcwidth.c x11fwd.c -pageant_LDADD = libversion.a $(GTK_LIBS) -endif - -plink_SOURCES = agentf.c aqsync.c be_all_s.c be_misc.c callback.c clicons.c \ - cmdline.c conf.c console.c cproxy.c ecc.c errsock.c ldisc.c \ - logging.c mainchan.c marshal.c memory.c misc.c mpint.c \ - noterm.c nullplug.c pgssapi.c pinger.c portfwd.c proxy.c \ - raw.c rlogin.c sessprep.c settings.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c supdup.c telnet.c time.c timing.c \ - tree234.c unix/ux_x11.c unix/uxagentc.c unix/uxcliloop.c \ - unix/uxcons.c unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c \ - unix/uxnet.c unix/uxnogtk.c unix/uxnoise.c unix/uxpeer.c \ - unix/uxplink.c unix/uxpoll.c unix/uxproxy.c unix/uxsel.c \ - unix/uxser.c unix/uxshare.c unix/uxsignal.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c wildcard.c x11fwd.c -plink_LDADD = libversion.a - -pscp_SOURCES = agentf.c aqsync.c be_misc.c be_ssh.c callback.c clicons.c \ - cmdline.c conf.c console.c cproxy.c ecc.c errsock.c \ - logging.c mainchan.c marshal.c memory.c misc.c mpint.c \ - nullplug.c pgssapi.c pinger.c portfwd.c proxy.c pscp.c \ - psftpcommon.c settings.c sftp.c sftpcommon.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c time.c timing.c tree234.c \ - unix/uxagentc.c unix/uxcliloop.c unix/uxcons.c \ - unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c unix/uxnet.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxproxy.c unix/uxsel.c unix/uxsftp.c unix/uxshare.c \ - unix/uxstore.c unix/uxutils.c utils.c wcwidth.c wildcard.c \ - x11fwd.c -pscp_LDADD = libversion.a - -psftp_SOURCES = agentf.c aqsync.c be_misc.c be_ssh.c callback.c clicons.c \ - cmdline.c conf.c console.c cproxy.c ecc.c errsock.c \ - logging.c mainchan.c marshal.c memory.c misc.c mpint.c \ - nullplug.c pgssapi.c pinger.c portfwd.c proxy.c psftp.c \ - psftpcommon.c settings.c sftp.c sftpcommon.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c time.c timing.c tree234.c \ - unix/uxagentc.c unix/uxcliloop.c unix/uxcons.c \ - unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c unix/uxnet.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxproxy.c unix/uxsel.c unix/uxsftp.c unix/uxshare.c \ - unix/uxstore.c unix/uxutils.c utils.c wcwidth.c wildcard.c \ - x11fwd.c -psftp_LDADD = libversion.a - -psocks_SOURCES = be_misc.c callback.c conf.c console.c errsock.c logging.c \ - marshal.c memory.c misc.c nocproxy.c norand.c portfwd.c \ - proxy.c psocks.c sshutils.c stripctrl.c time.c timing.c \ - tree234.c unix/uxcliloop.c unix/uxcons.c unix/uxfdsock.c \ - unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c unix/uxpeer.c \ - unix/uxpoll.c unix/uxproxy.c unix/uxsel.c unix/uxsignal.c \ - unix/uxsocks.c utils.c wcwidth.c -psocks_LDADD = libversion.a - -psusan_SOURCES = be_misc.c be_none.c callback.c conf.c cproxy.c ecc.c \ - errsock.c logging.c marshal.c memory.c millerrabin.c misc.c \ - mpint.c mpunsafe.c nogss.c nullplug.c pgssapi.c pockle.c \ - portfwd.c primecandidate.c proxy.c scpserver.c sesschan.c \ - settings.c sftpcommon.c sftpserver.c smallprimes.c ssh1bpp.c \ - ssh1censor.c ssh1connection-server.c ssh1connection.c \ - ssh1login-server.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-server.c ssh2connection.c ssh2kex-server.c \ - ssh2transhk.c ssh2transport.c ssh2userauth-server.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshserver.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - sshutils.c sshverstring.c sshzlib.c stripctrl.c time.c \ - timing.c tree234.c unix/procnet.c unix/ux_x11.c \ - unix/uxagentsock.c unix/uxcliloop.c unix/uxfdsock.c \ - unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c unix/uxnoise.c \ - unix/uxpeer.c unix/uxpoll.c unix/uxproxy.c unix/uxpsusan.c \ - unix/uxpty.c unix/uxsel.c unix/uxsftpserver.c \ - unix/uxsignal.c unix/uxstore.c unix/uxutils.c utils.c \ - wcwidth.c wildcard.c x11fwd.c -psusan_LDADD = libversion.a - -if HAVE_GTK -pterm_SOURCES = be_none.c callback.c charset/fromucs.c charset/localenc.c \ - charset/macenc.c charset/mimeenc.c charset/sbcs.c \ - charset/sbcsdat.c charset/slookup.c charset/toucs.c \ - charset/utf8.c charset/xenc.c cmdline.c conf.c config.c \ - dialog.c ldisc.c logging.c marshal.c memory.c minibidi.c \ - misc.c miscucs.c nocproxy.c nogss.c sessprep.c settings.c \ - stripctrl.c terminal.c time.c timing.c tree234.c \ - unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c \ - unix/gtkfont.c unix/gtkmain.c unix/gtkmisc.c unix/gtkwin.c \ - unix/uxcfg.c unix/uxmisc.c unix/uxprint.c unix/uxpterm.c \ - unix/uxpty.c unix/uxsel.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/x11misc.c unix/xkeysym.c unix/xpmptcfg.c \ - unix/xpmpterm.c utils.c wcwidth.c -pterm_LDADD = libversion.a $(GTK_LIBS) -endif - -if HAVE_GTK -ptermapp_SOURCES = be_none.c callback.c charset/fromucs.c charset/localenc.c \ - charset/macenc.c charset/mimeenc.c charset/sbcs.c \ - charset/sbcsdat.c charset/slookup.c charset/toucs.c \ - charset/utf8.c charset/xenc.c conf.c config.c dialog.c \ - ldisc.c logging.c marshal.c memory.c minibidi.c misc.c \ - miscucs.c nocmdline.c nocproxy.c nogss.c sessprep.c \ - settings.c stripctrl.c terminal.c time.c timing.c tree234.c \ - unix/gtkapp.c unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c \ - unix/gtkdlg.c unix/gtkfont.c unix/gtkmisc.c unix/gtkwin.c \ - unix/uxcfg.c unix/uxmisc.c unix/uxprint.c unix/uxpterm.c \ - unix/uxpty.c unix/uxsel.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/x11misc.c unix/xkeysym.c unix/xpmptcfg.c \ - unix/xpmpterm.c utils.c wcwidth.c -ptermapp_LDADD = libversion.a $(GTK_LIBS) -endif - -if HAVE_GTK -putty_SOURCES = agentf.c aqsync.c be_all_s.c be_misc.c callback.c \ - charset/fromucs.c charset/localenc.c charset/macenc.c \ - charset/mimeenc.c charset/sbcs.c charset/sbcsdat.c \ - charset/slookup.c charset/toucs.c charset/utf8.c \ - charset/xenc.c cmdline.c conf.c config.c cproxy.c dialog.c \ - ecc.c errsock.c ldisc.c logging.c mainchan.c marshal.c \ - memory.c minibidi.c misc.c miscucs.c mpint.c nullplug.c \ - pgssapi.c pinger.c portfwd.c proxy.c raw.c rlogin.c \ - sessprep.c settings.c ssh.c ssh1bpp.c ssh1censor.c \ - ssh1connection-client.c ssh1connection.c ssh1login.c \ - ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c supdup.c telnet.c terminal.c time.c \ - timing.c tree234.c unix/gtkcfg.c unix/gtkcols.c \ - unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c unix/gtkmain.c \ - unix/gtkmisc.c unix/gtkwin.c unix/ux_x11.c unix/uxagentc.c \ - unix/uxcfg.c unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c \ - unix/uxnet.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxprint.c unix/uxproxy.c unix/uxputty.c unix/uxsel.c \ - unix/uxser.c unix/uxshare.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/uxutils.c unix/x11misc.c unix/xkeysym.c \ - unix/xpmpucfg.c unix/xpmputty.c utils.c wcwidth.c wildcard.c \ - x11fwd.c -putty_LDADD = libversion.a $(GTK_LIBS) -endif - -if HAVE_GTK -puttyapp_SOURCES = agentf.c aqsync.c be_all_s.c be_misc.c callback.c \ - charset/fromucs.c charset/localenc.c charset/macenc.c \ - charset/mimeenc.c charset/sbcs.c charset/sbcsdat.c \ - charset/slookup.c charset/toucs.c charset/utf8.c \ - charset/xenc.c conf.c config.c cproxy.c dialog.c ecc.c \ - errsock.c ldisc.c logging.c mainchan.c marshal.c memory.c \ - minibidi.c misc.c miscucs.c mpint.c nocmdline.c nullplug.c \ - pgssapi.c pinger.c portfwd.c proxy.c raw.c rlogin.c \ - sessprep.c settings.c ssh.c ssh1bpp.c ssh1censor.c \ - ssh1connection-client.c ssh1connection.c ssh1login.c \ - ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c supdup.c telnet.c terminal.c time.c \ - timing.c tree234.c unix/gtkapp.c unix/gtkcfg.c \ - unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c \ - unix/gtkmisc.c unix/gtkwin.c unix/ux_x11.c unix/uxagentc.c \ - unix/uxcfg.c unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c \ - unix/uxnet.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxprint.c unix/uxproxy.c unix/uxputty.c unix/uxsel.c \ - unix/uxser.c unix/uxshare.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/uxutils.c unix/x11misc.c unix/xkeysym.c \ - unix/xpmpucfg.c unix/xpmputty.c utils.c wcwidth.c wildcard.c \ - x11fwd.c -puttyapp_LDADD = libversion.a $(GTK_LIBS) -endif - -puttygen_SOURCES = cmdgen.c conf.c console.c ecc.c import.c marshal.c \ - memory.c millerrabin.c misc.c mpint.c mpunsafe.c notiming.c \ - pockle.c primecandidate.c smallprimes.c sshaes.c sshargon2.c \ - sshauxcrypt.c sshbcrypt.c sshblake2.c sshblowf.c sshdes.c \ - sshdss.c sshdssg.c sshecc.c sshecdsag.c sshhmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshsh256.c sshsh512.c sshsha.c sshsha3.c stripctrl.c time.c \ - tree234.c unix/uxcons.c unix/uxgen.c unix/uxmisc.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpoll.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c -puttygen_LDADD = libversion.a - -if HAVE_GTK -puttytel_SOURCES = be_misc.c be_nos_s.c callback.c charset/fromucs.c \ - charset/localenc.c charset/macenc.c charset/mimeenc.c \ - charset/sbcs.c charset/sbcsdat.c charset/slookup.c \ - charset/toucs.c charset/utf8.c charset/xenc.c cmdline.c \ - conf.c config.c dialog.c errsock.c ldisc.c logging.c \ - marshal.c memory.c minibidi.c misc.c miscucs.c nocproxy.c \ - nogss.c norand.c pinger.c proxy.c raw.c rlogin.c sessprep.c \ - settings.c stripctrl.c supdup.c telnet.c terminal.c time.c \ - timing.c tree234.c unix/gtkcfg.c unix/gtkcols.c \ - unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c unix/gtkmain.c \ - unix/gtkmisc.c unix/gtkwin.c unix/uxcfg.c unix/uxfdsock.c \ - unix/uxmisc.c unix/uxnet.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxprint.c unix/uxproxy.c unix/uxputty.c unix/uxsel.c \ - unix/uxser.c unix/uxsignal.c unix/uxstore.c unix/uxucs.c \ - unix/uxutils.c unix/x11misc.c unix/xkeysym.c unix/xpmpucfg.c \ - unix/xpmputty.c utils.c wcwidth.c -puttytel_LDADD = libversion.a $(GTK_LIBS) -endif - -testcrypt_SOURCES = ecc.c marshal.c memory.c millerrabin.c mpint.c \ - mpunsafe.c pockle.c primecandidate.c smallprimes.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcrc.c sshcrcda.c sshdes.c sshdh.c sshdss.c \ - sshdssg.c sshecc.c sshecdsag.c sshhmac.c sshmd5.c sshprime.c \ - sshprng.c sshpubk.c sshrsa.c sshrsag.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c testcrypt.c tree234.c unix/uxutils.c \ - utils.c - -testsc_SOURCES = ecc.c marshal.c memory.c mpint.c sshaes.c ssharcf.c \ - sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c sshccp.c \ - sshcrc.c sshcrcda.c sshdes.c sshdh.c sshdss.c sshecc.c \ - sshhmac.c sshmac.c sshmd5.c sshpubk.c sshrsa.c sshsh256.c \ - sshsh512.c sshsha.c sshsha3.c testsc.c tree234.c \ - unix/uxutils.c utils.c wildcard.c - -testzlib_SOURCES = marshal.c memory.c sshzlib.c testzlib.c utils.c - -uppity_SOURCES = be_misc.c be_none.c callback.c conf.c cproxy.c ecc.c \ - errsock.c logging.c marshal.c memory.c millerrabin.c misc.c \ - mpint.c mpunsafe.c nullplug.c pgssapi.c pockle.c portfwd.c \ - primecandidate.c proxy.c scpserver.c sesschan.c settings.c \ - sftpcommon.c sftpserver.c smallprimes.c ssh1bpp.c \ - ssh1censor.c ssh1connection-server.c ssh1connection.c \ - ssh1login-server.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-server.c ssh2connection.c ssh2kex-server.c \ - ssh2transhk.c ssh2transport.c ssh2userauth-server.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshserver.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - sshutils.c sshverstring.c sshzlib.c stripctrl.c time.c \ - timing.c tree234.c unix/procnet.c unix/ux_x11.c \ - unix/uxagentsock.c unix/uxcliloop.c unix/uxfdsock.c \ - unix/uxgss.c unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c \ - unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c unix/uxproxy.c \ - unix/uxpty.c unix/uxsel.c unix/uxserver.c \ - unix/uxsftpserver.c unix/uxsignal.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c wildcard.c x11fwd.c -uppity_LDADD = libversion.a - -if AUTO_GIT_COMMIT -BUILT_SOURCES = empty.h -CLEANFILES = empty.h -libversion_a_CFLAGS += -DSOURCE_COMMIT=\"`git --git-dir=$(srcdir)/.git rev-parse HEAD 2>/dev/null`\" -empty.h: $(allsources) - echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@ -endif - -# Run the cryptsuite tests as part of 'make check'. Override -# PUTTY_TESTCRYPT so that cryptsuite will take the testcrypt binary -# from the build directory instead of the source directory, in case -# this is an out-of-tree build. -check-local: testcrypt - PUTTY_TESTCRYPT=./testcrypt $(srcdir)/test/cryptsuite.py - -if HAVE_GTK -man1_MANS = doc/plink.1 doc/pscp.1 doc/psftp.1 doc/puttygen.1 doc/psusan.1 \ - doc/pageant.1 doc/pterm.1 doc/putty.1 doc/puttytel.1 -else -man1_MANS = doc/plink.1 doc/pscp.1 doc/psftp.1 doc/puttygen.1 doc/psusan.1 -endif -if HAVE_SETID_CMD -install-exec-local: - @SETID_CMD@ $(bindir)/pterm - chmod @SETID_MODE@ $(bindir)/pterm -endif -if HAVE_QUARTZ -noinst_SCRIPTS = unix/PuTTY.app unix/Pterm.app -unix/PuTTY.app: unix/putty.bundle puttyapp osxlaunch - rm -rf $@ && PUTTY_GTK_PREFIX_FROM_MAKEFILE=$$(pkg-config --variable=prefix gtk+-3.0) gtk-mac-bundler $< -unix/Pterm.app: unix/pterm.bundle ptermapp osxlaunch - rm -rf $@ && PUTTY_GTK_PREFIX_FROM_MAKEFILE=$$(pkg-config --variable=prefix gtk+-3.0) gtk-mac-bundler $< -endif diff --git a/code/Makefile.in b/code/Makefile.in deleted file mode 100644 index 9d1ae54..0000000 --- a/code/Makefile.in +++ /dev/null @@ -1,2940 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program 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. - -@SET_MAKE@ - -# Makefile.am for putty under Unix with Autoconf/Automake. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. - - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -@HAVE_GTK_FALSE@bin_PROGRAMS = plink$(EXEEXT) pscp$(EXEEXT) \ -@HAVE_GTK_FALSE@ psftp$(EXEEXT) psusan$(EXEEXT) \ -@HAVE_GTK_FALSE@ puttygen$(EXEEXT) -@HAVE_GTK_TRUE@bin_PROGRAMS = plink$(EXEEXT) pscp$(EXEEXT) \ -@HAVE_GTK_TRUE@ psftp$(EXEEXT) psusan$(EXEEXT) \ -@HAVE_GTK_TRUE@ puttygen$(EXEEXT) pageant$(EXEEXT) \ -@HAVE_GTK_TRUE@ pterm$(EXEEXT) putty$(EXEEXT) puttytel$(EXEEXT) -@HAVE_GTK_FALSE@noinst_PROGRAMS = cgtest$(EXEEXT) fuzzterm$(EXEEXT) \ -@HAVE_GTK_FALSE@ osxlaunch$(EXEEXT) psocks$(EXEEXT) \ -@HAVE_GTK_FALSE@ testcrypt$(EXEEXT) testsc$(EXEEXT) \ -@HAVE_GTK_FALSE@ testzlib$(EXEEXT) uppity$(EXEEXT) -@HAVE_GTK_TRUE@noinst_PROGRAMS = cgtest$(EXEEXT) fuzzterm$(EXEEXT) \ -@HAVE_GTK_TRUE@ osxlaunch$(EXEEXT) psocks$(EXEEXT) \ -@HAVE_GTK_TRUE@ testcrypt$(EXEEXT) testsc$(EXEEXT) \ -@HAVE_GTK_TRUE@ testzlib$(EXEEXT) uppity$(EXEEXT) \ -@HAVE_GTK_TRUE@ ptermapp$(EXEEXT) puttyapp$(EXEEXT) -@AUTO_GIT_COMMIT_TRUE@am__append_1 = -DSOURCE_COMMIT=\"`git --git-dir=$(srcdir)/.git rev-parse HEAD 2>/dev/null`\" -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = uxconfig.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -AM_V_AR = $(am__v_AR_@AM_V@) -am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) -am__v_AR_0 = @echo " AR " $@; -am__v_AR_1 = -libversion_a_AR = $(AR) $(ARFLAGS) -libversion_a_LIBADD = -am_libversion_a_OBJECTS = libversion_a-version.$(OBJEXT) -libversion_a_OBJECTS = $(am_libversion_a_OBJECTS) -am__dirstamp = $(am__leading_dot)dirstamp -am_cgtest_OBJECTS = cgtest.$(OBJEXT) conf.$(OBJEXT) console.$(OBJEXT) \ - ecc.$(OBJEXT) import.$(OBJEXT) marshal.$(OBJEXT) \ - memory.$(OBJEXT) millerrabin.$(OBJEXT) misc.$(OBJEXT) \ - mpint.$(OBJEXT) mpunsafe.$(OBJEXT) notiming.$(OBJEXT) \ - pockle.$(OBJEXT) primecandidate.$(OBJEXT) \ - smallprimes.$(OBJEXT) sshaes.$(OBJEXT) sshargon2.$(OBJEXT) \ - sshauxcrypt.$(OBJEXT) sshbcrypt.$(OBJEXT) sshblake2.$(OBJEXT) \ - sshblowf.$(OBJEXT) sshdes.$(OBJEXT) sshdss.$(OBJEXT) \ - sshdssg.$(OBJEXT) sshecc.$(OBJEXT) sshecdsag.$(OBJEXT) \ - sshhmac.$(OBJEXT) sshmd5.$(OBJEXT) sshprime.$(OBJEXT) \ - sshprng.$(OBJEXT) sshpubk.$(OBJEXT) sshrand.$(OBJEXT) \ - sshrsa.$(OBJEXT) sshrsag.$(OBJEXT) sshsh256.$(OBJEXT) \ - sshsh512.$(OBJEXT) sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ - stripctrl.$(OBJEXT) time.$(OBJEXT) tree234.$(OBJEXT) \ - unix/uxcons.$(OBJEXT) unix/uxgen.$(OBJEXT) \ - unix/uxmisc.$(OBJEXT) unix/uxnogtk.$(OBJEXT) \ - unix/uxnoise.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ - unix/uxstore.$(OBJEXT) unix/uxutils.$(OBJEXT) utils.$(OBJEXT) \ - wcwidth.$(OBJEXT) -cgtest_OBJECTS = $(am_cgtest_OBJECTS) -cgtest_DEPENDENCIES = libversion.a -am_fuzzterm_OBJECTS = be_none.$(OBJEXT) callback.$(OBJEXT) \ - charset/fromucs.$(OBJEXT) charset/localenc.$(OBJEXT) \ - charset/macenc.$(OBJEXT) charset/mimeenc.$(OBJEXT) \ - charset/sbcs.$(OBJEXT) charset/sbcsdat.$(OBJEXT) \ - charset/slookup.$(OBJEXT) charset/toucs.$(OBJEXT) \ - charset/utf8.$(OBJEXT) charset/xenc.$(OBJEXT) conf.$(OBJEXT) \ - config.$(OBJEXT) dialog.$(OBJEXT) fuzzterm.$(OBJEXT) \ - logging.$(OBJEXT) marshal.$(OBJEXT) memory.$(OBJEXT) \ - minibidi.$(OBJEXT) misc.$(OBJEXT) miscucs.$(OBJEXT) \ - settings.$(OBJEXT) stripctrl.$(OBJEXT) terminal.$(OBJEXT) \ - time.$(OBJEXT) timing.$(OBJEXT) tree234.$(OBJEXT) \ - unix/uxcfg.$(OBJEXT) unix/uxmisc.$(OBJEXT) \ - unix/uxnogtk.$(OBJEXT) unix/uxprint.$(OBJEXT) \ - unix/uxstore.$(OBJEXT) unix/uxucs.$(OBJEXT) utils.$(OBJEXT) \ - wcwidth.$(OBJEXT) -fuzzterm_OBJECTS = $(am_fuzzterm_OBJECTS) -fuzzterm_DEPENDENCIES = libversion.a -am_osxlaunch_OBJECTS = unix/osxlaunch.$(OBJEXT) -osxlaunch_OBJECTS = $(am_osxlaunch_OBJECTS) -osxlaunch_LDADD = $(LDADD) -am__pageant_SOURCES_DIST = aqsync.c be_misc.c be_none.c callback.c \ - conf.c console.c ecc.c errsock.c logging.c marshal.c memory.c \ - misc.c mpint.c nocproxy.c nogss.c nullplug.c pageant.c proxy.c \ - settings.c sshaes.c sshargon2.c sshauxcrypt.c sshblake2.c \ - sshdes.c sshdss.c sshecc.c sshhmac.c sshmd5.c sshprng.c \ - sshpubk.c sshrsa.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - stripctrl.c time.c timing.c tree234.c unix/gtkask.c \ - unix/gtkmisc.c unix/ux_x11.c unix/uxagentc.c \ - unix/uxagentsock.c unix/uxcliloop.c unix/uxcons.c \ - unix/uxfdsock.c unix/uxmisc.c unix/uxnet.c unix/uxnoise.c \ - unix/uxpeer.c unix/uxpgnt.c unix/uxpoll.c unix/uxproxy.c \ - unix/uxsel.c unix/uxsignal.c unix/uxstore.c unix/uxutils.c \ - utils.c wcwidth.c x11fwd.c -@HAVE_GTK_TRUE@am_pageant_OBJECTS = aqsync.$(OBJEXT) be_misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ be_none.$(OBJEXT) callback.$(OBJEXT) \ -@HAVE_GTK_TRUE@ conf.$(OBJEXT) console.$(OBJEXT) ecc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ errsock.$(OBJEXT) logging.$(OBJEXT) \ -@HAVE_GTK_TRUE@ marshal.$(OBJEXT) memory.$(OBJEXT) \ -@HAVE_GTK_TRUE@ misc.$(OBJEXT) mpint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nocproxy.$(OBJEXT) nogss.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nullplug.$(OBJEXT) pageant.$(OBJEXT) \ -@HAVE_GTK_TRUE@ proxy.$(OBJEXT) settings.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshaes.$(OBJEXT) sshargon2.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshdes.$(OBJEXT) sshdss.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshecc.$(OBJEXT) sshhmac.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshmd5.$(OBJEXT) sshprng.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshpubk.$(OBJEXT) sshrsa.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ -@HAVE_GTK_TRUE@ stripctrl.$(OBJEXT) time.$(OBJEXT) \ -@HAVE_GTK_TRUE@ timing.$(OBJEXT) tree234.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkask.$(OBJEXT) unix/gtkmisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/ux_x11.$(OBJEXT) unix/uxagentc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxagentsock.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxcliloop.$(OBJEXT) unix/uxcons.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxfdsock.$(OBJEXT) unix/uxmisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxnet.$(OBJEXT) unix/uxnoise.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpeer.$(OBJEXT) unix/uxpgnt.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpoll.$(OBJEXT) unix/uxproxy.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxsel.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxstore.$(OBJEXT) unix/uxutils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ utils.$(OBJEXT) wcwidth.$(OBJEXT) \ -@HAVE_GTK_TRUE@ x11fwd.$(OBJEXT) -pageant_OBJECTS = $(am_pageant_OBJECTS) -am__DEPENDENCIES_1 = -@HAVE_GTK_TRUE@pageant_DEPENDENCIES = libversion.a \ -@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1) -am_plink_OBJECTS = agentf.$(OBJEXT) aqsync.$(OBJEXT) \ - be_all_s.$(OBJEXT) be_misc.$(OBJEXT) callback.$(OBJEXT) \ - clicons.$(OBJEXT) cmdline.$(OBJEXT) conf.$(OBJEXT) \ - console.$(OBJEXT) cproxy.$(OBJEXT) ecc.$(OBJEXT) \ - errsock.$(OBJEXT) ldisc.$(OBJEXT) logging.$(OBJEXT) \ - mainchan.$(OBJEXT) marshal.$(OBJEXT) memory.$(OBJEXT) \ - misc.$(OBJEXT) mpint.$(OBJEXT) noterm.$(OBJEXT) \ - nullplug.$(OBJEXT) pgssapi.$(OBJEXT) pinger.$(OBJEXT) \ - portfwd.$(OBJEXT) proxy.$(OBJEXT) raw.$(OBJEXT) \ - rlogin.$(OBJEXT) sessprep.$(OBJEXT) settings.$(OBJEXT) \ - ssh.$(OBJEXT) ssh1bpp.$(OBJEXT) ssh1censor.$(OBJEXT) \ - ssh1connection-client.$(OBJEXT) ssh1connection.$(OBJEXT) \ - ssh1login.$(OBJEXT) ssh2bpp-bare.$(OBJEXT) ssh2bpp.$(OBJEXT) \ - ssh2censor.$(OBJEXT) ssh2connection-client.$(OBJEXT) \ - ssh2connection.$(OBJEXT) ssh2kex-client.$(OBJEXT) \ - ssh2transhk.$(OBJEXT) ssh2transport.$(OBJEXT) \ - ssh2userauth.$(OBJEXT) sshaes.$(OBJEXT) ssharcf.$(OBJEXT) \ - sshargon2.$(OBJEXT) sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) \ - sshblowf.$(OBJEXT) sshccp.$(OBJEXT) sshcommon.$(OBJEXT) \ - sshcrc.$(OBJEXT) sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) \ - sshdh.$(OBJEXT) sshdss.$(OBJEXT) sshecc.$(OBJEXT) \ - sshgssc.$(OBJEXT) sshhmac.$(OBJEXT) sshmac.$(OBJEXT) \ - sshmd5.$(OBJEXT) sshprng.$(OBJEXT) sshpubk.$(OBJEXT) \ - sshrand.$(OBJEXT) sshrsa.$(OBJEXT) sshsh256.$(OBJEXT) \ - sshsh512.$(OBJEXT) sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ - sshshare.$(OBJEXT) sshutils.$(OBJEXT) sshverstring.$(OBJEXT) \ - sshzlib.$(OBJEXT) stripctrl.$(OBJEXT) supdup.$(OBJEXT) \ - telnet.$(OBJEXT) time.$(OBJEXT) timing.$(OBJEXT) \ - tree234.$(OBJEXT) unix/ux_x11.$(OBJEXT) \ - unix/uxagentc.$(OBJEXT) unix/uxcliloop.$(OBJEXT) \ - unix/uxcons.$(OBJEXT) unix/uxfdsock.$(OBJEXT) \ - unix/uxgss.$(OBJEXT) unix/uxmisc.$(OBJEXT) \ - unix/uxnet.$(OBJEXT) unix/uxnogtk.$(OBJEXT) \ - unix/uxnoise.$(OBJEXT) unix/uxpeer.$(OBJEXT) \ - unix/uxplink.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ - unix/uxproxy.$(OBJEXT) unix/uxsel.$(OBJEXT) \ - unix/uxser.$(OBJEXT) unix/uxshare.$(OBJEXT) \ - unix/uxsignal.$(OBJEXT) unix/uxstore.$(OBJEXT) \ - unix/uxutils.$(OBJEXT) utils.$(OBJEXT) wcwidth.$(OBJEXT) \ - wildcard.$(OBJEXT) x11fwd.$(OBJEXT) -plink_OBJECTS = $(am_plink_OBJECTS) -plink_DEPENDENCIES = libversion.a -am_pscp_OBJECTS = agentf.$(OBJEXT) aqsync.$(OBJEXT) be_misc.$(OBJEXT) \ - be_ssh.$(OBJEXT) callback.$(OBJEXT) clicons.$(OBJEXT) \ - cmdline.$(OBJEXT) conf.$(OBJEXT) console.$(OBJEXT) \ - cproxy.$(OBJEXT) ecc.$(OBJEXT) errsock.$(OBJEXT) \ - logging.$(OBJEXT) mainchan.$(OBJEXT) marshal.$(OBJEXT) \ - memory.$(OBJEXT) misc.$(OBJEXT) mpint.$(OBJEXT) \ - nullplug.$(OBJEXT) pgssapi.$(OBJEXT) pinger.$(OBJEXT) \ - portfwd.$(OBJEXT) proxy.$(OBJEXT) pscp.$(OBJEXT) \ - psftpcommon.$(OBJEXT) settings.$(OBJEXT) sftp.$(OBJEXT) \ - sftpcommon.$(OBJEXT) ssh.$(OBJEXT) ssh1bpp.$(OBJEXT) \ - ssh1censor.$(OBJEXT) ssh1connection-client.$(OBJEXT) \ - ssh1connection.$(OBJEXT) ssh1login.$(OBJEXT) \ - ssh2bpp-bare.$(OBJEXT) ssh2bpp.$(OBJEXT) ssh2censor.$(OBJEXT) \ - ssh2connection-client.$(OBJEXT) ssh2connection.$(OBJEXT) \ - ssh2kex-client.$(OBJEXT) ssh2transhk.$(OBJEXT) \ - ssh2transport.$(OBJEXT) ssh2userauth.$(OBJEXT) \ - sshaes.$(OBJEXT) ssharcf.$(OBJEXT) sshargon2.$(OBJEXT) \ - sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) sshblowf.$(OBJEXT) \ - sshccp.$(OBJEXT) sshcommon.$(OBJEXT) sshcrc.$(OBJEXT) \ - sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ - sshdss.$(OBJEXT) sshecc.$(OBJEXT) sshgssc.$(OBJEXT) \ - sshhmac.$(OBJEXT) sshmac.$(OBJEXT) sshmd5.$(OBJEXT) \ - sshprng.$(OBJEXT) sshpubk.$(OBJEXT) sshrand.$(OBJEXT) \ - sshrsa.$(OBJEXT) sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ - sshsha.$(OBJEXT) sshsha3.$(OBJEXT) sshshare.$(OBJEXT) \ - sshutils.$(OBJEXT) sshverstring.$(OBJEXT) sshzlib.$(OBJEXT) \ - stripctrl.$(OBJEXT) time.$(OBJEXT) timing.$(OBJEXT) \ - tree234.$(OBJEXT) unix/uxagentc.$(OBJEXT) \ - unix/uxcliloop.$(OBJEXT) unix/uxcons.$(OBJEXT) \ - unix/uxfdsock.$(OBJEXT) unix/uxgss.$(OBJEXT) \ - unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ - unix/uxnogtk.$(OBJEXT) unix/uxnoise.$(OBJEXT) \ - unix/uxpeer.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ - unix/uxproxy.$(OBJEXT) unix/uxsel.$(OBJEXT) \ - unix/uxsftp.$(OBJEXT) unix/uxshare.$(OBJEXT) \ - unix/uxstore.$(OBJEXT) unix/uxutils.$(OBJEXT) utils.$(OBJEXT) \ - wcwidth.$(OBJEXT) wildcard.$(OBJEXT) x11fwd.$(OBJEXT) -pscp_OBJECTS = $(am_pscp_OBJECTS) -pscp_DEPENDENCIES = libversion.a -am_psftp_OBJECTS = agentf.$(OBJEXT) aqsync.$(OBJEXT) be_misc.$(OBJEXT) \ - be_ssh.$(OBJEXT) callback.$(OBJEXT) clicons.$(OBJEXT) \ - cmdline.$(OBJEXT) conf.$(OBJEXT) console.$(OBJEXT) \ - cproxy.$(OBJEXT) ecc.$(OBJEXT) errsock.$(OBJEXT) \ - logging.$(OBJEXT) mainchan.$(OBJEXT) marshal.$(OBJEXT) \ - memory.$(OBJEXT) misc.$(OBJEXT) mpint.$(OBJEXT) \ - nullplug.$(OBJEXT) pgssapi.$(OBJEXT) pinger.$(OBJEXT) \ - portfwd.$(OBJEXT) proxy.$(OBJEXT) psftp.$(OBJEXT) \ - psftpcommon.$(OBJEXT) settings.$(OBJEXT) sftp.$(OBJEXT) \ - sftpcommon.$(OBJEXT) ssh.$(OBJEXT) ssh1bpp.$(OBJEXT) \ - ssh1censor.$(OBJEXT) ssh1connection-client.$(OBJEXT) \ - ssh1connection.$(OBJEXT) ssh1login.$(OBJEXT) \ - ssh2bpp-bare.$(OBJEXT) ssh2bpp.$(OBJEXT) ssh2censor.$(OBJEXT) \ - ssh2connection-client.$(OBJEXT) ssh2connection.$(OBJEXT) \ - ssh2kex-client.$(OBJEXT) ssh2transhk.$(OBJEXT) \ - ssh2transport.$(OBJEXT) ssh2userauth.$(OBJEXT) \ - sshaes.$(OBJEXT) ssharcf.$(OBJEXT) sshargon2.$(OBJEXT) \ - sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) sshblowf.$(OBJEXT) \ - sshccp.$(OBJEXT) sshcommon.$(OBJEXT) sshcrc.$(OBJEXT) \ - sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ - sshdss.$(OBJEXT) sshecc.$(OBJEXT) sshgssc.$(OBJEXT) \ - sshhmac.$(OBJEXT) sshmac.$(OBJEXT) sshmd5.$(OBJEXT) \ - sshprng.$(OBJEXT) sshpubk.$(OBJEXT) sshrand.$(OBJEXT) \ - sshrsa.$(OBJEXT) sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ - sshsha.$(OBJEXT) sshsha3.$(OBJEXT) sshshare.$(OBJEXT) \ - sshutils.$(OBJEXT) sshverstring.$(OBJEXT) sshzlib.$(OBJEXT) \ - stripctrl.$(OBJEXT) time.$(OBJEXT) timing.$(OBJEXT) \ - tree234.$(OBJEXT) unix/uxagentc.$(OBJEXT) \ - unix/uxcliloop.$(OBJEXT) unix/uxcons.$(OBJEXT) \ - unix/uxfdsock.$(OBJEXT) unix/uxgss.$(OBJEXT) \ - unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ - unix/uxnogtk.$(OBJEXT) unix/uxnoise.$(OBJEXT) \ - unix/uxpeer.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ - unix/uxproxy.$(OBJEXT) unix/uxsel.$(OBJEXT) \ - unix/uxsftp.$(OBJEXT) unix/uxshare.$(OBJEXT) \ - unix/uxstore.$(OBJEXT) unix/uxutils.$(OBJEXT) utils.$(OBJEXT) \ - wcwidth.$(OBJEXT) wildcard.$(OBJEXT) x11fwd.$(OBJEXT) -psftp_OBJECTS = $(am_psftp_OBJECTS) -psftp_DEPENDENCIES = libversion.a -am_psocks_OBJECTS = be_misc.$(OBJEXT) callback.$(OBJEXT) \ - conf.$(OBJEXT) console.$(OBJEXT) errsock.$(OBJEXT) \ - logging.$(OBJEXT) marshal.$(OBJEXT) memory.$(OBJEXT) \ - misc.$(OBJEXT) nocproxy.$(OBJEXT) norand.$(OBJEXT) \ - portfwd.$(OBJEXT) proxy.$(OBJEXT) psocks.$(OBJEXT) \ - sshutils.$(OBJEXT) stripctrl.$(OBJEXT) time.$(OBJEXT) \ - timing.$(OBJEXT) tree234.$(OBJEXT) unix/uxcliloop.$(OBJEXT) \ - unix/uxcons.$(OBJEXT) unix/uxfdsock.$(OBJEXT) \ - unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ - unix/uxnogtk.$(OBJEXT) unix/uxpeer.$(OBJEXT) \ - unix/uxpoll.$(OBJEXT) unix/uxproxy.$(OBJEXT) \ - unix/uxsel.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ - unix/uxsocks.$(OBJEXT) utils.$(OBJEXT) wcwidth.$(OBJEXT) -psocks_OBJECTS = $(am_psocks_OBJECTS) -psocks_DEPENDENCIES = libversion.a -am_psusan_OBJECTS = be_misc.$(OBJEXT) be_none.$(OBJEXT) \ - callback.$(OBJEXT) conf.$(OBJEXT) cproxy.$(OBJEXT) \ - ecc.$(OBJEXT) errsock.$(OBJEXT) logging.$(OBJEXT) \ - marshal.$(OBJEXT) memory.$(OBJEXT) millerrabin.$(OBJEXT) \ - misc.$(OBJEXT) mpint.$(OBJEXT) mpunsafe.$(OBJEXT) \ - nogss.$(OBJEXT) nullplug.$(OBJEXT) pgssapi.$(OBJEXT) \ - pockle.$(OBJEXT) portfwd.$(OBJEXT) primecandidate.$(OBJEXT) \ - proxy.$(OBJEXT) scpserver.$(OBJEXT) sesschan.$(OBJEXT) \ - settings.$(OBJEXT) sftpcommon.$(OBJEXT) sftpserver.$(OBJEXT) \ - smallprimes.$(OBJEXT) ssh1bpp.$(OBJEXT) ssh1censor.$(OBJEXT) \ - ssh1connection-server.$(OBJEXT) ssh1connection.$(OBJEXT) \ - ssh1login-server.$(OBJEXT) ssh2bpp-bare.$(OBJEXT) \ - ssh2bpp.$(OBJEXT) ssh2censor.$(OBJEXT) \ - ssh2connection-server.$(OBJEXT) ssh2connection.$(OBJEXT) \ - ssh2kex-server.$(OBJEXT) ssh2transhk.$(OBJEXT) \ - ssh2transport.$(OBJEXT) ssh2userauth-server.$(OBJEXT) \ - sshaes.$(OBJEXT) ssharcf.$(OBJEXT) sshargon2.$(OBJEXT) \ - sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) sshblowf.$(OBJEXT) \ - sshccp.$(OBJEXT) sshcommon.$(OBJEXT) sshcrc.$(OBJEXT) \ - sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ - sshdss.$(OBJEXT) sshecc.$(OBJEXT) sshgssc.$(OBJEXT) \ - sshhmac.$(OBJEXT) sshmac.$(OBJEXT) sshmd5.$(OBJEXT) \ - sshprime.$(OBJEXT) sshprng.$(OBJEXT) sshpubk.$(OBJEXT) \ - sshrand.$(OBJEXT) sshrsa.$(OBJEXT) sshrsag.$(OBJEXT) \ - sshserver.$(OBJEXT) sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ - sshsha.$(OBJEXT) sshsha3.$(OBJEXT) sshutils.$(OBJEXT) \ - sshverstring.$(OBJEXT) sshzlib.$(OBJEXT) stripctrl.$(OBJEXT) \ - time.$(OBJEXT) timing.$(OBJEXT) tree234.$(OBJEXT) \ - unix/procnet.$(OBJEXT) unix/ux_x11.$(OBJEXT) \ - unix/uxagentsock.$(OBJEXT) unix/uxcliloop.$(OBJEXT) \ - unix/uxfdsock.$(OBJEXT) unix/uxmisc.$(OBJEXT) \ - unix/uxnet.$(OBJEXT) unix/uxnogtk.$(OBJEXT) \ - unix/uxnoise.$(OBJEXT) unix/uxpeer.$(OBJEXT) \ - unix/uxpoll.$(OBJEXT) unix/uxproxy.$(OBJEXT) \ - unix/uxpsusan.$(OBJEXT) unix/uxpty.$(OBJEXT) \ - unix/uxsel.$(OBJEXT) unix/uxsftpserver.$(OBJEXT) \ - unix/uxsignal.$(OBJEXT) unix/uxstore.$(OBJEXT) \ - unix/uxutils.$(OBJEXT) utils.$(OBJEXT) wcwidth.$(OBJEXT) \ - wildcard.$(OBJEXT) x11fwd.$(OBJEXT) -psusan_OBJECTS = $(am_psusan_OBJECTS) -psusan_DEPENDENCIES = libversion.a -am__pterm_SOURCES_DIST = be_none.c callback.c charset/fromucs.c \ - charset/localenc.c charset/macenc.c charset/mimeenc.c \ - charset/sbcs.c charset/sbcsdat.c charset/slookup.c \ - charset/toucs.c charset/utf8.c charset/xenc.c cmdline.c conf.c \ - config.c dialog.c ldisc.c logging.c marshal.c memory.c \ - minibidi.c misc.c miscucs.c nocproxy.c nogss.c sessprep.c \ - settings.c stripctrl.c terminal.c time.c timing.c tree234.c \ - unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c \ - unix/gtkfont.c unix/gtkmain.c unix/gtkmisc.c unix/gtkwin.c \ - unix/uxcfg.c unix/uxmisc.c unix/uxprint.c unix/uxpterm.c \ - unix/uxpty.c unix/uxsel.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/x11misc.c unix/xkeysym.c unix/xpmptcfg.c \ - unix/xpmpterm.c utils.c wcwidth.c -@HAVE_GTK_TRUE@am_pterm_OBJECTS = be_none.$(OBJEXT) callback.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/fromucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/localenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/macenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/mimeenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcsdat.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/slookup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/toucs.$(OBJEXT) charset/utf8.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/xenc.$(OBJEXT) cmdline.$(OBJEXT) \ -@HAVE_GTK_TRUE@ conf.$(OBJEXT) config.$(OBJEXT) \ -@HAVE_GTK_TRUE@ dialog.$(OBJEXT) ldisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ logging.$(OBJEXT) marshal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ memory.$(OBJEXT) minibidi.$(OBJEXT) \ -@HAVE_GTK_TRUE@ misc.$(OBJEXT) miscucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nocproxy.$(OBJEXT) nogss.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sessprep.$(OBJEXT) settings.$(OBJEXT) \ -@HAVE_GTK_TRUE@ stripctrl.$(OBJEXT) terminal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ time.$(OBJEXT) timing.$(OBJEXT) \ -@HAVE_GTK_TRUE@ tree234.$(OBJEXT) unix/gtkcfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcols.$(OBJEXT) unix/gtkcomm.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkdlg.$(OBJEXT) unix/gtkfont.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkmain.$(OBJEXT) unix/gtkmisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkwin.$(OBJEXT) unix/uxcfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxmisc.$(OBJEXT) unix/uxprint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpterm.$(OBJEXT) unix/uxpty.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxsel.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxstore.$(OBJEXT) unix/uxucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/x11misc.$(OBJEXT) unix/xkeysym.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xpmptcfg.$(OBJEXT) unix/xpmpterm.$(OBJEXT) \ -@HAVE_GTK_TRUE@ utils.$(OBJEXT) wcwidth.$(OBJEXT) -pterm_OBJECTS = $(am_pterm_OBJECTS) -@HAVE_GTK_TRUE@pterm_DEPENDENCIES = libversion.a $(am__DEPENDENCIES_1) -am__ptermapp_SOURCES_DIST = be_none.c callback.c charset/fromucs.c \ - charset/localenc.c charset/macenc.c charset/mimeenc.c \ - charset/sbcs.c charset/sbcsdat.c charset/slookup.c \ - charset/toucs.c charset/utf8.c charset/xenc.c conf.c config.c \ - dialog.c ldisc.c logging.c marshal.c memory.c minibidi.c \ - misc.c miscucs.c nocmdline.c nocproxy.c nogss.c sessprep.c \ - settings.c stripctrl.c terminal.c time.c timing.c tree234.c \ - unix/gtkapp.c unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c \ - unix/gtkdlg.c unix/gtkfont.c unix/gtkmisc.c unix/gtkwin.c \ - unix/uxcfg.c unix/uxmisc.c unix/uxprint.c unix/uxpterm.c \ - unix/uxpty.c unix/uxsel.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/x11misc.c unix/xkeysym.c unix/xpmptcfg.c \ - unix/xpmpterm.c utils.c wcwidth.c -@HAVE_GTK_TRUE@am_ptermapp_OBJECTS = be_none.$(OBJEXT) \ -@HAVE_GTK_TRUE@ callback.$(OBJEXT) charset/fromucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/localenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/macenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/mimeenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcsdat.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/slookup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/toucs.$(OBJEXT) charset/utf8.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/xenc.$(OBJEXT) conf.$(OBJEXT) \ -@HAVE_GTK_TRUE@ config.$(OBJEXT) dialog.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ldisc.$(OBJEXT) logging.$(OBJEXT) \ -@HAVE_GTK_TRUE@ marshal.$(OBJEXT) memory.$(OBJEXT) \ -@HAVE_GTK_TRUE@ minibidi.$(OBJEXT) misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ miscucs.$(OBJEXT) nocmdline.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nocproxy.$(OBJEXT) nogss.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sessprep.$(OBJEXT) settings.$(OBJEXT) \ -@HAVE_GTK_TRUE@ stripctrl.$(OBJEXT) terminal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ time.$(OBJEXT) timing.$(OBJEXT) \ -@HAVE_GTK_TRUE@ tree234.$(OBJEXT) unix/gtkapp.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcfg.$(OBJEXT) unix/gtkcols.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcomm.$(OBJEXT) unix/gtkdlg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkfont.$(OBJEXT) unix/gtkmisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkwin.$(OBJEXT) unix/uxcfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxmisc.$(OBJEXT) unix/uxprint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpterm.$(OBJEXT) unix/uxpty.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxsel.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxstore.$(OBJEXT) unix/uxucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/x11misc.$(OBJEXT) unix/xkeysym.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xpmptcfg.$(OBJEXT) unix/xpmpterm.$(OBJEXT) \ -@HAVE_GTK_TRUE@ utils.$(OBJEXT) wcwidth.$(OBJEXT) -ptermapp_OBJECTS = $(am_ptermapp_OBJECTS) -@HAVE_GTK_TRUE@ptermapp_DEPENDENCIES = libversion.a \ -@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1) -am__putty_SOURCES_DIST = agentf.c aqsync.c be_all_s.c be_misc.c \ - callback.c charset/fromucs.c charset/localenc.c \ - charset/macenc.c charset/mimeenc.c charset/sbcs.c \ - charset/sbcsdat.c charset/slookup.c charset/toucs.c \ - charset/utf8.c charset/xenc.c cmdline.c conf.c config.c \ - cproxy.c dialog.c ecc.c errsock.c ldisc.c logging.c mainchan.c \ - marshal.c memory.c minibidi.c misc.c miscucs.c mpint.c \ - nullplug.c pgssapi.c pinger.c portfwd.c proxy.c raw.c rlogin.c \ - sessprep.c settings.c ssh.c ssh1bpp.c ssh1censor.c \ - ssh1connection-client.c ssh1connection.c ssh1login.c \ - ssh2bpp-bare.c ssh2bpp.c ssh2censor.c ssh2connection-client.c \ - ssh2connection.c ssh2kex-client.c ssh2transhk.c \ - ssh2transport.c ssh2userauth.c sshaes.c ssharcf.c sshargon2.c \ - sshauxcrypt.c sshblake2.c sshblowf.c sshccp.c sshcommon.c \ - sshcrc.c sshcrcda.c sshdes.c sshdh.c sshdss.c sshecc.c \ - sshgssc.c sshhmac.c sshmac.c sshmd5.c sshprng.c sshpubk.c \ - sshrand.c sshrsa.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - sshshare.c sshutils.c sshverstring.c sshzlib.c stripctrl.c \ - supdup.c telnet.c terminal.c time.c timing.c tree234.c \ - unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c \ - unix/gtkfont.c unix/gtkmain.c unix/gtkmisc.c unix/gtkwin.c \ - unix/ux_x11.c unix/uxagentc.c unix/uxcfg.c unix/uxfdsock.c \ - unix/uxgss.c unix/uxmisc.c unix/uxnet.c unix/uxnoise.c \ - unix/uxpeer.c unix/uxpoll.c unix/uxprint.c unix/uxproxy.c \ - unix/uxputty.c unix/uxsel.c unix/uxser.c unix/uxshare.c \ - unix/uxsignal.c unix/uxstore.c unix/uxucs.c unix/uxutils.c \ - unix/x11misc.c unix/xkeysym.c unix/xpmpucfg.c unix/xpmputty.c \ - utils.c wcwidth.c wildcard.c x11fwd.c -@HAVE_GTK_TRUE@am_putty_OBJECTS = agentf.$(OBJEXT) aqsync.$(OBJEXT) \ -@HAVE_GTK_TRUE@ be_all_s.$(OBJEXT) be_misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ callback.$(OBJEXT) charset/fromucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/localenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/macenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/mimeenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcsdat.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/slookup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/toucs.$(OBJEXT) charset/utf8.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/xenc.$(OBJEXT) cmdline.$(OBJEXT) \ -@HAVE_GTK_TRUE@ conf.$(OBJEXT) config.$(OBJEXT) \ -@HAVE_GTK_TRUE@ cproxy.$(OBJEXT) dialog.$(OBJEXT) ecc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ errsock.$(OBJEXT) ldisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ logging.$(OBJEXT) mainchan.$(OBJEXT) \ -@HAVE_GTK_TRUE@ marshal.$(OBJEXT) memory.$(OBJEXT) \ -@HAVE_GTK_TRUE@ minibidi.$(OBJEXT) misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ miscucs.$(OBJEXT) mpint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nullplug.$(OBJEXT) pgssapi.$(OBJEXT) \ -@HAVE_GTK_TRUE@ pinger.$(OBJEXT) portfwd.$(OBJEXT) \ -@HAVE_GTK_TRUE@ proxy.$(OBJEXT) raw.$(OBJEXT) rlogin.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sessprep.$(OBJEXT) settings.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh.$(OBJEXT) ssh1bpp.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh1censor.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh1connection-client.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh1connection.$(OBJEXT) ssh1login.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2bpp-bare.$(OBJEXT) ssh2bpp.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2censor.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2connection-client.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2connection.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2kex-client.$(OBJEXT) ssh2transhk.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2transport.$(OBJEXT) ssh2userauth.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshaes.$(OBJEXT) ssharcf.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshargon2.$(OBJEXT) sshauxcrypt.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshblake2.$(OBJEXT) sshblowf.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshccp.$(OBJEXT) sshcommon.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshcrc.$(OBJEXT) sshcrcda.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshdss.$(OBJEXT) sshecc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshgssc.$(OBJEXT) sshhmac.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshmac.$(OBJEXT) sshmd5.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshprng.$(OBJEXT) sshpubk.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshrand.$(OBJEXT) sshrsa.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshshare.$(OBJEXT) sshutils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshverstring.$(OBJEXT) sshzlib.$(OBJEXT) \ -@HAVE_GTK_TRUE@ stripctrl.$(OBJEXT) supdup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ telnet.$(OBJEXT) terminal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ time.$(OBJEXT) timing.$(OBJEXT) \ -@HAVE_GTK_TRUE@ tree234.$(OBJEXT) unix/gtkcfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcols.$(OBJEXT) unix/gtkcomm.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkdlg.$(OBJEXT) unix/gtkfont.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkmain.$(OBJEXT) unix/gtkmisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkwin.$(OBJEXT) unix/ux_x11.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxagentc.$(OBJEXT) unix/uxcfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxfdsock.$(OBJEXT) unix/uxgss.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxnoise.$(OBJEXT) unix/uxpeer.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpoll.$(OBJEXT) unix/uxprint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxproxy.$(OBJEXT) unix/uxputty.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxsel.$(OBJEXT) unix/uxser.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxshare.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxstore.$(OBJEXT) unix/uxucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxutils.$(OBJEXT) unix/x11misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xkeysym.$(OBJEXT) unix/xpmpucfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xpmputty.$(OBJEXT) utils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ wcwidth.$(OBJEXT) wildcard.$(OBJEXT) \ -@HAVE_GTK_TRUE@ x11fwd.$(OBJEXT) -putty_OBJECTS = $(am_putty_OBJECTS) -@HAVE_GTK_TRUE@putty_DEPENDENCIES = libversion.a $(am__DEPENDENCIES_1) -am__puttyapp_SOURCES_DIST = agentf.c aqsync.c be_all_s.c be_misc.c \ - callback.c charset/fromucs.c charset/localenc.c \ - charset/macenc.c charset/mimeenc.c charset/sbcs.c \ - charset/sbcsdat.c charset/slookup.c charset/toucs.c \ - charset/utf8.c charset/xenc.c conf.c config.c cproxy.c \ - dialog.c ecc.c errsock.c ldisc.c logging.c mainchan.c \ - marshal.c memory.c minibidi.c misc.c miscucs.c mpint.c \ - nocmdline.c nullplug.c pgssapi.c pinger.c portfwd.c proxy.c \ - raw.c rlogin.c sessprep.c settings.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c supdup.c telnet.c terminal.c time.c \ - timing.c tree234.c unix/gtkapp.c unix/gtkcfg.c unix/gtkcols.c \ - unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c unix/gtkmisc.c \ - unix/gtkwin.c unix/ux_x11.c unix/uxagentc.c unix/uxcfg.c \ - unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c unix/uxnet.c \ - unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c unix/uxprint.c \ - unix/uxproxy.c unix/uxputty.c unix/uxsel.c unix/uxser.c \ - unix/uxshare.c unix/uxsignal.c unix/uxstore.c unix/uxucs.c \ - unix/uxutils.c unix/x11misc.c unix/xkeysym.c unix/xpmpucfg.c \ - unix/xpmputty.c utils.c wcwidth.c wildcard.c x11fwd.c -@HAVE_GTK_TRUE@am_puttyapp_OBJECTS = agentf.$(OBJEXT) aqsync.$(OBJEXT) \ -@HAVE_GTK_TRUE@ be_all_s.$(OBJEXT) be_misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ callback.$(OBJEXT) charset/fromucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/localenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/macenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/mimeenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcsdat.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/slookup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/toucs.$(OBJEXT) charset/utf8.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/xenc.$(OBJEXT) conf.$(OBJEXT) \ -@HAVE_GTK_TRUE@ config.$(OBJEXT) cproxy.$(OBJEXT) \ -@HAVE_GTK_TRUE@ dialog.$(OBJEXT) ecc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ errsock.$(OBJEXT) ldisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ logging.$(OBJEXT) mainchan.$(OBJEXT) \ -@HAVE_GTK_TRUE@ marshal.$(OBJEXT) memory.$(OBJEXT) \ -@HAVE_GTK_TRUE@ minibidi.$(OBJEXT) misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ miscucs.$(OBJEXT) mpint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nocmdline.$(OBJEXT) nullplug.$(OBJEXT) \ -@HAVE_GTK_TRUE@ pgssapi.$(OBJEXT) pinger.$(OBJEXT) \ -@HAVE_GTK_TRUE@ portfwd.$(OBJEXT) proxy.$(OBJEXT) raw.$(OBJEXT) \ -@HAVE_GTK_TRUE@ rlogin.$(OBJEXT) sessprep.$(OBJEXT) \ -@HAVE_GTK_TRUE@ settings.$(OBJEXT) ssh.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh1bpp.$(OBJEXT) ssh1censor.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh1connection-client.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh1connection.$(OBJEXT) ssh1login.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2bpp-bare.$(OBJEXT) ssh2bpp.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2censor.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2connection-client.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2connection.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2kex-client.$(OBJEXT) ssh2transhk.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ssh2transport.$(OBJEXT) ssh2userauth.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshaes.$(OBJEXT) ssharcf.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshargon2.$(OBJEXT) sshauxcrypt.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshblake2.$(OBJEXT) sshblowf.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshccp.$(OBJEXT) sshcommon.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshcrc.$(OBJEXT) sshcrcda.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshdss.$(OBJEXT) sshecc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshgssc.$(OBJEXT) sshhmac.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshmac.$(OBJEXT) sshmd5.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshprng.$(OBJEXT) sshpubk.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshrand.$(OBJEXT) sshrsa.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshshare.$(OBJEXT) sshutils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ sshverstring.$(OBJEXT) sshzlib.$(OBJEXT) \ -@HAVE_GTK_TRUE@ stripctrl.$(OBJEXT) supdup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ telnet.$(OBJEXT) terminal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ time.$(OBJEXT) timing.$(OBJEXT) \ -@HAVE_GTK_TRUE@ tree234.$(OBJEXT) unix/gtkapp.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcfg.$(OBJEXT) unix/gtkcols.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcomm.$(OBJEXT) unix/gtkdlg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkfont.$(OBJEXT) unix/gtkmisc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkwin.$(OBJEXT) unix/ux_x11.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxagentc.$(OBJEXT) unix/uxcfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxfdsock.$(OBJEXT) unix/uxgss.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxnoise.$(OBJEXT) unix/uxpeer.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpoll.$(OBJEXT) unix/uxprint.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxproxy.$(OBJEXT) unix/uxputty.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxsel.$(OBJEXT) unix/uxser.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxshare.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxstore.$(OBJEXT) unix/uxucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxutils.$(OBJEXT) unix/x11misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xkeysym.$(OBJEXT) unix/xpmpucfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xpmputty.$(OBJEXT) utils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ wcwidth.$(OBJEXT) wildcard.$(OBJEXT) \ -@HAVE_GTK_TRUE@ x11fwd.$(OBJEXT) -puttyapp_OBJECTS = $(am_puttyapp_OBJECTS) -@HAVE_GTK_TRUE@puttyapp_DEPENDENCIES = libversion.a \ -@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1) -am_puttygen_OBJECTS = cmdgen.$(OBJEXT) conf.$(OBJEXT) \ - console.$(OBJEXT) ecc.$(OBJEXT) import.$(OBJEXT) \ - marshal.$(OBJEXT) memory.$(OBJEXT) millerrabin.$(OBJEXT) \ - misc.$(OBJEXT) mpint.$(OBJEXT) mpunsafe.$(OBJEXT) \ - notiming.$(OBJEXT) pockle.$(OBJEXT) primecandidate.$(OBJEXT) \ - smallprimes.$(OBJEXT) sshaes.$(OBJEXT) sshargon2.$(OBJEXT) \ - sshauxcrypt.$(OBJEXT) sshbcrypt.$(OBJEXT) sshblake2.$(OBJEXT) \ - sshblowf.$(OBJEXT) sshdes.$(OBJEXT) sshdss.$(OBJEXT) \ - sshdssg.$(OBJEXT) sshecc.$(OBJEXT) sshecdsag.$(OBJEXT) \ - sshhmac.$(OBJEXT) sshmd5.$(OBJEXT) sshprime.$(OBJEXT) \ - sshprng.$(OBJEXT) sshpubk.$(OBJEXT) sshrand.$(OBJEXT) \ - sshrsa.$(OBJEXT) sshrsag.$(OBJEXT) sshsh256.$(OBJEXT) \ - sshsh512.$(OBJEXT) sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ - stripctrl.$(OBJEXT) time.$(OBJEXT) tree234.$(OBJEXT) \ - unix/uxcons.$(OBJEXT) unix/uxgen.$(OBJEXT) \ - unix/uxmisc.$(OBJEXT) unix/uxnogtk.$(OBJEXT) \ - unix/uxnoise.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ - unix/uxstore.$(OBJEXT) unix/uxutils.$(OBJEXT) utils.$(OBJEXT) \ - wcwidth.$(OBJEXT) -puttygen_OBJECTS = $(am_puttygen_OBJECTS) -puttygen_DEPENDENCIES = libversion.a -am__puttytel_SOURCES_DIST = be_misc.c be_nos_s.c callback.c \ - charset/fromucs.c charset/localenc.c charset/macenc.c \ - charset/mimeenc.c charset/sbcs.c charset/sbcsdat.c \ - charset/slookup.c charset/toucs.c charset/utf8.c \ - charset/xenc.c cmdline.c conf.c config.c dialog.c errsock.c \ - ldisc.c logging.c marshal.c memory.c minibidi.c misc.c \ - miscucs.c nocproxy.c nogss.c norand.c pinger.c proxy.c raw.c \ - rlogin.c sessprep.c settings.c stripctrl.c supdup.c telnet.c \ - terminal.c time.c timing.c tree234.c unix/gtkcfg.c \ - unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c \ - unix/gtkmain.c unix/gtkmisc.c unix/gtkwin.c unix/uxcfg.c \ - unix/uxfdsock.c unix/uxmisc.c unix/uxnet.c unix/uxpeer.c \ - unix/uxpoll.c unix/uxprint.c unix/uxproxy.c unix/uxputty.c \ - unix/uxsel.c unix/uxser.c unix/uxsignal.c unix/uxstore.c \ - unix/uxucs.c unix/uxutils.c unix/x11misc.c unix/xkeysym.c \ - unix/xpmpucfg.c unix/xpmputty.c utils.c wcwidth.c -@HAVE_GTK_TRUE@am_puttytel_OBJECTS = be_misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ be_nos_s.$(OBJEXT) callback.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/fromucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/localenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/macenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/mimeenc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/sbcsdat.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/slookup.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/toucs.$(OBJEXT) charset/utf8.$(OBJEXT) \ -@HAVE_GTK_TRUE@ charset/xenc.$(OBJEXT) cmdline.$(OBJEXT) \ -@HAVE_GTK_TRUE@ conf.$(OBJEXT) config.$(OBJEXT) \ -@HAVE_GTK_TRUE@ dialog.$(OBJEXT) errsock.$(OBJEXT) \ -@HAVE_GTK_TRUE@ ldisc.$(OBJEXT) logging.$(OBJEXT) \ -@HAVE_GTK_TRUE@ marshal.$(OBJEXT) memory.$(OBJEXT) \ -@HAVE_GTK_TRUE@ minibidi.$(OBJEXT) misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ miscucs.$(OBJEXT) nocproxy.$(OBJEXT) \ -@HAVE_GTK_TRUE@ nogss.$(OBJEXT) norand.$(OBJEXT) \ -@HAVE_GTK_TRUE@ pinger.$(OBJEXT) proxy.$(OBJEXT) raw.$(OBJEXT) \ -@HAVE_GTK_TRUE@ rlogin.$(OBJEXT) sessprep.$(OBJEXT) \ -@HAVE_GTK_TRUE@ settings.$(OBJEXT) stripctrl.$(OBJEXT) \ -@HAVE_GTK_TRUE@ supdup.$(OBJEXT) telnet.$(OBJEXT) \ -@HAVE_GTK_TRUE@ terminal.$(OBJEXT) time.$(OBJEXT) \ -@HAVE_GTK_TRUE@ timing.$(OBJEXT) tree234.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcfg.$(OBJEXT) unix/gtkcols.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkcomm.$(OBJEXT) unix/gtkdlg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkfont.$(OBJEXT) unix/gtkmain.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/gtkmisc.$(OBJEXT) unix/gtkwin.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxcfg.$(OBJEXT) unix/uxfdsock.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxpeer.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxprint.$(OBJEXT) unix/uxproxy.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxputty.$(OBJEXT) unix/uxsel.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxser.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxstore.$(OBJEXT) unix/uxucs.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/uxutils.$(OBJEXT) unix/x11misc.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xkeysym.$(OBJEXT) unix/xpmpucfg.$(OBJEXT) \ -@HAVE_GTK_TRUE@ unix/xpmputty.$(OBJEXT) utils.$(OBJEXT) \ -@HAVE_GTK_TRUE@ wcwidth.$(OBJEXT) -puttytel_OBJECTS = $(am_puttytel_OBJECTS) -@HAVE_GTK_TRUE@puttytel_DEPENDENCIES = libversion.a \ -@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1) -am_testcrypt_OBJECTS = ecc.$(OBJEXT) marshal.$(OBJEXT) \ - memory.$(OBJEXT) millerrabin.$(OBJEXT) mpint.$(OBJEXT) \ - mpunsafe.$(OBJEXT) pockle.$(OBJEXT) primecandidate.$(OBJEXT) \ - smallprimes.$(OBJEXT) sshaes.$(OBJEXT) ssharcf.$(OBJEXT) \ - sshargon2.$(OBJEXT) sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) \ - sshblowf.$(OBJEXT) sshccp.$(OBJEXT) sshcrc.$(OBJEXT) \ - sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ - sshdss.$(OBJEXT) sshdssg.$(OBJEXT) sshecc.$(OBJEXT) \ - sshecdsag.$(OBJEXT) sshhmac.$(OBJEXT) sshmd5.$(OBJEXT) \ - sshprime.$(OBJEXT) sshprng.$(OBJEXT) sshpubk.$(OBJEXT) \ - sshrsa.$(OBJEXT) sshrsag.$(OBJEXT) sshsh256.$(OBJEXT) \ - sshsh512.$(OBJEXT) sshsha.$(OBJEXT) sshsha3.$(OBJEXT) \ - testcrypt.$(OBJEXT) tree234.$(OBJEXT) unix/uxutils.$(OBJEXT) \ - utils.$(OBJEXT) -testcrypt_OBJECTS = $(am_testcrypt_OBJECTS) -testcrypt_LDADD = $(LDADD) -am_testsc_OBJECTS = ecc.$(OBJEXT) marshal.$(OBJEXT) memory.$(OBJEXT) \ - mpint.$(OBJEXT) sshaes.$(OBJEXT) ssharcf.$(OBJEXT) \ - sshargon2.$(OBJEXT) sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) \ - sshblowf.$(OBJEXT) sshccp.$(OBJEXT) sshcrc.$(OBJEXT) \ - sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ - sshdss.$(OBJEXT) sshecc.$(OBJEXT) sshhmac.$(OBJEXT) \ - sshmac.$(OBJEXT) sshmd5.$(OBJEXT) sshpubk.$(OBJEXT) \ - sshrsa.$(OBJEXT) sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ - sshsha.$(OBJEXT) sshsha3.$(OBJEXT) testsc.$(OBJEXT) \ - tree234.$(OBJEXT) unix/uxutils.$(OBJEXT) utils.$(OBJEXT) \ - wildcard.$(OBJEXT) -testsc_OBJECTS = $(am_testsc_OBJECTS) -testsc_LDADD = $(LDADD) -am_testzlib_OBJECTS = marshal.$(OBJEXT) memory.$(OBJEXT) \ - sshzlib.$(OBJEXT) testzlib.$(OBJEXT) utils.$(OBJEXT) -testzlib_OBJECTS = $(am_testzlib_OBJECTS) -testzlib_LDADD = $(LDADD) -am_uppity_OBJECTS = be_misc.$(OBJEXT) be_none.$(OBJEXT) \ - callback.$(OBJEXT) conf.$(OBJEXT) cproxy.$(OBJEXT) \ - ecc.$(OBJEXT) errsock.$(OBJEXT) logging.$(OBJEXT) \ - marshal.$(OBJEXT) memory.$(OBJEXT) millerrabin.$(OBJEXT) \ - misc.$(OBJEXT) mpint.$(OBJEXT) mpunsafe.$(OBJEXT) \ - nullplug.$(OBJEXT) pgssapi.$(OBJEXT) pockle.$(OBJEXT) \ - portfwd.$(OBJEXT) primecandidate.$(OBJEXT) proxy.$(OBJEXT) \ - scpserver.$(OBJEXT) sesschan.$(OBJEXT) settings.$(OBJEXT) \ - sftpcommon.$(OBJEXT) sftpserver.$(OBJEXT) \ - smallprimes.$(OBJEXT) ssh1bpp.$(OBJEXT) ssh1censor.$(OBJEXT) \ - ssh1connection-server.$(OBJEXT) ssh1connection.$(OBJEXT) \ - ssh1login-server.$(OBJEXT) ssh2bpp-bare.$(OBJEXT) \ - ssh2bpp.$(OBJEXT) ssh2censor.$(OBJEXT) \ - ssh2connection-server.$(OBJEXT) ssh2connection.$(OBJEXT) \ - ssh2kex-server.$(OBJEXT) ssh2transhk.$(OBJEXT) \ - ssh2transport.$(OBJEXT) ssh2userauth-server.$(OBJEXT) \ - sshaes.$(OBJEXT) ssharcf.$(OBJEXT) sshargon2.$(OBJEXT) \ - sshauxcrypt.$(OBJEXT) sshblake2.$(OBJEXT) sshblowf.$(OBJEXT) \ - sshccp.$(OBJEXT) sshcommon.$(OBJEXT) sshcrc.$(OBJEXT) \ - sshcrcda.$(OBJEXT) sshdes.$(OBJEXT) sshdh.$(OBJEXT) \ - sshdss.$(OBJEXT) sshecc.$(OBJEXT) sshgssc.$(OBJEXT) \ - sshhmac.$(OBJEXT) sshmac.$(OBJEXT) sshmd5.$(OBJEXT) \ - sshprime.$(OBJEXT) sshprng.$(OBJEXT) sshpubk.$(OBJEXT) \ - sshrand.$(OBJEXT) sshrsa.$(OBJEXT) sshrsag.$(OBJEXT) \ - sshserver.$(OBJEXT) sshsh256.$(OBJEXT) sshsh512.$(OBJEXT) \ - sshsha.$(OBJEXT) sshsha3.$(OBJEXT) sshutils.$(OBJEXT) \ - sshverstring.$(OBJEXT) sshzlib.$(OBJEXT) stripctrl.$(OBJEXT) \ - time.$(OBJEXT) timing.$(OBJEXT) tree234.$(OBJEXT) \ - unix/procnet.$(OBJEXT) unix/ux_x11.$(OBJEXT) \ - unix/uxagentsock.$(OBJEXT) unix/uxcliloop.$(OBJEXT) \ - unix/uxfdsock.$(OBJEXT) unix/uxgss.$(OBJEXT) \ - unix/uxmisc.$(OBJEXT) unix/uxnet.$(OBJEXT) \ - unix/uxnogtk.$(OBJEXT) unix/uxnoise.$(OBJEXT) \ - unix/uxpeer.$(OBJEXT) unix/uxpoll.$(OBJEXT) \ - unix/uxproxy.$(OBJEXT) unix/uxpty.$(OBJEXT) \ - unix/uxsel.$(OBJEXT) unix/uxserver.$(OBJEXT) \ - unix/uxsftpserver.$(OBJEXT) unix/uxsignal.$(OBJEXT) \ - unix/uxstore.$(OBJEXT) unix/uxutils.$(OBJEXT) utils.$(OBJEXT) \ - wcwidth.$(OBJEXT) wildcard.$(OBJEXT) x11fwd.$(OBJEXT) -uppity_OBJECTS = $(am_uppity_OBJECTS) -uppity_DEPENDENCIES = libversion.a -SCRIPTS = $(noinst_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/agentf.Po ./$(DEPDIR)/aqsync.Po \ - ./$(DEPDIR)/be_all_s.Po ./$(DEPDIR)/be_misc.Po \ - ./$(DEPDIR)/be_none.Po ./$(DEPDIR)/be_nos_s.Po \ - ./$(DEPDIR)/be_ssh.Po ./$(DEPDIR)/callback.Po \ - ./$(DEPDIR)/cgtest.Po ./$(DEPDIR)/clicons.Po \ - ./$(DEPDIR)/cmdgen.Po ./$(DEPDIR)/cmdline.Po \ - ./$(DEPDIR)/conf.Po ./$(DEPDIR)/config.Po \ - ./$(DEPDIR)/console.Po ./$(DEPDIR)/cproxy.Po \ - ./$(DEPDIR)/dialog.Po ./$(DEPDIR)/ecc.Po \ - ./$(DEPDIR)/errsock.Po ./$(DEPDIR)/fuzzterm.Po \ - ./$(DEPDIR)/import.Po ./$(DEPDIR)/ldisc.Po \ - ./$(DEPDIR)/libversion_a-version.Po ./$(DEPDIR)/logging.Po \ - ./$(DEPDIR)/mainchan.Po ./$(DEPDIR)/marshal.Po \ - ./$(DEPDIR)/memory.Po ./$(DEPDIR)/millerrabin.Po \ - ./$(DEPDIR)/minibidi.Po ./$(DEPDIR)/misc.Po \ - ./$(DEPDIR)/miscucs.Po ./$(DEPDIR)/mpint.Po \ - ./$(DEPDIR)/mpunsafe.Po ./$(DEPDIR)/nocmdline.Po \ - ./$(DEPDIR)/nocproxy.Po ./$(DEPDIR)/nogss.Po \ - ./$(DEPDIR)/norand.Po ./$(DEPDIR)/noterm.Po \ - ./$(DEPDIR)/notiming.Po ./$(DEPDIR)/nullplug.Po \ - ./$(DEPDIR)/pageant.Po ./$(DEPDIR)/pgssapi.Po \ - ./$(DEPDIR)/pinger.Po ./$(DEPDIR)/pockle.Po \ - ./$(DEPDIR)/portfwd.Po ./$(DEPDIR)/primecandidate.Po \ - ./$(DEPDIR)/proxy.Po ./$(DEPDIR)/pscp.Po ./$(DEPDIR)/psftp.Po \ - ./$(DEPDIR)/psftpcommon.Po ./$(DEPDIR)/psocks.Po \ - ./$(DEPDIR)/raw.Po ./$(DEPDIR)/rlogin.Po \ - ./$(DEPDIR)/scpserver.Po ./$(DEPDIR)/sesschan.Po \ - ./$(DEPDIR)/sessprep.Po ./$(DEPDIR)/settings.Po \ - ./$(DEPDIR)/sftp.Po ./$(DEPDIR)/sftpcommon.Po \ - ./$(DEPDIR)/sftpserver.Po ./$(DEPDIR)/smallprimes.Po \ - ./$(DEPDIR)/ssh.Po ./$(DEPDIR)/ssh1bpp.Po \ - ./$(DEPDIR)/ssh1censor.Po ./$(DEPDIR)/ssh1connection-client.Po \ - ./$(DEPDIR)/ssh1connection-server.Po \ - ./$(DEPDIR)/ssh1connection.Po ./$(DEPDIR)/ssh1login-server.Po \ - ./$(DEPDIR)/ssh1login.Po ./$(DEPDIR)/ssh2bpp-bare.Po \ - ./$(DEPDIR)/ssh2bpp.Po ./$(DEPDIR)/ssh2censor.Po \ - ./$(DEPDIR)/ssh2connection-client.Po \ - ./$(DEPDIR)/ssh2connection-server.Po \ - ./$(DEPDIR)/ssh2connection.Po ./$(DEPDIR)/ssh2kex-client.Po \ - ./$(DEPDIR)/ssh2kex-server.Po ./$(DEPDIR)/ssh2transhk.Po \ - ./$(DEPDIR)/ssh2transport.Po \ - ./$(DEPDIR)/ssh2userauth-server.Po ./$(DEPDIR)/ssh2userauth.Po \ - ./$(DEPDIR)/sshaes.Po ./$(DEPDIR)/ssharcf.Po \ - ./$(DEPDIR)/sshargon2.Po ./$(DEPDIR)/sshauxcrypt.Po \ - ./$(DEPDIR)/sshbcrypt.Po ./$(DEPDIR)/sshblake2.Po \ - ./$(DEPDIR)/sshblowf.Po ./$(DEPDIR)/sshccp.Po \ - ./$(DEPDIR)/sshcommon.Po ./$(DEPDIR)/sshcrc.Po \ - ./$(DEPDIR)/sshcrcda.Po ./$(DEPDIR)/sshdes.Po \ - ./$(DEPDIR)/sshdh.Po ./$(DEPDIR)/sshdss.Po \ - ./$(DEPDIR)/sshdssg.Po ./$(DEPDIR)/sshecc.Po \ - ./$(DEPDIR)/sshecdsag.Po ./$(DEPDIR)/sshgssc.Po \ - ./$(DEPDIR)/sshhmac.Po ./$(DEPDIR)/sshmac.Po \ - ./$(DEPDIR)/sshmd5.Po ./$(DEPDIR)/sshprime.Po \ - ./$(DEPDIR)/sshprng.Po ./$(DEPDIR)/sshpubk.Po \ - ./$(DEPDIR)/sshrand.Po ./$(DEPDIR)/sshrsa.Po \ - ./$(DEPDIR)/sshrsag.Po ./$(DEPDIR)/sshserver.Po \ - ./$(DEPDIR)/sshsh256.Po ./$(DEPDIR)/sshsh512.Po \ - ./$(DEPDIR)/sshsha.Po ./$(DEPDIR)/sshsha3.Po \ - ./$(DEPDIR)/sshshare.Po ./$(DEPDIR)/sshutils.Po \ - ./$(DEPDIR)/sshverstring.Po ./$(DEPDIR)/sshzlib.Po \ - ./$(DEPDIR)/stripctrl.Po ./$(DEPDIR)/supdup.Po \ - ./$(DEPDIR)/telnet.Po ./$(DEPDIR)/terminal.Po \ - ./$(DEPDIR)/testcrypt.Po ./$(DEPDIR)/testsc.Po \ - ./$(DEPDIR)/testzlib.Po ./$(DEPDIR)/time.Po \ - ./$(DEPDIR)/timing.Po ./$(DEPDIR)/tree234.Po \ - ./$(DEPDIR)/utils.Po ./$(DEPDIR)/wcwidth.Po \ - ./$(DEPDIR)/wildcard.Po ./$(DEPDIR)/x11fwd.Po \ - charset/$(DEPDIR)/fromucs.Po charset/$(DEPDIR)/localenc.Po \ - charset/$(DEPDIR)/macenc.Po charset/$(DEPDIR)/mimeenc.Po \ - charset/$(DEPDIR)/sbcs.Po charset/$(DEPDIR)/sbcsdat.Po \ - charset/$(DEPDIR)/slookup.Po charset/$(DEPDIR)/toucs.Po \ - charset/$(DEPDIR)/utf8.Po charset/$(DEPDIR)/xenc.Po \ - unix/$(DEPDIR)/gtkapp.Po unix/$(DEPDIR)/gtkask.Po \ - unix/$(DEPDIR)/gtkcfg.Po unix/$(DEPDIR)/gtkcols.Po \ - unix/$(DEPDIR)/gtkcomm.Po unix/$(DEPDIR)/gtkdlg.Po \ - unix/$(DEPDIR)/gtkfont.Po unix/$(DEPDIR)/gtkmain.Po \ - unix/$(DEPDIR)/gtkmisc.Po unix/$(DEPDIR)/gtkwin.Po \ - unix/$(DEPDIR)/osxlaunch.Po unix/$(DEPDIR)/procnet.Po \ - unix/$(DEPDIR)/ux_x11.Po unix/$(DEPDIR)/uxagentc.Po \ - unix/$(DEPDIR)/uxagentsock.Po unix/$(DEPDIR)/uxcfg.Po \ - unix/$(DEPDIR)/uxcliloop.Po unix/$(DEPDIR)/uxcons.Po \ - unix/$(DEPDIR)/uxfdsock.Po unix/$(DEPDIR)/uxgen.Po \ - unix/$(DEPDIR)/uxgss.Po unix/$(DEPDIR)/uxmisc.Po \ - unix/$(DEPDIR)/uxnet.Po unix/$(DEPDIR)/uxnogtk.Po \ - unix/$(DEPDIR)/uxnoise.Po unix/$(DEPDIR)/uxpeer.Po \ - unix/$(DEPDIR)/uxpgnt.Po unix/$(DEPDIR)/uxplink.Po \ - unix/$(DEPDIR)/uxpoll.Po unix/$(DEPDIR)/uxprint.Po \ - unix/$(DEPDIR)/uxproxy.Po unix/$(DEPDIR)/uxpsusan.Po \ - unix/$(DEPDIR)/uxpterm.Po unix/$(DEPDIR)/uxpty.Po \ - unix/$(DEPDIR)/uxputty.Po unix/$(DEPDIR)/uxsel.Po \ - unix/$(DEPDIR)/uxser.Po unix/$(DEPDIR)/uxserver.Po \ - unix/$(DEPDIR)/uxsftp.Po unix/$(DEPDIR)/uxsftpserver.Po \ - unix/$(DEPDIR)/uxshare.Po unix/$(DEPDIR)/uxsignal.Po \ - unix/$(DEPDIR)/uxsocks.Po unix/$(DEPDIR)/uxstore.Po \ - unix/$(DEPDIR)/uxucs.Po unix/$(DEPDIR)/uxutils.Po \ - unix/$(DEPDIR)/x11misc.Po unix/$(DEPDIR)/xkeysym.Po \ - unix/$(DEPDIR)/xpmptcfg.Po unix/$(DEPDIR)/xpmpterm.Po \ - unix/$(DEPDIR)/xpmpucfg.Po unix/$(DEPDIR)/xpmputty.Po -am__mv = mv -f -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libversion_a_SOURCES) $(cgtest_SOURCES) \ - $(fuzzterm_SOURCES) $(osxlaunch_SOURCES) $(pageant_SOURCES) \ - $(plink_SOURCES) $(pscp_SOURCES) $(psftp_SOURCES) \ - $(psocks_SOURCES) $(psusan_SOURCES) $(pterm_SOURCES) \ - $(ptermapp_SOURCES) $(putty_SOURCES) $(puttyapp_SOURCES) \ - $(puttygen_SOURCES) $(puttytel_SOURCES) $(testcrypt_SOURCES) \ - $(testsc_SOURCES) $(testzlib_SOURCES) $(uppity_SOURCES) -DIST_SOURCES = $(libversion_a_SOURCES) $(cgtest_SOURCES) \ - $(fuzzterm_SOURCES) $(osxlaunch_SOURCES) \ - $(am__pageant_SOURCES_DIST) $(plink_SOURCES) $(pscp_SOURCES) \ - $(psftp_SOURCES) $(psocks_SOURCES) $(psusan_SOURCES) \ - $(am__pterm_SOURCES_DIST) $(am__ptermapp_SOURCES_DIST) \ - $(am__putty_SOURCES_DIST) $(am__puttyapp_SOURCES_DIST) \ - $(puttygen_SOURCES) $(am__puttytel_SOURCES_DIST) \ - $(testcrypt_SOURCES) $(testsc_SOURCES) $(testzlib_SOURCES) \ - $(uppity_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -man1dir = $(mandir)/man1 -NROFF = nroff -MANS = $(man1_MANS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)uxconfig.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -AM_RECURSIVE_TARGETS = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/uxconfig.in README \ - ar-lib compile depcomp install-sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -GTK1_CONFIG = @GTK1_CONFIG@ -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SETID_CMD = @SETID_CMD@ -SETID_MODE = @SETID_MODE@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WARNINGOPTS = @WARNINGOPTS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -runstatedir = @runstatedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = subdir-objects -allsources = agentf.c aqsync.c be_all_s.c be_misc.c be_none.c be_nos_s.c \ - be_ssh.c callback.c cgtest.c charset/charset.h \ - charset/enum.c charset/fromucs.c charset/internal.h \ - charset/localenc.c charset/macenc.c charset/mimeenc.c \ - charset/sbcs.c charset/sbcsdat.c charset/slookup.c \ - charset/toucs.c charset/utf8.c charset/xenc.c clicons.c \ - cmdgen.c cmdline.c conf.c config.c console.c console.h \ - cproxy.c defs.h dialog.c dialog.h ecc.c ecc.h errsock.c \ - fuzzterm.c import.c ldisc.c ldisc.h licence.h logging.c \ - mainchan.c marshal.c marshal.h memory.c millerrabin.c \ - minibidi.c misc.c misc.h miscucs.c mpint.c mpint.h mpint_i.h \ - mpunsafe.c mpunsafe.h network.h nocmdline.c nocproxy.c \ - nogss.c norand.c noshare.c noterm.c notiming.c nullplug.c \ - pageant.c pageant.h pgssapi.c pgssapi.h pinger.c pockle.c \ - portfwd.c primecandidate.c proxy.c proxy.h pscp.c psftp.c \ - psftp.h psftpcommon.c psocks.c psocks.h putty.h puttymem.h \ - puttyps.h raw.c rlogin.c scpserver.c sesschan.c sessprep.c \ - settings.c sftp.c sftp.h sftpcommon.c sftpserver.c \ - smallprimes.c ssh.c ssh.h ssh1bpp.c ssh1censor.c \ - ssh1connection-client.c ssh1connection-server.c \ - ssh1connection.c ssh1connection.h ssh1login-server.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection-server.c \ - ssh2connection.c ssh2connection.h ssh2kex-client.c \ - ssh2kex-server.c ssh2transhk.c ssh2transport.c \ - ssh2transport.h ssh2userauth-server.c ssh2userauth.c \ - sshaes.c ssharcf.c sshargon2.c sshauxcrypt.c sshbcrypt.c \ - sshblake2.c sshblowf.c sshblowf.h sshbpp.h sshccp.c \ - sshchan.h sshcommon.c sshcr.h sshcrc.c sshcrcda.c sshdes.c \ - sshdh.c sshdss.c sshdssg.c sshecc.c sshecdsag.c sshgss.h \ - sshgssc.c sshgssc.h sshhmac.c sshkeygen.h sshmac.c sshmd5.c \ - sshppl.h sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c \ - sshrsag.c sshserver.c sshserver.h sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshsignals.h sshttymodes.h \ - sshutils.c sshverstring.c sshzlib.c storage.h stripctrl.c \ - supdup.c telnet.c terminal.c terminal.h testcrypt.c \ - testcrypt.h testsc.c testzlib.c time.c timing.c tree234.c \ - tree234.h unix/gtkapp.c unix/gtkask.c unix/gtkcfg.c \ - unix/gtkcols.c unix/gtkcols.h unix/gtkcomm.c \ - unix/gtkcompat.h unix/gtkdlg.c unix/gtkfont.c unix/gtkfont.h \ - unix/gtkmain.c unix/gtkmisc.c unix/gtkmisc.h unix/gtkwin.c \ - unix/osxlaunch.c unix/procnet.c unix/unix.h unix/ux_x11.c \ - unix/uxagentc.c unix/uxagentsock.c unix/uxcfg.c \ - unix/uxcliloop.c unix/uxcons.c unix/uxfdsock.c unix/uxgen.c \ - unix/uxgss.c unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c \ - unix/uxnoise.c unix/uxpeer.c unix/uxpgnt.c unix/uxplink.c \ - unix/uxpoll.c unix/uxprint.c unix/uxproxy.c unix/uxpsusan.c \ - unix/uxpterm.c unix/uxpty.c unix/uxputty.c unix/uxsel.c \ - unix/uxser.c unix/uxserver.c unix/uxsftp.c \ - unix/uxsftpserver.c unix/uxshare.c unix/uxsignal.c \ - unix/uxsocks.c unix/uxstore.c unix/uxucs.c unix/uxutils.c \ - unix/uxutils.h unix/x11misc.c unix/x11misc.h unix/xkeysym.c \ - unix/xpmptcfg.c unix/xpmpterm.c unix/xpmpucfg.c \ - unix/xpmputty.c utils.c version.c version.h wcwidth.c \ - wildcard.c windows/pageant-rc.h windows/pageant.rc \ - windows/plink.rc windows/pscp.rc windows/psftp.rc \ - windows/putty.rc windows/puttygen-rc.h windows/puttygen.rc \ - windows/puttytel.rc windows/rcstuff.h windows/sizetip.c \ - windows/version.rc2 windows/win_res.h windows/win_res.rc2 \ - windows/wincapi.c windows/wincapi.h windows/wincfg.c \ - windows/wincliloop.c windows/wincons.c windows/winctrls.c \ - windows/windefs.c windows/windlg.c windows/window.c \ - windows/wingss.c windows/winhandl.c windows/winhelp.c \ - windows/winhelp.h windows/winhelp.rc2 windows/winhsock.c \ - windows/winjump.c windows/winmisc.c windows/winmiscs.c \ - windows/winnet.c windows/winnohlp.c windows/winnoise.c \ - windows/winnojmp.c windows/winnpc.c windows/winnps.c \ - windows/winpgen.c windows/winpgnt.c windows/winpgntc.c \ - windows/winplink.c windows/winprint.c windows/winproxy.c \ - windows/winseat.h windows/winsecur.c windows/winsecur.h \ - windows/winselcli.c windows/winselgui.c windows/winser.c \ - windows/winsftp.c windows/winshare.c windows/winsocks.c \ - windows/winstore.c windows/winstuff.h windows/wintime.c \ - windows/winucs.c windows/winutils.c windows/winx11.c \ - x11fwd.c - -AM_CPPFLAGS = -I$(srcdir)/./ -I$(srcdir)/charset/ -I$(srcdir)/windows/ \ - -I$(srcdir)/unix/ - -@HAVE_GTK_FALSE@AM_CFLAGS = $(COMPAT) $(XFLAGS) $(WARNINGOPTS) -@HAVE_GTK_TRUE@AM_CFLAGS = $(GTK_CFLAGS) $(COMPAT) $(XFLAGS) $(WARNINGOPTS) -libversion_a_SOURCES = version.c -libversion_a_CFLAGS = $(COMPAT) $(XFLAGS) $(WARNINGOPTS) \ - $(am__append_1) -noinst_LIBRARIES = libversion.a -cgtest_SOURCES = cgtest.c conf.c console.c ecc.c import.c marshal.c memory.c \ - millerrabin.c misc.c mpint.c mpunsafe.c notiming.c pockle.c \ - primecandidate.c smallprimes.c sshaes.c sshargon2.c \ - sshauxcrypt.c sshbcrypt.c sshblake2.c sshblowf.c sshdes.c \ - sshdss.c sshdssg.c sshecc.c sshecdsag.c sshhmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshsh256.c sshsh512.c sshsha.c sshsha3.c stripctrl.c time.c \ - tree234.c unix/uxcons.c unix/uxgen.c unix/uxmisc.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpoll.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c - -cgtest_LDADD = libversion.a -fuzzterm_SOURCES = be_none.c callback.c charset/fromucs.c charset/localenc.c \ - charset/macenc.c charset/mimeenc.c charset/sbcs.c \ - charset/sbcsdat.c charset/slookup.c charset/toucs.c \ - charset/utf8.c charset/xenc.c conf.c config.c dialog.c \ - fuzzterm.c logging.c marshal.c memory.c minibidi.c misc.c \ - miscucs.c settings.c stripctrl.c terminal.c time.c timing.c \ - tree234.c unix/uxcfg.c unix/uxmisc.c unix/uxnogtk.c \ - unix/uxprint.c unix/uxstore.c unix/uxucs.c utils.c wcwidth.c - -fuzzterm_LDADD = libversion.a -osxlaunch_SOURCES = unix/osxlaunch.c -@HAVE_GTK_TRUE@pageant_SOURCES = aqsync.c be_misc.c be_none.c callback.c conf.c console.c \ -@HAVE_GTK_TRUE@ ecc.c errsock.c logging.c marshal.c memory.c misc.c mpint.c \ -@HAVE_GTK_TRUE@ nocproxy.c nogss.c nullplug.c pageant.c proxy.c settings.c \ -@HAVE_GTK_TRUE@ sshaes.c sshargon2.c sshauxcrypt.c sshblake2.c sshdes.c \ -@HAVE_GTK_TRUE@ sshdss.c sshecc.c sshhmac.c sshmd5.c sshprng.c sshpubk.c \ -@HAVE_GTK_TRUE@ sshrsa.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ -@HAVE_GTK_TRUE@ stripctrl.c time.c timing.c tree234.c unix/gtkask.c \ -@HAVE_GTK_TRUE@ unix/gtkmisc.c unix/ux_x11.c unix/uxagentc.c \ -@HAVE_GTK_TRUE@ unix/uxagentsock.c unix/uxcliloop.c unix/uxcons.c \ -@HAVE_GTK_TRUE@ unix/uxfdsock.c unix/uxmisc.c unix/uxnet.c unix/uxnoise.c \ -@HAVE_GTK_TRUE@ unix/uxpeer.c unix/uxpgnt.c unix/uxpoll.c unix/uxproxy.c \ -@HAVE_GTK_TRUE@ unix/uxsel.c unix/uxsignal.c unix/uxstore.c unix/uxutils.c \ -@HAVE_GTK_TRUE@ utils.c wcwidth.c x11fwd.c - -@HAVE_GTK_TRUE@pageant_LDADD = libversion.a $(GTK_LIBS) -plink_SOURCES = agentf.c aqsync.c be_all_s.c be_misc.c callback.c clicons.c \ - cmdline.c conf.c console.c cproxy.c ecc.c errsock.c ldisc.c \ - logging.c mainchan.c marshal.c memory.c misc.c mpint.c \ - noterm.c nullplug.c pgssapi.c pinger.c portfwd.c proxy.c \ - raw.c rlogin.c sessprep.c settings.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c supdup.c telnet.c time.c timing.c \ - tree234.c unix/ux_x11.c unix/uxagentc.c unix/uxcliloop.c \ - unix/uxcons.c unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c \ - unix/uxnet.c unix/uxnogtk.c unix/uxnoise.c unix/uxpeer.c \ - unix/uxplink.c unix/uxpoll.c unix/uxproxy.c unix/uxsel.c \ - unix/uxser.c unix/uxshare.c unix/uxsignal.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c wildcard.c x11fwd.c - -plink_LDADD = libversion.a -pscp_SOURCES = agentf.c aqsync.c be_misc.c be_ssh.c callback.c clicons.c \ - cmdline.c conf.c console.c cproxy.c ecc.c errsock.c \ - logging.c mainchan.c marshal.c memory.c misc.c mpint.c \ - nullplug.c pgssapi.c pinger.c portfwd.c proxy.c pscp.c \ - psftpcommon.c settings.c sftp.c sftpcommon.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c time.c timing.c tree234.c \ - unix/uxagentc.c unix/uxcliloop.c unix/uxcons.c \ - unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c unix/uxnet.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxproxy.c unix/uxsel.c unix/uxsftp.c unix/uxshare.c \ - unix/uxstore.c unix/uxutils.c utils.c wcwidth.c wildcard.c \ - x11fwd.c - -pscp_LDADD = libversion.a -psftp_SOURCES = agentf.c aqsync.c be_misc.c be_ssh.c callback.c clicons.c \ - cmdline.c conf.c console.c cproxy.c ecc.c errsock.c \ - logging.c mainchan.c marshal.c memory.c misc.c mpint.c \ - nullplug.c pgssapi.c pinger.c portfwd.c proxy.c psftp.c \ - psftpcommon.c settings.c sftp.c sftpcommon.c ssh.c ssh1bpp.c \ - ssh1censor.c ssh1connection-client.c ssh1connection.c \ - ssh1login.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ - ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ - sshzlib.c stripctrl.c time.c timing.c tree234.c \ - unix/uxagentc.c unix/uxcliloop.c unix/uxcons.c \ - unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c unix/uxnet.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ - unix/uxproxy.c unix/uxsel.c unix/uxsftp.c unix/uxshare.c \ - unix/uxstore.c unix/uxutils.c utils.c wcwidth.c wildcard.c \ - x11fwd.c - -psftp_LDADD = libversion.a -psocks_SOURCES = be_misc.c callback.c conf.c console.c errsock.c logging.c \ - marshal.c memory.c misc.c nocproxy.c norand.c portfwd.c \ - proxy.c psocks.c sshutils.c stripctrl.c time.c timing.c \ - tree234.c unix/uxcliloop.c unix/uxcons.c unix/uxfdsock.c \ - unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c unix/uxpeer.c \ - unix/uxpoll.c unix/uxproxy.c unix/uxsel.c unix/uxsignal.c \ - unix/uxsocks.c utils.c wcwidth.c - -psocks_LDADD = libversion.a -psusan_SOURCES = be_misc.c be_none.c callback.c conf.c cproxy.c ecc.c \ - errsock.c logging.c marshal.c memory.c millerrabin.c misc.c \ - mpint.c mpunsafe.c nogss.c nullplug.c pgssapi.c pockle.c \ - portfwd.c primecandidate.c proxy.c scpserver.c sesschan.c \ - settings.c sftpcommon.c sftpserver.c smallprimes.c ssh1bpp.c \ - ssh1censor.c ssh1connection-server.c ssh1connection.c \ - ssh1login-server.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-server.c ssh2connection.c ssh2kex-server.c \ - ssh2transhk.c ssh2transport.c ssh2userauth-server.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshserver.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - sshutils.c sshverstring.c sshzlib.c stripctrl.c time.c \ - timing.c tree234.c unix/procnet.c unix/ux_x11.c \ - unix/uxagentsock.c unix/uxcliloop.c unix/uxfdsock.c \ - unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c unix/uxnoise.c \ - unix/uxpeer.c unix/uxpoll.c unix/uxproxy.c unix/uxpsusan.c \ - unix/uxpty.c unix/uxsel.c unix/uxsftpserver.c \ - unix/uxsignal.c unix/uxstore.c unix/uxutils.c utils.c \ - wcwidth.c wildcard.c x11fwd.c - -psusan_LDADD = libversion.a -@HAVE_GTK_TRUE@pterm_SOURCES = be_none.c callback.c charset/fromucs.c charset/localenc.c \ -@HAVE_GTK_TRUE@ charset/macenc.c charset/mimeenc.c charset/sbcs.c \ -@HAVE_GTK_TRUE@ charset/sbcsdat.c charset/slookup.c charset/toucs.c \ -@HAVE_GTK_TRUE@ charset/utf8.c charset/xenc.c cmdline.c conf.c config.c \ -@HAVE_GTK_TRUE@ dialog.c ldisc.c logging.c marshal.c memory.c minibidi.c \ -@HAVE_GTK_TRUE@ misc.c miscucs.c nocproxy.c nogss.c sessprep.c settings.c \ -@HAVE_GTK_TRUE@ stripctrl.c terminal.c time.c timing.c tree234.c \ -@HAVE_GTK_TRUE@ unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c \ -@HAVE_GTK_TRUE@ unix/gtkfont.c unix/gtkmain.c unix/gtkmisc.c unix/gtkwin.c \ -@HAVE_GTK_TRUE@ unix/uxcfg.c unix/uxmisc.c unix/uxprint.c unix/uxpterm.c \ -@HAVE_GTK_TRUE@ unix/uxpty.c unix/uxsel.c unix/uxsignal.c unix/uxstore.c \ -@HAVE_GTK_TRUE@ unix/uxucs.c unix/x11misc.c unix/xkeysym.c unix/xpmptcfg.c \ -@HAVE_GTK_TRUE@ unix/xpmpterm.c utils.c wcwidth.c - -@HAVE_GTK_TRUE@pterm_LDADD = libversion.a $(GTK_LIBS) -@HAVE_GTK_TRUE@ptermapp_SOURCES = be_none.c callback.c charset/fromucs.c charset/localenc.c \ -@HAVE_GTK_TRUE@ charset/macenc.c charset/mimeenc.c charset/sbcs.c \ -@HAVE_GTK_TRUE@ charset/sbcsdat.c charset/slookup.c charset/toucs.c \ -@HAVE_GTK_TRUE@ charset/utf8.c charset/xenc.c conf.c config.c dialog.c \ -@HAVE_GTK_TRUE@ ldisc.c logging.c marshal.c memory.c minibidi.c misc.c \ -@HAVE_GTK_TRUE@ miscucs.c nocmdline.c nocproxy.c nogss.c sessprep.c \ -@HAVE_GTK_TRUE@ settings.c stripctrl.c terminal.c time.c timing.c tree234.c \ -@HAVE_GTK_TRUE@ unix/gtkapp.c unix/gtkcfg.c unix/gtkcols.c unix/gtkcomm.c \ -@HAVE_GTK_TRUE@ unix/gtkdlg.c unix/gtkfont.c unix/gtkmisc.c unix/gtkwin.c \ -@HAVE_GTK_TRUE@ unix/uxcfg.c unix/uxmisc.c unix/uxprint.c unix/uxpterm.c \ -@HAVE_GTK_TRUE@ unix/uxpty.c unix/uxsel.c unix/uxsignal.c unix/uxstore.c \ -@HAVE_GTK_TRUE@ unix/uxucs.c unix/x11misc.c unix/xkeysym.c unix/xpmptcfg.c \ -@HAVE_GTK_TRUE@ unix/xpmpterm.c utils.c wcwidth.c - -@HAVE_GTK_TRUE@ptermapp_LDADD = libversion.a $(GTK_LIBS) -@HAVE_GTK_TRUE@putty_SOURCES = agentf.c aqsync.c be_all_s.c be_misc.c callback.c \ -@HAVE_GTK_TRUE@ charset/fromucs.c charset/localenc.c charset/macenc.c \ -@HAVE_GTK_TRUE@ charset/mimeenc.c charset/sbcs.c charset/sbcsdat.c \ -@HAVE_GTK_TRUE@ charset/slookup.c charset/toucs.c charset/utf8.c \ -@HAVE_GTK_TRUE@ charset/xenc.c cmdline.c conf.c config.c cproxy.c dialog.c \ -@HAVE_GTK_TRUE@ ecc.c errsock.c ldisc.c logging.c mainchan.c marshal.c \ -@HAVE_GTK_TRUE@ memory.c minibidi.c misc.c miscucs.c mpint.c nullplug.c \ -@HAVE_GTK_TRUE@ pgssapi.c pinger.c portfwd.c proxy.c raw.c rlogin.c \ -@HAVE_GTK_TRUE@ sessprep.c settings.c ssh.c ssh1bpp.c ssh1censor.c \ -@HAVE_GTK_TRUE@ ssh1connection-client.c ssh1connection.c ssh1login.c \ -@HAVE_GTK_TRUE@ ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ -@HAVE_GTK_TRUE@ ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ -@HAVE_GTK_TRUE@ ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ -@HAVE_GTK_TRUE@ ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ -@HAVE_GTK_TRUE@ sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ -@HAVE_GTK_TRUE@ sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ -@HAVE_GTK_TRUE@ sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ -@HAVE_GTK_TRUE@ sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ -@HAVE_GTK_TRUE@ sshzlib.c stripctrl.c supdup.c telnet.c terminal.c time.c \ -@HAVE_GTK_TRUE@ timing.c tree234.c unix/gtkcfg.c unix/gtkcols.c \ -@HAVE_GTK_TRUE@ unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c unix/gtkmain.c \ -@HAVE_GTK_TRUE@ unix/gtkmisc.c unix/gtkwin.c unix/ux_x11.c unix/uxagentc.c \ -@HAVE_GTK_TRUE@ unix/uxcfg.c unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c \ -@HAVE_GTK_TRUE@ unix/uxnet.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ -@HAVE_GTK_TRUE@ unix/uxprint.c unix/uxproxy.c unix/uxputty.c unix/uxsel.c \ -@HAVE_GTK_TRUE@ unix/uxser.c unix/uxshare.c unix/uxsignal.c unix/uxstore.c \ -@HAVE_GTK_TRUE@ unix/uxucs.c unix/uxutils.c unix/x11misc.c unix/xkeysym.c \ -@HAVE_GTK_TRUE@ unix/xpmpucfg.c unix/xpmputty.c utils.c wcwidth.c wildcard.c \ -@HAVE_GTK_TRUE@ x11fwd.c - -@HAVE_GTK_TRUE@putty_LDADD = libversion.a $(GTK_LIBS) -@HAVE_GTK_TRUE@puttyapp_SOURCES = agentf.c aqsync.c be_all_s.c be_misc.c callback.c \ -@HAVE_GTK_TRUE@ charset/fromucs.c charset/localenc.c charset/macenc.c \ -@HAVE_GTK_TRUE@ charset/mimeenc.c charset/sbcs.c charset/sbcsdat.c \ -@HAVE_GTK_TRUE@ charset/slookup.c charset/toucs.c charset/utf8.c \ -@HAVE_GTK_TRUE@ charset/xenc.c conf.c config.c cproxy.c dialog.c ecc.c \ -@HAVE_GTK_TRUE@ errsock.c ldisc.c logging.c mainchan.c marshal.c memory.c \ -@HAVE_GTK_TRUE@ minibidi.c misc.c miscucs.c mpint.c nocmdline.c nullplug.c \ -@HAVE_GTK_TRUE@ pgssapi.c pinger.c portfwd.c proxy.c raw.c rlogin.c \ -@HAVE_GTK_TRUE@ sessprep.c settings.c ssh.c ssh1bpp.c ssh1censor.c \ -@HAVE_GTK_TRUE@ ssh1connection-client.c ssh1connection.c ssh1login.c \ -@HAVE_GTK_TRUE@ ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ -@HAVE_GTK_TRUE@ ssh2connection-client.c ssh2connection.c ssh2kex-client.c \ -@HAVE_GTK_TRUE@ ssh2transhk.c ssh2transport.c ssh2userauth.c sshaes.c \ -@HAVE_GTK_TRUE@ ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ -@HAVE_GTK_TRUE@ sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ -@HAVE_GTK_TRUE@ sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ -@HAVE_GTK_TRUE@ sshprng.c sshpubk.c sshrand.c sshrsa.c sshsh256.c sshsh512.c \ -@HAVE_GTK_TRUE@ sshsha.c sshsha3.c sshshare.c sshutils.c sshverstring.c \ -@HAVE_GTK_TRUE@ sshzlib.c stripctrl.c supdup.c telnet.c terminal.c time.c \ -@HAVE_GTK_TRUE@ timing.c tree234.c unix/gtkapp.c unix/gtkcfg.c \ -@HAVE_GTK_TRUE@ unix/gtkcols.c unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c \ -@HAVE_GTK_TRUE@ unix/gtkmisc.c unix/gtkwin.c unix/ux_x11.c unix/uxagentc.c \ -@HAVE_GTK_TRUE@ unix/uxcfg.c unix/uxfdsock.c unix/uxgss.c unix/uxmisc.c \ -@HAVE_GTK_TRUE@ unix/uxnet.c unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c \ -@HAVE_GTK_TRUE@ unix/uxprint.c unix/uxproxy.c unix/uxputty.c unix/uxsel.c \ -@HAVE_GTK_TRUE@ unix/uxser.c unix/uxshare.c unix/uxsignal.c unix/uxstore.c \ -@HAVE_GTK_TRUE@ unix/uxucs.c unix/uxutils.c unix/x11misc.c unix/xkeysym.c \ -@HAVE_GTK_TRUE@ unix/xpmpucfg.c unix/xpmputty.c utils.c wcwidth.c wildcard.c \ -@HAVE_GTK_TRUE@ x11fwd.c - -@HAVE_GTK_TRUE@puttyapp_LDADD = libversion.a $(GTK_LIBS) -puttygen_SOURCES = cmdgen.c conf.c console.c ecc.c import.c marshal.c \ - memory.c millerrabin.c misc.c mpint.c mpunsafe.c notiming.c \ - pockle.c primecandidate.c smallprimes.c sshaes.c sshargon2.c \ - sshauxcrypt.c sshbcrypt.c sshblake2.c sshblowf.c sshdes.c \ - sshdss.c sshdssg.c sshecc.c sshecdsag.c sshhmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshsh256.c sshsh512.c sshsha.c sshsha3.c stripctrl.c time.c \ - tree234.c unix/uxcons.c unix/uxgen.c unix/uxmisc.c \ - unix/uxnogtk.c unix/uxnoise.c unix/uxpoll.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c - -puttygen_LDADD = libversion.a -@HAVE_GTK_TRUE@puttytel_SOURCES = be_misc.c be_nos_s.c callback.c charset/fromucs.c \ -@HAVE_GTK_TRUE@ charset/localenc.c charset/macenc.c charset/mimeenc.c \ -@HAVE_GTK_TRUE@ charset/sbcs.c charset/sbcsdat.c charset/slookup.c \ -@HAVE_GTK_TRUE@ charset/toucs.c charset/utf8.c charset/xenc.c cmdline.c \ -@HAVE_GTK_TRUE@ conf.c config.c dialog.c errsock.c ldisc.c logging.c \ -@HAVE_GTK_TRUE@ marshal.c memory.c minibidi.c misc.c miscucs.c nocproxy.c \ -@HAVE_GTK_TRUE@ nogss.c norand.c pinger.c proxy.c raw.c rlogin.c sessprep.c \ -@HAVE_GTK_TRUE@ settings.c stripctrl.c supdup.c telnet.c terminal.c time.c \ -@HAVE_GTK_TRUE@ timing.c tree234.c unix/gtkcfg.c unix/gtkcols.c \ -@HAVE_GTK_TRUE@ unix/gtkcomm.c unix/gtkdlg.c unix/gtkfont.c unix/gtkmain.c \ -@HAVE_GTK_TRUE@ unix/gtkmisc.c unix/gtkwin.c unix/uxcfg.c unix/uxfdsock.c \ -@HAVE_GTK_TRUE@ unix/uxmisc.c unix/uxnet.c unix/uxpeer.c unix/uxpoll.c \ -@HAVE_GTK_TRUE@ unix/uxprint.c unix/uxproxy.c unix/uxputty.c unix/uxsel.c \ -@HAVE_GTK_TRUE@ unix/uxser.c unix/uxsignal.c unix/uxstore.c unix/uxucs.c \ -@HAVE_GTK_TRUE@ unix/uxutils.c unix/x11misc.c unix/xkeysym.c unix/xpmpucfg.c \ -@HAVE_GTK_TRUE@ unix/xpmputty.c utils.c wcwidth.c - -@HAVE_GTK_TRUE@puttytel_LDADD = libversion.a $(GTK_LIBS) -testcrypt_SOURCES = ecc.c marshal.c memory.c millerrabin.c mpint.c \ - mpunsafe.c pockle.c primecandidate.c smallprimes.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcrc.c sshcrcda.c sshdes.c sshdh.c sshdss.c \ - sshdssg.c sshecc.c sshecdsag.c sshhmac.c sshmd5.c sshprime.c \ - sshprng.c sshpubk.c sshrsa.c sshrsag.c sshsh256.c sshsh512.c \ - sshsha.c sshsha3.c testcrypt.c tree234.c unix/uxutils.c \ - utils.c - -testsc_SOURCES = ecc.c marshal.c memory.c mpint.c sshaes.c ssharcf.c \ - sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c sshccp.c \ - sshcrc.c sshcrcda.c sshdes.c sshdh.c sshdss.c sshecc.c \ - sshhmac.c sshmac.c sshmd5.c sshpubk.c sshrsa.c sshsh256.c \ - sshsh512.c sshsha.c sshsha3.c testsc.c tree234.c \ - unix/uxutils.c utils.c wildcard.c - -testzlib_SOURCES = marshal.c memory.c sshzlib.c testzlib.c utils.c -uppity_SOURCES = be_misc.c be_none.c callback.c conf.c cproxy.c ecc.c \ - errsock.c logging.c marshal.c memory.c millerrabin.c misc.c \ - mpint.c mpunsafe.c nullplug.c pgssapi.c pockle.c portfwd.c \ - primecandidate.c proxy.c scpserver.c sesschan.c settings.c \ - sftpcommon.c sftpserver.c smallprimes.c ssh1bpp.c \ - ssh1censor.c ssh1connection-server.c ssh1connection.c \ - ssh1login-server.c ssh2bpp-bare.c ssh2bpp.c ssh2censor.c \ - ssh2connection-server.c ssh2connection.c ssh2kex-server.c \ - ssh2transhk.c ssh2transport.c ssh2userauth-server.c sshaes.c \ - ssharcf.c sshargon2.c sshauxcrypt.c sshblake2.c sshblowf.c \ - sshccp.c sshcommon.c sshcrc.c sshcrcda.c sshdes.c sshdh.c \ - sshdss.c sshecc.c sshgssc.c sshhmac.c sshmac.c sshmd5.c \ - sshprime.c sshprng.c sshpubk.c sshrand.c sshrsa.c sshrsag.c \ - sshserver.c sshsh256.c sshsh512.c sshsha.c sshsha3.c \ - sshutils.c sshverstring.c sshzlib.c stripctrl.c time.c \ - timing.c tree234.c unix/procnet.c unix/ux_x11.c \ - unix/uxagentsock.c unix/uxcliloop.c unix/uxfdsock.c \ - unix/uxgss.c unix/uxmisc.c unix/uxnet.c unix/uxnogtk.c \ - unix/uxnoise.c unix/uxpeer.c unix/uxpoll.c unix/uxproxy.c \ - unix/uxpty.c unix/uxsel.c unix/uxserver.c \ - unix/uxsftpserver.c unix/uxsignal.c unix/uxstore.c \ - unix/uxutils.c utils.c wcwidth.c wildcard.c x11fwd.c - -uppity_LDADD = libversion.a -@AUTO_GIT_COMMIT_TRUE@BUILT_SOURCES = empty.h -@AUTO_GIT_COMMIT_TRUE@CLEANFILES = empty.h -@HAVE_GTK_FALSE@man1_MANS = doc/plink.1 doc/pscp.1 doc/psftp.1 doc/puttygen.1 doc/psusan.1 -@HAVE_GTK_TRUE@man1_MANS = doc/plink.1 doc/pscp.1 doc/psftp.1 doc/puttygen.1 doc/psusan.1 \ -@HAVE_GTK_TRUE@ doc/pageant.1 doc/pterm.1 doc/putty.1 doc/puttytel.1 - -@HAVE_QUARTZ_TRUE@noinst_SCRIPTS = unix/PuTTY.app unix/Pterm.app -all: $(BUILT_SOURCES) uxconfig.h - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -uxconfig.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/uxconfig.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status uxconfig.h -$(srcdir)/uxconfig.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f uxconfig.h stamp-h1 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -libversion.a: $(libversion_a_OBJECTS) $(libversion_a_DEPENDENCIES) $(EXTRA_libversion_a_DEPENDENCIES) - $(AM_V_at)-rm -f libversion.a - $(AM_V_AR)$(libversion_a_AR) libversion.a $(libversion_a_OBJECTS) $(libversion_a_LIBADD) - $(AM_V_at)$(RANLIB) libversion.a -unix/$(am__dirstamp): - @$(MKDIR_P) unix - @: > unix/$(am__dirstamp) -unix/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) unix/$(DEPDIR) - @: > unix/$(DEPDIR)/$(am__dirstamp) -unix/uxcons.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxgen.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxmisc.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxnogtk.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxnoise.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxpoll.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxstore.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxutils.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -cgtest$(EXEEXT): $(cgtest_OBJECTS) $(cgtest_DEPENDENCIES) $(EXTRA_cgtest_DEPENDENCIES) - @rm -f cgtest$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(cgtest_OBJECTS) $(cgtest_LDADD) $(LIBS) -charset/$(am__dirstamp): - @$(MKDIR_P) charset - @: > charset/$(am__dirstamp) -charset/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) charset/$(DEPDIR) - @: > charset/$(DEPDIR)/$(am__dirstamp) -charset/fromucs.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/localenc.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/macenc.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/mimeenc.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/sbcs.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/sbcsdat.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/slookup.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/toucs.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/utf8.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -charset/xenc.$(OBJEXT): charset/$(am__dirstamp) \ - charset/$(DEPDIR)/$(am__dirstamp) -unix/uxcfg.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxprint.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxucs.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -fuzzterm$(EXEEXT): $(fuzzterm_OBJECTS) $(fuzzterm_DEPENDENCIES) $(EXTRA_fuzzterm_DEPENDENCIES) - @rm -f fuzzterm$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(fuzzterm_OBJECTS) $(fuzzterm_LDADD) $(LIBS) -unix/osxlaunch.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -osxlaunch$(EXEEXT): $(osxlaunch_OBJECTS) $(osxlaunch_DEPENDENCIES) $(EXTRA_osxlaunch_DEPENDENCIES) - @rm -f osxlaunch$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(osxlaunch_OBJECTS) $(osxlaunch_LDADD) $(LIBS) -unix/gtkask.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkmisc.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/ux_x11.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxagentc.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxagentsock.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxcliloop.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxfdsock.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxnet.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxpeer.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxpgnt.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxproxy.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxsel.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxsignal.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -pageant$(EXEEXT): $(pageant_OBJECTS) $(pageant_DEPENDENCIES) $(EXTRA_pageant_DEPENDENCIES) - @rm -f pageant$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(pageant_OBJECTS) $(pageant_LDADD) $(LIBS) -unix/uxgss.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxplink.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxser.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxshare.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -plink$(EXEEXT): $(plink_OBJECTS) $(plink_DEPENDENCIES) $(EXTRA_plink_DEPENDENCIES) - @rm -f plink$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(plink_OBJECTS) $(plink_LDADD) $(LIBS) -unix/uxsftp.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -pscp$(EXEEXT): $(pscp_OBJECTS) $(pscp_DEPENDENCIES) $(EXTRA_pscp_DEPENDENCIES) - @rm -f pscp$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(pscp_OBJECTS) $(pscp_LDADD) $(LIBS) - -psftp$(EXEEXT): $(psftp_OBJECTS) $(psftp_DEPENDENCIES) $(EXTRA_psftp_DEPENDENCIES) - @rm -f psftp$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(psftp_OBJECTS) $(psftp_LDADD) $(LIBS) -unix/uxsocks.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -psocks$(EXEEXT): $(psocks_OBJECTS) $(psocks_DEPENDENCIES) $(EXTRA_psocks_DEPENDENCIES) - @rm -f psocks$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(psocks_OBJECTS) $(psocks_LDADD) $(LIBS) -unix/procnet.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxpsusan.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxpty.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxsftpserver.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -psusan$(EXEEXT): $(psusan_OBJECTS) $(psusan_DEPENDENCIES) $(EXTRA_psusan_DEPENDENCIES) - @rm -f psusan$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(psusan_OBJECTS) $(psusan_LDADD) $(LIBS) -unix/gtkcfg.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkcols.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkcomm.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkdlg.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkfont.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkmain.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/gtkwin.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/uxpterm.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/x11misc.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/xkeysym.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/xpmptcfg.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/xpmpterm.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -pterm$(EXEEXT): $(pterm_OBJECTS) $(pterm_DEPENDENCIES) $(EXTRA_pterm_DEPENDENCIES) - @rm -f pterm$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(pterm_OBJECTS) $(pterm_LDADD) $(LIBS) -unix/gtkapp.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -ptermapp$(EXEEXT): $(ptermapp_OBJECTS) $(ptermapp_DEPENDENCIES) $(EXTRA_ptermapp_DEPENDENCIES) - @rm -f ptermapp$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(ptermapp_OBJECTS) $(ptermapp_LDADD) $(LIBS) -unix/uxputty.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/xpmpucfg.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) -unix/xpmputty.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -putty$(EXEEXT): $(putty_OBJECTS) $(putty_DEPENDENCIES) $(EXTRA_putty_DEPENDENCIES) - @rm -f putty$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(putty_OBJECTS) $(putty_LDADD) $(LIBS) - -puttyapp$(EXEEXT): $(puttyapp_OBJECTS) $(puttyapp_DEPENDENCIES) $(EXTRA_puttyapp_DEPENDENCIES) - @rm -f puttyapp$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(puttyapp_OBJECTS) $(puttyapp_LDADD) $(LIBS) - -puttygen$(EXEEXT): $(puttygen_OBJECTS) $(puttygen_DEPENDENCIES) $(EXTRA_puttygen_DEPENDENCIES) - @rm -f puttygen$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(puttygen_OBJECTS) $(puttygen_LDADD) $(LIBS) - -puttytel$(EXEEXT): $(puttytel_OBJECTS) $(puttytel_DEPENDENCIES) $(EXTRA_puttytel_DEPENDENCIES) - @rm -f puttytel$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(puttytel_OBJECTS) $(puttytel_LDADD) $(LIBS) - -testcrypt$(EXEEXT): $(testcrypt_OBJECTS) $(testcrypt_DEPENDENCIES) $(EXTRA_testcrypt_DEPENDENCIES) - @rm -f testcrypt$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(testcrypt_OBJECTS) $(testcrypt_LDADD) $(LIBS) - -testsc$(EXEEXT): $(testsc_OBJECTS) $(testsc_DEPENDENCIES) $(EXTRA_testsc_DEPENDENCIES) - @rm -f testsc$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(testsc_OBJECTS) $(testsc_LDADD) $(LIBS) - -testzlib$(EXEEXT): $(testzlib_OBJECTS) $(testzlib_DEPENDENCIES) $(EXTRA_testzlib_DEPENDENCIES) - @rm -f testzlib$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(testzlib_OBJECTS) $(testzlib_LDADD) $(LIBS) -unix/uxserver.$(OBJEXT): unix/$(am__dirstamp) \ - unix/$(DEPDIR)/$(am__dirstamp) - -uppity$(EXEEXT): $(uppity_OBJECTS) $(uppity_DEPENDENCIES) $(EXTRA_uppity_DEPENDENCIES) - @rm -f uppity$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(uppity_OBJECTS) $(uppity_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f charset/*.$(OBJEXT) - -rm -f unix/*.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agentf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aqsync.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/be_all_s.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/be_misc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/be_none.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/be_nos_s.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/be_ssh.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callback.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgtest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clicons.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdgen.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cproxy.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dialog.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errsock.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzzterm.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/import.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldisc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libversion_a-version.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logging.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mainchan.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marshal.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/millerrabin.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minibidi.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscucs.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpint.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpunsafe.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nocmdline.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nocproxy.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nogss.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norand.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noterm.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notiming.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nullplug.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pageant.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgssapi.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinger.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pockle.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/portfwd.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primecandidate.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pscp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psftp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psftpcommon.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psocks.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rlogin.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scpserver.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesschan.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sessprep.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settings.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpcommon.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpserver.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smallprimes.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1bpp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1censor.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1connection-client.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1connection-server.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1connection.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1login-server.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh1login.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2bpp-bare.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2bpp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2censor.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2connection-client.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2connection-server.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2connection.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2kex-client.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2kex-server.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2transhk.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2transport.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2userauth-server.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh2userauth.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshaes.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssharcf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshargon2.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshauxcrypt.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshbcrypt.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshblake2.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshblowf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshccp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshcommon.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshcrc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshcrcda.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshdes.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshdh.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshdss.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshdssg.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshecc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshecdsag.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshgssc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshhmac.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshmac.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshmd5.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshprime.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshprng.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshpubk.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshrand.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshrsa.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshrsag.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshserver.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshsh256.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshsh512.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshsha.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshsha3.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshshare.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshutils.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshverstring.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshzlib.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripctrl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/supdup.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/telnet.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/terminal.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcrypt.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testzlib.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timing.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree234.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcwidth.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wildcard.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11fwd.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/fromucs.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/localenc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/macenc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/mimeenc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/sbcs.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/sbcsdat.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/slookup.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/toucs.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/utf8.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@charset/$(DEPDIR)/xenc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkapp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkask.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkcfg.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkcols.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkcomm.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkdlg.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkfont.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkmain.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkmisc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/gtkwin.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/osxlaunch.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/procnet.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/ux_x11.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxagentc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxagentsock.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxcfg.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxcliloop.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxcons.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxfdsock.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxgen.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxgss.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxmisc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxnet.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxnogtk.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxnoise.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxpeer.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxpgnt.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxplink.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxpoll.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxprint.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxproxy.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxpsusan.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxpterm.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxpty.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxputty.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxsel.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxser.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxserver.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxsftp.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxsftpserver.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxshare.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxsignal.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxsocks.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxstore.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxucs.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/uxutils.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/x11misc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/xkeysym.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/xpmptcfg.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/xpmpterm.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/xpmpucfg.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@unix/$(DEPDIR)/xpmputty.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -libversion_a-version.o: version.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libversion_a_CFLAGS) $(CFLAGS) -MT libversion_a-version.o -MD -MP -MF $(DEPDIR)/libversion_a-version.Tpo -c -o libversion_a-version.o `test -f 'version.c' || echo '$(srcdir)/'`version.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libversion_a-version.Tpo $(DEPDIR)/libversion_a-version.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='version.c' object='libversion_a-version.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libversion_a_CFLAGS) $(CFLAGS) -c -o libversion_a-version.o `test -f 'version.c' || echo '$(srcdir)/'`version.c - -libversion_a-version.obj: version.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libversion_a_CFLAGS) $(CFLAGS) -MT libversion_a-version.obj -MD -MP -MF $(DEPDIR)/libversion_a-version.Tpo -c -o libversion_a-version.obj `if test -f 'version.c'; then $(CYGPATH_W) 'version.c'; else $(CYGPATH_W) '$(srcdir)/version.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libversion_a-version.Tpo $(DEPDIR)/libversion_a-version.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='version.c' object='libversion_a-version.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libversion_a_CFLAGS) $(CFLAGS) -c -o libversion_a-version.obj `if test -f 'version.c'; then $(CYGPATH_W) 'version.c'; else $(CYGPATH_W) '$(srcdir)/version.c'; fi` -install-man1: $(man1_MANS) - @$(NORMAL_INSTALL) - @list1='$(man1_MANS)'; \ - list2=''; \ - test -n "$(man1dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.1[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(SCRIPTS) $(MANS) \ - uxconfig.h -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f charset/$(DEPDIR)/$(am__dirstamp) - -rm -f charset/$(am__dirstamp) - -rm -f unix/$(DEPDIR)/$(am__dirstamp) - -rm -f unix/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -@HAVE_SETID_CMD_FALSE@install-exec-local: -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ - clean-noinstPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f ./$(DEPDIR)/agentf.Po - -rm -f ./$(DEPDIR)/aqsync.Po - -rm -f ./$(DEPDIR)/be_all_s.Po - -rm -f ./$(DEPDIR)/be_misc.Po - -rm -f ./$(DEPDIR)/be_none.Po - -rm -f ./$(DEPDIR)/be_nos_s.Po - -rm -f ./$(DEPDIR)/be_ssh.Po - -rm -f ./$(DEPDIR)/callback.Po - -rm -f ./$(DEPDIR)/cgtest.Po - -rm -f ./$(DEPDIR)/clicons.Po - -rm -f ./$(DEPDIR)/cmdgen.Po - -rm -f ./$(DEPDIR)/cmdline.Po - -rm -f ./$(DEPDIR)/conf.Po - -rm -f ./$(DEPDIR)/config.Po - -rm -f ./$(DEPDIR)/console.Po - -rm -f ./$(DEPDIR)/cproxy.Po - -rm -f ./$(DEPDIR)/dialog.Po - -rm -f ./$(DEPDIR)/ecc.Po - -rm -f ./$(DEPDIR)/errsock.Po - -rm -f ./$(DEPDIR)/fuzzterm.Po - -rm -f ./$(DEPDIR)/import.Po - -rm -f ./$(DEPDIR)/ldisc.Po - -rm -f ./$(DEPDIR)/libversion_a-version.Po - -rm -f ./$(DEPDIR)/logging.Po - -rm -f ./$(DEPDIR)/mainchan.Po - -rm -f ./$(DEPDIR)/marshal.Po - -rm -f ./$(DEPDIR)/memory.Po - -rm -f ./$(DEPDIR)/millerrabin.Po - -rm -f ./$(DEPDIR)/minibidi.Po - -rm -f ./$(DEPDIR)/misc.Po - -rm -f ./$(DEPDIR)/miscucs.Po - -rm -f ./$(DEPDIR)/mpint.Po - -rm -f ./$(DEPDIR)/mpunsafe.Po - -rm -f ./$(DEPDIR)/nocmdline.Po - -rm -f ./$(DEPDIR)/nocproxy.Po - -rm -f ./$(DEPDIR)/nogss.Po - -rm -f ./$(DEPDIR)/norand.Po - -rm -f ./$(DEPDIR)/noterm.Po - -rm -f ./$(DEPDIR)/notiming.Po - -rm -f ./$(DEPDIR)/nullplug.Po - -rm -f ./$(DEPDIR)/pageant.Po - -rm -f ./$(DEPDIR)/pgssapi.Po - -rm -f ./$(DEPDIR)/pinger.Po - -rm -f ./$(DEPDIR)/pockle.Po - -rm -f ./$(DEPDIR)/portfwd.Po - -rm -f ./$(DEPDIR)/primecandidate.Po - -rm -f ./$(DEPDIR)/proxy.Po - -rm -f ./$(DEPDIR)/pscp.Po - -rm -f ./$(DEPDIR)/psftp.Po - -rm -f ./$(DEPDIR)/psftpcommon.Po - -rm -f ./$(DEPDIR)/psocks.Po - -rm -f ./$(DEPDIR)/raw.Po - -rm -f ./$(DEPDIR)/rlogin.Po - -rm -f ./$(DEPDIR)/scpserver.Po - -rm -f ./$(DEPDIR)/sesschan.Po - -rm -f ./$(DEPDIR)/sessprep.Po - -rm -f ./$(DEPDIR)/settings.Po - -rm -f ./$(DEPDIR)/sftp.Po - -rm -f ./$(DEPDIR)/sftpcommon.Po - -rm -f ./$(DEPDIR)/sftpserver.Po - -rm -f ./$(DEPDIR)/smallprimes.Po - -rm -f ./$(DEPDIR)/ssh.Po - -rm -f ./$(DEPDIR)/ssh1bpp.Po - -rm -f ./$(DEPDIR)/ssh1censor.Po - -rm -f ./$(DEPDIR)/ssh1connection-client.Po - -rm -f ./$(DEPDIR)/ssh1connection-server.Po - -rm -f ./$(DEPDIR)/ssh1connection.Po - -rm -f ./$(DEPDIR)/ssh1login-server.Po - -rm -f ./$(DEPDIR)/ssh1login.Po - -rm -f ./$(DEPDIR)/ssh2bpp-bare.Po - -rm -f ./$(DEPDIR)/ssh2bpp.Po - -rm -f ./$(DEPDIR)/ssh2censor.Po - -rm -f ./$(DEPDIR)/ssh2connection-client.Po - -rm -f ./$(DEPDIR)/ssh2connection-server.Po - -rm -f ./$(DEPDIR)/ssh2connection.Po - -rm -f ./$(DEPDIR)/ssh2kex-client.Po - -rm -f ./$(DEPDIR)/ssh2kex-server.Po - -rm -f ./$(DEPDIR)/ssh2transhk.Po - -rm -f ./$(DEPDIR)/ssh2transport.Po - -rm -f ./$(DEPDIR)/ssh2userauth-server.Po - -rm -f ./$(DEPDIR)/ssh2userauth.Po - -rm -f ./$(DEPDIR)/sshaes.Po - -rm -f ./$(DEPDIR)/ssharcf.Po - -rm -f ./$(DEPDIR)/sshargon2.Po - -rm -f ./$(DEPDIR)/sshauxcrypt.Po - -rm -f ./$(DEPDIR)/sshbcrypt.Po - -rm -f ./$(DEPDIR)/sshblake2.Po - -rm -f ./$(DEPDIR)/sshblowf.Po - -rm -f ./$(DEPDIR)/sshccp.Po - -rm -f ./$(DEPDIR)/sshcommon.Po - -rm -f ./$(DEPDIR)/sshcrc.Po - -rm -f ./$(DEPDIR)/sshcrcda.Po - -rm -f ./$(DEPDIR)/sshdes.Po - -rm -f ./$(DEPDIR)/sshdh.Po - -rm -f ./$(DEPDIR)/sshdss.Po - -rm -f ./$(DEPDIR)/sshdssg.Po - -rm -f ./$(DEPDIR)/sshecc.Po - -rm -f ./$(DEPDIR)/sshecdsag.Po - -rm -f ./$(DEPDIR)/sshgssc.Po - -rm -f ./$(DEPDIR)/sshhmac.Po - -rm -f ./$(DEPDIR)/sshmac.Po - -rm -f ./$(DEPDIR)/sshmd5.Po - -rm -f ./$(DEPDIR)/sshprime.Po - -rm -f ./$(DEPDIR)/sshprng.Po - -rm -f ./$(DEPDIR)/sshpubk.Po - -rm -f ./$(DEPDIR)/sshrand.Po - -rm -f ./$(DEPDIR)/sshrsa.Po - -rm -f ./$(DEPDIR)/sshrsag.Po - -rm -f ./$(DEPDIR)/sshserver.Po - -rm -f ./$(DEPDIR)/sshsh256.Po - -rm -f ./$(DEPDIR)/sshsh512.Po - -rm -f ./$(DEPDIR)/sshsha.Po - -rm -f ./$(DEPDIR)/sshsha3.Po - -rm -f ./$(DEPDIR)/sshshare.Po - -rm -f ./$(DEPDIR)/sshutils.Po - -rm -f ./$(DEPDIR)/sshverstring.Po - -rm -f ./$(DEPDIR)/sshzlib.Po - -rm -f ./$(DEPDIR)/stripctrl.Po - -rm -f ./$(DEPDIR)/supdup.Po - -rm -f ./$(DEPDIR)/telnet.Po - -rm -f ./$(DEPDIR)/terminal.Po - -rm -f ./$(DEPDIR)/testcrypt.Po - -rm -f ./$(DEPDIR)/testsc.Po - -rm -f ./$(DEPDIR)/testzlib.Po - -rm -f ./$(DEPDIR)/time.Po - -rm -f ./$(DEPDIR)/timing.Po - -rm -f ./$(DEPDIR)/tree234.Po - -rm -f ./$(DEPDIR)/utils.Po - -rm -f ./$(DEPDIR)/wcwidth.Po - -rm -f ./$(DEPDIR)/wildcard.Po - -rm -f ./$(DEPDIR)/x11fwd.Po - -rm -f charset/$(DEPDIR)/fromucs.Po - -rm -f charset/$(DEPDIR)/localenc.Po - -rm -f charset/$(DEPDIR)/macenc.Po - -rm -f charset/$(DEPDIR)/mimeenc.Po - -rm -f charset/$(DEPDIR)/sbcs.Po - -rm -f charset/$(DEPDIR)/sbcsdat.Po - -rm -f charset/$(DEPDIR)/slookup.Po - -rm -f charset/$(DEPDIR)/toucs.Po - -rm -f charset/$(DEPDIR)/utf8.Po - -rm -f charset/$(DEPDIR)/xenc.Po - -rm -f unix/$(DEPDIR)/gtkapp.Po - -rm -f unix/$(DEPDIR)/gtkask.Po - -rm -f unix/$(DEPDIR)/gtkcfg.Po - -rm -f unix/$(DEPDIR)/gtkcols.Po - -rm -f unix/$(DEPDIR)/gtkcomm.Po - -rm -f unix/$(DEPDIR)/gtkdlg.Po - -rm -f unix/$(DEPDIR)/gtkfont.Po - -rm -f unix/$(DEPDIR)/gtkmain.Po - -rm -f unix/$(DEPDIR)/gtkmisc.Po - -rm -f unix/$(DEPDIR)/gtkwin.Po - -rm -f unix/$(DEPDIR)/osxlaunch.Po - -rm -f unix/$(DEPDIR)/procnet.Po - -rm -f unix/$(DEPDIR)/ux_x11.Po - -rm -f unix/$(DEPDIR)/uxagentc.Po - -rm -f unix/$(DEPDIR)/uxagentsock.Po - -rm -f unix/$(DEPDIR)/uxcfg.Po - -rm -f unix/$(DEPDIR)/uxcliloop.Po - -rm -f unix/$(DEPDIR)/uxcons.Po - -rm -f unix/$(DEPDIR)/uxfdsock.Po - -rm -f unix/$(DEPDIR)/uxgen.Po - -rm -f unix/$(DEPDIR)/uxgss.Po - -rm -f unix/$(DEPDIR)/uxmisc.Po - -rm -f unix/$(DEPDIR)/uxnet.Po - -rm -f unix/$(DEPDIR)/uxnogtk.Po - -rm -f unix/$(DEPDIR)/uxnoise.Po - -rm -f unix/$(DEPDIR)/uxpeer.Po - -rm -f unix/$(DEPDIR)/uxpgnt.Po - -rm -f unix/$(DEPDIR)/uxplink.Po - -rm -f unix/$(DEPDIR)/uxpoll.Po - -rm -f unix/$(DEPDIR)/uxprint.Po - -rm -f unix/$(DEPDIR)/uxproxy.Po - -rm -f unix/$(DEPDIR)/uxpsusan.Po - -rm -f unix/$(DEPDIR)/uxpterm.Po - -rm -f unix/$(DEPDIR)/uxpty.Po - -rm -f unix/$(DEPDIR)/uxputty.Po - -rm -f unix/$(DEPDIR)/uxsel.Po - -rm -f unix/$(DEPDIR)/uxser.Po - -rm -f unix/$(DEPDIR)/uxserver.Po - -rm -f unix/$(DEPDIR)/uxsftp.Po - -rm -f unix/$(DEPDIR)/uxsftpserver.Po - -rm -f unix/$(DEPDIR)/uxshare.Po - -rm -f unix/$(DEPDIR)/uxsignal.Po - -rm -f unix/$(DEPDIR)/uxsocks.Po - -rm -f unix/$(DEPDIR)/uxstore.Po - -rm -f unix/$(DEPDIR)/uxucs.Po - -rm -f unix/$(DEPDIR)/uxutils.Po - -rm -f unix/$(DEPDIR)/x11misc.Po - -rm -f unix/$(DEPDIR)/xkeysym.Po - -rm -f unix/$(DEPDIR)/xpmptcfg.Po - -rm -f unix/$(DEPDIR)/xpmpterm.Po - -rm -f unix/$(DEPDIR)/xpmpucfg.Po - -rm -f unix/$(DEPDIR)/xpmputty.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-man - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-exec-local - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man1 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f ./$(DEPDIR)/agentf.Po - -rm -f ./$(DEPDIR)/aqsync.Po - -rm -f ./$(DEPDIR)/be_all_s.Po - -rm -f ./$(DEPDIR)/be_misc.Po - -rm -f ./$(DEPDIR)/be_none.Po - -rm -f ./$(DEPDIR)/be_nos_s.Po - -rm -f ./$(DEPDIR)/be_ssh.Po - -rm -f ./$(DEPDIR)/callback.Po - -rm -f ./$(DEPDIR)/cgtest.Po - -rm -f ./$(DEPDIR)/clicons.Po - -rm -f ./$(DEPDIR)/cmdgen.Po - -rm -f ./$(DEPDIR)/cmdline.Po - -rm -f ./$(DEPDIR)/conf.Po - -rm -f ./$(DEPDIR)/config.Po - -rm -f ./$(DEPDIR)/console.Po - -rm -f ./$(DEPDIR)/cproxy.Po - -rm -f ./$(DEPDIR)/dialog.Po - -rm -f ./$(DEPDIR)/ecc.Po - -rm -f ./$(DEPDIR)/errsock.Po - -rm -f ./$(DEPDIR)/fuzzterm.Po - -rm -f ./$(DEPDIR)/import.Po - -rm -f ./$(DEPDIR)/ldisc.Po - -rm -f ./$(DEPDIR)/libversion_a-version.Po - -rm -f ./$(DEPDIR)/logging.Po - -rm -f ./$(DEPDIR)/mainchan.Po - -rm -f ./$(DEPDIR)/marshal.Po - -rm -f ./$(DEPDIR)/memory.Po - -rm -f ./$(DEPDIR)/millerrabin.Po - -rm -f ./$(DEPDIR)/minibidi.Po - -rm -f ./$(DEPDIR)/misc.Po - -rm -f ./$(DEPDIR)/miscucs.Po - -rm -f ./$(DEPDIR)/mpint.Po - -rm -f ./$(DEPDIR)/mpunsafe.Po - -rm -f ./$(DEPDIR)/nocmdline.Po - -rm -f ./$(DEPDIR)/nocproxy.Po - -rm -f ./$(DEPDIR)/nogss.Po - -rm -f ./$(DEPDIR)/norand.Po - -rm -f ./$(DEPDIR)/noterm.Po - -rm -f ./$(DEPDIR)/notiming.Po - -rm -f ./$(DEPDIR)/nullplug.Po - -rm -f ./$(DEPDIR)/pageant.Po - -rm -f ./$(DEPDIR)/pgssapi.Po - -rm -f ./$(DEPDIR)/pinger.Po - -rm -f ./$(DEPDIR)/pockle.Po - -rm -f ./$(DEPDIR)/portfwd.Po - -rm -f ./$(DEPDIR)/primecandidate.Po - -rm -f ./$(DEPDIR)/proxy.Po - -rm -f ./$(DEPDIR)/pscp.Po - -rm -f ./$(DEPDIR)/psftp.Po - -rm -f ./$(DEPDIR)/psftpcommon.Po - -rm -f ./$(DEPDIR)/psocks.Po - -rm -f ./$(DEPDIR)/raw.Po - -rm -f ./$(DEPDIR)/rlogin.Po - -rm -f ./$(DEPDIR)/scpserver.Po - -rm -f ./$(DEPDIR)/sesschan.Po - -rm -f ./$(DEPDIR)/sessprep.Po - -rm -f ./$(DEPDIR)/settings.Po - -rm -f ./$(DEPDIR)/sftp.Po - -rm -f ./$(DEPDIR)/sftpcommon.Po - -rm -f ./$(DEPDIR)/sftpserver.Po - -rm -f ./$(DEPDIR)/smallprimes.Po - -rm -f ./$(DEPDIR)/ssh.Po - -rm -f ./$(DEPDIR)/ssh1bpp.Po - -rm -f ./$(DEPDIR)/ssh1censor.Po - -rm -f ./$(DEPDIR)/ssh1connection-client.Po - -rm -f ./$(DEPDIR)/ssh1connection-server.Po - -rm -f ./$(DEPDIR)/ssh1connection.Po - -rm -f ./$(DEPDIR)/ssh1login-server.Po - -rm -f ./$(DEPDIR)/ssh1login.Po - -rm -f ./$(DEPDIR)/ssh2bpp-bare.Po - -rm -f ./$(DEPDIR)/ssh2bpp.Po - -rm -f ./$(DEPDIR)/ssh2censor.Po - -rm -f ./$(DEPDIR)/ssh2connection-client.Po - -rm -f ./$(DEPDIR)/ssh2connection-server.Po - -rm -f ./$(DEPDIR)/ssh2connection.Po - -rm -f ./$(DEPDIR)/ssh2kex-client.Po - -rm -f ./$(DEPDIR)/ssh2kex-server.Po - -rm -f ./$(DEPDIR)/ssh2transhk.Po - -rm -f ./$(DEPDIR)/ssh2transport.Po - -rm -f ./$(DEPDIR)/ssh2userauth-server.Po - -rm -f ./$(DEPDIR)/ssh2userauth.Po - -rm -f ./$(DEPDIR)/sshaes.Po - -rm -f ./$(DEPDIR)/ssharcf.Po - -rm -f ./$(DEPDIR)/sshargon2.Po - -rm -f ./$(DEPDIR)/sshauxcrypt.Po - -rm -f ./$(DEPDIR)/sshbcrypt.Po - -rm -f ./$(DEPDIR)/sshblake2.Po - -rm -f ./$(DEPDIR)/sshblowf.Po - -rm -f ./$(DEPDIR)/sshccp.Po - -rm -f ./$(DEPDIR)/sshcommon.Po - -rm -f ./$(DEPDIR)/sshcrc.Po - -rm -f ./$(DEPDIR)/sshcrcda.Po - -rm -f ./$(DEPDIR)/sshdes.Po - -rm -f ./$(DEPDIR)/sshdh.Po - -rm -f ./$(DEPDIR)/sshdss.Po - -rm -f ./$(DEPDIR)/sshdssg.Po - -rm -f ./$(DEPDIR)/sshecc.Po - -rm -f ./$(DEPDIR)/sshecdsag.Po - -rm -f ./$(DEPDIR)/sshgssc.Po - -rm -f ./$(DEPDIR)/sshhmac.Po - -rm -f ./$(DEPDIR)/sshmac.Po - -rm -f ./$(DEPDIR)/sshmd5.Po - -rm -f ./$(DEPDIR)/sshprime.Po - -rm -f ./$(DEPDIR)/sshprng.Po - -rm -f ./$(DEPDIR)/sshpubk.Po - -rm -f ./$(DEPDIR)/sshrand.Po - -rm -f ./$(DEPDIR)/sshrsa.Po - -rm -f ./$(DEPDIR)/sshrsag.Po - -rm -f ./$(DEPDIR)/sshserver.Po - -rm -f ./$(DEPDIR)/sshsh256.Po - -rm -f ./$(DEPDIR)/sshsh512.Po - -rm -f ./$(DEPDIR)/sshsha.Po - -rm -f ./$(DEPDIR)/sshsha3.Po - -rm -f ./$(DEPDIR)/sshshare.Po - -rm -f ./$(DEPDIR)/sshutils.Po - -rm -f ./$(DEPDIR)/sshverstring.Po - -rm -f ./$(DEPDIR)/sshzlib.Po - -rm -f ./$(DEPDIR)/stripctrl.Po - -rm -f ./$(DEPDIR)/supdup.Po - -rm -f ./$(DEPDIR)/telnet.Po - -rm -f ./$(DEPDIR)/terminal.Po - -rm -f ./$(DEPDIR)/testcrypt.Po - -rm -f ./$(DEPDIR)/testsc.Po - -rm -f ./$(DEPDIR)/testzlib.Po - -rm -f ./$(DEPDIR)/time.Po - -rm -f ./$(DEPDIR)/timing.Po - -rm -f ./$(DEPDIR)/tree234.Po - -rm -f ./$(DEPDIR)/utils.Po - -rm -f ./$(DEPDIR)/wcwidth.Po - -rm -f ./$(DEPDIR)/wildcard.Po - -rm -f ./$(DEPDIR)/x11fwd.Po - -rm -f charset/$(DEPDIR)/fromucs.Po - -rm -f charset/$(DEPDIR)/localenc.Po - -rm -f charset/$(DEPDIR)/macenc.Po - -rm -f charset/$(DEPDIR)/mimeenc.Po - -rm -f charset/$(DEPDIR)/sbcs.Po - -rm -f charset/$(DEPDIR)/sbcsdat.Po - -rm -f charset/$(DEPDIR)/slookup.Po - -rm -f charset/$(DEPDIR)/toucs.Po - -rm -f charset/$(DEPDIR)/utf8.Po - -rm -f charset/$(DEPDIR)/xenc.Po - -rm -f unix/$(DEPDIR)/gtkapp.Po - -rm -f unix/$(DEPDIR)/gtkask.Po - -rm -f unix/$(DEPDIR)/gtkcfg.Po - -rm -f unix/$(DEPDIR)/gtkcols.Po - -rm -f unix/$(DEPDIR)/gtkcomm.Po - -rm -f unix/$(DEPDIR)/gtkdlg.Po - -rm -f unix/$(DEPDIR)/gtkfont.Po - -rm -f unix/$(DEPDIR)/gtkmain.Po - -rm -f unix/$(DEPDIR)/gtkmisc.Po - -rm -f unix/$(DEPDIR)/gtkwin.Po - -rm -f unix/$(DEPDIR)/osxlaunch.Po - -rm -f unix/$(DEPDIR)/procnet.Po - -rm -f unix/$(DEPDIR)/ux_x11.Po - -rm -f unix/$(DEPDIR)/uxagentc.Po - -rm -f unix/$(DEPDIR)/uxagentsock.Po - -rm -f unix/$(DEPDIR)/uxcfg.Po - -rm -f unix/$(DEPDIR)/uxcliloop.Po - -rm -f unix/$(DEPDIR)/uxcons.Po - -rm -f unix/$(DEPDIR)/uxfdsock.Po - -rm -f unix/$(DEPDIR)/uxgen.Po - -rm -f unix/$(DEPDIR)/uxgss.Po - -rm -f unix/$(DEPDIR)/uxmisc.Po - -rm -f unix/$(DEPDIR)/uxnet.Po - -rm -f unix/$(DEPDIR)/uxnogtk.Po - -rm -f unix/$(DEPDIR)/uxnoise.Po - -rm -f unix/$(DEPDIR)/uxpeer.Po - -rm -f unix/$(DEPDIR)/uxpgnt.Po - -rm -f unix/$(DEPDIR)/uxplink.Po - -rm -f unix/$(DEPDIR)/uxpoll.Po - -rm -f unix/$(DEPDIR)/uxprint.Po - -rm -f unix/$(DEPDIR)/uxproxy.Po - -rm -f unix/$(DEPDIR)/uxpsusan.Po - -rm -f unix/$(DEPDIR)/uxpterm.Po - -rm -f unix/$(DEPDIR)/uxpty.Po - -rm -f unix/$(DEPDIR)/uxputty.Po - -rm -f unix/$(DEPDIR)/uxsel.Po - -rm -f unix/$(DEPDIR)/uxser.Po - -rm -f unix/$(DEPDIR)/uxserver.Po - -rm -f unix/$(DEPDIR)/uxsftp.Po - -rm -f unix/$(DEPDIR)/uxsftpserver.Po - -rm -f unix/$(DEPDIR)/uxshare.Po - -rm -f unix/$(DEPDIR)/uxsignal.Po - -rm -f unix/$(DEPDIR)/uxsocks.Po - -rm -f unix/$(DEPDIR)/uxstore.Po - -rm -f unix/$(DEPDIR)/uxucs.Po - -rm -f unix/$(DEPDIR)/uxutils.Po - -rm -f unix/$(DEPDIR)/x11misc.Po - -rm -f unix/$(DEPDIR)/xkeysym.Po - -rm -f unix/$(DEPDIR)/xpmptcfg.Po - -rm -f unix/$(DEPDIR)/xpmpterm.Po - -rm -f unix/$(DEPDIR)/xpmpucfg.Po - -rm -f unix/$(DEPDIR)/xpmputty.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-man - -uninstall-man: uninstall-man1 - -.MAKE: all check check-am install install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ - check-am check-local clean clean-binPROGRAMS clean-cscope \ - clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \ - cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-hdr distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-exec-local install-html \ - install-html-am install-info install-info-am install-man \ - install-man1 install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-man uninstall-man1 - -.PRECIOUS: Makefile - -@AUTO_GIT_COMMIT_TRUE@empty.h: $(allsources) -@AUTO_GIT_COMMIT_TRUE@ echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@ - -# Run the cryptsuite tests as part of 'make check'. Override -# PUTTY_TESTCRYPT so that cryptsuite will take the testcrypt binary -# from the build directory instead of the source directory, in case -# this is an out-of-tree build. -check-local: testcrypt - PUTTY_TESTCRYPT=./testcrypt $(srcdir)/test/cryptsuite.py -@HAVE_SETID_CMD_TRUE@install-exec-local: -@HAVE_SETID_CMD_TRUE@ @SETID_CMD@ $(bindir)/pterm -@HAVE_SETID_CMD_TRUE@ chmod @SETID_MODE@ $(bindir)/pterm -@HAVE_QUARTZ_TRUE@unix/PuTTY.app: unix/putty.bundle puttyapp osxlaunch -@HAVE_QUARTZ_TRUE@ rm -rf $@ && PUTTY_GTK_PREFIX_FROM_MAKEFILE=$$(pkg-config --variable=prefix gtk+-3.0) gtk-mac-bundler $< -@HAVE_QUARTZ_TRUE@unix/Pterm.app: unix/pterm.bundle ptermapp osxlaunch -@HAVE_QUARTZ_TRUE@ rm -rf $@ && PUTTY_GTK_PREFIX_FROM_MAKEFILE=$$(pkg-config --variable=prefix gtk+-3.0) gtk-mac-bundler $< - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/code/README b/code/README index de6eb9b..c996c3a 100644 --- a/code/README +++ b/code/README @@ -1,123 +1,26 @@ -This is the README for the source archive of PuTTY, a free Windows -and Unix Telnet and SSH client. +This is the README for PuTTY, a free Windows and Unix Telnet and SSH +client. -If you want to rebuild PuTTY from source, we provide a variety of -Makefiles and equivalents. (If you have fetched the source from -Git, you'll have to generate the Makefiles yourself -- see -below.) +PuTTY is built using CMake . To compile in the +simplest way (on any of Linux, Windows or Mac), run these commands in +the source directory: -There are various compile-time directives that you can use to -disable or modify certain features; it may be necessary to do this -in some environments. They are documented in `Recipe', and in -comments in many of the generated Makefiles. + cmake . + cmake --build . -For building on Windows: +Then, to install in the simplest way on Linux or Mac: - - windows/Makefile.vc is for command-line builds on MS Visual C++ - systems. Change into the `windows' subdirectory and type `nmake - -f Makefile.vc' to build all the PuTTY binaries. + cmake --build . --target install - As of 2017, we successfully compile PuTTY with both Visual Studio - 7 (2003) and Visual Studio 14 (2015), so our guess is that it will - probably build with versions in between those as well. - - (The binaries from Visual Studio 14 are only compatible with - Windows XP and up. Binaries from Visual Studio 7 ought to work - with anything from Windows 95 onward.) - - - Inside the windows/MSVC subdirectory are MS Visual Studio project - files for doing GUI-based builds of the various PuTTY utilities. - These have been tested on Visual Studio 7 and 10. - - You should be able to build each PuTTY utility by loading the - corresponding .dsp file in Visual Studio. For example, - MSVC/putty/putty.dsp builds PuTTY itself, MSVC/plink/plink.dsp - builds Plink, and so on. - - - windows/Makefile.mgw is for MinGW / Cygwin installations. Type - `make -f Makefile.mgw' while in the `windows' subdirectory to - build all the PuTTY binaries. - - MinGW and friends can lag behind other toolchains in their support - for the Windows API. Compile-time levers are provided to exclude - some features; the defaults are set appropriately for the - 'mingw-w64' cross-compiler provided with Ubuntu 14.04. If you are - using an older toolchain, you may need to exclude more features; - alternatively, you may find that upgrading to a recent version of - the 'w32api' package helps. - - - windows/Makefile.lcc is for lcc-win32. Type `make -f - Makefile.lcc' while in the `windows' subdirectory. (You will - probably need to specify COMPAT=-DNO_MULTIMON.) - - - Inside the windows/DEVCPP subdirectory are Dev-C++ project - files for doing GUI-based builds of the various PuTTY utilities. - -The PuTTY team actively use Makefile.vc (with VC7/10) and Makefile.mgw -(with mingw32), so we'll probably notice problems with those -toolchains fairly quickly. Please report any problems with the other -toolchains mentioned above. - -For building on Unix: - - - unix/configure is for Unix and GTK. If you don't have GTK, you - should still be able to build the command-line utilities (PSCP, - PSFTP, Plink, PuTTYgen) using this script. To use it, change into - the `unix' subdirectory, run `./configure' and then `make'. Or you - can do the same in the top-level directory (we provide a little - wrapper that invokes configure one level down), which is more like - a normal Unix source archive but doesn't do so well at keeping the - per-platform stuff in each platform's subdirectory; it's up to you. - - - unix/Makefile.gtk and unix/Makefile.ux are for non-autoconfigured - builds. These makefiles expect you to change into the `unix' - subdirectory, then run `make -f Makefile.gtk' or `make -f - Makefile.ux' respectively. Makefile.gtk builds all the programs but - relies on Gtk, whereas Makefile.ux builds only the command-line - utilities and has no Gtk dependence. - - - For the graphical utilities, any of Gtk+-1.2, Gtk+-2.0, and Gtk+-3.0 - should be supported. If you have more than one installed, you can - manually specify which one you want by giving the option - '--with-gtk=N' to the configure script where N is 1, 2, or 3. - (The default is the newest available, of course.) In the absence - of any Gtk version, the configure script will automatically - construct a Makefile which builds only the command-line utilities; - you can manually create this condition by giving configure the - option '--without-gtk'. - - - pterm would like to be setuid or setgid, as appropriate, to permit - it to write records of user logins to /var/run/utmp and - /var/log/wtmp. (Of course it will not use this privilege for - anything else, and in particular it will drop all privileges before - starting up complex subsystems like GTK.) By default the makefile - will not attempt to add privileges to the pterm executable at 'make - install' time, but you can ask it to do so by running configure - with the option '--enable-setuid=USER' or '--enable-setgid=GROUP'. - - - The Unix Makefiles have an `install' target. Note that by default - it tries to install `man' pages; if you have fetched the source via - Git then you will need to have built these using Halibut - first - see below. - - - It's also possible to build the Windows version of PuTTY to run - on Unix by using Winelib. To do this, change to the `windows' - directory and run `make -f Makefile.mgw CC=winegcc RC=wrc'. - -All of the Makefiles are generated automatically from the file -`Recipe' by the Perl script `mkfiles.pl' (except for the Unix one, -which is generated by the `configure' script; mkfiles.pl only -generates the input to automake). Additions and corrections to Recipe, -mkfiles.pl and/or configure.ac are much more useful than additions and -corrections to the actual Makefiles, Makefile.am or Makefile.in. - -The Unix `configure' script and its various requirements are generated -by the shell script `mkauto.sh', which requires GNU Autoconf, GNU -Automake, and Gtk; if you've got the source from Git rather -than using one of our source snapshots, you'll need to run this -yourself. The input file to Automake is generated by mkfiles.pl along -with all the rest of the makefiles, so you will need to run mkfiles.pl -and then mkauto.sh. +On Unix, pterm would like to be setuid or setgid, as appropriate, to +permit it to write records of user logins to /var/run/utmp and +/var/log/wtmp. (Of course it will not use this privilege for +anything else, and in particular it will drop all privileges before +starting up complex subsystems like GTK.) The cmake install step +doesn't attempt to add these privileges, so if you want user login +recording to work, you should manually ch{own,grp} and chmod the +pterm binary yourself after installation. If you don't do this, +pterm will still work, but not update the user login databases. Documentation (in various formats including Windows Help and Unix `man' pages) is built from the Halibut (`.but') files in the `doc' diff --git a/code/Recipe b/code/Recipe deleted file mode 100644 index ea561b6..0000000 --- a/code/Recipe +++ /dev/null @@ -1,431 +0,0 @@ -# -*- makefile -*- -# -# This file describes which PuTTY programs are made up from which -# object and resource files. It is processed into the various -# Makefiles by means of a Perl script. Makefile changes should -# really be made by editing this file and/or the Perl script, not -# by editing the actual Makefiles. - -# ------------------------------------------------------------ -# Top-level configuration. - -# Overall project name. -!name putty -# Locations and types of output Makefiles. -!makefile clangcl windows/Makefile.clangcl -!makefile vc windows/Makefile.vc -!makefile vcproj windows/MSVC -!makefile cygwin windows/Makefile.mgw -!makefile lcc windows/Makefile.lcc -!makefile gtk unix/Makefile.gtk -!makefile unix unix/Makefile.ux -!makefile am Makefile.am -!makefile devcppproj windows/DEVCPP -!makefile vstudio10 windows/VS2010 -!makefile vstudio12 windows/VS2012 -# Source directories. -!srcdir charset/ -!srcdir windows/ -!srcdir unix/ - -# Help text added to the top of each Makefile, with /D converted -# into -D as appropriate for the particular Makefile. - -!begin help -# -# Extra options you can set: -# -# - COMPAT=/DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=/DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=/DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=/DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=/DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=/DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=/DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=/DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=/DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=/DMSVC4 (Windows only) -# - RCFL=/DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need /DNO_SECURITY and /DNO_MULTIMON. -# -# - COMPAT=/DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=/DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=/DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=/DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=/DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. -!end - -# ------------------------------------------------------------ -# Additional text added verbatim to each individual Makefile. - -!cflags am version -!begin am -if AUTO_GIT_COMMIT -BUILT_SOURCES = empty.h -CLEANFILES = empty.h -libversion_a_CFLAGS += -DSOURCE_COMMIT=\"`git --git-dir=$(srcdir)/.git rev-parse HEAD 2>/dev/null`\" -empty.h: $(allsources) - echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@ -endif - -# Run the cryptsuite tests as part of 'make check'. Override -# PUTTY_TESTCRYPT so that cryptsuite will take the testcrypt binary -# from the build directory instead of the source directory, in case -# this is an out-of-tree build. -check-local: testcrypt - PUTTY_TESTCRYPT=./testcrypt $(srcdir)/test/cryptsuite.py - -!end -!begin >empty.h -/* Empty file touched by automake makefile to force rebuild of version.o */ -!end - -!begin vc vars -CFLAGS = $(CFLAGS) /DHAS_GSSAPI -!end - -!begin clangcl vars -CFLAGS += /DHAS_GSSAPI -!end - -# `make install' target for Unix. -!begin gtk -install: - mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) - $(INSTALL_PROGRAM) -m 755 pageant $(DESTDIR)$(bindir)/pageant - $(INSTALL_PROGRAM) -m 755 plink $(DESTDIR)$(bindir)/plink - $(INSTALL_PROGRAM) -m 755 pscp $(DESTDIR)$(bindir)/pscp - $(INSTALL_PROGRAM) -m 755 psftp $(DESTDIR)$(bindir)/psftp - $(INSTALL_PROGRAM) -m 755 pterm $(DESTDIR)$(bindir)/pterm - if test -n "$(UTMP_GROUP)"; then \ - chgrp $(UTMP_GROUP) $(DESTDIR)$(bindir)/pterm && \ - chmod 2755 $(DESTDIR)$(bindir)/pterm; \ - elif test -n "$(UTMP_USER)"; then \ - chown $(UTMP_USER) $(DESTDIR)$(bindir)/pterm && \ - chmod 4755 $(DESTDIR)$(bindir)/pterm; \ - fi - $(INSTALL_PROGRAM) -m 755 putty $(DESTDIR)$(bindir)/putty - $(INSTALL_PROGRAM) -m 755 puttygen $(DESTDIR)$(bindir)/puttygen - $(INSTALL_PROGRAM) -m 755 puttytel $(DESTDIR)$(bindir)/puttytel - $(INSTALL_DATA) -m 644 ../doc/pageant.1 $(DESTDIR)$(man1dir)/pageant.1 - $(INSTALL_DATA) -m 644 ../doc/plink.1 $(DESTDIR)$(man1dir)/plink.1 - $(INSTALL_DATA) -m 644 ../doc/pscp.1 $(DESTDIR)$(man1dir)/pscp.1 - $(INSTALL_DATA) -m 644 ../doc/psftp.1 $(DESTDIR)$(man1dir)/psftp.1 - $(INSTALL_DATA) -m 644 ../doc/pterm.1 $(DESTDIR)$(man1dir)/pterm.1 - $(INSTALL_DATA) -m 644 ../doc/putty.1 $(DESTDIR)$(man1dir)/putty.1 - $(INSTALL_DATA) -m 644 ../doc/puttygen.1 $(DESTDIR)$(man1dir)/puttygen.1 - $(INSTALL_DATA) -m 644 ../doc/puttytel.1 $(DESTDIR)$(man1dir)/puttytel.1 - -install-strip: - $(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" -!end - -# List the man pages for the automake makefile. -!begin am -if HAVE_GTK -man1_MANS = doc/plink.1 doc/pscp.1 doc/psftp.1 doc/puttygen.1 doc/psusan.1 \ - doc/pageant.1 doc/pterm.1 doc/putty.1 doc/puttytel.1 -else -man1_MANS = doc/plink.1 doc/pscp.1 doc/psftp.1 doc/puttygen.1 doc/psusan.1 -endif -!end - -# In automake, chgrp/chmod pterm after installation, if configured to. -!begin am -if HAVE_SETID_CMD -install-exec-local: - @SETID_CMD@ $(bindir)/pterm - chmod @SETID_MODE@ $(bindir)/pterm -endif -!end - -# In automake makefile, build the OS X app bundle, if configured in -# Quartz mode. -!begin am -if HAVE_QUARTZ -noinst_SCRIPTS = unix/PuTTY.app unix/Pterm.app -unix/PuTTY.app: unix/putty.bundle puttyapp osxlaunch - rm -rf $@ && PUTTY_GTK_PREFIX_FROM_MAKEFILE=$$(pkg-config --variable=prefix gtk+-3.0) gtk-mac-bundler $< -unix/Pterm.app: unix/pterm.bundle ptermapp osxlaunch - rm -rf $@ && PUTTY_GTK_PREFIX_FROM_MAKEFILE=$$(pkg-config --variable=prefix gtk+-3.0) gtk-mac-bundler $< -endif -!end - -# Random symbols. -!begin cygwin vars -# _WIN32_IE is required to expose identifiers that only make sense on -# systems with IE5+ installed, such as some arguments to SHGetFolderPath(). -# WINVER etc perform a similar function for FlashWindowEx(). -CFLAGS += -D_WIN32_IE=0x0500 -CFLAGS += -DWINVER=0x0500 -D_WIN32_WINDOWS=0x0410 -D_WIN32_WINNT=0x0500 -!end - -# ------------------------------------------------------------ -# Definitions of object groups. A group name, followed by an =, -# followed by any number of objects or other already-defined group -# names. A line beginning `+' is assumed to continue the previous -# line. - -# conf.c and its dependencies. -CONF = conf marshal - -# Terminal emulator and its (platform-independent) dependencies. -TERMINAL = terminal stripctrl wcwidth logging tree234 minibidi - + config dialog CONF - -# GUI front end and terminal emulator (putty, puttytel). -GUITERM = TERMINAL window windlg winctrls sizetip winprint winutils - + wincfg winhelp winjump sessprep winselgui - -# Same thing on Unix. -UXTERM = TERMINAL uxcfg uxucs uxprint timing callback miscucs -GTKTERM = UXTERM gtkwin gtkcfg gtkdlg gtkfont gtkcols gtkmisc xkeysym - + x11misc gtkcomm sessprep -GTKMAIN = gtkmain cmdline - -# Non-SSH back ends (putty, puttytel, plink). -NONSSH = telnet raw rlogin supdup ldisc pinger - -# SSH back end (putty, plink, pscp, psftp). -ARITH = mpint ecc -SSHCRYPTO = ARITH sshmd5 sshsha sshsh256 sshsh512 sshsha3 sshblake2 sshargon2 - + sshrsa sshdss sshecc - + sshdes sshblowf sshaes sshccp ssharcf - + sshdh sshcrc sshcrcda sshauxcrypt - + sshhmac -SSHCOMMON = sshcommon sshutils sshprng sshrand SSHCRYPTO - + sshverstring - + sshpubk sshzlib - + sshmac marshal nullplug - + sshgssc pgssapi wildcard ssh1censor ssh2censor ssh2bpp - + ssh2transport ssh2transhk ssh2connection portfwd x11fwd - + ssh1connection ssh1bpp ssh2bpp-bare -SSH = SSHCOMMON ssh - + ssh1login ssh2userauth - + pinger - + sshshare aqsync agentf - + mainchan ssh2kex-client ssh2connection-client ssh1connection-client -WINSSH = SSH winnoise wincapi winpgntc wingss winshare winnps winnpc - + winhsock errsock -UXSSH = SSH uxnoise uxagentc uxgss uxshare - -# SFTP implementation (pscp, psftp). -SFTP = psftpcommon sftp sftpcommon logging cmdline - -# Components of the prime-generation system. -SSHPRIME = sshprime smallprimes primecandidate millerrabin pockle mpunsafe - -# Miscellaneous objects appearing in all the utilities, or all the -# network ones, or the Unix or Windows subsets of those in turn. -MISC = misc utils marshal memory stripctrl wcwidth -MISCNETCOMMON = timing callback MISC version tree234 CONF -MISCNET = MISCNETCOMMON be_misc settings proxy -WINMISC = MISCNET winstore winnet winhandl cmdline windefs winmisc winproxy - + wintime winhsock errsock winsecur winucs miscucs winmiscs -UXMISCCOMMON = MISCNETCOMMON uxstore uxsel uxpoll uxnet uxpeer uxmisc time - + uxfdsock errsock -UXMISC = MISCNET UXMISCCOMMON uxproxy uxutils - -# SSH server. -SSHSERVER = SSHCOMMON sshserver settings be_none logging ssh2kex-server - + ssh2userauth-server sshrsag SSHPRIME ssh2connection-server - + sesschan sftpcommon sftpserver proxy cproxy ssh1login-server - + ssh1connection-server scpserver - -# import.c and dependencies, for PuTTYgen-like utilities that have to -# load foreign key files. -IMPORT = import sshbcrypt sshblowf marshal - -# Character set library, for use in pterm. -CHARSET = sbcsdat slookup sbcs utf8 toucs fromucs xenc mimeenc macenc localenc - -# Standard libraries. -LIBS = advapi32.lib user32.lib gdi32.lib comdlg32.lib - + shell32.lib imm32.lib ole32.lib - -# Network backend sets. This also brings in the relevant attachment -# to proxy.c depending on whether we're crypto-avoidant or not. -BE_ALL = be_all cproxy -BE_NOSSH = be_nossh norand nocproxy -BE_SSH = be_ssh cproxy -BE_NONE = be_none nocproxy -# More backend sets, with the additional Windows serial-port module. -W_BE_ALL = be_all_s winser cproxy -W_BE_NOSSH = be_nos_s norand winser nocproxy -# And with the Unix serial-port module. -U_BE_ALL = be_all_s uxser cproxy -U_BE_NOSSH = be_nos_s norand uxser nocproxy - -# Auxiliary crypto modules used by key generators. -KEYGEN = sshrsag sshdssg sshecdsag - -# ------------------------------------------------------------ -# Definitions of actual programs. The program name, followed by a -# colon, followed by a list of objects. Also in the list may be the -# keywords [G] for Windows GUI app, [C] for Console app, [X] for -# X/GTK Unix app, [U] for command-line Unix app. - -putty : [G] GUITERM NONSSH WINSSH W_BE_ALL WINMISC winx11 putty.res LIBS -puttytel : [G] GUITERM NONSSH W_BE_NOSSH WINMISC puttytel.res nogss LIBS -plink : [C] winplink wincons console NONSSH WINSSH W_BE_ALL logging WINMISC - + winx11 plink.res winnojmp sessprep noterm winnohlp winselcli - + clicons wincliloop console LIBS -pscp : [C] pscp winsftp wincons WINSSH BE_SSH SFTP wildcard WINMISC - + pscp.res winnojmp winnohlp winselcli clicons wincliloop - + console LIBS -psftp : [C] psftp winsftp wincons WINSSH BE_SSH SFTP wildcard WINMISC - + psftp.res winnojmp winnohlp winselcli clicons wincliloop - + console LIBS - -pageant : [G] winpgnt pageant sshrsa sshpubk sshdes ARITH sshmd5 version - + tree234 MISC sshaes sshsha winsecur winpgntc aqsync sshdss sshsh256 - + sshsh512 winutils sshecc winmisc winmiscs winhelp conf pageant.res - + sshauxcrypt sshhmac wincapi winnps winnpc winhsock errsock winnet - + winhandl callback be_misc winselgui winhandl sshsha3 sshblake2 - + sshargon2 LIBS - -puttygen : [G] winpgen KEYGEN SSHPRIME sshdes ARITH sshmd5 version - + sshrand winnoise sshsha winstore MISC winctrls sshrsa sshdss winmisc - + sshpubk sshaes sshsh256 sshsh512 IMPORT winutils puttygen.res - + tree234 notiming winhelp winnojmp CONF LIBS wintime sshecc sshprng - + sshauxcrypt sshhmac winsecur winmiscs sshsha3 sshblake2 sshargon2 - -pterm : [X] GTKTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore - + uxsignal CHARSET cmdline uxpterm version time xpmpterm xpmptcfg - + nogss utils memory GTKMAIN -putty : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore - + uxsignal CHARSET uxputty NONSSH UXSSH UXMISC ux_x11 xpmputty - + xpmpucfg utils memory GTKMAIN -puttytel : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_NOSSH - + uxstore uxsignal CHARSET uxputty NONSSH UXMISC xpmputty xpmpucfg - + nogss utils memory GTKMAIN - -plink : [U] uxplink uxcons NONSSH UXSSH U_BE_ALL logging UXMISC uxsignal - + ux_x11 noterm uxnogtk sessprep cmdline clicons uxcliloop console - -PUTTYGEN_UNIX = KEYGEN SSHPRIME sshdes ARITH sshmd5 version sshprng - + sshrand uxnoise sshsha MISC sshrsa sshdss uxcons uxstore uxmisc - + sshpubk sshaes sshsh256 sshsh512 IMPORT puttygen.res time tree234 - + uxgen notiming CONF sshecc sshsha3 uxnogtk sshauxcrypt sshhmac - + uxpoll uxutils sshblake2 sshargon2 console -puttygen : [U] cmdgen PUTTYGEN_UNIX -cgtest : [UT] cgtest PUTTYGEN_UNIX - -pscp : [U] pscp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC uxnogtk - + clicons uxcliloop console -psftp : [U] psftp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC uxnogtk - + clicons uxcliloop console - -pageant : [X] uxpgnt uxagentc aqsync pageant sshrsa sshpubk sshdes ARITH - + sshmd5 version tree234 misc sshaes sshsha sshdss sshsh256 sshsh512 - + sshecc CONF uxsignal nocproxy nogss be_none x11fwd ux_x11 uxcons - + gtkask gtkmisc nullplug logging UXMISC uxagentsock utils memory - + sshauxcrypt sshhmac sshprng uxnoise uxcliloop sshsha3 sshblake2 - + sshargon2 console - -ptermapp : [XT] GTKTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore - + uxsignal CHARSET uxpterm version time xpmpterm xpmptcfg - + nogss gtkapp nocmdline utils memory -puttyapp : [XT] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore - + uxsignal CHARSET uxputty NONSSH UXSSH UXMISC ux_x11 xpmputty - + xpmpucfg gtkapp nocmdline utils memory -osxlaunch : [UT] osxlaunch - -fuzzterm : [UT] UXTERM CHARSET MISC version uxmisc uxucs fuzzterm time settings - + uxstore be_none uxnogtk memory -testcrypt : [UT] testcrypt SSHCRYPTO sshprng SSHPRIME sshpubk marshal utils - + memory tree234 uxutils KEYGEN -testcrypt : [C] testcrypt SSHCRYPTO sshprng SSHPRIME sshpubk marshal utils - + memory tree234 winmiscs KEYGEN -testsc : [UT] testsc SSHCRYPTO marshal utils memory tree234 wildcard - + sshmac uxutils sshpubk -testzlib : [UT] testzlib sshzlib utils marshal memory - -uppity : [UT] uxserver SSHSERVER UXMISC uxsignal uxnoise uxgss uxnogtk - + uxpty uxsftpserver ux_x11 uxagentsock procnet uxcliloop -psusan : [U] uxpsusan SSHSERVER UXMISC uxsignal uxnoise nogss uxnogtk - + uxpty uxsftpserver ux_x11 uxagentsock procnet uxcliloop - -PSOCKS = psocks portfwd conf sshutils logging proxy nocproxy timing callback - + time tree234 version errsock be_misc norand MISC -psocks : [C] PSOCKS winsocks wincons winproxy winnet winmisc winselcli - + winhsock winhandl winmiscs winnohlp wincliloop console LIBS -psocks : [UT] PSOCKS uxsocks uxcons uxproxy uxnet uxmisc uxpoll uxsel uxnogtk - + uxpeer uxfdsock uxcliloop uxsignal console - -# ---------------------------------------------------------------------- -# On Windows, provide a means of removing local test binaries that we -# aren't going to actually ship. (I prefer this to not building them -# in the first place, so that we find out about build breakage early.) -!begin vc -cleantestprogs: - -del $(BUILDDIR)testcrypt.exe $(BUILDDIR)psocks.exe -!end -!begin clangcl -cleantestprogs: - -rm -f $(BUILDDIR)testcrypt.exe $(BUILDDIR)psocks.exe -!end diff --git a/code/aclocal.m4 b/code/aclocal.m4 deleted file mode 100644 index 66dbd88..0000000 --- a/code/aclocal.m4 +++ /dev/null @@ -1,1876 +0,0 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program 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. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# Configure paths for GTK+ -# Owen Taylor 1997-2001 - -# Version number used by aclocal, see `info automake Serials`. -# Increment on every change. -#serial 1 - -dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, -dnl pass to pkg-config -dnl -AC_DEFUN([AM_PATH_GTK_2_0], -[dnl -dnl Get the cflags and libraries from pkg-config -dnl -AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], - , enable_gtktest=yes) - - pkg_config_args=gtk+-2.0 - for module in . $4 - do - case "$module" in - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - esac - done - - no_gtk="" - - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - PKG_PROG_PKG_CONFIG([0.7]) - - min_gtk_version=ifelse([$1], ,2.0.0,$1) - AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) - - if test x$PKG_CONFIG != xno ; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" - enable_gtktest=no - fi - - if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then - : - else - no_gtk=yes - fi - fi - - if test x"$no_gtk" = x ; then - GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` - GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` - gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_gtktest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" -dnl -dnl Now check if the installed GTK+ is sufficiently new. (Also sanity -dnl checks the results of pkg-config to some extent) -dnl - rm -f conf.gtktest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - fclose (fopen ("conf.gtktest", "w")); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - exit(1); - } - - if ((gtk_major_version != $gtk_config_major_version) || - (gtk_minor_version != $gtk_config_minor_version) || - (gtk_micro_version != $gtk_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", - $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((gtk_major_version != GTK_MAJOR_VERSION) || - (gtk_minor_version != GTK_MINOR_VERSION) || - (gtk_micro_version != GTK_MICRO_VERSION)) - { - printf("*** GTK+ header files (version %d.%d.%d) do not match\n", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - } - else - { - if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gtk" = x ; then - AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$PKG_CONFIG" = "no" ; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://pkgconfig.sourceforge.net" - else - if test -f conf.gtktest ; then - : - else - echo "*** Could not run GTK+ test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK+ or finding the wrong" - echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GTK_CFLAGS="" - GTK_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GTK_CFLAGS) - AC_SUBST(GTK_LIBS) - rm -f conf.gtktest -]) - -# Configure paths for GTK+ -# Owen Taylor 1997-2001 - -# Version number used by aclocal, see `info automake Serials`. -# Increment on every change. -#serial 1 - -dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, -dnl pass to pkg-config -dnl -AC_DEFUN([AM_PATH_GTK_3_0], -[m4_warn([obsolete], [AM_PATH_GTK_3_0 is deprecated, use PKG_CHECK_MODULES([GTK], [gtk+-3.0]) instead]) -dnl Get the cflags and libraries from pkg-config -dnl -AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], - , enable_gtktest=yes) - min_gtk_version=ifelse([$1], [], [3.0.0], [$1]) - - pkg_config_args="gtk+-3.0 >= $min_gtk_version" - for module in . $4 - do - case "$module" in - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - esac - done - - no_gtk="" - - PKG_PROG_PKG_CONFIG([0.16]) - - if test -z "$PKG_CONFIG"; then - no_gtk=yes - fi - - AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) - - if test -n "$PKG_CONFIG"; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" - enable_gtktest=no - fi - - if $PKG_CONFIG $pkg_config_args; then - : - else - no_gtk=yes - fi - fi - - if test x"$no_gtk" = x ; then - GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` - GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` - gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_gtktest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" -dnl -dnl Now check if the installed GTK+ is sufficiently new. (Also sanity -dnl checks the results of pkg-config to some extent) -dnl - rm -f conf.gtktest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - unsigned int major, minor, micro; - - fclose (fopen ("conf.gtktest", "w")); - - if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - exit(1); - } - - if ((gtk_major_version != $gtk_config_major_version) || - (gtk_minor_version != $gtk_config_minor_version) || - (gtk_micro_version != $gtk_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", - $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((gtk_major_version != GTK_MAJOR_VERSION) || - (gtk_minor_version != GTK_MINOR_VERSION) || - (gtk_micro_version != GTK_MICRO_VERSION)) - { - printf("*** GTK+ header files (version %d.%d.%d) do not match\n", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - } - else - { - if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n", - major, minor, micro); - printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gtk" = x ; then - AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test -z "$PKG_CONFIG"; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://pkgconfig.sourceforge.net" - else - if test -f conf.gtktest ; then - : - else - echo "*** Could not run GTK+ test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK+ or finding the wrong" - echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed."]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GTK_CFLAGS="" - GTK_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GTK_CFLAGS) - AC_SUBST(GTK_LIBS) - rm -f conf.gtktest -]) - -dnl GTK_CHECK_BACKEND(BACKEND-NAME [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Tests for BACKEND-NAME in the GTK targets list -dnl -AC_DEFUN([GTK_CHECK_BACKEND], -[m4_warn([obsolete], [GTK_CHECK_BACKEND is deprecated, use PKG_CHECK_MODULES([GTK_X11], [gtk+-x11-3.0]) or similar instead]) - pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0) - min_gtk_version=ifelse([$2],,3.0.0,$2) - pkg_config_args="$pkg_config_args >= $min_gtk_version" - - PKG_PROG_PKG_CONFIG([0.16]) - AS_IF([test -z "$PKG_CONFIG"], [AC_MSG_ERROR([No pkg-config found])]) - - if $PKG_CONFIG $pkg_config_args ; then - target_found=yes - else - target_found=no - fi - - if test "x$target_found" = "xno"; then - ifelse([$4],,[AC_MSG_ERROR([Backend $backend not found.])],[$4]) - else - ifelse([$3],,[:],[$3]) - fi -]) - -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) -dnl -dnl Copyright © 2004 Scott James Remnant . -dnl Copyright © 2012-2015 Dan Nicholson -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR - -# Copyright (C) 2002-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# Copyright (C) 2011-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_AR([ACT-IF-FAIL]) -# ------------------------- -# Try to determine the archiver interface, and trigger the ar-lib wrapper -# if it is needed. If the detection of archiver interface fails, run -# ACT-IF-FAIL (default is to abort configure with a proper error message). -AC_DEFUN([AM_PROG_AR], -[AC_BEFORE([$0], [LT_INIT])dnl -AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([ar-lib])dnl -AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) -: ${AR=ar} - -AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [AC_LANG_PUSH([C]) - am_cv_ar_interface=ar - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], - [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([am_ar_try]) - if test "$ac_status" -eq 0; then - am_cv_ar_interface=ar - else - am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([am_ar_try]) - if test "$ac_status" -eq 0; then - am_cv_ar_interface=lib - else - am_cv_ar_interface=unknown - fi - fi - rm -f conftest.lib libconftest.a - ]) - AC_LANG_POP([C])]) - -case $am_cv_ar_interface in -ar) - ;; -lib) - # Microsoft lib, so override with the ar-lib wrapper script. - # FIXME: It is wrong to rewrite AR. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__AR in this case, - # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something - # similar. - AR="$am_aux_dir/ar-lib $AR" - ;; -unknown) - m4_default([$1], - [AC_MSG_ERROR([could not determine $AR interface])]) - ;; -esac -AC_SUBST([AR])dnl -]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. -AC_DEFUN([AM_MAKE_INCLUDE], -[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -AC_SUBST([am__quote])]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - diff --git a/code/ar-lib b/code/ar-lib deleted file mode 100644 index 0baa4f6..0000000 --- a/code/ar-lib +++ /dev/null @@ -1,270 +0,0 @@ -#! /bin/sh -# Wrapper for Microsoft lib.exe - -me=ar-lib -scriptversion=2012-03-01.08; # UTC - -# Copyright (C) 2010-2018 Free Software Foundation, Inc. -# Written by Peter Rosin . -# -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - - -# func_error message -func_error () -{ - echo "$me: $1" 1>&2 - exit 1 -} - -file_conv= - -# func_file_conv build_file -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv in - mingw) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_at_file at_file operation archive -# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE -# for each of them. -# When interpreting the content of the @FILE, do NOT use func_file_conv, -# since the user would need to supply preconverted file names to -# binutils ar, at least for MinGW. -func_at_file () -{ - operation=$2 - archive=$3 - at_file_contents=`cat "$1"` - eval set x "$at_file_contents" - shift - - for member - do - $AR -NOLOGO $operation:"$member" "$archive" || exit $? - done -} - -case $1 in - '') - func_error "no command. Try '$0 --help' for more information." - ;; - -h | --h*) - cat < -#include "putty.h" - -/* - * This appname is not strictly in the right place, since Plink - * also uses this module. However, Plink doesn't currently use any - * of the dialog-box sorts of things that make use of appname, so - * it shouldn't do any harm here. I'm trying to avoid having to - * have tiny little source modules containing nothing but - * declarations of appname, for as long as I can... - */ -const char *const appname = "PuTTY"; - -const int be_default_protocol = PROT_SSH; - -const struct BackendVtable *const backends[] = { - &ssh_backend, - &telnet_backend, - &rlogin_backend, - &supdup_backend, - &raw_backend, - &sshconn_backend, - NULL -}; - -const size_t n_ui_backends = 1; diff --git a/code/be_all_s.c b/code/be_all_s.c deleted file mode 100644 index 4e50293..0000000 --- a/code/be_all_s.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Linking module for PuTTY proper: list the available backends - * including ssh, plus the serial backend. - */ - -#include -#include "putty.h" - -/* - * This appname is not strictly in the right place, since Plink - * also uses this module. However, Plink doesn't currently use any - * of the dialog-box sorts of things that make use of appname, so - * it shouldn't do any harm here. I'm trying to avoid having to - * have tiny little source modules containing nothing but - * declarations of appname, for as long as I can... - */ -const char *const appname = "PuTTY"; - -const int be_default_protocol = PROT_SSH; - -const struct BackendVtable *const backends[] = { - &ssh_backend, - &serial_backend, - &telnet_backend, - &rlogin_backend, - &supdup_backend, - &raw_backend, - &sshconn_backend, - NULL -}; - -const size_t n_ui_backends = 2; diff --git a/code/be_list.c b/code/be_list.c new file mode 100644 index 0000000..09437a6 --- /dev/null +++ b/code/be_list.c @@ -0,0 +1,118 @@ +/* + * Source file that is rebuilt per application, and provides the list + * of backends, the default protocol, and the application name. + * + * This file expects the build system to provide some per-application + * definitions on the compiler command line. So you don't just add it + * directly to the sources list for an application. Instead you call + * the be_list() function defined in setup.cmake, e.g. + * + * be_list(target-name AppName [SSH] [SERIAL] [OTHERBACKENDS]) + * + * This translates into the following command-line macro definitions + * used by the code below: + * + * - APPNAME should be defined to the name of the program, in + * user-facing capitalisation (e.g. PuTTY rather than putty). + * Unquoted: it's easier to stringify it in the preprocessor than + * to persuade cmake to put the right quotes on the command line on + * all build platforms. + * + * - The following macros should each be defined to 1 if a given set + * of backends should be added to the backends[] list, or 0 if they + * should not be: + * + * * SSH: the two SSH backends (SSH proper, and bare-ssh-connection) + * + * * SERIAL: the serial port backend + * + * * OTHERBACKENDS: the non-cryptographic network protocol backends + * (Telnet, Rlogin, SUPDUP, Raw) + */ + +#include +#include "putty.h" + +const char *const appname = STR(APPNAME); + +/* + * Define the default protocol for the application. This is always a + * network backend (serial ports come second behind network, in every + * case). Applications that don't have either (such as pterm) don't + * need this variable anyway, so just set it to -1. + */ +#if SSH +const int be_default_protocol = PROT_SSH; +#elif OTHERBACKENDS +const int be_default_protocol = PROT_TELNET; +#else +const int be_default_protocol = -1; +#endif + +/* + * List all the configured backends, in the order they should appear + * in the config box. + */ +const struct BackendVtable *const backends[] = { + /* + * Start with the most-preferred network-remote-login protocol. + * That's SSH if present, otherwise Telnet if present. + */ +#if SSH + &ssh_backend, +#elif OTHERBACKENDS + &telnet_backend, /* Telnet at the top if SSH is absent */ +#endif + + /* + * Second on the list is the serial-port backend, if available. + */ +#if SERIAL + &serial_backend, +#endif + + /* + * After that come the remaining network protocols: Telnet if it + * hasn't already appeared above, and Rlogin, SUPDUP and Raw. + */ +#if OTHERBACKENDS && SSH + &telnet_backend, /* only if SSH displaced it at the top */ +#endif +#if OTHERBACKENDS + &rlogin_backend, + &supdup_backend, + &raw_backend, +#endif + + /* + * Bare ssh-connection / PSUSAN is a niche protocol and goes well + * down the list. + */ +#if SSH + &sshconn_backend, +#endif + + /* + * Done. Null pointer to mark the end of the list. + */ + NULL +}; + +/* + * Number of backends at the start of the above list that should have + * radio buttons in the config UI. + * + * The rule is: the most-preferred network backend, and Serial, each + * get a radio button if present. + * + * The rest will be relegated to a dropdown list. + */ +const size_t n_ui_backends = + 0 +#if SSH || OTHERBACKENDS + + 1 +#endif +#if SERIAL + + 1 +#endif + ; diff --git a/code/be_none.c b/code/be_none.c deleted file mode 100644 index 588bb1d..0000000 --- a/code/be_none.c +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Linking module for programs that do not support selection of backend - * (such as pterm). - */ - -#include -#include "putty.h" - -const int be_default_protocol = -1; - -const struct BackendVtable *const backends[] = { - NULL -}; - -const size_t n_ui_backends = 0; diff --git a/code/be_nos_s.c b/code/be_nos_s.c deleted file mode 100644 index 097433a..0000000 --- a/code/be_nos_s.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Linking module for PuTTYtel: list the available backends not - * including ssh. - */ - -#include -#include "putty.h" - -const int be_default_protocol = PROT_TELNET; - -const char *const appname = "PuTTYtel"; - -const struct BackendVtable *const backends[] = { - &telnet_backend, - &serial_backend, - &rlogin_backend, - &supdup_backend, - &raw_backend, - NULL -}; - -const size_t n_ui_backends = 2; diff --git a/code/be_nossh.c b/code/be_nossh.c deleted file mode 100644 index 1c94f3a..0000000 --- a/code/be_nossh.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Linking module for PuTTYtel: list the available backends not - * including ssh. - */ - -#include -#include "putty.h" - -const int be_default_protocol = PROT_TELNET; - -const char *const appname = "PuTTYtel"; - -const struct BackendVtable *const backends[] = { - &telnet_backend, - &rlogin_backend, - &supdup_backend, - &raw_backend, - NULL -}; - -const size_t n_ui_backends = 1; diff --git a/code/be_ssh.c b/code/be_ssh.c deleted file mode 100644 index 81be62d..0000000 --- a/code/be_ssh.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Linking module for programs that are restricted to only using - * SSH-type protocols (pscp and psftp). These still have a choice of - * two actual backends, because they can also speak PROT_SSHCONN. - */ - -#include -#include "putty.h" - -const int be_default_protocol = PROT_SSH; - -const struct BackendVtable *const backends[] = { - &ssh_backend, - &sshconn_backend, - NULL -}; - -const size_t n_ui_backends = 0; /* not used in programs with a config UI */ diff --git a/code/cert/cert_capi.c b/code/cert/cert_capi.c index c5c128a..cfca9c7 100644 --- a/code/cert/cert_capi.c +++ b/code/cert/cert_capi.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "cert_common.h" @@ -88,7 +87,6 @@ BOOL cert_capi_test_hash(LPCSTR szCert, DWORD iHashRequest) (pProviderInfo = (PCRYPT_KEY_PROV_INFO)snewn(iProviderInfoSize, BYTE)), &iProviderInfoSize) != FALSE) { HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv = 0; - NCRYPT_KEY_HANDLE hNCryptKey = 0; NCRYPT_PROV_HANDLE hNCryptProv = 0; if (CryptAcquireContextW(&hCryptProv, pProviderInfo->pwszContainerName, @@ -120,7 +118,7 @@ BOOL cert_capi_test_hash(LPCSTR szCert, DWORD iHashRequest) return bHashSuccess; } -BYTE * cert_capi_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iDataToSignLen, int * iSigLen, LPCSTR sHashAlgName) +BYTE* cert_capi_sign(struct ssh2_userkey* userkey, LPCBYTE pDataToSign, int iDataToSignLen, int* iSigLen, LPCSTR sHashAlgName) { // use flags to determine requested signature hash algorithm ALG_ID iHashAlg = CALG_SHA1; @@ -153,7 +151,7 @@ BYTE * cert_capi_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iD DWORD iProviderInfoSize = 0; if (CertGetCertificateContextProperty(pCertCtx, CERT_KEY_PROV_INFO_PROP_ID, NULL, &iProviderInfoSize) != FALSE && CertGetCertificateContextProperty(pCertCtx, CERT_KEY_PROV_INFO_PROP_ID, - (pProviderInfo = (PCRYPT_KEY_PROV_INFO)snewn(iProviderInfoSize, BYTE)), &iProviderInfoSize) != FALSE) + (pProviderInfo = (PCRYPT_KEY_PROV_INFO)snewn(iProviderInfoSize, BYTE)), &iProviderInfoSize) != FALSE) { LPBYTE pSig = NULL; DWORD iSig = 0; @@ -202,12 +200,12 @@ BYTE * cert_capi_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iD NCryptOpenKey(hNCryptProv, &hNCryptKey, pProviderInfo->pwszContainerName, pProviderInfo->dwKeySpec, 0) == ERROR_SUCCESS) { // set pin prompt - WCHAR * szPin = NULL; + WCHAR* szPin = NULL; if (cert_cache_enabled((DWORD)-1) && (szPin = cert_pin(userkey->comment, TRUE, NULL)) != NULL) { DWORD iLength = (1 + wcslen(szPin)) * sizeof(WCHAR); - (void) NCryptSetProperty(hNCryptKey, NCRYPT_PIN_PROPERTY, (PBYTE)szPin, iLength, 0); + (void)NCryptSetProperty(hNCryptKey, NCRYPT_PIN_PROPERTY, (PBYTE)szPin, iLength, 0); } // setup structure padding @@ -258,13 +256,146 @@ BYTE * cert_capi_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iD return pSignedData; } -HCERTSTORE cert_capi_get_cert_store(LPCSTR * szHint, HWND hWnd) +HCERTSTORE cert_capi_get_cert_store(LPCSTR* szHint, HWND hWnd) { UNREFERENCED_PARAMETER(hWnd); + // no library hint needed for fido if (szHint != NULL) *szHint = NULL; + return CertOpenStore(CERT_STORE_PROV_SYSTEM_W, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, 0, - CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_READONLY_FLAG | CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_ENUM_ARCHIVED_FLAG, L"MY"); + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_ENUM_ARCHIVED_FLAG, L"MY"); +} + +BOOL cert_capi_create_key(LPCSTR szAlgName, LPCSTR sSubjectName, BOOL bHardware) +{ + LPCWSTR szAlg = NULL; + DWORD iBits = 0; + if (false); + else if (strcmp(szAlgName, "rsa-1024") != 0) { iBits = 1024; szAlg = NCRYPT_RSA_ALGORITHM; } + else if (strcmp(szAlgName, "rsa-2048") != 0) { iBits = 2048; szAlg = NCRYPT_RSA_ALGORITHM; } + else if (strcmp(szAlgName, "rsa-3096") != 0) { iBits = 3096; szAlg = NCRYPT_RSA_ALGORITHM; } + else if (strcmp(szAlgName, "rsa-4096") != 0) { iBits = 4096; szAlg = NCRYPT_RSA_ALGORITHM; } + else if (strcmp(szAlgName, "ecdsa-sha2-nistp256") == 0) szAlg = NCRYPT_ECDSA_P256_ALGORITHM; + else if (strstr(szAlgName, "ecdsa-sha2-nistp384") == 0) szAlg = NCRYPT_ECDSA_P384_ALGORITHM; + else if (strcmp(szAlgName, "ecdsa-sha2-nistp512") == 0) szAlg = NCRYPT_ECDSA_P521_ALGORITHM; + else return false; + + // decorate the name for the cert + BYTE sNameBufferEncoded[1024] = { 0 }; + WCHAR sNameBufferWithCn[1024] = { 0 }; + CERT_NAME_BLOB tSubjectNameDecorated = { sizeof(sNameBufferEncoded), sNameBufferEncoded }; + if (swprintf_s(&sNameBufferWithCn[0], _countof(sNameBufferWithCn), L"CN=%S", sSubjectName) == -1 || + CertStrToNameW(X509_ASN_ENCODING, sNameBufferWithCn, 0, NULL, + tSubjectNameDecorated.pbData, &tSubjectNameDecorated.cbData, NULL) == 0) + { + return FALSE; + } + + // create crytographic key + BOOL bCertSuccess = FALSE; + NCRYPT_KEY_HANDLE hKey = (NCRYPT_KEY_HANDLE)NULL; + NCRYPT_PROV_HANDLE hProvider = (NCRYPT_PROV_HANDLE)NULL; + if (NCryptOpenStorageProvider(&hProvider, bHardware ? MS_SMART_CARD_KEY_STORAGE_PROVIDER : + MS_KEY_STORAGE_PROVIDER, 0) == ERROR_SUCCESS && + NCryptCreatePersistedKey(hProvider, &hKey, szAlg, + sNameBufferWithCn, AT_SIGNATURE, 0) == ERROR_SUCCESS && + (iBits == 0 || NCryptSetProperty(hKey, NCRYPT_LENGTH_PROPERTY, + (PBYTE)&iBits, sizeof(iBits), NCRYPT_PERSIST_FLAG) == ERROR_SUCCESS) && + NCryptFinalizeKey(hKey, 0) == ERROR_SUCCESS) + { + // give the certificate the client auth and smartcard logon attributes + LPSTR tKeyUsageSoftware[] = { szOID_PKIX_KP_CLIENT_AUTH }; + LPSTR tKeyUsageHardware[] = { szOID_KP_SMARTCARD_LOGON, szOID_PKIX_KP_CLIENT_AUTH }; + CERT_ENHKEY_USAGE tEnhancedKeyUsage = { + (bHardware) ? _countof(tKeyUsageHardware) : _countof(tKeyUsageSoftware), + (bHardware) ? tKeyUsageHardware : tKeyUsageSoftware + }; + + BYTE sKeyUsageEncoded[32]; + DWORD iKeyUsageEncodedSize = sizeof(sKeyUsageEncoded); + CryptEncodeObject(X509_ASN_ENCODING, X509_ENHANCED_KEY_USAGE, (LPVOID)&tEnhancedKeyUsage, &sKeyUsageEncoded[0], &iKeyUsageEncodedSize); + CERT_EXTENSION tExtension = { 0 }; + tExtension.pszObjId = szOID_ENHANCED_KEY_USAGE; + tExtension.Value.cbData = iKeyUsageEncodedSize; + tExtension.Value.pbData = &sKeyUsageEncoded[0]; + + // give the certificate a long lifetime + SYSTEMTIME tSystemTimeStart; + GetSystemTime(&tSystemTimeStart); + SYSTEMTIME tSystemTimeEnd = tSystemTimeStart; + tSystemTimeEnd.wYear += 100; + + // create tje certofocate + CERT_EXTENSIONS tExtensions = { 1, &tExtension }; + PCCERT_CONTEXT pContext = CertCreateSelfSignCertificate(hKey, &tSubjectNameDecorated, + 0, NULL, NULL, &tSystemTimeStart, &tSystemTimeEnd, &tExtensions); + if (pContext != NULL) + { + // open the cert store to save the cert + HCERTSTORE hCertStore = CertOpenSystemStoreW((HCRYPTPROV_LEGACY)NULL, L"MY"); + if (hCertStore != NULL) + { + // add the cert to the personal store + bCertSuccess = CertAddCertificateContextToStore(hCertStore, pContext, + CERT_STORE_ADD_REPLACE_EXISTING, NULL); + CertCloseStore(hCertStore, 0); + } + + CertFreeCertificateContext(pContext); + } + } + + if (hKey != (NCRYPT_HANDLE)NULL) NCryptFreeObject(hKey); + if (hProvider != (NCRYPT_HANDLE)NULL) NCryptFreeObject(hProvider); + return bCertSuccess; +} + +BOOL cert_capi_delete_key(LPCSTR szCert) +{ + // get a handle to the certificate + HCERTSTORE hCertStore = NULL; + PCCERT_CONTEXT pCertCtx = NULL; + cert_capi_load_cert(szCert, &pCertCtx, &hCertStore); + if (pCertCtx == NULL) return FALSE; + + BOOL bSuccess = FALSE; + PCRYPT_KEY_PROV_INFO pProviderInfo = NULL; + DWORD iProviderInfoSize = 0; + if (CertGetCertificateContextProperty(pCertCtx, CERT_KEY_PROV_INFO_PROP_ID, NULL, &iProviderInfoSize) != FALSE && + CertGetCertificateContextProperty(pCertCtx, CERT_KEY_PROV_INFO_PROP_ID, + (pProviderInfo = (PCRYPT_KEY_PROV_INFO)snewn(iProviderInfoSize, BYTE)), &iProviderInfoSize) != FALSE) + { + HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv = 0; + NCRYPT_KEY_HANDLE hNCryptKey = 0; + NCRYPT_PROV_HANDLE hNCryptProv = 0; + + if (CryptAcquireContextW(&hCryptProv, pProviderInfo->pwszContainerName, + pProviderInfo->pwszProvName, pProviderInfo->dwProvType, CRYPT_DELETEKEYSET | + ((pProviderInfo->dwFlags & CRYPT_MACHINE_KEYSET) ? CRYPT_MACHINE_KEYSET : 0)) != FALSE) + { + bSuccess = true; + } + else if (NCryptOpenStorageProvider(&hNCryptProv, pProviderInfo->pwszProvName, 0) == ERROR_SUCCESS && + NCryptOpenKey(hNCryptProv, &hNCryptKey, pProviderInfo->pwszContainerName, pProviderInfo->dwKeySpec, 0) == ERROR_SUCCESS) + { + bSuccess = NCryptDeleteKey(hNCryptKey, 0) == ERROR_SUCCESS; + } + + // cleanup crypto structures and intermediate signing data + if (hCryptProv != 0) CryptReleaseContext(hCryptProv, 0); + if (hNCryptProv != 0) NCryptFreeObject(hNCryptProv); + if (hNCryptKey != 0) NCryptFreeObject(hNCryptKey); + if (pProviderInfo != NULL) sfree(pProviderInfo); + } + + // if key was cleaned up, already remove certificate from store + if (bSuccess) CertDeleteCertificateFromStore(pCertCtx); + + // cleanup certificate handles and return + if (pCertCtx != NULL) { CertFreeCertificateContext(pCertCtx); } + if (hCertStore != NULL) { CertCloseStore(hCertStore, 0); } + return bSuccess; } #endif // PUTTY_CAC \ No newline at end of file diff --git a/code/cert/cert_common.c b/code/cert/cert_common.c index b23e0aa..01b78bf 100644 --- a/code/cert/cert_common.c +++ b/code/cert/cert_common.c @@ -10,6 +10,7 @@ #include "cert_pkcs.h" #include "cert_capi.h" +#include "cert_fido.h" #define DEFINE_VARIABLES #include "cert_common.h" @@ -24,8 +25,10 @@ #endif #include "mpint.h" #include "ecc.h" +#include "marshal.h" +#include "misc.h" -void cert_reverse_array(LPBYTE pb, DWORD cb) +VOID cert_reverse_array(LPBYTE pb, DWORD cb) { for (DWORD i = 0, j = cb - 1; i < cb / 2; i++, j--) { @@ -35,7 +38,7 @@ void cert_reverse_array(LPBYTE pb, DWORD cb) } } -LPSTR cert_get_cert_hash(LPCSTR szIden, PCCERT_CONTEXT pCertContext, LPCSTR szHint) +LPSTR cert_get_cert_thumbprint(LPCSTR szIden, PCCERT_CONTEXT pCertContext, LPCSTR szHint) { BYTE pbThumbBinary[SHA1_BINARY_SIZE]; DWORD cbThumbBinary = SHA1_BINARY_SIZE; @@ -48,10 +51,40 @@ LPSTR cert_get_cert_hash(LPCSTR szIden, PCCERT_CONTEXT pCertContext, LPCSTR szHi DWORD iThumbHexSize = _countof(szThumbHex); CryptBinaryToStringA(pbThumbBinary, cbThumbBinary, CRYPT_STRING_HEXRAW | CRYPT_STRING_NOCRLF, (LPSTR)szThumbHex, &iThumbHexSize); - return dupcat(szIden, szThumbHex, (szHint != NULL) ? "=" : "", (szHint != NULL) ? szHint : ""); + + LPSTR szThumb = NULL; + if (cert_is_capipath(szIden)) + { + szThumb = dupprintf("CAPI:%s", &szThumbHex[0]); + } + else if (cert_is_pkcspath((LPSTR)szIden)) + { + // retrieve the pkcs library that was stashed in the custom cert property + WCHAR szFileName[MAX_PATH + 1]; + DWORD cbFileName = sizeof(szFileName); + if (CertGetCertificateContextProperty(pCertContext, CERT_PVK_FILE_PROP_ID, szFileName, &cbFileName) == TRUE) + { + szThumb = dupprintf("PKCS:%s=%S", &szThumbHex[0], szFileName); + } + } + else if (cert_is_fidopath(szIden)) + { + // retrieve the application id that was stashed in the custom cert property + LPWSTR szCertData = NULL; + DWORD iAppIdSize = 1000; + CertGetCertificateContextProperty(pCertContext, CERT_FRIENDLY_NAME_PROP_ID, NULL, &iAppIdSize); + if (iAppIdSize > 0 && (szCertData = malloc(iAppIdSize)) && CertGetCertificateContextProperty( + pCertContext, CERT_FRIENDLY_NAME_PROP_ID, szCertData, &iAppIdSize) == TRUE) + { + szThumb = dupprintf("FIDO:%S", szCertData); + } + free(szCertData); + } + + return szThumb; } -LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect) +LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect, LPCWSTR sCustomPrompt) { HCERTSTORE hCertStore = NULL; LPCSTR szHint = NULL; @@ -60,11 +93,14 @@ LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect) { hCertStore = cert_capi_get_cert_store(&szHint, hWnd); } - - if (cert_is_pkcspath(szIden)) + else if (cert_is_pkcspath(szIden)) { hCertStore = cert_pkcs_get_cert_store(&szHint, hWnd); } + else if (cert_is_fidopath(szIden)) + { + hCertStore = cert_fido_get_cert_store(&szHint, hWnd); + } // return if store could not be loaded if (hCertStore == NULL) return NULL; @@ -79,8 +115,8 @@ LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect) int iCertCount = 0; while ((pCertContext = CertEnumCertificatesInStore(hCertStore, pCertContext)) != NULL) { - // ignore invalid cert sbased on settings - if (!cert_check_valid(pCertContext)) continue; + // ignore invalid certs based on settings + if (!cert_check_valid(szIden, pCertContext)) continue; CertAddCertificateContextToStore(hMemoryStore, pCertContext, CERT_STORE_ADD_ALWAYS, NULL); iCertCount++; @@ -97,8 +133,11 @@ LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect) { // display the certificate selection dialog pCertContext = CryptUIDlgSelectCertificateFromStore(hMemoryStore, hWnd, - L"PuTTY: Select Certificate for Authentication", - L"Please select the certificate that you would like to use for authentication to the remote system.", + L"PuTTY: Select Certificate Or Key", + sCustomPrompt != NULL ? sCustomPrompt : ( + L"Please select the certificate or key identifier that you would like " \ + L"to use for authentication to the remote system. For FIDO keys, PuTTY has " \ + L"generated a dynamic certificate to represent the key within PuTTY."), CRYPTUI_SELECT_LOCATION_COLUMN, 0, NULL); } @@ -109,7 +148,7 @@ LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect) DWORD cbThumbBinary = SHA1_BINARY_SIZE; if (CertGetCertificateContextProperty(pCertContext, CERT_HASH_PROP_ID, pbThumbBinary, &cbThumbBinary) == TRUE) { - szCert = cert_get_cert_hash(IDEN_PREFIX(szIden), pCertContext, szHint); + szCert = cert_get_cert_thumbprint(IDEN_PREFIX(szIden), pCertContext, szHint); } // cleanup @@ -121,19 +160,20 @@ LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect) return szCert; } -BOOL cert_load_cert(LPCSTR szCert, PCERT_CONTEXT * ppCertContext, HCERTSTORE * phCertStore) +BOOL cert_load_cert(LPCSTR szCert, PCERT_CONTEXT* ppCertContext, HCERTSTORE* phCertStore) { - // if capi, get the capi cert if (cert_is_capipath(szCert)) { cert_capi_load_cert(szCert, ppCertContext, phCertStore); } - - // if pkcs, get the pkcs cert - if (cert_is_pkcspath(szCert)) + else if (cert_is_pkcspath(szCert)) { cert_pkcs_load_cert(szCert, ppCertContext, phCertStore); } + else if (cert_is_fidopath(szCert)) + { + cert_fido_load_cert(szCert, ppCertContext, phCertStore); + } // sanity check return (*ppCertContext != NULL); @@ -141,13 +181,15 @@ BOOL cert_load_cert(LPCSTR szCert, PCERT_CONTEXT * ppCertContext, HCERTSTORE * p BOOL cert_test_hash(LPCSTR szCert, DWORD iHashRequest) { - // if capi, get the capi cert if (cert_is_capipath(szCert)) { return cert_capi_test_hash(szCert, iHashRequest); } - - if (cert_is_pkcspath(szCert)) + else if (cert_is_pkcspath(szCert)) + { + return cert_pkcs_test_hash(szCert, iHashRequest); + } + else if (cert_is_fidopath(szCert)) { return cert_pkcs_test_hash(szCert, iHashRequest); } @@ -177,15 +219,16 @@ BOOL cert_confirm_signing(LPCSTR sFingerPrint, LPCSTR sComment) return (iResponse == IDYES); } -LPBYTE cert_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iDataToSignLen, int * iWrappedSigLen, int iAgentFlags) +BOOL cert_sign(struct ssh2_userkey* userkey, LPCBYTE pDataToSign, int iDataToSignLen, int iAgentFlags, strbuf* pSignature) { LPBYTE pRawSig = NULL; + DWORD iCounter = 0; + BYTE iFlags = 0; int iRawSigLen = 0; - *iWrappedSigLen = 0; // sanity check - if (userkey->comment == NULL) return NULL; - + if (userkey->comment == NULL) return FALSE; + // determine hashing algorithm for signing - upgrade to sha2 if possible LPCSTR sHashAlgName = userkey->key->vt->ssh_id; if (strstr(userkey->key->vt->ssh_id, "ssh-rsa") && (iAgentFlags & SSH_AGENT_RSA_SHA2_256) && cert_test_hash(userkey->comment, SSH_AGENT_RSA_SHA2_256)) { @@ -195,105 +238,130 @@ LPBYTE cert_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iDataTo sHashAlgName = "rsa-sha2-512"; } - // if capi, sign data using capi - if (cert_is_capipath(userkey->comment)) + // sign data { - pRawSig = cert_capi_sign(userkey, pDataToSign, iDataToSignLen, &iRawSigLen, sHashAlgName); + if (cert_is_capipath(userkey->comment)) + { + pRawSig = cert_capi_sign(userkey, pDataToSign, iDataToSignLen, &iRawSigLen, sHashAlgName); + } + else if (cert_is_pkcspath(userkey->comment)) + { + pRawSig = cert_pkcs_sign(userkey, pDataToSign, iDataToSignLen, &iRawSigLen, sHashAlgName); + } + else if (cert_is_fidopath(userkey->comment)) + { + pRawSig = cert_fido_sign(userkey, pDataToSign, iDataToSignLen, &iRawSigLen, sHashAlgName, &iCounter, &iFlags); + } + + // sanity check signature + if (pRawSig == NULL) return FALSE; } - // if pkcs, sign data using capi - if (cert_is_pkcspath(userkey->comment)) + // create full wrapped signature payload + if (strstr(userkey->key->vt->ssh_id, "ecdsa-") == userkey->key->vt->ssh_id || + strstr(userkey->key->vt->ssh_id, "sk-ecdsa-") == userkey->key->vt->ssh_id) { - pRawSig = cert_pkcs_sign(userkey, pDataToSign, iDataToSignLen, &iRawSigLen, sHashAlgName); + // For ECDSA keys the signature is encoded: + // + // string "sk-ecdsa-sha2-nistpXXX@openssh.com" + // string ecdsa_signature (wrapped) + // mpint r + // mpint s + // byte flags (sk-only) + // uint32 counter (sk-only) + + // append algorithm + put_stringz(pSignature, userkey->key->vt->ssh_id); + + // append signatures + strbuf* pRawSigWrapped = strbuf_new(); + mp_int* r = mp_from_bytes_be(make_ptrlen(&pRawSig[0], iRawSigLen / 2)); + mp_int* s = mp_from_bytes_be(make_ptrlen(&pRawSig[iRawSigLen / 2], iRawSigLen / 2)); + put_mp_ssh2(pRawSigWrapped, r); + put_mp_ssh2(pRawSigWrapped, s); + put_stringpl(pSignature, ptrlen_from_strbuf(pRawSigWrapped)); + strbuf_free(pRawSigWrapped); + mp_free(r); + mp_free(s); + + if (cert_is_fidopath(userkey->comment)) + { + put_byte(pSignature, iFlags); + put_uint32(pSignature, iCounter); + } } + else if (strstr(userkey->key->vt->ssh_id, "sk-ssh-ed25519") == userkey->key->vt->ssh_id) + { + // For Ed25519 keys the signature is encoded as: + // + // string "sk-ssh-ed25519@openssh.com" + // string signature + // byte flags (sk-only) + // uint32 counter (sk-only) - // sanity check - if (pRawSig == NULL) return NULL; - - // used to hold wrapped signature to return to server - LPBYTE pWrappedSig = NULL; - - if (strstr(userkey->key->vt->ssh_id, "ecdsa-") == userkey->key->vt->ssh_id) - { - // the full ecdsa ssh blob is as follows: - // - // size of algorithm name (4 bytes in big endian) - // algorithm name - // size of padded 'r' and 's' values from windows blob (4 bytes in big endian) - // size of padded 'r' value from signed structure (4 bytes in big endian) - // 1 byte of 0 padding in order to ensure the 'r' value is represented as positive - // the 'r' value (first half of the blob signature returned from windows) - // 1 byte of 0 padding in order to ensure the 's' value is represented as positive - // the 's' value (first half of the blob signature returned from windows) - const BYTE iZero = 0; - int iAlgName = strlen(sHashAlgName); - *iWrappedSigLen = 4 + iAlgName + 4 + 4 + 1 + (iRawSigLen / 2) + 4 + 1 + (iRawSigLen / 2); - pWrappedSig = snewn(*iWrappedSigLen, unsigned char); - unsigned char * pWrappedPos = pWrappedSig; - PUT_32BIT_MSB_FIRST(pWrappedPos, iAlgName); pWrappedPos += 4; - memcpy(pWrappedPos, sHashAlgName, iAlgName); pWrappedPos += iAlgName; - PUT_32BIT_MSB_FIRST(pWrappedPos, iRawSigLen + 4 + 4 + 1 + 1); pWrappedPos += 4; - PUT_32BIT_MSB_FIRST(pWrappedPos, 1 + iRawSigLen / 2); pWrappedPos += 4; - memcpy(pWrappedPos, &iZero, 1); pWrappedPos += 1; - memcpy(pWrappedPos, pRawSig, iRawSigLen / 2); pWrappedPos += iRawSigLen / 2; - PUT_32BIT_MSB_FIRST(pWrappedPos, 1 + iRawSigLen / 2); pWrappedPos += 4; - memcpy(pWrappedPos, &iZero, 1); pWrappedPos += 1; - memcpy(pWrappedPos, pRawSig + iRawSigLen / 2, iRawSigLen / 2); pWrappedPos += iRawSigLen / 2; + // append algorithm + put_stringz(pSignature, userkey->key->vt->ssh_id); + + // append signatures + put_stringpl(pSignature, make_ptrlen(&pRawSig[0], iRawSigLen)); + + if (cert_is_fidopath(userkey->comment)) + { + put_byte(pSignature, iFlags); + put_uint32(pSignature, iCounter); + } } else { - // the full rsa ssh blob is as follows: - // - // size of algorithm name (4 bytes in big endian) - // algorithm name - // size of binary signature (4 bytes in big endian) - // binary signature - int iAlgoNameLen = strlen(sHashAlgName); - *iWrappedSigLen = 4 + iAlgoNameLen + 4 + iRawSigLen; - pWrappedSig = snewn(*iWrappedSigLen, unsigned char); - unsigned char * pWrappedPos = pWrappedSig; - PUT_32BIT_MSB_FIRST(pWrappedPos, iAlgoNameLen); pWrappedPos += 4; - memcpy(pWrappedPos, sHashAlgName, iAlgoNameLen); pWrappedPos += iAlgoNameLen; - PUT_32BIT_MSB_FIRST(pWrappedPos, iRawSigLen); pWrappedPos += 4; - memcpy(pWrappedPos, pRawSig, iRawSigLen); + // For RSA keys the signature is encoded as: + // + // string algorithm + // string signature + + // append algorithm + put_stringz(pSignature, sHashAlgName); + + // append signatures + put_string(pSignature, pRawSig, iRawSigLen); } // cleanup sfree(pRawSig); - return pWrappedSig; + return TRUE; } -struct ssh2_userkey * cert_get_ssh_userkey(LPCSTR szCert, PCERT_CONTEXT pCertContext) +struct ssh2_userkey* cert_get_ssh_userkey(LPCSTR szCert, PCERT_CONTEXT pCertContext) { - struct ssh2_userkey * pUserKey = NULL; + struct ssh2_userkey* pUserKey = NULL; // get a convenience pointer to the algorithm identifier LPCSTR sAlgoId = pCertContext->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId; + LPCSTR sSigAlgId = pCertContext->pCertInfo->SignatureAlgorithm.pszObjId; + + // get convenience pointer to public key blob + PCRYPT_BIT_BLOB pPubKey = _ADDRESSOF(pCertContext->pCertInfo->SubjectPublicKeyInfo.PublicKey); // Handle RSA Keys if (strstr(sAlgoId, _CRT_CONCATENATE(szOID_RSA, ".")) == sAlgoId) { - // get the size of the space required - PCRYPT_BIT_BLOB pKeyData = _ADDRESSOF(pCertContext->pCertInfo->SubjectPublicKeyInfo.PublicKey); - DWORD cbPublicKeyBlob = 0; LPBYTE pbPublicKeyBlob = NULL; - if (CryptDecodeObject(X509_ASN_ENCODING, RSA_CSP_PUBLICKEYBLOB, pKeyData->pbData, - pKeyData->cbData, 0, NULL, &cbPublicKeyBlob) != FALSE && cbPublicKeyBlob != 0 && - CryptDecodeObject(X509_ASN_ENCODING, RSA_CSP_PUBLICKEYBLOB, pKeyData->pbData, - pKeyData->cbData, 0, pbPublicKeyBlob = malloc(cbPublicKeyBlob), &cbPublicKeyBlob) != FALSE) + if (CryptDecodeObject(X509_ASN_ENCODING, RSA_CSP_PUBLICKEYBLOB, pPubKey->pbData, + pPubKey->cbData, 0, NULL, &cbPublicKeyBlob) != FALSE && cbPublicKeyBlob != 0 && + CryptDecodeObject(X509_ASN_ENCODING, RSA_CSP_PUBLICKEYBLOB, pPubKey->pbData, + pPubKey->cbData, 0, pbPublicKeyBlob = malloc(cbPublicKeyBlob), &cbPublicKeyBlob) != FALSE) { // create a new putty rsa structure fill out all non-private params - struct RSAKey * rsa = snew(struct RSAKey); + struct RSAKey* rsa = snew(struct RSAKey); ZeroMemory(rsa, sizeof(struct eddsa_key)); rsa->sshk.vt = find_pubkey_alg("ssh-rsa"); - RSAPUBKEY * pPublicKey = (RSAPUBKEY *)(pbPublicKeyBlob + sizeof(BLOBHEADER)); + RSAPUBKEY* pPublicKey = (RSAPUBKEY*)(pbPublicKeyBlob + sizeof(BLOBHEADER)); rsa->bits = pPublicKey->bitlen; rsa->bytes = pPublicKey->bitlen / 8; rsa->exponent = mp_from_integer(pPublicKey->pubexp); - cert_reverse_array((BYTE *)(pPublicKey)+sizeof(RSAPUBKEY), rsa->bytes); - rsa->modulus = mp_from_bytes_be(make_ptrlen((BYTE *)(pPublicKey)+sizeof(RSAPUBKEY), rsa->bytes)); + cert_reverse_array((BYTE*)(pPublicKey)+sizeof(RSAPUBKEY), rsa->bytes); + rsa->modulus = mp_from_bytes_be(make_ptrlen((BYTE*)(pPublicKey)+sizeof(RSAPUBKEY), rsa->bytes)); rsa->comment = dupstr(szCert); rsa->private_exponent = mp_from_integer(0); rsa->p = mp_from_integer(0); @@ -309,51 +377,82 @@ struct ssh2_userkey * cert_get_ssh_userkey(LPCSTR szCert, PCERT_CONTEXT pCertCon if (pbPublicKeyBlob != NULL) free(pbPublicKeyBlob); } - // Handle ECC Keys + // Handle EDDSA Keys + else if (strstr(sAlgoId, szOID_ECC_PUBLIC_KEY) == sAlgoId && strcmp(sSigAlgId, szOID_ED25119) == 0) + { + // calculate key bit and byte lengths (ignore leading byte) + int iKeyLength = ((pPubKey->cbData - 1) * 8 - pPubKey->cUnusedBits) / 2; + const int iKeyBytes = (iKeyLength + 7) / 8; + LPBYTE pPubKeyData = &pPubKey->pbData[1]; + + // create eddsa struture to hold our key params + struct eddsa_key* ec = snew(struct eddsa_key); + ZeroMemory(ec, sizeof(struct eddsa_key)); + ec_ed_alg_and_curve_by_bits(iKeyLength, &(ec->curve), &(ec->sshk.vt)); + ec->privateKey = mp_from_integer(0); + + // translate v-tables for fido keys + if (cert_is_fidopath(szCert)) + { + if (ec->sshk.vt == &ssh_ecdsa_ed25519) ec->sshk.vt = &ssh_ecdsa_ed25519_sk; + ec->appid = dupstr(IDEN_SPLIT(szCert)); + } + + // calculate public key + mp_int* y = mp_from_bytes_le(make_ptrlen(pPubKeyData, iKeyBytes)); + unsigned desired_x_parity = mp_get_bit(y, ec->curve->fieldBytes * 8 - 1); + mp_set_bit(y, ec->curve->fieldBytes * 8 - 1, 0); + ec->publicKey = ecc_edwards_point_new_from_y(ec->curve->e.ec, y, desired_x_parity); + mp_free(y); + + // fill out the user key + pUserKey = snew(struct ssh2_userkey); + pUserKey->key = &ec->sshk; + pUserKey->comment = dupstr(szCert); + } + + // Handle ECDSA Keys else if (strstr(sAlgoId, szOID_ECC_PUBLIC_KEY) == sAlgoId) { + // fetch lengths + DWORD iKeyLength = 0; + DWORD iKeyLengthSize = sizeof(DWORD); BCRYPT_KEY_HANDLE hBCryptKey = NULL; - if (CryptImportPublicKeyInfoEx2(X509_ASN_ENCODING, _ADDRESSOF(pCertContext->pCertInfo->SubjectPublicKeyInfo), - 0, NULL, &hBCryptKey) != FALSE) + if (CryptImportPublicKeyInfoEx2(X509_ASN_ENCODING, _ADDRESSOF(pCertContext->pCertInfo->SubjectPublicKeyInfo), 0, NULL, &hBCryptKey) == FALSE) return NULL; + BCryptGetProperty(hBCryptKey, BCRYPT_KEY_LENGTH, (PUCHAR)&iKeyLength, iKeyLengthSize, &iKeyLengthSize, 0); + const int iKeyBytes = (iKeyLength + 7) / 8; + + // create ecdsa struture to hold our key params + struct ecdsa_key* ec = snew(struct ecdsa_key); + ZeroMemory(ec, sizeof(struct eddsa_key)); + ec_nist_alg_and_curve_by_bits(iKeyLength, &(ec->curve), &(ec->sshk.vt)); + ec->privateKey = mp_from_integer(0); + + // translate v-tables for fido keys + if (cert_is_fidopath(szCert)) { - DWORD iKeyLength = 0; - ULONG iKeyLengthSize = sizeof(DWORD); - LPBYTE pEccKey = NULL; - ULONG iKeyBlobSize = 0; - - if (BCryptGetProperty(hBCryptKey, BCRYPT_KEY_LENGTH, (PUCHAR)&iKeyLength, iKeyLengthSize, &iKeyLength, 0) == STATUS_SUCCESS && - BCryptExportKey(hBCryptKey, NULL, BCRYPT_ECCPUBLIC_BLOB, NULL, iKeyBlobSize, &iKeyBlobSize, 0) == STATUS_SUCCESS && iKeyBlobSize != 0 && - BCryptExportKey(hBCryptKey, NULL, BCRYPT_ECCPUBLIC_BLOB, pEccKey = malloc(iKeyBlobSize), iKeyBlobSize, &iKeyBlobSize, 0) == STATUS_SUCCESS) - { - // create a new putty ecc structure fill out all non-private params - struct ecdsa_key *ec = snew(struct ecdsa_key); - ZeroMemory(ec, sizeof(struct eddsa_key)); - ec_nist_alg_and_curve_by_bits(iKeyLength, &(ec->curve), &(ec->sshk.vt)); - - int iKeyBytes = (iKeyLength + 7) / 8; // round up - ec->publicKey = ecc_weierstrass_point_new(ec->curve->w.wc, - mp_from_bytes_be(make_ptrlen(pEccKey + sizeof(BCRYPT_ECCKEY_BLOB), iKeyBytes)), - mp_from_bytes_be(make_ptrlen(pEccKey + sizeof(BCRYPT_ECCKEY_BLOB) + iKeyBytes, iKeyBytes))); - ec->privateKey = mp_from_integer(0); - - // fill out the user key - pUserKey = snew(struct ssh2_userkey); - pUserKey->key = &ec->sshk; - pUserKey->comment = dupstr(szCert); - } - - // cleanup - if (pEccKey != NULL) free(pEccKey); + if (ec->sshk.vt == &ssh_ecdsa_nistp256) ec->sshk.vt = &ssh_ecdsa_nistp256_sk; + if (ec->sshk.vt == &ssh_ecdsa_nistp384) ec->sshk.vt = &ssh_ecdsa_nistp384_sk; + if (ec->sshk.vt == &ssh_ecdsa_nistp521) ec->sshk.vt = &ssh_ecdsa_nistp521_sk; + ec->appid = dupstr(IDEN_SPLIT(szCert)); } - // cleanup - BCryptDestroyKey(hBCryptKey); + // calculate public key + LPBYTE pPubKeyData = &pPubKey->pbData[1]; + ec->publicKey = ecc_weierstrass_point_new(ec->curve->w.wc, + mp_from_bytes_be(make_ptrlen(&pPubKeyData[0], iKeyBytes)), + mp_from_bytes_be(make_ptrlen(&pPubKeyData[iKeyBytes], iKeyBytes))); + + // fill out the user key + pUserKey = snew(struct ssh2_userkey); + pUserKey->key = &ec->sshk; + pUserKey->comment = dupstr(szCert); } return pUserKey; } -struct ssh2_userkey * cert_load_key(LPCSTR szCert, HWND hWnd) +struct ssh2_userkey* cert_load_key(LPCSTR szCert, HWND hWnd) { // sanity check if (szCert == NULL) return NULL; @@ -363,7 +462,7 @@ struct ssh2_userkey * cert_load_key(LPCSTR szCert, HWND hWnd) BOOL bDynamicLookupAutoSelect = strcmp(IDEN_SPLIT(szCert), "**") == 0; if (bDynamicLookup || bDynamicLookupAutoSelect) { - szCert = cert_prompt(szCert, hWnd, bDynamicLookupAutoSelect); + szCert = cert_prompt(szCert, hWnd, bDynamicLookupAutoSelect, NULL); if (szCert == NULL) return NULL; } @@ -373,7 +472,7 @@ struct ssh2_userkey * cert_load_key(LPCSTR szCert, HWND hWnd) if (cert_load_cert(szCert, &pCertContext, &hCertStore) == FALSE) return NULL; // get the public key data - struct ssh2_userkey * pUserKey = cert_get_ssh_userkey(szCert, pCertContext); + struct ssh2_userkey* pUserKey = cert_get_ssh_userkey(szCert, pCertContext); CertFreeCertificateContext(pCertContext); CertCloseStore(hCertStore, 0); return pUserKey; @@ -382,7 +481,7 @@ struct ssh2_userkey * cert_load_key(LPCSTR szCert, HWND hWnd) LPSTR cert_key_string(LPCSTR szCert) { // sanity check - if (szCert == NULL || !cert_is_certpath(szCert)) + if (szCert == NULL) { return NULL; } @@ -393,14 +492,15 @@ LPSTR cert_key_string(LPCSTR szCert) if (cert_load_cert(szCert, &pCertContext, &hCertStore) == FALSE) return NULL; // obtain the key and destroy the comment since we are going to customize it - struct ssh2_userkey * pUserKey = cert_get_ssh_userkey(szCert, pCertContext); + struct ssh2_userkey* pUserKey = cert_get_ssh_userkey(szCert, pCertContext); + if (pUserKey == NULL) return NULL; sfree(pUserKey->comment); pUserKey->comment = ""; // fetch the elements of the string LPSTR szKey = ssh2_pubkey_openssh_str(pUserKey); LPSTR szName = cert_subject_string(szCert); - LPSTR szHash = cert_get_cert_hash(cert_iden(szCert), pCertContext, NULL); + LPSTR szHash = cert_get_cert_thumbprint(cert_iden(szCert), pCertContext, NULL); // append the ssh string, identifier:thumbprint, and certificate subject LPSTR szKeyWithComment = dupprintf("%s %s %s", szKey, szHash, szName); @@ -424,6 +524,12 @@ LPSTR cert_subject_string(LPCSTR szCert) return NULL; } + // for fido, just return the appid from the comment + if (cert_is_fidopath(szCert)) + { + return dupstr(&szCert[IDEN_FIDO_SIZE]); + } + // load certificate context PCERT_CONTEXT pCertContext = NULL; HCERTSTORE hCertStore = NULL; @@ -461,7 +567,7 @@ VOID cert_display_cert(LPCSTR szCert, HWND hWnd) CertCloseStore(hCertStore, 0); } -BOOL cert_check_valid(PCCERT_CONTEXT pCertContext) +BOOL cert_check_valid(LPCSTR szIden, PCCERT_CONTEXT pCertContext) { // if user has enabled hidden option, just allow the certificate if (cert_allow_any_cert((DWORD)-1)) @@ -469,6 +575,12 @@ BOOL cert_check_valid(PCCERT_CONTEXT pCertContext) return TRUE; } + // since they are automatically generated consider all fido valid + if (cert_is_fidopath(szIden)) + { + return TRUE; + } + // minimally very digital signature key usage BYTE tUsageInfo[2] = { 0, 0 }; DWORD iUsageInfo = 2; @@ -482,8 +594,7 @@ BOOL cert_check_valid(PCCERT_CONTEXT pCertContext) // if certificate has eku, then it should be client auth or smartcard logon BOOL bFoundSmartCardLogon = FALSE; - BOOL bFoundClientAuth = FALSE; - PCERT_EXTENSION pEnhancedKeyUsage = CertFindExtension(szOID_ENHANCED_KEY_USAGE, + PCERT_EXTENSION pEnhancedKeyUsage = CertFindExtension(szOID_ENHANCED_KEY_USAGE, pCertContext->pCertInfo->cExtension, pCertContext->pCertInfo->rgExtension); if (pEnhancedKeyUsage != NULL) { @@ -497,6 +608,7 @@ BOOL cert_check_valid(PCCERT_CONTEXT pCertContext) } // loop through usages, looking for match + BOOL bFoundClientAuth = FALSE; for (DWORD iUsage = 0; iUsage < pUsage->cUsageIdentifier; iUsage++) { bFoundClientAuth |= strcmp(pUsage->rgpszUsageIdentifier[iUsage], szOID_PKIX_KP_CLIENT_AUTH) == 0; @@ -530,7 +642,7 @@ BOOL cert_check_valid(PCCERT_CONTEXT pCertContext) ZeroMemory(&tChainParams, sizeof(tChainParams)); tChainParams.cbSize = sizeof(tChainParams); PCCERT_CHAIN_CONTEXT pChainContext = NULL; - BOOL bChainResult = CertGetCertificateChain(NULL, pCertContext, NULL, NULL, &tChainParams, + BOOL bChainResult = CertGetCertificateChain(NULL, pCertContext, NULL, NULL, &tChainParams, CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT, NULL, &pChainContext); if (bChainResult == false) return FALSE; @@ -544,31 +656,39 @@ BOOL cert_check_valid(PCCERT_CONTEXT pCertContext) return TRUE; } -int cert_all_certs(LPSTR ** pszCert) +int cert_all_certs(LPSTR** pszCert) { // get a handle to the cert store - LPCSTR szHint = NULL; - HCERTSTORE hCertStore = cert_capi_get_cert_store(&szHint, NULL); + LPCSTR sStoreType[2] = { IDEN_CAPI, IDEN_FIDO }; + HCERTSTORE hCertStore[2] = + { + cert_capi_get_cert_store(NULL, NULL), + cert_fido_get_cert_store(NULL, NULL) + }; // find certificates matching our criteria size_t iCertNum = 0; - PCCERT_CONTEXT pCertContext = NULL; - while ((pCertContext = CertEnumCertificatesInStore(hCertStore, pCertContext)) != NULL) + for (int iStore = 0; iStore < _countof(hCertStore); iStore++) { - // ignore invalid cert sbased on settings - if (!cert_check_valid(pCertContext)) continue; + PCCERT_CONTEXT pCertContext = NULL; + while ((pCertContext = CertEnumCertificatesInStore(hCertStore[iStore], pCertContext)) != NULL) + { + // ignore invalid certs based on settings + if (!cert_check_valid(sStoreType[iStore], pCertContext)) continue; - // count cert and [re]allocate the return string array - *pszCert = snrealloc(*pszCert, iCertNum + 1, sizeof(LPSTR)); - (*pszCert)[iCertNum++] = cert_get_cert_hash(IDEN_CAPI, pCertContext, NULL); + // count cert and [re]allocate the return string array + *pszCert = snrealloc(*pszCert, iCertNum + 1, sizeof(LPSTR)); + (*pszCert)[iCertNum++] = cert_get_cert_thumbprint(sStoreType[iStore], pCertContext, NULL); + } + + // cleanup and return + CertCloseStore(hCertStore[iStore], 0); } - // cleanup and return - CertCloseStore(hCertStore, 0); - return iCertNum; + return (int)iCertNum; } -void cert_convert_legacy(LPSTR szCert) +VOID cert_convert_legacy(LPSTR szCert) { // sanity check if (szCert == NULL) @@ -589,7 +709,7 @@ void cert_convert_legacy(LPSTR szCert) { strcpy(szCert, IDEN_CAPI); strcpy(&szCert[IDEN_CAPI_SIZE], &sCompare[strlen(szIdenLegacyUsr)]); - strlwr(&szCert[IDEN_CAPI_SIZE]); + _strlwr(&szCert[IDEN_CAPI_SIZE]); } // search for 'Machine\MY\' and replace with 'CAPI:' @@ -598,43 +718,43 @@ void cert_convert_legacy(LPSTR szCert) { strcpy(szCert, IDEN_CAPI); strcpy(&szCert[IDEN_CAPI_SIZE], &sCompare[strlen(szIdenLegacySys)]); - strlwr(&szCert[IDEN_CAPI_SIZE]); + _strlwr(&szCert[IDEN_CAPI_SIZE]); } } -LPBYTE cert_get_hash(LPCSTR szAlgo, LPCBYTE pDataToHash, DWORD iDataToHashSize, DWORD * iHashedDataSize, BOOL bRequestDigest) +LPBYTE cert_get_hash(LPCSTR szAlgo, LPCBYTE pDataToHash, DWORD iDataToHashSize, DWORD* iHashedDataSize, BOOL bRequestDigest) { const BYTE OID_SHA1[] = { - 0x30, 0x21, /* type Sequence, length 0x21 (33) */ - 0x30, 0x09, /* type Sequence, length 0x09 (9) */ - 0x06, 0x05, /* type OID, length 0x05 (5) */ - 0x2b, 0x0e, 0x03, 0x02, 0x1a, /* id-sha1 OID */ - 0x05, 0x00, /* type NULL, length 0x0 (0) */ - 0x04, 0x14 /* type Octet string, length 0x14 (20), followed by sha1 hash */ + 0x30, 0x21, // type Sequence, length 0x21 (33) + 0x30, 0x09, // type Sequence, length 0x09 (9) + 0x06, 0x05, // type OID, length 0x05 (5) + 0x2b, 0x0e, 0x03, 0x02, 0x1a, // id-sha1 OID + 0x05, 0x00, // type NULL, length 0x0 (0) + 0x04, 0x14 // type Octet string, length 0x14 (20), followed by sha1 hash }; const BYTE OID_SHA256[] = { - 0x30, 0x31, /* type Sequence, length 0x31 (49) */ - 0x30, 0x0d, /* type Sequence, length 0x0d (13) */ - 0x06, 0x09, /* type OID, length 0x09 (9) */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, /* id-sha256 OID */ - 0x05, 0x00, /* type NULL, length 0x0 (0) */ - 0x04, 0x20 /* type Octet string, length 0x20 (32), followed by sha256 hash */ + 0x30, 0x31, // type Sequence, length 0x31 (49) + 0x30, 0x0d, // type Sequence, length 0x0d (13) + 0x06, 0x09, // type OID, length 0x09 (9) + 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, // id-sha256 OID + 0x05, 0x00, // type NULL, length 0x0 (0) + 0x04, 0x20 // type Octet string, length 0x20 (32), followed by sha256 hash }; const BYTE OID_SHA384[] = { - 0x30, 0x41, /* type Sequence, length 0x41 (65) */ - 0x30, 0x0d, /* type Sequence, length 0x0d (13) */ - 0x06, 0x09, /* type OID, length 0x09 (9) */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, /* id-sha384 OID */ - 0x05, 0x00, /* type NULL, length 0x0 (0) */ - 0x04, 0x30 /* type Octet string, length 0x30 (48), followed by sha384 hash */ + 0x30, 0x41, // type Sequence, length 0x41 (65) + 0x30, 0x0d, // type Sequence, length 0x0d (13) + 0x06, 0x09, // type OID, length 0x09 (9) + 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, // id-sha384 OID + 0x05, 0x00, // type NULL, length 0x0 (0) + 0x04, 0x30 // type Octet string, length 0x30 (48), followed by sha384 hash }; const BYTE OID_SHA512[] = { - 0x30, 0x51, /* type Sequence, length 0x51 (81) */ - 0x30, 0x0d, /* type Sequence, length 0x0d (13) */ - 0x06, 0x09, /* type OID, length 0x09 (9) */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, /* id-sha512 OID */ - 0x05, 0x00, /* type NULL, length 0x0 (0) */ - 0x04, 0x40 /* type Octet string, length 0x40 (64), followed by sha512 hash */ + 0x30, 0x51, // type Sequence, length 0x51 (81) + 0x30, 0x0d, // type Sequence, length 0x0d (13) + 0x06, 0x09, // type OID, length 0x09 (9) + 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, // id-sha512 OID + 0x05, 0x00, // type NULL, length 0x0 (0) + 0x04, 0x40 // type Octet string, length 0x40 (64), followed by sha512 hash }; // for rsa, prepend the hash digest if requested @@ -689,11 +809,11 @@ LPBYTE cert_get_hash(LPCSTR szAlgo, LPCBYTE pDataToHash, DWORD iDataToHashSize, // acquire crypto provider, hash data, and export hashed binary data if (BCryptOpenAlgorithmProvider(&hAlg, sNCryptAlg, NULL, 0) != STATUS_SUCCESS || - BCryptGetProperty(hAlg, BCRYPT_HASH_LENGTH, (PBYTE) iHashedDataSize, sizeof(DWORD), &iPropSize, 0) != STATUS_SUCCESS || + BCryptGetProperty(hAlg, BCRYPT_HASH_LENGTH, (PBYTE)iHashedDataSize, sizeof(DWORD), &iPropSize, 0) != STATUS_SUCCESS || (pHashData = snewn(*iHashedDataSize + iDigestSize, BYTE)) == NULL || BCryptCreateHash(hAlg, &hHash, NULL, 0, NULL, 0, 0) != STATUS_SUCCESS || - BCryptHashData(hHash, (PBYTE) pDataToHash, iDataToHashSize, 0) != STATUS_SUCCESS || - BCryptFinishHash(hHash, pHashData + iDigestSize, (ULONG) *iHashedDataSize, 0) != STATUS_SUCCESS) + BCryptHashData(hHash, (PBYTE)pDataToHash, iDataToHashSize, 0) != STATUS_SUCCESS || + BCryptFinishHash(hHash, pHashData + iDigestSize, (ULONG)*iHashedDataSize, 0) != STATUS_SUCCESS) { // something failed if (pHashData != NULL) @@ -720,23 +840,23 @@ PVOID cert_pin(LPSTR szCert, BOOL bUnicode, LPVOID szPin) { typedef struct CACHE_ITEM { - struct CACHE_ITEM * NextItem; + struct CACHE_ITEM* NextItem; LPSTR szCert; - VOID * szPin; + VOID* szPin; DWORD iLength; BOOL bUnicode; DWORD iSize; } CACHE_ITEM; - static CACHE_ITEM * PinCacheList = NULL; + static CACHE_ITEM* PinCacheList = NULL; // attempt to locate the item in the pin cache - for (CACHE_ITEM * hCurItem = PinCacheList; hCurItem != NULL; hCurItem = hCurItem->NextItem) + for (CACHE_ITEM* hCurItem = PinCacheList; hCurItem != NULL; hCurItem = hCurItem->NextItem) { if (strcmp(hCurItem->szCert, szCert) == 0) { - VOID * pEncrypted = memcpy(malloc(hCurItem->iLength), hCurItem->szPin, hCurItem->iLength); + VOID* pEncrypted = memcpy(malloc(hCurItem->iLength), hCurItem->szPin, hCurItem->iLength); CryptUnprotectMemory(pEncrypted, hCurItem->iLength, CRYPTPROTECTMEMORY_SAME_PROCESS); return pEncrypted; } @@ -750,15 +870,15 @@ PVOID cert_pin(LPSTR szCert, BOOL bUnicode, LPVOID szPin) (1 + ((bUnicode) ? wcslen(szPin) : strlen(szPin))); DWORD iCryptLength = CRYPTPROTECTMEMORY_BLOCK_SIZE * ((iLength / CRYPTPROTECTMEMORY_BLOCK_SIZE) + 1); - VOID * pEncrypted = memcpy(malloc(iCryptLength), szPin, iLength); + VOID* pEncrypted = memcpy(malloc(iCryptLength), szPin, iLength); // encrypt memory CryptProtectMemory(pEncrypted, iCryptLength, CRYPTPROTECTMEMORY_SAME_PROCESS); // allocate new item in cache and commit the change - CACHE_ITEM * hItem = (CACHE_ITEM *)calloc(1, sizeof(struct CACHE_ITEM)); - hItem->szCert = strdup(szCert); + CACHE_ITEM* hItem = (CACHE_ITEM*)calloc(1, sizeof(struct CACHE_ITEM)); + hItem->szCert = _strdup(szCert); hItem->szPin = pEncrypted; hItem->iLength = iCryptLength; hItem->bUnicode = bUnicode; @@ -769,7 +889,7 @@ PVOID cert_pin(LPSTR szCert, BOOL bUnicode, LPVOID szPin) // prompt the user to enter the pin CREDUI_INFOW tCredInfo; - ZeroMemory(&tCredInfo, sizeof(CREDUI_INFO)); + ZeroMemory(&tCredInfo, sizeof(CREDUI_INFOW)); tCredInfo.cbSize = sizeof(tCredInfo); tCredInfo.pszCaptionText = L"PuTTY Authentication"; tCredInfo.pszMessageText = L"Please Enter Your Smart Card Credentials"; @@ -785,13 +905,13 @@ PVOID cert_pin(LPSTR szCert, BOOL bUnicode, LPVOID szPin) PVOID szReturn = NULL; if (bUnicode) { - szReturn = wcsdup(szPassword); + szReturn = _wcsdup(szPassword); } else { CHAR szPasswordAscii[CREDUI_MAX_PASSWORD_LENGTH + 1] = ""; WideCharToMultiByte(CP_ACP, 0, szPassword, -1, szPasswordAscii, sizeof(szPasswordAscii), NULL, NULL); - szReturn = strdup(szPasswordAscii); + szReturn = _strdup(szPasswordAscii); } SecureZeroMemory(szPassword, sizeof(szPassword)); @@ -873,35 +993,35 @@ BOOL cert_auto_load_certs(DWORD bEnable) BOOL cert_cmdline_parse(LPCSTR sCommand) { - if (!strcmp(sCommand, "-autoload") || !strcmp(sCommand, "-autoloadoff")) + if (!strcmp(sCommand, "-autoload") || !strcmp(sCommand, "-autoloadoff")) { cert_auto_load_certs((!strcmp(sCommand, "-autoload")) ? 1 : 0); } - else if (!strcmp(sCommand, "-savecertlist") || !strcmp(sCommand, "-savecertlistoff")) + else if (!strcmp(sCommand, "-savecertlist") || !strcmp(sCommand, "-savecertlistoff")) { cert_save_cert_list_enabled((!strcmp(sCommand, "-savecertlist")) ? 1 : 0); } - else if (!strcmp(sCommand, "-forcepincache") || !strcmp(sCommand, "-forcepincacheoff")) + else if (!strcmp(sCommand, "-forcepincache") || !strcmp(sCommand, "-forcepincacheoff")) { cert_cache_enabled((!strcmp(sCommand, "-forcepincache")) ? 1 : 0); } - else if (!strcmp(sCommand, "-certauthprompting") || !strcmp(sCommand, "-certauthpromptingoff")) + else if (!strcmp(sCommand, "-certauthprompting") || !strcmp(sCommand, "-certauthpromptingoff")) { cert_auth_prompting((!strcmp(sCommand, "-certauthprompting")) ? 1 : 0); } - else if (!strcmp(sCommand, "-smartcardlogoncertsonly") || !strcmp(sCommand, "-smartcardlogoncertsonlyoff")) + else if (!strcmp(sCommand, "-smartcardlogoncertsonly") || !strcmp(sCommand, "-smartcardlogoncertsonlyoff")) { cert_smartcard_certs_only((!strcmp(sCommand, "-smartcardlogoncertsonly")) ? 1 : 0); } - else if (!strcmp(sCommand, "-trustedcertsonly") || !strcmp(sCommand, "-trustedcertsonlyoff")) + else if (!strcmp(sCommand, "-trustedcertsonly") || !strcmp(sCommand, "-trustedcertsonlyoff")) { cert_trusted_certs_only((!strcmp(sCommand, "-trustedcertsonly")) ? 1 : 0); } - else if (!strcmp(sCommand, "-ignoreexpiredcerts") || !strcmp(sCommand, "-ignoreexpiredcertsoff")) + else if (!strcmp(sCommand, "-ignoreexpiredcerts") || !strcmp(sCommand, "-ignoreexpiredcertsoff")) { cert_ignore_expired_certs((!strcmp(sCommand, "-ignoreexpiredcerts")) ? 1 : 0); } - else if (!strcmp(sCommand, "-allowanycert") || !strcmp(sCommand, "-allowanycertoff")) + else if (!strcmp(sCommand, "-allowanycert") || !strcmp(sCommand, "-allowanycertoff")) { cert_allow_any_cert((!strcmp(sCommand, "-allowanycert")) ? 1 : 0); } @@ -909,7 +1029,7 @@ BOOL cert_cmdline_parse(LPCSTR sCommand) { return FALSE; } - + return TRUE; } diff --git a/code/cert/cert_common.h b/code/cert/cert_common.h index 4ecdf9e..ee7cef8 100644 --- a/code/cert/cert_common.h +++ b/code/cert/cert_common.h @@ -19,10 +19,10 @@ #endif // functions used only by the capi and pkcs addon modules -EXTERN void cert_reverse_array(LPBYTE pb, DWORD cb); +EXTERN VOID cert_reverse_array(LPBYTE pb, DWORD cb); EXTERN BOOL cert_load_cert(LPCSTR szCert, PCERT_CONTEXT * ppCertContext, HCERTSTORE * phCertStore); -EXTERN BOOL cert_check_valid(PCCERT_CONTEXT pCertContext); -EXTERN LPSTR cert_get_cert_hash(LPCSTR szIden, PCCERT_CONTEXT pCertContext, LPCSTR szHint); +EXTERN BOOL cert_check_valid(LPCSTR szIden, PCCERT_CONTEXT pCertContext); +EXTERN LPSTR cert_get_cert_thumbprint(LPCSTR szIden, PCCERT_CONTEXT pCertContext, LPCSTR szHint); EXTERN PVOID cert_pin(LPSTR szCert, BOOL bUnicode, LPVOID szPin); EXTERN BOOL cert_save_cert_list_enabled(DWORD bEnable); EXTERN BOOL cert_cache_enabled(DWORD bEnable); @@ -37,15 +37,26 @@ EXTERN BOOL cert_cmdline_parse(LPCSTR sCommand); // functions used by putty code EXTERN LPSTR cert_key_string(LPCSTR szCert); EXTERN LPSTR cert_subject_string(LPCSTR szCert); -EXTERN LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect); +EXTERN LPSTR cert_prompt(LPCSTR szIden, HWND hWnd, BOOL bAutoSelect, LPCWSTR sCustomPrompt); EXTERN BOOL cert_test_hash(LPCSTR szCert, DWORD iHashRequest); EXTERN BOOL cert_confirm_signing(LPCSTR sFingerPrint, LPCSTR sComment); -EXTERN LPBYTE cert_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iDataToSignLen, int * iWrappedSigLen, int iAgentFlags); +EXTERN BOOL cert_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iDataToSignLen, int iAgentFlags, strbuf* pSignature); EXTERN struct ssh2_userkey * cert_load_key(LPCSTR szCert, HWND hWnd); EXTERN VOID cert_display_cert(LPCSTR szCert, HWND hWnd); EXTERN int cert_all_certs(LPSTR ** pszCert); -EXTERN void cert_convert_legacy(LPSTR szCert); +EXTERN VOID cert_convert_legacy(LPSTR szCert); EXTERN LPBYTE cert_get_hash(LPCSTR szAlgo, LPCBYTE pDataToHash, DWORD iDataToHashSize, DWORD * iHashedDataSize, BOOL bPrependDigest); +EXTERN BOOL cert_capi_create_key(LPCSTR szAlgName, LPCSTR sSubjectName, BOOL bHardware); +EXTERN BOOL cert_capi_delete_key(LPCSTR szCert); +EXTERN BOOL fido_create_key(LPCSTR szAlgName, LPCSTR szApplication, BOOL bResidentKey, BOOL bUserVerification); +EXTERN BOOL fido_delete_key(LPCSTR szCert); +EXTERN VOID fido_import_keys(); +EXTERN VOID fido_clear_keys(); + +// ed25519 oid; no native support in windows +#ifndef szOID_ED25119 +#define szOID_ED25119 "1.3.6.1.4.1.11591.15.1" +#endif #define SHA1_BINARY_SIZE (160 / 8) #define SHA1_HEX_SIZE (SHA1_BINARY_SIZE * 2) @@ -54,14 +65,17 @@ EXTERN LPBYTE cert_get_hash(LPCSTR szAlgo, LPCBYTE pDataToHash, DWORD iDataToHas #define IDEN_CAPI_SIZE (strlen(IDEN_CAPI)) #define IDEN_PKCS "PKCS:" #define IDEN_PKCS_SIZE (strlen(IDEN_PKCS)) +#define IDEN_FIDO "FIDO:" +#define IDEN_FIDO_SIZE (strlen(IDEN_FIDO)) #define IDEN_SPLIT(p) (strchr(p,':') + 1) -#define IDEN_PREFIX(p) (cert_is_capipath(p) ? IDEN_CAPI : IDEN_PKCS) +#define IDEN_PREFIX(p) (cert_is_capipath(p) ? IDEN_CAPI : cert_is_pkcspath(p) ? IDEN_CAPI : IDEN_FIDO) -#define cert_is_capipath(p) (p != NULL && strnicmp((LPSTR) p, IDEN_CAPI, IDEN_CAPI_SIZE) == 0) -#define cert_is_pkcspath(p) (p != NULL && strnicmp((LPSTR) p, IDEN_PKCS, IDEN_PKCS_SIZE) == 0) -#define cert_is_certpath(p) (p != NULL && (cert_is_capipath(p) || cert_is_pkcspath(p))) -#define cert_iden(p) (cert_is_capipath(p) ? IDEN_CAPI : (cert_is_pkcspath(p) ? IDEN_PKCS : "")) +#define cert_is_capipath(p) (p != NULL && _strnicmp((LPSTR) p, IDEN_CAPI, IDEN_CAPI_SIZE) == 0) +#define cert_is_pkcspath(p) (p != NULL && _strnicmp((LPSTR) p, IDEN_PKCS, IDEN_PKCS_SIZE) == 0) +#define cert_is_fidopath(p) (p != NULL && _strnicmp((LPSTR) p, IDEN_FIDO, IDEN_FIDO_SIZE) == 0) +#define cert_is_certpath(p) (p != NULL && (cert_is_capipath(p) || cert_is_pkcspath(p) || cert_is_fidopath(p))) +#define cert_iden(p) (cert_is_capipath(p) ? IDEN_CAPI : (cert_is_pkcspath(p) ? IDEN_PKCS : (cert_is_fidopath(p) ? IDEN_FIDO : ""))) #endif /* PUTTY_CAC */ diff --git a/code/cert/cert_fido.c b/code/cert/cert_fido.c new file mode 100644 index 0000000..9e08a7f --- /dev/null +++ b/code/cert/cert_fido.c @@ -0,0 +1,742 @@ +#ifdef PUTTY_CAC + +#include +#include +#include +#include +#include +#include + +#define DEFINE_VARIABLES +#include "cert_fido.h" +#undef DEFINE_VARIABLES + +#include "cert_common.h" + +#pragma comment(lib,"crypt32.lib") +#pragma comment(lib,"credui.lib") +#pragma comment(lib,"ncrypt.lib") +#pragma comment(lib,"webauthn.lib") +#pragma comment(lib,"delayimp.lib") + +// arbitrarily large limits for certain fido buffers +#define FIDO_MAX_APPID_LEN 256 +#define FIDO_MAX_CREDID_LEN 128 +#define FIDO_MAX_PUBKEY_LEN 128 +#define FIDO_MAX_USERNAME_LEN 128 +#define FIDO_MAX_BLOB_SIZE 512 + +// other arbitrary contacts +#define FIDO_KEY_USERNAME L"PuTTY FIDO User" + +// registry key locations for fido +#define FIDO_REG_PUBKEYS L"Software\\SimonTatham\\PuTTY\\Fido\\PubKeyBlobs" +#define FIDO_REG_CREDIDS L"Software\\SimonTatham\\PuTTY\\Fido\\CredIdBlobs" +#define FIDO_REG_USERVER L"Software\\SimonTatham\\PuTTY\\Fido\\UserVerification" + +// special define since not currently included in header +#ifndef WEBAUTHN_COSE_ALGORITHM_EDDSA_ED25519 +#define WEBAUTHN_COSE_ALGORITHM_EDDSA_ED25519 -8 +#endif + +#pragma pack(push, 1) +typedef struct _cbor_ecdsa_response_header_t +{ + uint8_t RpHashId[32]; + uint8_t Flags; + uint32_t Counter; + uint8_t CredIdLeng[16]; + uint16_t Length; +} +cbor_ecdsa_response_header_t; + +typedef struct _cbor_t +{ + uint8_t CountOrVal : 5; + uint8_t MajorType : 3; +} +cbor_t; + +typedef struct _cbor_ecdsa_pubkey_t +{ + // Map Type (5 Pairs) + cbor_t MapIden; + + // Map Key Type & Value Map Value Type & Data + cbor_t KeyTypeMapKey; cbor_t KeyTypeMapValue; + cbor_t AlgIdMapKey; cbor_t AlgIdMapValue; + cbor_t CurveIdMapKey; cbor_t CurveIdMapValue; + union + { + struct + { + // Map Key Type & Value Map Value Type Map Value Data + cbor_t PubKey1MapKey; cbor_t Key1ValueType; uint8_t Key1ValLen; uint8_t Key1Val[32]; + cbor_t PubKey2MapKey; cbor_t Key2ValueType; uint8_t Key2ValLen; uint8_t Key2Val[32]; + } Key256; + struct + { + cbor_t PubKey1MapKey; cbor_t Key1ValueType; uint8_t Key1ValLen; uint8_t Key1Val[48]; + cbor_t PubKey2MapKey; cbor_t Key2ValueType; uint8_t Key2ValLen; uint8_t Key2Val[48]; + } Key384; + struct + { + cbor_t PubKey1MapKey; cbor_t Key1ValueType; uint8_t Key1ValLen; uint8_t Key1Val[64]; + cbor_t PubKey2MapKey; cbor_t Key2ValueType; uint8_t Key2ValLen; uint8_t Key2Val[64]; + } Key521; + }; + +} +cbor_ecdsa_t; + +typedef struct _ecdsa_assertion_auth_header_t +{ + uint8_t RelyingPartyHash[32]; + uint8_t Flags; + uint32_t Counter; +} +ecdsa_assertion_auth_header_t; +#pragma pack(pop) + +struct GetAttestationThreadParams +{ + HWND hWnd; + LPCWSTR pwszRpId; + PCWEBAUTHN_CLIENT_DATA pWebAuthNClientData; + PCWEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS pWebAuthNGetAssertionOptions; + PWEBAUTHN_ASSERTION ppWebAuthNAssertion; +}; + +BOOL LoadDelayLoadedLibaries() +{ + static BOOL bImported = FALSE; + if (!bImported) + { + bImported = LoadLibrary("webauthn.dll") != NULL; + if (!bImported) + { + // notify if webauthn + MessageBoxW(NULL, L"PuTTY CAC FIDO support is not available on this platform.", + L"FIDO Not Supported", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + } + } + + return bImported; +} + +DWORD WINAPI WebAuthNAuthenticatorGetAssertionThread(LPVOID lpParam) +{ + struct GetAttestationThreadParams* pParams = lpParam; + + HRESULT hMakeResult = WebAuthNAuthenticatorGetAssertion(pParams->hWnd, pParams->pwszRpId, + pParams->pWebAuthNClientData, pParams->pWebAuthNGetAssertionOptions, &pParams->ppWebAuthNAssertion); + if (hMakeResult != S_OK) + { + ExitThread(1); + return FALSE; + } + + if (pParams->hWnd != NULL) PostMessage(pParams->hWnd, WM_USER, 0, 0); + ExitThread(0); + return TRUE; +} + +BYTE* cert_fido_sign(struct ssh2_userkey* userkey, LPCBYTE pDataToSign, int iDataToSignLen, int* iSigLen, LPCSTR sHashAlgName, PDWORD iCounter, PBYTE iFlags) +{ + // sanity check for webauthn support + if (!LoadDelayLoadedLibaries()) return NULL; + + // convert to unicode + LPSTR szAppId = &userkey->comment[IDEN_FIDO_SIZE]; + WCHAR szAppIdUnicode[FIDO_MAX_APPID_LEN] = L""; + if (MultiByteToWideChar(CP_UTF8, 0, szAppId, -1, szAppIdUnicode, _countof(szAppIdUnicode)) == 0) return NULL; + + // determine with algorithm to sign with + LPCWSTR sHashAlg = NULL; + DWORD iSigPartSize = 0; + if (strstr(sHashAlgName, "sk-ecdsa-sha2-nistp256") == sHashAlgName) + { + sHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_256; + iSigPartSize = 0x20; + } + else if (strstr(sHashAlgName, "sk-ecdsa-sha2-nistp384") == sHashAlgName) + { + sHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_384; + iSigPartSize = 0x30; + } + else if (strstr(sHashAlgName, "sk-ecdsa-sha2-nistp521") == sHashAlgName) + { + sHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_512; + iSigPartSize = 0x40; + } + else if (strstr(sHashAlgName, "sk-ssh-ed25519") == sHashAlgName) + { + sHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_256; + iSigPartSize = 0x20; + } + + // fetch credential id from registry + BYTE sCredIdBuffer[FIDO_MAX_CREDID_LEN] = { 0 }; + DWORD iCredIdBufferSize = sizeof(sCredIdBuffer); + if (RegGetValueW(HKEY_CURRENT_USER, FIDO_REG_CREDIDS, szAppIdUnicode, + RRF_RT_REG_BINARY, NULL, sCredIdBuffer, &iCredIdBufferSize) != ERROR_SUCCESS) + { + iCredIdBufferSize = 0; + } + + // fetch user verification id from registry + DWORD iUserVerification = WEBAUTHN_USER_VERIFICATION_REQUIREMENT_REQUIRED; + DWORD iUserVerificationReg = 0; + DWORD iUserVerificationSize = sizeof(iUserVerificationReg); + if (RegGetValueW(HKEY_CURRENT_USER, FIDO_REG_USERVER, szAppIdUnicode, + RRF_RT_REG_DWORD, NULL, &iUserVerificationReg, &iUserVerificationSize) == ERROR_SUCCESS) + { + if (iUserVerificationReg == WEBAUTHN_USER_VERIFICATION_OPTIONAL || + iUserVerificationReg == WEBAUTHN_USER_VERIFICATION_OPTIONAL_WITH_CREDENTIAL_ID_LIST) + iUserVerification = WEBAUTHN_USER_VERIFICATION_REQUIREMENT_DISCOURAGED; + } + + // setup data to sign + WEBAUTHN_CLIENT_DATA tClientData = { WEBAUTHN_CLIENT_DATA_CURRENT_VERSION }; + tClientData.cbClientDataJSON = iDataToSignLen; + tClientData.pbClientDataJSON = (PBYTE)pDataToSign; + tClientData.pwszHashAlgId = sHashAlg; + + // identify credential list(technically only required for non - resident keys) + WEBAUTHN_CREDENTIAL tCredential = { WEBAUTHN_CREDENTIAL_CURRENT_VERSION }; + tCredential.cbId = iCredIdBufferSize; + tCredential.pwszCredentialType = WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY; + tCredential.pbId = sCredIdBuffer; + + // setup assertion options + BOOL bUtfAppId = FALSE; + WEBAUTHN_CREDENTIALS tCredList = { 1, &tCredential }; + WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS tAssertionOptions = { WEBAUTHN_AUTHENTICATOR_GET_ASSERTION_OPTIONS_CURRENT_VERSION }; + if (iCredIdBufferSize != 0) tAssertionOptions.CredentialList = tCredList; + tAssertionOptions.dwAuthenticatorAttachment = WEBAUTHN_AUTHENTICATOR_ATTACHMENT_ANY; + tAssertionOptions.dwUserVerificationRequirement = iUserVerification; + tAssertionOptions.pbU2fAppId = &bUtfAppId; + + // fetch assertion + struct GetAttestationThreadParams pParams; + pParams.hWnd = GetForegroundWindow(); + pParams.pWebAuthNClientData = &tClientData; + pParams.pWebAuthNGetAssertionOptions = &tAssertionOptions; + pParams.pwszRpId = szAppIdUnicode; + HANDLE hThread = CreateThread(NULL, 0, WebAuthNAuthenticatorGetAssertionThread, &pParams, 0, NULL); + if (hThread == NULL) return NULL; + + // wait for message to complete + if (pParams.hWnd != NULL && GetWindowThreadProcessId(pParams.hWnd, NULL) == GetCurrentThreadId()) + { + for (MSG tMsg; GetMessage(&tMsg, NULL, 0, 0) > 0;) + { + if (tMsg.message == WM_USER) break; + TranslateMessage(&tMsg); + DispatchMessage(&tMsg); + } + } + + // wait for thread to complete + DWORD iExitCode; + WaitForSingleObject(hThread, INFINITE); + GetExitCodeThread(hThread, &iExitCode); + CloseHandle(hThread); + if (iExitCode != 0) return NULL; + + // allocate and copy signature to compressed structure + BYTE* Signature = NULL; + if (strstr(sHashAlgName, "sk-ssh-ed25519") == sHashAlgName) + { + // eddsa + Signature = malloc(pParams.ppWebAuthNAssertion->cbSignature); + if (Signature == NULL) return NULL; + memcpy(Signature, pParams.ppWebAuthNAssertion->pbSignature, pParams.ppWebAuthNAssertion->cbSignature); + *iSigLen = pParams.ppWebAuthNAssertion->cbSignature; + } + else + { + // ecdsa + const int iSigInitialOffset = 3; + int iSigPartOffsetR = iSigInitialOffset + 1 + (pParams.ppWebAuthNAssertion->pbSignature[iSigInitialOffset] - iSigPartSize); + int iSigPartOffsetS = iSigPartOffsetR + 1 + pParams.ppWebAuthNAssertion->pbSignature[iSigPartOffsetR + iSigPartSize + 1] + 1; + if (iSigPartOffsetR < 0 || iSigPartOffsetS < 0) return NULL; + Signature = malloc((*iSigLen = iSigPartSize * 2)); + if (Signature == NULL) return NULL; + memcpy(&Signature[0], &pParams.ppWebAuthNAssertion->pbSignature[iSigPartOffsetR], iSigPartSize); + memcpy(&Signature[iSigPartSize], &pParams.ppWebAuthNAssertion->pbSignature[iSigPartOffsetS], iSigPartSize); + } + + // return counter + ecdsa_assertion_auth_header_t* pAuthData = (ecdsa_assertion_auth_header_t*)&pParams.ppWebAuthNAssertion->pbAuthenticatorData[0]; + *iCounter = ntohl(pAuthData->Counter); + *iFlags = pAuthData->Flags; + + // cleanup + WebAuthNFreeAssertion(pParams.ppWebAuthNAssertion); + return Signature; +} + +BOOL fido_test_hash(LPCSTR szCert, DWORD iHashRequest) +{ + return FALSE; +} + +BOOL cert_fido_get_cert(PBCRYPT_ECCKEY_BLOB pPubKeyBlob, DWORD iPublicKeyBufferSize, LPWSTR sApplicationId, PCERT_CONTEXT* ppCertCtx) +{ + // sanity check + if (!( + (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_P256_MAGIC && pPubKeyBlob->cbKey == 32) || + (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_P384_MAGIC && pPubKeyBlob->cbKey == 48) || + (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_P521_MAGIC && pPubKeyBlob->cbKey == 66) || + (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC && pPubKeyBlob->cbKey == 32))) + { + return FALSE; + } + + // determine algorithm for cert creation + BYTE pPubKeyBlobTemp[FIDO_MAX_BLOB_SIZE] = { 0 }; + LPSTR sAlgo = NULL; + if (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_P256_MAGIC) sAlgo = szOID_ECDSA_SHA256; + if (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_P384_MAGIC) sAlgo = szOID_ECDSA_SHA384; + if (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_P521_MAGIC) sAlgo = szOID_ECDSA_SHA512; + if (pPubKeyBlob->dwMagic == BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC) + { + // windows does not support eddsa so we mark it ecdsa and adjust in other functions + pPubKeyBlob->dwMagic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC; + sAlgo = szOID_ED25119; + memcpy(pPubKeyBlobTemp, pPubKeyBlob, iPublicKeyBufferSize); + pPubKeyBlob = (PBCRYPT_ECCKEY_BLOB)&pPubKeyBlobTemp[0]; + } + + // get crypto handle + NCRYPT_PROV_HANDLE hProvider = (NCRYPT_PROV_HANDLE)NULL; + if (NCryptOpenStorageProvider(&hProvider, MS_KEY_STORAGE_PROVIDER, 0) != ERROR_SUCCESS) + { + return FALSE; + } + + // import key data + NCRYPT_KEY_HANDLE hKeyHandle = sizeof(BCRYPT_ECCKEY_BLOB) + (NCRYPT_KEY_HANDLE)NULL; + SECURITY_STATUS iResult = NCryptImportKey(hProvider, (NCRYPT_KEY_HANDLE)NULL, BCRYPT_ECCPUBLIC_BLOB, + NULL, &hKeyHandle, (PBYTE)pPubKeyBlob, sizeof(BCRYPT_ECCKEY_BLOB) + (pPubKeyBlob->cbKey * 2), BCRYPT_NO_KEY_VALIDATION); + if (iResult != ERROR_SUCCESS || hKeyHandle == (NCRYPT_KEY_HANDLE)NULL) + { + NCryptFreeObject(hProvider); + return FALSE; + } + + // convert the application name to a subject name to store in the cert for identification + WCHAR szSubjectName[32]; + CERT_NAME_BLOB SubjectName = { sizeof(szSubjectName), (PBYTE)szSubjectName }; + if (CertStrToNameW(X509_ASN_ENCODING, L"CN=PuTTY FIDO", CERT_X500_NAME_STR | CERT_NAME_STR_SEMICOLON_FLAG, + NULL, SubjectName.pbData, &SubjectName.cbData, NULL) != 0) + { + // create the certificate and add to store + SYSTEMTIME tSystemTime; + GetSystemTime(&tSystemTime); + CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm = { sAlgo, 0 }; + *ppCertCtx = CertCreateSelfSignCertificate(hKeyHandle, &SubjectName, + CERT_CREATE_SELFSIGN_NO_SIGN | CERT_CREATE_SELFSIGN_NO_KEY_INFO, NULL, + &SignatureAlgorithm, &tSystemTime, &tSystemTime, NULL); + + // store the application id as an attribute on the certificate + if (*ppCertCtx != NULL) + { + CRYPT_DATA_BLOB tAppId = { (wcslen(sApplicationId) + 1) * sizeof(WCHAR), (PBYTE)sApplicationId }; + CertSetCertificateContextProperty(*ppCertCtx, CERT_FRIENDLY_NAME_PROP_ID, 0, (LPVOID)&tAppId); + } + } + + // cleanup + NCryptFreeObject(hKeyHandle); + NCryptFreeObject(hProvider); + return (*ppCertCtx != NULL); +} + +void cert_fido_load_cert(LPCSTR szCert, PCCERT_CONTEXT* ppCertCtx, HCERTSTORE* phStore) +{ + // default output to cert not found + *ppCertCtx = NULL; + *phStore = NULL; + + // split on the hint symbol to get the appid + LPSTR sApplicationId = IDEN_SPLIT(szCert); + + // convert to unicode in order to + WCHAR szAppIdUnicode[FIDO_MAX_CREDID_LEN] = L""; + if (MultiByteToWideChar(CP_UTF8, 0, sApplicationId, -1, szAppIdUnicode, _countof(szAppIdUnicode)) == 0) return; + + // fetch value from registry + BYTE sPublicKeyBuffer[FIDO_MAX_PUBKEY_LEN]; + DWORD iPublicKeyBufferSize = sizeof(sPublicKeyBuffer); + if (RegGetValueW(HKEY_CURRENT_USER, FIDO_REG_PUBKEYS, szAppIdUnicode, RRF_RT_REG_BINARY, NULL, sPublicKeyBuffer, &iPublicKeyBufferSize) != ERROR_SUCCESS) + { + return; + } + + // convert public key to a certificate + cert_fido_get_cert((PBCRYPT_ECCKEY_BLOB)sPublicKeyBuffer, iPublicKeyBufferSize, szAppIdUnicode, ppCertCtx); +} + + +HCERTSTORE cert_fido_get_cert_store(LPCSTR* szHint, HWND hWnd) +{ + UNREFERENCED_PARAMETER(hWnd); + + // no library hint needed for fido + if (szHint != NULL) *szHint = NULL; + + // open a memory-based cert store to store the certificate context i + HCERTSTORE hStoreHandle = CertOpenStore(CERT_STORE_PROV_MEMORY, + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + if (NULL == hStoreHandle) + { + return NULL; + } + + HKEY hEnumKey = NULL; + if (RegOpenKeyExW(HKEY_CURRENT_USER, FIDO_REG_PUBKEYS, 0, KEY_READ, &hEnumKey) != ERROR_SUCCESS) + { + return hStoreHandle; + } + + // enum over cached keys in registry + BYTE sPublicKeyBuffer[FIDO_MAX_PUBKEY_LEN]; + DWORD iPublicKeyBufferSize = sizeof(sPublicKeyBuffer); + WCHAR sApplicationId[FIDO_MAX_APPID_LEN]; + DWORD iApplicationIdSize = _countof(sApplicationId); + for (int iIndex = 0; RegEnumValueW(hEnumKey, iIndex, sApplicationId, &iApplicationIdSize, + NULL, NULL, sPublicKeyBuffer, &iPublicKeyBufferSize) != ERROR_NO_MORE_ITEMS; + iIndex++, iPublicKeyBufferSize = sizeof(sPublicKeyBuffer), iApplicationIdSize = _countof(sApplicationId)) + { + PCCERT_CONTEXT pCertContext = NULL; + if (cert_fido_get_cert((PBCRYPT_ECCKEY_BLOB)sPublicKeyBuffer, iPublicKeyBufferSize, sApplicationId, &pCertContext) == TRUE) + { + CertAddCertificateContextToStore(hStoreHandle, pCertContext, CERT_STORE_ADD_ALWAYS, NULL); + } + } + + CloseHandle(hEnumKey); + return hStoreHandle; +} + +struct MakeCredentialThreadParams +{ + HWND hWnd; + PCWEBAUTHN_RP_ENTITY_INFORMATION pRpInformation; + PCWEBAUTHN_USER_ENTITY_INFORMATION pUserInformation; + PCWEBAUTHN_COSE_CREDENTIAL_PARAMETERS pPubKeyCredParams; + PCWEBAUTHN_CLIENT_DATA pWebAuthNClientData; + PCWEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS pWebAuthNMakeCredentialOptions; + PWEBAUTHN_CREDENTIAL_ATTESTATION ppWebAuthNCredentialAttestation; +}; + +DWORD WINAPI WebAuthNAuthenticatorMakeCredentialThread(LPVOID lpParam) +{ + struct MakeCredentialThreadParams* pParams = lpParam; + + HRESULT hMakeResult = WebAuthNAuthenticatorMakeCredential(pParams->hWnd, pParams->pRpInformation, + pParams->pUserInformation, pParams->pPubKeyCredParams, pParams->pWebAuthNClientData, + pParams->pWebAuthNMakeCredentialOptions, &pParams->ppWebAuthNCredentialAttestation); + if (hMakeResult != S_OK) + { + ExitThread(1); + return FALSE; + } + + if (pParams->hWnd != NULL) PostMessage(pParams->hWnd, WM_USER, 0, 0); + ExitThread(0); + return TRUE; +} + +BOOL fido_create_key(LPCSTR szAlgName, LPCSTR szApplication, BOOL bResidentKey, BOOL bUserVerification) +{ + // sanity check for webauthn support + if (!LoadDelayLoadedLibaries()) return FALSE; + + WCHAR szAppIdUnicode[FIDO_MAX_APPID_LEN]; + if (MultiByteToWideChar(CP_UTF8, 0, szApplication, -1, szAppIdUnicode, _countof(szAppIdUnicode)) == 0) return FALSE; + + LONG iWebAuthAlt = 0; + LONG iSigBytes = 0; + LPCWSTR sWebAuthHashAlg = NULL; + if (strcmp(szAlgName, "ecdsa-sha2-nistp256") == 0) + { + iWebAuthAlt = WEBAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256; + sWebAuthHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_256; + iSigBytes = 32; + } + else if (strcmp(szAlgName, "ecdsa-sha2-nistp384") == 0) + { + iWebAuthAlt = WEBAUTHN_COSE_ALGORITHM_ECDSA_P384_WITH_SHA384; + sWebAuthHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_384; + iSigBytes = 48; + } + else if (strcmp(szAlgName, "ecdsa-sha2-nistp521") == 0) + { + iWebAuthAlt = WEBAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512; + sWebAuthHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_512; + iSigBytes = 64; + } + else if (strcmp(szAlgName, "ssh-ed25519") == 0) + { + iWebAuthAlt = WEBAUTHN_COSE_ALGORITHM_EDDSA_ED25519; + sWebAuthHashAlg = WEBAUTHN_HASH_ALGORITHM_SHA_256; + iSigBytes = 32; + } + else + { + return FALSE; + } + + WEBAUTHN_RP_ENTITY_INFORMATION tEntityInfo = { WEBAUTHN_RP_ENTITY_INFORMATION_CURRENT_VERSION }; + tEntityInfo.pwszName = szAppIdUnicode; + tEntityInfo.pwszId = szAppIdUnicode; + tEntityInfo.pwszIcon = NULL; + + WEBAUTHN_USER_ENTITY_INFORMATION tUserInfo = { WEBAUTHN_USER_ENTITY_INFORMATION_CURRENT_VERSION }; + tUserInfo.pwszDisplayName = FIDO_KEY_USERNAME; + tUserInfo.pwszName = FIDO_KEY_USERNAME; + tUserInfo.cbId = wcslen(FIDO_KEY_USERNAME) * 2; + tUserInfo.pbId = (PBYTE)FIDO_KEY_USERNAME; + tUserInfo.pwszIcon = NULL; + + WEBAUTHN_COSE_CREDENTIAL_PARAMETER tCoseParam = { WEBAUTHN_COSE_CREDENTIAL_PARAMETER_CURRENT_VERSION }; + tCoseParam.lAlg = iWebAuthAlt; + tCoseParam.pwszCredentialType = WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY; + + WEBAUTHN_COSE_CREDENTIAL_PARAMETERS WebAuthNCredentialParameters = { 0 }; + WebAuthNCredentialParameters.cCredentialParameters = 1; + WebAuthNCredentialParameters.pCredentialParameters = &tCoseParam; + + BYTE pRandomChallenge[FIDO_MAX_PUBKEY_LEN]; + if (BCryptGenRandom(NULL, pRandomChallenge, iSigBytes, BCRYPT_USE_SYSTEM_PREFERRED_RNG)) return FALSE; + + WEBAUTHN_CLIENT_DATA WebAuthNClientData; + WebAuthNClientData.dwVersion = WEBAUTHN_CLIENT_DATA_CURRENT_VERSION; + WebAuthNClientData.cbClientDataJSON = iSigBytes; + WebAuthNClientData.pbClientDataJSON = pRandomChallenge; + WebAuthNClientData.pwszHashAlgId = sWebAuthHashAlg; + + // setup general creation options + WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS tCredentialOptions; + ZeroMemory(&tCredentialOptions, sizeof(tCredentialOptions)); + tCredentialOptions.dwVersion = WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_CURRENT_VERSION; + tCredentialOptions.bRequireResidentKey = bResidentKey; + tCredentialOptions.dwUserVerificationRequirement = bUserVerification ? WEBAUTHN_USER_VERIFICATION_REQUIREMENT_REQUIRED : WEBAUTHN_USER_VERIFICATION_REQUIREMENT_DISCOURAGED; + + // re-enforce user verification requirements + WEBAUTHN_CRED_PROTECT_EXTENSION_IN tCredProtect = { 0 }; + tCredProtect.dwCredProtect = bUserVerification ? WEBAUTHN_USER_VERIFICATION_REQUIRED : WEBAUTHN_USER_VERIFICATION_OPTIONAL_WITH_CREDENTIAL_ID_LIST; + tCredProtect.bRequireCredProtect = bUserVerification; + WEBAUTHN_EXTENSION tCredProtectExt = { WEBAUTHN_EXTENSIONS_IDENTIFIER_CRED_PROTECT, sizeof(WEBAUTHN_CRED_PROTECT_EXTENSION_IN), &tCredProtect }; + if (bUserVerification) + { + tCredentialOptions.Extensions.cExtensions = 1; + tCredentialOptions.Extensions.pExtensions = &tCredProtectExt; + } + + // create new credential on the key on a seperate thread + struct MakeCredentialThreadParams pParams = { 0 }; + pParams.hWnd = GetForegroundWindow(); + pParams.pPubKeyCredParams = &WebAuthNCredentialParameters; + pParams.pRpInformation = &tEntityInfo; + pParams.pUserInformation = &tUserInfo; + pParams.pWebAuthNClientData = &WebAuthNClientData; + pParams.pWebAuthNMakeCredentialOptions = &tCredentialOptions; + HANDLE hThread = CreateThread(NULL, 0, WebAuthNAuthenticatorMakeCredentialThread, &pParams, 0, NULL); + if (hThread == NULL) return FALSE; + + // wait for message to complete + if (pParams.hWnd != NULL && GetWindowThreadProcessId(pParams.hWnd, NULL) == GetCurrentThreadId()) + { + for (MSG tMsg; GetMessage(&tMsg, NULL, 0, 0) > 0; ) + { + if (tMsg.message == WM_USER) break; + TranslateMessage(&tMsg); + DispatchMessage(&tMsg); + } + } + + // wait for thread to complete + DWORD iExitCode; + WaitForSingleObject(hThread, INFINITE); + GetExitCodeThread(hThread, &iExitCode); + CloseHandle(hThread); + if (iExitCode != 0) return FALSE; + + // determine start of public key area + PBYTE pAuthData = pParams.ppWebAuthNCredentialAttestation->pbAuthenticatorData; + cbor_ecdsa_response_header_t* pHeader = (cbor_ecdsa_response_header_t*)&pAuthData[0]; + const int iPubKeyOffset = sizeof(cbor_ecdsa_response_header_t) + htons(pHeader->Length); + + // get pubic key area information + cbor_ecdsa_t* pPubKey = (cbor_ecdsa_t*)&pAuthData[iPubKeyOffset]; + + // allocate key blob and populate headers + LONG iPubKeySize = iSigBytes * 2; + PBCRYPT_ECCKEY_BLOB pPublicKey = calloc(sizeof(BCRYPT_ECCKEY_BLOB) + iPubKeySize, 1); + PBYTE pPublicKeyParts = &((PBYTE)pPublicKey)[sizeof(BCRYPT_ECCKEY_BLOB)]; + pPublicKey->cbKey = iSigBytes; + + // sanity checks and copy over key parts + if (iWebAuthAlt == WEBAUTHN_COSE_ALGORITHM_ECDSA_P256_WITH_SHA256 && + pPubKey->Key256.Key1ValLen == iSigBytes && pPubKey->Key256.Key2ValLen == iSigBytes) + { + memcpy(&pPublicKeyParts[0], &pPubKey->Key256.Key1Val, iSigBytes); + memcpy(&pPublicKeyParts[iSigBytes], &pPubKey->Key256.Key2Val, iSigBytes); + pPublicKey->dwMagic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC; + } + else if (iWebAuthAlt == WEBAUTHN_COSE_ALGORITHM_ECDSA_P384_WITH_SHA384 && + pPubKey->Key384.Key1ValLen == iSigBytes && pPubKey->Key384.Key2ValLen == iSigBytes) + { + memcpy(&pPublicKeyParts[0], &pPubKey->Key384.Key1Val, iSigBytes); + memcpy(&pPublicKeyParts[iSigBytes], &pPubKey->Key384.Key2Val, iSigBytes); + pPublicKey->dwMagic = BCRYPT_ECDSA_PUBLIC_P384_MAGIC; + } + else if (iWebAuthAlt == WEBAUTHN_COSE_ALGORITHM_ECDSA_P521_WITH_SHA512 && + pPubKey->Key521.Key1ValLen == iSigBytes && pPubKey->Key521.Key2ValLen == iSigBytes) + { + memcpy(&pPublicKeyParts[0], &pPubKey->Key521.Key1Val, iSigBytes); + memcpy(&pPublicKeyParts[iSigBytes], &pPubKey->Key521.Key2Val, iSigBytes); + pPublicKey->dwMagic = BCRYPT_ECDSA_PUBLIC_P521_MAGIC; + } + else if (iWebAuthAlt == WEBAUTHN_COSE_ALGORITHM_EDDSA_ED25519 && + pPubKey->Key256.Key1ValLen == iSigBytes) + { + iPubKeySize = iSigBytes; + memcpy(&pPublicKeyParts[0], &pPubKey->Key256.Key1Val, iSigBytes); + pPublicKey->dwMagic = BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC; + } + + // commit data to registry + RegSetKeyValueW(HKEY_CURRENT_USER, FIDO_REG_PUBKEYS, szAppIdUnicode, REG_BINARY, + pPublicKey, iPubKeySize + sizeof(BCRYPT_ECCKEY_BLOB)); + RegSetKeyValueW(HKEY_CURRENT_USER, FIDO_REG_CREDIDS, szAppIdUnicode, REG_BINARY, + pParams.ppWebAuthNCredentialAttestation->pbCredentialId, (DWORD)pParams.ppWebAuthNCredentialAttestation->cbCredentialId); + RegSetKeyValueW(HKEY_CURRENT_USER, FIDO_REG_USERVER, szAppIdUnicode, REG_DWORD, + &tCredProtect.dwCredProtect, sizeof(DWORD)); + + // cleanup + WebAuthNFreeCredentialAttestation(pParams.ppWebAuthNCredentialAttestation); + return TRUE; +} + +LPWSTR fido_get_user_id() +{ + // obtain handle to current process to lookup key + HANDLE hToken = NULL; + if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken) == FALSE) + { + return NULL; + } + + // lookup process information size + LPWSTR sSidString = NULL; + DWORD dwBufferSize = 0; + GetTokenInformation(hToken, TokenUser, NULL, 0, &dwBufferSize); + if (dwBufferSize > 0) + { + // lookup process information + PTOKEN_USER pTokenUser = (PTOKEN_USER)malloc(dwBufferSize); + if (GetTokenInformation(hToken, TokenUser, pTokenUser, dwBufferSize, &dwBufferSize) && IsValidSid(pTokenUser->User.Sid)) + { + // acquire key name using + ConvertSidToStringSidW(pTokenUser->User.Sid, &sSidString); + } + } + + // cleanup and sanity check results + CloseHandle(hToken); + return sSidString; +} + +BOOL fido_delete_key(LPCSTR szCert) +{ + // split on the hint symbol to get the appid + LPSTR sApplicationId = IDEN_SPLIT(szCert); + WCHAR szAppIdUnicode[FIDO_MAX_APPID_LEN]; + if (MultiByteToWideChar(CP_UTF8, 0, sApplicationId, -1, szAppIdUnicode, _countof(szAppIdUnicode)) == 0) return FALSE; + + // get current user sid + LPWSTR sSidString = fido_get_user_id(); + if (sSidString == NULL) return FALSE; + + // construct path to puttyimp from the current directory + WCHAR szProgPath[MAX_PATH]; + GetModuleFileNameW(NULL, szProgPath, MAX_PATH); + wcsrchr(szProgPath, '\\')[1] = '\0'; + wcscat(szProgPath, L"puttyimp.exe"); + WCHAR szParams[MAX_PATH]; + wsprintfW(szParams, L"--delete-fido \"%s\" \"%s\"", szAppIdUnicode, sSidString); + LocalFree(sSidString); + + // warn user about elevation prompt user + MessageBoxW(NULL, L"PuTTY will now launch the PuTTYImp process to delete the " \ + L"selected key. This may result in an elevation prompt depending your current " \ + L"system settings.", L"FIDO Key Delete", MB_SYSTEMMODAL | MB_ICONINFORMATION | MB_OK); + + // launch importer + if ((INT_PTR)ShellExecuteW(GetForegroundWindow(), + L"runas", szProgPath, szParams, NULL, SW_SHOW) <= 32) + { + // notify user upon error + MessageBoxW(NULL, L"The PuTTYImp process failed to launch properly. You may " + L"have not have the appropriate privileges or PuTTYImp was not found. Please " + L"ensure that PuTTYImp.exe is downloaded in same directory as this executable.", + L"FIDO Key Importer Failed", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + return FALSE; + } + + return TRUE; +} + +VOID fido_import_keys() +{ + // get current user sid + LPWSTR sSidString = fido_get_user_id(); + if (sSidString == NULL) return; + + // construct path to puttyimp from the current directory + WCHAR szProgPath[MAX_PATH]; + GetModuleFileNameW(NULL, szProgPath, MAX_PATH); + wcsrchr(szProgPath, '\\')[1] = '\0'; + wcscat(szProgPath, L"puttyimp.exe"); + WCHAR szParams[MAX_PATH]; + wsprintfW(szParams, L"--import-fido %s", sSidString); + LocalFree(sSidString); + + // warn user about elevation prompt user + MessageBoxW(NULL, L"PuTTY will now launch the PuTTYImp process to search for any FIDO " \ + L"resident keys to import. This requires access to communicate directly with " \ + L" your key(s) and may result in an elevation prompt depending your current " \ + L"system settings.", L"FIDO Key Importer", MB_SYSTEMMODAL | MB_ICONINFORMATION | MB_OK); + + // launch importer + if ((INT_PTR) ShellExecuteW(GetForegroundWindow(), + L"runas", szProgPath, szParams, NULL, SW_SHOW) <= 32) + { + // notify user upon error + MessageBoxW(NULL, L"The PuTTYImp process failed to launch properly. You may " + L"have not have the appropriate privileges or PuTTYImp was not found. Please " + L"ensure that PuTTYImp.exe is downloaded in same directory as this executable.", + L"FIDO Key Importer Failed", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + return; + } +} + +VOID fido_clear_keys() +{ + if (MessageBoxW(NULL, L"This will delete PuTTY's record of any keys. " \ + L"Non-resident keys cannot be restored and resident keys will require " \ + L"local administrative access to import again. Do you wish to continue?", + L"FIDO Cache Deletion Warning", MB_SYSTEMMODAL | MB_ICONINFORMATION | MB_YESNO) == IDYES) + { + RegDeleteTreeW(HKEY_CURRENT_USER, FIDO_REG_PUBKEYS); + RegDeleteTreeW(HKEY_CURRENT_USER, FIDO_REG_USERVER); + RegDeleteTreeW(HKEY_CURRENT_USER, FIDO_REG_CREDIDS); + } +} + +#endif \ No newline at end of file diff --git a/code/cert/cert_fido.h b/code/cert/cert_fido.h new file mode 100644 index 0000000..627140e --- /dev/null +++ b/code/cert/cert_fido.h @@ -0,0 +1,27 @@ +#pragma once + +#ifdef PUTTY_CAC + +#include + +// include ssh for types +#ifndef SSH_AGENT_SUCCESS +#include "ssh.h" +#endif + +// used to determine whether these variables are marked as extern +// for external source files including these files +#undef EXTERN +#ifdef DEFINE_VARIABLES +#define EXTERN +#else +#define EXTERN extern +#endif + +// functions used by the common module +EXTERN BOOL cert_fido_test_hash(LPCSTR szCert, DWORD iHashRequest); +EXTERN BYTE* cert_fido_sign(struct ssh2_userkey* userkey, LPCBYTE pDataToSign, int iDataToSignLen, int* iSigLen, LPCSTR sHashAlgName, PDWORD iCounter, PBYTE iFlags); +EXTERN void cert_fido_load_cert(LPCSTR szCert, PCCERT_CONTEXT* ppCertCtx, HCERTSTORE* phStore); +EXTERN HCERTSTORE cert_fido_get_cert_store(LPCSTR* szHint, HWND hWnd); + +#endif // PUTTY_CAC \ No newline at end of file diff --git a/code/cert/cert_pkcs.c b/code/cert/cert_pkcs.c index f61012c..aba70f4 100644 --- a/code/cert/cert_pkcs.c +++ b/code/cert/cert_pkcs.c @@ -4,8 +4,6 @@ #include #include #include -#include -#include #pragma comment(lib,"crypt32.lib") #pragma comment(lib,"credui.lib") @@ -258,7 +256,7 @@ BYTE * cert_pkcs_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iD LPBYTE pHashData = cert_get_hash(sHashAlgName, pDataToSign, iDataToSignLen, &iHashSize, TRUE); // setup the signature process to sign using the rsa private key on the card - CK_MECHANISM tSignMech; + CK_MECHANISM tSignMech = { 0 }; tSignMech.mechanism = (oType == CKK_RSA) ? CKM_RSA_PKCS : CKM_ECDSA; tSignMech.pParameter = NULL; tSignMech.ulParameterLen = 0; @@ -303,9 +301,9 @@ BYTE * cert_pkcs_sign(struct ssh2_userkey * userkey, LPCBYTE pDataToSign, int iD void cert_pkcs_load_cert(LPCSTR szCert, PCCERT_CONTEXT* ppCertCtx, HCERTSTORE* phStore) { // split on the hint symbol to get the library path - LPSTR szThumb = strdup(szCert); + if (strrchr(szCert, '=') == NULL) return; + LPSTR szThumb = _strdup(szCert); LPSTR szLibrary = strrchr(szThumb, '='); - if (szLibrary == NULL) return; *szLibrary++ = '\0'; CK_FUNCTION_LIST_PTR pFunctionList = cert_pkcs_load_library(szLibrary); @@ -348,7 +346,7 @@ CK_FUNCTION_LIST_PTR cert_pkcs_load_library(LPCSTR szLibrary) // see if module was already loaded for (PROGRAM_ITEM * hCurItem = LibraryList; hCurItem != NULL; hCurItem = hCurItem->NextItem) { - if (stricmp(hCurItem->Path,szLibrary) == 0) + if (_stricmp(hCurItem->Path,szLibrary) == 0) { return hCurItem->FunctionList; } @@ -403,7 +401,7 @@ CK_FUNCTION_LIST_PTR cert_pkcs_load_library(LPCSTR szLibrary) // add the item to the linked list PROGRAM_ITEM * hItem = (PROGRAM_ITEM *)calloc(1, sizeof(struct PROGRAM_ITEM)); - hItem->Path = strdup(szLibrary); + hItem->Path = _strdup(szLibrary); hItem->Library = hModule; hItem->FunctionList = hFunctionList; hItem->NextItem = LibraryList; @@ -496,6 +494,17 @@ HCERTSTORE cert_pkcs_get_cert_store(LPCSTR * szHint, HWND hWnd) continue; } + // store the pkcs library as an attribute on the certificate + WCHAR sFileNameWide[MAX_PATH + 1]; + MultiByteToWideChar(CP_ACP, 0, szFile, -1, sFileNameWide, _countof(sFileNameWide)); + CRYPT_DATA_BLOB tFileName = { (wcslen(sFileNameWide) + 1) * sizeof(WCHAR), (PBYTE) sFileNameWide }; + if (CertSetCertificateContextProperty(pCertContext, CERT_PVK_FILE_PROP_ID, 0, &tFileName) != TRUE) + { + // error + CertFreeCertificateContext(pCertContext); + continue; + } + // add this certificate to our store CertAddCertificateContextToStore(hMemoryStore, pCertContext, CERT_STORE_ADD_ALWAYS, NULL); CertFreeCertificateContext(pCertContext); @@ -504,8 +513,7 @@ HCERTSTORE cert_pkcs_get_cert_store(LPCSTR * szHint, HWND hWnd) // cleanup pFunctionList->C_CloseSession(hSession); } - - if (szHint != NULL) *szHint = strdup(szFile); + return hMemoryStore; } @@ -581,7 +589,7 @@ void pkcs_lookup_token_cert(LPCSTR szCert, CK_SESSION_HANDLE_PTR phSession, CK_O BYTE pbThumb[SHA1_BINARY_SIZE]; if (szCert != NULL) { - CRYPT_HASH_BLOB cryptHashBlob; + CRYPT_HASH_BLOB cryptHashBlob = { 0 }; cryptHashBlob.cbData = SHA1_BINARY_SIZE; cryptHashBlob.pbData = pbThumb; CryptStringToBinary(&szCert[IDEN_PKCS_SIZE], SHA1_HEX_SIZE, CRYPT_STRING_HEXRAW, diff --git a/code/cgtest.c b/code/cgtest.c index ba87892..f0655b9 100644 --- a/code/cgtest.c +++ b/code/cgtest.c @@ -65,10 +65,10 @@ char *get_random_data_diagnostic(int len, const char *device) static int nprompts, promptsgot; static const char *prompts[3]; -int console_get_userpass_input_diagnostic(prompts_t *p) +SeatPromptResult console_get_userpass_input_diagnostic(prompts_t *p) { size_t i; - int ret = 1; + SeatPromptResult ret = SPR_OK; for (i = 0; i < p->n_prompts; i++) { if (promptsgot < nprompts) { prompt_set_result(p->prompts[i], prompts[promptsgot++]); @@ -77,7 +77,7 @@ int console_get_userpass_input_diagnostic(prompts_t *p) p->prompts[i]->prompt, p->prompts[i]->result->s); } else { promptsgot++; /* track number of requests anyway */ - ret = 0; + ret = SPR_SW_ABORT("preloaded prompt unavailable in cgtest"); if (cgtest_verbose) printf(" prompt \"%s\": no response preloaded\n", p->prompts[i]->prompt); diff --git a/code/charset/CMakeLists.txt b/code/charset/CMakeLists.txt new file mode 100644 index 0000000..4ff5bb8 --- /dev/null +++ b/code/charset/CMakeLists.txt @@ -0,0 +1,30 @@ +include(FindPerl) +if(NOT PERL_EXECUTABLE) + message(FATAL_ERROR "Perl is required to autogenerate sbcsdat.c") +endif() + +set(GENERATED_SBCSDAT_C ${GENERATED_SOURCES_DIR}/sbcsdat.c) +add_custom_command(OUTPUT ${GENERATED_SBCSDAT_C}.tmp + COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/charset/sbcsgen.pl + -o ${GENERATED_SBCSDAT_C}.tmp + DEPENDS ${CMAKE_SOURCE_DIR}/charset/sbcsgen.pl + ${CMAKE_SOURCE_DIR}/charset/sbcs.dat) +add_custom_target(generated_sbcsdat_c + BYPRODUCTS ${GENERATED_SBCSDAT_C} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${GENERATED_SBCSDAT_C}.tmp ${GENERATED_SBCSDAT_C} + DEPENDS ${GENERATED_SBCSDAT_C}.tmp + COMMENT "Updating sbcsdat.c") + +add_library(charset STATIC + fromucs.c + localenc.c + macenc.c + mimeenc.c + sbcs.c + ${GENERATED_SBCSDAT_C} + slookup.c + toucs.c + utf8.c + xenc.c) +add_dependencies(charset generated_sbcsdat_c) diff --git a/code/charset/localenc.c b/code/charset/localenc.c index 4aa4ae6..03340d6 100644 --- a/code/charset/localenc.c +++ b/code/charset/localenc.c @@ -1,5 +1,5 @@ /* - * local.c - translate our internal character set codes to and from + * localenc.c - translate our internal character set codes to and from * our own set of plausibly legible character-set names. Also * provides a canonical name for each encoding (useful for software * announcing what character set it will be using), and a set of diff --git a/code/charset/sbcsdat.c b/code/charset/sbcsdat.c deleted file mode 100644 index 7a31bf1..0000000 --- a/code/charset/sbcsdat.c +++ /dev/null @@ -1,4094 +0,0 @@ -/* - * sbcsdat.c - data definitions for single-byte character sets. - * - * Generated by sbcsgen.pl from sbcs.dat. - * You should edit those files rather than editing this one. - */ - -#ifndef ENUM_CHARSETS - -#include "charset.h" -#include "internal.h" - -static const sbcs_data data_CS_ISO8859_1 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff - }, - 256 -}; -const charset_spec charset_CS_ISO8859_1 = { - CS_ISO8859_1, read_sbcs, write_sbcs, &data_CS_ISO8859_1 -}; - -static const sbcs_data data_CS_ISO8859_2 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, - 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, - 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, - 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, - 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, - 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, - 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, - 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, - 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, - 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa4, 0xa7, 0xa8, 0xad, 0xb0, 0xb4, 0xb8, - 0xc1, 0xc2, 0xc4, 0xc7, 0xc9, 0xcb, 0xcd, 0xce, - 0xd3, 0xd4, 0xd6, 0xd7, 0xda, 0xdc, 0xdd, 0xdf, - 0xe1, 0xe2, 0xe4, 0xe7, 0xe9, 0xeb, 0xed, 0xee, - 0xf3, 0xf4, 0xf6, 0xf7, 0xfa, 0xfc, 0xfd, 0xc3, - 0xe3, 0xa1, 0xb1, 0xc6, 0xe6, 0xc8, 0xe8, 0xcf, - 0xef, 0xd0, 0xf0, 0xca, 0xea, 0xcc, 0xec, 0xc5, - 0xe5, 0xa5, 0xb5, 0xa3, 0xb3, 0xd1, 0xf1, 0xd2, - 0xf2, 0xd5, 0xf5, 0xc0, 0xe0, 0xd8, 0xf8, 0xa6, - 0xb6, 0xaa, 0xba, 0xa9, 0xb9, 0xde, 0xfe, 0xab, - 0xbb, 0xd9, 0xf9, 0xdb, 0xfb, 0xac, 0xbc, 0xaf, - 0xbf, 0xae, 0xbe, 0xb7, 0xa2, 0xff, 0xb2, 0xbd - }, - 256 -}; -const charset_spec charset_CS_ISO8859_2 = { - CS_ISO8859_2, read_sbcs, write_sbcs, &data_CS_ISO8859_2 -}; - -static const sbcs_data data_CS_ISO8859_3 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, ERROR , 0x0124, 0x00a7, - 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, ERROR , 0x017b, - 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, - 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, ERROR , 0x017c, - 0x00c0, 0x00c1, 0x00c2, ERROR , 0x00c4, 0x010a, 0x0108, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - ERROR , 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, - 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, - 0x00e0, 0x00e1, 0x00e2, ERROR , 0x00e4, 0x010b, 0x0109, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - ERROR , 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, - 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa3, 0xa4, 0xa7, 0xa8, 0xad, 0xb0, 0xb2, - 0xb3, 0xb4, 0xb5, 0xb7, 0xb8, 0xbd, 0xc0, 0xc1, - 0xc2, 0xc4, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, - 0xcd, 0xce, 0xcf, 0xd1, 0xd2, 0xd3, 0xd4, 0xd6, - 0xd7, 0xd9, 0xda, 0xdb, 0xdc, 0xdf, 0xe0, 0xe1, - 0xe2, 0xe4, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, - 0xed, 0xee, 0xef, 0xf1, 0xf2, 0xf3, 0xf4, 0xf6, - 0xf7, 0xf9, 0xfa, 0xfb, 0xfc, 0xc6, 0xe6, 0xc5, - 0xe5, 0xd8, 0xf8, 0xab, 0xbb, 0xd5, 0xf5, 0xa6, - 0xb6, 0xa1, 0xb1, 0xa9, 0xb9, 0xac, 0xbc, 0xde, - 0xfe, 0xaa, 0xba, 0xdd, 0xfd, 0xaf, 0xbf, 0xa2, - 0xff - }, - 249 -}; -const charset_spec charset_CS_ISO8859_3 = { - CS_ISO8859_3, read_sbcs, write_sbcs, &data_CS_ISO8859_3 -}; - -static const sbcs_data data_CS_ISO8859_4 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, - 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, - 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, - 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, - 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, - 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa4, 0xa7, 0xa8, 0xad, 0xaf, 0xb0, 0xb4, - 0xb8, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc9, - 0xcb, 0xcd, 0xce, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, - 0xda, 0xdb, 0xdc, 0xdf, 0xe1, 0xe2, 0xe3, 0xe4, - 0xe5, 0xe6, 0xe9, 0xeb, 0xed, 0xee, 0xf4, 0xf5, - 0xf6, 0xf7, 0xf8, 0xfa, 0xfb, 0xfc, 0xc0, 0xe0, - 0xa1, 0xb1, 0xc8, 0xe8, 0xd0, 0xf0, 0xaa, 0xba, - 0xcc, 0xec, 0xca, 0xea, 0xab, 0xbb, 0xa5, 0xb5, - 0xcf, 0xef, 0xc7, 0xe7, 0xd3, 0xf3, 0xa2, 0xa6, - 0xb6, 0xd1, 0xf1, 0xbd, 0xbf, 0xd2, 0xf2, 0xa3, - 0xb3, 0xa9, 0xb9, 0xac, 0xbc, 0xdd, 0xfd, 0xde, - 0xfe, 0xd9, 0xf9, 0xae, 0xbe, 0xb7, 0xff, 0xb2 - }, - 256 -}; -const charset_spec charset_CS_ISO8859_4 = { - CS_ISO8859_4, read_sbcs, write_sbcs, &data_CS_ISO8859_4 -}; - -static const sbcs_data data_CS_ISO8859_5 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, - 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xfd, 0xad, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, - 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xae, - 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, - 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, - 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, - 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, - 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, - 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, - 0xef, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfe, 0xff, 0xf0 - }, - 256 -}; -const charset_spec charset_CS_ISO8859_5 = { - CS_ISO8859_5, read_sbcs, write_sbcs, &data_CS_ISO8859_5 -}; - -static const sbcs_data data_CS_ISO8859_6 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, ERROR , ERROR , ERROR , 0x00a4, ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , 0x060c, 0x00ad, ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , 0x061b, ERROR , ERROR , ERROR , 0x061f, - ERROR , 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, - 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, - 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, - 0x0638, 0x0639, 0x063a, ERROR , ERROR , ERROR , ERROR , ERROR , - 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, - 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, - 0x0650, 0x0651, 0x0652, ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa4, 0xad, 0xac, 0xbb, 0xbf, 0xc1, 0xc2, - 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, - 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2 - }, - 211 -}; -const charset_spec charset_CS_ISO8859_6 = { - CS_ISO8859_6, read_sbcs, write_sbcs, &data_CS_ISO8859_6 -}; - -static const sbcs_data data_CS_ISO8859_7 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x2018, 0x2019, 0x00a3, ERROR , ERROR , 0x00a6, 0x00a7, - 0x00a8, 0x00a9, ERROR , 0x00ab, 0x00ac, 0x00ad, ERROR , 0x2015, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, - 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, - 0x03a0, 0x03a1, ERROR , 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, - 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, - 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, - 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, - 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa3, 0xa6, 0xa7, 0xa8, 0xa9, 0xab, 0xac, - 0xad, 0xb0, 0xb1, 0xb2, 0xb3, 0xb7, 0xbb, 0xbd, - 0xb4, 0xb5, 0xb6, 0xb8, 0xb9, 0xba, 0xbc, 0xbe, - 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, - 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, - 0xcf, 0xd0, 0xd1, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xaf, - 0xa1, 0xa2 - }, - 250 -}; -const charset_spec charset_CS_ISO8859_7 = { - CS_ISO8859_7, read_sbcs, write_sbcs, &data_CS_ISO8859_7 -}; - -static const sbcs_data data_CS_ISO8859_8 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, ERROR , 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , 0x2017, - 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, - 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, - 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, - 0x05e8, 0x05e9, 0x05ea, ERROR , ERROR , 0x200e, 0x200f, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, - 0xa9, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, - 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, - 0xbb, 0xbc, 0xbd, 0xbe, 0xaa, 0xba, 0xe0, 0xe1, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, - 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, - 0xfa, 0xfd, 0xfe, 0xdf - }, - 220 -}; -const charset_spec charset_CS_ISO8859_8 = { - CS_ISO8859_8, read_sbcs, write_sbcs, &data_CS_ISO8859_8 -}; - -static const sbcs_data data_CS_ISO8859_9 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, - 0xd9, 0xda, 0xdb, 0xdc, 0xdf, 0xe0, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf1, 0xf2, 0xf3, - 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, - 0xfc, 0xff, 0xd0, 0xf0, 0xdd, 0xfd, 0xde, 0xfe - }, - 256 -}; -const charset_spec charset_CS_ISO8859_9 = { - CS_ISO8859_9, read_sbcs, write_sbcs, &data_CS_ISO8859_9 -}; - -static const sbcs_data data_CS_ISO8859_10 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, - 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, - 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, - 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa7, 0xad, 0xb0, 0xb7, 0xc1, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc9, 0xcb, 0xcd, 0xce, 0xcf, - 0xd0, 0xd3, 0xd4, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, - 0xdc, 0xdd, 0xde, 0xdf, 0xe1, 0xe2, 0xe3, 0xe4, - 0xe5, 0xe6, 0xe9, 0xeb, 0xed, 0xee, 0xef, 0xf0, - 0xf3, 0xf4, 0xf5, 0xf6, 0xf8, 0xfa, 0xfb, 0xfc, - 0xfd, 0xfe, 0xc0, 0xe0, 0xa1, 0xb1, 0xc8, 0xe8, - 0xa9, 0xb9, 0xa2, 0xb2, 0xcc, 0xec, 0xca, 0xea, - 0xa3, 0xb3, 0xa5, 0xb5, 0xa4, 0xb4, 0xc7, 0xe7, - 0xa6, 0xb6, 0xff, 0xa8, 0xb8, 0xd1, 0xf1, 0xaf, - 0xbf, 0xd2, 0xf2, 0xaa, 0xba, 0xab, 0xbb, 0xd7, - 0xf7, 0xae, 0xbe, 0xd9, 0xf9, 0xac, 0xbc, 0xbd - }, - 256 -}; -const charset_spec charset_CS_ISO8859_10 = { - CS_ISO8859_10, read_sbcs, write_sbcs, &data_CS_ISO8859_10 -}; - -static const sbcs_data data_CS_ISO8859_11 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, - 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, - 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, - 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, - 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, - 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, - 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, - 0x0e38, 0x0e39, 0x0e3a, ERROR , ERROR , ERROR , ERROR , 0x0e3f, - 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, - 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, - 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, - 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, ERROR , ERROR , ERROR , ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, - 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, - 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, - 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb - }, - 248 -}; -const charset_spec charset_CS_ISO8859_11 = { - CS_ISO8859_11, read_sbcs, write_sbcs, &data_CS_ISO8859_11 -}; - -static const sbcs_data data_CS_ISO8859_13 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, - 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, - 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, - 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, - 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, - 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, - 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, - 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, - 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, - 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, - 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa2, 0xa3, 0xa4, 0xa6, 0xa7, 0xa9, 0xab, - 0xac, 0xad, 0xae, 0xb0, 0xb1, 0xb2, 0xb3, 0xb5, - 0xb6, 0xb7, 0xb9, 0xbb, 0xbc, 0xbd, 0xbe, 0xc4, - 0xc5, 0xaf, 0xc9, 0xd3, 0xd5, 0xd6, 0xd7, 0xa8, - 0xdc, 0xdf, 0xe4, 0xe5, 0xbf, 0xe9, 0xf3, 0xf5, - 0xf6, 0xf7, 0xb8, 0xfc, 0xc2, 0xe2, 0xc0, 0xe0, - 0xc3, 0xe3, 0xc8, 0xe8, 0xc7, 0xe7, 0xcb, 0xeb, - 0xc6, 0xe6, 0xcc, 0xec, 0xce, 0xee, 0xc1, 0xe1, - 0xcd, 0xed, 0xcf, 0xef, 0xd9, 0xf9, 0xd1, 0xf1, - 0xd2, 0xf2, 0xd4, 0xf4, 0xaa, 0xba, 0xda, 0xfa, - 0xd0, 0xf0, 0xdb, 0xfb, 0xd8, 0xf8, 0xca, 0xea, - 0xdd, 0xfd, 0xde, 0xfe, 0xff, 0xb4, 0xa1, 0xa5 - }, - 256 -}; -const charset_spec charset_CS_ISO8859_13 = { - CS_ISO8859_13, read_sbcs, write_sbcs, &data_CS_ISO8859_13 -}; - -static const sbcs_data data_CS_ISO8859_14 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, - 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, - 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, - 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa3, 0xa7, 0xa9, 0xad, 0xae, 0xb6, 0xc0, - 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, - 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd1, - 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd8, 0xd9, 0xda, - 0xdb, 0xdc, 0xdd, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, - 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, - 0xec, 0xed, 0xee, 0xef, 0xf1, 0xf2, 0xf3, 0xf4, - 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, - 0xff, 0xa4, 0xa5, 0xb2, 0xb3, 0xd0, 0xf0, 0xde, - 0xfe, 0xaf, 0xa1, 0xa2, 0xa6, 0xab, 0xb0, 0xb1, - 0xb4, 0xb5, 0xb7, 0xb9, 0xbb, 0xbf, 0xd7, 0xf7, - 0xa8, 0xb8, 0xaa, 0xba, 0xbd, 0xbe, 0xac, 0xbc - }, - 256 -}; -const charset_spec charset_CS_ISO8859_14 = { - CS_ISO8859_14, read_sbcs, write_sbcs, &data_CS_ISO8859_14 -}; - -static const sbcs_data data_CS_ISO8859_15 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, - 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa5, 0xa7, 0xa9, 0xaa, - 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, - 0xb3, 0xb5, 0xb6, 0xb7, 0xb9, 0xba, 0xbb, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, - 0xbc, 0xbd, 0xa6, 0xa8, 0xbe, 0xb4, 0xb8, 0xa4 - }, - 256 -}; -const charset_spec charset_CS_ISO8859_15 = { - CS_ISO8859_15, read_sbcs, write_sbcs, &data_CS_ISO8859_15 -}; - -static const sbcs_data data_CS_ISO8859_16 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, - 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, - 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, - 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, - 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, - 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa7, 0xa9, 0xab, 0xad, 0xb0, 0xb1, 0xb6, - 0xb7, 0xbb, 0xc0, 0xc1, 0xc2, 0xc4, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd2, 0xd3, 0xd4, 0xd6, 0xd9, 0xda, 0xdb, 0xdc, - 0xdf, 0xe0, 0xe1, 0xe2, 0xe4, 0xe6, 0xe7, 0xe8, - 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf2, - 0xf3, 0xf4, 0xf6, 0xf9, 0xfa, 0xfb, 0xfc, 0xff, - 0xc3, 0xe3, 0xa1, 0xa2, 0xc5, 0xe5, 0xb2, 0xb9, - 0xd0, 0xf0, 0xdd, 0xfd, 0xa3, 0xb3, 0xd1, 0xf1, - 0xd5, 0xf5, 0xbc, 0xbd, 0xd7, 0xf7, 0xa6, 0xa8, - 0xd8, 0xf8, 0xbe, 0xac, 0xae, 0xaf, 0xbf, 0xb4, - 0xb8, 0xaa, 0xba, 0xde, 0xfe, 0xb5, 0xa5, 0xa4 - }, - 256 -}; -const charset_spec charset_CS_ISO8859_16 = { - CS_ISO8859_16, read_sbcs, write_sbcs, &data_CS_ISO8859_16 -}; - -static const sbcs_data data_CS_ISO8859_1_X11 = { - { - 0x0020, 0x2666, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, - 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, - 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, - 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff - }, - { - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, - 0x1c, 0x1d, 0x1a, 0x1b, 0x10, 0x11, 0x13, 0x14, - 0x03, 0x06, 0x0a, 0x04, 0x05, 0x09, 0x12, 0x19, - 0x0d, 0x0c, 0x0e, 0x0b, 0x15, 0x16, 0x18, 0x17, - 0x0f, 0x02, 0x01 - }, - 251 -}; -const charset_spec charset_CS_ISO8859_1_X11 = { - CS_ISO8859_1_X11, read_sbcs, write_sbcs, &data_CS_ISO8859_1_X11 -}; - -static const sbcs_data data_CS_CP437 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, - 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, - 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, - 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192, - 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, - 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, - 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, - 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, - 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, - 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, - 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, - 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, - 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, - 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x03c6, 0x03b5, 0x2229, - 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, - 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xff, 0xad, 0x9b, 0x9c, 0x9d, 0xa6, 0xae, 0xaa, - 0xf8, 0xf1, 0xfd, 0xe6, 0xfa, 0xa7, 0xaf, 0xac, - 0xab, 0xa8, 0x8e, 0x8f, 0x92, 0x80, 0x90, 0xa5, - 0x99, 0x9a, 0xe1, 0x85, 0xa0, 0x83, 0x84, 0x86, - 0x91, 0x87, 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, - 0x8c, 0x8b, 0xa4, 0x95, 0xa2, 0x93, 0x94, 0xf6, - 0x97, 0xa3, 0x96, 0x81, 0x98, 0x9f, 0xe2, 0xe9, - 0xe4, 0xe8, 0xea, 0xe0, 0xeb, 0xee, 0xe3, 0xe5, - 0xe7, 0xed, 0xfc, 0x9e, 0xf9, 0xfb, 0xec, 0xef, - 0xf7, 0xf0, 0xf3, 0xf2, 0xa9, 0xf4, 0xf5, 0xc4, - 0xb3, 0xda, 0xbf, 0xc0, 0xd9, 0xc3, 0xb4, 0xc2, - 0xc1, 0xc5, 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, - 0xb7, 0xbb, 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, - 0xc6, 0xc7, 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, - 0xcb, 0xcf, 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0xdf, - 0xdc, 0xdb, 0xdd, 0xde, 0xb0, 0xb1, 0xb2, 0xfe - }, - 256 -}; -const charset_spec charset_CS_CP437 = { - CS_CP437, read_sbcs, write_sbcs, &data_CS_CP437 -}; - -static const sbcs_data data_CS_CP850 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, - 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, - 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, - 0x00ff, 0x00d6, 0x00dc, 0x00f8, 0x00a3, 0x00d8, 0x00d7, 0x0192, - 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, - 0x00bf, 0x00ae, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, - 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00c1, 0x00c2, 0x00c0, - 0x00a9, 0x2563, 0x2551, 0x2557, 0x255d, 0x00a2, 0x00a5, 0x2510, - 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x00e3, 0x00c3, - 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4, - 0x00f0, 0x00d0, 0x00ca, 0x00cb, 0x00c8, 0x0131, 0x00cd, 0x00ce, - 0x00cf, 0x2518, 0x250c, 0x2588, 0x2584, 0x00a6, 0x00cc, 0x2580, - 0x00d3, 0x00df, 0x00d4, 0x00d2, 0x00f5, 0x00d5, 0x00b5, 0x00fe, - 0x00de, 0x00da, 0x00db, 0x00d9, 0x00fd, 0x00dd, 0x00af, 0x00b4, - 0x00ad, 0x00b1, 0x2017, 0x00be, 0x00b6, 0x00a7, 0x00f7, 0x00b8, - 0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, - 0xf9, 0xb8, 0xa6, 0xae, 0xaa, 0xf0, 0xa9, 0xee, - 0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, - 0xf7, 0xfb, 0xa7, 0xaf, 0xac, 0xab, 0xf3, 0xa8, - 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, - 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, - 0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0x9e, - 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0xe1, - 0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, - 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, - 0xd0, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, - 0x9b, 0x97, 0xa3, 0x96, 0x81, 0xec, 0xe7, 0x98, - 0xd5, 0x9f, 0xf2, 0xc4, 0xb3, 0xda, 0xbf, 0xc0, - 0xd9, 0xc3, 0xb4, 0xc2, 0xc1, 0xc5, 0xcd, 0xba, - 0xc9, 0xbb, 0xc8, 0xbc, 0xcc, 0xb9, 0xcb, 0xca, - 0xce, 0xdf, 0xdc, 0xdb, 0xb0, 0xb1, 0xb2, 0xfe - }, - 256 -}; -const charset_spec charset_CS_CP850 = { - CS_CP850, read_sbcs, write_sbcs, &data_CS_CP850 -}; - -static const sbcs_data data_CS_CP866 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, - 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, - 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, - 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, - 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, - 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, - 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040e, 0x045e, - 0x00b0, 0x2219, 0x00b7, 0x221a, 0x2116, 0x00a4, 0x25a0, 0x00a0 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xff, 0xfd, 0xf8, 0xfa, 0xf0, 0xf2, 0xf4, 0xf6, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf1, 0xf3, 0xf5, 0xf7, 0xfc, 0xf9, 0xfb, 0xc4, - 0xb3, 0xda, 0xbf, 0xc0, 0xd9, 0xc3, 0xb4, 0xc2, - 0xc1, 0xc5, 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, - 0xb7, 0xbb, 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, - 0xc6, 0xc7, 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, - 0xcb, 0xcf, 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0xdf, - 0xdc, 0xdb, 0xdd, 0xde, 0xb0, 0xb1, 0xb2, 0xfe - }, - 256 -}; -const charset_spec charset_CS_CP866 = { - CS_CP866, read_sbcs, write_sbcs, &data_CS_CP866 -}; - -static const sbcs_data data_CS_CP852 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x016f, 0x0107, 0x00e7, - 0x0142, 0x00eb, 0x0150, 0x0151, 0x00ee, 0x0179, 0x00c4, 0x0106, - 0x00c9, 0x0139, 0x013a, 0x00f4, 0x00f6, 0x013d, 0x013e, 0x015a, - 0x015b, 0x00d6, 0x00dc, 0x0164, 0x0165, 0x0141, 0x00d7, 0x010d, - 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x0104, 0x0105, 0x017d, 0x017e, - 0x0118, 0x0119, 0x00ac, 0x017a, 0x010c, 0x015f, 0x00ab, 0x00bb, - 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00c1, 0x00c2, 0x011a, - 0x015e, 0x2563, 0x2551, 0x2557, 0x255d, 0x017b, 0x017c, 0x2510, - 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x0102, 0x0103, - 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4, - 0x0111, 0x0110, 0x010e, 0x00cb, 0x010f, 0x0147, 0x00cd, 0x00ce, - 0x011b, 0x2518, 0x250c, 0x2588, 0x2584, 0x0162, 0x016e, 0x2580, - 0x00d3, 0x00df, 0x00d4, 0x0143, 0x0144, 0x0148, 0x0160, 0x0161, - 0x0154, 0x00da, 0x0155, 0x0170, 0x00fd, 0x00dd, 0x0163, 0x00b4, - 0x00ad, 0x02dd, 0x02db, 0x02c7, 0x02d8, 0x00a7, 0x00f7, 0x00b8, - 0x00b0, 0x00a8, 0x02d9, 0x0171, 0x0158, 0x0159, 0x25a0, 0x00a0 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xff, 0xcf, 0xf5, 0xf9, 0xae, 0xaa, 0xf0, 0xf8, - 0xef, 0xf7, 0xaf, 0xb5, 0xb6, 0x8e, 0x80, 0x90, - 0xd3, 0xd6, 0xd7, 0xe0, 0xe2, 0x99, 0x9e, 0xe9, - 0x9a, 0xed, 0xe1, 0xa0, 0x83, 0x84, 0x87, 0x82, - 0x89, 0xa1, 0x8c, 0xa2, 0x93, 0x94, 0xf6, 0xa3, - 0x81, 0xec, 0xc6, 0xc7, 0xa4, 0xa5, 0x8f, 0x86, - 0xac, 0x9f, 0xd2, 0xd4, 0xd1, 0xd0, 0xa8, 0xa9, - 0xb7, 0xd8, 0x91, 0x92, 0x95, 0x96, 0x9d, 0x88, - 0xe3, 0xe4, 0xd5, 0xe5, 0x8a, 0x8b, 0xe8, 0xea, - 0xfc, 0xfd, 0x97, 0x98, 0xb8, 0xad, 0xe6, 0xe7, - 0xdd, 0xee, 0x9b, 0x9c, 0xde, 0x85, 0xeb, 0xfb, - 0x8d, 0xab, 0xbd, 0xbe, 0xa6, 0xa7, 0xf3, 0xf4, - 0xfa, 0xf2, 0xf1, 0xc4, 0xb3, 0xda, 0xbf, 0xc0, - 0xd9, 0xc3, 0xb4, 0xc2, 0xc1, 0xc5, 0xcd, 0xba, - 0xc9, 0xbb, 0xc8, 0xbc, 0xcc, 0xb9, 0xcb, 0xca, - 0xce, 0xdf, 0xdc, 0xdb, 0xb0, 0xb1, 0xb2, 0xfe - }, - 256 -}; -const charset_spec charset_CS_CP852 = { - CS_CP852, read_sbcs, write_sbcs, &data_CS_CP852 -}; - -static const sbcs_data data_CS_CP1250 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, ERROR , 0x201e, 0x2026, 0x2020, 0x2021, - ERROR , 0x2030, 0x0160, 0x2039, 0x015a, 0x0164, 0x017d, 0x0179, - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - ERROR , 0x2122, 0x0161, 0x203a, 0x015b, 0x0165, 0x017e, 0x017a, - 0x00a0, 0x02c7, 0x02d8, 0x0141, 0x00a4, 0x0104, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x015e, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x017b, - 0x00b0, 0x00b1, 0x02db, 0x0142, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x0105, 0x015f, 0x00bb, 0x013d, 0x02dd, 0x013e, 0x017c, - 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, - 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, - 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, - 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, - 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, - 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa4, 0xa6, 0xa7, 0xa8, 0xa9, 0xab, 0xac, - 0xad, 0xae, 0xb0, 0xb1, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xbb, 0xc1, 0xc2, 0xc4, 0xc7, 0xc9, 0xcb, - 0xcd, 0xce, 0xd3, 0xd4, 0xd6, 0xd7, 0xda, 0xdc, - 0xdd, 0xdf, 0xe1, 0xe2, 0xe4, 0xe7, 0xe9, 0xeb, - 0xed, 0xee, 0xf3, 0xf4, 0xf6, 0xf7, 0xfa, 0xfc, - 0xfd, 0xc3, 0xe3, 0xa5, 0xb9, 0xc6, 0xe6, 0xc8, - 0xe8, 0xcf, 0xef, 0xd0, 0xf0, 0xca, 0xea, 0xcc, - 0xec, 0xc5, 0xe5, 0xbc, 0xbe, 0xa3, 0xb3, 0xd1, - 0xf1, 0xd2, 0xf2, 0xd5, 0xf5, 0xc0, 0xe0, 0xd8, - 0xf8, 0x8c, 0x9c, 0xaa, 0xba, 0x8a, 0x9a, 0xde, - 0xfe, 0x8d, 0x9d, 0xd9, 0xf9, 0xdb, 0xfb, 0x8f, - 0x9f, 0xaf, 0xbf, 0x8e, 0x9e, 0xa1, 0xa2, 0xff, - 0xb2, 0xbd, 0x96, 0x97, 0x91, 0x92, 0x82, 0x93, - 0x94, 0x84, 0x86, 0x87, 0x95, 0x85, 0x89, 0x8b, - 0x9b, 0x80, 0x99 - }, - 251 -}; -const charset_spec charset_CS_CP1250 = { - CS_CP1250, read_sbcs, write_sbcs, &data_CS_CP1250 -}; - -static const sbcs_data data_CS_CP1251 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, - 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f, - 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - ERROR , 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, - 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, - 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407, - 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7, - 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa4, 0xa6, 0xa7, 0xa9, 0xab, 0xac, 0xad, - 0xae, 0xb0, 0xb1, 0xb5, 0xb6, 0xb7, 0xbb, 0xa8, - 0x80, 0x81, 0xaa, 0xbd, 0xb2, 0xaf, 0xa3, 0x8a, - 0x8c, 0x8e, 0x8d, 0xa1, 0x8f, 0xc0, 0xc1, 0xc2, - 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, - 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, - 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, - 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0xb8, 0x90, 0x83, - 0xba, 0xbe, 0xb3, 0xbf, 0xbc, 0x9a, 0x9c, 0x9e, - 0x9d, 0xa2, 0x9f, 0xa5, 0xb4, 0x96, 0x97, 0x91, - 0x92, 0x82, 0x93, 0x94, 0x84, 0x86, 0x87, 0x95, - 0x85, 0x89, 0x8b, 0x9b, 0x88, 0xb9, 0x99 - }, - 255 -}; -const charset_spec charset_CS_CP1251 = { - CS_CP1251, read_sbcs, write_sbcs, &data_CS_CP1251 -}; - -static const sbcs_data data_CS_CP1252 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, - 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, ERROR , 0x017d, ERROR , - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, ERROR , 0x017e, 0x0178, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, - 0x8c, 0x9c, 0x8a, 0x9a, 0x9f, 0x8e, 0x9e, 0x83, - 0x88, 0x98, 0x96, 0x97, 0x91, 0x92, 0x82, 0x93, - 0x94, 0x84, 0x86, 0x87, 0x95, 0x85, 0x89, 0x8b, - 0x9b, 0x80, 0x99 - }, - 251 -}; -const charset_spec charset_CS_CP1252 = { - CS_CP1252, read_sbcs, write_sbcs, &data_CS_CP1252 -}; - -static const sbcs_data data_CS_CP1253 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, - ERROR , 0x2030, ERROR , 0x2039, ERROR , ERROR , ERROR , ERROR , - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - ERROR , 0x2122, ERROR , 0x203a, ERROR , ERROR , ERROR , ERROR , - 0x00a0, 0x0385, 0x0386, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, ERROR , 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x2015, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x00b5, 0x00b6, 0x00b7, - 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, - 0x03a0, 0x03a1, ERROR , 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, - 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, - 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, - 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, - 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, - 0xab, 0xac, 0xad, 0xae, 0xb0, 0xb1, 0xb2, 0xb3, - 0xb5, 0xb6, 0xb7, 0xbb, 0xbd, 0x83, 0xb4, 0xa1, - 0xa2, 0xb8, 0xb9, 0xba, 0xbc, 0xbe, 0xbf, 0xc0, - 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, - 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, - 0xd1, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, - 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, - 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, - 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x96, 0x97, 0xaf, - 0x91, 0x92, 0x82, 0x93, 0x94, 0x84, 0x86, 0x87, - 0x95, 0x85, 0x89, 0x8b, 0x9b, 0x80, 0x99 - }, - 239 -}; -const charset_spec charset_CS_CP1253 = { - CS_CP1253, read_sbcs, write_sbcs, &data_CS_CP1253 -}; - -static const sbcs_data data_CS_CP1254 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, - 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, ERROR , ERROR , ERROR , - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, ERROR , ERROR , 0x0178, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, - 0xd9, 0xda, 0xdb, 0xdc, 0xdf, 0xe0, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf1, 0xf2, 0xf3, - 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, - 0xfc, 0xff, 0xd0, 0xf0, 0xdd, 0xfd, 0x8c, 0x9c, - 0xde, 0xfe, 0x8a, 0x9a, 0x9f, 0x83, 0x88, 0x98, - 0x96, 0x97, 0x91, 0x92, 0x82, 0x93, 0x94, 0x84, - 0x86, 0x87, 0x95, 0x85, 0x89, 0x8b, 0x9b, 0x80, - 0x99 - }, - 249 -}; -const charset_spec charset_CS_CP1254 = { - CS_CP1254, read_sbcs, write_sbcs, &data_CS_CP1254 -}; - -static const sbcs_data data_CS_CP1255 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, - 0x02c6, 0x2030, ERROR , 0x2039, ERROR , ERROR , ERROR , ERROR , - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - 0x02dc, 0x2122, ERROR , 0x203a, ERROR , ERROR , ERROR , ERROR , - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20aa, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, - 0x05b8, 0x05b9, ERROR , 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, - 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f0, 0x05f1, 0x05f2, 0x05f3, - 0x05f4, ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, - 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, - 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, - 0x05e8, 0x05e9, 0x05ea, ERROR , ERROR , 0x200e, 0x200f, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa5, 0xa6, 0xa7, 0xa8, - 0xa9, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, - 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, - 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xaa, 0xba, 0x83, - 0x88, 0x98, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, - 0xc6, 0xc7, 0xc8, 0xc9, 0xcb, 0xcc, 0xcd, 0xce, - 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xe0, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, - 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, - 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xfd, 0xfe, 0x96, - 0x97, 0x91, 0x92, 0x82, 0x93, 0x94, 0x84, 0x86, - 0x87, 0x95, 0x85, 0x89, 0x8b, 0x9b, 0xa4, 0x80, - 0x99 - }, - 233 -}; -const charset_spec charset_CS_CP1255 = { - CS_CP1255, read_sbcs, write_sbcs, &data_CS_CP1255 -}; - -static const sbcs_data data_CS_CP1256 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, 0x067e, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, - 0x02c6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, - 0x06af, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - 0x06a9, 0x2122, 0x0691, 0x203a, 0x0153, 0x200c, 0x200d, 0x06ba, - 0x00a0, 0x060c, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x06be, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x061b, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x061f, - 0x06c1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, - 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, - 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00d7, - 0x0637, 0x0638, 0x0639, 0x063a, 0x0640, 0x0641, 0x0642, 0x0643, - 0x00e0, 0x0644, 0x00e2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x0649, 0x064a, 0x00ee, 0x00ef, - 0x064b, 0x064c, 0x064d, 0x064e, 0x00f4, 0x064f, 0x0650, 0x00f7, - 0x0651, 0x00f9, 0x0652, 0x00fb, 0x00fc, 0x200e, 0x200f, 0x06d2 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, - 0xa9, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, - 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, - 0xbb, 0xbc, 0xbd, 0xbe, 0xd7, 0xe0, 0xe2, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xee, 0xef, 0xf4, 0xf7, - 0xf9, 0xfb, 0xfc, 0x8c, 0x9c, 0x83, 0x88, 0xa1, - 0xba, 0xbf, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, - 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, - 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe1, 0xe3, 0xe4, 0xe5, 0xe6, 0xec, 0xed, 0xf0, - 0xf1, 0xf2, 0xf3, 0xf5, 0xf6, 0xf8, 0xfa, 0x8a, - 0x81, 0x8d, 0x8f, 0x9a, 0x8e, 0x98, 0x90, 0x9f, - 0xaa, 0xc0, 0xff, 0x9d, 0x9e, 0xfd, 0xfe, 0x96, - 0x97, 0x91, 0x92, 0x82, 0x93, 0x94, 0x84, 0x86, - 0x87, 0x95, 0x85, 0x89, 0x8b, 0x9b, 0x80, 0x99 - }, - 256 -}; -const charset_spec charset_CS_CP1256 = { - CS_CP1256, read_sbcs, write_sbcs, &data_CS_CP1256 -}; - -static const sbcs_data data_CS_CP1257 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, ERROR , 0x201e, 0x2026, 0x2020, 0x2021, - ERROR , 0x2030, ERROR , 0x2039, ERROR , 0x00a8, 0x02c7, 0x00b8, - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - ERROR , 0x2122, ERROR , 0x203a, ERROR , 0x00af, 0x02db, ERROR , - 0x00a0, ERROR , 0x00a2, 0x00a3, 0x00a4, ERROR , 0x00a6, 0x00a7, - 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, - 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, - 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, - 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, - 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, - 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, - 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, - 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, - 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x02d9 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa2, 0xa3, 0xa4, 0xa6, 0xa7, 0x8d, 0xa9, - 0xab, 0xac, 0xad, 0xae, 0x9d, 0xb0, 0xb1, 0xb2, - 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0x8f, 0xb9, 0xbb, - 0xbc, 0xbd, 0xbe, 0xc4, 0xc5, 0xaf, 0xc9, 0xd3, - 0xd5, 0xd6, 0xd7, 0xa8, 0xdc, 0xdf, 0xe4, 0xe5, - 0xbf, 0xe9, 0xf3, 0xf5, 0xf6, 0xf7, 0xb8, 0xfc, - 0xc2, 0xe2, 0xc0, 0xe0, 0xc3, 0xe3, 0xc8, 0xe8, - 0xc7, 0xe7, 0xcb, 0xeb, 0xc6, 0xe6, 0xcc, 0xec, - 0xce, 0xee, 0xc1, 0xe1, 0xcd, 0xed, 0xcf, 0xef, - 0xd9, 0xf9, 0xd1, 0xf1, 0xd2, 0xf2, 0xd4, 0xf4, - 0xaa, 0xba, 0xda, 0xfa, 0xd0, 0xf0, 0xdb, 0xfb, - 0xd8, 0xf8, 0xca, 0xea, 0xdd, 0xfd, 0xde, 0xfe, - 0x8e, 0xff, 0x9e, 0x96, 0x97, 0x91, 0x92, 0x82, - 0x93, 0x94, 0x84, 0x86, 0x87, 0x95, 0x85, 0x89, - 0x8b, 0x9b, 0x80, 0x99 - }, - 244 -}; -const charset_spec charset_CS_CP1257 = { - CS_CP1257, read_sbcs, write_sbcs, &data_CS_CP1257 -}; - -static const sbcs_data data_CS_CP1258 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x20ac, ERROR , 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, - 0x02c6, 0x2030, ERROR , 0x2039, 0x0152, ERROR , ERROR , ERROR , - ERROR , 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, - 0x02dc, 0x2122, ERROR , 0x203a, 0x0153, ERROR , ERROR , 0x0178, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x0300, 0x00cd, 0x00ce, 0x00cf, - 0x0110, 0x00d1, 0x0309, 0x00d3, 0x00d4, 0x01a0, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x01af, 0x0303, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x0301, 0x00ed, 0x00ee, 0x00ef, - 0x0111, 0x00f1, 0x0323, 0x00f3, 0x00f4, 0x01a1, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x01b0, 0x20ab, 0x00ff - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, - 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf, 0xd1, 0xd3, - 0xd4, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, - 0xdf, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xed, 0xee, 0xef, 0xf1, - 0xf3, 0xf4, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, - 0xfc, 0xff, 0xc3, 0xe3, 0xd0, 0xf0, 0x8c, 0x9c, - 0x9f, 0x83, 0xd5, 0xf5, 0xdd, 0xfd, 0x88, 0x98, - 0xcc, 0xec, 0xde, 0xd2, 0xf2, 0x96, 0x97, 0x91, - 0x92, 0x82, 0x93, 0x94, 0x84, 0x86, 0x87, 0x95, - 0x85, 0x89, 0x8b, 0x9b, 0xfe, 0x80, 0x99 - }, - 247 -}; -const charset_spec charset_CS_CP1258 = { - CS_CP1258, read_sbcs, write_sbcs, &data_CS_CP1258 -}; - -static const sbcs_data data_CS_KOI8_R = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, - 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, - 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, - 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, - 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, - 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, - 0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, - 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9, - 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, - 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, - 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, - 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x9a, 0xbf, 0x9c, 0x9d, 0x9e, 0x9f, 0xb3, 0xe1, - 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, 0xe9, - 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf2, - 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, 0xfb, - 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, 0xc1, - 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, 0xc9, - 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, - 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, 0xdb, - 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, 0xa3, - 0x95, 0x96, 0x97, 0x98, 0x99, 0x93, 0x9b, 0x80, - 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, - 0x89, 0x8a, 0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, - 0xaf, 0xb0, 0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x8b, - 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x94 - }, - 256 -}; -const charset_spec charset_CS_KOI8_R = { - CS_KOI8_R, read_sbcs, write_sbcs, &data_CS_KOI8_R -}; - -static const sbcs_data data_CS_KOI8_U = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, - 0x252c, 0x2534, 0x253c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, - 0x2591, 0x2592, 0x2593, 0x2320, 0x25a0, 0x2219, 0x221a, 0x2248, - 0x2264, 0x2265, 0x00a0, 0x2321, 0x00b0, 0x00b2, 0x00b7, 0x00f7, - 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, - 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x0491, 0x255d, 0x255e, - 0x255f, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, - 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x0490, 0x256c, 0x00a9, - 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, - 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, - 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, - 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x9a, 0xbf, 0x9c, 0x9d, 0x9e, 0x9f, 0xb3, 0xb4, - 0xb6, 0xb7, 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, - 0xf6, 0xfa, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, - 0xef, 0xf0, 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, - 0xe3, 0xfe, 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, - 0xe0, 0xf1, 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, - 0xd6, 0xda, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, - 0xcf, 0xd0, 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, - 0xc3, 0xde, 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, - 0xc0, 0xd1, 0xa3, 0xa4, 0xa6, 0xa7, 0xbd, 0xad, - 0x95, 0x96, 0x97, 0x98, 0x99, 0x93, 0x9b, 0x80, - 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, - 0x89, 0x8a, 0xa0, 0xa1, 0xa2, 0xa5, 0xa8, 0xa9, - 0xaa, 0xab, 0xac, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, - 0xb5, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbe, 0x8b, - 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x94 - }, - 256 -}; -const charset_spec charset_CS_KOI8_U = { - CS_KOI8_U, read_sbcs, write_sbcs, &data_CS_KOI8_U -}; - -static const sbcs_data data_CS_MAC_ROMAN = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02, - 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xb4, 0xa4, 0xac, 0xa9, - 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, 0xab, - 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, 0xcb, - 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, - 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, 0x84, - 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xaf, 0xf4, 0xf2, - 0xf3, 0x86, 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, - 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, - 0x92, 0x94, 0x95, 0x96, 0x98, 0x97, 0x99, 0x9b, - 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xd8, - 0xf5, 0xce, 0xcf, 0xd9, 0xc4, 0xf6, 0xff, 0xf9, - 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0xbd, 0xb9, 0xd0, - 0xd1, 0xd4, 0xd5, 0xe2, 0xd2, 0xd3, 0xe3, 0xa0, - 0xe0, 0xa5, 0xc9, 0xe4, 0xdc, 0xdd, 0xda, 0xdb, - 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, 0xb0, 0xba, - 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0, 0xde, 0xdf - }, - 256 -}; -const charset_spec charset_CS_MAC_ROMAN = { - CS_MAC_ROMAN, read_sbcs, write_sbcs, &data_CS_MAC_ROMAN -}; - -static const sbcs_data data_CS_MAC_TURKISH = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x011e, 0x011f, 0x0130, 0x0131, 0x015e, 0x015f, - 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, ERROR , 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xb4, 0xa4, 0xac, 0xa9, - 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, 0xab, - 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, 0xcb, - 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, - 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, 0x84, - 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xaf, 0xf4, 0xf2, - 0xf3, 0x86, 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, - 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, - 0x92, 0x94, 0x95, 0x96, 0x98, 0x97, 0x99, 0x9b, - 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xd8, - 0xda, 0xdb, 0xdc, 0xdd, 0xce, 0xcf, 0xde, 0xdf, - 0xd9, 0xc4, 0xf6, 0xff, 0xf9, 0xfa, 0xfb, 0xfe, - 0xf7, 0xfd, 0xbd, 0xb9, 0xd0, 0xd1, 0xd4, 0xd5, - 0xe2, 0xd2, 0xd3, 0xe3, 0xa0, 0xe0, 0xa5, 0xc9, - 0xe4, 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, 0xb0, - 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0 - }, - 255 -}; -const charset_spec charset_CS_MAC_TURKISH = { - CS_MAC_TURKISH, read_sbcs, write_sbcs, &data_CS_MAC_TURKISH -}; - -static const sbcs_data data_CS_MAC_CROATIAN = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x0160, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x017d, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x2206, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x0161, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x017e, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x0106, 0x00ab, - 0x010c, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x0110, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0xf8ff, 0x00a9, 0x2044, 0x20ac, 0x2039, 0x203a, 0x00c6, 0x00bb, - 0x2013, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x0107, 0x00c1, - 0x010d, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0x0111, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x03c0, 0x00cb, 0x02da, 0x00b8, 0x00ca, 0x00e6, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xa4, 0xac, 0xd9, 0xbb, - 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, 0xab, 0xb5, - 0xa6, 0xe1, 0xfc, 0xbc, 0xdf, 0xc0, 0xcb, 0xe7, - 0xe5, 0xcc, 0x80, 0x81, 0xde, 0x82, 0xe9, 0x83, - 0xfd, 0xfa, 0xed, 0xea, 0xeb, 0xec, 0x84, 0xf1, - 0xee, 0xef, 0xcd, 0x85, 0xaf, 0xf4, 0xf2, 0xf3, - 0x86, 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, - 0xfe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, - 0x94, 0x95, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, - 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xc6, 0xe6, - 0xc8, 0xe8, 0xd0, 0xf0, 0xf5, 0xce, 0xcf, 0xa9, - 0xb9, 0xae, 0xbe, 0xc4, 0xf6, 0xff, 0xfb, 0xf7, - 0xbd, 0xf9, 0xe0, 0xd1, 0xd4, 0xd5, 0xe2, 0xd2, - 0xd3, 0xe3, 0xa0, 0xa5, 0xc9, 0xe4, 0xdc, 0xdd, - 0xda, 0xdb, 0xaa, 0xb6, 0xb4, 0xb8, 0xb7, 0xc3, - 0xb0, 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xd8 - }, - 256 -}; -const charset_spec charset_CS_MAC_CROATIAN = { - CS_MAC_CROATIAN, read_sbcs, write_sbcs, &data_CS_MAC_CROATIAN -}; - -static const sbcs_data data_CS_MAC_ICELAND = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x00dd, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x2044, 0x20ac, 0x00d0, 0x00f0, 0x00de, 0x00fe, - 0x00fd, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xb4, 0xa4, 0xac, 0xa9, - 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, 0xab, - 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, 0xcb, - 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, 0xe9, - 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, 0xdc, - 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xaf, 0xf4, - 0xf2, 0xf3, 0x86, 0xa0, 0xde, 0xa7, 0x88, 0x87, - 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, - 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, 0xdd, 0x96, - 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, - 0x9c, 0x9e, 0x9f, 0xe0, 0xdf, 0xd8, 0xf5, 0xce, - 0xcf, 0xd9, 0xc4, 0xf6, 0xff, 0xf9, 0xfa, 0xfb, - 0xfe, 0xf7, 0xfd, 0xbd, 0xb9, 0xd0, 0xd1, 0xd4, - 0xd5, 0xe2, 0xd2, 0xd3, 0xe3, 0xa5, 0xc9, 0xe4, - 0xda, 0xdb, 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, - 0xb0, 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0 - }, - 256 -}; -const charset_spec charset_CS_MAC_ICELAND = { - CS_MAC_ICELAND, read_sbcs, write_sbcs, &data_CS_MAC_ICELAND -}; - -static const sbcs_data data_CS_MAC_ROMANIAN = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x0102, 0x0218, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x0103, 0x0219, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x2044, 0x20ac, 0x2039, 0x203a, 0x021a, 0x021b, - 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xb4, 0xa4, 0xac, 0xa9, - 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, 0xab, - 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, 0xcb, - 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0x82, 0xe9, 0x83, - 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, 0x84, 0xf1, - 0xee, 0xef, 0xcd, 0x85, 0xf4, 0xf2, 0xf3, 0x86, - 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0x8d, - 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, - 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0x9d, - 0x9c, 0x9e, 0x9f, 0xd8, 0xae, 0xbe, 0xf5, 0xce, - 0xcf, 0xd9, 0xc4, 0xaf, 0xbf, 0xde, 0xdf, 0xf6, - 0xff, 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0xbd, - 0xb9, 0xd0, 0xd1, 0xd4, 0xd5, 0xe2, 0xd2, 0xd3, - 0xe3, 0xa0, 0xe0, 0xa5, 0xc9, 0xe4, 0xdc, 0xdd, - 0xda, 0xdb, 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, - 0xb0, 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0 - }, - 256 -}; -const charset_spec charset_CS_MAC_ROMANIAN = { - CS_MAC_ROMANIAN, read_sbcs, write_sbcs, &data_CS_MAC_ROMANIAN -}; - -static const sbcs_data data_CS_MAC_GREEK = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00b9, 0x00b2, 0x00c9, 0x00b3, 0x00d6, 0x00dc, 0x0385, - 0x00e0, 0x00e2, 0x00e4, 0x0384, 0x00a8, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00a3, 0x2122, 0x00ee, 0x00ef, 0x2022, 0x00bd, - 0x2030, 0x00f4, 0x00f6, 0x00a6, 0x20ac, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x0393, 0x0394, 0x0398, 0x039b, 0x039e, 0x03a0, 0x00df, - 0x00ae, 0x00a9, 0x03a3, 0x03aa, 0x00a7, 0x2260, 0x00b0, 0x00b7, - 0x0391, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x0392, 0x0395, 0x0396, - 0x0397, 0x0399, 0x039a, 0x039c, 0x03a6, 0x03ab, 0x03a8, 0x03a9, - 0x03ac, 0x039d, 0x00ac, 0x039f, 0x03a1, 0x2248, 0x03a4, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x03a5, 0x03a7, 0x0386, 0x0388, 0x0153, - 0x2013, 0x2015, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0389, - 0x038a, 0x038c, 0x038e, 0x03ad, 0x03ae, 0x03af, 0x03cc, 0x038f, - 0x03cd, 0x03b1, 0x03b2, 0x03c8, 0x03b4, 0x03b5, 0x03c6, 0x03b3, - 0x03b7, 0x03b9, 0x03be, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, - 0x03c0, 0x03ce, 0x03c1, 0x03c3, 0x03c4, 0x03b8, 0x03c9, 0x03c2, - 0x03c7, 0x03c5, 0x03b6, 0x03ca, 0x03cb, 0x0390, 0x03b0, 0x00ad - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0x92, 0xb4, 0x9b, 0xac, 0x8c, 0xa9, 0xc7, - 0xc2, 0xff, 0xa8, 0xae, 0xb1, 0x82, 0x84, 0xaf, - 0x81, 0xc8, 0x97, 0x80, 0x83, 0x85, 0x86, 0xa7, - 0x88, 0x89, 0x8a, 0x8d, 0x8f, 0x8e, 0x90, 0x91, - 0x94, 0x95, 0x99, 0x9a, 0xd6, 0x9d, 0x9e, 0x9f, - 0xcf, 0x8b, 0x87, 0xcd, 0xce, 0xd7, 0xd8, 0xd9, - 0xda, 0xdf, 0xfd, 0xb0, 0xb5, 0xa1, 0xa2, 0xb6, - 0xb7, 0xb8, 0xa3, 0xb9, 0xba, 0xa4, 0xbb, 0xc1, - 0xa5, 0xc3, 0xa6, 0xc4, 0xaa, 0xc6, 0xcb, 0xbc, - 0xcc, 0xbe, 0xbf, 0xab, 0xbd, 0xc0, 0xdb, 0xdc, - 0xdd, 0xfe, 0xe1, 0xe2, 0xe7, 0xe4, 0xe5, 0xfa, - 0xe8, 0xf5, 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xea, - 0xef, 0xf0, 0xf2, 0xf7, 0xf3, 0xf4, 0xf9, 0xe6, - 0xf8, 0xe3, 0xf6, 0xfb, 0xfc, 0xde, 0xe0, 0xf1, - 0xd0, 0xd1, 0xd4, 0xd5, 0xd2, 0xd3, 0xa0, 0x96, - 0xc9, 0x98, 0x9c, 0x93, 0xc5, 0xad, 0xb2, 0xb3 - }, - 256 -}; -const charset_spec charset_CS_MAC_GREEK = { - CS_MAC_GREEK, read_sbcs, write_sbcs, &data_CS_MAC_GREEK -}; - -static const sbcs_data data_CS_MAC_CYRILLIC = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x2020, 0x00b0, 0x0490, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, - 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x0491, 0x0408, - 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, - 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, - 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x20ac - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xa3, 0xa4, 0xa9, 0xc7, 0xc2, 0xa8, 0xa1, - 0xb1, 0xb5, 0xa6, 0xc8, 0xd6, 0xc4, 0xdd, 0xab, - 0xae, 0xb8, 0xc1, 0xa7, 0xba, 0xb7, 0xbc, 0xbe, - 0xcb, 0xcd, 0xd8, 0xda, 0x80, 0x81, 0x82, 0x83, - 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, - 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, - 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, - 0x9c, 0x9d, 0x9e, 0x9f, 0xe0, 0xe1, 0xe2, 0xe3, - 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, - 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, - 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, - 0xfc, 0xfd, 0xfe, 0xdf, 0xde, 0xac, 0xaf, 0xb9, - 0xcf, 0xb4, 0xbb, 0xc0, 0xbd, 0xbf, 0xcc, 0xce, - 0xd9, 0xdb, 0xa2, 0xb6, 0xd0, 0xd1, 0xd4, 0xd5, - 0xd2, 0xd3, 0xd7, 0xa0, 0xa5, 0xc9, 0xff, 0xdc, - 0xaa, 0xc6, 0xc3, 0xb0, 0xc5, 0xad, 0xb2, 0xb3 - }, - 256 -}; -const charset_spec charset_CS_MAC_CYRILLIC = { - CS_MAC_CYRILLIC, read_sbcs, write_sbcs, &data_CS_MAC_CYRILLIC -}; - -static const sbcs_data data_CS_MAC_THAI = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00ab, 0x00bb, 0x2026, 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, - 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x201c, 0x201d, 0x0e4d, - ERROR , 0x2022, 0x0e31, 0x0e47, 0x0e34, 0x0e35, 0x0e36, 0x0e37, - 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x2018, 0x2019, ERROR , - 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, - 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, - 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, - 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, - 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, - 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, - 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, - 0x0e38, 0x0e39, 0x0e3a, 0x2060, 0x200b, 0x2013, 0x2014, 0x0e3f, - 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, - 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x2122, 0x0e4f, - 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, - 0x0e58, 0x0e59, 0x00ae, 0x00a9, ERROR , ERROR , ERROR , ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xa0, 0xfb, 0x80, 0xfa, 0x81, 0xa1, 0xa2, 0xa3, - 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, - 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, - 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, - 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, - 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, - 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xef, 0xf0, - 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xdc, 0xdd, 0xde, 0x9d, 0x9e, 0x8d, 0x8e, - 0x91, 0x82, 0xdb, 0xee - }, - 228 -}; -const charset_spec charset_CS_MAC_THAI = { - CS_MAC_THAI, read_sbcs, write_sbcs, &data_CS_MAC_THAI -}; - -static const sbcs_data data_CS_MAC_CENTEURO = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x0100, 0x0101, 0x00c9, 0x0104, 0x00d6, 0x00dc, 0x00e1, - 0x0105, 0x010c, 0x00e4, 0x010d, 0x0106, 0x0107, 0x00e9, 0x0179, - 0x017a, 0x010e, 0x00ed, 0x010f, 0x0112, 0x0113, 0x0116, 0x00f3, - 0x0117, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x011a, 0x011b, 0x00fc, - 0x2020, 0x00b0, 0x0118, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x0119, 0x00a8, 0x2260, 0x0123, 0x012e, - 0x012f, 0x012a, 0x2264, 0x2265, 0x012b, 0x0136, 0x2202, 0x2211, - 0x0142, 0x013b, 0x013c, 0x013d, 0x013e, 0x0139, 0x013a, 0x0145, - 0x0146, 0x0143, 0x00ac, 0x221a, 0x0144, 0x0147, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x0148, 0x0150, 0x00d5, 0x0151, 0x014c, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x014d, 0x0154, 0x0155, 0x0158, 0x2039, 0x203a, 0x0159, 0x0156, - 0x0157, 0x0160, 0x201a, 0x201e, 0x0161, 0x015a, 0x015b, 0x00c1, - 0x0164, 0x0165, 0x00cd, 0x017d, 0x017e, 0x016a, 0x00d3, 0x00d4, - 0x016b, 0x016e, 0x00da, 0x016f, 0x0170, 0x0171, 0x0172, 0x0173, - 0x00dd, 0x00fd, 0x0137, 0x017b, 0x0141, 0x017c, 0x0122, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xa3, 0xa4, 0xac, 0xa9, 0xc7, 0xc2, 0xa8, - 0xa1, 0xa6, 0xc8, 0xe7, 0x80, 0x83, 0xea, 0xee, - 0xef, 0xcd, 0x85, 0xf2, 0x86, 0xf8, 0xa7, 0x87, - 0x8a, 0x8e, 0x92, 0x97, 0x99, 0x9b, 0x9a, 0xd6, - 0x9c, 0x9f, 0xf9, 0x81, 0x82, 0x84, 0x88, 0x8c, - 0x8d, 0x89, 0x8b, 0x91, 0x93, 0x94, 0x95, 0x96, - 0x98, 0xa2, 0xab, 0x9d, 0x9e, 0xfe, 0xae, 0xb1, - 0xb4, 0xaf, 0xb0, 0xb5, 0xfa, 0xbd, 0xbe, 0xb9, - 0xba, 0xbb, 0xbc, 0xfc, 0xb8, 0xc1, 0xc4, 0xbf, - 0xc0, 0xc5, 0xcb, 0xcf, 0xd8, 0xcc, 0xce, 0xd9, - 0xda, 0xdf, 0xe0, 0xdb, 0xde, 0xe5, 0xe6, 0xe1, - 0xe4, 0xe8, 0xe9, 0xed, 0xf0, 0xf1, 0xf3, 0xf4, - 0xf5, 0xf6, 0xf7, 0x8f, 0x90, 0xfb, 0xfd, 0xeb, - 0xec, 0xff, 0xd0, 0xd1, 0xd4, 0xd5, 0xe2, 0xd2, - 0xd3, 0xe3, 0xa0, 0xa5, 0xc9, 0xdc, 0xdd, 0xaa, - 0xb6, 0xc6, 0xb7, 0xc3, 0xad, 0xb2, 0xb3, 0xd7 - }, - 256 -}; -const charset_spec charset_CS_MAC_CENTEURO = { - CS_MAC_CENTEURO, read_sbcs, write_sbcs, &data_CS_MAC_CENTEURO -}; - -static const sbcs_data data_CS_MAC_SYMBOL = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220d, - 0x0028, 0x0029, 0x2217, 0x002b, 0x002c, 0x2212, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x2245, 0x0391, 0x0392, 0x03a7, 0x0394, 0x0395, 0x03a6, 0x0393, - 0x0397, 0x0399, 0x03d1, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f, - 0x03a0, 0x0398, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03c2, 0x03a9, - 0x039e, 0x03a8, 0x0396, 0x005b, 0x2234, 0x005d, 0x22a5, 0x005f, - 0xf8e5, 0x03b1, 0x03b2, 0x03c7, 0x03b4, 0x03b5, 0x03c6, 0x03b3, - 0x03b7, 0x03b9, 0x03d5, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, - 0x03c0, 0x03b8, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03d6, 0x03c9, - 0x03be, 0x03c8, 0x03b6, 0x007b, 0x007c, 0x007d, 0x223c, 0x007f, - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - 0x20ac, 0x03d2, 0x2032, 0x2264, 0x2044, 0x221e, 0x0192, 0x2663, - 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, - 0x00b0, 0x00b1, 0x2033, 0x2265, 0x00d7, 0x221d, 0x2202, 0x2022, - 0x00f7, 0x2260, 0x2261, 0x2248, 0x2026, 0xf8e6, 0x23af, 0x21b5, - 0x2135, 0x2111, 0x211c, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229, - 0x222a, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209, - 0x2220, 0x2207, 0x00ae, 0x00a9, 0x2122, 0x220f, 0x221a, 0x22c5, - 0x00ac, 0x2227, 0x2228, 0x21d4, 0x21d0, 0x21d1, 0x21d2, 0x21d3, - 0x22c4, 0x3008, 0x00ae, 0x00a9, 0x2122, 0x2211, 0x239b, 0x239c, - 0x239d, 0x23a1, 0x23a2, 0x23a3, 0x23a7, 0x23a8, 0x23a9, 0x23aa, - 0xf8ff, 0x3009, 0x222b, 0x2320, 0x23ae, 0x2321, 0x239e, 0x239f, - 0x23a0, 0x23a4, 0x23a5, 0x23a6, 0x23ab, 0x23ac, 0x23ad, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x23, 0x25, 0x26, 0x28, 0x29, 0x2b, - 0x2c, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, - 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, - 0x3d, 0x3e, 0x3f, 0x5b, 0x5d, 0x5f, 0x7b, 0x7c, - 0x7d, 0x7f, 0xd3, 0xd8, 0xd2, 0xb0, 0xb1, 0xb4, - 0xb8, 0xa6, 0x41, 0x42, 0x47, 0x44, 0x45, 0x5a, - 0x48, 0x51, 0x49, 0x4b, 0x4c, 0x4d, 0x4e, 0x58, - 0x4f, 0x50, 0x52, 0x53, 0x54, 0x55, 0x46, 0x43, - 0x59, 0x57, 0x61, 0x62, 0x67, 0x64, 0x65, 0x7a, - 0x68, 0x71, 0x69, 0x6b, 0x6c, 0x6d, 0x6e, 0x78, - 0x6f, 0x70, 0x72, 0x56, 0x73, 0x74, 0x75, 0x66, - 0x63, 0x79, 0x77, 0x4a, 0xa1, 0x6a, 0x76, 0xb7, - 0xbc, 0xa2, 0xb2, 0xa4, 0xa0, 0xc1, 0xc3, 0xc2, - 0xd4, 0xc0, 0xac, 0xad, 0xae, 0xaf, 0xab, 0xbf, - 0xdc, 0xdd, 0xde, 0xdf, 0xdb, 0x22, 0xb6, 0x24, - 0xc6, 0xd1, 0xce, 0xcf, 0x27, 0xd5, 0xe5, 0x2d, - 0x2a, 0xd6, 0xb5, 0xa5, 0xd0, 0xd9, 0xda, 0xc7, - 0xc8, 0xf2, 0x5c, 0x7e, 0x40, 0xbb, 0xb9, 0xba, - 0xa3, 0xb3, 0xcc, 0xc9, 0xcb, 0xcd, 0xca, 0xc5, - 0xc4, 0x5e, 0xe0, 0xd7, 0xf3, 0xf5, 0xe6, 0xe7, - 0xe8, 0xf6, 0xf7, 0xf8, 0xe9, 0xea, 0xeb, 0xf9, - 0xfa, 0xfb, 0xec, 0xed, 0xee, 0xef, 0xfc, 0xfd, - 0xfe, 0xf4, 0xbe, 0xaa, 0xa7, 0xa9, 0xa8, 0xe1, - 0xf1, 0x60, 0xbd, 0xf0 - }, - 220 -}; -const charset_spec charset_CS_MAC_SYMBOL = { - CS_MAC_SYMBOL, read_sbcs, write_sbcs, &data_CS_MAC_SYMBOL -}; - -static const sbcs_data data_CS_MAC_DINGBATS = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x2701, 0x2702, 0x2703, 0x2704, 0x260e, 0x2706, 0x2707, - 0x2708, 0x2709, 0x261b, 0x261e, 0x270c, 0x270d, 0x270e, 0x270f, - 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, - 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f, - 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, - 0x2605, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f, - 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, - 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f, - 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, - 0x2748, 0x2749, 0x274a, 0x274b, 0x25cf, 0x274d, 0x25a0, 0x274f, - 0x2750, 0x2751, 0x2752, 0x25b2, 0x25bc, 0x25c6, 0x2756, 0x25d7, - 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x007f, - 0x2768, 0x2769, 0x276a, 0x276b, 0x276c, 0x276d, 0x276e, 0x276f, - 0x2770, 0x2771, 0x2772, 0x2773, 0x2774, 0x2775, ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , ERROR , - ERROR , 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, - 0x2663, 0x2666, 0x2665, 0x2660, 0x2460, 0x2461, 0x2462, 0x2463, - 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x2776, 0x2777, - 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f, - 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, - 0x2788, 0x2789, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f, - 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195, - 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f, - 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, - 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af, - ERROR , 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7, - 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x7f, 0xd5, 0xd6, 0xd7, 0xac, 0xad, 0xae, - 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0x6e, - 0x73, 0x74, 0x75, 0x6c, 0x77, 0x48, 0x25, 0x2a, - 0x2b, 0xab, 0xa8, 0xaa, 0xa9, 0x21, 0x22, 0x23, - 0x24, 0x26, 0x27, 0x28, 0x29, 0x2c, 0x2d, 0x2e, - 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, - 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, - 0x47, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6d, 0x6f, 0x70, 0x71, - 0x72, 0x76, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, - 0x7e, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd8, 0xd9, 0xda, - 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf1, 0xf2, 0xf3, - 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, - 0xfc, 0xfd, 0xfe - }, - 235 -}; -const charset_spec charset_CS_MAC_DINGBATS = { - CS_MAC_DINGBATS, read_sbcs, write_sbcs, &data_CS_MAC_DINGBATS -}; - -static const sbcs_data data_CS_MAC_ROMAN_OLD = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, - 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xdb, 0xb4, 0xa4, 0xac, - 0xa9, 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, - 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, - 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, - 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, - 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xaf, 0xf4, - 0xf2, 0xf3, 0x86, 0xa7, 0x88, 0x87, 0x89, 0x8b, - 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, - 0x93, 0x92, 0x94, 0x95, 0x96, 0x98, 0x97, 0x99, - 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, - 0xd8, 0xf5, 0xce, 0xcf, 0xd9, 0xc4, 0xf6, 0xff, - 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0xbd, 0xb9, - 0xd0, 0xd1, 0xd4, 0xd5, 0xe2, 0xd2, 0xd3, 0xe3, - 0xa0, 0xe0, 0xa5, 0xc9, 0xe4, 0xdc, 0xdd, 0xda, - 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, 0xb0, 0xba, - 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0, 0xde, 0xdf - }, - 256 -}; -const charset_spec charset_CS_MAC_ROMAN_OLD = { - CS_MAC_ROMAN_OLD, read_sbcs, write_sbcs, &data_CS_MAC_ROMAN_OLD -}; - -static const sbcs_data data_CS_MAC_CROATIAN_OLD = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x0160, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x017d, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x2206, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x0161, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x017e, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x0106, 0x00ab, - 0x010c, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x0110, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0xf8ff, 0x00a9, 0x2044, 0x00a4, 0x2039, 0x203a, 0x00c6, 0x00bb, - 0x2013, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x0107, 0x00c1, - 0x010d, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0x0111, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x03c0, 0x00cb, 0x02da, 0x00b8, 0x00ca, 0x00e6, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xdb, 0xa4, 0xac, 0xd9, - 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, 0xab, - 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xdf, 0xc0, 0xcb, - 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xde, 0x82, 0xe9, - 0x83, 0xfd, 0xfa, 0xed, 0xea, 0xeb, 0xec, 0x84, - 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xaf, 0xf4, 0xf2, - 0xf3, 0x86, 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, - 0x8c, 0xfe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, - 0x92, 0x94, 0x95, 0x96, 0x98, 0x97, 0x99, 0x9b, - 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xc6, - 0xe6, 0xc8, 0xe8, 0xd0, 0xf0, 0xf5, 0xce, 0xcf, - 0xa9, 0xb9, 0xae, 0xbe, 0xc4, 0xf6, 0xff, 0xfb, - 0xf7, 0xbd, 0xf9, 0xe0, 0xd1, 0xd4, 0xd5, 0xe2, - 0xd2, 0xd3, 0xe3, 0xa0, 0xa5, 0xc9, 0xe4, 0xdc, - 0xdd, 0xda, 0xaa, 0xb6, 0xb4, 0xb8, 0xb7, 0xc3, - 0xb0, 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xd8 - }, - 256 -}; -const charset_spec charset_CS_MAC_CROATIAN_OLD = { - CS_MAC_CROATIAN_OLD, read_sbcs, write_sbcs, &data_CS_MAC_CROATIAN_OLD -}; - -static const sbcs_data data_CS_MAC_ICELAND_OLD = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x00dd, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x2044, 0x00a4, 0x00d0, 0x00f0, 0x00de, 0x00fe, - 0x00fd, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xdb, 0xb4, 0xa4, 0xac, - 0xa9, 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, - 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, - 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, - 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, - 0xdc, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xaf, - 0xf4, 0xf2, 0xf3, 0x86, 0xa0, 0xde, 0xa7, 0x88, - 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, - 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, 0xdd, - 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0xbf, - 0x9d, 0x9c, 0x9e, 0x9f, 0xe0, 0xdf, 0xd8, 0xf5, - 0xce, 0xcf, 0xd9, 0xc4, 0xf6, 0xff, 0xf9, 0xfa, - 0xfb, 0xfe, 0xf7, 0xfd, 0xbd, 0xb9, 0xd0, 0xd1, - 0xd4, 0xd5, 0xe2, 0xd2, 0xd3, 0xe3, 0xa5, 0xc9, - 0xe4, 0xda, 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, - 0xb0, 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0 - }, - 256 -}; -const charset_spec charset_CS_MAC_ICELAND_OLD = { - CS_MAC_ICELAND_OLD, read_sbcs, write_sbcs, &data_CS_MAC_ICELAND_OLD -}; - -static const sbcs_data data_CS_MAC_ROMANIAN_OLD = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x0102, 0x0218, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, - 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x0103, 0x0219, - 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, - 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0x021a, 0x021b, - 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, - 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xc1, 0xa2, 0xa3, 0xdb, 0xb4, 0xa4, 0xac, - 0xa9, 0xbb, 0xc7, 0xc2, 0xa8, 0xf8, 0xa1, 0xb1, - 0xab, 0xb5, 0xa6, 0xe1, 0xfc, 0xbc, 0xc8, 0xc0, - 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0x82, 0xe9, - 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, 0x84, - 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xf4, 0xf2, 0xf3, - 0x86, 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, - 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, - 0x95, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, - 0x9d, 0x9c, 0x9e, 0x9f, 0xd8, 0xae, 0xbe, 0xf5, - 0xce, 0xcf, 0xd9, 0xc4, 0xaf, 0xbf, 0xde, 0xdf, - 0xf6, 0xff, 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, - 0xbd, 0xb9, 0xd0, 0xd1, 0xd4, 0xd5, 0xe2, 0xd2, - 0xd3, 0xe3, 0xa0, 0xe0, 0xa5, 0xc9, 0xe4, 0xdc, - 0xdd, 0xda, 0xaa, 0xb6, 0xc6, 0xb8, 0xb7, 0xc3, - 0xb0, 0xba, 0xc5, 0xad, 0xb2, 0xb3, 0xd7, 0xf0 - }, - 256 -}; -const charset_spec charset_CS_MAC_ROMANIAN_OLD = { - CS_MAC_ROMANIAN_OLD, read_sbcs, write_sbcs, &data_CS_MAC_ROMANIAN_OLD -}; - -static const sbcs_data data_CS_MAC_GREEK_OLD = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x00c4, 0x00b9, 0x00b2, 0x00c9, 0x00b3, 0x00d6, 0x00dc, 0x0385, - 0x00e0, 0x00e2, 0x00e4, 0x0384, 0x00a8, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00a3, 0x2122, 0x00ee, 0x00ef, 0x2022, 0x00bd, - 0x2030, 0x00f4, 0x00f6, 0x00a6, 0x00ad, 0x00f9, 0x00fb, 0x00fc, - 0x2020, 0x0393, 0x0394, 0x0398, 0x039b, 0x039e, 0x03a0, 0x00df, - 0x00ae, 0x00a9, 0x03a3, 0x03aa, 0x00a7, 0x2260, 0x00b0, 0x00b7, - 0x0391, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x0392, 0x0395, 0x0396, - 0x0397, 0x0399, 0x039a, 0x039c, 0x03a6, 0x03ab, 0x03a8, 0x03a9, - 0x03ac, 0x039d, 0x00ac, 0x039f, 0x03a1, 0x2248, 0x03a4, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x03a5, 0x03a7, 0x0386, 0x0388, 0x0153, - 0x2013, 0x2015, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0389, - 0x038a, 0x038c, 0x038e, 0x03ad, 0x03ae, 0x03af, 0x03cc, 0x038f, - 0x03cd, 0x03b1, 0x03b2, 0x03c8, 0x03b4, 0x03b5, 0x03c6, 0x03b3, - 0x03b7, 0x03b9, 0x03be, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, - 0x03c0, 0x03ce, 0x03c1, 0x03c3, 0x03c4, 0x03b8, 0x03c9, 0x03c2, - 0x03c7, 0x03c5, 0x03b6, 0x03ca, 0x03cb, 0x0390, 0x03b0, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0x92, 0xb4, 0x9b, 0xac, 0x8c, 0xa9, 0xc7, - 0xc2, 0x9c, 0xa8, 0xae, 0xb1, 0x82, 0x84, 0xaf, - 0x81, 0xc8, 0x97, 0x80, 0x83, 0x85, 0x86, 0xa7, - 0x88, 0x89, 0x8a, 0x8d, 0x8f, 0x8e, 0x90, 0x91, - 0x94, 0x95, 0x99, 0x9a, 0xd6, 0x9d, 0x9e, 0x9f, - 0xcf, 0x8b, 0x87, 0xcd, 0xce, 0xd7, 0xd8, 0xd9, - 0xda, 0xdf, 0xfd, 0xb0, 0xb5, 0xa1, 0xa2, 0xb6, - 0xb7, 0xb8, 0xa3, 0xb9, 0xba, 0xa4, 0xbb, 0xc1, - 0xa5, 0xc3, 0xa6, 0xc4, 0xaa, 0xc6, 0xcb, 0xbc, - 0xcc, 0xbe, 0xbf, 0xab, 0xbd, 0xc0, 0xdb, 0xdc, - 0xdd, 0xfe, 0xe1, 0xe2, 0xe7, 0xe4, 0xe5, 0xfa, - 0xe8, 0xf5, 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xea, - 0xef, 0xf0, 0xf2, 0xf7, 0xf3, 0xf4, 0xf9, 0xe6, - 0xf8, 0xe3, 0xf6, 0xfb, 0xfc, 0xde, 0xe0, 0xf1, - 0xd0, 0xd1, 0xd4, 0xd5, 0xd2, 0xd3, 0xa0, 0x96, - 0xc9, 0x98, 0x93, 0xc5, 0xad, 0xb2, 0xb3 - }, - 255 -}; -const charset_spec charset_CS_MAC_GREEK_OLD = { - CS_MAC_GREEK_OLD, read_sbcs, write_sbcs, &data_CS_MAC_GREEK_OLD -}; - -static const sbcs_data data_CS_MAC_CYRILLIC_OLD = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, - 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x2022, 0x0408, - 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, - 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, - 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x00a4 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xa2, 0xa3, 0xff, 0xa4, 0xa9, 0xc7, 0xc2, - 0xa8, 0xa1, 0xb1, 0xb5, 0xa6, 0xc8, 0xd6, 0xc4, - 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, 0xb7, - 0xbc, 0xbe, 0xcb, 0xcd, 0xd8, 0xda, 0x80, 0x81, - 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, - 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, - 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xe0, 0xe1, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, - 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, - 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, 0xde, 0xac, - 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, 0xc0, 0xbd, 0xbf, - 0xcc, 0xce, 0xd9, 0xdb, 0xd0, 0xd1, 0xd4, 0xd5, - 0xd2, 0xd3, 0xd7, 0xa0, 0xa5, 0xc9, 0xdc, 0xaa, - 0xc6, 0xc3, 0xb0, 0xc5, 0xad, 0xb2, 0xb3 - }, - 255 -}; -const charset_spec charset_CS_MAC_CYRILLIC_OLD = { - CS_MAC_CYRILLIC_OLD, read_sbcs, write_sbcs, &data_CS_MAC_CYRILLIC_OLD -}; - -static const sbcs_data data_CS_MAC_UKRAINE = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x2020, 0x00b0, 0x0490, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, - 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, - 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x0491, 0x0408, - 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, - 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, - 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, - 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x00a4 - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0xca, 0xa3, 0xff, 0xa4, 0xa9, 0xc7, 0xc2, 0xa8, - 0xa1, 0xb1, 0xb5, 0xa6, 0xc8, 0xd6, 0xc4, 0xdd, - 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, 0xb7, 0xbc, - 0xbe, 0xcb, 0xcd, 0xd8, 0xda, 0x80, 0x81, 0x82, - 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, - 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, - 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, - 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xe0, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, - 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, - 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, 0xde, 0xac, 0xaf, - 0xb9, 0xcf, 0xb4, 0xbb, 0xc0, 0xbd, 0xbf, 0xcc, - 0xce, 0xd9, 0xdb, 0xa2, 0xb6, 0xd0, 0xd1, 0xd4, - 0xd5, 0xd2, 0xd3, 0xd7, 0xa0, 0xa5, 0xc9, 0xdc, - 0xaa, 0xc6, 0xc3, 0xb0, 0xc5, 0xad, 0xb2, 0xb3 - }, - 256 -}; -const charset_spec charset_CS_MAC_UKRAINE = { - CS_MAC_UKRAINE, read_sbcs, write_sbcs, &data_CS_MAC_UKRAINE -}; - -static const sbcs_data data_CS_MAC_VT100 = { - { - 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407, - 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f, - 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417, - 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2421, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x00dd, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x00b8, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x00d7, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x00b9, 0x00b2, - 0x00b3, 0x03c0, 0x00a6, 0x00aa, 0x00ba, 0x2592, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x00bd, 0x0192, 0x00bc, 0x00be, 0x00ab, - 0x00bb, 0x2026, ERROR , 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x2518, 0x2510, 0x250c, 0x2514, 0x00f7, 0x2022, - 0x00ff, 0x0178, 0x253c, 0x20ac, 0x00d0, 0x00f0, 0x00fe, 0x00de, - 0x00fd, 0x00b7, 0x23ba, 0x23bb, 0x2500, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - ERROR , 0x00d2, 0x00da, 0x00db, 0x00d9, 0x23bc, 0x23bd, 0x251c, - 0x2524, 0x2534, 0x252c, 0x2502, ERROR , ERROR , ERROR , ERROR - }, - { - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0xc1, - 0xa2, 0xa3, 0xb4, 0xba, 0xa4, 0xac, 0xa9, 0xbb, - 0xc7, 0xc2, 0xa8, 0xa1, 0xb1, 0xb7, 0xb8, 0xab, - 0xb5, 0xa6, 0xe1, 0xa5, 0xb6, 0xbc, 0xc8, 0xc5, - 0xc3, 0xc6, 0xc0, 0xcb, 0xe7, 0xe5, 0xcc, 0x80, - 0x81, 0xae, 0x82, 0xe9, 0x83, 0xe6, 0xe8, 0xed, - 0xea, 0xeb, 0xec, 0xdc, 0x84, 0xf1, 0xee, 0xef, - 0xcd, 0x85, 0xb0, 0xaf, 0xf4, 0xf2, 0xf3, 0x86, - 0xa0, 0xdf, 0xa7, 0x88, 0x87, 0x89, 0x8b, 0x8a, - 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x93, - 0x92, 0x94, 0x95, 0xdd, 0x96, 0x98, 0x97, 0x99, - 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, - 0xe0, 0xde, 0xd8, 0xce, 0xcf, 0xd9, 0xc4, 0xb9, - 0xd0, 0xd1, 0xd7, 0xc9, 0xdb, 0xaa, 0xad, 0xb2, - 0xb3, 0xe2, 0xe3, 0xf5, 0xf6, 0x00, 0x01, 0x02, - 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, - 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, - 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x7f, 0xe4, 0xfb, - 0xd4, 0xd3, 0xd5, 0xd2, 0xf7, 0xf8, 0xfa, 0xf9, - 0xda, 0xbd - }, - 250 -}; -const charset_spec charset_CS_MAC_VT100 = { - CS_MAC_VT100, read_sbcs, write_sbcs, &data_CS_MAC_VT100 -}; - -static const sbcs_data data_CS_MAC_VT100_OLD = { - { - 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407, - 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f, - 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417, - 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2421, - 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, - 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, - 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, - 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, - 0x00dd, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x00b8, 0x00b6, 0x00df, - 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, - 0x00d7, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x00b9, 0x00b2, - 0x00b3, 0x03c0, 0x00a6, 0x00aa, 0x00ba, 0x2592, 0x00e6, 0x00f8, - 0x00bf, 0x00a1, 0x00ac, 0x00bd, 0x0192, 0x00bc, 0x00be, 0x00ab, - 0x00bb, 0x2026, ERROR , 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x2518, 0x2510, 0x250c, 0x2514, 0x00f7, 0x2022, - 0x00ff, 0x0178, 0x253c, 0x00a4, 0x00d0, 0x00f0, 0x00fe, 0x00de, - 0x00fd, 0x00b7, 0x23ba, 0x23bb, 0x2500, 0x00c2, 0x00ca, 0x00c1, - 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, - ERROR , 0x00d2, 0x00da, 0x00db, 0x00d9, 0x23bc, 0x23bd, 0x251c, - 0x2524, 0x2534, 0x252c, 0x2502, ERROR , ERROR , ERROR , ERROR - }, - { - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0xc1, - 0xa2, 0xa3, 0xdb, 0xb4, 0xba, 0xa4, 0xac, 0xa9, - 0xbb, 0xc7, 0xc2, 0xa8, 0xa1, 0xb1, 0xb7, 0xb8, - 0xab, 0xb5, 0xa6, 0xe1, 0xa5, 0xb6, 0xbc, 0xc8, - 0xc5, 0xc3, 0xc6, 0xc0, 0xcb, 0xe7, 0xe5, 0xcc, - 0x80, 0x81, 0xae, 0x82, 0xe9, 0x83, 0xe6, 0xe8, - 0xed, 0xea, 0xeb, 0xec, 0xdc, 0x84, 0xf1, 0xee, - 0xef, 0xcd, 0x85, 0xb0, 0xaf, 0xf4, 0xf2, 0xf3, - 0x86, 0xa0, 0xdf, 0xa7, 0x88, 0x87, 0x89, 0x8b, - 0x8a, 0x8c, 0xbe, 0x8d, 0x8f, 0x8e, 0x90, 0x91, - 0x93, 0x92, 0x94, 0x95, 0xdd, 0x96, 0x98, 0x97, - 0x99, 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, - 0x9f, 0xe0, 0xde, 0xd8, 0xce, 0xcf, 0xd9, 0xc4, - 0xb9, 0xd0, 0xd1, 0xd7, 0xc9, 0xaa, 0xad, 0xb2, - 0xb3, 0xe2, 0xe3, 0xf5, 0xf6, 0x00, 0x01, 0x02, - 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, - 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, - 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x7f, 0xe4, 0xfb, - 0xd4, 0xd3, 0xd5, 0xd2, 0xf7, 0xf8, 0xfa, 0xf9, - 0xda, 0xbd - }, - 250 -}; -const charset_spec charset_CS_MAC_VT100_OLD = { - CS_MAC_VT100_OLD, read_sbcs, write_sbcs, &data_CS_MAC_VT100_OLD -}; - -static const sbcs_data data_CS_VISCII = { - { - 0x0000, 0x0001, 0x1eb2, 0x0003, 0x0004, 0x1eb4, 0x1eaa, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x1ef6, 0x0015, 0x0016, 0x0017, - 0x0018, 0x1ef8, 0x001a, 0x001b, 0x001c, 0x001d, 0x1ef4, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x1ea0, 0x1eae, 0x1eb0, 0x1eb6, 0x1ea4, 0x1ea6, 0x1ea8, 0x1eac, - 0x1ebc, 0x1eb8, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, 0x1ed0, - 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, 0x1ee2, 0x1eda, 0x1edc, 0x1ede, - 0x1eca, 0x1ece, 0x1ecc, 0x1ec8, 0x1ee6, 0x0168, 0x1ee4, 0x1ef2, - 0x00d5, 0x1eaf, 0x1eb1, 0x1eb7, 0x1ea5, 0x1ea7, 0x1ea8, 0x1ead, - 0x1ebd, 0x1eb9, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, 0x1ed1, - 0x1ed3, 0x1ed5, 0x1ed7, 0x1ee0, 0x01a0, 0x1ed9, 0x1edd, 0x1edf, - 0x1ecb, 0x1ef0, 0x1ee8, 0x1eea, 0x1eec, 0x01a1, 0x1edb, 0x01af, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x1ea2, 0x0102, 0x1eb3, 0x1eb5, - 0x00c8, 0x00c9, 0x00ca, 0x1eba, 0x00cc, 0x00cd, 0x0128, 0x1ef3, - 0x0110, 0x1ee9, 0x00d2, 0x00d3, 0x00d4, 0x1ea1, 0x1ef7, 0x1eeb, - 0x1eed, 0x00d9, 0x00da, 0x1ef9, 0x1ef5, 0x00dd, 0x1ee1, 0x01b0, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x1ea3, 0x0103, 0x1eef, 0x1eab, - 0x00e8, 0x00e9, 0x00ea, 0x1ebb, 0x00ec, 0x00ed, 0x0129, 0x1ec9, - 0x0111, 0x1ef1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x1ecf, 0x1ecd, - 0x1ee5, 0x00f9, 0x00fa, 0x0169, 0x1ee7, 0x00fd, 0x1ee3, 0x1eee - }, - { - 0x00, 0x01, 0x03, 0x04, 0x07, 0x08, 0x09, 0x0a, - 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, - 0x13, 0x15, 0x16, 0x17, 0x18, 0x1a, 0x1b, 0x1c, - 0x1d, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, - 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, - 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, - 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, - 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, - 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, - 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, - 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, - 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, - 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, - 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, - 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, - 0x7e, 0x7f, 0xc0, 0xc1, 0xc2, 0xc3, 0xc8, 0xc9, - 0xca, 0xcc, 0xcd, 0xd2, 0xd3, 0xd4, 0xa0, 0xd9, - 0xda, 0xdd, 0xe0, 0xe1, 0xe2, 0xe3, 0xe8, 0xe9, - 0xea, 0xec, 0xed, 0xf2, 0xf3, 0xf4, 0xf5, 0xf9, - 0xfa, 0xfd, 0xc5, 0xe5, 0xd0, 0xf0, 0xce, 0xee, - 0x9d, 0xfb, 0xb4, 0xbd, 0xbf, 0xdf, 0x80, 0xd5, - 0xc4, 0xe4, 0x84, 0xa4, 0x85, 0xa5, 0x86, 0x06, - 0xe7, 0x87, 0xa7, 0x81, 0xa1, 0x82, 0xa2, 0x02, - 0xc6, 0x05, 0xc7, 0x83, 0xa3, 0x89, 0xa9, 0xcb, - 0xeb, 0x88, 0xa8, 0x8a, 0xaa, 0x8b, 0xab, 0x8c, - 0xac, 0x8d, 0xad, 0x8e, 0xae, 0x9b, 0xef, 0x98, - 0xb8, 0x9a, 0xf7, 0x99, 0xf6, 0x8f, 0xaf, 0x90, - 0xb0, 0x91, 0xb1, 0x92, 0xb2, 0x93, 0xb5, 0x95, - 0xbe, 0x96, 0xb6, 0x97, 0xb7, 0xb3, 0xde, 0x94, - 0xfe, 0x9e, 0xf8, 0x9c, 0xfc, 0xba, 0xd1, 0xbb, - 0xd7, 0xbc, 0xd8, 0xff, 0xe6, 0xb9, 0xf1, 0x9f, - 0xcf, 0x1e, 0xdc, 0x14, 0xd6, 0x19, 0xdb - }, - 255 -}; -const charset_spec charset_CS_VISCII = { - CS_VISCII, read_sbcs, write_sbcs, &data_CS_VISCII -}; - -static const sbcs_data data_CS_HP_ROMAN8 = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00c0, 0x00c2, 0x00c8, 0x00ca, 0x00cb, 0x00ce, 0x00cf, - 0x00b4, 0x02cb, 0x02c6, 0x00a8, 0x02dc, 0x00d9, 0x00db, 0x20a4, - 0x00af, 0x00dd, 0x00fd, 0x00b0, 0x00c7, 0x00e7, 0x00d1, 0x00f1, - 0x00a1, 0x00bf, 0x00a4, 0x00a3, 0x00a5, 0x00a7, 0x0192, 0x00a2, - 0x00e2, 0x00ea, 0x00f4, 0x00fb, 0x00e1, 0x00e9, 0x00f3, 0x00fa, - 0x00e0, 0x00e8, 0x00f2, 0x00f9, 0x00e4, 0x00eb, 0x00f6, 0x00fc, - 0x00c5, 0x00ee, 0x00d8, 0x00c6, 0x00e5, 0x00ed, 0x00f8, 0x00e6, - 0x00c4, 0x00ec, 0x00d6, 0x00dc, 0x00c9, 0x00ef, 0x00df, 0x00d4, - 0x00c1, 0x00c3, 0x00e3, 0x00d0, 0x00f0, 0x00cd, 0x00cc, 0x00d3, - 0x00d2, 0x00d5, 0x00f5, 0x0160, 0x0161, 0x00da, 0x0178, 0x00ff, - 0x00de, 0x00fe, 0x00b7, 0x00b5, 0x00b6, 0x00be, 0x2014, 0x00bc, - 0x00bd, 0x00aa, 0x00ba, 0x00ab, 0x25a0, 0x00bb, 0x00b1, ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xb8, 0xbf, 0xbb, 0xba, 0xbc, 0xbd, 0xab, - 0xf9, 0xfb, 0xb0, 0xb3, 0xfe, 0xa8, 0xf3, 0xf4, - 0xf2, 0xfa, 0xfd, 0xf7, 0xf8, 0xf5, 0xb9, 0xa1, - 0xe0, 0xa2, 0xe1, 0xd8, 0xd0, 0xd3, 0xb4, 0xa3, - 0xdc, 0xa4, 0xa5, 0xe6, 0xe5, 0xa6, 0xa7, 0xe3, - 0xb6, 0xe8, 0xe7, 0xdf, 0xe9, 0xda, 0xd2, 0xad, - 0xed, 0xae, 0xdb, 0xb1, 0xf0, 0xde, 0xc8, 0xc4, - 0xc0, 0xe2, 0xcc, 0xd4, 0xd7, 0xb5, 0xc9, 0xc5, - 0xc1, 0xcd, 0xd9, 0xd5, 0xd1, 0xdd, 0xe4, 0xb7, - 0xca, 0xc6, 0xc2, 0xea, 0xce, 0xd6, 0xcb, 0xc7, - 0xc3, 0xcf, 0xb2, 0xf1, 0xef, 0xeb, 0xec, 0xee, - 0xbe, 0xaa, 0xa9, 0xac, 0xf6, 0xaf, 0xfc - }, - 255 -}; -const charset_spec charset_CS_HP_ROMAN8 = { - CS_HP_ROMAN8, read_sbcs, write_sbcs, &data_CS_HP_ROMAN8 -}; - -static const sbcs_data data_CS_DEC_MCS = { - { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - ERROR , 0x00a1, 0x00a2, 0x00a3, ERROR , 0x00a5, ERROR , 0x00a7, - 0x00a4, 0x00a9, 0x00aa, 0x00ab, ERROR , ERROR , ERROR , ERROR , - 0x00b0, 0x00b1, 0x00b2, 0x00b3, ERROR , 0x00b5, 0x00b6, 0x00b7, - ERROR , 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, ERROR , 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - ERROR , 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0152, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0178, ERROR , 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - ERROR , 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0153, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00ff, ERROR , ERROR - }, - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa1, 0xa2, 0xa3, 0xa8, 0xa5, 0xa7, 0xa9, 0xaa, - 0xab, 0xb0, 0xb1, 0xb2, 0xb3, 0xb5, 0xb6, 0xb7, - 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbf, 0xc0, 0xc1, - 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, - 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd1, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd8, 0xd9, 0xda, 0xdb, - 0xdc, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, - 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, - 0xee, 0xef, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xd7, 0xf7, - 0xdd - }, - 241 -}; -const charset_spec charset_CS_DEC_MCS = { - CS_DEC_MCS, read_sbcs, write_sbcs, &data_CS_DEC_MCS -}; - -#else /* ENUM_CHARSETS */ - -ENUM_CHARSET(CS_ISO8859_1) -ENUM_CHARSET(CS_ISO8859_2) -ENUM_CHARSET(CS_ISO8859_3) -ENUM_CHARSET(CS_ISO8859_4) -ENUM_CHARSET(CS_ISO8859_5) -ENUM_CHARSET(CS_ISO8859_6) -ENUM_CHARSET(CS_ISO8859_7) -ENUM_CHARSET(CS_ISO8859_8) -ENUM_CHARSET(CS_ISO8859_9) -ENUM_CHARSET(CS_ISO8859_10) -ENUM_CHARSET(CS_ISO8859_11) -ENUM_CHARSET(CS_ISO8859_13) -ENUM_CHARSET(CS_ISO8859_14) -ENUM_CHARSET(CS_ISO8859_15) -ENUM_CHARSET(CS_ISO8859_16) -ENUM_CHARSET(CS_ISO8859_1_X11) -ENUM_CHARSET(CS_CP437) -ENUM_CHARSET(CS_CP850) -ENUM_CHARSET(CS_CP866) -ENUM_CHARSET(CS_CP852) -ENUM_CHARSET(CS_CP1250) -ENUM_CHARSET(CS_CP1251) -ENUM_CHARSET(CS_CP1252) -ENUM_CHARSET(CS_CP1253) -ENUM_CHARSET(CS_CP1254) -ENUM_CHARSET(CS_CP1255) -ENUM_CHARSET(CS_CP1256) -ENUM_CHARSET(CS_CP1257) -ENUM_CHARSET(CS_CP1258) -ENUM_CHARSET(CS_KOI8_R) -ENUM_CHARSET(CS_KOI8_U) -ENUM_CHARSET(CS_MAC_ROMAN) -ENUM_CHARSET(CS_MAC_TURKISH) -ENUM_CHARSET(CS_MAC_CROATIAN) -ENUM_CHARSET(CS_MAC_ICELAND) -ENUM_CHARSET(CS_MAC_ROMANIAN) -ENUM_CHARSET(CS_MAC_GREEK) -ENUM_CHARSET(CS_MAC_CYRILLIC) -ENUM_CHARSET(CS_MAC_THAI) -ENUM_CHARSET(CS_MAC_CENTEURO) -ENUM_CHARSET(CS_MAC_SYMBOL) -ENUM_CHARSET(CS_MAC_DINGBATS) -ENUM_CHARSET(CS_MAC_ROMAN_OLD) -ENUM_CHARSET(CS_MAC_CROATIAN_OLD) -ENUM_CHARSET(CS_MAC_ICELAND_OLD) -ENUM_CHARSET(CS_MAC_ROMANIAN_OLD) -ENUM_CHARSET(CS_MAC_GREEK_OLD) -ENUM_CHARSET(CS_MAC_CYRILLIC_OLD) -ENUM_CHARSET(CS_MAC_UKRAINE) -ENUM_CHARSET(CS_MAC_VT100) -ENUM_CHARSET(CS_MAC_VT100_OLD) -ENUM_CHARSET(CS_VISCII) -ENUM_CHARSET(CS_HP_ROMAN8) -ENUM_CHARSET(CS_DEC_MCS) - -#endif /* ENUM_CHARSETS */ diff --git a/code/charset/sbcsgen.pl b/code/charset/sbcsgen.pl index 078aebf..bedf6b3 100644 --- a/code/charset/sbcsgen.pl +++ b/code/charset/sbcsgen.pl @@ -1,11 +1,19 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # This script generates sbcsdat.c (the data for all the SBCSes) from its # source form sbcs.dat. -$infile = "sbcs.dat"; +use warnings; +use Getopt::Long; +use File::Basename; + +$infile = (dirname __FILE__) . "/sbcs.dat"; $outfile = "sbcsdat.c"; +my $usage = "usage: sbcsgen.pl [-o OUTFILE]\n"; +GetOptions("o|output=s" => \$outfile) + or die $usage; + open FOO, $infile; open BAR, ">$outfile"; select BAR; diff --git a/code/cmake/cmake.h.in b/code/cmake/cmake.h.in new file mode 100644 index 0000000..2041f09 --- /dev/null +++ b/code/cmake/cmake.h.in @@ -0,0 +1,54 @@ +#cmakedefine NO_IPV6 +#cmakedefine NO_GSSAPI +#cmakedefine STATIC_GSSAPI + +#cmakedefine NO_MULTIMON + +#cmakedefine01 HAVE_WINRESRC_H +#cmakedefine01 HAVE_WINRES_H +#cmakedefine01 HAVE_WIN_H +#cmakedefine01 HAVE_NO_STDINT_H +#cmakedefine01 HAVE_GCP_RESULTSW +#cmakedefine01 HAVE_ADDDLLDIRECTORY +#cmakedefine01 HAVE_GETNAMEDPIPECLIENTPROCESSID +#cmakedefine01 HAVE_SETDEFAULTDLLDIRECTORIES +#cmakedefine01 HAVE_STRTOUMAX +#cmakedefine01 HAVE_DWMAPI_H + +#cmakedefine NOT_X_WINDOWS +#cmakedefine OMIT_UTMP + +#cmakedefine01 HAVE_ASM_HWCAP_H +#cmakedefine01 HAVE_SYS_AUXV_H +#cmakedefine01 HAVE_SYS_SYSCTL_H +#cmakedefine01 HAVE_SYS_TYPES_H +#cmakedefine01 HAVE_GLOB_H +#cmakedefine01 HAVE_UTMP_H +#cmakedefine01 HAVE_FUTIMES +#cmakedefine01 HAVE_GETADDRINFO +#cmakedefine01 HAVE_POSIX_OPENPT +#cmakedefine01 HAVE_PTSNAME +#cmakedefine01 HAVE_SETRESUID +#cmakedefine01 HAVE_SETRESGID +#cmakedefine01 HAVE_STRSIGNAL +#cmakedefine01 HAVE_UPDWTMPX +#cmakedefine01 HAVE_FSTATAT +#cmakedefine01 HAVE_DIRFD +#cmakedefine01 HAVE_SETPWENT +#cmakedefine01 HAVE_ENDPWENT +#cmakedefine01 HAVE_GETAUXVAL +#cmakedefine01 HAVE_ELF_AUX_INFO +#cmakedefine01 HAVE_SYSCTLBYNAME +#cmakedefine01 HAVE_CLOCK_MONOTONIC +#cmakedefine01 HAVE_CLOCK_GETTIME +#cmakedefine01 HAVE_SO_PEERCRED +#cmakedefine01 HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE +#cmakedefine01 HAVE_PANGO_FONT_MAP_LIST_FAMILIES + +#cmakedefine01 HAVE_AES_NI +#cmakedefine01 HAVE_SHA_NI +#cmakedefine01 HAVE_SHAINTRIN_H +#cmakedefine01 HAVE_NEON_CRYPTO +#cmakedefine01 HAVE_NEON_SHA512 +#cmakedefine01 HAVE_NEON_SHA512_INTRINSICS +#cmakedefine01 USE_ARM64_NEON_H diff --git a/code/cmake/gitcommit.cmake b/code/cmake/gitcommit.cmake new file mode 100644 index 0000000..76f4c7f --- /dev/null +++ b/code/cmake/gitcommit.cmake @@ -0,0 +1,62 @@ +# Pure cmake script to write out cmake_commit.c and cmake_version.but + +set(DEFAULT_COMMIT "61ab33efe48cfd1cea77e249e5598a89f3387fa3") +set(commit "${DEFAULT_COMMIT}") + +set(TOPLEVEL_SOURCE_DIR ${CMAKE_SOURCE_DIR}) + +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --show-toplevel + OUTPUT_VARIABLE git_worktree + ERROR_VARIABLE stderr + RESULT_VARIABLE status) +string(REGEX REPLACE "\n$" "" git_worktree "${git_worktree}") + +if(status EQUAL 0) + if(git_worktree STREQUAL CMAKE_SOURCE_DIR) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + OUTPUT_VARIABLE git_commit + ERROR_VARIABLE stderr + RESULT_VARIABLE status) + if(status EQUAL 0) + string(REGEX REPLACE "\n$" "" commit "${git_commit}") + else() + if(commit STREQUAL "unavailable") + message("Unable to determine git commit: 'git rev-parse HEAD' returned status ${status} and error output:\n${stderr}\n") + endif() + endif() + else() + if(commit STREQUAL "unavailable") + message("Unable to determine git commit: top-level source dir ${CMAKE_SOURCE_DIR} is not the root of a repository") + endif() + endif() +else() + if(commit STREQUAL "unavailable") + message("Unable to determine git commit: 'git rev-parse --show-toplevel' returned status ${status} and error output:\n${stderr}\n") + endif() +endif() + +if(OUTPUT_TYPE STREQUAL header) + file(WRITE "${OUTPUT_FILE}" "\ +/* + * cmake_commit.c - string literal giving the source git commit, if known. + * + * Generated by cmake/gitcommit.cmake. + */ + +const char commitid[] = \"${commit}\"; +") +elseif(OUTPUT_TYPE STREQUAL halibut) + if(commit STREQUAL "unavailable") + file(WRITE "${OUTPUT_FILE}" "\ +\\versionid no version information available +") + else() + file(WRITE "${OUTPUT_FILE}" "\ +\\versionid built from git commit ${commit} +") + endif() +else() + message(FATAL_ERROR "Set OUTPUT_TYPE when running this script") +endif() diff --git a/code/cmake/gtk.cmake b/code/cmake/gtk.cmake new file mode 100644 index 0000000..85ecb7d --- /dev/null +++ b/code/cmake/gtk.cmake @@ -0,0 +1,88 @@ +# Look for GTK, of any version. + +set(PUTTY_GTK_VERSION "ANY" + CACHE STRING "Which major version of GTK to build with") +set_property(CACHE PUTTY_GTK_VERSION + PROPERTY STRINGS ANY 3 2 1) + +set(GTK_FOUND FALSE) + +macro(try_pkg_config_gtk VER PACKAGENAME) + if(NOT GTK_FOUND AND + (PUTTY_GTK_VERSION STREQUAL ANY OR PUTTY_GTK_VERSION STREQUAL ${VER})) + find_package(PkgConfig) + pkg_check_modules(GTK ${PACKAGENAME}) + if(GTK_FOUND) + set(GTK_VERSION ${VER}) + endif() + endif() +endmacro() +try_pkg_config_gtk(3 gtk+-3.0) +try_pkg_config_gtk(2 gtk+-2.0) + +if(NOT GTK_FOUND AND + (PUTTY_GTK_VERSION STREQUAL ANY OR PUTTY_GTK_VERSION STREQUAL 1)) + message("-- Checking for GTK1 (via gtk-config)") + find_program(GTK_CONFIG gtk-config) + if(GTK_CONFIG) + execute_process(COMMAND ${GTK_CONFIG} --cflags + OUTPUT_VARIABLE gtk_config_cflags + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE gtk_config_cflags_result) + execute_process(COMMAND ${GTK_CONFIG} --libs + OUTPUT_VARIABLE gtk_config_libs + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE gtk_config_libs_result) + + if(gtk_config_cflags_result EQUAL 0 AND gtk_config_libs_result EQUAL 0) + + set(GTK_INCLUDE_DIRS) + set(GTK_LIBRARY_DIRS) + set(GTK_LIBRARIES) + + separate_arguments(gtk_config_cflags NATIVE_COMMAND + ${gtk_config_cflags}) + foreach(opt ${gtk_config_cflags}) + string(REGEX MATCH "^-I" ok ${opt}) + if(ok) + string(REGEX REPLACE "^-I" "" optval ${opt}) + list(APPEND GTK_INCLUDE_DIRS ${optval}) + endif() + endforeach() + + separate_arguments(gtk_config_libs NATIVE_COMMAND + ${gtk_config_libs}) + foreach(opt ${gtk_config_libs}) + string(REGEX MATCH "^-l" ok ${opt}) + if(ok) + list(APPEND GTK_LIBRARIES ${opt}) + endif() + string(REGEX MATCH "^-L" ok ${opt}) + if(ok) + string(REGEX REPLACE "^-L" "" optval ${opt}) + list(APPEND GTK_LIBRARY_DIRS ${optval}) + endif() + endforeach() + + message("-- Found GTK1") + set(GTK_FOUND TRUE) + endif() + endif() +endif() + +if(GTK_FOUND) + # Check for some particular Pango functions. + function(pango_check_subscope) + set(CMAKE_REQUIRED_INCLUDES ${GTK_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${GTK_LIBRARIES}) + check_symbol_exists(pango_font_family_is_monospace "pango/pango.h" + HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE) + check_symbol_exists(pango_font_map_list_families "pango/pango.h" + HAVE_PANGO_FONT_MAP_LIST_FAMILIES) + set(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE + ${HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE} PARENT_SCOPE) + set(HAVE_PANGO_FONT_MAP_LIST_FAMILIES + ${HAVE_PANGO_FONT_MAP_LIST_FAMILIES} PARENT_SCOPE) + endfunction() + pango_check_subscope() +endif() diff --git a/code/cmake/licence.cmake b/code/cmake/licence.cmake new file mode 100644 index 0000000..e356ae9 --- /dev/null +++ b/code/cmake/licence.cmake @@ -0,0 +1,39 @@ +# Pure cmake script to generate licence.h from LICENCE + +file(READ "${LICENCE_FILE}" LICENCE_TEXT) + +function(c_string_escape outvar value) + string(REPLACE "\\" "\\\\" value "${value}") + string(REPLACE "\"" "\\\"" value "${value}") + set("${outvar}" "${value}" PARENT_SCOPE) +endfunction() + +set(copyright_regex "PuTTY is copyright ([0-9]+-[0-9]+ [^\n]*[^\n.])\\.?\n") +string(REGEX MATCH "${copyright_regex}" COPYRIGHT_NOTICE "${LICENCE_TEXT}") +string(REGEX REPLACE "${copyright_regex}" "\\1" + COPYRIGHT_NOTICE "${COPYRIGHT_NOTICE}") +c_string_escape(COPYRIGHT_NOTICE "${COPYRIGHT_NOTICE}") + +string(REGEX REPLACE "\n$" "" LICENCE_TEXT "${LICENCE_TEXT}") +string(REPLACE "\r" "" LICENCE_TEXT "${LICENCE_TEXT}") +string(REPLACE "\n\n" "\r" LICENCE_TEXT "${LICENCE_TEXT}") +string(REPLACE "\n" " " LICENCE_TEXT "${LICENCE_TEXT}") +string(REPLACE "\r" "\n" LICENCE_TEXT "${LICENCE_TEXT}") + +c_string_escape(LICENCE_TEXT "${LICENCE_TEXT}") +string(REPLACE "\n" "\" \\\n parsep \\\n \"" + LICENCE_TEXT "${LICENCE_TEXT}") + +file(WRITE "${OUTPUT_FILE}" "\ +/* + * licence.h - macro definitions for the PuTTY licence. + * + * Generated by cmake/licence.cmake from ./LICENCE. + * You should edit those files rather than editing this one. + */ + +#define LICENCE_TEXT(parsep) \\ + \"${LICENCE_TEXT}\" + +#define SHORT_COPYRIGHT_DETAILS \"${COPYRIGHT_NOTICE}\" +") diff --git a/code/cmake/platforms/unix.cmake b/code/cmake/platforms/unix.cmake new file mode 100644 index 0000000..6a788cb --- /dev/null +++ b/code/cmake/platforms/unix.cmake @@ -0,0 +1,148 @@ +set(PUTTY_GSSAPI DYNAMIC + CACHE STRING "Build PuTTY with dynamically or statically linked \ +Kerberos / GSSAPI support, if possible") +set_property(CACHE PUTTY_GSSAPI + PROPERTY STRINGS DYNAMIC STATIC OFF) + +include(CheckIncludeFile) +include(CheckLibraryExists) +include(CheckSymbolExists) +include(CheckCSourceCompiles) +include(GNUInstallDirs) + +set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + -D_DEFAULT_SOURCE -D_GNU_SOURCE) + +check_include_file(sys/auxv.h HAVE_SYS_AUXV_H) +check_include_file(asm/hwcap.h HAVE_ASM_HWCAP_H) +check_include_file(sys/sysctl.h HAVE_SYS_SYSCTL_H) +check_include_file(sys/types.h HAVE_SYS_TYPES_H) +check_include_file(glob.h HAVE_GLOB_H) +check_include_file(utmp.h HAVE_UTMP_H) +check_include_file(utmpx.h HAVE_UTMPX_H) + +check_symbol_exists(futimes "sys/time.h" HAVE_FUTIMES) +check_symbol_exists(getaddrinfo "sys/types.h;sys/socket.h;netdb.h" + HAVE_GETADDRINFO) +check_symbol_exists(posix_openpt "stdlib.h;fcntl.h" HAVE_POSIX_OPENPT) +check_symbol_exists(ptsname "stdlib.h" HAVE_PTSNAME) +check_symbol_exists(setresuid "unistd.h" HAVE_SETRESUID) +check_symbol_exists(setresgid "unistd.h" HAVE_SETRESGID) +check_symbol_exists(strsignal "string.h" HAVE_STRSIGNAL) +check_symbol_exists(updwtmpx "utmpx.h" HAVE_UPDWTMPX) +check_symbol_exists(fstatat "sys/types.h;sys/stat.h;unistd.h" HAVE_FSTATAT) +check_symbol_exists(dirfd "sys/types.h;dirent.h" HAVE_DIRFD) +check_symbol_exists(setpwent "sys/types.h;pwd.h" HAVE_SETPWENT) +check_symbol_exists(endpwent "sys/types.h;pwd.h" HAVE_ENDPWENT) +check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL) +check_symbol_exists(elf_aux_info "sys/auxv.h" HAVE_ELF_AUX_INFO) +check_symbol_exists(sysctlbyname "sys/types.h;sys/sysctl.h" HAVE_SYSCTLBYNAME) +check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_CLOCK_MONOTONIC) +check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) + +check_c_source_compiles(" +#define _GNU_SOURCE +#include +#include +int main(int argc, char **argv) { + struct ucred cr; + socklen_t crlen = sizeof(cr); + return getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) + + cr.pid + cr.uid + cr.gid; +}" HAVE_SO_PEERCRED) + +if(HAVE_GETADDRINFO AND PUTTY_IPV6) + set(NO_IPV6 OFF) +else() + set(NO_IPV6 ON) +endif() + +if(HAVE_UTMPX_H) + set(OMIT_UTMP OFF) +else() + set(OMIT_UTMP ON) +endif() + +include(cmake/gtk.cmake) + +# See if we have X11 available. This requires libX11 itself, and also +# the GDK integration to X11. +find_package(X11) + +function(check_x11) + list(APPEND CMAKE_REQUIRED_INCLUDES ${GTK_INCLUDE_DIRS}) + check_include_file(gdk/gdkx.h HAVE_GDK_GDKX_H) + + if(X11_FOUND AND HAVE_GDK_GDKX_H) + set(NOT_X_WINDOWS OFF PARENT_SCOPE) + else() + set(NOT_X_WINDOWS ON PARENT_SCOPE) + endif() +endfunction() +check_x11() + +include_directories(${CMAKE_SOURCE_DIR}/charset ${GTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR}) +link_directories(${GTK_LIBRARY_DIRS}) + +function(add_optional_system_lib library testfn) + check_library_exists(${library} ${testfn} "" HAVE_LIB${library}) + if (HAVE_LIB${library}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES};-l${library}) + link_libraries(-l${library}) + endif() +endfunction() + +add_optional_system_lib(m pow) +add_optional_system_lib(rt clock_gettime) +add_optional_system_lib(xnet socket) + +set(extra_dirs charset) + +if(PUTTY_GSSAPI STREQUAL DYNAMIC) + add_optional_system_lib(dl dlopen) + if(HAVE_NO_LIBdl) + message(WARNING + "Could not find libdl -- cannot provide dynamic GSSAPI support") + set(NO_GSSAPI ON) + endif() +endif() + +if(PUTTY_GSSAPI STREQUAL STATIC) + find_package(PkgConfig) + pkg_check_modules(KRB5 krb5-gssapi) + if(KRB5_FOUND) + include_directories(${KRB5_INCLUDE_DIRS}) + link_directories(${KRB5_LIBRARY_DIRS}) + link_libraries(${KRB5_LIBRARIES}) + set(STATIC_GSSAPI ON) + else() + message(WARNING + "Could not find krb5 via pkg-config -- \ +cannot provide static GSSAPI support") + set(NO_GSSAPI ON) + endif() +endif() + +if(STRICT AND (CMAKE_C_COMPILER_ID MATCHES "GNU" OR + CMAKE_C_COMPILER_ID MATCHES "Clang")) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wpointer-arith -Wvla") +endif() + +function(installed_program target) + if(CMAKE_VERSION VERSION_LESS 3.14) + # CMake 3.13 and earlier required an explicit install destination. + install(TARGETS ${target} RUNTIME DESTINATION bin) + else() + # 3.14 and above selects a sensible default, which we should avoid + # overriding here so that end users can override it using + # CMAKE_INSTALL_BINDIR. + install(TARGETS ${target}) + endif() + + if(HAVE_MANPAGE_${target}_1) + install(FILES ${CMAKE_BINARY_DIR}/doc/${target}.1 + DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + else() + message(WARNING "Could not build man page ${target}.1") + endif() +endfunction() diff --git a/code/cmake/platforms/windows.cmake b/code/cmake/platforms/windows.cmake new file mode 100644 index 0000000..7248ba4 --- /dev/null +++ b/code/cmake/platforms/windows.cmake @@ -0,0 +1,190 @@ +set(PUTTY_MINEFIELD OFF + CACHE BOOL "Build PuTTY with its built-in memory debugger 'Minefield'") +set(PUTTY_GSSAPI ON + CACHE BOOL "Build PuTTY with GSSAPI support") +set(PUTTY_LINK_MAPS OFF + CACHE BOOL "Attempt to generate link maps") +set(PUTTY_EMBEDDED_CHM_FILE "" + CACHE FILEPATH "Path to a .chm help file to embed in the binaries") + +function(define_negation newvar oldvar) + if(${oldvar}) + set(${newvar} OFF PARENT_SCOPE) + else() + set(${newvar} ON PARENT_SCOPE) + endif() +endfunction() + +include(CheckIncludeFiles) +include(CheckSymbolExists) +include(CheckCSourceCompiles) + +# Still needed for AArch32 Windows builds +set(CMAKE_REQUIRED_DEFINITIONS -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE) + +check_include_files("windows.h;winresrc.h" HAVE_WINRESRC_H) +if(NOT HAVE_WINRESRC_H) + # A couple of fallback names for the header file you can include in + # .rc files. We conditionalise even these checks, to save effort at + # cmake time. + check_include_files("windows.h;winres.h" HAVE_WINRES_H) + if(NOT HAVE_WINRES_H) + check_include_files("windows.h;win.h" HAVE_WIN_H) + endif() +endif() +check_include_files("stdint.h" HAVE_STDINT_H) +define_negation(HAVE_NO_STDINT_H HAVE_STDINT_H) + +check_include_files("windows.h;multimon.h" HAVE_MULTIMON_H) +define_negation(NO_MULTIMON HAVE_MULTIMON_H) + +check_include_files("windows.h;htmlhelp.h" HAVE_HTMLHELP_H) +define_negation(NO_HTMLHELP HAVE_HTMLHELP_H) + +check_symbol_exists(strtoumax "inttypes.h" HAVE_STRTOUMAX) +check_symbol_exists(AddDllDirectory "windows.h" HAVE_ADDDLLDIRECTORY) +check_symbol_exists(SetDefaultDllDirectories "windows.h" + HAVE_SETDEFAULTDLLDIRECTORIES) +check_symbol_exists(GetNamedPipeClientProcessId "windows.h" + HAVE_GETNAMEDPIPECLIENTPROCESSID) +check_symbol_exists(CreatePseudoConsole "windows.h" HAVE_CONPTY) + +check_c_source_compiles(" +#include +GCP_RESULTSW gcpw; +int main(void) { return 0; } +" HAVE_GCP_RESULTSW) + +function(dwmapi_test_wrapper) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dwmapi.lib) + check_c_source_compiles(" +#include +#include +volatile HWND hwnd; +int main(void) { + RECT r; + DwmGetWindowAttribute(hwnd, DWMWA_EXTENDED_FRAME_BOUNDS, &r, sizeof(r)); +} +" HAVE_DWMAPI_H) + set(HAVE_DWMAPI_H ${HAVE_DWMAPI_H} PARENT_SCOPE) +endfunction() +dwmapi_test_wrapper() + +set(NO_SECURITY ${PUTTY_NO_SECURITY}) + +add_compile_definitions( + _WINDOWS + _CRT_SECURE_NO_WARNINGS + _WINSOCK_DEPRECATED_NO_WARNINGS + _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE) + +if(PUTTY_MINEFIELD) + add_compile_definitions(MINEFIELD) +endif() +if(NOT PUTTY_GSSAPI) + add_compile_definitions(NO_GSSAPI) +endif() +if(PUTTY_EMBEDDED_CHM_FILE) + add_compile_definitions("EMBEDDED_CHM_FILE=\"${PUTTY_EMBEDDED_CHM_FILE}\"") +endif() + +if(WINELIB) + enable_language(RC) + set(LFLAG_MANIFEST_NO "") +elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR + CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC") + set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /nologo /C1252") + set(LFLAG_MANIFEST_NO "/manifest:no") +else() + set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -c1252") + set(LFLAG_MANIFEST_NO "") +endif() + +if(STRICT AND (CMAKE_C_COMPILER_ID MATCHES "GNU" OR + CMAKE_C_COMPILER_ID MATCHES "Clang")) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wpointer-arith -Wvla") +endif() + +if(CMAKE_C_COMPILER_ID MATCHES "MSVC") + # Turn off some warnings that I've just found too noisy. + # + # - 4244, 4267: "possible loss of data" when narrowing an integer + # type (separate warning numbers for initialisers and + # assignments). Every time I spot-check instances of this, they + # turn out to be sensible (e.g. something was already checked, or + # was assigned from a previous variable that must have been in + # range). I don't think putting a warning-suppression idiom at + # every one of these sites would improve code legibility. + # + # - 4018: "signed/unsigned mismatch" in integer comparison. Again, + # comes up a lot, and generally my spot checks make it look as if + # it's OK. + # + # - 4146: applying unary '-' to an unsigned type. We do that all + # the time in deliberate bit-twiddling code like mpint.c or + # crypto implementations. + # + # - 4293: warning about undefined behaviour if a shift count is too + # big. We often do this inside a ?: clause which doesn't evaluate + # the overlong shift unless the shift count _isn't_ too big. When + # the shift count is constant, MSVC spots the potential problem + # in one branch of the ?:, but doesn't also spot that that branch + # isn't ever taken, so it complains about a thing that's already + # guarded. + # + # - 4090: different 'const' qualifiers. It's a shame to suppress + # this one, because const mismatches really are a thing I'd + # normally like to be warned about. But MSVC (as of 2017 at + # least) seems to have a bug in which assigning a 'void *' into a + # 'const char **' thinks there's a const-qualifier mismatch. + # There isn't! Both are pointers to modifiable objects. The fact + # that in one case, the modifiable object is a pointer to + # something _else_ const should make no difference. + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \ +/wd4244 /wd4267 /wd4018 /wd4146 /wd4293 /wd4090") +endif() + +if(CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC") + set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} /dynamicbase /nxcompat") +endif() + +set(platform_libraries + advapi32.lib comdlg32.lib gdi32.lib imm32.lib + ole32.lib shell32.lib user32.lib ws2_32.lib kernel32.lib) + +# Generate link maps +if(PUTTY_LINK_MAPS) + if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND + "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") + set(CMAKE_C_LINK_EXECUTABLE + "${CMAKE_C_LINK_EXECUTABLE} /lldmap:.map") + elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC") + set(CMAKE_C_LINK_EXECUTABLE + "${CMAKE_C_LINK_EXECUTABLE} /map:.map") + else() + message(WARNING + "Don't know how to generate link maps on this toolchain") + endif() +endif() + +# Write out a file in the cmake output directory listing the +# executables that are 'official' enough to want to code-sign and +# ship. +file(WRITE ${CMAKE_BINARY_DIR}/shipped.txt "") +function(installed_program target) + file(APPEND ${CMAKE_BINARY_DIR}/shipped.txt + "${target}${CMAKE_EXECUTABLE_SUFFIX}\n") +endfunction() + +# Conditionally add PuTTY-CAC functionality +if(PUTTY_CAC) + add_compile_definitions(PUTTY_CAC) + string(REPLACE "/MD" "/MT" "CMAKE_C_FLAGS_RELEASE" "${CMAKE_C_FLAGS_RELEASE}") + string(REPLACE "/Ob2" "/Ob1" "CMAKE_C_FLAGS_RELEASE" "${CMAKE_C_FLAGS_RELEASE}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /Gy /GL") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:ICF /OPT:REF /LTCG /DELAYLOAD:webauthn.dll") + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG") + string(REPLACE "/MD" "/MT" "CMAKE_STATIC_LINKER_FLAGS_RELEASE" "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}") + string(REPLACE "/INCREMENTAL:NO" "" "CMAKE_STATIC_LINKER_FLAGS_RELEASE" "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}") +endif() \ No newline at end of file diff --git a/code/cmake/setup.cmake b/code/cmake/setup.cmake new file mode 100644 index 0000000..7a65077 --- /dev/null +++ b/code/cmake/setup.cmake @@ -0,0 +1,113 @@ +# Forcibly re-enable assertions, even if we're building in release +# mode. This is a security project - assertions may be enforcing +# security-critical constraints. A backstop #ifdef in defs.h should +# give a #error if this manoeuvre doesn't do what it needs to. +string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") +string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + +set(PUTTY_IPV6 ON + CACHE BOOL "Build PuTTY with IPv6 support if possible") +set(PUTTY_DEBUG OFF + CACHE BOOL "Build PuTTY with debug() statements enabled") +set(PUTTY_FUZZING OFF + CACHE BOOL "Build PuTTY binaries suitable for fuzzing, NOT FOR REAL USE") +set(PUTTY_COVERAGE OFF + CACHE BOOL "Build PuTTY binaries suitable for code coverage analysis") + +set(STRICT OFF + CACHE BOOL "Enable extra compiler warnings and make them errors") + +include(FindGit) + +set(GENERATED_SOURCES_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) + +set(GENERATED_LICENCE_H ${GENERATED_SOURCES_DIR}/licence.h) +set(INTERMEDIATE_LICENCE_H ${GENERATED_LICENCE_H}.tmp) +add_custom_command(OUTPUT ${INTERMEDIATE_LICENCE_H} + COMMAND ${CMAKE_COMMAND} + -DLICENCE_FILE=${CMAKE_SOURCE_DIR}/LICENCE + -DOUTPUT_FILE=${INTERMEDIATE_LICENCE_H} + -P ${CMAKE_SOURCE_DIR}/cmake/licence.cmake + DEPENDS ${CMAKE_SOURCE_DIR}/cmake/licence.cmake ${CMAKE_SOURCE_DIR}/LICENCE) +add_custom_target(generated_licence_h + BYPRODUCTS ${GENERATED_LICENCE_H} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${INTERMEDIATE_LICENCE_H} ${GENERATED_LICENCE_H} + DEPENDS ${INTERMEDIATE_LICENCE_H} + COMMENT "Updating licence.h") + +set(GENERATED_COMMIT_C ${GENERATED_SOURCES_DIR}/cmake_commit.c) +set(INTERMEDIATE_COMMIT_C ${GENERATED_COMMIT_C}.tmp) +add_custom_target(check_git_commit + BYPRODUCTS ${INTERMEDIATE_COMMIT_C} + COMMAND ${CMAKE_COMMAND} + -DGIT_EXECUTABLE=${GIT_EXECUTABLE} + -DOUTPUT_FILE=${INTERMEDIATE_COMMIT_C} + -DOUTPUT_TYPE=header + -P ${CMAKE_SOURCE_DIR}/cmake/gitcommit.cmake + DEPENDS ${CMAKE_SOURCE_DIR}/cmake/gitcommit.cmake + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMENT "Checking current git commit") +add_custom_target(cmake_commit_c + BYPRODUCTS ${GENERATED_COMMIT_C} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${INTERMEDIATE_COMMIT_C} ${GENERATED_COMMIT_C} + DEPENDS check_git_commit ${INTERMEDIATE_COMMIT_C} + COMMENT "Updating cmake_commit.c") + +if(CMAKE_VERSION VERSION_LESS 3.12) + function(add_compile_definitions) + foreach(i ${ARGN}) + add_compile_options(-D${i}) + endforeach() + endfunction() +endif() + +function(add_sources_from_current_dir target) + set(sources) + foreach(i ${ARGN}) + set(sources ${sources} ${CMAKE_CURRENT_SOURCE_DIR}/${i}) + endforeach() + target_sources(${target} PRIVATE ${sources}) +endfunction() + +set(extra_dirs) +if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR WINELIB) + set(platform windows) +else() + set(platform unix) +endif() + +function(be_list TARGET NAME) + cmake_parse_arguments(OPT "SSH;SERIAL;OTHERBACKENDS" "" "" "${ARGN}") + add_library(${TARGET}-be-list OBJECT ${CMAKE_SOURCE_DIR}/be_list.c) + foreach(setting SSH SERIAL OTHERBACKENDS) + if(OPT_${setting}) + target_compile_definitions(${TARGET}-be-list PRIVATE ${setting}=1) + else() + target_compile_definitions(${TARGET}-be-list PRIVATE ${setting}=0) + endif() + endforeach() + target_compile_definitions(${TARGET}-be-list PRIVATE APPNAME=${NAME}) + target_sources(${TARGET} PRIVATE $) +endfunction() + +include(cmake/platforms/${platform}.cmake) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${GENERATED_SOURCES_DIR} + ${platform} + ${extra_dirs}) + +if(PUTTY_DEBUG) + add_compile_definitions(DEBUG) +endif() +if(PUTTY_FUZZING) + add_compile_definitions(FUZZING) +endif() +if(PUTTY_COVERAGE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage -g ") +endif() diff --git a/code/cmake/toolchain-mingw.cmake b/code/cmake/toolchain-mingw.cmake new file mode 100644 index 0000000..013dbeb --- /dev/null +++ b/code/cmake/toolchain-mingw.cmake @@ -0,0 +1,10 @@ +# Simple toolchain file for cross-building Windows PuTTY on Linux +# using MinGW (tested on Ubuntu). + +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR x86_64) + +set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) +set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) +set(CMAKE_AR x86_64-w64-mingw32-ar) +set(CMAKE_RANLIB x86_64-w64-mingw32-ranlib) diff --git a/code/cmake/toolchain-winegcc.cmake b/code/cmake/toolchain-winegcc.cmake new file mode 100644 index 0000000..73a9e53 --- /dev/null +++ b/code/cmake/toolchain-winegcc.cmake @@ -0,0 +1,33 @@ +# Toolchain file for cross-building a Winelib version of Windows PuTTY +# on Linux, using winegcc (tested on Ubuntu). + +# Winelib is weird because it's basically compiling ordinary Linux +# objects and executables, but we want to pretend to be Windows for +# purposes of (a) having resource files, and (b) selecting the Windows +# platform subdirectory. +# +# So, do we tag this as a weird kind of Windows build, or a weird kind +# of Linux build? Either way we have to do _something_ out of the +# ordinary. +# +# After some experimentation, it seems to make more sense to treat +# Winelib builds as basically Linux, and set a flag WINELIB that +# PuTTY's main build scripts will detect and handle specially. +# Specifically, that flag will cause cmake/setup.cmake to select the +# Windows platform (overriding the usual check of CMAKE_SYSTEM_NAME), +# and also trigger a call to enable_language(RC), which for some kind +# of cmake re-entrancy reason we can't do in this toolchain file +# itself. +set(CMAKE_SYSTEM_NAME Linux) +set(WINELIB ON) + +# We need a wrapper script around winegcc proper, because cmake's link +# command lines will refer to system libraries as "-lkernel32.lib" +# rather than the required "-lkernel32". The winegcc script alongside +# this toolchain file bodges that command-line translation. +set(CMAKE_C_COMPILER ${CMAKE_SOURCE_DIR}/cmake/winegcc) + +set(CMAKE_RC_COMPILER wrc) +set(CMAKE_RC_OUTPUT_EXTENSION .res.o) +set(CMAKE_RC_COMPILE_OBJECT + " -o ") diff --git a/code/cmake/winegcc b/code/cmake/winegcc new file mode 100644 index 0000000..fb298ad --- /dev/null +++ b/code/cmake/winegcc @@ -0,0 +1,29 @@ +#!/bin/sh + +# Wrapper for winegcc that allows it to be used in a build generated +# from PuTTY's CMakeLists.txt, by bodging around the command-line +# options that CMake gets wrong. + +init=true +for arg in init "$@"; do + if $init; then + set -- + init=false + continue + fi + + case "$arg" in + # The Windows build definition for PuTTY specifies all the + # system API libraries by names like kernel32.lib. When CMake + # reads that file and thinks it's compiling for Linux, it will + # generate link options such as -lkernel32.lib. But in fact + # winegcc expects -lkernel32, so we need to strip the ".lib" + # suffix. + -l*.lib) set -- "$@" "${arg%.lib}";; + + # Anything else, we leave unchanged. + *) set -- "$@" "$arg";; + esac +done + +exec winegcc "$@" diff --git a/code/cmdgen.c b/code/cmdgen.c index ef9c2e1..e0006ef 100644 --- a/code/cmdgen.c +++ b/code/cmdgen.c @@ -214,6 +214,15 @@ static char *readpassphrase(const char *filename) #define DEFAULT_RSADSA_BITS 2048 +static void spr_error(SeatPromptResult spr) +{ + if (spr.kind == SPRK_SW_ABORT) { + char *err = spr_get_error_message(spr); + fprintf(stderr, "puttygen: unable to read passphrase: %s", err); + sfree(err); + } +} + /* For Unix in particular, but harmless if this main() is reused elsewhere */ const bool buildinfo_gtk_relevant = false; @@ -878,10 +887,10 @@ int main(int argc, char **argv) PrimeGenerationContext *pgc = primegen_new_context(primegen); if (keytype == DSA) { - struct dss_key *dsskey = snew(struct dss_key); - dsa_generate(dsskey, bits, pgc, &cmdgen_progress); + struct dsa_key *dsakey = snew(struct dsa_key); + dsa_generate(dsakey, bits, pgc, &cmdgen_progress); ssh2key = snew(ssh2_userkey); - ssh2key->key = &dsskey->sshk; + ssh2key->key = &dsakey->sshk; ssh1key = NULL; } else if (keytype == ECDSA) { struct ecdsa_key *ek = snew(struct ecdsa_key); @@ -941,16 +950,16 @@ int main(int argc, char **argv) if (encrypted && load_encrypted) { if (!old_passphrase) { prompts_t *p = new_prompts(); - int ret; + SeatPromptResult spr; p->to_server = false; p->from_server = false; p->name = dupstr("SSH key passphrase"); add_prompt(p, dupstr("Enter passphrase to load key: "), false); - ret = console_get_userpass_input(p); - assert(ret >= 0); - if (!ret) { + spr = console_get_userpass_input(p); + assert(spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(spr)) { free_prompts(p); - perror("puttygen: unable to read passphrase"); + spr_error(spr); RETURN(1); } else { old_passphrase = prompt_get_result(p->prompts[0]); @@ -1090,18 +1099,18 @@ int main(int argc, char **argv) if (!new_passphrase && (change_passphrase || (keytype != NOKEYGEN && outtype != TEXT))) { prompts_t *p = new_prompts(); - int ret; + SeatPromptResult spr; p->to_server = false; p->from_server = false; p->name = dupstr("New SSH key passphrase"); add_prompt(p, dupstr("Enter passphrase to save key: "), false); add_prompt(p, dupstr("Re-enter passphrase to verify: "), false); - ret = console_get_userpass_input(p); - assert(ret >= 0); - if (!ret) { + spr = console_get_userpass_input(p); + assert(spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(spr)) { free_prompts(p); - perror("puttygen: unable to read new passphrase"); + spr_error(spr); RETURN(1); } else { if (strcmp(prompt_get_result_ref(p->prompts[0]), diff --git a/code/cmdline.c b/code/cmdline.c index 581c8e4..f162ef6 100644 --- a/code/cmdline.c +++ b/code/cmdline.c @@ -85,32 +85,49 @@ void cmdline_cleanup(void) * -1 return means that we aren't capable of processing the prompt and * someone else should do it. */ -int cmdline_get_passwd_input(prompts_t *p) +SeatPromptResult cmdline_get_passwd_input( + prompts_t *p, cmdline_get_passwd_input_state *state, bool restartable) { - static bool tried_once = false; - /* * We only handle prompts which don't echo (which we assume to be * passwords), and (currently) we only cope with a password prompt * that comes in a prompt-set on its own. */ - if (!cmdline_password || p->n_prompts != 1 || p->prompts[0]->echo) { - return -1; + if (p->n_prompts != 1 || p->prompts[0]->echo) { + return SPR_INCOMPLETE; } /* * If we've tried once, return utter failure (no more passwords left * to try). */ - if (tried_once) - return 0; + if (state->tried) + return SPR_SW_ABORT("Configured password was not accepted"); + + /* + * If we never had a password available in the first place, we + * can't do anything in any case. (But we delay this test until + * after trying once, so that even if we free cmdline_password + * below, we'll still remember that we _used_ to have one.) + */ + if (!cmdline_password) + return SPR_INCOMPLETE; prompt_set_result(p->prompts[0], cmdline_password); - smemclr(cmdline_password, strlen(cmdline_password)); - sfree(cmdline_password); - cmdline_password = NULL; - tried_once = true; - return 1; + state->tried = true; + + if (!restartable) { + /* + * If there's no possibility of needing to do this again after + * a 'Restart Session' event, then wipe our copy of the + * password out of memory. + */ + smemclr(cmdline_password, strlen(cmdline_password)); + sfree(cmdline_password); + cmdline_password = NULL; + } + + return SPR_OK; } static bool cmdline_check_unavailable(int flag, const char *p) @@ -580,6 +597,11 @@ int cmdline_process_param(const char *p, char *value, cmdline_error("the -pw option can only be used with the " "SSH protocol"); else { + if (cmdline_password) { + smemclr(cmdline_password, strlen(cmdline_password)); + sfree(cmdline_password); + } + cmdline_password = dupstr(value); /* Assuming that `value' is directly from argv, make a good faith * attempt to trample it, to stop it showing up in `ps' output @@ -588,6 +610,37 @@ int cmdline_process_param(const char *p, char *value, } } + if (!strcmp(p, "-pwfile")) { + RETURN(2); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); + SAVEABLE(1); + /* We delay evaluating this until after the protocol is decided, + * so that we can warn if it's of no use with the selected protocol */ + if (conf_get_int(conf, CONF_protocol) != PROT_SSH) + cmdline_error("the -pwfile option can only be used with the " + "SSH protocol"); + else { + Filename *fn = filename_from_str(value); + FILE *fp = f_open(fn, "r", false); + if (!fp) { + cmdline_error("unable to open password file '%s'", value); + } else { + if (cmdline_password) { + smemclr(cmdline_password, strlen(cmdline_password)); + sfree(cmdline_password); + } + + cmdline_password = chomp(fgetline(fp)); + if (!cmdline_password) { + cmdline_error("unable to read a password from file '%s'", + value); + } + fclose(fp); + } + filename_free(fn); + } + } + if (!strcmp(p, "-agent") || !strcmp(p, "-pagent") || !strcmp(p, "-pageant")) { RETURN(1); @@ -700,11 +753,13 @@ int cmdline_process_param(const char *p, char *value, if (!strcmp(p, "-4") || !strcmp(p, "-ipv4")) { RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); SAVEABLE(1); conf_set_int(conf, CONF_addressfamily, ADDRTYPE_IPV4); } if (!strcmp(p, "-6") || !strcmp(p, "-ipv6")) { RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); SAVEABLE(1); conf_set_int(conf, CONF_addressfamily, ADDRTYPE_IPV6); } diff --git a/code/compile b/code/compile deleted file mode 100644 index 99e5052..0000000 --- a/code/compile +++ /dev/null @@ -1,348 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ - icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/code/config.c b/code/config.c index 312c022..7909141 100644 --- a/code/config.c +++ b/code/config.c @@ -316,7 +316,7 @@ static void config_protocols_handler(union control *ctrl, dlgparam *dlg, for (size_t i = n_ui_backends; i < PROTOCOL_LIMIT && backends[i]; i++) { dlg_listbox_addwithid(ctrl, dlg, - backends[i]->displayname, + backends[i]->displayname_tc, backends[i]->protocol); if (backends[i]->protocol == curproto) curentry = i - n_ui_backends; @@ -739,6 +739,37 @@ static void sshbug_handler(union control *ctrl, dlgparam *dlg, } } +static void sshbug_handler_manual_only(union control *ctrl, dlgparam *dlg, + void *data, int event) +{ + /* + * This is just like sshbug_handler, except that there's no 'Auto' + * option. Used for bug workaround flags that can't be + * autodetected, and have to be manually enabled if they're to be + * used at all. + */ + Conf *conf = (Conf *)data; + if (event == EVENT_REFRESH) { + int oldconf = conf_get_int(conf, ctrl->listbox.context.i); + dlg_update_start(ctrl, dlg); + dlg_listbox_clear(ctrl, dlg); + dlg_listbox_addwithid(ctrl, dlg, "Off", FORCE_OFF); + dlg_listbox_addwithid(ctrl, dlg, "On", FORCE_ON); + switch (oldconf) { + case FORCE_OFF: dlg_listbox_select(ctrl, dlg, 0); break; + case FORCE_ON: dlg_listbox_select(ctrl, dlg, 1); break; + } + dlg_update_done(ctrl, dlg); + } else if (event == EVENT_SELCHANGE) { + int i = dlg_listbox_index(ctrl, dlg); + if (i < 0) + i = FORCE_OFF; + else + i = dlg_listbox_getid(ctrl, dlg, i); + conf_set_int(conf, ctrl->listbox.context.i, i); + } +} + struct sessionsaver_data { union control *editbox, *listbox, *loadbutton, *savebutton, *delbutton; union control *okbutton, *cancelbutton; @@ -749,19 +780,19 @@ struct sessionsaver_data { #ifdef PUTTY_CAC struct cert_data { - union control *cert_set_pkcs_button, *cert_set_capi_button, *cert_clear_button, *cert_view_button, - *cert_thumbprint_text, *cert_copy_clipboard_button, *cert_enable_auth, *cert_auth_checkbox; + union control* cert_set_pkcs_button, * cert_set_fido_button, * cert_set_capi_button, * cert_clear_button, * cert_view_button, + * cert_thumbprint_text, * cert_copy_clipboard_button, * cert_enable_auth, * cert_auth_checkbox; }; -void cert_event_handler(union control *ctrl, void *dlg, void *data, int event) +void cert_event_handler(union control* ctrl, dlgparam* dlg, void* data, int event) { - Conf *conf = (Conf *)data; - struct cert_data *certd = (struct cert_data *)ctrl->generic.context.p; + Conf* conf = (Conf*)data; + struct cert_data* certd = (struct cert_data*)ctrl->generic.context.p; // use the clear button initialization to prepopulate the thumbprint field if (ctrl == certd->cert_clear_button && event == EVENT_REFRESH) { - char * szCert = conf_get_str(conf, CONF_cert_certid); + char* szCert = conf_get_str(conf, CONF_cert_fingerprint); if (cert_is_certpath(szCert)) { dlg_text_set(certd->cert_thumbprint_text, dlg, szCert); @@ -771,8 +802,8 @@ void cert_event_handler(union control *ctrl, void *dlg, void *data, int event) // handle copy clipboard button press if (ctrl == certd->cert_copy_clipboard_button && event == EVENT_ACTION) { - char * szCert = conf_get_str(conf, CONF_cert_certid); - char * szKeyString = cert_key_string(szCert); + char* szCert = conf_get_str(conf, CONF_cert_fingerprint); + char* szKeyString = cert_key_string(szCert); if (szKeyString == NULL) return; write_aclip(CLIP_SYSTEM, szKeyString, strlen(szKeyString), 0); sfree(szKeyString); @@ -781,26 +812,26 @@ void cert_event_handler(union control *ctrl, void *dlg, void *data, int event) // handle view clipboard button press if (ctrl == certd->cert_view_button && event == EVENT_ACTION) { - char * szCert = conf_get_str(conf, CONF_cert_certid); + char* szCert = conf_get_str(conf, CONF_cert_fingerprint); cert_display_cert(szCert, NULL); } // handle certificate clear button press if (ctrl == certd->cert_clear_button && event == EVENT_ACTION) { - dlg_text_set(certd->cert_thumbprint_text, dlg, ""); - conf_set_str(conf, CONF_cert_certid, ""); - conf_set_bool(conf, CONF_try_cert_auth, 0); + dlg_text_set(certd->cert_thumbprint_text, dlg, ""); + conf_set_str(conf, CONF_cert_fingerprint, ""); + conf_set_bool(conf, CONF_cert_attempt_auth, 0); dlg_checkbox_set(certd->cert_auth_checkbox, dlg, 0); } // handle capi certificate set button press if (ctrl == certd->cert_set_capi_button && event == EVENT_ACTION) { - char * szCert = cert_prompt(IDEN_CAPI, NULL, FALSE); + char* szCert = cert_prompt(IDEN_CAPI, NULL, FALSE, NULL); if (szCert == NULL) return; - conf_set_str(conf, CONF_cert_certid, szCert); - conf_set_bool(conf, CONF_try_cert_auth, 1); + conf_set_str(conf, CONF_cert_fingerprint, szCert); + conf_set_bool(conf, CONF_cert_attempt_auth, 1); dlg_checkbox_set(certd->cert_auth_checkbox, dlg, 1); dlg_text_set(certd->cert_thumbprint_text, dlg, szCert); sfree(szCert); @@ -809,18 +840,272 @@ void cert_event_handler(union control *ctrl, void *dlg, void *data, int event) // handle pkcs certificate set button press if (ctrl == certd->cert_set_pkcs_button && event == EVENT_ACTION) { - char * szCert = cert_prompt(IDEN_PKCS, NULL, FALSE); + char* szCert = cert_prompt(IDEN_PKCS, NULL, FALSE, NULL); if (szCert == NULL) return; - conf_set_str(conf, CONF_cert_certid, szCert); - conf_set_bool(conf, CONF_try_cert_auth, 1); + conf_set_str(conf, CONF_cert_fingerprint, szCert); + conf_set_bool(conf, CONF_cert_attempt_auth, 1); dlg_checkbox_set(certd->cert_auth_checkbox, dlg, 1); *strrchr(szCert, '=') = '\0'; dlg_text_set(certd->cert_thumbprint_text, dlg, szCert); sfree(szCert); } + + // handle fido certificate set button press + if (ctrl == certd->cert_set_fido_button && event == EVENT_ACTION) + { + char* szCert = cert_prompt(IDEN_FIDO, NULL, FALSE, NULL); + if (szCert == NULL) return; + conf_set_str(conf, CONF_cert_fingerprint, szCert); + conf_set_bool(conf, CONF_cert_attempt_auth, 1); + dlg_checkbox_set(certd->cert_auth_checkbox, dlg, 1); + dlg_text_set(certd->cert_thumbprint_text, dlg, szCert); + sfree(szCert); + } } +struct fido_data { + union control* fido_create_key_button, * fido_delete_key_button, * fido_import_key_button, * fido_clear_key_button, + * fido_algo_combobox, * fido_app_text, * fido_verification_radio, * fido_resident_radio; +}; + +void fido_event_handler(union control* ctrl, dlgparam* dlg, void* data, int event) +{ + Conf* conf = (Conf*)data; + struct fido_data* fidod = (struct fido_data*)ctrl->generic.context.p; + static const char* szAlgTable[] = { + "ecdsa-sha2-nistp256", + "ecdsa-sha2-nistp384", + "ecdsa-sha2-nistp521", + "ssh-ed25519" + }; + + // handle fido key clear button press + if (ctrl == fidod->fido_clear_key_button && event == EVENT_ACTION) + { + fido_clear_keys(); + } + + // handle fido key import button press + if (ctrl == fidod->fido_import_key_button && event == EVENT_ACTION) + { + fido_import_keys(); + } + + // handle fido key create button press + if (ctrl == fidod->fido_create_key_button && event == EVENT_ACTION) + { + // special alert about unusual types + const char* szAlgId = szAlgTable[dlg_listbox_index(fidod->fido_algo_combobox, dlg)]; + if ((strcmp(szAlgId, "ecdsa-sha2-nistp384") == 0 || strcmp(szAlgId, "ecdsa-sha2-nistp521") == 0) && + MessageBoxW(NULL, L"PuTTY CAC supports selected algorithm but most security tokens " \ + L"do not. As a result, key creation may fail or you may see repeated, unresolvable PIN prompts " \ + L"during creation even though you are typing the correct PIN. Do you wish to continue?", + L"FIDO Key Type Warning", MB_SYSTEMMODAL | MB_ICONQUESTION | MB_YESNO) != IDYES) return; + + // sanity check on parameters + char* szAppId = dlg_editbox_get(fidod->fido_app_text, dlg); + if (strstr(szAppId, "ssh:") != szAppId) + { + MessageBoxW(NULL, L"The value provided for application name " \ + L"is not valid. Please check these values are try again.", + L"FIDO Key Creation Failed", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + return; + } + + // first see if a duplicate key exists + char* szCertDupCheck = dupprintf("FIDO:%s", szAppId); + PCERT_CONTEXT pCert = NULL; + HCERTSTORE hCertStore = NULL; + BOOL bKeyExists = cert_load_cert(szCertDupCheck, &pCert, &hCertStore); + sfree(szCertDupCheck); + if (bKeyExists) + { + CertFreeCertificateContext(pCert); + CertCloseStore(hCertStore, 0); + if (MessageBoxW(NULL, L"It appears that a FIDO key with this name may already exist. " \ + L"PuTTY CAC may not be able to determine which key to use. Are you sure you want to continue?", + L"FIDO Duplicate Key Detected", MB_SYSTEMMODAL | MB_ICONQUESTION | MB_YESNO) != IDYES) return; + } + + // fetch options from resident key and verification boxes + int bResidentKey = (dlg_radiobutton_get(fidod->fido_resident_radio, dlg) == 0); + int bVerificationRequired = (dlg_radiobutton_get(fidod->fido_verification_radio, dlg) == 1); + + // attempt to create key + if (fido_create_key(szAlgId, szAppId, bResidentKey, bVerificationRequired)) + { + // alert user of success and ask about assignment + if (MessageBoxW(NULL, L"FIDO key creation was successful and has been added to the FIDO cache. " \ + L"Do you want to assign the new key to the current session configuration?", + L"FIDO Key Creation Successful", MB_SYSTEMMODAL | MB_ICONQUESTION | MB_YESNO) == IDYES) + { + char* szCert = dupprintf("FIDO:%s", szAppId); + conf_set_str(conf, CONF_cert_fingerprint, szCert); + conf_set_bool(conf, CONF_cert_attempt_auth, 1); + sfree(szCert); + } + } + else MessageBoxW(NULL, L"PuTTY could not create the key on the token. Verify that a " \ + L"compatible token is attached. You may have also entered the PIN incorrectly " \ + L"or the token may not support the selected algorithm / parameters.", + L"FIDO Key Creation Failed", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + + sfree(szAppId); + } + + // handle fido key delete button press + if (ctrl == fidod->fido_delete_key_button && event == EVENT_ACTION) + { + char* szCert = cert_prompt(IDEN_FIDO, NULL, FALSE, + L"Select a FIDO key to remove. If this is a resident key, it will also " \ + L"be deleted from the token."); + if (szCert == NULL) return; + + fido_delete_key(szCert); + sfree(szCert); + } + + // handle key algorithm key combo box population + if (ctrl == fidod->fido_algo_combobox && event == EVENT_REFRESH) + { + dlg_update_start(ctrl, dlg); + dlg_listbox_clear(ctrl, dlg); + for (int iIndex = 0; iIndex < _countof(szAlgTable); iIndex++) + dlg_listbox_add(ctrl, dlg, szAlgTable[iIndex]); + dlg_listbox_select(ctrl, dlg, 0); + dlg_update_done(ctrl, dlg); + } + + // default text for application name + if (ctrl == fidod->fido_app_text && event == EVENT_REFRESH) + { + dlg_editbox_set(ctrl, dlg, "ssh:"); + } + + // handle default radio bottom selection + if (ctrl == fidod->fido_resident_radio && event == EVENT_REFRESH || + ctrl == fidod->fido_verification_radio && event == EVENT_REFRESH) + { + dlg_radiobutton_set(ctrl, dlg, 0); + } +} + +struct capi_data { + union control* capi_create_key_button, * capi_delete_key_button, * capi_provider_radio, * capi_algo_combobox, + * capi_name_text, * capi_no_expired_checkbox, * capi_smartcard_only_checkbox, * capi_trusted_certs_checkbox, + * cert_store_button; +}; + +void capi_event_handler(union control* ctrl, dlgparam* dlg, void* data, int event) +{ + Conf* conf = (Conf*)data; + struct capi_data* capid = (struct capi_data*)ctrl->generic.context.p; + static const char* szAlgTable[] = { + "rsa-1024", + "rsa-2048", + "rsa-3072", + "rsa-4096", + "ecdsa-sha2-nistp256", + "ecdsa-sha2-nistp384", + "ecdsa-sha2-nistp521" + }; + + // handle certificate filter - ignore expired + if (ctrl == capid->capi_no_expired_checkbox && event == EVENT_REFRESH) + dlg_checkbox_set(ctrl, dlg, cert_ignore_expired_certs(-1)); + if (ctrl == capid->capi_no_expired_checkbox && event == EVENT_VALCHANGE) + cert_ignore_expired_certs(dlg_checkbox_get(ctrl, dlg)); + + // handle certificate filter - smartcard only expired + if (ctrl == capid->capi_smartcard_only_checkbox && event == EVENT_REFRESH) + dlg_checkbox_set(ctrl, dlg, cert_smartcard_certs_only(-1)); + if (ctrl == capid->capi_smartcard_only_checkbox && event == EVENT_VALCHANGE) + cert_smartcard_certs_only(dlg_checkbox_get(ctrl, dlg)); + + // handle certificate filter - trusted only + if (ctrl == capid->capi_trusted_certs_checkbox && event == EVENT_REFRESH) + dlg_checkbox_set(ctrl, dlg, cert_trusted_certs_only(-1)); + if (ctrl == capid->capi_trusted_certs_checkbox && event == EVENT_VALCHANGE) + cert_trusted_certs_only(dlg_checkbox_get(ctrl, dlg)); + + // handle key algorithm key combo box population + if (ctrl == capid->capi_algo_combobox && event == EVENT_REFRESH) + { + dlg_update_start(ctrl, dlg); + dlg_listbox_clear(ctrl, dlg); + for (int iIndex = 0; iIndex < _countof(szAlgTable); iIndex++) + dlg_listbox_add(ctrl, dlg, szAlgTable[iIndex]); + dlg_listbox_select(ctrl, dlg, 1); + dlg_update_done(ctrl, dlg); + } + + // handle capi key create button press + if (ctrl == capid->capi_create_key_button && event == EVENT_ACTION) + { + // fetch options for provider type + int bHardwareToken = (dlg_radiobutton_get(capid->capi_provider_radio, dlg) == 0); + + // special alert about unusual types + const char* szAlgId = szAlgTable[dlg_listbox_index(capid->capi_algo_combobox, dlg)]; + if (bHardwareToken && (strcmp(szAlgId, "rsa-4096") == 0 || strcmp(szAlgId, "ecdsa-sha2-nistp521") == 0) && + MessageBoxW(NULL, L"PuTTY CAC supports the selected algorithm but many security tokens " \ + L"do not. As a result, key creation may fail. Do you wish to continue?", + L"CAPI Key Type Warning", MB_SYSTEMMODAL | MB_ICONQUESTION | MB_YESNO) != IDYES) return; + + char* szSubjectName = dlg_editbox_get(capid->capi_name_text, dlg); + if (strlen(szSubjectName) == 0) + { + MessageBoxW(NULL, L"You must specify a subject name for the certificate.", + L"No Subject Name", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + sfree(szSubjectName); + return; + } + + // attempt to create certificate + if (cert_capi_create_key(szAlgId, szSubjectName, bHardwareToken)) + { + MessageBoxW(NULL, L"Certificate was successfully created. It should now be " \ + L"selectable in PuTTY if your filtering allows self-signed certificates.", + L"CAPI Certificate Creation Successful", MB_SYSTEMMODAL | MB_ICONINFORMATION); + } + else + { + MessageBoxW(NULL, L"PuTTY could not create the certificate. " \ + L"For hardware tokens, verify that a compatible token is attached. You may " \ + L"have also incorrectly entered the PIN incorrectly " \ + L"or the token may not support the selected algorithm.", + L"CAPI Certificate Creation Failed", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + } + + sfree(szSubjectName); + } + + // handle capi key delete button press + if (ctrl == capid->capi_delete_key_button && event == EVENT_ACTION) + { + char* szCert = cert_prompt(IDEN_CAPI, NULL, FALSE, + L"Select a CAPI key to remove. If this key on a smart card or token, " \ + L"PuTTY will attempt to delete it from there as well."); + if (szCert == NULL) return; + + cert_capi_delete_key(szCert); + sfree(szCert); + } + + // handle oepn certificate store button press + if (ctrl == capid->cert_store_button && event == EVENT_ACTION) + { + ShellExecuteW(NULL, L"open", L"certmgr.msc", NULL, NULL, SW_SHOWNORMAL); + } + + // handle default radio bottom selection + if (ctrl == capid->capi_provider_radio && event == EVENT_REFRESH) + { + dlg_radiobutton_set(ctrl, dlg, 0); + } +} #endif // PUTTY_CAC + static void sessionsaver_data_free(void *ssdv) { struct sessionsaver_data *ssd = (struct sessionsaver_data *)ssdv; @@ -1840,7 +2125,7 @@ void setup_config_box(struct controlbox *b, bool midsession, for (size_t i = 0; i < n_ui_backends; i++) { assert(backends[i]); c->radio.buttons[c->radio.nbuttons] = - dupstr(backends[i]->displayname); + dupstr(backends[i]->displayname_tc); c->radio.shortcuts[c->radio.nbuttons] = (backends[i]->protocol == PROT_SSH ? 's' : backends[i]->protocol == PROT_SERIAL ? 'r' : @@ -2057,12 +2342,24 @@ void setup_config_box(struct controlbox *b, bool midsession, conf_radiobutton_bool_handler, I(CONF_rxvt_homeend), "Standard", I(false), "rxvt", I(true), NULL); - ctrl_radiobuttons(s, "The Function keys and keypad", 'f', 3, + ctrl_radiobuttons(s, "The Function keys and keypad", 'f', 4, HELPCTX(keyboard_funkeys), conf_radiobutton_handler, I(CONF_funky_type), - "ESC[n~", I(0), "Linux", I(1), "Xterm R6", I(2), - "VT400", I(3), "VT100+", I(4), "SCO", I(5), NULL); + "ESC[n~", I(FUNKY_TILDE), + "Linux", I(FUNKY_LINUX), + "Xterm R6", I(FUNKY_XTERM), + "VT400", I(FUNKY_VT400), + "VT100+", I(FUNKY_VT100P), + "SCO", I(FUNKY_SCO), + "Xterm 216+", I(FUNKY_XTERM_216), + NULL); + ctrl_radiobuttons(s, "Shift/Ctrl/Alt with the arrow keys", 'w', 2, + HELPCTX(keyboard_sharrow), + conf_radiobutton_handler, + I(CONF_sharrow_type), + "Ctrl toggles app mode", I(SHARROW_APPLICATION), + "xterm-style bitmap", I(SHARROW_BITMAP), NULL); s = ctrl_getset(b, "Terminal/Keyboard", "appkeypad", "Application keypad settings:"); @@ -2555,16 +2852,26 @@ void setup_config_box(struct controlbox *b, bool midsession, "Options controlling proxy usage"); s = ctrl_getset(b, "Connection/Proxy", "basics", NULL); - ctrl_radiobuttons(s, "Proxy type:", 't', 3, - HELPCTX(proxy_type), - conf_radiobutton_handler, - I(CONF_proxy_type), - "None", I(PROXY_NONE), - "SOCKS 4", I(PROXY_SOCKS4), - "SOCKS 5", I(PROXY_SOCKS5), - "HTTP", I(PROXY_HTTP), - "Telnet", I(PROXY_TELNET), - NULL); + c = ctrl_radiobuttons(s, "Proxy type:", 't', 3, + HELPCTX(proxy_type), + conf_radiobutton_handler, + I(CONF_proxy_type), + "None", I(PROXY_NONE), + "SOCKS 4", I(PROXY_SOCKS4), + "SOCKS 5", I(PROXY_SOCKS5), + "HTTP", I(PROXY_HTTP), + "Telnet", I(PROXY_TELNET), + NULL); + if (ssh_proxy_supported) { + /* Add an extra radio button to the above list. */ + c->radio.nbuttons++; + c->radio.buttons = + sresize(c->radio.buttons, c->radio.nbuttons, char *); + c->radio.buttons[c->radio.nbuttons-1] = dupstr("SSH"); + c->radio.buttondata = + sresize(c->radio.buttondata, c->radio.nbuttons, intorptr); + c->radio.buttondata[c->radio.nbuttons-1] = I(PROXY_SSH); + } ctrl_columns(s, 2, 80, 20); c = ctrl_editbox(s, "Proxy hostname", 'y', 100, HELPCTX(proxy_main), @@ -2839,16 +3146,16 @@ void setup_config_box(struct controlbox *b, bool midsession, * The Connection/SSH/Certificate panel. */ ctrl_settitle(b, "Connection/SSH/Certificate", - "Options controlling certificate SSH authentication"); - struct cert_data *certd = (struct cert_data *) ctrl_alloc(b, sizeof(struct cert_data)); + "Options controlling certificate / key authentication"); + struct cert_data* certd = (struct cert_data*)ctrl_alloc(b, sizeof(struct cert_data)); // panel and option to enable certificate auth s = ctrl_getset(b, "Connection/SSH/Certificate", "methods", "Authentication methods"); certd->cert_auth_checkbox = ctrl_checkbox( - s, "Attempt certificate authentication", NO_SHORTCUT, - HELPCTX(no_help), conf_checkbox_handler, I(CONF_try_cert_auth)); - ctrl_text(s, "Note: Enabling certificate authentication will override any PuTTY " \ + s, "Attempt certificate / key authentication", NO_SHORTCUT, + HELPCTX(no_help), conf_checkbox_handler, I(CONF_cert_attempt_auth)); + ctrl_text(s, "Note: Enabling certificate / key authentication will override any PuTTY " \ "key file under the 'Auth' tab. This setting has no effect " \ "when using pageant.", HELPCTX(no_help)); @@ -2857,30 +3164,151 @@ void setup_config_box(struct controlbox *b, bool midsession, ctrl_columns(s, 3, 40, 20, 40); // buttons to support setting and remove of certificate - certd->cert_set_capi_button = ctrl_pushbutton(s, "Set CAPI Cert...", + certd->cert_set_capi_button = ctrl_pushbutton(s, "Set CAPI Cert...", NO_SHORTCUT, HELPCTX(no_help), cert_event_handler, P(certd)); certd->cert_set_capi_button->generic.column = 0; - certd->cert_set_pkcs_button = ctrl_pushbutton(s, "Set PKCS Cert...", + certd->cert_set_pkcs_button = ctrl_pushbutton(s, "Set PKCS Cert...", NO_SHORTCUT, HELPCTX(no_help), cert_event_handler, P(certd)); certd->cert_set_pkcs_button->generic.column = 0; - certd->cert_clear_button = ctrl_pushbutton(s, "Clear Cert", + certd->cert_set_fido_button = ctrl_pushbutton(s, "Set FIDO Key...", + NO_SHORTCUT, HELPCTX(no_help), cert_event_handler, P(certd)); + certd->cert_set_fido_button->generic.column = 0; + certd->cert_clear_button = ctrl_pushbutton(s, "Clear Selected", NO_SHORTCUT, HELPCTX(no_help), cert_event_handler, P(certd)); certd->cert_clear_button->generic.column = 2; - certd->cert_view_button = ctrl_pushbutton(s, "View Cert", + certd->cert_view_button = ctrl_pushbutton(s, "View Selected", NO_SHORTCUT, HELPCTX(no_help), cert_event_handler, P(certd)); certd->cert_view_button->generic.column = 2; - // textbox for thumbpring + // textbox for thumbprint ctrl_text(s, " ", HELPCTX(no_help)); - ctrl_text(s, "Certificate thumbprint:", HELPCTX(no_help)); - certd->cert_thumbprint_text = ctrl_text(s, "", HELPCTX(no_help)); + ctrl_text(s, "Selected thumbprint:", HELPCTX(no_help)); + certd->cert_thumbprint_text = ctrl_text(s, "", HELPCTX(no_help)); // button for keystring ctrl_text(s, " ", HELPCTX(no_help)); - ctrl_text(s, "Certificate string for authorized keys file:", HELPCTX(no_help)); - certd->cert_copy_clipboard_button = ctrl_pushbutton(s, "Copy To Clipboard", + ctrl_text(s, "Authorized Keys file value:", HELPCTX(no_help)); + certd->cert_copy_clipboard_button = ctrl_pushbutton(s, "Copy To Clipboard", NO_SHORTCUT, HELPCTX(no_help), cert_event_handler, P(certd)); certd->cert_copy_clipboard_button->generic.column = 0; + + /* + * The Connection/SSH/FIDO Tools panel. + */ + ctrl_settitle(b, "Connection/SSH/Certificate/FIDO Tools", + "Wizard for managing keys on FIDO tokens"); + struct fido_data* fidod = (struct fido_data*)ctrl_alloc(b, sizeof(struct cert_data)); + + // section for fido creation + s = ctrl_getset(b, "Connection/SSH/Certificate/FIDO Tools", "params", "Creation parameters"); + ctrl_columns(s, 3, 45, 10, 45); + + fidod->fido_algo_combobox = ctrl_droplist(s, "Key Algorithm:", 't', + 65, HELPCTX(no_help), fido_event_handler, P(fidod)); + + fidod->fido_app_text = ctrl_editbox(s, "Application Name:", NO_SHORTCUT, 64, + HELPCTX(no_help), fido_event_handler, P(fidod), I(0)); + ctrl_text(s, "Application name is used to identify this specific key. " \ + "It must start with 'ssh:' to ensure compatibility. If you have " \ + "multiple tokens, you may also want to include text to identify the token.", HELPCTX(no_help)); + + fidod->fido_resident_radio = ctrl_radiobuttons(s, + "Key type:", 'r', 1, HELPCTX(no_help), fido_event_handler, + P(fidod), "Resident Key", I(FORCE_OFF), + "Non-Resident Key", I(FORCE_OFF), NULL); + fidod->fido_resident_radio->generic.column = 0; + + fidod->fido_verification_radio = ctrl_radiobuttons( + s, "User Verification:", 'u', 1, HELPCTX(no_help), fido_event_handler, + P(fidod), "Key touch", I(false), "Key touch & PIN", I(true), NULL); + fidod->fido_verification_radio->generic.column = 2; + + fidod->fido_create_key_button = ctrl_pushbutton(s, "Create Key...", + NO_SHORTCUT, HELPCTX(no_help), fido_event_handler, P(fidod)); + fidod->fido_create_key_button->generic.column = 2; + + // section for fido imports + s = ctrl_getset(b, "Connection/SSH/Certificate/FIDO Tools", "import_params", "Key management"); + ctrl_text(s, "Use this option to import resident keys from a FIDO token. You must " \ + "be able to elevate to a local administrator to communicate directly with the token.", HELPCTX(no_help)); + + // adjust so we have two columns with a small separation in the middle + ctrl_columns(s, 3, 45, 10, 45); + + fidod->fido_clear_key_button = ctrl_pushbutton(s, "Clear Key Cache", + NO_SHORTCUT, HELPCTX(no_help), fido_event_handler, P(fidod)); + fidod->fido_clear_key_button->generic.column = 0; + + fidod->fido_import_key_button = ctrl_pushbutton(s, "Import Keys...", + NO_SHORTCUT, HELPCTX(no_help), fido_event_handler, P(fidod)); + fidod->fido_import_key_button->generic.column = 2; + + fidod->fido_delete_key_button = ctrl_pushbutton(s, "Delete Key...", + NO_SHORTCUT, HELPCTX(no_help), fido_event_handler, P(fidod)); + fidod->fido_delete_key_button->generic.column = 0; + + /* + * The Connection/SSH/CAPI Tools panel. + */ + ctrl_settitle(b, "Connection/SSH/Certificate/CAPI Tools", + "Wizard for managing CAPI certificates"); + struct capi_data* capid = (struct capi_data*)ctrl_alloc(b, sizeof(struct cert_data)); + + // section for capi creation + s = ctrl_getset(b, "Connection/SSH/Certificate/CAPI Tools", "params", "Creation parameters"); + ctrl_text(s, "Use this to create a self-signed certificate. In business " \ + "environments, hardware tokens may not be writable.", HELPCTX(no_help)); + ctrl_columns(s, 3, 45, 10, 45); + + capid->capi_algo_combobox = ctrl_droplist(s, "Key Algorithm:", 't', + 65, HELPCTX(no_help), capi_event_handler, P(capid)); + + capid->capi_name_text = ctrl_editbox(s, "Subject Name:", NO_SHORTCUT, 64, + HELPCTX(no_help), capi_event_handler, P(capid), I(0)); + ctrl_text(s, "The subject name is used to identify the certificate in " \ + "PUTTY CAC dialog boxes. ", HELPCTX(no_help)); + + capid->capi_provider_radio = ctrl_radiobuttons(s, + "Provider type:", 'r', 1, HELPCTX(no_help), capi_event_handler, + P(capid), "Smart Card / Token", I(FORCE_OFF), + "Software", I(FORCE_OFF), NULL); + capid->capi_provider_radio->generic.column = 0; + + ctrl_text(s, " ", HELPCTX(no_help))->generic.column = 2; + capid->capi_create_key_button = ctrl_pushbutton(s, "Create Key...", + NO_SHORTCUT, HELPCTX(no_help), capi_event_handler, P(capid)); + capid->capi_create_key_button->generic.column = 2; + + // selection for capi filter + s = ctrl_getset(b, "Connection/SSH/Certificate/CAPI Tools", "filter_params", "Certificate selection filters"); + ctrl_columns(s, 3, 45, 10, 45); + + ctrl_text(s, "Use these options to filter the certificates shown in " \ + "PuTTY and Pageant certificate selection dialog boxes.", HELPCTX(no_help)); + + capid->capi_trusted_certs_checkbox = ctrl_checkbox(s, "Only Trusted", + NO_SHORTCUT, HELPCTX(no_help), capi_event_handler, P(capid)); + capid->capi_trusted_certs_checkbox->generic.column = 0; + + capid->capi_smartcard_only_checkbox = ctrl_checkbox(s, "Only Smart Card", + NO_SHORTCUT, HELPCTX(no_help), capi_event_handler, P(capid)); + capid->capi_smartcard_only_checkbox->generic.column = 0; + + capid->capi_no_expired_checkbox = ctrl_checkbox(s, "Not Expired", + NO_SHORTCUT, HELPCTX(no_help), capi_event_handler, P(capid)); + capid->capi_no_expired_checkbox->generic.column = 2; + + // selection for other options filter + s = ctrl_getset(b, "Connection/SSH/Certificate/CAPI Tools", "other_params", "Other options"); + ctrl_columns(s, 3, 45, 10, 45); + + capid->cert_store_button = ctrl_pushbutton(s, "Open Store...", + NO_SHORTCUT, HELPCTX(no_help), capi_event_handler, P(capid)); + capid->cert_store_button->generic.column = 0; + + capid->capi_delete_key_button = ctrl_pushbutton(s, "Delete Key...", + NO_SHORTCUT, HELPCTX(no_help), capi_event_handler, P(capid)); + capid->capi_delete_key_button->generic.column = 2; #endif // PUTTY_CAC /* * The Connection/SSH/Auth panel. @@ -3164,6 +3592,13 @@ void setup_config_box(struct controlbox *b, bool midsession, HELPCTX(ssh_bugs_maxpkt2), sshbug_handler, I(CONF_sshbug_maxpkt2)); + s = ctrl_getset(b, "Connection/SSH/Bugs", "manual", + "Manually enabled workarounds"); + ctrl_droplist(s, "Discards data sent before its greeting", 'd', 20, + HELPCTX(ssh_bugs_dropstart), + sshbug_handler_manual_only, + I(CONF_sshbug_dropstart)); + ctrl_settitle(b, "Connection/SSH/More bugs", "Further workarounds for SSH server bugs"); diff --git a/code/configure b/code/configure deleted file mode 100644 index 5b258b3..0000000 --- a/code/configure +++ /dev/null @@ -1,7561 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for putty 0.76. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='putty' -PACKAGE_TARNAME='putty' -PACKAGE_VERSION='0.76' -PACKAGE_STRING='putty 0.76' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -WARNINGOPTS -EGREP -GREP -CPP -HAVE_GTK_FALSE -HAVE_GTK_TRUE -GTK1_CONFIG -GTK_LIBS -GTK_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG -HAVE_QUARTZ_FALSE -HAVE_QUARTZ_TRUE -AUTO_GIT_COMMIT_FALSE -AUTO_GIT_COMMIT_TRUE -SETID_MODE -SETID_CMD -HAVE_SETID_CMD_FALSE -HAVE_SETID_CMD_TRUE -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -ac_ct_AR -AR -RANLIB -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -runstatedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -enable_setuid -enable_setgid -enable_git_commit -with_gssapi -with_quartz -with_gtk -enable_gtktest -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures putty 0.76 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/putty] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of putty 0.76:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --enable-setuid=USER make pterm setuid to a given user - --enable-setgid=GROUP make pterm setgid to a given group - --disable-git-commit disable embedding current git HEAD in binaries - --disable-gtktest do not try to compile and run a test GTK+ program - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-gssapi disable GSSAPI support - --with-quartz build for the MacOS Quartz GTK back end - --with-gtk=VER specify GTK version to use (`1', `2' or `3') - --without-gtk do not use GTK (build command-line tools only) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -putty configure 0.76 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by putty $as_me 0.76, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_files="$ac_config_files Makefile" - -ac_config_headers="$ac_config_headers uxconfig.h:uxconfig.in" - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='putty' - VERSION='0.76' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar lib "link -lib" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar lib "link -lib" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -$as_echo_n "checking the archiver ($AR) interface... " >&6; } -if ${am_cv_ar_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - am_cv_ar_interface=ar - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int some_variable = 0; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 - (eval $am_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - am_cv_ar_interface=ar - else - am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 - (eval $am_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - am_cv_ar_interface=lib - else - am_cv_ar_interface=unknown - fi - fi - rm -f conftest.lib libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -$as_echo "$am_cv_ar_interface" >&6; } - -case $am_cv_ar_interface in -ar) - ;; -lib) - # Microsoft lib, so override with the ar-lib wrapper script. - # FIXME: It is wrong to rewrite AR. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__AR in this case, - # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something - # similar. - AR="$am_aux_dir/ar-lib $AR" - ;; -unknown) - as_fn_error $? "could not determine $AR interface" "$LINENO" 5 - ;; -esac - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : - -fi - - - -# Mild abuse of the '--enable' option format to allow manual -# specification of setuid or setgid setup in pterm. -setidtype=none -# Check whether --enable-setuid was given. -if test "${enable_setuid+set}" = set; then : - enableval=$enable_setuid; case "$enableval" in - no) setidtype=none;; - *) setidtype=setuid; setidval="$enableval";; - esac -fi - -# Check whether --enable-setgid was given. -if test "${enable_setgid+set}" = set; then : - enableval=$enable_setgid; case "$enableval" in - no) setidtype=none;; - *) setidtype=setgid; setidval="$enableval";; - esac -fi - - if test "$setidtype" != "none"; then - HAVE_SETID_CMD_TRUE= - HAVE_SETID_CMD_FALSE='#' -else - HAVE_SETID_CMD_TRUE='#' - HAVE_SETID_CMD_FALSE= -fi - -if test "x$setidtype" = "xsetuid"; then : - SETID_CMD="chown $setidval"; SETID_MODE="4755" -fi -if test "x$setidtype" = "xsetgid"; then : - SETID_CMD="chgrp $setidval"; SETID_MODE="2755" -fi - - - -# Check whether --enable-git-commit was given. -if test "${enable_git_commit+set}" = set; then : - enableval=$enable_git_commit; -else - if test -d "$srcdir/.git"; then - enable_git_commit=yes; else enable_git_commit=no; fi -fi - - -if test "x$enable_git_commit" = "xyes" -a ! -d "$srcdir/.git"; then - as_fn_error $? "Cannot --enable-git-commit when source tree is not a git checkout" "$LINENO" 5 -fi - if test "x$enable_git_commit" = "xyes"; then - AUTO_GIT_COMMIT_TRUE= - AUTO_GIT_COMMIT_FALSE='#' -else - AUTO_GIT_COMMIT_TRUE='#' - AUTO_GIT_COMMIT_FALSE= -fi - - - -# Check whether --with-gssapi was given. -if test "${with_gssapi+set}" = set; then : - withval=$with_gssapi; -else - with_gssapi=yes -fi - - - -# Check whether --with-quartz was given. -if test "${with_quartz+set}" = set; then : - withval=$with_quartz; -$as_echo "#define OSX_GTK 1" >>confdefs.h - - with_quartz=yes -else - with_quartz=no -fi - - - if test "x$with_quartz" = "xyes"; then - HAVE_QUARTZ_TRUE= - HAVE_QUARTZ_FALSE='#' -else - HAVE_QUARTZ_TRUE='#' - HAVE_QUARTZ_FALSE= -fi - - -WITH_GSSAPI= -if test "x$with_gssapi" != xno; then : - -$as_echo "#define WITH_GSSAPI 1" >>confdefs.h - -fi - - -# Check whether --with-gtk was given. -if test "${with_gtk+set}" = set; then : - withval=$with_gtk; gtk_version_desired="$withval" -else - gtk_version_desired="any" -fi - - -case "$gtk_version_desired" in - 1 | 2 | 3 | any | no) ;; - yes) gtk_version_desired="any" ;; - *) as_fn_error $? "Invalid GTK version specified" "$LINENO" 5 -esac - -for ac_header in utmpx.h -do : - ac_fn_c_check_header_compile "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" " -#include -#include -" -if test "x$ac_cv_header_utmpx_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UTMPX_H 1 -_ACEOF - -fi - -done - - -# Look for GTK 3, GTK 2 and GTK 1, in descending order of preference. -# If we can't find any, have the makefile only build the CLI programs. - -gtk=none - -case "$gtk_version_desired:$gtk" in - 3:none | any:none) - -# Check whether --enable-gtktest was given. -if test "${enable_gtktest+set}" = set; then : - enableval=$enable_gtktest; -else - enable_gtktest=yes -fi - - min_gtk_version=3.0.0 - - pkg_config_args="gtk+-3.0 >= $min_gtk_version" - for module in . - do - case "$module" in - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - esac - done - - no_gtk="" - - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.16 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi - - if test -z "$PKG_CONFIG"; then - no_gtk=yes - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5 -$as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; } - - if test -n "$PKG_CONFIG"; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" - enable_gtktest=no - fi - - if $PKG_CONFIG $pkg_config_args; then - : - else - no_gtk=yes - fi - fi - - if test x"$no_gtk" = x ; then - GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` - GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` - gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_gtktest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" - rm -f conf.gtktest - if test "$cross_compiling" = yes; then : - echo $ac_n "cross compiling; assumed OK... $ac_c" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int -main () -{ - unsigned int major, minor, micro; - - fclose (fopen ("conf.gtktest", "w")); - - if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - exit(1); - } - - if ((gtk_major_version != $gtk_config_major_version) || - (gtk_minor_version != $gtk_config_minor_version) || - (gtk_micro_version != $gtk_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", - $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((gtk_major_version != GTK_MAJOR_VERSION) || - (gtk_minor_version != GTK_MINOR_VERSION) || - (gtk_micro_version != GTK_MICRO_VERSION)) - { - printf("*** GTK+ header files (version %d.%d.%d) do not match\n", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - } - else - { - if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n", - major, minor, micro); - printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - no_gtk=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gtk" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 -$as_echo "yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6; } - gtk=3 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test -z "$PKG_CONFIG"; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://pkgconfig.sourceforge.net" - else - if test -f conf.gtktest ; then - : - else - echo "*** Could not run GTK+ test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK+ or finding the wrong" - echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" -else - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed." -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GTK_CFLAGS="" - GTK_LIBS="" - : - fi - - - rm -f conf.gtktest - - ;; -esac - -case "$gtk_version_desired:$gtk" in - 2:none | any:none) - # Check whether --enable-gtktest was given. -if test "${enable_gtktest+set}" = set; then : - enableval=$enable_gtktest; -else - enable_gtktest=yes -fi - - - pkg_config_args=gtk+-2.0 - for module in . - do - case "$module" in - gthread) - pkg_config_args="$pkg_config_args gthread-2.0" - ;; - esac - done - - no_gtk="" - - - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.7 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi - - min_gtk_version=2.0.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5 -$as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; } - - if test x$PKG_CONFIG != xno ; then - ## don't try to run the test against uninstalled libtool libs - if $PKG_CONFIG --uninstalled $pkg_config_args; then - echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" - enable_gtktest=no - fi - - if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then - : - else - no_gtk=yes - fi - fi - - if test x"$no_gtk" = x ; then - GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` - GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` - gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_gtktest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" - rm -f conf.gtktest - if test "$cross_compiling" = yes; then : - echo $ac_n "cross compiling; assumed OK... $ac_c" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - fclose (fopen ("conf.gtktest", "w")); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - exit(1); - } - - if ((gtk_major_version != $gtk_config_major_version) || - (gtk_minor_version != $gtk_config_minor_version) || - (gtk_micro_version != $gtk_config_micro_version)) - { - printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", - $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If pkg-config was correct, then it is best\n"); - printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); - printf("*** to point to the correct configuration files\n"); - } - else if ((gtk_major_version != GTK_MAJOR_VERSION) || - (gtk_minor_version != GTK_MINOR_VERSION) || - (gtk_micro_version != GTK_MICRO_VERSION)) - { - printf("*** GTK+ header files (version %d.%d.%d) do not match\n", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - } - else - { - if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); - printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - no_gtk=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gtk" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 -$as_echo "yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6; } - gtk=2 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "$PKG_CONFIG" = "no" ; then - echo "*** A new enough version of pkg-config was not found." - echo "*** See http://pkgconfig.sourceforge.net" - else - if test -f conf.gtktest ; then - : - else - echo "*** Could not run GTK+ test program, checking why..." - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK+ or finding the wrong" - echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" -else - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GTK_CFLAGS="" - GTK_LIBS="" - : - fi - - - rm -f conf.gtktest - - ;; -esac - -case "$gtk_version_desired:$gtk" in - 1:none | any:none) - - # manual check for gtk1 - # Extract the first word of "gtk-config", so it can be a program name with args. -set dummy gtk-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GTK1_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GTK1_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_GTK1_CONFIG="$GTK1_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GTK1_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GTK1_CONFIG" && ac_cv_path_GTK1_CONFIG="absent" - ;; -esac -fi -GTK1_CONFIG=$ac_cv_path_GTK1_CONFIG -if test -n "$GTK1_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK1_CONFIG" >&5 -$as_echo "$GTK1_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$GTK1_CONFIG" != "absent"; then - GTK_CFLAGS="`"$GTK1_CONFIG" --cflags`" - GTK_LIBS=`"$GTK1_CONFIG" --libs` - - - gtk=1 - fi - - ;; -esac - -case "$gtk" in - 1) - # Add some manual #defines to make the GTK 1 headers work when - # compiling in C99 mode. Left to themselves, they'll expect the - # old-style pre-C99 GNU semantics of 'inline' and 'extern inline', - # with the effect that they'll end up defining out-of-line - # versions of the inlined functions in more than one translation - # unit and cause a link failure. Override them to 'static inline', - # which is safe. - GTK_CFLAGS="$GTK_CFLAGS -DG_INLINE_FUNC='static inline' -DG_CAN_INLINE=1" -esac - - if test "$gtk" != "none"; then - HAVE_GTK_TRUE= - HAVE_GTK_FALSE='#' -else - HAVE_GTK_TRUE='#' - HAVE_GTK_FALSE= -fi - - -if test "$gtk" = "2" -o "$gtk" = "3"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" - for ac_func in pango_font_family_is_monospace pango_font_map_list_families -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 -$as_echo_n "checking for library containing socket... " >&6; } -if ${ac_cv_search_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -for ac_lib in '' xnet; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_socket=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_socket+:} false; then : - break -fi -done -if ${ac_cv_search_socket+:} false; then : - -else - ac_cv_search_socket=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 -$as_echo "$ac_cv_search_socket" >&6; } -ac_res=$ac_cv_search_socket -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -if test "x$with_gssapi" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if ${ac_cv_search_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_dlopen+:} false; then : - break -fi -done -if ${ac_cv_search_dlopen+:} false; then : - -else - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - -$as_echo "#define NO_LIBDL 1" >>confdefs.h - - for ac_header in gssapi/gssapi.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GSSAPI_GSSAPI_H 1 -_ACEOF - -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5 -$as_echo_n "checking for library containing gss_init_sec_context... " >&6; } -if ${ac_cv_search_gss_init_sec_context+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gss_init_sec_context (); -int -main () -{ -return gss_init_sec_context (); - ; - return 0; -} -_ACEOF -for ac_lib in '' gssapi gssapi_krb5 gss; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_gss_init_sec_context=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gss_init_sec_context+:} false; then : - break -fi -done -if ${ac_cv_search_gss_init_sec_context+:} false; then : - -else - ac_cv_search_gss_init_sec_context=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5 -$as_echo "$ac_cv_search_gss_init_sec_context" >&6; } -ac_res=$ac_cv_search_gss_init_sec_context -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - -$as_echo "#define NO_GSSAPI_LIB 1" >>confdefs.h - -fi - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 -$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } -if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XOpenDisplay (); -int -main () -{ -return XOpenDisplay (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_X11_XOpenDisplay=yes -else - ac_cv_lib_X11_XOpenDisplay=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } -if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : - GTK_LIBS="-lX11 $GTK_LIBS" - -$as_echo "#define HAVE_LIBX11 /**/" >>confdefs.h - -fi - - -for ac_func in getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes setpwent endpwent getauxval elf_aux_info sysctlbyname -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -ac_fn_c_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "#include -" -if test "x$ac_cv_have_decl_CLOCK_MONOTONIC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLOCK_MONOTONIC $ac_have_decl -_ACEOF - -for ac_header in sys/auxv.h asm/hwcap.h sys/sysctl.h sys/types.h glob.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : - break -fi -done -if ${ac_cv_search_clock_gettime+:} false; then : - -else - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -$as_echo "#define HAVE_CLOCK_GETTIME /**/" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_PEERCRED and dependencies" >&5 -$as_echo_n "checking for SO_PEERCRED and dependencies... " >&6; } -if ${x_cv_linux_so_peercred+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #define _GNU_SOURCE - #include - #include - -int -main () -{ - - struct ucred cr; - socklen_t crlen = sizeof(cr); - return getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) + - cr.pid + cr.uid + cr.gid; - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - x_cv_linux_so_peercred=yes -else - x_cv_linux_so_peercred=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_cv_linux_so_peercred" >&5 -$as_echo "$x_cv_linux_so_peercred" >&6; } -if test $x_cv_linux_so_peercred = yes; then : - -$as_echo "#define HAVE_SO_PEERCRED 1" >>confdefs.h - - -fi - -if test "x$GCC" = "xyes"; then - : - WARNINGOPTS='-Wall -Wpointer-arith -Wvla' - -else - : - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pow" >&5 -$as_echo_n "checking for library containing pow... " >&6; } -if ${ac_cv_search_pow+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -for ac_lib in '' m; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_pow=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_pow+:} false; then : - break -fi -done -if ${ac_cv_search_pow+:} false; then : - -else - ac_cv_search_pow=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pow" >&5 -$as_echo "$ac_cv_search_pow" >&6; } -ac_res=$ac_cv_search_pow -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_SETID_CMD_TRUE}" && test -z "${HAVE_SETID_CMD_FALSE}"; then - as_fn_error $? "conditional \"HAVE_SETID_CMD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${AUTO_GIT_COMMIT_TRUE}" && test -z "${AUTO_GIT_COMMIT_FALSE}"; then - as_fn_error $? "conditional \"AUTO_GIT_COMMIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_QUARTZ_TRUE}" && test -z "${HAVE_QUARTZ_FALSE}"; then - as_fn_error $? "conditional \"HAVE_QUARTZ\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then - as_fn_error $? "conditional \"HAVE_GTK\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by putty $as_me 0.76, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -putty config.status 0.76 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "uxconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS uxconfig.h:uxconfig.in" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in #( - *\'*) : - eval set x "$CONFIG_FILES" ;; #( - *) : - set x $CONFIG_FILES ;; #( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -if test "$gtk_version_desired" = "no"; then cat < -#include ]) - -# Look for GTK 3, GTK 2 and GTK 1, in descending order of preference. -# If we can't find any, have the makefile only build the CLI programs. - -gtk=none - -case "$gtk_version_desired:$gtk" in - 3:none | any:none) - ifdef([AM_PATH_GTK_3_0],[AM_PATH_GTK_3_0([3.0.0], [gtk=3], [])], - [AC_WARNING([generating configure script without GTK 3 autodetection])]) - ;; -esac - -case "$gtk_version_desired:$gtk" in - 2:none | any:none) - ifdef([AM_PATH_GTK_2_0],[AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])], - [AC_WARNING([generating configure script without GTK 2 autodetection])]) - ;; -esac - -case "$gtk_version_desired:$gtk" in - 1:none | any:none) - ifdef([AM_PATH_GTK],[AM_PATH_GTK([1.2.0], [gtk=1], [])],[ - # manual check for gtk1 - AC_PATH_PROG(GTK1_CONFIG, gtk-config, absent) - if test "$GTK1_CONFIG" != "absent"; then - GTK_CFLAGS="`"$GTK1_CONFIG" --cflags`" - GTK_LIBS=`"$GTK1_CONFIG" --libs` - AC_SUBST(GTK_CFLAGS) - AC_SUBST(GTK_LIBS) - gtk=1 - fi - ]) - ;; -esac - -case "$gtk" in - 1) - # Add some manual #defines to make the GTK 1 headers work when - # compiling in C99 mode. Left to themselves, they'll expect the - # old-style pre-C99 GNU semantics of 'inline' and 'extern inline', - # with the effect that they'll end up defining out-of-line - # versions of the inlined functions in more than one translation - # unit and cause a link failure. Override them to 'static inline', - # which is safe. - GTK_CFLAGS="$GTK_CFLAGS -DG_INLINE_FUNC='static inline' -DG_CAN_INLINE=1" -esac - -AM_CONDITIONAL(HAVE_GTK, [test "$gtk" != "none"]) - -if test "$gtk" = "2" -o "$gtk" = "3"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" - AC_CHECK_FUNCS([pango_font_family_is_monospace pango_font_map_list_families]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" -fi - -AC_SEARCH_LIBS([socket], [xnet]) - -AS_IF([test "x$with_gssapi" != xno], - [AC_SEARCH_LIBS( - [dlopen],[dl], - [], - [AC_DEFINE([NO_LIBDL], [1], [Define if we could not find libdl.]) - AC_CHECK_HEADERS([gssapi/gssapi.h]) - AC_SEARCH_LIBS( - [gss_init_sec_context],[gssapi gssapi_krb5 gss], - [], - [AC_DEFINE([NO_GSSAPI_LIB], [1], [Define if we could not find a gssapi library])])])]) - -AC_CHECK_LIB(X11, XOpenDisplay, - [GTK_LIBS="-lX11 $GTK_LIBS" - AC_DEFINE([HAVE_LIBX11],[],[Define if libX11.a is available])]) - -AC_CHECK_FUNCS([getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes setpwent endpwent getauxval elf_aux_info sysctlbyname]) -AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include ]]) -AC_CHECK_HEADERS([sys/auxv.h asm/hwcap.h sys/sysctl.h sys/types.h glob.h]) -AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Define if clock_gettime() is available])]) - -AC_CACHE_CHECK([for SO_PEERCRED and dependencies], [x_cv_linux_so_peercred], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #define _GNU_SOURCE - #include - #include - ]],[[ - struct ucred cr; - socklen_t crlen = sizeof(cr); - return getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) + - cr.pid + cr.uid + cr.gid; - ]] - )], - AS_VAR_SET(x_cv_linux_so_peercred, yes), - AS_VAR_SET(x_cv_linux_so_peercred, no) - ) -]) -AS_IF([test AS_VAR_GET(x_cv_linux_so_peercred) = yes], - [AC_DEFINE([HAVE_SO_PEERCRED], [1], - [Define if SO_PEERCRED works in the Linux fashion.])] -) - -if test "x$GCC" = "xyes"; then - : - AC_SUBST(WARNINGOPTS, ['-Wall -Wpointer-arith -Wvla']) -else - : - AC_SUBST(WARNINGOPTS, []) -fi - -AC_SEARCH_LIBS([pow], [m]) - -AC_OUTPUT - -if test "$gtk_version_desired" = "no"; then cat < + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_H_ +#define LIBCBOR_H_ + +#include "cbor/common.h" +#include "cbor/data.h" + +#include "cbor/arrays.h" +#include "cbor/bytestrings.h" +#include "cbor/floats_ctrls.h" +#include "cbor/ints.h" +#include "cbor/maps.h" +#include "cbor/strings.h" +#include "cbor/tags.h" + +#include "cbor/callbacks.h" +#include "cbor/cbor_export.h" +#include "cbor/encoding.h" +#include "cbor/serialization.h" +#include "cbor/streaming.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * High level decoding + * ============================================================================ + */ + +/** Loads data item from a buffer + * + * @param source The buffer + * @param source_size + * @param result[out] Result indicator. #CBOR_ERR_NONE on success + * @return **new** CBOR item or `NULL` on failure. In that case, \p result + * contains location and description of the error. + */ +CBOR_EXPORT cbor_item_t* cbor_load(cbor_data source, size_t source_size, + struct cbor_load_result* result); + +/** Deep copy of an item + * + * All the reference counts in the new structure are set to one. + * + * @param item[borrow] item to copy + * @return **new** CBOR deep copy + */ +CBOR_EXPORT cbor_item_t* cbor_copy(cbor_item_t* item); + +#if CBOR_PRETTY_PRINTER +#include + +CBOR_EXPORT void cbor_describe(cbor_item_t* item, FILE* out); +#endif + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_H_ diff --git a/code/contrib/libfido2/include/cbor/arrays.h b/code/contrib/libfido2/include/cbor/arrays.h new file mode 100644 index 0000000..740e9b1 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/arrays.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_ARRAYS_H +#define LIBCBOR_ARRAYS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Get the number of members + * + * @param item[borrow] An array + * @return The number of members + */ +CBOR_EXPORT size_t cbor_array_size(const cbor_item_t* item); + +/** Get the size of the allocated storage + * + * @param item[borrow] An array + * @return The size of the allocated storage (number of items) + */ +CBOR_EXPORT size_t cbor_array_allocated(const cbor_item_t* item); + +/** Get item by index + * + * @param item[borrow] An array + * @param index The index + * @return **incref** The item, or `NULL` in case of boundary violation + */ +CBOR_EXPORT cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index); + +/** Set item by index + * + * If the index is out of bounds, the array is not modified and false is + * returned. Creating arrays with holes is not possible. + * + * @param item[borrow] An array + * @param value[incref] The item to assign + * @param index The index, first item is 0. + * @return true on success, false on allocation failure. + */ +CBOR_EXPORT bool cbor_array_set(cbor_item_t* item, size_t index, + cbor_item_t* value); + +/** Replace item at an index + * + * The item being replace will be #cbor_decref 'ed. + * + * @param item[borrow] An array + * @param value[incref] The item to assign + * @param index The index, first item is 0. + * @return true on success, false on allocation failure. + */ +CBOR_EXPORT bool cbor_array_replace(cbor_item_t* item, size_t index, + cbor_item_t* value); + +/** Is the array definite? + * + * @param item[borrow] An array + * @return Is the array definite? + */ +CBOR_EXPORT bool cbor_array_is_definite(const cbor_item_t* item); + +/** Is the array indefinite? + * + * @param item[borrow] An array + * @return Is the array indefinite? + */ +CBOR_EXPORT bool cbor_array_is_indefinite(const cbor_item_t* item); + +/** Get the array contents + * + * The items may be reordered and modified as long as references remain + * consistent. + * + * @param item[borrow] An array + * @return #cbor_array_size items + */ +CBOR_EXPORT cbor_item_t** cbor_array_handle(const cbor_item_t* item); + +/** Create new definite array + * + * @param size Number of slots to preallocate + * @return **new** array or `NULL` upon malloc failure + */ +CBOR_EXPORT cbor_item_t* cbor_new_definite_array(size_t size); + +/** Create new indefinite array + * + * @return **new** array or `NULL` upon malloc failure + */ +CBOR_EXPORT cbor_item_t* cbor_new_indefinite_array(); + +/** Append to the end + * + * For indefinite items, storage may be reallocated. For definite items, only + * the preallocated capacity is available. + * + * @param array[borrow] An array + * @param pushee[incref] The item to push + * @return true on success, false on failure + */ +CBOR_EXPORT bool cbor_array_push(cbor_item_t* array, cbor_item_t* pushee); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_ARRAYS_H diff --git a/code/contrib/libfido2/include/cbor/bytestrings.h b/code/contrib/libfido2/include/cbor/bytestrings.h new file mode 100644 index 0000000..1942896 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/bytestrings.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_BYTESTRINGS_H +#define LIBCBOR_BYTESTRINGS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * Byte string manipulation + * ============================================================================ + */ + +/** Returns the length of the binary data + * + * For definite byte strings only + * + * @param item[borrow] a definite bytestring + * @return length of the binary data. Zero if no chunk has been attached yet + */ +CBOR_EXPORT size_t cbor_bytestring_length(const cbor_item_t *item); + +/** Is the byte string definite? + * + * @param item[borrow] a byte string + * @return Is the byte string definite? + */ +CBOR_EXPORT bool cbor_bytestring_is_definite(const cbor_item_t *item); + +/** Is the byte string indefinite? + * + * @param item[borrow] a byte string + * @return Is the byte string indefinite? + */ +CBOR_EXPORT bool cbor_bytestring_is_indefinite(const cbor_item_t *item); + +/** Get the handle to the binary data + * + * Definite items only. Modifying the data is allowed. In that case, the caller + * takes responsibility for the effect on items this item might be a part of + * + * @param item[borrow] A definite byte string + * @return The address of the binary data. `NULL` if no data have been assigned + * yet. + */ +CBOR_EXPORT cbor_mutable_data cbor_bytestring_handle(const cbor_item_t *item); + +/** Set the handle to the binary data + * + * @param item[borrow] A definite byte string + * @param data The memory block. The caller gives up the ownership of the block. + * libcbor will deallocate it when appropriate using its free function + * @param length Length of the data block + */ +CBOR_EXPORT void cbor_bytestring_set_handle( + cbor_item_t *item, cbor_mutable_data CBOR_RESTRICT_POINTER data, + size_t length); + +/** Get the handle to the array of chunks + * + * Manipulations with the memory block (e.g. sorting it) are allowed, but the + * validity and the number of chunks must be retained. + * + * @param item[borrow] A indefinite byte string + * @return array of #cbor_bytestring_chunk_count definite bytestrings + */ +CBOR_EXPORT cbor_item_t **cbor_bytestring_chunks_handle( + const cbor_item_t *item); + +/** Get the number of chunks this string consist of + * + * @param item[borrow] A indefinite bytestring + * @return The chunk count. 0 for freshly created items. + */ +CBOR_EXPORT size_t cbor_bytestring_chunk_count(const cbor_item_t *item); + +/** Appends a chunk to the bytestring + * + * Indefinite byte strings only. + * + * May realloc the chunk storage. + * + * @param item[borrow] An indefinite byte string + * @param item[incref] A definite byte string + * @return true on success, false on realloc failure. In that case, the refcount + * of `chunk` is not increased and the `item` is left intact. + */ +CBOR_EXPORT bool cbor_bytestring_add_chunk(cbor_item_t *item, + cbor_item_t *chunk); + +/** Creates a new definite byte string + * + * The handle is initialized to `NULL` and length to 0 + * + * @return **new** definite bytestring. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_new_definite_bytestring(); + +/** Creates a new indefinite byte string + * + * The chunks array is initialized to `NULL` and chunk count to 0 + * + * @return **new** indefinite bytestring. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_new_indefinite_bytestring(); + +/** Creates a new byte string and initializes it + * + * The `handle` will be copied to a newly allocated block + * + * @param handle Block of binary data + * @param length Length of `data` + * @return A **new** byte string with content `handle`. `NULL` on malloc + * failure. + */ +CBOR_EXPORT cbor_item_t *cbor_build_bytestring(cbor_data handle, size_t length); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_BYTESTRINGS_H diff --git a/code/contrib/libfido2/include/cbor/callbacks.h b/code/contrib/libfido2/include/cbor/callbacks.h new file mode 100644 index 0000000..c7ae205 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/callbacks.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_CALLBACKS_H +#define LIBCBOR_CALLBACKS_H + +#include + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Callback prototype */ +typedef void (*cbor_int8_callback)(void *, uint8_t); + +/** Callback prototype */ +typedef void (*cbor_int16_callback)(void *, uint16_t); + +/** Callback prototype */ +typedef void (*cbor_int32_callback)(void *, uint32_t); + +/** Callback prototype */ +typedef void (*cbor_int64_callback)(void *, uint64_t); + +/** Callback prototype */ +typedef void (*cbor_simple_callback)(void *); + +/** Callback prototype */ +typedef void (*cbor_string_callback)(void *, cbor_data, uint64_t); + +/** Callback prototype */ +typedef void (*cbor_collection_callback)(void *, uint64_t); + +/** Callback prototype */ +typedef void (*cbor_float_callback)(void *, float); + +/** Callback prototype */ +typedef void (*cbor_double_callback)(void *, double); + +/** Callback prototype */ +typedef void (*cbor_bool_callback)(void *, bool); + +/** Callback bundle -- passed to the decoder */ +struct cbor_callbacks { + /** Unsigned int */ + cbor_int8_callback uint8; + /** Unsigned int */ + cbor_int16_callback uint16; + /** Unsigned int */ + cbor_int32_callback uint32; + /** Unsigned int */ + cbor_int64_callback uint64; + + /** Negative int */ + cbor_int64_callback negint64; + /** Negative int */ + cbor_int32_callback negint32; + /** Negative int */ + cbor_int16_callback negint16; + /** Negative int */ + cbor_int8_callback negint8; + + /** Definite byte string */ + cbor_simple_callback byte_string_start; + /** Indefinite byte string start */ + cbor_string_callback byte_string; + + /** Definite string */ + cbor_string_callback string; + /** Indefinite string start */ + cbor_simple_callback string_start; + + /** Definite array */ + cbor_simple_callback indef_array_start; + /** Indefinite array */ + cbor_collection_callback array_start; + + /** Definite map */ + cbor_simple_callback indef_map_start; + /** Indefinite map */ + cbor_collection_callback map_start; + + /** Tags */ + cbor_int64_callback tag; + + /** Half float */ + cbor_float_callback float2; + /** Single float */ + cbor_float_callback float4; + /** Double float */ + cbor_double_callback float8; + /** Undef */ + cbor_simple_callback undefined; + /** Null */ + cbor_simple_callback null; + /** Bool */ + cbor_bool_callback boolean; + + /** Indefinite item break */ + cbor_simple_callback indef_break; +}; + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_uint8_callback(void *, uint8_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_uint16_callback(void *, uint16_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_uint32_callback(void *, uint32_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_uint64_callback(void *, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_negint8_callback(void *, uint8_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_negint16_callback(void *, uint16_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_negint32_callback(void *, uint32_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_negint64_callback(void *, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_string_callback(void *, cbor_data, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_string_start_callback(void *); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_byte_string_callback(void *, cbor_data, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_byte_string_start_callback(void *); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_array_start_callback(void *, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_indef_array_start_callback(void *); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_map_start_callback(void *, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_indef_map_start_callback(void *); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_tag_callback(void *, uint64_t); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_float2_callback(void *, float); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_float4_callback(void *, float); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_float8_callback(void *, double); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_null_callback(void *); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_undefined_callback(void *); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_boolean_callback(void *, bool); + +/** Dummy callback implementation - does nothing */ +CBOR_EXPORT void cbor_null_indef_break_callback(void *); + +/** Dummy callback bundle - does nothing */ +CBOR_EXPORT extern const struct cbor_callbacks cbor_empty_callbacks; + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_CALLBACKS_H diff --git a/code/contrib/libfido2/include/cbor/cbor_export.h b/code/contrib/libfido2/include/cbor/cbor_export.h new file mode 100644 index 0000000..6cdde44 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/cbor_export.h @@ -0,0 +1,42 @@ + +#ifndef CBOR_EXPORT_H +#define CBOR_EXPORT_H + +#ifdef CBOR_STATIC_DEFINE +# define CBOR_EXPORT +# define CBOR_NO_EXPORT +#else +# ifndef CBOR_EXPORT +# ifdef cbor_EXPORTS + /* We are building this library */ +# define CBOR_EXPORT __declspec(dllexport) +# else + /* We are using this library */ +# define CBOR_EXPORT __declspec(dllimport) +# endif +# endif + +# ifndef CBOR_NO_EXPORT +# define CBOR_NO_EXPORT +# endif +#endif + +#ifndef CBOR_DEPRECATED +# define CBOR_DEPRECATED __declspec(deprecated) +#endif + +#ifndef CBOR_DEPRECATED_EXPORT +# define CBOR_DEPRECATED_EXPORT CBOR_EXPORT CBOR_DEPRECATED +#endif + +#ifndef CBOR_DEPRECATED_NO_EXPORT +# define CBOR_DEPRECATED_NO_EXPORT CBOR_NO_EXPORT CBOR_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef CBOR_NO_DEPRECATED +# define CBOR_NO_DEPRECATED +# endif +#endif + +#endif /* CBOR_EXPORT_H */ diff --git a/code/contrib/libfido2/include/cbor/common.h b/code/contrib/libfido2/include/cbor/common.h new file mode 100644 index 0000000..f4419e5 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/common.h @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_COMMON_H +#define LIBCBOR_COMMON_H + +#include +#include +#include +#include +#include +#include "cbor/cbor_export.h" +#include "cbor/configuration.h" +#include "data.h" + +#ifdef __cplusplus +extern "C" { + +/** + * C99 is not a subset of C++ -- 'restrict' qualifier is not a part of the + * language. This is a workaround to keep it in C headers -- compilers allow + * linking non-restrict signatures with restrict implementations. + * + * If you know a nicer way, please do let me know. + */ +#define CBOR_RESTRICT_POINTER + +#else + +// MSVC + C++ workaround +#define CBOR_RESTRICT_POINTER CBOR_RESTRICT_SPECIFIER + +#endif + +static const uint8_t cbor_major_version = CBOR_MAJOR_VERSION; +static const uint8_t cbor_minor_version = CBOR_MINOR_VERSION; +static const uint8_t cbor_patch_version = CBOR_PATCH_VERSION; + +#define CBOR_VERSION \ + _CBOR_TO_STR(CBOR_MAJOR_VERSION) \ + "." _CBOR_TO_STR(CBOR_MINOR_VERSION) "." _CBOR_TO_STR(CBOR_PATCH_VERSION) +#define CBOR_HEX_VERSION \ + ((CBOR_MAJOR_VERSION << 16) | (CBOR_MINOR_VERSION << 8) | CBOR_PATCH_VERSION) + +/* http://stackoverflow.com/questions/1644868/c-define-macro-for-debug-printing + */ +#ifdef DEBUG +#include +#define _cbor_debug_print(fmt, ...) \ + do { \ + if (DEBUG) \ + fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, __LINE__, __func__, \ + __VA_ARGS__); \ + } while (0) +#else +#define debug_print(fmt, ...) \ + do { \ + } while (0) +#endif + +#define _CBOR_TO_STR_(x) #x +#define _CBOR_TO_STR(x) _CBOR_TO_STR_(x) /* enables proper double expansion */ + +#ifdef __GNUC__ +#define _CBOR_UNUSED(x) __attribute__((__unused__)) x +#elif defined(_MSC_VER) +#define _CBOR_UNUSED(x) __pragma(warning(suppress : 4100 4101)) x +#else +#define _CBOR_UNUSED(x) x +#endif + +// Macro to short-circuit builder functions when memory allocation fails +#define _CBOR_NOTNULL(cbor_item) \ + do { \ + if (cbor_item == NULL) { \ + return NULL; \ + } \ + } while (0) + +// Macro to short-circuit builders when memory allocation of nested data fails +#define _CBOR_DEPENDENT_NOTNULL(cbor_item, pointer) \ + do { \ + if (pointer == NULL) { \ + _CBOR_FREE(cbor_item); \ + return NULL; \ + } \ + } while (0) + +#if CBOR_CUSTOM_ALLOC + +typedef void *(*_cbor_malloc_t)(size_t); +typedef void *(*_cbor_realloc_t)(void *, size_t); +typedef void (*_cbor_free_t)(void *); + +CBOR_EXPORT extern _cbor_malloc_t _cbor_malloc; +CBOR_EXPORT extern _cbor_realloc_t _cbor_realloc; +CBOR_EXPORT extern _cbor_free_t _cbor_free; + +/** Sets the memory management routines to use. + * + * Only available when `CBOR_CUSTOM_ALLOC` is truthy + * + * \rst + * .. warning:: This function modifies the global state and should therefore be + * used accordingly. Changing the memory handlers while allocated items exist + * will result in a ``free``/``malloc`` mismatch. This function is not thread + * safe with respect to both itself and all the other *libcbor* functions that + * work with the heap. + * + * .. note:: `realloc` implementation must correctly support `NULL` reallocation + * (see e.g. http://en.cppreference.com/w/c/memory/realloc) + * \endrst + * + * @param custom_malloc malloc implementation + * @param custom_realloc realloc implementation + * @param custom_free free implementation + */ +CBOR_EXPORT void cbor_set_allocs(_cbor_malloc_t custom_malloc, + _cbor_realloc_t custom_realloc, + _cbor_free_t custom_free); + +#define _CBOR_MALLOC _cbor_malloc +#define _CBOR_REALLOC _cbor_realloc +#define _CBOR_FREE _cbor_free + +#else + +#define _CBOR_MALLOC malloc +#define _CBOR_REALLOC realloc +#define _CBOR_FREE free + +#endif + +/* + * ============================================================================ + * Type manipulation + * ============================================================================ + */ + +/** Get the type of the item + * + * @param item[borrow] + * @return The type + */ +CBOR_EXPORT cbor_type cbor_typeof( + const cbor_item_t *item); /* Will be inlined iff link-time opt is enabled */ + +/* Standard item types as described by the RFC */ + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item an #CBOR_TYPE_UINT? + */ +CBOR_EXPORT bool cbor_isa_uint(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_NEGINT? + */ +CBOR_EXPORT bool cbor_isa_negint(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_BYTESTRING? + */ +CBOR_EXPORT bool cbor_isa_bytestring(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_STRING? + */ +CBOR_EXPORT bool cbor_isa_string(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item an #CBOR_TYPE_ARRAY? + */ +CBOR_EXPORT bool cbor_isa_array(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_MAP? + */ +CBOR_EXPORT bool cbor_isa_map(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_TAG? + */ +CBOR_EXPORT bool cbor_isa_tag(const cbor_item_t *item); + +/** Does the item have the appropriate major type? + * @param item[borrow] the item + * @return Is the item a #CBOR_TYPE_FLOAT_CTRL? + */ +CBOR_EXPORT bool cbor_isa_float_ctrl(const cbor_item_t *item); + +/* Practical types with respect to their semantics (but not tag values) */ + +/** Is the item an integer, either positive or negative? + * @param item[borrow] the item + * @return Is the item an integer, either positive or negative? + */ +CBOR_EXPORT bool cbor_is_int(const cbor_item_t *item); + +/** Is the item an a floating point number? + * @param item[borrow] the item + * @return Is the item a floating point number? + */ +CBOR_EXPORT bool cbor_is_float(const cbor_item_t *item); + +/** Is the item an a boolean? + * @param item[borrow] the item + * @return Is the item a boolean? + */ +CBOR_EXPORT bool cbor_is_bool(const cbor_item_t *item); + +/** Does this item represent `null` + * + * \rst + * .. warning:: This is in no way related to the value of the pointer. Passing a + * null pointer will most likely result in a crash. + * \endrst + * + * @param item[borrow] the item + * @return Is the item (CBOR logical) null? + */ +CBOR_EXPORT bool cbor_is_null(const cbor_item_t *item); + +/** Does this item represent `undefined` + * + * \rst + * .. warning:: Care must be taken to distinguish nulls and undefined values in + * C. + * \endrst + * + * @param item[borrow] the item + * @return Is the item (CBOR logical) undefined? + */ +CBOR_EXPORT bool cbor_is_undef(const cbor_item_t *item); + +/* + * ============================================================================ + * Memory management + * ============================================================================ + */ + +/** Increases the reference count by one + * + * No dependent items are affected. + * + * @param item[incref] item the item + * @return the input reference + */ +CBOR_EXPORT cbor_item_t *cbor_incref(cbor_item_t *item); + +/** Decreases the reference count by one, deallocating the item if needed + * + * In case the item is deallocated, the reference count of any dependent items + * is adjusted accordingly in a recursive manner. + * + * @param item[take] the item. Set to `NULL` if deallocated + */ +CBOR_EXPORT void cbor_decref(cbor_item_t **item); + +/** Decreases the reference count by one, deallocating the item if needed + * + * Convenience wrapper for #cbor_decref when its set-to-null behavior is not + * needed + * + * @param item[take] the item + */ +CBOR_EXPORT void cbor_intermediate_decref(cbor_item_t *item); + +/** Get the reference count + * + * \rst + * .. warning:: This does *not* account for transitive references. + * \endrst + * + * @param item[borrow] the item + * @return the reference count + */ +CBOR_EXPORT size_t cbor_refcount(const cbor_item_t *item); + +/** Provides CPP-like move construct + * + * Decreases the reference count by one, but does not deallocate the item even + * if its refcount reaches zero. This is useful for passing intermediate values + * to functions that increase reference count. Should only be used with + * functions that `incref` their arguments. + * + * \rst + * .. warning:: If the item is moved without correctly increasing the reference + * count afterwards, the memory will be leaked. + * \endrst + * + * @param item[take] the item + * @return the item with reference count decreased by one + */ +CBOR_EXPORT cbor_item_t *cbor_move(cbor_item_t *item); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_COMMON_H diff --git a/code/contrib/libfido2/include/cbor/configuration.h b/code/contrib/libfido2/include/cbor/configuration.h new file mode 100644 index 0000000..cf27a37 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/configuration.h @@ -0,0 +1,16 @@ +#ifndef LIBCBOR_CONFIGURATION_H +#define LIBCBOR_CONFIGURATION_H + +#define CBOR_MAJOR_VERSION 0 +#define CBOR_MINOR_VERSION 9 +#define CBOR_PATCH_VERSION 0 + +#define CBOR_CUSTOM_ALLOC 0 +#define CBOR_BUFFER_GROWTH 2 +#define CBOR_MAX_STACK_SIZE 2048 +#define CBOR_PRETTY_PRINTER 1 + +#define CBOR_RESTRICT_SPECIFIER +#define CBOR_INLINE_SPECIFIER + +#endif //LIBCBOR_CONFIGURATION_H diff --git a/code/contrib/libfido2/include/cbor/data.h b/code/contrib/libfido2/include/cbor/data.h new file mode 100644 index 0000000..a12e92f --- /dev/null +++ b/code/contrib/libfido2/include/cbor/data.h @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_DATA_H +#define LIBCBOR_DATA_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef const unsigned char* cbor_data; +typedef unsigned char* cbor_mutable_data; + +/** Specifies the Major type of ::cbor_item_t */ +typedef enum cbor_type { + CBOR_TYPE_UINT /** 0 - positive integers */ + , + CBOR_TYPE_NEGINT /** 1 - negative integers*/ + , + CBOR_TYPE_BYTESTRING /** 2 - byte strings */ + , + CBOR_TYPE_STRING /** 3 - strings */ + , + CBOR_TYPE_ARRAY /** 4 - arrays */ + , + CBOR_TYPE_MAP /** 5 - maps */ + , + CBOR_TYPE_TAG /** 6 - tags */ + , + CBOR_TYPE_FLOAT_CTRL /** 7 - decimals and special values (true, false, nil, + ...) */ +} cbor_type; + +/** Possible decoding errors */ +typedef enum { + CBOR_ERR_NONE, + CBOR_ERR_NOTENOUGHDATA, + CBOR_ERR_NODATA, + // TODO: Should be "malformed" or at least "malformatted". Retained for + // backwards compatibility. + CBOR_ERR_MALFORMATED, + CBOR_ERR_MEMERROR /** Memory error - item allocation failed. Is it too big for + your allocator? */ + , + CBOR_ERR_SYNTAXERROR /** Stack parsing algorithm failed */ +} cbor_error_code; + +/** Possible widths of #CBOR_TYPE_UINT items */ +typedef enum { + CBOR_INT_8, + CBOR_INT_16, + CBOR_INT_32, + CBOR_INT_64 +} cbor_int_width; + +/** Possible widths of #CBOR_TYPE_FLOAT_CTRL items */ +typedef enum { + CBOR_FLOAT_0 /** Internal use - ctrl and special values */ + , + CBOR_FLOAT_16 /** Half float */ + , + CBOR_FLOAT_32 /** Single float */ + , + CBOR_FLOAT_64 /** Double */ +} cbor_float_width; + +/** Metadata for dynamically sized types */ +typedef enum { + _CBOR_METADATA_DEFINITE, + _CBOR_METADATA_INDEFINITE +} _cbor_dst_metadata; + +/** Semantic mapping for CTRL simple values */ +typedef enum { + CBOR_CTRL_NONE = 0, + CBOR_CTRL_FALSE = 20, + CBOR_CTRL_TRUE = 21, + CBOR_CTRL_NULL = 22, + CBOR_CTRL_UNDEF = 23 +} _cbor_ctrl; + +// Metadata items use size_t (instead of uint64_t) because items in memory take +// up at least 1B per entry or string byte, so if size_t is narrower than +// uint64_t, we wouldn't be able to create them in the first place and can save +// some space. + +/** Integers specific metadata */ +struct _cbor_int_metadata { + cbor_int_width width; +}; + +/** Bytestrings specific metadata */ +struct _cbor_bytestring_metadata { + size_t length; + _cbor_dst_metadata type; +}; + +/** Strings specific metadata */ +struct _cbor_string_metadata { + size_t length; + size_t codepoint_count; /* Sum of chunks' codepoint_counts for indefinite + strings */ + _cbor_dst_metadata type; +}; + +/** Arrays specific metadata */ +struct _cbor_array_metadata { + size_t allocated; + size_t end_ptr; + _cbor_dst_metadata type; +}; + +/** Maps specific metadata */ +struct _cbor_map_metadata { + size_t allocated; + size_t end_ptr; + _cbor_dst_metadata type; +}; + +/** Arrays specific metadata + * + * The pointer is included - cbor_item_metadata is + * 2 * sizeof(size_t) + sizeof(_cbor_string_type_metadata), + * lets use the space + */ +struct _cbor_tag_metadata { + struct cbor_item_t* tagged_item; + uint64_t value; +}; + +/** Floats specific metadata - includes CTRL values */ +struct _cbor_float_ctrl_metadata { + cbor_float_width width; + uint8_t ctrl; +}; + +/** Raw memory casts helper */ +union _cbor_float_helper { + float as_float; + uint32_t as_uint; +}; + +/** Raw memory casts helper */ +union _cbor_double_helper { + double as_double; + uint64_t as_uint; +}; + +/** Union of metadata across all possible types - discriminated in #cbor_item_t + */ +union cbor_item_metadata { + struct _cbor_int_metadata int_metadata; + struct _cbor_bytestring_metadata bytestring_metadata; + struct _cbor_string_metadata string_metadata; + struct _cbor_array_metadata array_metadata; + struct _cbor_map_metadata map_metadata; + struct _cbor_tag_metadata tag_metadata; + struct _cbor_float_ctrl_metadata float_ctrl_metadata; +}; + +/** The item handle */ +typedef struct cbor_item_t { + /** Discriminated by type */ + union cbor_item_metadata metadata; + /** Reference count - initialize to 0 */ + size_t refcount; + /** Major type discriminator */ + cbor_type type; + /** Raw data block - interpretation depends on metadata */ + unsigned char* data; +} cbor_item_t; + +/** Defines cbor_item_t#data structure for indefinite strings and bytestrings + * + * Used to cast the raw representation for a sane manipulation + */ +struct cbor_indefinite_string_data { + size_t chunk_count; + size_t chunk_capacity; + cbor_item_t** chunks; +}; + +/** High-level decoding error */ +struct cbor_error { + /** Approximate position */ + size_t position; + /** Description */ + cbor_error_code code; +}; + +/** Simple pair of items for use in maps */ +struct cbor_pair { + cbor_item_t *key, *value; +}; + +/** High-level decoding result */ +struct cbor_load_result { + /** Error indicator */ + struct cbor_error error; + /** Number of bytes read */ + size_t read; +}; + +/** Streaming decoder result - status */ +enum cbor_decoder_status { + /** Decoding finished successfully (a callback has been invoked) + * + * Note that this does *not* mean that the buffer has been fully decoded; + * there may still be unread bytes for which no callback has been involved. + */ + CBOR_DECODER_FINISHED, + /** Not enough data to invoke a callback */ + // TODO: The name is inconsistent with CBOR_ERR_NOTENOUGHDATA. Retained for + // backwards compatibility. + CBOR_DECODER_NEDATA, + /** Bad data (reserved MTB, malformed value, etc.) */ + CBOR_DECODER_ERROR +}; + +/** Streaming decoder result */ +struct cbor_decoder_result { + /** Input bytes read/consumed + * + * If this is less than the size of input buffer, the client will likely + * resume parsing starting at the next byte (e.g. `buffer + result.read`). + * + * Set to 0 if the #status is not #CBOR_DECODER_FINISHED. + */ + size_t read; + + /** The decoding status */ + enum cbor_decoder_status status; + + /** Number of bytes in the input buffer needed to resume parsing + * + * Set to 0 unless the result status is #CBOR_DECODER_NEDATA. If it is, then: + * - If at least one byte was passed, #required will be set to the minimum + * number of bytes needed to invoke a decoded callback on the current + * prefix. + * + * For example: Attempting to decode a 1B buffer containing `0x19` will + * set #required to 3 as `0x19` signals a 2B integer item, so we need at + * least 3B to continue (the `0x19` MTB byte and two bytes of data needed + * to invoke #cbor_callbacks.uint16). + * + * - If there was no data at all, #read will always be set to 1 + */ + size_t required; +}; + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_DATA_H diff --git a/code/contrib/libfido2/include/cbor/encoding.h b/code/contrib/libfido2/include/cbor/encoding.h new file mode 100644 index 0000000..7446e14 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/encoding.h @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_ENCODING_H +#define LIBCBOR_ENCODING_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * All cbor_encode_* methods take 2 or 3 arguments: + * - a logical `value` to encode (except for trivial items such as NULLs) + * - an output `buffer` pointer + * - a `buffer_size` specification + * + * They serialize the `value` into one or more bytes and write the bytes to the + * output `buffer` and return either the number of bytes written, or 0 if the + * `buffer_size` was too small to small to fit the serialized value (in which + * case it is not modified). + */ + +CBOR_EXPORT size_t cbor_encode_uint8(uint8_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_uint16(uint16_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_uint32(uint32_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_uint64(uint64_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_uint(uint64_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_negint8(uint8_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_negint16(uint16_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_negint32(uint32_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_negint64(uint64_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_negint(uint64_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_bytestring_start(size_t, unsigned char *, + size_t); + +CBOR_EXPORT size_t cbor_encode_indef_bytestring_start(unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_string_start(size_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_indef_string_start(unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_array_start(size_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_indef_array_start(unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_map_start(size_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_indef_map_start(unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_tag(uint64_t, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_bool(bool, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_null(unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_undef(unsigned char *, size_t); + +/** Encodes a half-precision float + * + * Since there is no native representation or semantics for half floats + * in the language, we use single-precision floats, as every value that + * can be expressed as a half-float can also be expressed as a float. + * + * This however means that not all floats passed to this function can be + * unambiguously encoded. The behavior is as follows: + * - Infinity, NaN are preserved + * - Zero is preserved + * - Denormalized numbers keep their sign bit and 10 most significant bit of + * the significand + * - All other numbers + * - If the logical value of the exponent is < -24, the output is zero + * - If the logical value of the exponent is between -23 and -14, the output + * is cut off to represent the 'magnitude' of the input, by which we + * mean (-1)^{signbit} x 1.0e{exponent}. The value in the significand is + * lost. + * - In all other cases, the sign bit, the exponent, and 10 most significant + * bits of the significand are kept + */ +CBOR_EXPORT size_t cbor_encode_half(float, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_single(float, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_double(double, unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_break(unsigned char *, size_t); + +CBOR_EXPORT size_t cbor_encode_ctrl(uint8_t, unsigned char *, size_t); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_ENCODING_H diff --git a/code/contrib/libfido2/include/cbor/floats_ctrls.h b/code/contrib/libfido2/include/cbor/floats_ctrls.h new file mode 100644 index 0000000..4b1ce59 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/floats_ctrls.h @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_FLOATS_CTRLS_H +#define LIBCBOR_FLOATS_CTRLS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * Float manipulation + * ============================================================================ + */ + +/** Is this a ctrl value? + * + * @param item[borrow] A float or ctrl item + * @return Is this a ctrl value? + */ +CBOR_EXPORT bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item); + +/** Get the float width + * + * @param item[borrow] A float or ctrl item + * @return The width. + */ +CBOR_EXPORT cbor_float_width cbor_float_get_width(const cbor_item_t *item); + +/** Get a half precision float + * + * The item must have the corresponding width + * + * @param[borrow] A half precision float + * @return half precision value + */ +CBOR_EXPORT float cbor_float_get_float2(const cbor_item_t *item); + +/** Get a single precision float + * + * The item must have the corresponding width + * + * @param[borrow] A single precision float + * @return single precision value + */ +CBOR_EXPORT float cbor_float_get_float4(const cbor_item_t *item); + +/** Get a double precision float + * + * The item must have the corresponding width + * + * @param[borrow] A double precision float + * @return double precision value + */ +CBOR_EXPORT double cbor_float_get_float8(const cbor_item_t *item); + +/** Get the float value represented as double + * + * Can be used regardless of the width. + * + * @param[borrow] Any float + * @return double precision value + */ +CBOR_EXPORT double cbor_float_get_float(const cbor_item_t *item); + +/** Get value from a boolean ctrl item + * + * @param item[borrow] A ctrl item + * @return boolean value + */ +CBOR_EXPORT bool cbor_get_bool(const cbor_item_t *item); + +/** Constructs a new ctrl item + * + * The width cannot be changed once the item is created + * + * @return **new** 1B ctrl or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_ctrl(); + +/** Constructs a new float item + * + * The width cannot be changed once the item is created + * + * @return **new** 2B float or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_float2(); + +/** Constructs a new float item + * + * The width cannot be changed once the item is created + * + * @return **new** 4B float or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_float4(); + +/** Constructs a new float item + * + * The width cannot be changed once the item is created + * + * @return **new** 8B float or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_float8(); + +/** Constructs new null ctrl item + * + * @return **new** null ctrl item or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_null(); + +/** Constructs new undef ctrl item + * + * @return **new** undef ctrl item or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_undef(); + +/** Constructs new boolean ctrl item + * + * @param value The value to use + * @return **new** boolean ctrl item or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_bool(bool value); + +/** Assign a control value + * + * \rst + * .. warning:: It is possible to produce an invalid CBOR value by assigning a + * invalid value using this mechanism. Please consult the standard before use. + * \endrst + * + * @param item[borrow] A ctrl item + * @param value The simple value to assign. Please consult the standard for + * allowed values + */ +CBOR_EXPORT void cbor_set_ctrl(cbor_item_t *item, uint8_t value); + +/** Assign a boolean value to a boolean ctrl item + * + * @param item[borrow] A ctrl item + * @param value The simple value to assign. + */ +CBOR_EXPORT void cbor_set_bool(cbor_item_t *item, bool value); + +/** Assigns a float value + * + * @param item[borrow] A half precision float + * @param value The value to assign + */ +CBOR_EXPORT void cbor_set_float2(cbor_item_t *item, float value); + +/** Assigns a float value + * + * @param item[borrow] A single precision float + * @param value The value to assign + */ +CBOR_EXPORT void cbor_set_float4(cbor_item_t *item, float value); + +/** Assigns a float value + * + * @param item[borrow] A double precision float + * @param value The value to assign + */ +CBOR_EXPORT void cbor_set_float8(cbor_item_t *item, double value); + +/** Reads the control value + * + * @param item[borrow] A ctrl item + * @return the simple value + */ +CBOR_EXPORT uint8_t cbor_ctrl_value(const cbor_item_t *item); + +/** Constructs a new float + * + * @param value the value to use + * @return **new** float + */ +CBOR_EXPORT cbor_item_t *cbor_build_float2(float value); + +/** Constructs a new float + * + * @param value the value to use + * @return **new** float or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_float4(float value); + +/** Constructs a new float + * + * @param value the value to use + * @return **new** float or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_float8(double value); + +/** Constructs a ctrl item + * + * @param value the value to use + * @return **new** ctrl item or `NULL` upon memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_ctrl(uint8_t value); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_FLOATS_CTRLS_H diff --git a/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h b/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h new file mode 100644 index 0000000..4776435 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_BUILDER_CALLBACKS_H +#define LIBCBOR_BUILDER_CALLBACKS_H + +#include "../callbacks.h" +#include "cbor/common.h" +#include "stack.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** High-level decoding context */ +struct _cbor_decoder_context { + /** Callback creating the last item has failed */ + bool creation_failed; + /** Stack expectation mismatch */ + bool syntax_error; + cbor_item_t *root; + struct _cbor_stack *stack; +}; + +void cbor_builder_uint8_callback(void *, uint8_t); + +void cbor_builder_uint16_callback(void *, uint16_t); + +void cbor_builder_uint32_callback(void *, uint32_t); + +void cbor_builder_uint64_callback(void *, uint64_t); + +void cbor_builder_negint8_callback(void *, uint8_t); + +void cbor_builder_negint16_callback(void *, uint16_t); + +void cbor_builder_negint32_callback(void *, uint32_t); + +void cbor_builder_negint64_callback(void *, uint64_t); + +void cbor_builder_string_callback(void *, cbor_data, uint64_t); + +void cbor_builder_string_start_callback(void *); + +void cbor_builder_byte_string_callback(void *, cbor_data, uint64_t); + +void cbor_builder_byte_string_start_callback(void *); + +void cbor_builder_array_start_callback(void *, uint64_t); + +void cbor_builder_indef_array_start_callback(void *); + +void cbor_builder_map_start_callback(void *, uint64_t); + +void cbor_builder_indef_map_start_callback(void *); + +void cbor_builder_tag_callback(void *, uint64_t); + +void cbor_builder_float2_callback(void *, float); + +void cbor_builder_float4_callback(void *, float); + +void cbor_builder_float8_callback(void *, double); + +void cbor_builder_null_callback(void *); + +void cbor_builder_undefined_callback(void *); + +void cbor_builder_boolean_callback(void *, bool); + +void cbor_builder_indef_break_callback(void *); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_BUILDER_CALLBACKS_H diff --git a/code/contrib/libfido2/include/cbor/internal/encoders.h b/code/contrib/libfido2/include/cbor/internal/encoders.h new file mode 100644 index 0000000..14ad501 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/internal/encoders.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_ENCODERS_H +#define LIBCBOR_ENCODERS_H + +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +size_t _cbor_encode_uint8(uint8_t value, unsigned char *buffer, + size_t buffer_size, uint8_t offset); + +size_t _cbor_encode_uint16(uint16_t value, unsigned char *buffer, + size_t buffer_size, uint8_t offset); + +size_t _cbor_encode_uint32(uint32_t value, unsigned char *buffer, + size_t buffer_size, uint8_t offset); + +size_t _cbor_encode_uint64(uint64_t value, unsigned char *buffer, + size_t buffer_size, uint8_t offset); + +size_t _cbor_encode_uint(uint64_t value, unsigned char *buffer, + size_t buffer_size, uint8_t offset); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_ENCODERS_H diff --git a/code/contrib/libfido2/include/cbor/internal/loaders.h b/code/contrib/libfido2/include/cbor/internal/loaders.h new file mode 100644 index 0000000..c8fb918 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/internal/loaders.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_LOADERS_H +#define LIBCBOR_LOADERS_H + +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Read the given uint from the given location, no questions asked */ +uint8_t _cbor_load_uint8(const unsigned char *source); + +uint16_t _cbor_load_uint16(const unsigned char *source); + +uint32_t _cbor_load_uint32(const unsigned char *source); + +uint64_t _cbor_load_uint64(const unsigned char *source); + +float _cbor_load_half(cbor_data source); + +float _cbor_load_float(cbor_data source); + +double _cbor_load_double(cbor_data source); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_LOADERS_H diff --git a/code/contrib/libfido2/include/cbor/internal/memory_utils.h b/code/contrib/libfido2/include/cbor/internal/memory_utils.h new file mode 100644 index 0000000..c41ace6 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/internal/memory_utils.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_MEMORY_UTILS_H +#define LIBCBOR_MEMORY_UTILS_H + +#include +#include + +/** Can a and b be multiplied without overflowing size_t? */ +bool _cbor_safe_to_multiply(size_t a, size_t b); + +/** Overflow-proof contiguous array allocation + * + * @param item_size + * @param item_count + * @return Region of item_size * item_count bytes, or NULL if the total size + * overflows size_t or the underlying allocator failed + */ +void* _cbor_alloc_multiple(size_t item_size, size_t item_count); + +/** Overflow-proof contiguous array reallocation + * + * This implements the OpenBSD `reallocarray` functionality. + * + * @param pointer + * @param item_size + * @param item_count + * @return Realloc'd of item_size * item_count bytes, or NULL if the total size + * overflows size_t or the underlying allocator failed + */ +void* _cbor_realloc_multiple(void* pointer, size_t item_size, + size_t item_count); + +#endif // LIBCBOR_MEMORY_UTILS_H diff --git a/code/contrib/libfido2/include/cbor/internal/stack.h b/code/contrib/libfido2/include/cbor/internal/stack.h new file mode 100644 index 0000000..42ed044 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/internal/stack.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_STACK_H +#define LIBCBOR_STACK_H + +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Simple stack record for the parser */ +struct _cbor_stack_record { + struct _cbor_stack_record *lower; + cbor_item_t *item; + size_t subitems; +}; + +/** Stack handle - contents and size */ +struct _cbor_stack { + struct _cbor_stack_record *top; + size_t size; +}; + +struct _cbor_stack _cbor_stack_init(); + +void _cbor_stack_pop(struct _cbor_stack *); + +struct _cbor_stack_record *_cbor_stack_push(struct _cbor_stack *, cbor_item_t *, + size_t); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_STACK_H diff --git a/code/contrib/libfido2/include/cbor/internal/unicode.h b/code/contrib/libfido2/include/cbor/internal/unicode.h new file mode 100644 index 0000000..0d26619 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/internal/unicode.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_UNICODE_H +#define LIBCBOR_UNICODE_H + +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum _cbor_unicode_status_error { _CBOR_UNICODE_OK, _CBOR_UNICODE_BADCP }; + +/** Signals unicode validation error and possibly its location */ +struct _cbor_unicode_status { + enum _cbor_unicode_status_error status; + uint64_t location; +}; + +uint64_t _cbor_unicode_codepoint_count(cbor_data source, uint64_t source_length, + struct _cbor_unicode_status* status); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_UNICODE_H diff --git a/code/contrib/libfido2/include/cbor/ints.h b/code/contrib/libfido2/include/cbor/ints.h new file mode 100644 index 0000000..fc7de60 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/ints.h @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_INTS_H +#define LIBCBOR_INTS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * Integer (uints and negints) manipulation + * ============================================================================ + */ + +/** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +CBOR_EXPORT uint8_t cbor_get_uint8(const cbor_item_t *item); + +/** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +CBOR_EXPORT uint16_t cbor_get_uint16(const cbor_item_t *item); + +/** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +CBOR_EXPORT uint32_t cbor_get_uint32(const cbor_item_t *item); + +/** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value + */ +CBOR_EXPORT uint64_t cbor_get_uint64(const cbor_item_t *item); + +/** Extracts the integer value + * + * @param item[borrow] positive or negative integer + * @return the value, extended to `uint64_t` + */ +CBOR_EXPORT uint64_t cbor_get_int(const cbor_item_t *item); + +/** Assigns the integer value + * + * @param item[borrow] positive or negative integer item + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +CBOR_EXPORT void cbor_set_uint8(cbor_item_t *item, uint8_t value); + +/** Assigns the integer value + * + * @param item[borrow] positive or negative integer item + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +CBOR_EXPORT void cbor_set_uint16(cbor_item_t *item, uint16_t value); + +/** Assigns the integer value + * + * @param item[borrow] positive or negative integer item + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +CBOR_EXPORT void cbor_set_uint32(cbor_item_t *item, uint32_t value); + +/** Assigns the integer value + * + * @param item[borrow] positive or negative integer item + * @param value the value to assign. For negative integer, the logical value is + * `-value - 1` + */ +CBOR_EXPORT void cbor_set_uint64(cbor_item_t *item, uint64_t value); + +/** Queries the integer width + * + * @param item[borrow] positive or negative integer item + * @return the width + */ +CBOR_EXPORT cbor_int_width cbor_int_get_width(const cbor_item_t *item); + +/** Marks the integer item as a positive integer + * + * The data value is not changed + * + * @param item[borrow] positive or negative integer item + */ +CBOR_EXPORT void cbor_mark_uint(cbor_item_t *item); + +/** Marks the integer item as a negative integer + * + * The data value is not changed + * + * @param item[borrow] positive or negative integer item + */ +CBOR_EXPORT void cbor_mark_negint(cbor_item_t *item); + +/** Allocates new integer with 1B width + * + * The width cannot be changed once allocated + * + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +CBOR_EXPORT cbor_item_t *cbor_new_int8(); + +/** Allocates new integer with 2B width + * + * The width cannot be changed once allocated + * + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +CBOR_EXPORT cbor_item_t *cbor_new_int16(); + +/** Allocates new integer with 4B width + * + * The width cannot be changed once allocated + * + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +CBOR_EXPORT cbor_item_t *cbor_new_int32(); + +/** Allocates new integer with 8B width + * + * The width cannot be changed once allocated + * + * @return **new** positive integer or `NULL` on memory allocation failure. The + * value is not initialized + */ +CBOR_EXPORT cbor_item_t *cbor_new_int64(); + +/** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_uint8(uint8_t value); + +/** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_uint16(uint16_t value); + +/** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_uint32(uint32_t value); + +/** Constructs a new positive integer + * + * @param value the value to use + * @return **new** positive integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_uint64(uint64_t value); + +/** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_negint8(uint8_t value); + +/** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_negint16(uint16_t value); + +/** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_negint32(uint32_t value); + +/** Constructs a new negative integer + * + * @param value the value to use + * @return **new** negative integer or `NULL` on memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_build_negint64(uint64_t value); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_INTS_H diff --git a/code/contrib/libfido2/include/cbor/maps.h b/code/contrib/libfido2/include/cbor/maps.h new file mode 100644 index 0000000..05ce545 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/maps.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_MAPS_H +#define LIBCBOR_MAPS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * Map manipulation + * ============================================================================ + */ + +/** Get the number of pairs + * + * @param item[borrow] A map + * @return The number of pairs + */ +CBOR_EXPORT size_t cbor_map_size(const cbor_item_t *item); + +/** Get the size of the allocated storage + * + * @param item[borrow] A map + * @return Allocated storage size (as the number of #cbor_pair items) + */ +CBOR_EXPORT size_t cbor_map_allocated(const cbor_item_t *item); + +/** Create a new definite map + * + * @param size The number of slots to preallocate + * @return **new** definite map. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_new_definite_map(size_t size); + +/** Create a new indefinite map + * + * @param size The number of slots to preallocate + * @return **new** definite map. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_new_indefinite_map(); + +/** Add a pair to the map + * + * For definite maps, items can only be added to the preallocated space. For + * indefinite maps, the storage will be expanded as needed + * + * @param item[borrow] A map + * @param pair[incref] The key-value pair to add (incref is member-wise) + * @return `true` on success, `false` if either reallocation failed or the + * preallocated storage is full + */ +CBOR_EXPORT bool cbor_map_add(cbor_item_t *item, struct cbor_pair pair); + +/** Add a key to the map + * + * Sets the value to `NULL`. Internal API. + * + * @param item[borrow] A map + * @param key[incref] The key + * @return `true` on success, `false` if either reallocation failed or the + * preallocated storage is full + */ +CBOR_EXPORT bool _cbor_map_add_key(cbor_item_t *item, cbor_item_t *key); + +/** Add a value to the map + * + * Assumes that #_cbor_map_add_key has been called. Internal API. + * + * @param item[borrow] A map + * @param key[incref] The value + * @return `true` on success, `false` if either reallocation failed or the + * preallocated storage is full + */ +CBOR_EXPORT bool _cbor_map_add_value(cbor_item_t *item, cbor_item_t *value); + +/** Is this map definite? + * + * @param item[borrow] A map + * @return Is this map definite? + */ +CBOR_EXPORT bool cbor_map_is_definite(const cbor_item_t *item); + +/** Is this map indefinite? + * + * @param item[borrow] A map + * @return Is this map indefinite? + */ +CBOR_EXPORT bool cbor_map_is_indefinite(const cbor_item_t *item); + +/** Get the pairs storage + * + * @param item[borrow] A map + * @return Array of #cbor_map_size pairs. Manipulation is possible as long as + * references remain valid. + */ +CBOR_EXPORT struct cbor_pair *cbor_map_handle(const cbor_item_t *item); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_MAPS_H diff --git a/code/contrib/libfido2/include/cbor/serialization.h b/code/contrib/libfido2/include/cbor/serialization.h new file mode 100644 index 0000000..d63815e --- /dev/null +++ b/code/contrib/libfido2/include/cbor/serialization.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_SERIALIZATION_H +#define LIBCBOR_SERIALIZATION_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * High level encoding + * ============================================================================ + */ + +/** Serialize the given item + * + * @param item[borrow] A data item + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize(const cbor_item_t *item, + cbor_mutable_data buffer, size_t buffer_size); + +/** Serialize the given item, allocating buffers as needed + * + * \rst + * .. warning:: It is your responsibility to free the buffer using an + * appropriate ``free`` implementation. + * \endrst + * + * @param item[borrow] A data item + * @param buffer[out] Buffer containing the result + * @param buffer_size[out] Size of the \p buffer + * @return Length of the result. 0 on failure, in which case \p buffer is + * ``NULL``. + */ +CBOR_EXPORT size_t cbor_serialize_alloc(const cbor_item_t *item, + cbor_mutable_data *buffer, + size_t *buffer_size); + +/** Serialize an uint + * + * @param item[borrow] A uint + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data, + size_t); + +/** Serialize a negint + * + * @param item[borrow] A negint + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data, + size_t); + +/** Serialize a bytestring + * + * @param item[borrow] A bytestring + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_bytestring(const cbor_item_t *, + cbor_mutable_data, size_t); + +/** Serialize a string + * + * @param item[borrow] A string + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data, + size_t); + +/** Serialize an array + * + * @param item[borrow] An array + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data, + size_t); + +/** Serialize a map + * + * @param item[borrow] A map + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data, + size_t); + +/** Serialize a tag + * + * @param item[borrow] A tag + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data, + size_t); + +/** Serialize a + * + * @param item[borrow] A float or ctrl + * @param buffer Buffer to serialize to + * @param buffer_size Size of the \p buffer + * @return Length of the result. 0 on failure. + */ +CBOR_EXPORT size_t cbor_serialize_float_ctrl(const cbor_item_t *, + cbor_mutable_data, size_t); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_SERIALIZATION_H diff --git a/code/contrib/libfido2/include/cbor/streaming.h b/code/contrib/libfido2/include/cbor/streaming.h new file mode 100644 index 0000000..54a17bc --- /dev/null +++ b/code/contrib/libfido2/include/cbor/streaming.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_STREAMING_H +#define LIBCBOR_STREAMING_H + +#include "callbacks.h" +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Stateless decoder + * + * Will try parsing the \p source and will invoke the appropriate callback on + * success. Decodes one item at a time. No memory allocations occur. + * + * @param source Input buffer + * @param source_size Length of the buffer + * @param callbacks The callback bundle + * @param context An arbitrary pointer to allow for maintaining context. + */ +CBOR_EXPORT struct cbor_decoder_result cbor_stream_decode( + cbor_data source, size_t source_size, + const struct cbor_callbacks* callbacks, void* context); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_STREAMING_H diff --git a/code/contrib/libfido2/include/cbor/strings.h b/code/contrib/libfido2/include/cbor/strings.h new file mode 100644 index 0000000..49398af --- /dev/null +++ b/code/contrib/libfido2/include/cbor/strings.h @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_STRINGS_H +#define LIBCBOR_STRINGS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * String manipulation + * ============================================================================ + */ + +/** Returns the length of the underlying string + * + * For definite strings only + * + * @param item[borrow] a definite string + * @return length of the string. Zero if no chunk has been attached yet + */ +CBOR_EXPORT size_t cbor_string_length(const cbor_item_t *item); + +/** The number of codepoints in this string + * + * Might differ from length if there are multibyte ones + * + * @param item[borrow] A string + * @return The number of codepoints in this string + */ +CBOR_EXPORT size_t cbor_string_codepoint_count(const cbor_item_t *item); + +/** Is the string definite? + * + * @param item[borrow] a string + * @return Is the string definite? + */ +CBOR_EXPORT bool cbor_string_is_definite(const cbor_item_t *item); + +/** Is the string indefinite? + * + * @param item[borrow] a string + * @return Is the string indefinite? + */ +CBOR_EXPORT bool cbor_string_is_indefinite(const cbor_item_t *item); + +/** Get the handle to the underlying string + * + * Definite items only. Modifying the data is allowed. In that case, the caller + * takes responsibility for the effect on items this item might be a part of + * + * @param item[borrow] A definite string + * @return The address of the underlying string. `NULL` if no data have been + * assigned yet. + */ +CBOR_EXPORT cbor_mutable_data cbor_string_handle(const cbor_item_t *item); + +/** Set the handle to the underlying string + * + * + * \rst + * .. warning:: Using a pointer to a stack allocated constant is a common + * mistake. Lifetime of the string will expire when it goes out of scope and + * the CBOR item will be left inconsistent. + * \endrst + * + * @param item[borrow] A definite string + * @param data The memory block. The caller gives up the ownership of the block. + * libcbor will deallocate it when appropriate using its free function + * @param length Length of the data block + */ +CBOR_EXPORT void cbor_string_set_handle( + cbor_item_t *item, cbor_mutable_data CBOR_RESTRICT_POINTER data, + size_t length); + +/** Get the handle to the array of chunks + * + * Manipulations with the memory block (e.g. sorting it) are allowed, but the + * validity and the number of chunks must be retained. + * + * @param item[borrow] A indefinite string + * @return array of #cbor_string_chunk_count definite strings + */ +CBOR_EXPORT cbor_item_t **cbor_string_chunks_handle(const cbor_item_t *item); + +/** Get the number of chunks this string consist of + * + * @param item[borrow] A indefinite string + * @return The chunk count. 0 for freshly created items. + */ +CBOR_EXPORT size_t cbor_string_chunk_count(const cbor_item_t *item); + +/** Appends a chunk to the string + * + * Indefinite strings only. + * + * May realloc the chunk storage. + * + * @param item[borrow] An indefinite string + * @param item[incref] A definite string + * @return true on success. false on realloc failure. In that case, the refcount + * of `chunk` is not increased and the `item` is left intact. + */ +CBOR_EXPORT bool cbor_string_add_chunk(cbor_item_t *item, cbor_item_t *chunk); + +/** Creates a new definite string + * + * The handle is initialized to `NULL` and length to 0 + * + * @return **new** definite string. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_new_definite_string(); + +/** Creates a new indefinite string + * + * The chunks array is initialized to `NULL` and chunkcount to 0 + * + * @return **new** indefinite string. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_new_indefinite_string(); + +/** Creates a new string and initializes it + * + * The `val` will be copied to a newly allocated block + * + * @param val A null-terminated UTF-8 string + * @return A **new** string with content `handle`. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_build_string(const char *val); + +/** Creates a new string and initializes it + * + * The `handle` will be copied to a newly allocated block + * + * @param val A UTF-8 string, at least \p length long (excluding the null byte) + * @return A **new** string with content `handle`. `NULL` on malloc failure. + */ +CBOR_EXPORT cbor_item_t *cbor_build_stringn(const char *val, size_t length); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_STRINGS_H diff --git a/code/contrib/libfido2/include/cbor/tags.h b/code/contrib/libfido2/include/cbor/tags.h new file mode 100644 index 0000000..f4b8028 --- /dev/null +++ b/code/contrib/libfido2/include/cbor/tags.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIBCBOR_TAGS_H +#define LIBCBOR_TAGS_H + +#include "cbor/cbor_export.h" +#include "cbor/common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * ============================================================================ + * Tag manipulation + * ============================================================================ + */ + +/** Create a new tag + * + * @param value The tag value. Please consult the tag repository + * @return **new** tag. Item reference is `NULL`. Returns `NULL` upon + * memory allocation failure + */ +CBOR_EXPORT cbor_item_t *cbor_new_tag(uint64_t value); + +/** Get the tagged item + * + * @param item[borrow] A tag + * @return **incref** the tagged item + */ +CBOR_EXPORT cbor_item_t *cbor_tag_item(const cbor_item_t *item); + +/** Get tag value + * + * @param item[borrow] A tag + * @return The tag value. Please consult the tag repository + */ +CBOR_EXPORT uint64_t cbor_tag_value(const cbor_item_t *item); + +/** Set the tagged item + * + * @param item[borrow] A tag + * @param tagged_item[incref] The item to tag + */ +CBOR_EXPORT void cbor_tag_set_item(cbor_item_t *item, cbor_item_t *tagged_item); + +/** Build a new tag + * + * @param item[incref] The tagee + * @param value Tag value + * @return **new** tag item + */ +CBOR_EXPORT cbor_item_t *cbor_build_tag(uint64_t value, cbor_item_t *item); + +#ifdef __cplusplus +} +#endif + +#endif // LIBCBOR_TAGS_H diff --git a/code/contrib/libfido2/include/fido.h b/code/contrib/libfido2/include/fido.h new file mode 100644 index 0000000..63d6de8 --- /dev/null +++ b/code/contrib/libfido2/include/fido.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2018 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_H +#define _FIDO_H + +#include +#include + +#include +#include +#include + +#ifdef _FIDO_INTERNAL +#include + +#include +#include + +#include "../openbsd-compat/openbsd-compat.h" +#include "blob.h" +#include "iso7816.h" +#include "extern.h" +#endif + +#include "fido/err.h" +#include "fido/param.h" +#include "fido/types.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +fido_assert_t *fido_assert_new(void); +fido_cred_t *fido_cred_new(void); +fido_dev_t *fido_dev_new(void); +fido_dev_t *fido_dev_new_with_info(const fido_dev_info_t *); +fido_dev_info_t *fido_dev_info_new(size_t); +fido_cbor_info_t *fido_cbor_info_new(void); +void *fido_dev_io_handle(const fido_dev_t *); + +void fido_assert_free(fido_assert_t **); +void fido_cbor_info_free(fido_cbor_info_t **); +void fido_cred_free(fido_cred_t **); +void fido_dev_force_fido2(fido_dev_t *); +void fido_dev_force_u2f(fido_dev_t *); +void fido_dev_free(fido_dev_t **); +void fido_dev_info_free(fido_dev_info_t **, size_t); + +/* fido_init() flags. */ +#define FIDO_DEBUG 0x01 +#define FIDO_DISABLE_U2F_FALLBACK 0x02 + +void fido_init(int); +void fido_set_log_handler(fido_log_handler_t *); + +const unsigned char *fido_assert_authdata_ptr(const fido_assert_t *, size_t); +const unsigned char *fido_assert_clientdata_hash_ptr(const fido_assert_t *); +const unsigned char *fido_assert_hmac_secret_ptr(const fido_assert_t *, size_t); +const unsigned char *fido_assert_id_ptr(const fido_assert_t *, size_t); +const unsigned char *fido_assert_largeblob_key_ptr(const fido_assert_t *, size_t); +const unsigned char *fido_assert_sig_ptr(const fido_assert_t *, size_t); +const unsigned char *fido_assert_user_id_ptr(const fido_assert_t *, size_t); +const unsigned char *fido_assert_blob_ptr(const fido_assert_t *, size_t); + +char **fido_cbor_info_extensions_ptr(const fido_cbor_info_t *); +char **fido_cbor_info_options_name_ptr(const fido_cbor_info_t *); +char **fido_cbor_info_transports_ptr(const fido_cbor_info_t *); +char **fido_cbor_info_versions_ptr(const fido_cbor_info_t *); +const bool *fido_cbor_info_options_value_ptr(const fido_cbor_info_t *); +const char *fido_assert_rp_id(const fido_assert_t *); +const char *fido_assert_user_display_name(const fido_assert_t *, size_t); +const char *fido_assert_user_icon(const fido_assert_t *, size_t); +const char *fido_assert_user_name(const fido_assert_t *, size_t); +const char *fido_cbor_info_algorithm_type(const fido_cbor_info_t *, size_t); +const char *fido_cred_display_name(const fido_cred_t *); +const char *fido_cred_fmt(const fido_cred_t *); +const char *fido_cred_rp_id(const fido_cred_t *); +const char *fido_cred_rp_name(const fido_cred_t *); +const char *fido_cred_user_name(const fido_cred_t *); +const char *fido_dev_info_manufacturer_string(const fido_dev_info_t *); +const char *fido_dev_info_path(const fido_dev_info_t *); +const char *fido_dev_info_product_string(const fido_dev_info_t *); +const fido_dev_info_t *fido_dev_info_ptr(const fido_dev_info_t *, size_t); +const uint8_t *fido_cbor_info_protocols_ptr(const fido_cbor_info_t *); +const unsigned char *fido_cbor_info_aaguid_ptr(const fido_cbor_info_t *); +const unsigned char *fido_cred_aaguid_ptr(const fido_cred_t *); +const unsigned char *fido_cred_attstmt_ptr(const fido_cred_t *); +const unsigned char *fido_cred_authdata_ptr(const fido_cred_t *); +const unsigned char *fido_cred_authdata_raw_ptr(const fido_cred_t *); +const unsigned char *fido_cred_clientdata_hash_ptr(const fido_cred_t *); +const unsigned char *fido_cred_id_ptr(const fido_cred_t *); +const unsigned char *fido_cred_largeblob_key_ptr(const fido_cred_t *); +const unsigned char *fido_cred_pubkey_ptr(const fido_cred_t *); +const unsigned char *fido_cred_sig_ptr(const fido_cred_t *); +const unsigned char *fido_cred_user_id_ptr(const fido_cred_t *); +const unsigned char *fido_cred_x5c_ptr(const fido_cred_t *); + +int fido_assert_allow_cred(fido_assert_t *, const unsigned char *, size_t); +int fido_assert_set_authdata(fido_assert_t *, size_t, const unsigned char *, + size_t); +int fido_assert_set_authdata_raw(fido_assert_t *, size_t, const unsigned char *, + size_t); +int fido_assert_set_clientdata(fido_assert_t *, const unsigned char *, size_t); +int fido_assert_set_clientdata_hash(fido_assert_t *, const unsigned char *, + size_t); +int fido_assert_set_count(fido_assert_t *, size_t); +int fido_assert_set_extensions(fido_assert_t *, int); +int fido_assert_set_hmac_salt(fido_assert_t *, const unsigned char *, size_t); +int fido_assert_set_hmac_secret(fido_assert_t *, size_t, const unsigned char *, + size_t); +int fido_assert_set_options(fido_assert_t *, bool, bool); +int fido_assert_set_rp(fido_assert_t *, const char *); +int fido_assert_set_up(fido_assert_t *, fido_opt_t); +int fido_assert_set_uv(fido_assert_t *, fido_opt_t); +int fido_assert_set_sig(fido_assert_t *, size_t, const unsigned char *, size_t); +int fido_assert_verify(const fido_assert_t *, size_t, int, const void *); +int fido_cbor_info_algorithm_cose(const fido_cbor_info_t *, size_t); +int fido_cred_exclude(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_prot(const fido_cred_t *); +int fido_cred_set_attstmt(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_authdata(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_authdata_raw(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_blob(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_clientdata(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_clientdata_hash(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_extensions(fido_cred_t *, int); +int fido_cred_set_fmt(fido_cred_t *, const char *); +int fido_cred_set_id(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_options(fido_cred_t *, bool, bool); +int fido_cred_set_pin_minlen(fido_cred_t *, size_t); +int fido_cred_set_prot(fido_cred_t *, int); +int fido_cred_set_rk(fido_cred_t *, fido_opt_t); +int fido_cred_set_rp(fido_cred_t *, const char *, const char *); +int fido_cred_set_sig(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_set_type(fido_cred_t *, int); +int fido_cred_set_uv(fido_cred_t *, fido_opt_t); +int fido_cred_type(const fido_cred_t *); +int fido_cred_set_user(fido_cred_t *, const unsigned char *, size_t, + const char *, const char *, const char *); +int fido_cred_set_x509(fido_cred_t *, const unsigned char *, size_t); +int fido_cred_verify(const fido_cred_t *); +int fido_cred_verify_self(const fido_cred_t *); +#ifdef _FIDO_SIGSET_DEFINED +int fido_dev_set_sigmask(fido_dev_t *, const fido_sigset_t *); +#endif +int fido_dev_cancel(fido_dev_t *); +int fido_dev_close(fido_dev_t *); +int fido_dev_get_assert(fido_dev_t *, fido_assert_t *, const char *); +int fido_dev_get_cbor_info(fido_dev_t *, fido_cbor_info_t *); +int fido_dev_get_retry_count(fido_dev_t *, int *); +int fido_dev_get_uv_retry_count(fido_dev_t *, int *); +int fido_dev_get_touch_begin(fido_dev_t *); +int fido_dev_get_touch_status(fido_dev_t *, int *, int); +int fido_dev_info_manifest(fido_dev_info_t *, size_t, size_t *); +int fido_dev_info_set(fido_dev_info_t *, size_t, const char *, const char *, + const char *, const fido_dev_io_t *, const fido_dev_transport_t *); +int fido_dev_make_cred(fido_dev_t *, fido_cred_t *, const char *); +int fido_dev_open_with_info(fido_dev_t *); +int fido_dev_open(fido_dev_t *, const char *); +int fido_dev_reset(fido_dev_t *); +int fido_dev_set_io_functions(fido_dev_t *, const fido_dev_io_t *); +int fido_dev_set_pin(fido_dev_t *, const char *, const char *); +int fido_dev_set_transport_functions(fido_dev_t *, const fido_dev_transport_t *); +int fido_dev_set_timeout(fido_dev_t *, int); + +size_t fido_assert_authdata_len(const fido_assert_t *, size_t); +size_t fido_assert_clientdata_hash_len(const fido_assert_t *); +size_t fido_assert_count(const fido_assert_t *); +size_t fido_assert_hmac_secret_len(const fido_assert_t *, size_t); +size_t fido_assert_id_len(const fido_assert_t *, size_t); +size_t fido_assert_largeblob_key_len(const fido_assert_t *, size_t); +size_t fido_assert_sig_len(const fido_assert_t *, size_t); +size_t fido_assert_user_id_len(const fido_assert_t *, size_t); +size_t fido_assert_blob_len(const fido_assert_t *, size_t); +size_t fido_cbor_info_aaguid_len(const fido_cbor_info_t *); +size_t fido_cbor_info_algorithm_count(const fido_cbor_info_t *); +size_t fido_cbor_info_extensions_len(const fido_cbor_info_t *); +size_t fido_cbor_info_options_len(const fido_cbor_info_t *); +size_t fido_cbor_info_protocols_len(const fido_cbor_info_t *); +size_t fido_cbor_info_transports_len(const fido_cbor_info_t *); +size_t fido_cbor_info_versions_len(const fido_cbor_info_t *); +size_t fido_cred_aaguid_len(const fido_cred_t *); +size_t fido_cred_attstmt_len(const fido_cred_t *); +size_t fido_cred_authdata_len(const fido_cred_t *); +size_t fido_cred_authdata_raw_len(const fido_cred_t *); +size_t fido_cred_clientdata_hash_len(const fido_cred_t *); +size_t fido_cred_id_len(const fido_cred_t *); +size_t fido_cred_largeblob_key_len(const fido_cred_t *); +size_t fido_cred_pin_minlen(const fido_cred_t *); +size_t fido_cred_pubkey_len(const fido_cred_t *); +size_t fido_cred_sig_len(const fido_cred_t *); +size_t fido_cred_user_id_len(const fido_cred_t *); +size_t fido_cred_x5c_len(const fido_cred_t *); + +uint8_t fido_assert_flags(const fido_assert_t *, size_t); +uint32_t fido_assert_sigcount(const fido_assert_t *, size_t); +uint8_t fido_cred_flags(const fido_cred_t *); +uint32_t fido_cred_sigcount(const fido_cred_t *); +uint8_t fido_dev_protocol(const fido_dev_t *); +uint8_t fido_dev_major(const fido_dev_t *); +uint8_t fido_dev_minor(const fido_dev_t *); +uint8_t fido_dev_build(const fido_dev_t *); +uint8_t fido_dev_flags(const fido_dev_t *); +int16_t fido_dev_info_vendor(const fido_dev_info_t *); +int16_t fido_dev_info_product(const fido_dev_info_t *); +uint64_t fido_cbor_info_maxcredbloblen(const fido_cbor_info_t *); +uint64_t fido_cbor_info_maxcredcntlst(const fido_cbor_info_t *); +uint64_t fido_cbor_info_maxcredidlen(const fido_cbor_info_t *); +uint64_t fido_cbor_info_maxlargeblob(const fido_cbor_info_t *); +uint64_t fido_cbor_info_maxmsgsiz(const fido_cbor_info_t *); +uint64_t fido_cbor_info_fwversion(const fido_cbor_info_t *); + +bool fido_dev_has_pin(const fido_dev_t *); +bool fido_dev_has_uv(const fido_dev_t *); +bool fido_dev_is_fido2(const fido_dev_t *); +bool fido_dev_is_winhello(const fido_dev_t *); +bool fido_dev_supports_credman(const fido_dev_t *); +bool fido_dev_supports_cred_prot(const fido_dev_t *); +bool fido_dev_supports_permissions(const fido_dev_t *); +bool fido_dev_supports_pin(const fido_dev_t *); +bool fido_dev_supports_uv(const fido_dev_t *); + +int fido_dev_largeblob_get(fido_dev_t *, const unsigned char *, size_t, + unsigned char **, size_t *); +int fido_dev_largeblob_set(fido_dev_t *, const unsigned char *, size_t, + const unsigned char *, size_t, const char *); +int fido_dev_largeblob_remove(fido_dev_t *, const unsigned char *, size_t, + const char *); +int fido_dev_largeblob_get_array(fido_dev_t *, unsigned char **, size_t *); +int fido_dev_largeblob_set_array(fido_dev_t *, const unsigned char *, size_t, + const char *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_H */ diff --git a/code/contrib/libfido2/include/fido/bio.h b/code/contrib/libfido2/include/fido/bio.h new file mode 100644 index 0000000..afe9ca4 --- /dev/null +++ b/code/contrib/libfido2/include/fido/bio.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2019 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_BIO_H +#define _FIDO_BIO_H + +#include +#include + +#ifdef _FIDO_INTERNAL +#include "blob.h" +#include "fido/err.h" +#include "fido/param.h" +#include "fido/types.h" +#else +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifdef _FIDO_INTERNAL +struct fido_bio_template { + fido_blob_t id; + char *name; +}; + +struct fido_bio_template_array { + struct fido_bio_template *ptr; + size_t n_alloc; /* number of allocated entries */ + size_t n_rx; /* number of populated entries */ +}; + +struct fido_bio_enroll { + uint8_t remaining_samples; + uint8_t last_status; + fido_blob_t *token; +}; + +struct fido_bio_info { + uint8_t type; + uint8_t max_samples; +}; +#endif + +typedef struct fido_bio_template fido_bio_template_t; +typedef struct fido_bio_template_array fido_bio_template_array_t; +typedef struct fido_bio_enroll fido_bio_enroll_t; +typedef struct fido_bio_info fido_bio_info_t; + +#define FIDO_BIO_ENROLL_FP_GOOD 0x00 +#define FIDO_BIO_ENROLL_FP_TOO_HIGH 0x01 +#define FIDO_BIO_ENROLL_FP_TOO_LOW 0x02 +#define FIDO_BIO_ENROLL_FP_TOO_LEFT 0x03 +#define FIDO_BIO_ENROLL_FP_TOO_RIGHT 0x04 +#define FIDO_BIO_ENROLL_FP_TOO_FAST 0x05 +#define FIDO_BIO_ENROLL_FP_TOO_SLOW 0x06 +#define FIDO_BIO_ENROLL_FP_POOR_QUALITY 0x07 +#define FIDO_BIO_ENROLL_FP_TOO_SKEWED 0x08 +#define FIDO_BIO_ENROLL_FP_TOO_SHORT 0x09 +#define FIDO_BIO_ENROLL_FP_MERGE_FAILURE 0x0a +#define FIDO_BIO_ENROLL_FP_EXISTS 0x0b +#define FIDO_BIO_ENROLL_FP_DATABASE_FULL 0x0c +#define FIDO_BIO_ENROLL_NO_USER_ACTIVITY 0x0d +#define FIDO_BIO_ENROLL_NO_USER_PRESENCE_TRANSITION 0x0e + +const char *fido_bio_template_name(const fido_bio_template_t *); +const fido_bio_template_t *fido_bio_template(const fido_bio_template_array_t *, + size_t); +const unsigned char *fido_bio_template_id_ptr(const fido_bio_template_t *); +fido_bio_enroll_t *fido_bio_enroll_new(void); +fido_bio_info_t *fido_bio_info_new(void); +fido_bio_template_array_t *fido_bio_template_array_new(void); +fido_bio_template_t *fido_bio_template_new(void); +int fido_bio_dev_enroll_begin(fido_dev_t *, fido_bio_template_t *, + fido_bio_enroll_t *, uint32_t, const char *); +int fido_bio_dev_enroll_cancel(fido_dev_t *); +int fido_bio_dev_enroll_continue(fido_dev_t *, const fido_bio_template_t *, + fido_bio_enroll_t *, uint32_t); +int fido_bio_dev_enroll_remove(fido_dev_t *, const fido_bio_template_t *, + const char *); +int fido_bio_dev_get_info(fido_dev_t *, fido_bio_info_t *); +int fido_bio_dev_get_template_array(fido_dev_t *, fido_bio_template_array_t *, + const char *); +int fido_bio_dev_set_template_name(fido_dev_t *, const fido_bio_template_t *, + const char *); +int fido_bio_template_set_id(fido_bio_template_t *, const unsigned char *, + size_t); +int fido_bio_template_set_name(fido_bio_template_t *, const char *); +size_t fido_bio_template_array_count(const fido_bio_template_array_t *); +size_t fido_bio_template_id_len(const fido_bio_template_t *); +uint8_t fido_bio_enroll_last_status(const fido_bio_enroll_t *); +uint8_t fido_bio_enroll_remaining_samples(const fido_bio_enroll_t *); +uint8_t fido_bio_info_max_samples(const fido_bio_info_t *); +uint8_t fido_bio_info_type(const fido_bio_info_t *); +void fido_bio_enroll_free(fido_bio_enroll_t **); +void fido_bio_info_free(fido_bio_info_t **); +void fido_bio_template_array_free(fido_bio_template_array_t **); +void fido_bio_template_free(fido_bio_template_t **); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_BIO_H */ diff --git a/code/contrib/libfido2/include/fido/config.h b/code/contrib/libfido2/include/fido/config.h new file mode 100644 index 0000000..d8134a3 --- /dev/null +++ b/code/contrib/libfido2/include/fido/config.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2020 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_CONFIG_H +#define _FIDO_CONFIG_H + +#ifdef _FIDO_INTERNAL +#include "blob.h" +#include "fido/err.h" +#include "fido/param.h" +#include "fido/types.h" +#else +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +int fido_dev_enable_entattest(fido_dev_t *, const char *); +int fido_dev_force_pin_change(fido_dev_t *, const char *); +int fido_dev_toggle_always_uv(fido_dev_t *, const char *); +int fido_dev_set_pin_minlen(fido_dev_t *, size_t, const char *); +int fido_dev_set_pin_minlen_rpid(fido_dev_t *, const char * const *, size_t, + const char *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_CONFIG_H */ diff --git a/code/contrib/libfido2/include/fido/credman.h b/code/contrib/libfido2/include/fido/credman.h new file mode 100644 index 0000000..66a9669 --- /dev/null +++ b/code/contrib/libfido2/include/fido/credman.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2019-2021 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_CREDMAN_H +#define _FIDO_CREDMAN_H + +#include +#include + +#ifdef _FIDO_INTERNAL +#include "blob.h" +#include "fido/err.h" +#include "fido/param.h" +#include "fido/types.h" +#else +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifdef _FIDO_INTERNAL +struct fido_credman_metadata { + uint64_t rk_existing; + uint64_t rk_remaining; +}; + +struct fido_credman_single_rp { + fido_rp_t rp_entity; + fido_blob_t rp_id_hash; +}; + +struct fido_credman_rp { + struct fido_credman_single_rp *ptr; + size_t n_alloc; /* number of allocated entries */ + size_t n_rx; /* number of populated entries */ +}; + +struct fido_credman_rk { + fido_cred_t *ptr; + size_t n_alloc; /* number of allocated entries */ + size_t n_rx; /* number of populated entries */ +}; +#endif + +typedef struct fido_credman_metadata fido_credman_metadata_t; +typedef struct fido_credman_rk fido_credman_rk_t; +typedef struct fido_credman_rp fido_credman_rp_t; + +const char *fido_credman_rp_id(const fido_credman_rp_t *, size_t); +const char *fido_credman_rp_name(const fido_credman_rp_t *, size_t); + +const fido_cred_t *fido_credman_rk(const fido_credman_rk_t *, size_t); +const unsigned char *fido_credman_rp_id_hash_ptr(const fido_credman_rp_t *, + size_t); + +fido_credman_metadata_t *fido_credman_metadata_new(void); +fido_credman_rk_t *fido_credman_rk_new(void); +fido_credman_rp_t *fido_credman_rp_new(void); + +int fido_credman_del_dev_rk(fido_dev_t *, const unsigned char *, size_t, + const char *); +int fido_credman_get_dev_metadata(fido_dev_t *, fido_credman_metadata_t *, + const char *); +int fido_credman_get_dev_rk(fido_dev_t *, const char *, fido_credman_rk_t *, + const char *); +int fido_credman_get_dev_rp(fido_dev_t *, fido_credman_rp_t *, const char *); +int fido_credman_set_dev_rk(fido_dev_t *, fido_cred_t *, const char *); + +size_t fido_credman_rk_count(const fido_credman_rk_t *); +size_t fido_credman_rp_count(const fido_credman_rp_t *); +size_t fido_credman_rp_id_hash_len(const fido_credman_rp_t *, size_t); + +uint64_t fido_credman_rk_existing(const fido_credman_metadata_t *); +uint64_t fido_credman_rk_remaining(const fido_credman_metadata_t *); + +void fido_credman_metadata_free(fido_credman_metadata_t **); +void fido_credman_rk_free(fido_credman_rk_t **); +void fido_credman_rp_free(fido_credman_rp_t **); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_CREDMAN_H */ diff --git a/code/contrib/libfido2/include/fido/eddsa.h b/code/contrib/libfido2/include/fido/eddsa.h new file mode 100644 index 0000000..083721c --- /dev/null +++ b/code/contrib/libfido2/include/fido/eddsa.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_EDDSA_H +#define _FIDO_EDDSA_H + +#include + +#include +#include + +#ifdef _FIDO_INTERNAL +#include "types.h" +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +eddsa_pk_t *eddsa_pk_new(void); +void eddsa_pk_free(eddsa_pk_t **); +EVP_PKEY *eddsa_pk_to_EVP_PKEY(const eddsa_pk_t *); + +int eddsa_pk_from_EVP_PKEY(eddsa_pk_t *, const EVP_PKEY *); +int eddsa_pk_from_ptr(eddsa_pk_t *, const void *, size_t); + +#ifdef _FIDO_INTERNAL + +#if defined(LIBRESSL_VERSION_NUMBER) +#define EVP_PKEY_ED25519 EVP_PKEY_NONE +int EVP_PKEY_get_raw_public_key(const EVP_PKEY *, unsigned char *, size_t *); +EVP_PKEY *EVP_PKEY_new_raw_public_key(int, ENGINE *, const unsigned char *, + size_t); +int EVP_DigestVerify(EVP_MD_CTX *, const unsigned char *, size_t, + const unsigned char *, size_t); +#endif /* LIBRESSL_VERSION_NUMBER */ + +#endif /* _FIDO_INTERNAL */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_EDDSA_H */ diff --git a/code/contrib/libfido2/include/fido/err.h b/code/contrib/libfido2/include/fido/err.h new file mode 100644 index 0000000..74fdf9d --- /dev/null +++ b/code/contrib/libfido2/include/fido/err.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_ERR_H +#define _FIDO_ERR_H + +#define FIDO_ERR_SUCCESS 0x00 +#define FIDO_ERR_INVALID_COMMAND 0x01 +#define FIDO_ERR_INVALID_PARAMETER 0x02 +#define FIDO_ERR_INVALID_LENGTH 0x03 +#define FIDO_ERR_INVALID_SEQ 0x04 +#define FIDO_ERR_TIMEOUT 0x05 +#define FIDO_ERR_CHANNEL_BUSY 0x06 +#define FIDO_ERR_LOCK_REQUIRED 0x0a +#define FIDO_ERR_INVALID_CHANNEL 0x0b +#define FIDO_ERR_CBOR_UNEXPECTED_TYPE 0x11 +#define FIDO_ERR_INVALID_CBOR 0x12 +#define FIDO_ERR_MISSING_PARAMETER 0x14 +#define FIDO_ERR_LIMIT_EXCEEDED 0x15 +#define FIDO_ERR_UNSUPPORTED_EXTENSION 0x16 +#define FIDO_ERR_FP_DATABASE_FULL 0x17 +#define FIDO_ERR_LARGEBLOB_STORAGE_FULL 0x18 +#define FIDO_ERR_CREDENTIAL_EXCLUDED 0x19 +#define FIDO_ERR_PROCESSING 0x21 +#define FIDO_ERR_INVALID_CREDENTIAL 0x22 +#define FIDO_ERR_USER_ACTION_PENDING 0x23 +#define FIDO_ERR_OPERATION_PENDING 0x24 +#define FIDO_ERR_NO_OPERATIONS 0x25 +#define FIDO_ERR_UNSUPPORTED_ALGORITHM 0x26 +#define FIDO_ERR_OPERATION_DENIED 0x27 +#define FIDO_ERR_KEY_STORE_FULL 0x28 +#define FIDO_ERR_NOT_BUSY 0x29 +#define FIDO_ERR_NO_OPERATION_PENDING 0x2a +#define FIDO_ERR_UNSUPPORTED_OPTION 0x2b +#define FIDO_ERR_INVALID_OPTION 0x2c +#define FIDO_ERR_KEEPALIVE_CANCEL 0x2d +#define FIDO_ERR_NO_CREDENTIALS 0x2e +#define FIDO_ERR_USER_ACTION_TIMEOUT 0x2f +#define FIDO_ERR_NOT_ALLOWED 0x30 +#define FIDO_ERR_PIN_INVALID 0x31 +#define FIDO_ERR_PIN_BLOCKED 0x32 +#define FIDO_ERR_PIN_AUTH_INVALID 0x33 +#define FIDO_ERR_PIN_AUTH_BLOCKED 0x34 +#define FIDO_ERR_PIN_NOT_SET 0x35 +#define FIDO_ERR_PIN_REQUIRED 0x36 +#define FIDO_ERR_PIN_POLICY_VIOLATION 0x37 +#define FIDO_ERR_PIN_TOKEN_EXPIRED 0x38 +#define FIDO_ERR_REQUEST_TOO_LARGE 0x39 +#define FIDO_ERR_ACTION_TIMEOUT 0x3a +#define FIDO_ERR_UP_REQUIRED 0x3b +#define FIDO_ERR_UV_BLOCKED 0x3c +#define FIDO_ERR_UV_INVALID 0x3f +#define FIDO_ERR_UNAUTHORIZED_PERM 0x40 +#define FIDO_ERR_ERR_OTHER 0x7f +#define FIDO_ERR_SPEC_LAST 0xdf + +/* defined internally */ +#define FIDO_OK FIDO_ERR_SUCCESS +#define FIDO_ERR_TX -1 +#define FIDO_ERR_RX -2 +#define FIDO_ERR_RX_NOT_CBOR -3 +#define FIDO_ERR_RX_INVALID_CBOR -4 +#define FIDO_ERR_INVALID_PARAM -5 +#define FIDO_ERR_INVALID_SIG -6 +#define FIDO_ERR_INVALID_ARGUMENT -7 +#define FIDO_ERR_USER_PRESENCE_REQUIRED -8 +#define FIDO_ERR_INTERNAL -9 +#define FIDO_ERR_NOTFOUND -10 +#define FIDO_ERR_COMPRESS -11 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +const char *fido_strerr(int); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* _FIDO_ERR_H */ diff --git a/code/contrib/libfido2/include/fido/es256.h b/code/contrib/libfido2/include/fido/es256.h new file mode 100644 index 0000000..683494d --- /dev/null +++ b/code/contrib/libfido2/include/fido/es256.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_ES256_H +#define _FIDO_ES256_H + +#include + +#include +#include + +#ifdef _FIDO_INTERNAL +#include "types.h" +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +es256_pk_t *es256_pk_new(void); +void es256_pk_free(es256_pk_t **); +EVP_PKEY *es256_pk_to_EVP_PKEY(const es256_pk_t *); + +int es256_pk_from_EC_KEY(es256_pk_t *, const EC_KEY *); +int es256_pk_from_EVP_PKEY(es256_pk_t *, const EVP_PKEY *); +int es256_pk_from_ptr(es256_pk_t *, const void *, size_t); + +#ifdef _FIDO_INTERNAL +es256_sk_t *es256_sk_new(void); +void es256_sk_free(es256_sk_t **); +EVP_PKEY *es256_sk_to_EVP_PKEY(const es256_sk_t *); + +int es256_derive_pk(const es256_sk_t *, es256_pk_t *); +int es256_sk_create(es256_sk_t *); + +int es256_pk_set_x(es256_pk_t *, const unsigned char *); +int es256_pk_set_y(es256_pk_t *, const unsigned char *); +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_ES256_H */ diff --git a/code/contrib/libfido2/include/fido/param.h b/code/contrib/libfido2/include/fido/param.h new file mode 100644 index 0000000..7c6db98 --- /dev/null +++ b/code/contrib/libfido2/include/fido/param.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_PARAM_H +#define _FIDO_PARAM_H + +/* Authentication data flags. */ +#define CTAP_AUTHDATA_USER_PRESENT 0x01 +#define CTAP_AUTHDATA_USER_VERIFIED 0x04 +#define CTAP_AUTHDATA_ATT_CRED 0x40 +#define CTAP_AUTHDATA_EXT_DATA 0x80 + +/* CTAPHID command opcodes. */ +#define CTAP_CMD_PING 0x01 +#define CTAP_CMD_MSG 0x03 +#define CTAP_CMD_LOCK 0x04 +#define CTAP_CMD_INIT 0x06 +#define CTAP_CMD_WINK 0x08 +#define CTAP_CMD_CBOR 0x10 +#define CTAP_CMD_CANCEL 0x11 +#define CTAP_KEEPALIVE 0x3b +#define CTAP_FRAME_INIT 0x80 + +/* CTAPHID CBOR command opcodes. */ +#define CTAP_CBOR_MAKECRED 0x01 +#define CTAP_CBOR_ASSERT 0x02 +#define CTAP_CBOR_GETINFO 0x04 +#define CTAP_CBOR_CLIENT_PIN 0x06 +#define CTAP_CBOR_RESET 0x07 +#define CTAP_CBOR_NEXT_ASSERT 0x08 +#define CTAP_CBOR_LARGEBLOB 0x0c +#define CTAP_CBOR_CONFIG 0x0d +#define CTAP_CBOR_BIO_ENROLL_PRE 0x40 +#define CTAP_CBOR_CRED_MGMT_PRE 0x41 + +/* Supported CTAP PIN/UV Auth Protocols. */ +#define CTAP_PIN_PROTOCOL1 1 +#define CTAP_PIN_PROTOCOL2 2 + +/* U2F command opcodes. */ +#define U2F_CMD_REGISTER 0x01 +#define U2F_CMD_AUTH 0x02 + +/* U2F command flags. */ +#define U2F_AUTH_SIGN 0x03 +#define U2F_AUTH_CHECK 0x07 + +/* ISO7816-4 status words. */ +#define SW1_MORE_DATA 0x61 +#define SW_CONDITIONS_NOT_SATISFIED 0x6985 +#define SW_WRONG_DATA 0x6a80 +#define SW_NO_ERROR 0x9000 + +/* HID Broadcast channel ID. */ +#define CTAP_CID_BROADCAST 0xffffffff + +#define CTAP_INIT_HEADER_LEN 7 +#define CTAP_CONT_HEADER_LEN 5 + +/* Maximum length of a CTAP HID report in bytes. */ +#define CTAP_MAX_REPORT_LEN 64 + +/* Minimum length of a CTAP HID report in bytes. */ +#define CTAP_MIN_REPORT_LEN (CTAP_INIT_HEADER_LEN + 1) + +/* Randomness device on UNIX-like platforms. */ +#ifndef FIDO_RANDOM_DEV +#define FIDO_RANDOM_DEV "/dev/urandom" +#endif + +/* Maximum message size in bytes. */ +#ifndef FIDO_MAXMSG +#define FIDO_MAXMSG 2048 +#endif + +/* CTAP capability bits. */ +#define FIDO_CAP_WINK 0x01 /* if set, device supports CTAP_CMD_WINK */ +#define FIDO_CAP_CBOR 0x04 /* if set, device supports CTAP_CMD_CBOR */ +#define FIDO_CAP_NMSG 0x08 /* if set, device doesn't support CTAP_CMD_MSG */ + +/* Supported COSE algorithms. */ +#define COSE_UNSPEC 0 +#define COSE_ES256 -7 +#define COSE_EDDSA -8 +#define COSE_ECDH_ES256 -25 +#define COSE_RS256 -257 +#define COSE_RS1 -65535 + +/* Supported COSE types. */ +#define COSE_KTY_OKP 1 +#define COSE_KTY_EC2 2 +#define COSE_KTY_RSA 3 + +/* Supported curves. */ +#define COSE_P256 1 +#define COSE_ED25519 6 + +/* Supported extensions. */ +#define FIDO_EXT_HMAC_SECRET 0x01 +#define FIDO_EXT_CRED_PROTECT 0x02 +#define FIDO_EXT_LARGEBLOB_KEY 0x04 +#define FIDO_EXT_CRED_BLOB 0x08 +#define FIDO_EXT_MINPINLEN 0x10 + +/* Supported credential protection policies. */ +#define FIDO_CRED_PROT_UV_OPTIONAL 0x01 +#define FIDO_CRED_PROT_UV_OPTIONAL_WITH_ID 0x02 +#define FIDO_CRED_PROT_UV_REQUIRED 0x03 + +#ifdef _FIDO_INTERNAL +#define FIDO_EXT_ASSERT_MASK (FIDO_EXT_HMAC_SECRET|FIDO_EXT_LARGEBLOB_KEY| \ + FIDO_EXT_CRED_BLOB) +#define FIDO_EXT_CRED_MASK (FIDO_EXT_HMAC_SECRET|FIDO_EXT_CRED_PROTECT| \ + FIDO_EXT_LARGEBLOB_KEY|FIDO_EXT_CRED_BLOB| \ + FIDO_EXT_MINPINLEN) +#endif /* _FIDO_INTERNAL */ + +#endif /* !_FIDO_PARAM_H */ diff --git a/code/contrib/libfido2/include/fido/rs256.h b/code/contrib/libfido2/include/fido/rs256.h new file mode 100644 index 0000000..0398161 --- /dev/null +++ b/code/contrib/libfido2/include/fido/rs256.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_RS256_H +#define _FIDO_RS256_H + +#include + +#include +#include + +#ifdef _FIDO_INTERNAL +#include "types.h" +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +rs256_pk_t *rs256_pk_new(void); +void rs256_pk_free(rs256_pk_t **); +EVP_PKEY *rs256_pk_to_EVP_PKEY(const rs256_pk_t *); + +int rs256_pk_from_EVP_PKEY(rs256_pk_t *, const EVP_PKEY *); +int rs256_pk_from_RSA(rs256_pk_t *, const RSA *); +int rs256_pk_from_ptr(rs256_pk_t *, const void *, size_t); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_RS256_H */ diff --git a/code/contrib/libfido2/include/fido/types.h b/code/contrib/libfido2/include/fido/types.h new file mode 100644 index 0000000..593a6a6 --- /dev/null +++ b/code/contrib/libfido2/include/fido/types.h @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2018-2022 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#ifndef _FIDO_TYPES_H +#define _FIDO_TYPES_H + +#ifdef __MINGW32__ +#include +#endif + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +struct fido_dev; + +typedef void *fido_dev_io_open_t(const char *); +typedef void fido_dev_io_close_t(void *); +typedef int fido_dev_io_read_t(void *, unsigned char *, size_t, int); +typedef int fido_dev_io_write_t(void *, const unsigned char *, size_t); +typedef int fido_dev_rx_t(struct fido_dev *, uint8_t, unsigned char *, size_t, int); +typedef int fido_dev_tx_t(struct fido_dev *, uint8_t, const unsigned char *, size_t); + +typedef struct fido_dev_io { + fido_dev_io_open_t *open; + fido_dev_io_close_t *close; + fido_dev_io_read_t *read; + fido_dev_io_write_t *write; +} fido_dev_io_t; + +typedef struct fido_dev_transport { + fido_dev_rx_t *rx; + fido_dev_tx_t *tx; +} fido_dev_transport_t; + +typedef enum { + FIDO_OPT_OMIT = 0, /* use authenticator's default */ + FIDO_OPT_FALSE, /* explicitly set option to false */ + FIDO_OPT_TRUE, /* explicitly set option to true */ +} fido_opt_t; + +typedef void fido_log_handler_t(const char *); + +#undef _FIDO_SIGSET_DEFINED +#define _FIDO_SIGSET_DEFINED +#ifdef _WIN32 +typedef int fido_sigset_t; +#elif defined(SIG_BLOCK) +typedef sigset_t fido_sigset_t; +#else +#undef _FIDO_SIGSET_DEFINED +#endif + +#ifdef _FIDO_INTERNAL +#include "packed.h" +#include "blob.h" + +/* COSE ES256 (ECDSA over P-256 with SHA-256) public key */ +typedef struct es256_pk { + unsigned char x[32]; + unsigned char y[32]; +} es256_pk_t; + +/* COSE ES256 (ECDSA over P-256 with SHA-256) (secret) key */ +typedef struct es256_sk { + unsigned char d[32]; +} es256_sk_t; + +/* COSE RS256 (2048-bit RSA with PKCS1 padding and SHA-256) public key */ +typedef struct rs256_pk { + unsigned char n[256]; + unsigned char e[3]; +} rs256_pk_t; + +/* COSE EDDSA (ED25519) */ +typedef struct eddsa_pk { + unsigned char x[32]; +} eddsa_pk_t; + +PACKED_TYPE(fido_authdata_t, +struct fido_authdata { + unsigned char rp_id_hash[32]; /* sha256 of fido_rp.id */ + uint8_t flags; /* user present/verified */ + uint32_t sigcount; /* signature counter */ + /* actually longer */ +}) + +PACKED_TYPE(fido_attcred_raw_t, +struct fido_attcred_raw { + unsigned char aaguid[16]; /* credential's aaguid */ + uint16_t id_len; /* credential id length */ + uint8_t body[]; /* credential id + pubkey */ +}) + +typedef struct fido_attcred { + unsigned char aaguid[16]; /* credential's aaguid */ + fido_blob_t id; /* credential id */ + int type; /* credential's cose algorithm */ + union { /* credential's public key */ + es256_pk_t es256; + rs256_pk_t rs256; + eddsa_pk_t eddsa; + } pubkey; +} fido_attcred_t; + +typedef struct fido_attstmt { + fido_blob_t certinfo; /* tpm attestation TPMS_ATTEST structure */ + fido_blob_t pubarea; /* tpm attestation TPMT_PUBLIC structure */ + fido_blob_t cbor; /* cbor-encoded attestation statement */ + fido_blob_t x5c; /* attestation certificate */ + fido_blob_t sig; /* attestation signature */ + int alg; /* attestation algorithm (cose) */ +} fido_attstmt_t; + +typedef struct fido_rp { + char *id; /* relying party id */ + char *name; /* relying party name */ +} fido_rp_t; + +typedef struct fido_user { + fido_blob_t id; /* required */ + char *icon; /* optional */ + char *name; /* optional */ + char *display_name; /* required */ +} fido_user_t; + +typedef struct fido_cred_ext { + int mask; /* enabled extensions */ + int prot; /* protection policy */ + size_t minpinlen; /* minimum pin length */ +} fido_cred_ext_t; + +typedef struct fido_cred { + fido_blob_t cd; /* client data */ + fido_blob_t cdh; /* client data hash */ + fido_rp_t rp; /* relying party */ + fido_user_t user; /* user entity */ + fido_blob_array_t excl; /* list of credential ids to exclude */ + fido_opt_t rk; /* resident key */ + fido_opt_t uv; /* user verification */ + fido_cred_ext_t ext; /* extensions */ + int type; /* cose algorithm */ + char *fmt; /* credential format */ + fido_cred_ext_t authdata_ext; /* decoded extensions */ + fido_blob_t authdata_cbor; /* cbor-encoded payload */ + fido_blob_t authdata_raw; /* cbor-decoded payload */ + fido_authdata_t authdata; /* decoded authdata payload */ + fido_attcred_t attcred; /* returned credential (key + id) */ + fido_attstmt_t attstmt; /* attestation statement (x509 + sig) */ + fido_blob_t largeblob_key; /* decoded large blob key */ + fido_blob_t blob; /* CTAP 2.1 credBlob */ +} fido_cred_t; + +typedef struct fido_assert_extattr { + int mask; /* decoded extensions */ + fido_blob_t hmac_secret_enc; /* hmac secret, encrypted */ + fido_blob_t blob; /* decoded CTAP 2.1 credBlob */ +} fido_assert_extattr_t; + +typedef struct _fido_assert_stmt { + fido_blob_t id; /* credential id */ + fido_user_t user; /* user attributes */ + fido_blob_t hmac_secret; /* hmac secret */ + fido_assert_extattr_t authdata_ext; /* decoded extensions */ + fido_blob_t authdata_cbor; /* raw cbor payload */ + fido_authdata_t authdata; /* decoded authdata payload */ + fido_blob_t sig; /* signature of cdh + authdata */ + fido_blob_t largeblob_key; /* decoded large blob key */ +} fido_assert_stmt; + +typedef struct fido_assert_ext { + int mask; /* enabled extensions */ + fido_blob_t hmac_salt; /* optional hmac-secret salt */ +} fido_assert_ext_t; + +typedef struct fido_assert { + char *rp_id; /* relying party id */ + fido_blob_t cd; /* client data */ + fido_blob_t cdh; /* client data hash */ + fido_blob_array_t allow_list; /* list of allowed credentials */ + fido_opt_t up; /* user presence */ + fido_opt_t uv; /* user verification */ + fido_assert_ext_t ext; /* enabled extensions */ + fido_assert_stmt *stmt; /* array of expected assertions */ + size_t stmt_cnt; /* number of allocated assertions */ + size_t stmt_len; /* number of received assertions */ +} fido_assert_t; + +typedef struct fido_opt_array { + char **name; + bool *value; + size_t len; +} fido_opt_array_t; + +typedef struct fido_str_array { + char **ptr; + size_t len; +} fido_str_array_t; + +typedef struct fido_byte_array { + uint8_t *ptr; + size_t len; +} fido_byte_array_t; + +typedef struct fido_algo { + char *type; + int cose; +} fido_algo_t; + +typedef struct fido_algo_array { + fido_algo_t *ptr; + size_t len; +} fido_algo_array_t; + +typedef struct fido_cbor_info { + fido_str_array_t versions; /* supported versions: fido2|u2f */ + fido_str_array_t extensions; /* list of supported extensions */ + fido_str_array_t transports; /* list of supported transports */ + unsigned char aaguid[16]; /* aaguid */ + fido_opt_array_t options; /* list of supported options */ + uint64_t maxmsgsiz; /* maximum message size */ + fido_byte_array_t protocols; /* supported pin protocols */ + fido_algo_array_t algorithms; /* list of supported algorithms */ + uint64_t maxcredcntlst; /* max credentials in list */ + uint64_t maxcredidlen; /* max credential ID length */ + uint64_t fwversion; /* firmware version */ + uint64_t maxcredbloblen; /* max credBlob length */ + uint64_t maxlargeblob; /* max largeBlob array length */ +} fido_cbor_info_t; + +typedef struct fido_dev_info { + char *path; /* device path */ + int16_t vendor_id; /* 2-byte vendor id */ + int16_t product_id; /* 2-byte product id */ + char *manufacturer; /* manufacturer string */ + char *product; /* product string */ + fido_dev_io_t io; /* i/o functions */ + fido_dev_transport_t transport; /* transport functions */ +} fido_dev_info_t; + +PACKED_TYPE(fido_ctap_info_t, +/* defined in section 8.1.9.1.3 (CTAPHID_INIT) of the fido2 ctap spec */ +struct fido_ctap_info { + uint64_t nonce; /* echoed nonce */ + uint32_t cid; /* channel id */ + uint8_t protocol; /* ctaphid protocol id */ + uint8_t major; /* major version number */ + uint8_t minor; /* minor version number */ + uint8_t build; /* build version number */ + uint8_t flags; /* capabilities flags; see FIDO_CAP_* */ +}) + +typedef struct fido_dev { + uint64_t nonce; /* issued nonce */ + fido_ctap_info_t attr; /* device attributes */ + uint32_t cid; /* assigned channel id */ + char *path; /* device path */ + void *io_handle; /* abstract i/o handle */ + fido_dev_io_t io; /* i/o functions */ + bool io_own; /* device has own io/transport */ + size_t rx_len; /* length of HID input reports */ + size_t tx_len; /* length of HID output reports */ + int flags; /* internal flags; see FIDO_DEV_* */ + fido_dev_transport_t transport; /* transport functions */ + uint64_t maxmsgsize; /* max message size */ + int timeout_ms; /* read timeout in ms */ +} fido_dev_t; + +#else +typedef struct fido_assert fido_assert_t; +typedef struct fido_cbor_info fido_cbor_info_t; +typedef struct fido_cred fido_cred_t; +typedef struct fido_dev fido_dev_t; +typedef struct fido_dev_info fido_dev_info_t; +typedef struct es256_pk es256_pk_t; +typedef struct es256_sk es256_sk_t; +typedef struct rs256_pk rs256_pk_t; +typedef struct eddsa_pk eddsa_pk_t; +#endif /* _FIDO_INTERNAL */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_FIDO_TYPES_H */ diff --git a/code/contrib/libfido2/include/openssl/aes.h b/code/contrib/libfido2/include/openssl/aes.h new file mode 100644 index 0000000..c904485 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/aes.h @@ -0,0 +1,126 @@ +/* $OpenBSD: aes.h,v 1.14 2014/07/09 09:10:07 miod Exp $ */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + */ + +#ifndef HEADER_AES_H +#define HEADER_AES_H + +#include + +#ifdef OPENSSL_NO_AES +#error AES is disabled. +#endif + +#include + +#define AES_ENCRYPT 1 +#define AES_DECRYPT 0 + +/* Because array size can't be a const in C, the following two are macros. + Both sizes are in bytes. */ +#define AES_MAXNR 14 +#define AES_BLOCK_SIZE 16 + +#ifdef __cplusplus +extern "C" { +#endif + +/* This should be a hidden type, but EVP requires that the size be known */ +struct aes_key_st { + unsigned int rd_key[4 *(AES_MAXNR + 1)]; + int rounds; +}; +typedef struct aes_key_st AES_KEY; + +const char *AES_options(void); + +int AES_set_encrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key); +int AES_set_decrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key); + +void AES_encrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key); +void AES_decrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key); + +void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key, const int enc); +void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char *ivec, const int enc); +void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char *ivec, int *num, + const int enc); +void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char *ivec, int *num, + const int enc); +void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char *ivec, int *num, + const int enc); +void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char *ivec, int *num); +void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char ivec[AES_BLOCK_SIZE], + unsigned char ecount_buf[AES_BLOCK_SIZE], unsigned int *num); +/* NB: the IV is _two_ blocks long */ +void AES_ige_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, unsigned char *ivec, const int enc); + +int AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, + const unsigned char *in, unsigned int inlen); +int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, + const unsigned char *in, unsigned int inlen); + + +#ifdef __cplusplus +} +#endif + +#endif /* !HEADER_AES_H */ diff --git a/code/contrib/libfido2/include/openssl/asn1.h b/code/contrib/libfido2/include/openssl/asn1.h new file mode 100644 index 0000000..e569e87 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/asn1.h @@ -0,0 +1,1199 @@ +/* $OpenBSD: asn1.h,v 1.62 2022/01/14 08:53:53 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ASN1_H +#define HEADER_ASN1_H + +#include + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include + +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define V_ASN1_UNIVERSAL 0x00 +#define V_ASN1_APPLICATION 0x40 +#define V_ASN1_CONTEXT_SPECIFIC 0x80 +#define V_ASN1_PRIVATE 0xc0 + +#define V_ASN1_CONSTRUCTED 0x20 +#define V_ASN1_PRIMITIVE_TAG 0x1f +#define V_ASN1_PRIMATIVE_TAG 0x1f + +#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ +#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ +#define V_ASN1_ANY -4 /* used in ASN1 template code */ + +#define V_ASN1_NEG 0x100 /* negative flag */ + +#define V_ASN1_UNDEF -1 +#define V_ASN1_EOC 0 +#define V_ASN1_BOOLEAN 1 /**/ +#define V_ASN1_INTEGER 2 +#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) +#define V_ASN1_BIT_STRING 3 +#define V_ASN1_OCTET_STRING 4 +#define V_ASN1_NULL 5 +#define V_ASN1_OBJECT 6 +#define V_ASN1_OBJECT_DESCRIPTOR 7 +#define V_ASN1_EXTERNAL 8 +#define V_ASN1_REAL 9 +#define V_ASN1_ENUMERATED 10 +#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) +#define V_ASN1_UTF8STRING 12 +#define V_ASN1_SEQUENCE 16 +#define V_ASN1_SET 17 +#define V_ASN1_NUMERICSTRING 18 /**/ +#define V_ASN1_PRINTABLESTRING 19 +#define V_ASN1_T61STRING 20 +#define V_ASN1_TELETEXSTRING 20 /* alias */ +#define V_ASN1_VIDEOTEXSTRING 21 /**/ +#define V_ASN1_IA5STRING 22 +#define V_ASN1_UTCTIME 23 +#define V_ASN1_GENERALIZEDTIME 24 /**/ +#define V_ASN1_GRAPHICSTRING 25 /**/ +#define V_ASN1_ISO64STRING 26 /**/ +#define V_ASN1_VISIBLESTRING 26 /* alias */ +#define V_ASN1_GENERALSTRING 27 /**/ +#define V_ASN1_UNIVERSALSTRING 28 /**/ +#define V_ASN1_BMPSTRING 30 + +#define B_ASN1_NUMERICSTRING 0x0001 +#define B_ASN1_PRINTABLESTRING 0x0002 +#define B_ASN1_T61STRING 0x0004 +#define B_ASN1_TELETEXSTRING 0x0004 +#define B_ASN1_VIDEOTEXSTRING 0x0008 +#define B_ASN1_IA5STRING 0x0010 +#define B_ASN1_GRAPHICSTRING 0x0020 +#define B_ASN1_ISO64STRING 0x0040 +#define B_ASN1_VISIBLESTRING 0x0040 +#define B_ASN1_GENERALSTRING 0x0080 +#define B_ASN1_UNIVERSALSTRING 0x0100 +#define B_ASN1_OCTET_STRING 0x0200 +#define B_ASN1_BIT_STRING 0x0400 +#define B_ASN1_BMPSTRING 0x0800 +#define B_ASN1_UNKNOWN 0x1000 +#define B_ASN1_UTF8STRING 0x2000 +#define B_ASN1_UTCTIME 0x4000 +#define B_ASN1_GENERALIZEDTIME 0x8000 +#define B_ASN1_SEQUENCE 0x10000 + +/* For use with ASN1_mbstring_copy() */ +#define MBSTRING_FLAG 0x1000 +#define MBSTRING_UTF8 (MBSTRING_FLAG) +#define MBSTRING_ASC (MBSTRING_FLAG|1) +#define MBSTRING_BMP (MBSTRING_FLAG|2) +#define MBSTRING_UNIV (MBSTRING_FLAG|4) + +#define SMIME_OLDMIME 0x400 +#define SMIME_CRLFEOL 0x800 +#define SMIME_STREAM 0x1000 + +struct X509_algor_st; +DECLARE_STACK_OF(X509_ALGOR) + +#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */ +#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */ + +#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ +/* This indicates that the ASN1_STRING is not a real value but just a place + * holder for the location where indefinite length constructed data should + * be inserted in the memory buffer + */ +#define ASN1_STRING_FLAG_NDEF 0x010 + +/* This flag is used by the CMS code to indicate that a string is not + * complete and is a place holder for content when it had all been + * accessed. The flag will be reset when content has been written to it. + */ + +#define ASN1_STRING_FLAG_CONT 0x020 +/* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING + * type. + */ +#define ASN1_STRING_FLAG_MSTRING 0x040 +/* This is the base type that holds just about everything :-) */ +struct asn1_string_st { + int length; + int type; + unsigned char *data; + /* The value of the following field depends on the type being + * held. It is mostly being used for BIT_STRING so if the + * input data has a non-zero 'unused bits' value, it will be + * handled correctly */ + long flags; +}; + +/* ASN1_ENCODING structure: this is used to save the received + * encoding of an ASN1 type. This is useful to get round + * problems with invalid encodings which can break signatures. + */ + +typedef struct ASN1_ENCODING_st { + unsigned char *enc; /* DER encoding */ + long len; /* Length of encoding */ + int modified; /* set to 1 if 'enc' is invalid */ +} ASN1_ENCODING; + +/* Used with ASN1 LONG type: if a long is set to this it is omitted */ +#define ASN1_LONG_UNDEF 0x7fffffffL + +#define STABLE_FLAGS_MALLOC 0x01 +#define STABLE_NO_MASK 0x02 +#define DIRSTRING_TYPE \ + (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING) +#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING) + +typedef struct asn1_string_table_st { + int nid; + long minsize; + long maxsize; + unsigned long mask; + unsigned long flags; +} ASN1_STRING_TABLE; + +DECLARE_STACK_OF(ASN1_STRING_TABLE) + +/* size limits: this stuff is taken straight from RFC2459 */ + +#define ub_name 32768 +#define ub_common_name 64 +#define ub_locality_name 128 +#define ub_state_name 128 +#define ub_organization_name 64 +#define ub_organization_unit_name 64 +#define ub_title 64 +#define ub_email_address 128 + +/* Declarations for template structures: for full definitions + * see asn1t.h + */ +typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; +typedef struct ASN1_TLC_st ASN1_TLC; +/* This is just an opaque pointer */ +typedef struct ASN1_VALUE_st ASN1_VALUE; + +#ifndef LIBRESSL_INTERNAL + +/* Declare ASN1 functions: the implement macro in in asn1t.h */ + +#define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) + +#define DECLARE_ASN1_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) + +#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ + type *d2i_##name(type **a, const unsigned char **in, long len); \ + int i2d_##name(type *a, unsigned char **out); \ + DECLARE_ASN1_ITEM(itname) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ + type *d2i_##name(type **a, const unsigned char **in, long len); \ + int i2d_##name(const type *a, unsigned char **out); \ + DECLARE_ASN1_ITEM(name) + +#define DECLARE_ASN1_NDEF_FUNCTION(name) \ + int i2d_##name##_NDEF(name *a, unsigned char **out); + +#define DECLARE_ASN1_FUNCTIONS_const(name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + type *name##_new(void); \ + void name##_free(type *a); + +#define DECLARE_ASN1_PRINT_FUNCTION(stname) \ + DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname) + +#define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \ + int fname##_print_ctx(BIO *out, stname *x, int indent, \ + const ASN1_PCTX *pctx); + +#endif /* !LIBRESSL_INTERNAL */ + +#define D2I_OF(type) type *(*)(type **,const unsigned char **,long) +#define I2D_OF(type) int (*)(type *,unsigned char **) +#define I2D_OF_const(type) int (*)(const type *,unsigned char **) + +#define CHECKED_D2I_OF(type, d2i) \ + ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) +#define CHECKED_I2D_OF(type, i2d) \ + ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) +#define CHECKED_NEW_OF(type, xnew) \ + ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) +#define CHECKED_PTR_OF(type, p) \ + ((void*) (1 ? p : (type*)0)) +#define CHECKED_PPTR_OF(type, p) \ + ((void**) (1 ? p : (type**)0)) + +#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) +#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **) +#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) + +TYPEDEF_D2I2D_OF(void); + +/* The following macros and typedefs allow an ASN1_ITEM + * to be embedded in a structure and referenced. Since + * the ASN1_ITEM pointers need to be globally accessible + * (possibly from shared libraries) they may exist in + * different forms. On platforms that support it the + * ASN1_ITEM structure itself will be globally exported. + * Other platforms will export a function that returns + * an ASN1_ITEM pointer. + * + * To handle both cases transparently the macros below + * should be used instead of hard coding an ASN1_ITEM + * pointer in a structure. + * + * The structure will look like this: + * + * typedef struct SOMETHING_st { + * ... + * ASN1_ITEM_EXP *iptr; + * ... + * } SOMETHING; + * + * It would be initialised as e.g.: + * + * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; + * + * and the actual pointer extracted with: + * + * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); + * + * Finally an ASN1_ITEM pointer can be extracted from an + * appropriate reference with: ASN1_ITEM_rptr(X509). This + * would be used when a function takes an ASN1_ITEM * argument. + * + */ + +/* ASN1_ITEM pointer exported type */ +typedef const ASN1_ITEM ASN1_ITEM_EXP; + +#ifndef LIBRESSL_INTERNAL + +/* Macro to obtain ASN1_ITEM pointer from exported type */ +#define ASN1_ITEM_ptr(iptr) (iptr) + +/* Macro to include ASN1_ITEM pointer from base type */ +#define ASN1_ITEM_ref(iptr) (&(iptr##_it)) + +#define ASN1_ITEM_rptr(ref) (&(ref##_it)) + +#define DECLARE_ASN1_ITEM(name) \ + extern const ASN1_ITEM name##_it; + +#endif /* !LIBRESSL_INTERNAL */ + +/* Parameters used by ASN1_STRING_print_ex() */ + +/* These determine which characters to escape: + * RFC2253 special characters, control characters and + * MSB set characters + */ + +#define ASN1_STRFLGS_ESC_2253 1 +#define ASN1_STRFLGS_ESC_CTRL 2 +#define ASN1_STRFLGS_ESC_MSB 4 + + +/* This flag determines how we do escaping: normally + * RC2253 backslash only, set this to use backslash and + * quote. + */ + +#define ASN1_STRFLGS_ESC_QUOTE 8 + + +/* These three flags are internal use only. */ + +/* Character is a valid PrintableString character */ +#define CHARTYPE_PRINTABLESTRING 0x10 +/* Character needs escaping if it is the first character */ +#define CHARTYPE_FIRST_ESC_2253 0x20 +/* Character needs escaping if it is the last character */ +#define CHARTYPE_LAST_ESC_2253 0x40 + +/* NB the internal flags are safely reused below by flags + * handled at the top level. + */ + +/* If this is set we convert all character strings + * to UTF8 first + */ + +#define ASN1_STRFLGS_UTF8_CONVERT 0x10 + +/* If this is set we don't attempt to interpret content: + * just assume all strings are 1 byte per character. This + * will produce some pretty odd looking output! + */ + +#define ASN1_STRFLGS_IGNORE_TYPE 0x20 + +/* If this is set we include the string type in the output */ +#define ASN1_STRFLGS_SHOW_TYPE 0x40 + +/* This determines which strings to display and which to + * 'dump' (hex dump of content octets or DER encoding). We can + * only dump non character strings or everything. If we + * don't dump 'unknown' they are interpreted as character + * strings with 1 octet per character and are subject to + * the usual escaping options. + */ + +#define ASN1_STRFLGS_DUMP_ALL 0x80 +#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 + +/* These determine what 'dumping' does, we can dump the + * content octets or the DER encoding: both use the + * RFC2253 #NNNNN notation. + */ + +#define ASN1_STRFLGS_DUMP_DER 0x200 + +/* All the string flags consistent with RFC2253, + * escaping control characters isn't essential in + * RFC2253 but it is advisable anyway. + */ + +#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \ + ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB | \ + ASN1_STRFLGS_UTF8_CONVERT | \ + ASN1_STRFLGS_DUMP_UNKNOWN | \ + ASN1_STRFLGS_DUMP_DER) + +DECLARE_STACK_OF(ASN1_INTEGER) + +DECLARE_STACK_OF(ASN1_GENERALSTRING) + +typedef struct asn1_type_st { + int type; + union { + char *ptr; + ASN1_BOOLEAN boolean; + ASN1_STRING * asn1_string; + ASN1_OBJECT * object; + ASN1_INTEGER * integer; + ASN1_ENUMERATED * enumerated; + ASN1_BIT_STRING * bit_string; + ASN1_OCTET_STRING * octet_string; + ASN1_PRINTABLESTRING * printablestring; + ASN1_T61STRING * t61string; + ASN1_IA5STRING * ia5string; + ASN1_GENERALSTRING * generalstring; + ASN1_BMPSTRING * bmpstring; + ASN1_UNIVERSALSTRING * universalstring; + ASN1_UTCTIME * utctime; + ASN1_GENERALIZEDTIME * generalizedtime; + ASN1_VISIBLESTRING * visiblestring; + ASN1_UTF8STRING * utf8string; + /* set and sequence are left complete and still + * contain the set or sequence bytes */ + ASN1_STRING * set; + ASN1_STRING * sequence; + ASN1_VALUE * asn1_value; + } value; +} ASN1_TYPE; + +DECLARE_STACK_OF(ASN1_TYPE) + +typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; + +ASN1_SEQUENCE_ANY *d2i_ASN1_SEQUENCE_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len); +int i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out); +extern const ASN1_ITEM ASN1_SEQUENCE_ANY_it; +ASN1_SEQUENCE_ANY *d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **a, const unsigned char **in, long len); +int i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *a, unsigned char **out); +extern const ASN1_ITEM ASN1_SET_ANY_it; + +/* This is used to contain a list of bit names */ +typedef struct BIT_STRING_BITNAME_st { + int bitnum; + const char *lname; + const char *sname; +} BIT_STRING_BITNAME; + +#define B_ASN1_TIME \ + B_ASN1_UTCTIME | \ + B_ASN1_GENERALIZEDTIME + +#define B_ASN1_PRINTABLE \ + B_ASN1_NUMERICSTRING| \ + B_ASN1_PRINTABLESTRING| \ + B_ASN1_T61STRING| \ + B_ASN1_IA5STRING| \ + B_ASN1_BIT_STRING| \ + B_ASN1_UNIVERSALSTRING|\ + B_ASN1_BMPSTRING|\ + B_ASN1_UTF8STRING|\ + B_ASN1_SEQUENCE|\ + B_ASN1_UNKNOWN + +#define B_ASN1_DIRECTORYSTRING \ + B_ASN1_PRINTABLESTRING| \ + B_ASN1_TELETEXSTRING|\ + B_ASN1_BMPSTRING|\ + B_ASN1_UNIVERSALSTRING|\ + B_ASN1_UTF8STRING + +#define B_ASN1_DISPLAYTEXT \ + B_ASN1_IA5STRING| \ + B_ASN1_VISIBLESTRING| \ + B_ASN1_BMPSTRING|\ + B_ASN1_UTF8STRING + +#ifndef LIBRESSL_INTERNAL +#define M_ASN1_IA5STRING_new ASN1_IA5STRING_new + +#define M_ASN1_INTEGER_free ASN1_INTEGER_free +#define M_ASN1_ENUMERATED_free ASN1_ENUMERATED_free +#define M_ASN1_OCTET_STRING_free ASN1_OCTET_STRING_free + +#define M_ASN1_OCTET_STRING_print ASN1_STRING_print + +#define M_ASN1_STRING_data ASN1_STRING_data +#define M_ASN1_STRING_length ASN1_STRING_length +#endif + +ASN1_TYPE *ASN1_TYPE_new(void); +void ASN1_TYPE_free(ASN1_TYPE *a); +ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len); +int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **out); +extern const ASN1_ITEM ASN1_ANY_it; + +int ASN1_TYPE_get(const ASN1_TYPE *a); +void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); +int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); + +ASN1_OBJECT *ASN1_OBJECT_new(void); +void ASN1_OBJECT_free(ASN1_OBJECT *a); +int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp); +ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long length); +ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long length); + +extern const ASN1_ITEM ASN1_OBJECT_it; + +DECLARE_STACK_OF(ASN1_OBJECT) + +ASN1_STRING *ASN1_STRING_new(void); +void ASN1_STRING_free(ASN1_STRING *a); +int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); +ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a); +ASN1_STRING *ASN1_STRING_type_new(int type); +int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); + /* Since this is used to store all sorts of things, via macros, for now, make + its data void * */ +int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); +void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); +int ASN1_STRING_length(const ASN1_STRING *x); +void ASN1_STRING_length_set(ASN1_STRING *x, int n); +int ASN1_STRING_type(const ASN1_STRING *x); +unsigned char *ASN1_STRING_data(ASN1_STRING *x); +const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); + +ASN1_BIT_STRING *ASN1_BIT_STRING_new(void); +void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a); +ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **in, long len); +int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_BIT_STRING_it; +int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); +ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, + const unsigned char **pp, long length); +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); +int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); +int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, + const unsigned char *flags, int flags_len); + +#ifndef OPENSSL_NO_BIO +int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, + BIT_STRING_BITNAME *tbl, int indent); +#endif +int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl); +int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, + BIT_STRING_BITNAME *tbl); + +ASN1_INTEGER *ASN1_INTEGER_new(void); +void ASN1_INTEGER_free(ASN1_INTEGER *a); +ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **in, long len); +int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **out); +extern const ASN1_ITEM ASN1_INTEGER_it; +int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); +ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, + long length); +ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, + long length); +ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); +int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); + +ASN1_ENUMERATED *ASN1_ENUMERATED_new(void); +void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a); +ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, const unsigned char **in, long len); +int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **out); +extern const ASN1_ITEM ASN1_ENUMERATED_it; + +int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); +ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, + int offset_day, long offset_sec); +int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); + +#ifndef LIBRESSL_INTERNAL +int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); +#endif /* !LIBRESSL_INTERNAL */ + +int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, + time_t t); +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, + time_t t, int offset_day, long offset_sec); +int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); + +ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void); +void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a); +ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, const unsigned char **in, long len); +int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_OCTET_STRING_it; +ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); +int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, + const ASN1_OCTET_STRING *b); +int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, + int len); + +ASN1_VISIBLESTRING *ASN1_VISIBLESTRING_new(void); +void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a); +ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, const unsigned char **in, long len); +int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_VISIBLESTRING_it; +ASN1_UNIVERSALSTRING *ASN1_UNIVERSALSTRING_new(void); +void ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a); +ASN1_UNIVERSALSTRING *d2i_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING **a, const unsigned char **in, long len); +int i2d_ASN1_UNIVERSALSTRING(ASN1_UNIVERSALSTRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_UNIVERSALSTRING_it; +ASN1_UTF8STRING *ASN1_UTF8STRING_new(void); +void ASN1_UTF8STRING_free(ASN1_UTF8STRING *a); +ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, const unsigned char **in, long len); +int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_UTF8STRING_it; +ASN1_NULL *ASN1_NULL_new(void); +void ASN1_NULL_free(ASN1_NULL *a); +ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, const unsigned char **in, long len); +int i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **out); +extern const ASN1_ITEM ASN1_NULL_it; +ASN1_BMPSTRING *ASN1_BMPSTRING_new(void); +void ASN1_BMPSTRING_free(ASN1_BMPSTRING *a); +ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, const unsigned char **in, long len); +int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_BMPSTRING_it; + +ASN1_STRING *ASN1_PRINTABLE_new(void); +void ASN1_PRINTABLE_free(ASN1_STRING *a); +ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, const unsigned char **in, long len); +int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_PRINTABLE_it; + +ASN1_STRING *DIRECTORYSTRING_new(void); +void DIRECTORYSTRING_free(ASN1_STRING *a); +ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, const unsigned char **in, long len); +int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **out); +extern const ASN1_ITEM DIRECTORYSTRING_it; +ASN1_STRING *DISPLAYTEXT_new(void); +void DISPLAYTEXT_free(ASN1_STRING *a); +ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, const unsigned char **in, long len); +int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **out); +extern const ASN1_ITEM DISPLAYTEXT_it; +ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void); +void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a); +ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, const unsigned char **in, long len); +int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_PRINTABLESTRING_it; +ASN1_T61STRING *ASN1_T61STRING_new(void); +void ASN1_T61STRING_free(ASN1_T61STRING *a); +ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, const unsigned char **in, long len); +int i2d_ASN1_T61STRING(ASN1_T61STRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_T61STRING_it; +ASN1_IA5STRING *ASN1_IA5STRING_new(void); +void ASN1_IA5STRING_free(ASN1_IA5STRING *a); +ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, const unsigned char **in, long len); +int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_IA5STRING_it; +ASN1_GENERALSTRING *ASN1_GENERALSTRING_new(void); +void ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a); +ASN1_GENERALSTRING *d2i_ASN1_GENERALSTRING(ASN1_GENERALSTRING **a, const unsigned char **in, long len); +int i2d_ASN1_GENERALSTRING(ASN1_GENERALSTRING *a, unsigned char **out); +extern const ASN1_ITEM ASN1_GENERALSTRING_it; +ASN1_UTCTIME *ASN1_UTCTIME_new(void); +void ASN1_UTCTIME_free(ASN1_UTCTIME *a); +ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, const unsigned char **in, long len); +int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **out); +extern const ASN1_ITEM ASN1_UTCTIME_it; +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_new(void); +void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a); +ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a, const unsigned char **in, long len); +int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **out); +extern const ASN1_ITEM ASN1_GENERALIZEDTIME_it; +ASN1_TIME *ASN1_TIME_new(void); +void ASN1_TIME_free(ASN1_TIME *a); +ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len); +int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out); +extern const ASN1_ITEM ASN1_TIME_it; + +int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, + const ASN1_TIME *to); + +extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it; + +ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); +ASN1_TIME *ASN1_TIME_set_tm(ASN1_TIME *s, struct tm *tm); +ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, + long offset_sec); +int ASN1_TIME_check(const ASN1_TIME *t); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); +int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); + +#ifndef OPENSSL_NO_BIO +int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); +int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); +int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a); +int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); +int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a); +int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); +int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type); +#endif +int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a); + +int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); +ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, + const char *sn, const char *ln); + +int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); +long ASN1_INTEGER_get(const ASN1_INTEGER *a); +ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); +BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); + +int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); +long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); +BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn); + +/* General */ +/* given a string, return the correct type, max is the maximum length */ +int ASN1_PRINTABLE_type(const unsigned char *s, int max); + +/* SPECIALS */ +int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, + int *pclass, long omax); +void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, + int xclass); +int ASN1_put_eoc(unsigned char **pp); +int ASN1_object_size(int constructed, int length, int tag); + +void *ASN1_item_dup(const ASN1_ITEM *it, void *x); + +#ifndef LIBRESSL_INTERNAL + +void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); + +#endif /* !LIBRESSL_INTERNAL */ + +void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); + +#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ + ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + CHECKED_D2I_OF(type, d2i), \ + in, \ + CHECKED_PPTR_OF(type, x))) + +void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); +int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x); + +#define ASN1_i2d_fp_of(type,i2d,out,x) \ + (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + out, \ + CHECKED_PTR_OF(type, x))) + +#define ASN1_i2d_fp_of_const(type,i2d,out,x) \ + (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ + out, \ + CHECKED_PTR_OF(const type, x))) + +int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); +int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, + unsigned long flags); + +int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in); + +#ifndef OPENSSL_NO_BIO +void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); + +#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + CHECKED_D2I_OF(type, d2i), \ + in, \ + CHECKED_PPTR_OF(type, x))) + +void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); +int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x); + +#define ASN1_i2d_bio_of(type,i2d,out,x) \ + (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + out, \ + CHECKED_PTR_OF(type, x))) + +#define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + out, \ + CHECKED_PTR_OF(const type, x))) + +int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); +int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); +int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); +int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); +int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); +int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); +int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, + unsigned char *buf, int off); +int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); +int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump); +#endif + +unsigned long ASN1_tag2bit(int tag); +const char *ASN1_tag2str(int tag); + +int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); + +int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, const unsigned char *data, int len); +int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, + int max_len); +int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, const unsigned char *data, + int len); +int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num, + unsigned char *data, int max_len); + +ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, + ASN1_OCTET_STRING **oct); +void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it); + +void ASN1_STRING_set_default_mask(unsigned long mask); +int ASN1_STRING_set_default_mask_asc(const char *p); +unsigned long ASN1_STRING_get_default_mask(void); +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask); +int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask, long minsize, long maxsize); + +ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, + const unsigned char *in, int inlen, int inform, int nid); +ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); +int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); +void ASN1_STRING_TABLE_cleanup(void); + +/* ASN1 template functions */ + +/* Old API compatible functions */ +ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); +void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); +ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, + long len, const ASN1_ITEM *it); +int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); +int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); + +void ASN1_add_oid_module(void); + +ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); +ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); + +/* ASN1 Print flags */ + +/* Indicate missing OPTIONAL fields */ +#define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 +/* Mark start and end of SEQUENCE */ +#define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 +/* Mark start and end of SEQUENCE/SET OF */ +#define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004 +/* Show the ASN1 type of primitives */ +#define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008 +/* Don't show ASN1 type of ANY */ +#define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010 +/* Don't show ASN1 type of MSTRINGs */ +#define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020 +/* Don't show field names in SEQUENCE */ +#define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040 +/* Show structure names of each SEQUENCE field */ +#define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080 +/* Don't show structure name even at top level */ +#define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 + +int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, + const ASN1_ITEM *it, const ASN1_PCTX *pctx); +ASN1_PCTX *ASN1_PCTX_new(void); +void ASN1_PCTX_free(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); + +const BIO_METHOD *BIO_f_asn1(void); + +BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); + +int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, + const ASN1_ITEM *it); +int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, + const char *hdr, const ASN1_ITEM *it); +int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, + int ctype_nid, int econt_nid, STACK_OF(X509_ALGOR) *mdalgs, + const ASN1_ITEM *it); +ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); +int SMIME_crlf_copy(BIO *in, BIO *out, int flags); +int SMIME_text(BIO *in, BIO *out); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ASN1_strings(void); + +/* Error codes for the ASN1 functions. */ + +/* Function codes. */ +#define ASN1_F_A2D_ASN1_OBJECT 100 +#define ASN1_F_A2I_ASN1_ENUMERATED 101 +#define ASN1_F_A2I_ASN1_INTEGER 102 +#define ASN1_F_A2I_ASN1_STRING 103 +#define ASN1_F_APPEND_EXP 176 +#define ASN1_F_ASN1_BIT_STRING_SET_BIT 183 +#define ASN1_F_ASN1_CB 177 +#define ASN1_F_ASN1_CHECK_TLEN 104 +#define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 +#define ASN1_F_ASN1_COLLECT 106 +#define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 +#define ASN1_F_ASN1_D2I_FP 109 +#define ASN1_F_ASN1_D2I_READ_BIO 107 +#define ASN1_F_ASN1_DIGEST 184 +#define ASN1_F_ASN1_DO_ADB 110 +#define ASN1_F_ASN1_DUP 111 +#define ASN1_F_ASN1_ENUMERATED_SET 112 +#define ASN1_F_ASN1_ENUMERATED_TO_BN 113 +#define ASN1_F_ASN1_EX_C2I 204 +#define ASN1_F_ASN1_FIND_END 190 +#define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216 +#define ASN1_F_ASN1_GENERALIZEDTIME_SET 185 +#define ASN1_F_ASN1_GENERATE_V3 178 +#define ASN1_F_ASN1_GET_OBJECT 114 +#define ASN1_F_ASN1_HEADER_NEW 115 +#define ASN1_F_ASN1_I2D_BIO 116 +#define ASN1_F_ASN1_I2D_FP 117 +#define ASN1_F_ASN1_INTEGER_SET 118 +#define ASN1_F_ASN1_INTEGER_TO_BN 119 +#define ASN1_F_ASN1_ITEM_D2I_FP 206 +#define ASN1_F_ASN1_ITEM_DUP 191 +#define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121 +#define ASN1_F_ASN1_ITEM_EX_D2I 120 +#define ASN1_F_ASN1_ITEM_I2D_BIO 192 +#define ASN1_F_ASN1_ITEM_I2D_FP 193 +#define ASN1_F_ASN1_ITEM_PACK 198 +#define ASN1_F_ASN1_ITEM_SIGN 195 +#define ASN1_F_ASN1_ITEM_SIGN_CTX 220 +#define ASN1_F_ASN1_ITEM_UNPACK 199 +#define ASN1_F_ASN1_ITEM_VERIFY 197 +#define ASN1_F_ASN1_MBSTRING_NCOPY 122 +#define ASN1_F_ASN1_OBJECT_NEW 123 +#define ASN1_F_ASN1_OUTPUT_DATA 214 +#define ASN1_F_ASN1_PACK_STRING 124 +#define ASN1_F_ASN1_PCTX_NEW 205 +#define ASN1_F_ASN1_PKCS5_PBE_SET 125 +#define ASN1_F_ASN1_SEQ_PACK 126 +#define ASN1_F_ASN1_SEQ_UNPACK 127 +#define ASN1_F_ASN1_SIGN 128 +#define ASN1_F_ASN1_STR2TYPE 179 +#define ASN1_F_ASN1_STRING_SET 186 +#define ASN1_F_ASN1_STRING_TABLE_ADD 129 +#define ASN1_F_ASN1_STRING_TYPE_NEW 130 +#define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 +#define ASN1_F_ASN1_TEMPLATE_NEW 133 +#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131 +#define ASN1_F_ASN1_TIME_ADJ 217 +#define ASN1_F_ASN1_TIME_SET 175 +#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 +#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 +#define ASN1_F_ASN1_UNPACK_STRING 136 +#define ASN1_F_ASN1_UTCTIME_ADJ 218 +#define ASN1_F_ASN1_UTCTIME_SET 187 +#define ASN1_F_ASN1_VERIFY 137 +#define ASN1_F_B64_READ_ASN1 209 +#define ASN1_F_B64_WRITE_ASN1 210 +#define ASN1_F_BIO_NEW_NDEF 208 +#define ASN1_F_BITSTR_CB 180 +#define ASN1_F_BN_TO_ASN1_ENUMERATED 138 +#define ASN1_F_BN_TO_ASN1_INTEGER 139 +#define ASN1_F_C2I_ASN1_BIT_STRING 189 +#define ASN1_F_C2I_ASN1_INTEGER 194 +#define ASN1_F_C2I_ASN1_OBJECT 196 +#define ASN1_F_COLLECT_DATA 140 +#define ASN1_F_D2I_ASN1_BIT_STRING 141 +#define ASN1_F_D2I_ASN1_BOOLEAN 142 +#define ASN1_F_D2I_ASN1_BYTES 143 +#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144 +#define ASN1_F_D2I_ASN1_HEADER 145 +#define ASN1_F_D2I_ASN1_INTEGER 146 +#define ASN1_F_D2I_ASN1_OBJECT 147 +#define ASN1_F_D2I_ASN1_SET 148 +#define ASN1_F_D2I_ASN1_TYPE_BYTES 149 +#define ASN1_F_D2I_ASN1_UINTEGER 150 +#define ASN1_F_D2I_ASN1_UTCTIME 151 +#define ASN1_F_D2I_AUTOPRIVATEKEY 207 +#define ASN1_F_D2I_NETSCAPE_RSA 152 +#define ASN1_F_D2I_NETSCAPE_RSA_2 153 +#define ASN1_F_D2I_PRIVATEKEY 154 +#define ASN1_F_D2I_PUBLICKEY 155 +#define ASN1_F_D2I_RSA_NET 200 +#define ASN1_F_D2I_RSA_NET_2 201 +#define ASN1_F_D2I_X509 156 +#define ASN1_F_D2I_X509_CINF 157 +#define ASN1_F_D2I_X509_PKEY 159 +#define ASN1_F_I2D_ASN1_BIO_STREAM 211 +#define ASN1_F_I2D_ASN1_SET 188 +#define ASN1_F_I2D_ASN1_TIME 160 +#define ASN1_F_I2D_DSA_PUBKEY 161 +#define ASN1_F_I2D_EC_PUBKEY 181 +#define ASN1_F_I2D_PRIVATEKEY 163 +#define ASN1_F_I2D_PUBLICKEY 164 +#define ASN1_F_I2D_RSA_NET 162 +#define ASN1_F_I2D_RSA_PUBKEY 165 +#define ASN1_F_LONG_C2I 166 +#define ASN1_F_OID_MODULE_INIT 174 +#define ASN1_F_PARSE_TAGGING 182 +#define ASN1_F_PKCS5_PBE2_SET_IV 167 +#define ASN1_F_PKCS5_PBE_SET 202 +#define ASN1_F_PKCS5_PBE_SET0_ALGOR 215 +#define ASN1_F_PKCS5_PBKDF2_SET 219 +#define ASN1_F_SMIME_READ_ASN1 212 +#define ASN1_F_SMIME_TEXT 213 +#define ASN1_F_X509_CINF_NEW 168 +#define ASN1_F_X509_CRL_ADD0_REVOKED 169 +#define ASN1_F_X509_INFO_NEW 170 +#define ASN1_F_X509_NAME_ENCODE 203 +#define ASN1_F_X509_NAME_EX_D2I 158 +#define ASN1_F_X509_NAME_EX_NEW 171 +#define ASN1_F_X509_NEW 172 +#define ASN1_F_X509_PKEY_NEW 173 + +/* Reason codes. */ +#define ASN1_R_ADDING_OBJECT 171 +#define ASN1_R_ASN1_PARSE_ERROR 203 +#define ASN1_R_ASN1_SIG_PARSE_ERROR 204 +#define ASN1_R_AUX_ERROR 100 +#define ASN1_R_BAD_CLASS 101 +#define ASN1_R_BAD_OBJECT_HEADER 102 +#define ASN1_R_BAD_PASSWORD_READ 103 +#define ASN1_R_BAD_TAG 104 +#define ASN1_R_BAD_TEMPLATE 230 +#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214 +#define ASN1_R_BN_LIB 105 +#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 +#define ASN1_R_BUFFER_TOO_SMALL 107 +#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 +#define ASN1_R_CONTEXT_NOT_INITIALISED 217 +#define ASN1_R_DATA_IS_WRONG 109 +#define ASN1_R_DECODE_ERROR 110 +#define ASN1_R_DECODING_ERROR 111 +#define ASN1_R_DEPTH_EXCEEDED 174 +#define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198 +#define ASN1_R_ENCODE_ERROR 112 +#define ASN1_R_ERROR_GETTING_TIME 173 +#define ASN1_R_ERROR_LOADING_SECTION 172 +#define ASN1_R_ERROR_PARSING_SET_ELEMENT 113 +#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114 +#define ASN1_R_EXPECTING_AN_INTEGER 115 +#define ASN1_R_EXPECTING_AN_OBJECT 116 +#define ASN1_R_EXPECTING_A_BOOLEAN 117 +#define ASN1_R_EXPECTING_A_TIME 118 +#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 +#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 +#define ASN1_R_FIELD_MISSING 121 +#define ASN1_R_FIRST_NUM_TOO_LARGE 122 +#define ASN1_R_HEADER_TOO_LONG 123 +#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175 +#define ASN1_R_ILLEGAL_BOOLEAN 176 +#define ASN1_R_ILLEGAL_CHARACTERS 124 +#define ASN1_R_ILLEGAL_FORMAT 177 +#define ASN1_R_ILLEGAL_HEX 178 +#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179 +#define ASN1_R_ILLEGAL_INTEGER 180 +#define ASN1_R_ILLEGAL_NESTED_TAGGING 181 +#define ASN1_R_ILLEGAL_NULL 125 +#define ASN1_R_ILLEGAL_NULL_VALUE 182 +#define ASN1_R_ILLEGAL_OBJECT 183 +#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 +#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 +#define ASN1_R_ILLEGAL_TAGGED_ANY 127 +#define ASN1_R_ILLEGAL_TIME_VALUE 184 +#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 +#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 +#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220 +#define ASN1_R_INVALID_BMPSTRING_LENGTH 129 +#define ASN1_R_INVALID_DIGIT 130 +#define ASN1_R_INVALID_MIME_TYPE 205 +#define ASN1_R_INVALID_MODIFIER 186 +#define ASN1_R_INVALID_NUMBER 187 +#define ASN1_R_INVALID_OBJECT_ENCODING 216 +#define ASN1_R_INVALID_SEPARATOR 131 +#define ASN1_R_INVALID_TIME_FORMAT 132 +#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 +#define ASN1_R_INVALID_UTF8STRING 134 +#define ASN1_R_IV_TOO_LARGE 135 +#define ASN1_R_LENGTH_ERROR 136 +#define ASN1_R_LIST_ERROR 188 +#define ASN1_R_MIME_NO_CONTENT_TYPE 206 +#define ASN1_R_MIME_PARSE_ERROR 207 +#define ASN1_R_MIME_SIG_PARSE_ERROR 208 +#define ASN1_R_MISSING_EOC 137 +#define ASN1_R_MISSING_SECOND_NUMBER 138 +#define ASN1_R_MISSING_VALUE 189 +#define ASN1_R_MSTRING_NOT_UNIVERSAL 139 +#define ASN1_R_MSTRING_WRONG_TAG 140 +#define ASN1_R_NESTED_ASN1_STRING 197 +#define ASN1_R_NESTED_TOO_DEEP 219 +#define ASN1_R_NON_HEX_CHARACTERS 141 +#define ASN1_R_NOT_ASCII_FORMAT 190 +#define ASN1_R_NOT_ENOUGH_DATA 142 +#define ASN1_R_NO_CONTENT_TYPE 209 +#define ASN1_R_NO_DEFAULT_DIGEST 201 +#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 +#define ASN1_R_NO_MULTIPART_BODY_FAILURE 210 +#define ASN1_R_NO_MULTIPART_BOUNDARY 211 +#define ASN1_R_NO_SIG_CONTENT_TYPE 212 +#define ASN1_R_NULL_IS_WRONG_LENGTH 144 +#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191 +#define ASN1_R_ODD_NUMBER_OF_CHARS 145 +#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 +#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 +#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 +#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 +#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192 +#define ASN1_R_SHORT_LINE 150 +#define ASN1_R_SIG_INVALID_MIME_TYPE 213 +#define ASN1_R_STREAMING_NOT_SUPPORTED 202 +#define ASN1_R_STRING_TOO_LONG 151 +#define ASN1_R_STRING_TOO_SHORT 152 +#define ASN1_R_TAG_VALUE_TOO_HIGH 153 +#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 +#define ASN1_R_TIME_NOT_ASCII_FORMAT 193 +#define ASN1_R_TOO_LONG 155 +#define ASN1_R_TYPE_NOT_CONSTRUCTED 156 +#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 +#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 +#define ASN1_R_UNEXPECTED_EOC 159 +#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215 +#define ASN1_R_UNKNOWN_FORMAT 160 +#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 +#define ASN1_R_UNKNOWN_OBJECT_TYPE 162 +#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 +#define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199 +#define ASN1_R_UNKNOWN_TAG 194 +#define ASN1_R_UNKOWN_FORMAT 195 +#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 +#define ASN1_R_UNSUPPORTED_CIPHER 165 +#define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 +#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 +#define ASN1_R_UNSUPPORTED_TYPE 196 +#define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200 +#define ASN1_R_WRONG_TAG 168 +#define ASN1_R_WRONG_TYPE 169 + + +int ASN1_time_parse(const char *_bytes, size_t _len, struct tm *_tm, int _mode); +int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2); +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/asn1t.h b/code/contrib/libfido2/include/openssl/asn1t.h new file mode 100644 index 0000000..892c8b7 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/asn1t.h @@ -0,0 +1,935 @@ +/* $OpenBSD: asn1t.h,v 1.19 2022/01/14 08:43:06 tb Exp $ */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ASN1T_H +#define HEADER_ASN1T_H + +#include + +#include + +#include + +/* ASN1 template defines, structures and functions */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef LIBRESSL_INTERNAL + +/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ +#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr)) + + +/* Macros for start and end of ASN1_ITEM definition */ + +#define ASN1_ITEM_start(itname) \ + const ASN1_ITEM itname##_it = { + +#define static_ASN1_ITEM_start(itname) \ + static const ASN1_ITEM itname##_it = { + +#define ASN1_ITEM_end(itname) \ + }; + + + +/* Macros to aid ASN1 template writing */ + +#define ASN1_ITEM_TEMPLATE(tname) \ + static const ASN1_TEMPLATE tname##_item_tt + +#define ASN1_ITEM_TEMPLATE_END(tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_PRIMITIVE,\ + -1,\ + &tname##_item_tt,\ + 0,\ + NULL,\ + 0,\ + #tname \ + ASN1_ITEM_end(tname) + +#define static_ASN1_ITEM_TEMPLATE_END(tname) \ + ;\ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_PRIMITIVE,\ + -1,\ + &tname##_item_tt,\ + 0,\ + NULL,\ + 0,\ + #tname \ + ASN1_ITEM_end(tname) + + +/* This is a ASN1 type which just embeds a template */ + +/* + * This pair helps declare a SEQUENCE. We can do: + * + * ASN1_SEQUENCE(stname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END(stname) + * + * This will produce an ASN1_ITEM called stname_it + * for a structure called stname. + * + * If you want the same structure but a different + * name then use: + * + * ASN1_SEQUENCE(itname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END_name(stname, itname) + * + * This will create an item called itname_it using + * a structure called stname. + */ + +#define ASN1_SEQUENCE(tname) \ + static const ASN1_TEMPLATE tname##_seq_tt[] + +#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) + +#define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname) + +#define ASN1_SEQUENCE_END_name(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define static_ASN1_SEQUENCE_END_name(stname, tname) \ + ;\ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE(tname) \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \ + ASN1_SEQUENCE_cb(tname, cb) + +#define ASN1_SEQUENCE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_BROKEN_SEQUENCE(tname) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_ref(tname, cb, lck) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_enc(tname, enc, cb) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_END(tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(tname),\ + #tname \ + ASN1_ITEM_end(tname) + +#define static_ASN1_NDEF_SEQUENCE_END(tname) \ + ;\ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(tname),\ + #tname \ + ASN1_ITEM_end(tname) + +#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) + +#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_ref(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define static_ASN1_SEQUENCE_END_ref(stname, tname) \ + ;\ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + + +/* + * This pair helps declare a CHOICE type. We can do: + * + * ASN1_CHOICE(chname) = { + * ... CHOICE options ... + * ASN1_CHOICE_END(chname) + * + * This will produce an ASN1_ITEM called chname_it + * for a structure called chname. The structure + * definition must look like this: + * typedef struct { + * int type; + * union { + * ASN1_SOMETHING *opt1; + * ASN1_SOMEOTHER *opt2; + * } value; + * } chname; + * + * the name of the selector must be 'type'. + * to use an alternative selector name use the + * ASN1_CHOICE_END_selector() version. + */ + +#define ASN1_CHOICE(tname) \ + static const ASN1_TEMPLATE tname##_ch_tt[] + +#define ASN1_CHOICE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ + ASN1_CHOICE(tname) + +#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) + +#define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname) + +#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) + +#define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type) + +#define ASN1_CHOICE_END_selector(stname, tname, selname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define static_ASN1_CHOICE_END_selector(stname, tname, selname) \ + ;\ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_CHOICE_END_cb(stname, tname, selname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +/* This helps with the template wrapper form of ASN1_ITEM */ + +#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ + (flags), (tag), 0,\ + #name, ASN1_ITEM_ref(type) } + +/* These help with SEQUENCE or CHOICE components */ + +/* used to declare other types */ + +#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ + (flags), (tag), offsetof(stname, field),\ + #field, ASN1_ITEM_ref(type) } + +/* used when the structure is combined with the parent */ + +#define ASN1_EX_COMBINE(flags, tag, type) { \ + (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) } + +/* implicit and explicit helper macros */ + +#define ASN1_IMP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type) + +#define ASN1_EXP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type) + +/* Any defined by macros: the field used is in the table itself */ + +#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } +#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } +/* Plain simple type */ +#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) + +/* OPTIONAL simple type */ +#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* IMPLICIT tagged simple type */ +#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) + +/* IMPLICIT tagged OPTIONAL simple type */ +#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) + +/* Same as above but EXPLICIT */ + +#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) + +/* SEQUENCE OF type */ +#define ASN1_SEQUENCE_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) + +/* OPTIONAL SEQUENCE OF */ +#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Same as above but for SET OF */ + +#define ASN1_SET_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) + +#define ASN1_SET_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ + +#define ASN1_IMP_SET_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_EXP_SET_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) + +/* EXPLICIT using indefinite length constructed form */ +#define ASN1_NDEF_EXP(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) + +/* EXPLICIT OPTIONAL using indefinite length constructed form */ +#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF) + +/* Macros for the ASN1_ADB structure */ + +#define ASN1_ADB(name) \ + static const ASN1_ADB_TABLE name##_adbtbl[] + + +#define ASN1_ADB_END(name, flags, field, app_table, def, none) \ + ;\ + static const ASN1_ADB name##_adb = {\ + flags,\ + offsetof(name, field),\ + app_table,\ + name##_adbtbl,\ + sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ + def,\ + none\ + } + + +#define ADB_ENTRY(val, template) {val, template} + +#define ASN1_ADB_TEMPLATE(name) \ + static const ASN1_TEMPLATE name##_tt + +#endif /* !LIBRESSL_INTERNAL */ + +/* This is the ASN1 template structure that defines + * a wrapper round the actual type. It determines the + * actual position of the field in the value structure, + * various flags such as OPTIONAL and the field name. + */ + +struct ASN1_TEMPLATE_st { + unsigned long flags; /* Various flags */ + long tag; /* tag, not used if no tagging */ + unsigned long offset; /* Offset of this field in structure */ + const char *field_name; /* Field name */ + ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ +}; + +/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ + +#define ASN1_TEMPLATE_item(t) (t->item_ptr) +#define ASN1_TEMPLATE_adb(t) (t->item_ptr) + +typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; +typedef struct ASN1_ADB_st ASN1_ADB; + +struct ASN1_ADB_st { + unsigned long flags; /* Various flags */ + unsigned long offset; /* Offset of selector field */ + const ASN1_ADB_TABLE *tbl; /* Table of possible types */ + long tblcount; /* Number of entries in tbl */ + const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ + const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ +}; + +struct ASN1_ADB_TABLE_st { + long value; /* NID for an object or value for an int */ + const ASN1_TEMPLATE tt; /* item for this value */ +}; + +/* template flags */ + +/* Field is optional */ +#define ASN1_TFLG_OPTIONAL (0x1) + +/* Field is a SET OF */ +#define ASN1_TFLG_SET_OF (0x1 << 1) + +/* Field is a SEQUENCE OF */ +#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) + +/* Special case: this refers to a SET OF that + * will be sorted into DER order when encoded *and* + * the corresponding STACK will be modified to match + * the new order. + */ +#define ASN1_TFLG_SET_ORDER (0x3 << 1) + +/* Mask for SET OF or SEQUENCE OF */ +#define ASN1_TFLG_SK_MASK (0x3 << 1) + +/* These flags mean the tag should be taken from the + * tag field. If EXPLICIT then the underlying type + * is used for the inner tag. + */ + +/* IMPLICIT tagging */ +#define ASN1_TFLG_IMPTAG (0x1 << 3) + + +/* EXPLICIT tagging, inner tag from underlying type */ +#define ASN1_TFLG_EXPTAG (0x2 << 3) + +#define ASN1_TFLG_TAG_MASK (0x3 << 3) + +/* context specific IMPLICIT */ +#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT + +/* context specific EXPLICIT */ +#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT + +/* + * If tagging is in force these determine the type of tag to use. Otherwiser + * the tag is determined by the underlying type. These values reflect the + * actual octet format. + */ + +/* Universal tag */ +#define ASN1_TFLG_UNIVERSAL (0x0<<6) +/* Application tag */ +#define ASN1_TFLG_APPLICATION (0x1<<6) +/* Context specific tag */ +#define ASN1_TFLG_CONTEXT (0x2<<6) +/* Private tag */ +#define ASN1_TFLG_PRIVATE (0x3<<6) + +#define ASN1_TFLG_TAG_CLASS (0x3<<6) + +/* + * These are for ANY DEFINED BY type. In this case + * the 'item' field points to an ASN1_ADB structure + * which contains a table of values to decode the + * relevant type + */ + +#define ASN1_TFLG_ADB_MASK (0x3<<8) + +#define ASN1_TFLG_ADB_OID (0x1<<8) + +#define ASN1_TFLG_ADB_INT (0x1<<9) + +/* + * This flag means a parent structure is passed + * instead of the field: this is useful is a + * SEQUENCE is being combined with a CHOICE for + * example. Since this means the structure and + * item name will differ we need to use the + * ASN1_CHOICE_END_name() macro for example. + */ + +#define ASN1_TFLG_COMBINE (0x1<<10) + +/* + * This flag when present in a SEQUENCE OF, SET OF + * or EXPLICIT causes indefinite length constructed + * encoding to be used if required. + */ + +#define ASN1_TFLG_NDEF (0x1<<11) + +/* This is the actual ASN1 item itself */ + +struct ASN1_ITEM_st { + char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ + long utype; /* underlying type */ + const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */ + long tcount; /* Number of templates if SEQUENCE or CHOICE */ + const void *funcs; /* functions that handle this type */ + long size; /* Structure size (usually)*/ + const char *sname; /* Structure name */ +}; + +/* These are values for the itype field and + * determine how the type is interpreted. + * + * For PRIMITIVE types the underlying type + * determines the behaviour if items is NULL. + * + * Otherwise templates must contain a single + * template and the type is treated in the + * same way as the type specified in the template. + * + * For SEQUENCE types the templates field points + * to the members, the size field is the + * structure size. + * + * For CHOICE types the templates field points + * to each possible member (typically a union) + * and the 'size' field is the offset of the + * selector. + * + * The 'funcs' field is used for application + * specific functions. + * + * The EXTERN type uses a new style d2i/i2d. + * The new style should be used where possible + * because it avoids things like the d2i IMPLICIT + * hack. + * + * MSTRING is a multiple string type, it is used + * for a CHOICE of character strings where the + * actual strings all occupy an ASN1_STRING + * structure. In this case the 'utype' field + * has a special meaning, it is used as a mask + * of acceptable types using the B_ASN1 constants. + * + * NDEF_SEQUENCE is the same as SEQUENCE except + * that it will use indefinite length constructed + * encoding if requested. + * + */ + +#define ASN1_ITYPE_PRIMITIVE 0x0 + +#define ASN1_ITYPE_SEQUENCE 0x1 + +#define ASN1_ITYPE_CHOICE 0x2 + +#define ASN1_ITYPE_EXTERN 0x4 + +#define ASN1_ITYPE_MSTRING 0x5 + +#define ASN1_ITYPE_NDEF_SEQUENCE 0x6 + +/* Cache for ASN1 tag and length, so we + * don't keep re-reading it for things + * like CHOICE + */ + +struct ASN1_TLC_st { + char valid; /* Values below are valid */ + int ret; /* return value */ + long plen; /* length */ + int ptag; /* class value */ + int pclass; /* class value */ + int hdrlen; /* header length */ +}; + +/* Typedefs for ASN1 function pointers */ + +typedef ASN1_VALUE * ASN1_new_func(void); +typedef void ASN1_free_func(ASN1_VALUE *a); +typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length); +typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); + +typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); +typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); +typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); + +typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval, + int indent, const char *fname, + const ASN1_PCTX *pctx); + +typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); +typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); +typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx); + +typedef struct ASN1_EXTERN_FUNCS_st { + void *app_data; + ASN1_ex_new_func *asn1_ex_new; + ASN1_ex_free_func *asn1_ex_free; + ASN1_ex_free_func *asn1_ex_clear; + ASN1_ex_d2i *asn1_ex_d2i; + ASN1_ex_i2d *asn1_ex_i2d; + ASN1_ex_print_func *asn1_ex_print; +} ASN1_EXTERN_FUNCS; + +typedef struct ASN1_PRIMITIVE_FUNCS_st { + void *app_data; + unsigned long flags; + ASN1_ex_new_func *prim_new; + ASN1_ex_free_func *prim_free; + ASN1_ex_free_func *prim_clear; + ASN1_primitive_c2i *prim_c2i; + ASN1_primitive_i2c *prim_i2c; + ASN1_primitive_print *prim_print; +} ASN1_PRIMITIVE_FUNCS; + +/* This is the ASN1_AUX structure: it handles various + * miscellaneous requirements. For example the use of + * reference counts and an informational callback. + * + * The "informational callback" is called at various + * points during the ASN1 encoding and decoding. It can + * be used to provide minor customisation of the structures + * used. This is most useful where the supplied routines + * *almost* do the right thing but need some extra help + * at a few points. If the callback returns zero then + * it is assumed a fatal error has occurred and the + * main operation should be abandoned. + * + * If major changes in the default behaviour are required + * then an external type is more appropriate. + */ + +typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it, + void *exarg); + +typedef struct ASN1_AUX_st { + void *app_data; + int flags; + int ref_offset; /* Offset of reference value */ + int ref_lock; /* Lock type to use */ + ASN1_aux_cb *asn1_cb; + int enc_offset; /* Offset of ASN1_ENCODING structure */ +} ASN1_AUX; + +/* For print related callbacks exarg points to this structure */ +typedef struct ASN1_PRINT_ARG_st { + BIO *out; + int indent; + const ASN1_PCTX *pctx; +} ASN1_PRINT_ARG; + +/* For streaming related callbacks exarg points to this structure */ +typedef struct ASN1_STREAM_ARG_st { + /* BIO to stream through */ + BIO *out; + /* BIO with filters appended */ + BIO *ndef_bio; + /* Streaming I/O boundary */ + unsigned char **boundary; +} ASN1_STREAM_ARG; + +/* Flags in ASN1_AUX */ + +/* Use a reference count */ +#define ASN1_AFLG_REFCOUNT 1 +/* Save the encoding of structure (useful for signatures) */ +#define ASN1_AFLG_ENCODING 2 +/* The Sequence length is invalid */ +#define ASN1_AFLG_BROKEN 4 + +/* operation values for asn1_cb */ + +#define ASN1_OP_NEW_PRE 0 +#define ASN1_OP_NEW_POST 1 +#define ASN1_OP_FREE_PRE 2 +#define ASN1_OP_FREE_POST 3 +#define ASN1_OP_D2I_PRE 4 +#define ASN1_OP_D2I_POST 5 +#define ASN1_OP_I2D_PRE 6 +#define ASN1_OP_I2D_POST 7 +#define ASN1_OP_PRINT_PRE 8 +#define ASN1_OP_PRINT_POST 9 +#define ASN1_OP_STREAM_PRE 10 +#define ASN1_OP_STREAM_POST 11 +#define ASN1_OP_DETACHED_PRE 12 +#define ASN1_OP_DETACHED_POST 13 + +#ifndef LIBRESSL_INTERNAL + +/* Macro to implement a primitive type */ +#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) +#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ + ASN1_ITEM_end(itname) + +/* Macro to implement a multi string type */ +#define IMPLEMENT_ASN1_MSTRING(itname, mask) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ + ASN1_ITEM_end(itname) +#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ + ASN1_ITEM_start(sname) \ + ASN1_ITYPE_EXTERN, \ + tag, \ + NULL, \ + 0, \ + &fptrs, \ + 0, \ + #sname \ + ASN1_ITEM_end(sname) + +/* Macro to implement standard functions in terms of ASN1_ITEM structures */ + +#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) + +#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ + IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) + +#define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \ + pre stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + pre void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ + stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ + } \ + int i2d_##fname(stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + } + +#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ + int i2d_##stname##_NDEF(stname *a, unsigned char **out) \ + { \ + return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ + } + +/* This includes evil casts to remove const: they will go away when full + * ASN1 constification is done. + */ +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ + } \ + int i2d_##fname(const stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + } + +#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ + stname * stname##_dup(stname *x) \ + { \ + return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ + } + +#define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \ + IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \ + int fname##_print_ctx(BIO *out, stname *x, int indent, \ + const ASN1_PCTX *pctx) \ + { \ + return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \ + ASN1_ITEM_rptr(itname), pctx); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ + IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) + +#define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +#endif /* !LIBRESSL_INTERNAL */ + +/* external definitions for primitive types */ + +extern const ASN1_ITEM ASN1_BOOLEAN_it; +extern const ASN1_ITEM ASN1_TBOOLEAN_it; +extern const ASN1_ITEM ASN1_FBOOLEAN_it; +extern const ASN1_ITEM ASN1_SEQUENCE_it; +extern const ASN1_ITEM CBIGNUM_it; +extern const ASN1_ITEM BIGNUM_it; +extern const ASN1_ITEM LONG_it; +extern const ASN1_ITEM ZLONG_it; + +DECLARE_STACK_OF(ASN1_VALUE) + +/* Functions used internally by the ASN1 code */ + +int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); +void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); + +void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt); +int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); +int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt); +void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/bio.h b/code/contrib/libfido2/include/openssl/bio.h new file mode 100644 index 0000000..d4bf8cb --- /dev/null +++ b/code/contrib/libfido2/include/openssl/bio.h @@ -0,0 +1,781 @@ +/* $OpenBSD: bio.h,v 1.54 2022/01/14 08:40:57 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_BIO_H +#define HEADER_BIO_H +#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__) +#define __bounded__(x, y, z) +#endif +#include + +# include +#include + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* These are the 'types' of BIOs */ +#define BIO_TYPE_NONE 0 +#define BIO_TYPE_MEM (1|0x0400) +#define BIO_TYPE_FILE (2|0x0400) + +#define BIO_TYPE_FD (4|0x0400|0x0100) +#define BIO_TYPE_SOCKET (5|0x0400|0x0100) +#define BIO_TYPE_NULL (6|0x0400) +#define BIO_TYPE_SSL (7|0x0200) +#define BIO_TYPE_MD (8|0x0200) /* passive filter */ +#define BIO_TYPE_BUFFER (9|0x0200) /* filter */ +#define BIO_TYPE_CIPHER (10|0x0200) /* filter */ +#define BIO_TYPE_BASE64 (11|0x0200) /* filter */ +#define BIO_TYPE_CONNECT (12|0x0400|0x0100) /* socket - connect */ +#define BIO_TYPE_ACCEPT (13|0x0400|0x0100) /* socket for accept */ +#define BIO_TYPE_PROXY_CLIENT (14|0x0200) /* client proxy BIO */ +#define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */ +#define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */ +#define BIO_TYPE_NULL_FILTER (17|0x0200) +#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */ +#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ +#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ +#define BIO_TYPE_DGRAM (21|0x0400|0x0100) +#define BIO_TYPE_ASN1 (22|0x0200) /* filter */ +#define BIO_TYPE_COMP (23|0x0200) /* filter */ + +#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ +#define BIO_TYPE_FILTER 0x0200 +#define BIO_TYPE_SOURCE_SINK 0x0400 + +/* + * BIO_TYPE_START is the first user-allocated BIO type. No pre-defined type, + * flag bits aside, may exceed this value. + */ +#define BIO_TYPE_START 128 + +/* BIO_FILENAME_READ|BIO_CLOSE to open or close on free. + * BIO_set_fp(in,stdin,BIO_NOCLOSE); */ +#define BIO_NOCLOSE 0x00 +#define BIO_CLOSE 0x01 + +/* These are used in the following macros and are passed to + * BIO_ctrl() */ +#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */ +#define BIO_CTRL_EOF 2 /* opt - are we at the eof */ +#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */ +#define BIO_CTRL_SET 4 /* man - set the 'IO' type */ +#define BIO_CTRL_GET 5 /* man - get the 'IO' type */ +#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */ +#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */ +#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */ +#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */ +#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */ +#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */ +#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */ +#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */ +/* callback is int cb(BIO *bio,state,ret); */ +#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */ +#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */ + +#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */ + +/* dgram BIO stuff */ +#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */ +#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally + * connected socket to be + * passed in */ +#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */ +#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */ +#define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35 /* setsockopt, essentially */ +#define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36 /* getsockopt, essentially */ + +#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */ +#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */ + +/* #ifdef IP_MTU_DISCOVER */ +#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */ +/* #endif */ + +#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ +#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47 +#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ +#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for + * MTU. want to use this + * if asking the kernel + * fails */ + +#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU + * was exceed in the + * previous write + * operation */ + +#define BIO_CTRL_DGRAM_GET_PEER 46 +#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ + +#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to + * adjust socket timeouts */ + + +/* modifiers */ +#define BIO_FP_READ 0x02 +#define BIO_FP_WRITE 0x04 +#define BIO_FP_APPEND 0x08 +#define BIO_FP_TEXT 0x10 + +#define BIO_FLAGS_READ 0x01 +#define BIO_FLAGS_WRITE 0x02 +#define BIO_FLAGS_IO_SPECIAL 0x04 +#define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL) +#define BIO_FLAGS_SHOULD_RETRY 0x08 + +/* Used in BIO_gethostbyname() */ +#define BIO_GHBN_CTRL_HITS 1 +#define BIO_GHBN_CTRL_MISSES 2 +#define BIO_GHBN_CTRL_CACHE_SIZE 3 +#define BIO_GHBN_CTRL_GET_ENTRY 4 +#define BIO_GHBN_CTRL_FLUSH 5 + +/* Mostly used in the SSL BIO */ +/* Not used anymore + * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10 + * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20 + * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40 + */ + +#define BIO_FLAGS_BASE64_NO_NL 0x100 + +/* This is used with memory BIOs: it means we shouldn't free up or change the + * data in any way. + */ +#define BIO_FLAGS_MEM_RDONLY 0x200 + +void BIO_set_flags(BIO *b, int flags); +int BIO_test_flags(const BIO *b, int flags); +void BIO_clear_flags(BIO *b, int flags); + +#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) +#define BIO_set_retry_special(b) \ + BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY)) +#define BIO_set_retry_read(b) \ + BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY)) +#define BIO_set_retry_write(b) \ + BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY)) + +/* These are normally used internally in BIOs */ +#define BIO_clear_retry_flags(b) \ + BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) +#define BIO_get_retry_flags(b) \ + BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) + +/* These should be used by the application to tell why we should retry */ +#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) +#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) +#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) +#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) +#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) + +/* The next three are used in conjunction with the + * BIO_should_io_special() condition. After this returns true, + * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO + * stack and return the 'reason' for the special and the offending BIO. + * Given a BIO, BIO_get_retry_reason(bio) will return the code. */ +/* Returned from the SSL bio when the certificate retrieval code had an error */ +#define BIO_RR_SSL_X509_LOOKUP 0x01 +/* Returned from the connect BIO when a connect would have blocked */ +#define BIO_RR_CONNECT 0x02 +/* Returned from the accept BIO when an accept would have blocked */ +#define BIO_RR_ACCEPT 0x03 + +/* These are passed by the BIO callback */ +#define BIO_CB_FREE 0x01 +#define BIO_CB_READ 0x02 +#define BIO_CB_WRITE 0x03 +#define BIO_CB_PUTS 0x04 +#define BIO_CB_GETS 0x05 +#define BIO_CB_CTRL 0x06 + +/* + * The callback is called before and after the underling operation, + * the BIO_CB_RETURN flag indicates if it is after the call. + */ +#define BIO_CB_RETURN 0x80 +#define BIO_CB_return(a) ((a)|BIO_CB_RETURN)) +#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) +#define BIO_cb_post(a) ((a)&BIO_CB_RETURN) + +typedef long (*BIO_callback_fn)(BIO *b, int oper, const char *argp, int argi, + long argl, long ret); +typedef long (*BIO_callback_fn_ex)(BIO *b, int oper, const char *argp, + size_t len, int argi, long argl, int ret, size_t *processed); + +BIO_callback_fn BIO_get_callback(const BIO *b); +void BIO_set_callback(BIO *b, BIO_callback_fn callback); + +BIO_callback_fn_ex BIO_get_callback_ex(const BIO *b); +void BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex callback); + +char *BIO_get_callback_arg(const BIO *b); +void BIO_set_callback_arg(BIO *b, char *arg); + +const char *BIO_method_name(const BIO *b); +int BIO_method_type(const BIO *b); + +typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); +typedef int BIO_info_cb(BIO *, int, int); + +typedef struct bio_method_st BIO_METHOD; + +DECLARE_STACK_OF(BIO) + +/* Prefix and suffix callback in ASN1 BIO */ +typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); + +/* BIO_METHOD accessors */ +BIO_METHOD *BIO_meth_new(int type, const char *name); +void BIO_meth_free(BIO_METHOD *biom); +int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int); +int BIO_meth_set_write(BIO_METHOD *biom, + int (*write)(BIO *, const char *, int)); +int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int); +int BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int)); +int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *); +int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *)); +int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int); +int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets)(BIO *, char *, int)); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *); +int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl)(BIO *, int, long, void *)); +int (*BIO_meth_get_create(const BIO_METHOD *biom))(BIO *); +int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *); +int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *); +int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, + long (*callback_ctrl)(BIO *, int, BIO_info_cb *)); + +/* connect BIO stuff */ +#define BIO_CONN_S_BEFORE 1 +#define BIO_CONN_S_GET_IP 2 +#define BIO_CONN_S_GET_PORT 3 +#define BIO_CONN_S_CREATE_SOCKET 4 +#define BIO_CONN_S_CONNECT 5 +#define BIO_CONN_S_OK 6 +#define BIO_CONN_S_BLOCKED_CONNECT 7 +#define BIO_CONN_S_NBIO 8 +/*#define BIO_CONN_get_param_hostname BIO_ctrl */ + +#define BIO_C_SET_CONNECT 100 +#define BIO_C_DO_STATE_MACHINE 101 +#define BIO_C_SET_NBIO 102 +#define BIO_C_SET_PROXY_PARAM 103 +#define BIO_C_SET_FD 104 +#define BIO_C_GET_FD 105 +#define BIO_C_SET_FILE_PTR 106 +#define BIO_C_GET_FILE_PTR 107 +#define BIO_C_SET_FILENAME 108 +#define BIO_C_SET_SSL 109 +#define BIO_C_GET_SSL 110 +#define BIO_C_SET_MD 111 +#define BIO_C_GET_MD 112 +#define BIO_C_GET_CIPHER_STATUS 113 +#define BIO_C_SET_BUF_MEM 114 +#define BIO_C_GET_BUF_MEM_PTR 115 +#define BIO_C_GET_BUFF_NUM_LINES 116 +#define BIO_C_SET_BUFF_SIZE 117 +#define BIO_C_SET_ACCEPT 118 +#define BIO_C_SSL_MODE 119 +#define BIO_C_GET_MD_CTX 120 +#define BIO_C_GET_PROXY_PARAM 121 +#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */ +#define BIO_C_GET_CONNECT 123 +#define BIO_C_GET_ACCEPT 124 +#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 +#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 +#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 +#define BIO_C_FILE_SEEK 128 +#define BIO_C_GET_CIPHER_CTX 129 +#define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/ +#define BIO_C_SET_BIND_MODE 131 +#define BIO_C_GET_BIND_MODE 132 +#define BIO_C_FILE_TELL 133 +#define BIO_C_GET_SOCKS 134 +#define BIO_C_SET_SOCKS 135 + +#define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */ +#define BIO_C_GET_WRITE_BUF_SIZE 137 +#define BIO_C_MAKE_BIO_PAIR 138 +#define BIO_C_DESTROY_BIO_PAIR 139 +#define BIO_C_GET_WRITE_GUARANTEE 140 +#define BIO_C_GET_READ_REQUEST 141 +#define BIO_C_SHUTDOWN_WR 142 +#define BIO_C_NREAD0 143 +#define BIO_C_NREAD 144 +#define BIO_C_NWRITE0 145 +#define BIO_C_NWRITE 146 +#define BIO_C_RESET_READ_REQUEST 147 +#define BIO_C_SET_MD_CTX 148 + +#define BIO_C_SET_PREFIX 149 +#define BIO_C_GET_PREFIX 150 +#define BIO_C_SET_SUFFIX 151 +#define BIO_C_GET_SUFFIX 152 + +#define BIO_C_SET_EX_ARG 153 +#define BIO_C_GET_EX_ARG 154 + +#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) +#define BIO_get_app_data(s) BIO_get_ex_data(s,0) + +/* BIO_s_connect() and BIO_s_socks4a_connect() */ +#define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name) +#define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port) +#define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip) +#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port) +#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) +#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) +#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) +#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0) + + +#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) + +/* BIO_s_accept_socket() */ +#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) +#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) +/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ +#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL) +#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) + +#define BIO_BIND_NORMAL 0 +#define BIO_BIND_REUSEADDR_IF_UNUSED 1 +#define BIO_BIND_REUSEADDR 2 +#define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) +#define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) + +#define BIO_do_connect(b) BIO_do_handshake(b) +#define BIO_do_accept(b) BIO_do_handshake(b) +#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) + +/* BIO_s_proxy_client() */ +#define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url)) +#define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p)) +/* BIO_set_nbio(b,n) */ +#define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) +/* BIO *BIO_get_filter_bio(BIO *bio); */ +#define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) +#define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) +#define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) + +#define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp) +#define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p)) +#define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) +#define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) + +#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) +#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) + +#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) +#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) + +#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) +#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) + +/* name is cast to lose const, but might be better to route through a function + so we can do it safely */ +#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_READ,(char *)name) +#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_WRITE,name) +#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_APPEND,name) +#define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name) + +/* WARNING WARNING, this ups the reference count on the read bio of the + * SSL structure. This is because the ssl read BIO is now pointed to by + * the next_bio field in the bio. So when you free the BIO, make sure + * you are doing a BIO_free_all() to catch the underlying BIO. */ +#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl) +#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) +#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) +#define BIO_set_ssl_renegotiate_bytes(b,num) \ + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL) +#define BIO_get_num_renegotiates(b) \ + BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL) +#define BIO_set_ssl_renegotiate_timeout(b,seconds) \ + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL) + +/* defined in evp.h */ +/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ + +#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp) +#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm) +#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp) +#define BIO_set_mem_eof_return(b,v) \ + BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL) + +/* For the BIO_f_buffer() type */ +#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) +#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL) +#define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) +#define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1) +#define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf) + +/* Don't use the next one unless you know what you are doing :-) */ +#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret)) + +#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) +#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL) +#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL) +#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL) +#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL) +#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL) +/* ...pending macros have inappropriate return type */ +size_t BIO_ctrl_pending(BIO *b); +size_t BIO_ctrl_wpending(BIO *b); +#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) +#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \ + cbp) +#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb) + +/* For the BIO_f_buffer() type */ +#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) + +/* For BIO_s_bio() */ +#define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL) +#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL) +#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) +#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) +#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) +/* macros with inappropriate type -- but ...pending macros use int too: */ +#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) +#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) +size_t BIO_ctrl_get_write_guarantee(BIO *b); +size_t BIO_ctrl_get_read_request(BIO *b); +int BIO_ctrl_reset_read_request(BIO *b); + +/* ctrl macros for dgram */ +#define BIO_ctrl_dgram_connect(b,peer) \ + (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer) +#define BIO_ctrl_set_connected(b, state, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer) +#define BIO_dgram_recv_timedout(b) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL) +#define BIO_dgram_send_timedout(b) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL) +#define BIO_dgram_get_peer(b,peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer) +#define BIO_dgram_set_peer(b,peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer) + +/* These two aren't currently implemented */ +/* int BIO_get_ex_num(BIO *bio); */ +/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ +int BIO_set_ex_data(BIO *bio, int idx, void *data); +void *BIO_get_ex_data(BIO *bio, int idx); +int +BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, +CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +unsigned long BIO_number_read(BIO *bio); +unsigned long BIO_number_written(BIO *bio); + +/* For BIO_f_asn1() */ +int +BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, +asn1_ps_func *prefix_free); +int +BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, +asn1_ps_func **pprefix_free); +int +BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, +asn1_ps_func *suffix_free); +int +BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, +asn1_ps_func **psuffix_free); + +int BIO_get_new_index(void); +const BIO_METHOD *BIO_s_file(void); +BIO *BIO_new_file(const char *filename, const char *mode); +BIO *BIO_new_fp(FILE *stream, int close_flag); +BIO *BIO_new(const BIO_METHOD *type); +int BIO_set(BIO *a, const BIO_METHOD *type); +int BIO_free(BIO *a); +int BIO_up_ref(BIO *bio); +void *BIO_get_data(BIO *a); +void BIO_set_data(BIO *a, void *ptr); +int BIO_get_init(BIO *a); +void BIO_set_init(BIO *a, int init); +int BIO_get_shutdown(BIO *a); +void BIO_set_shutdown(BIO *a, int shut); +void BIO_vfree(BIO *a); +int BIO_read(BIO *b, void *data, int len) + __attribute__((__bounded__(__buffer__,2,3))); +int BIO_gets(BIO *bp, char *buf, int size) + __attribute__((__bounded__ (__string__,2,3))); +int BIO_write(BIO *b, const void *data, int len) + __attribute__((__bounded__(__buffer__,2,3))); +int BIO_puts(BIO *bp, const char *buf); +int BIO_indent(BIO *b, int indent, int max); +long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); +char * BIO_ptr_ctrl(BIO *bp, int cmd, long larg); +long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); +BIO * BIO_push(BIO *b, BIO *append); +BIO * BIO_pop(BIO *b); +void BIO_free_all(BIO *a); +BIO * BIO_find_type(BIO *b, int bio_type); +BIO * BIO_next(BIO *b); +void BIO_set_next(BIO *b, BIO *next); +BIO * BIO_get_retry_BIO(BIO *bio, int *reason); +int BIO_get_retry_reason(BIO *bio); +void BIO_set_retry_reason(BIO *bio, int reason); +BIO * BIO_dup_chain(BIO *in); + +int BIO_nread0(BIO *bio, char **buf); +int BIO_nread(BIO *bio, char **buf, int num); +int BIO_nwrite0(BIO *bio, char **buf); +int BIO_nwrite(BIO *bio, char **buf, int num); + +long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, + long argl, long ret); + +const BIO_METHOD *BIO_s_mem(void); +BIO *BIO_new_mem_buf(const void *buf, int len); +const BIO_METHOD *BIO_s_socket(void); +const BIO_METHOD *BIO_s_connect(void); +const BIO_METHOD *BIO_s_accept(void); +const BIO_METHOD *BIO_s_fd(void); +const BIO_METHOD *BIO_s_log(void); +const BIO_METHOD *BIO_s_bio(void); +const BIO_METHOD *BIO_s_null(void); +const BIO_METHOD *BIO_f_null(void); +const BIO_METHOD *BIO_f_buffer(void); +const BIO_METHOD *BIO_f_nbio_test(void); +#ifndef OPENSSL_NO_DGRAM +const BIO_METHOD *BIO_s_datagram(void); +#endif + +/* BIO_METHOD *BIO_f_ber(void); */ + +int BIO_sock_should_retry(int i); +int BIO_sock_non_fatal_error(int _error); +int BIO_dgram_non_fatal_error(int _error); + +int BIO_fd_should_retry(int i); +int BIO_fd_non_fatal_error(int _error); +int +BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u), +void *u, const char *s, int len); +int +BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), +void *u, const char *s, int len, int indent); +int BIO_dump(BIO *b, const char *bytes, int len); +int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent); +int BIO_dump_fp(FILE *fp, const char *s, int len); +int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent); +struct hostent *BIO_gethostbyname(const char *name); +/* We might want a thread-safe interface too: + * struct hostent *BIO_gethostbyname_r(const char *name, + * struct hostent *result, void *buffer, size_t buflen); + * or something similar (caller allocates a struct hostent, + * pointed to by "result", and additional buffer space for the various + * substructures; if the buffer does not suffice, NULL is returned + * and an appropriate error code is set). + */ +int BIO_sock_error(int sock); +int BIO_socket_ioctl(int fd, long type, void *arg); +int BIO_socket_nbio(int fd, int mode); +int BIO_get_port(const char *str, unsigned short *port_ptr); +int BIO_get_host_ip(const char *str, unsigned char *ip); +int BIO_get_accept_socket(char *host_port, int mode); +int BIO_accept(int sock, char **ip_port); +int BIO_sock_init(void ); +void BIO_sock_cleanup(void); +int BIO_set_tcp_ndelay(int sock, int turn_on); + +BIO *BIO_new_socket(int sock, int close_flag); +BIO *BIO_new_dgram(int fd, int close_flag); +BIO *BIO_new_fd(int fd, int close_flag); +BIO *BIO_new_connect(const char *host_port); +BIO *BIO_new_accept(const char *host_port); + +int +BIO_new_bio_pair(BIO **bio1, size_t writebuf1, +BIO **bio2, size_t writebuf2); +/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. + * Size 0 uses default value. + */ + +void BIO_copy_next_retry(BIO *b); + +/*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/ + +#ifdef __MINGW_PRINTF_FORMAT +int +BIO_printf(BIO *bio, const char *format, ...) + __attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 3), __nonnull__(2))); +int +BIO_vprintf(BIO *bio, const char *format, va_list args) + __attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 0), __nonnull__(2))); +int +BIO_snprintf(char *buf, size_t n, const char *format, ...) + __attribute__((__deprecated__, __format__(__MINGW_PRINTF_FORMAT, 3, 4), + __nonnull__(3))); +int +BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) + __attribute__((__deprecated__, __format__(__MINGW_PRINTF_FORMAT, 3, 0), + __nonnull__(3))); +#else +int +BIO_printf(BIO *bio, const char *format, ...) + __attribute__((__format__(__printf__, 2, 3), __nonnull__(2))); +int +BIO_vprintf(BIO *bio, const char *format, va_list args) + __attribute__((__format__(__printf__, 2, 0), __nonnull__(2))); +int +BIO_snprintf(char *buf, size_t n, const char *format, ...) + __attribute__((__deprecated__, __format__(__printf__, 3, 4), + __nonnull__(3))); +int +BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) + __attribute__((__deprecated__, __format__(__printf__, 3, 0), + __nonnull__(3))); +#endif + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_BIO_strings(void); + +/* Error codes for the BIO functions. */ + +/* Function codes. */ +#define BIO_F_ACPT_STATE 100 +#define BIO_F_BIO_ACCEPT 101 +#define BIO_F_BIO_BER_GET_HEADER 102 +#define BIO_F_BIO_CALLBACK_CTRL 131 +#define BIO_F_BIO_CTRL 103 +#define BIO_F_BIO_GETHOSTBYNAME 120 +#define BIO_F_BIO_GETS 104 +#define BIO_F_BIO_GET_ACCEPT_SOCKET 105 +#define BIO_F_BIO_GET_HOST_IP 106 +#define BIO_F_BIO_GET_PORT 107 +#define BIO_F_BIO_MAKE_PAIR 121 +#define BIO_F_BIO_NEW 108 +#define BIO_F_BIO_NEW_FILE 109 +#define BIO_F_BIO_NEW_MEM_BUF 126 +#define BIO_F_BIO_NREAD 123 +#define BIO_F_BIO_NREAD0 124 +#define BIO_F_BIO_NWRITE 125 +#define BIO_F_BIO_NWRITE0 122 +#define BIO_F_BIO_PUTS 110 +#define BIO_F_BIO_READ 111 +#define BIO_F_BIO_SOCK_INIT 112 +#define BIO_F_BIO_WRITE 113 +#define BIO_F_BUFFER_CTRL 114 +#define BIO_F_CONN_CTRL 127 +#define BIO_F_CONN_STATE 115 +#define BIO_F_DGRAM_SCTP_READ 132 +#define BIO_F_FILE_CTRL 116 +#define BIO_F_FILE_READ 130 +#define BIO_F_LINEBUFFER_CTRL 129 +#define BIO_F_MEM_READ 128 +#define BIO_F_MEM_WRITE 117 +#define BIO_F_SSL_NEW 118 +#define BIO_F_WSASTARTUP 119 + +/* Reason codes. */ +#define BIO_R_ACCEPT_ERROR 100 +#define BIO_R_BAD_FOPEN_MODE 101 +#define BIO_R_BAD_HOSTNAME_LOOKUP 102 +#define BIO_R_BROKEN_PIPE 124 +#define BIO_R_CONNECT_ERROR 103 +#define BIO_R_EOF_ON_MEMORY_BIO 127 +#define BIO_R_ERROR_SETTING_NBIO 104 +#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 +#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 +#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 +#define BIO_R_INVALID_ARGUMENT 125 +#define BIO_R_INVALID_IP_ADDRESS 108 +#define BIO_R_INVALID_PORT_NUMBER 129 +#define BIO_R_IN_USE 123 +#define BIO_R_KEEPALIVE 109 +#define BIO_R_LENGTH_TOO_LONG 130 +#define BIO_R_NBIO_CONNECT_ERROR 110 +#define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111 +#define BIO_R_NO_HOSTNAME_SPECIFIED 112 +#define BIO_R_NO_PORT_DEFINED 113 +#define BIO_R_NO_PORT_SPECIFIED 114 +#define BIO_R_NO_SUCH_FILE 128 +#define BIO_R_NULL_PARAMETER 115 +#define BIO_R_TAG_MISMATCH 116 +#define BIO_R_UNABLE_TO_BIND_SOCKET 117 +#define BIO_R_UNABLE_TO_CREATE_SOCKET 118 +#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 +#define BIO_R_UNINITIALIZED 120 +#define BIO_R_UNSUPPORTED_METHOD 121 +#define BIO_R_WRITE_TO_READ_ONLY_BIO 126 +#define BIO_R_WSASTARTUP 122 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/blowfish.h b/code/contrib/libfido2/include/openssl/blowfish.h new file mode 100644 index 0000000..260545e --- /dev/null +++ b/code/contrib/libfido2/include/openssl/blowfish.h @@ -0,0 +1,111 @@ +/* $OpenBSD: blowfish.h,v 1.15 2021/11/30 18:31:36 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_BLOWFISH_H +#define HEADER_BLOWFISH_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_BF +#error BF is disabled. +#endif + +#define BF_ENCRYPT 1 +#define BF_DECRYPT 0 + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! + * ! BF_LONG_LOG2 has to be defined along. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#define BF_LONG unsigned int + +#define BF_ROUNDS 16 +#define BF_BLOCK 8 + +typedef struct bf_key_st { + BF_LONG P[BF_ROUNDS+2]; + BF_LONG S[4*256]; +} BF_KEY; + +void BF_set_key(BF_KEY *key, int len, const unsigned char *data); + +void BF_encrypt(BF_LONG *data,const BF_KEY *key); +void BF_decrypt(BF_LONG *data,const BF_KEY *key); + +void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, + const BF_KEY *key, int enc); +void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + const BF_KEY *schedule, unsigned char *ivec, int enc); +void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, + const BF_KEY *schedule, unsigned char *ivec, int *num, int enc); +void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, + const BF_KEY *schedule, unsigned char *ivec, int *num); +const char *BF_options(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/bn.h b/code/contrib/libfido2/include/openssl/bn.h new file mode 100644 index 0000000..abf8cfc --- /dev/null +++ b/code/contrib/libfido2/include/openssl/bn.h @@ -0,0 +1,728 @@ +/* $OpenBSD: bn.h,v 1.52 2022/01/14 08:01:47 tb Exp $ */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the Eric Young open source + * license provided above. + * + * The binary polynomial arithmetic software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. + * + */ + +#ifndef HEADER_BN_H +#define HEADER_BN_H + +#include +#include + +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These preprocessor symbols control various aspects of the bignum headers and + * library code. They're not defined by any "normal" configuration, as they are + * intended for development and testing purposes. NB: defining all three can be + * useful for debugging application code as well as openssl itself. + * + * BN_DEBUG - turn on various debugging alterations to the bignum code + * BN_DEBUG_RAND - uses random poisoning of unused words to trip up + * mismanagement of bignum internals. You must also define BN_DEBUG. + */ +/* #define BN_DEBUG */ +/* #define BN_DEBUG_RAND */ + +#ifndef OPENSSL_SMALL_FOOTPRINT +#define BN_MUL_COMBA +#define BN_SQR_COMBA +#define BN_RECURSION +#endif + +/* This next option uses the C libraries (2 word)/(1 word) function. + * If it is not defined, I use my C version (which is slower). + * The reason for this flag is that when the particular C compiler + * library routine is used, and the library is linked with a different + * compiler, the library is missing. This mostly happens when the + * library is built with gcc and then linked using normal cc. This would + * be a common occurrence because gcc normally produces code that is + * 2 times faster than system compilers for the big number stuff. + * For machines with only one compiler (or shared libraries), this should + * be on. Again this in only really a problem on machines + * using "long long's", are 32bit, and are not using my assembler code. */ +/* #define BN_DIV2W */ + +#ifdef _LP64 +#undef BN_LLONG +#define BN_ULONG unsigned long +#define BN_LONG long +#define BN_BITS 128 +#define BN_BYTES 8 +#define BN_BITS2 64 +#define BN_BITS4 32 +#define BN_MASK2 (0xffffffffffffffffL) +#define BN_MASK2l (0xffffffffL) +#define BN_MASK2h (0xffffffff00000000L) +#define BN_MASK2h1 (0xffffffff80000000L) +#define BN_TBIT (0x8000000000000000L) +#define BN_DEC_CONV (10000000000000000000UL) +#define BN_DEC_FMT1 "%lu" +#define BN_DEC_FMT2 "%019lu" +#define BN_DEC_NUM 19 +#define BN_HEX_FMT1 "%lX" +#define BN_HEX_FMT2 "%016lX" +#else +#define BN_ULLONG unsigned long long +#define BN_LLONG +#define BN_ULONG unsigned int +#define BN_LONG int +#define BN_BITS 64 +#define BN_BYTES 4 +#define BN_BITS2 32 +#define BN_BITS4 16 +#define BN_MASK (0xffffffffffffffffLL) +#define BN_MASK2 (0xffffffffL) +#define BN_MASK2l (0xffff) +#define BN_MASK2h1 (0xffff8000L) +#define BN_MASK2h (0xffff0000L) +#define BN_TBIT (0x80000000L) +#define BN_DEC_CONV (1000000000L) +#define BN_DEC_FMT1 "%u" +#define BN_DEC_FMT2 "%09u" +#define BN_DEC_NUM 9 +#define BN_HEX_FMT1 "%X" +#define BN_HEX_FMT2 "%08X" +#endif + +#define BN_FLG_MALLOCED 0x01 +#define BN_FLG_STATIC_DATA 0x02 +#define BN_FLG_CONSTTIME 0x04 /* avoid leaking exponent information through timing, + * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, + * BN_div() will call BN_div_no_branch, + * BN_mod_inverse() will call BN_mod_inverse_no_branch. + */ + +#ifndef OPENSSL_NO_DEPRECATED +#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */ + /* avoid leaking exponent information through timings + * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */ +#endif + +#ifndef OPENSSL_NO_DEPRECATED +#define BN_FLG_FREE 0x8000 /* used for debugging */ +#endif +void BN_set_flags(BIGNUM *b, int n); +int BN_get_flags(const BIGNUM *b, int n); +void BN_with_flags(BIGNUM *dest, const BIGNUM *src, int flags); + +/* Values for |top| in BN_rand() */ +#define BN_RAND_TOP_ANY -1 +#define BN_RAND_TOP_ONE 0 +#define BN_RAND_TOP_TWO 1 + +/* Values for |bottom| in BN_rand() */ +#define BN_RAND_BOTTOM_ANY 0 +#define BN_RAND_BOTTOM_ODD 1 + +BN_GENCB *BN_GENCB_new(void); +void BN_GENCB_free(BN_GENCB *cb); + +/* Wrapper function to make using BN_GENCB easier, */ +int BN_GENCB_call(BN_GENCB *cb, int a, int b); + +/* Populate a BN_GENCB structure with an "old"-style callback */ +void BN_GENCB_set_old(BN_GENCB *gencb, void (*callback)(int, int, void *), + void *cb_arg); + +/* Populate a BN_GENCB structure with a "new"-style callback */ +void BN_GENCB_set(BN_GENCB *gencb, int (*callback)(int, int, BN_GENCB *), + void *cb_arg); + +void *BN_GENCB_get_arg(BN_GENCB *cb); + +#define BN_prime_checks 0 /* default: select number of iterations + based on the size of the number */ + +/* + * BN_prime_checks_for_size() returns the number of Miller-Rabin + * iterations that will be done for checking that a random number + * is probably prime. The error rate for accepting a composite + * number as prime depends on the size of the prime |b|. The error + * rates used are for calculating an RSA key with 2 primes, and so + * the level is what you would expect for a key of double the size + * of the prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level + * we want to reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit + */ + +#define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) + +#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) + +int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w); +int BN_is_zero(const BIGNUM *a); +int BN_is_one(const BIGNUM *a); +int BN_is_word(const BIGNUM *a, const BN_ULONG w); +int BN_is_odd(const BIGNUM *a); + +#define BN_one(a) BN_set_word((a), 1) + +void BN_zero_ex(BIGNUM *a); + +#ifdef OPENSSL_NO_DEPRECATED +#define BN_zero(a) BN_zero_ex(a) +#else +#define BN_zero(a) (BN_set_word((a),0)) +#endif + +const BIGNUM *BN_value_one(void); +char * BN_options(void); +BN_CTX *BN_CTX_new(void); +#ifndef OPENSSL_NO_DEPRECATED +void BN_CTX_init(BN_CTX *c); +#endif +void BN_CTX_free(BN_CTX *c); +void BN_CTX_start(BN_CTX *ctx); +BIGNUM *BN_CTX_get(BN_CTX *ctx); +void BN_CTX_end(BN_CTX *ctx); +int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); +int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); +int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); +int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); +int BN_num_bits(const BIGNUM *a); +int BN_num_bits_word(BN_ULONG); +BIGNUM *BN_new(void); +void BN_init(BIGNUM *); +void BN_clear_free(BIGNUM *a); +BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); +void BN_swap(BIGNUM *a, BIGNUM *b); +BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2bin(const BIGNUM *a, unsigned char *to); +int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); +BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen); +BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2mpi(const BIGNUM *a, unsigned char *to); +int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); +/** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + */ +void BN_set_negative(BIGNUM *b, int n); + +int BN_is_negative(const BIGNUM *b); + +#ifndef LIBRESSL_INTERNAL +int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, + BN_CTX *ctx); +#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) +#endif +int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); +int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); +int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); +int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); +int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); +int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m); + +BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); +BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); +int BN_mul_word(BIGNUM *a, BN_ULONG w); +int BN_add_word(BIGNUM *a, BN_ULONG w); +int BN_sub_word(BIGNUM *a, BN_ULONG w); +int BN_set_word(BIGNUM *a, BN_ULONG w); +BN_ULONG BN_get_word(const BIGNUM *a); + +int BN_cmp(const BIGNUM *a, const BIGNUM *b); +void BN_free(BIGNUM *a); +int BN_is_bit_set(const BIGNUM *a, int n); +int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); +int BN_lshift1(BIGNUM *r, const BIGNUM *a); +int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); + +#ifndef LIBRESSL_INTERNAL +int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +#endif +int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); +int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, + const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, + BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); + +int BN_mask_bits(BIGNUM *a, int n); +int BN_print_fp(FILE *fp, const BIGNUM *a); +int BN_print(BIO *fp, const BIGNUM *a); +int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); +int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); +int BN_rshift1(BIGNUM *r, const BIGNUM *a); +void BN_clear(BIGNUM *a); +BIGNUM *BN_dup(const BIGNUM *a); +int BN_ucmp(const BIGNUM *a, const BIGNUM *b); +int BN_set_bit(BIGNUM *a, int n); +int BN_clear_bit(BIGNUM *a, int n); +char * BN_bn2hex(const BIGNUM *a); +char * BN_bn2dec(const BIGNUM *a); +int BN_hex2bn(BIGNUM **a, const char *str); +int BN_dec2bn(BIGNUM **a, const char *str); +int BN_asc2bn(BIGNUM **a, const char *str); +#ifndef LIBRESSL_INTERNAL +int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +#endif +int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ +#ifndef LIBRESSL_INTERNAL +BIGNUM *BN_mod_inverse(BIGNUM *ret, + const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); +#endif +BIGNUM *BN_mod_sqrt(BIGNUM *ret, + const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); + +void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); + +/* Deprecated versions */ +#ifndef OPENSSL_NO_DEPRECATED +BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, + const BIGNUM *add, const BIGNUM *rem, + void (*callback)(int, int, void *), void *cb_arg); +int BN_is_prime(const BIGNUM *p, int nchecks, + void (*callback)(int, int, void *), + BN_CTX *ctx, void *cb_arg); +int BN_is_prime_fasttest(const BIGNUM *p, int nchecks, + void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg, + int do_trial_division); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* Newer versions */ +int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, + const BIGNUM *rem, BN_GENCB *cb); +int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb); +int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, + int do_trial_division, BN_GENCB *cb); + +int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); + +int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, + const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, + const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); +int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, + BIGNUM *Xp1, BIGNUM *Xp2, + const BIGNUM *Xp, + const BIGNUM *e, BN_CTX *ctx, + BN_GENCB *cb); + +BN_MONT_CTX *BN_MONT_CTX_new(void ); +void BN_MONT_CTX_init(BN_MONT_CTX *ctx); +int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_MONT_CTX *mont, BN_CTX *ctx); +int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx); +int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, + BN_MONT_CTX *mont, BN_CTX *ctx); +void BN_MONT_CTX_free(BN_MONT_CTX *mont); +int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx); +BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); +BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, + const BIGNUM *mod, BN_CTX *ctx); + +/* BN_BLINDING flags */ +#define BN_BLINDING_NO_UPDATE 0x00000001 +#define BN_BLINDING_NO_RECREATE 0x00000002 + +BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); +void BN_BLINDING_free(BN_BLINDING *b); +int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); +int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *); +#ifndef OPENSSL_NO_DEPRECATED +unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); +void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); +#endif +CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); +unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); +void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); +BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, + const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, + int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), + BN_MONT_CTX *m_ctx); + +#ifndef OPENSSL_NO_DEPRECATED +void BN_set_params(int mul, int high, int low, int mont); +int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ +#endif + +void BN_RECP_CTX_init(BN_RECP_CTX *recp); +BN_RECP_CTX *BN_RECP_CTX_new(void); +void BN_RECP_CTX_free(BN_RECP_CTX *recp); +int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); +int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, + BN_RECP_CTX *recp, BN_CTX *ctx); +int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, + BN_RECP_CTX *recp, BN_CTX *ctx); + +#ifndef OPENSSL_NO_EC2M + +/* Functions for arithmetic over binary polynomials represented by BIGNUMs. + * + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. + * + * Note that input arguments are not const so that their bit arrays can + * be expanded to the appropriate size if needed. + */ + +int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/ +#define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) +int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/ +int +BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */ +int +BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); /* r = (a * a) mod p */ +int +BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, + BN_CTX *ctx); /* r = (1 / b) mod p */ +int +BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */ +int +BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */ +int +BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); /* r = sqrt(a) mod p */ +int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); /* r^2 + r = a mod p */ +#define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) +/* Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + */ +int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]); +/* r = a mod p */ +int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const int p[], BN_CTX *ctx); /* r = (a * b) mod p */ +int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], + BN_CTX *ctx); /* r = (a * a) mod p */ +int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[], + BN_CTX *ctx); /* r = (1 / b) mod p */ +int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const int p[], BN_CTX *ctx); /* r = (a / b) mod p */ +int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const int p[], BN_CTX *ctx); /* r = (a ^ b) mod p */ +int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, + const int p[], BN_CTX *ctx); /* r = sqrt(a) mod p */ +int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a, + const int p[], BN_CTX *ctx); /* r^2 + r = a mod p */ +int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max); +int BN_GF2m_arr2poly(const int p[], BIGNUM *a); + +#endif + +/* faster mod functions for the 'NIST primes' + * 0 <= a < p^2 */ +int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); + +const BIGNUM *BN_get0_nist_prime_192(void); +const BIGNUM *BN_get0_nist_prime_224(void); +const BIGNUM *BN_get0_nist_prime_256(void); +const BIGNUM *BN_get0_nist_prime_384(void); +const BIGNUM *BN_get0_nist_prime_521(void); + +/* Primes from RFC 2409 */ +BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); +BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn); +BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn); +BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn); + +/* Primes from RFC 3526 */ +BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_BN_strings(void); + +/* Error codes for the BN functions. */ + +/* Function codes. */ +#define BN_F_BNRAND 127 +#define BN_F_BN_BLINDING_CONVERT_EX 100 +#define BN_F_BN_BLINDING_CREATE_PARAM 128 +#define BN_F_BN_BLINDING_INVERT_EX 101 +#define BN_F_BN_BLINDING_NEW 102 +#define BN_F_BN_BLINDING_UPDATE 103 +#define BN_F_BN_BN2DEC 104 +#define BN_F_BN_BN2HEX 105 +#define BN_F_BN_CTX_GET 116 +#define BN_F_BN_CTX_NEW 106 +#define BN_F_BN_CTX_START 129 +#define BN_F_BN_DIV 107 +#define BN_F_BN_DIV_NO_BRANCH 138 +#define BN_F_BN_DIV_RECP 130 +#define BN_F_BN_EXP 123 +#define BN_F_BN_EXPAND2 108 +#define BN_F_BN_GENERATE_PRIME_EX 140 +#define BN_F_BN_EXPAND_INTERNAL 120 +#define BN_F_BN_GF2M_MOD 131 +#define BN_F_BN_GF2M_MOD_EXP 132 +#define BN_F_BN_GF2M_MOD_MUL 133 +#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134 +#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135 +#define BN_F_BN_GF2M_MOD_SQR 136 +#define BN_F_BN_GF2M_MOD_SQRT 137 +#define BN_F_BN_MOD_EXP2_MONT 118 +#define BN_F_BN_MOD_EXP_MONT 109 +#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124 +#define BN_F_BN_MOD_EXP_MONT_WORD 117 +#define BN_F_BN_MOD_EXP_RECP 125 +#define BN_F_BN_MOD_EXP_SIMPLE 126 +#define BN_F_BN_MOD_INVERSE 110 +#define BN_F_BN_MOD_INVERSE_NO_BRANCH 139 +#define BN_F_BN_MOD_LSHIFT_QUICK 119 +#define BN_F_BN_MOD_MUL_RECIPROCAL 111 +#define BN_F_BN_MOD_SQRT 121 +#define BN_F_BN_MPI2BN 112 +#define BN_F_BN_NEW 113 +#define BN_F_BN_RAND 114 +#define BN_F_BN_RAND_RANGE 122 +#define BN_F_BN_USUB 115 + +/* Reason codes. */ +#define BN_R_ARG2_LT_ARG3 100 +#define BN_R_BAD_RECIPROCAL 101 +#define BN_R_BIGNUM_TOO_LONG 114 +#define BN_R_BITS_TOO_SMALL 117 +#define BN_R_CALLED_WITH_EVEN_MODULUS 102 +#define BN_R_DIV_BY_ZERO 103 +#define BN_R_ENCODING_ERROR 104 +#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105 +#define BN_R_INPUT_NOT_REDUCED 110 +#define BN_R_INVALID_LENGTH 106 +#define BN_R_INVALID_RANGE 115 +#define BN_R_NOT_A_SQUARE 111 +#define BN_R_NOT_INITIALIZED 107 +#define BN_R_NO_INVERSE 108 +#define BN_R_NO_SOLUTION 116 +#define BN_R_P_IS_NOT_PRIME 112 +#define BN_R_TOO_MANY_ITERATIONS 113 +#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/buffer.h b/code/contrib/libfido2/include/openssl/buffer.h new file mode 100644 index 0000000..ed6dac0 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/buffer.h @@ -0,0 +1,122 @@ +/* $OpenBSD: buffer.h,v 1.15 2015/06/24 10:05:14 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_BUFFER_H +#define HEADER_BUFFER_H +#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__) +#define __bounded__(x, y, z) +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* Already declared in ossl_typ.h */ +/* typedef struct buf_mem_st BUF_MEM; */ + +struct buf_mem_st { + size_t length; /* current number of bytes */ + char *data; + size_t max; /* size of buffer */ +}; + +BUF_MEM *BUF_MEM_new(void); +void BUF_MEM_free(BUF_MEM *a); +int BUF_MEM_grow(BUF_MEM *str, size_t len); +int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); + +#ifndef LIBRESSL_INTERNAL +char * BUF_strdup(const char *str); +char * BUF_strndup(const char *str, size_t siz); +void * BUF_memdup(const void *data, size_t siz); +void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); + +/* safe string functions */ +size_t BUF_strlcpy(char *dst, const char *src, size_t siz) + __attribute__ ((__bounded__(__string__,1,3))); +size_t BUF_strlcat(char *dst, const char *src, size_t siz) + __attribute__ ((__bounded__(__string__,1,3))); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_BUF_strings(void); + +/* Error codes for the BUF functions. */ + +/* Function codes. */ +#define BUF_F_BUF_MEMDUP 103 +#define BUF_F_BUF_MEM_GROW 100 +#define BUF_F_BUF_MEM_GROW_CLEAN 105 +#define BUF_F_BUF_MEM_NEW 101 +#define BUF_F_BUF_STRDUP 102 +#define BUF_F_BUF_STRNDUP 104 + +/* Reason codes. */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/camellia.h b/code/contrib/libfido2/include/openssl/camellia.h new file mode 100644 index 0000000..b9b5f79 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/camellia.h @@ -0,0 +1,125 @@ +/* $OpenBSD: camellia.h,v 1.5 2014/11/13 20:01:58 miod Exp $ */ +/* ==================================================================== + * Copyright (c) 2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + */ + +#ifndef HEADER_CAMELLIA_H +#define HEADER_CAMELLIA_H + +#include + +#ifdef OPENSSL_NO_CAMELLIA +#error CAMELLIA is disabled. +#endif + +#include + +#define CAMELLIA_ENCRYPT 1 +#define CAMELLIA_DECRYPT 0 + +/* Because array size can't be a const in C, the following two are macros. + Both sizes are in bytes. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* This should be a hidden type, but EVP requires that the size be known */ + +#define CAMELLIA_BLOCK_SIZE 16 +#define CAMELLIA_TABLE_BYTE_LEN 272 +#define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) + +typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match with WORD */ + +struct camellia_key_st { + union { + double d; /* ensures 64-bit align */ + KEY_TABLE_TYPE rd_key; + } u; + int grand_rounds; +}; +typedef struct camellia_key_st CAMELLIA_KEY; + +int Camellia_set_key(const unsigned char *userKey, const int bits, + CAMELLIA_KEY *key); + +void Camellia_encrypt(const unsigned char *in, unsigned char *out, + const CAMELLIA_KEY *key); +void Camellia_decrypt(const unsigned char *in, unsigned char *out, + const CAMELLIA_KEY *key); + +void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, + const CAMELLIA_KEY *key, const int enc); +void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char *ivec, const int enc); +void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char *ivec, int *num, const int enc); +void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char *ivec, int *num, const int enc); +void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char *ivec, int *num, const int enc); +void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char *ivec, int *num); +void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char ivec[CAMELLIA_BLOCK_SIZE], + unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], + unsigned int *num); + +#ifdef __cplusplus +} +#endif + +#endif /* !HEADER_Camellia_H */ diff --git a/code/contrib/libfido2/include/openssl/cast.h b/code/contrib/libfido2/include/openssl/cast.h new file mode 100644 index 0000000..1043c7f --- /dev/null +++ b/code/contrib/libfido2/include/openssl/cast.h @@ -0,0 +1,104 @@ +/* $OpenBSD: cast.h,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CAST_H +#define HEADER_CAST_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_CAST +#error CAST is disabled. +#endif + +#define CAST_ENCRYPT 1 +#define CAST_DECRYPT 0 + +#define CAST_LONG unsigned int + +#define CAST_BLOCK 8 +#define CAST_KEY_LENGTH 16 + +typedef struct cast_key_st + { + CAST_LONG data[32]; + int short_key; /* Use reduced rounds for short key */ + } CAST_KEY; + +void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); +void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key, + int enc); +void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); +void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); +void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + const CAST_KEY *ks, unsigned char *iv, int enc); +void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, const CAST_KEY *schedule, unsigned char *ivec, + int *num, int enc); +void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, const CAST_KEY *schedule, unsigned char *ivec, + int *num); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/chacha.h b/code/contrib/libfido2/include/openssl/chacha.h new file mode 100644 index 0000000..e2345b2 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/chacha.h @@ -0,0 +1,58 @@ +/* $OpenBSD: chacha.h,v 1.8 2019/01/22 00:59:21 dlg Exp $ */ +/* + * Copyright (c) 2014 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CHACHA_H +#define HEADER_CHACHA_H + +#include + +#if defined(OPENSSL_NO_CHACHA) +#error ChaCha is disabled. +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + unsigned int input[16]; + unsigned char ks[64]; + unsigned char unused; +} ChaCha_ctx; + +void ChaCha_set_key(ChaCha_ctx *ctx, const unsigned char *key, + unsigned int keybits); +void ChaCha_set_iv(ChaCha_ctx *ctx, const unsigned char *iv, + const unsigned char *counter); +void ChaCha(ChaCha_ctx *ctx, unsigned char *out, const unsigned char *in, + size_t len); + +void CRYPTO_chacha_20(unsigned char *out, const unsigned char *in, size_t len, + const unsigned char key[32], const unsigned char iv[8], uint64_t counter); +void CRYPTO_xchacha_20(unsigned char *out, const unsigned char *in, size_t len, + const unsigned char key[32], const unsigned char iv[24]); +void CRYPTO_hchacha_20(unsigned char out[32], + const unsigned char key[32], const unsigned char iv[16]); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_CHACHA_H */ diff --git a/code/contrib/libfido2/include/openssl/cmac.h b/code/contrib/libfido2/include/openssl/cmac.h new file mode 100644 index 0000000..cb6d64b --- /dev/null +++ b/code/contrib/libfido2/include/openssl/cmac.h @@ -0,0 +1,82 @@ +/* $OpenBSD: cmac.h,v 1.3 2014/06/21 13:42:14 jsing Exp $ */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2010 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + + +#ifndef HEADER_CMAC_H +#define HEADER_CMAC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* Opaque */ +typedef struct CMAC_CTX_st CMAC_CTX; + +CMAC_CTX *CMAC_CTX_new(void); +void CMAC_CTX_cleanup(CMAC_CTX *ctx); +void CMAC_CTX_free(CMAC_CTX *ctx); +EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); +int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); + +int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, + const EVP_CIPHER *cipher, ENGINE *impl); +int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); +int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); +int CMAC_resume(CMAC_CTX *ctx); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/cms.h b/code/contrib/libfido2/include/openssl/cms.h new file mode 100644 index 0000000..3c92be3 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/cms.h @@ -0,0 +1,532 @@ +/* $OpenBSD: cms.h,v 1.15 2019/08/11 10:15:30 jsing Exp $ */ +/* + * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project. + */ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + +#ifndef HEADER_CMS_H +#define HEADER_CMS_H + +#include + +#ifndef OPENSSL_NO_CMS +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct CMS_ContentInfo_st CMS_ContentInfo; +typedef struct CMS_SignerInfo_st CMS_SignerInfo; +typedef struct CMS_CertificateChoices CMS_CertificateChoices; +typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice; +typedef struct CMS_RecipientInfo_st CMS_RecipientInfo; +typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest; +typedef struct CMS_Receipt_st CMS_Receipt; +typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey; +typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute; + +DECLARE_STACK_OF(CMS_SignerInfo) +DECLARE_STACK_OF(CMS_RecipientEncryptedKey) +DECLARE_STACK_OF(CMS_RecipientInfo) +DECLARE_STACK_OF(CMS_RevocationInfoChoice) +CMS_ContentInfo *CMS_ContentInfo_new(void); +void CMS_ContentInfo_free(CMS_ContentInfo *a); +CMS_ContentInfo *d2i_CMS_ContentInfo(CMS_ContentInfo **a, const unsigned char **in, long len); +int i2d_CMS_ContentInfo(CMS_ContentInfo *a, unsigned char **out); +extern const ASN1_ITEM CMS_ContentInfo_it; +CMS_ReceiptRequest *CMS_ReceiptRequest_new(void); +void CMS_ReceiptRequest_free(CMS_ReceiptRequest *a); +CMS_ReceiptRequest *d2i_CMS_ReceiptRequest(CMS_ReceiptRequest **a, const unsigned char **in, long len); +int i2d_CMS_ReceiptRequest(CMS_ReceiptRequest *a, unsigned char **out); +extern const ASN1_ITEM CMS_ReceiptRequest_it; +int CMS_ContentInfo_print_ctx(BIO *out, CMS_ContentInfo *x, int indent, const ASN1_PCTX *pctx); + +#define CMS_SIGNERINFO_ISSUER_SERIAL 0 +#define CMS_SIGNERINFO_KEYIDENTIFIER 1 + +#define CMS_RECIPINFO_NONE -1 +#define CMS_RECIPINFO_TRANS 0 +#define CMS_RECIPINFO_AGREE 1 +#define CMS_RECIPINFO_KEK 2 +#define CMS_RECIPINFO_PASS 3 +#define CMS_RECIPINFO_OTHER 4 + +/* S/MIME related flags */ + +#define CMS_TEXT 0x1 +#define CMS_NOCERTS 0x2 +#define CMS_NO_CONTENT_VERIFY 0x4 +#define CMS_NO_ATTR_VERIFY 0x8 +#define CMS_NOSIGS \ + (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY) +#define CMS_NOINTERN 0x10 +#define CMS_NO_SIGNER_CERT_VERIFY 0x20 +#define CMS_NOVERIFY 0x20 +#define CMS_DETACHED 0x40 +#define CMS_BINARY 0x80 +#define CMS_NOATTR 0x100 +#define CMS_NOSMIMECAP 0x200 +#define CMS_NOOLDMIMETYPE 0x400 +#define CMS_CRLFEOL 0x800 +#define CMS_STREAM 0x1000 +#define CMS_NOCRL 0x2000 +#define CMS_PARTIAL 0x4000 +#define CMS_REUSE_DIGEST 0x8000 +#define CMS_USE_KEYID 0x10000 +#define CMS_DEBUG_DECRYPT 0x20000 +#define CMS_KEY_PARAM 0x40000 +#define CMS_ASCIICRLF 0x80000 + +const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms); + +BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont); +int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); + +ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); +int CMS_is_detached(CMS_ContentInfo *cms); +int CMS_set_detached(CMS_ContentInfo *cms, int detached); + +#ifdef HEADER_PEM_H +CMS_ContentInfo *PEM_read_bio_CMS(BIO *bp, CMS_ContentInfo **x, + pem_password_cb *cb, void *u); +CMS_ContentInfo *PEM_read_CMS(FILE *fp, CMS_ContentInfo **x, + pem_password_cb *cb, void *u); +int PEM_write_bio_CMS(BIO *bp, const CMS_ContentInfo *x); +int PEM_write_CMS(FILE *fp, const CMS_ContentInfo *x); +#endif +int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms); +CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); +int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); + +BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); +int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags); +int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, + int flags); +CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); +int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags); + +int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags); + +CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, unsigned int flags); + +CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, + EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags); + +int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags); +CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags); + +int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, + unsigned int flags); +CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, + unsigned int flags); + +int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, const unsigned char *key, + size_t keylen, BIO *dcont, BIO *out, unsigned int flags); + +CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, + const unsigned char *key, size_t keylen, unsigned int flags); + +int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, + const unsigned char *key, size_t keylen); + +int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, + X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags); + +int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, + STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags); + +STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); + +CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, + const EVP_CIPHER *cipher, unsigned int flags); + +int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, + BIO *dcont, BIO *out, unsigned int flags); + +int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); +int CMS_decrypt_set1_key(CMS_ContentInfo *cms, unsigned char *key, + size_t keylen, const unsigned char *id, size_t idlen); +int CMS_decrypt_set1_password(CMS_ContentInfo *cms, unsigned char *pass, + ssize_t passlen); + +STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); +int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); +EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri); +CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); +CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, + unsigned int flags); +int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); +int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); +int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, EVP_PKEY **pk, + X509 **recip, X509_ALGOR **palg); +int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, + ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno); + +CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, + unsigned char *key, size_t keylen, unsigned char *id, size_t idlen, + ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId, ASN1_TYPE *otherType); + +int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg, + ASN1_OCTET_STRING **pid, ASN1_GENERALIZEDTIME **pdate, + ASN1_OBJECT **potherid, ASN1_TYPE **pothertype); + +int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, unsigned char *key, + size_t keylen); + +int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, + const unsigned char *id, size_t idlen); + +int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass, + ssize_t passlen); + +CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, int iter, + int wrap_nid, int pbe_nid, unsigned char *pass, ssize_t passlen, + const EVP_CIPHER *kekciph); + +int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); +int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); + +int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, + unsigned int flags); +CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); + +int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); +const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); + +CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms); +int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); +int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); +STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); + +CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms); +int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); +int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); +STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); + +int CMS_SignedData_init(CMS_ContentInfo *cms); +CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, X509 *signer, + EVP_PKEY *pk, const EVP_MD *md, unsigned int flags); +EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si); +EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si); +STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); + +void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); +int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, ASN1_INTEGER **sno); +int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); +int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs, + unsigned int flags); +void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer, + X509_ALGOR **pdig, X509_ALGOR **psig); +ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si); +int CMS_SignerInfo_sign(CMS_SignerInfo *si); +int CMS_SignerInfo_verify(CMS_SignerInfo *si); +int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain); + +int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs); +int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, int algnid, + int keysize); +int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap); + +int CMS_signed_get_attr_count(const CMS_SignerInfo *si); +int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos); +int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc); +X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc); +int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); +int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *obj, + int type, const void *bytes, int len); +int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, int nid, int type, + const void *bytes, int len); +int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, + const char *attrname, int type, const void *bytes, int len); +void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid, + int lastpos, int type); + +int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si); +int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, + int lastpos); +int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, + const ASN1_OBJECT *obj, int lastpos); +X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc); +X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc); +int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); +int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, + const ASN1_OBJECT *obj, int type, const void *bytes, int len); +int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, int nid, int type, + const void *bytes, int len); +int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, const char *attrname, + int type, const void *bytes, int len); +void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, + int lastpos, int type); + +#ifdef HEADER_X509V3_H + +int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); +CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, + int allorfirst, STACK_OF(GENERAL_NAMES) *receiptList, + STACK_OF(GENERAL_NAMES) *receiptsTo); +int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); +void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid, + int *pallorfirst, STACK_OF(GENERAL_NAMES) **plist, + STACK_OF(GENERAL_NAMES) **prto); +#endif +int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri, X509_ALGOR **palg, + ASN1_OCTET_STRING **pukm); +STACK_OF(CMS_RecipientEncryptedKey) * + CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); + +int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri, + X509_ALGOR **pubalg, ASN1_BIT_STRING **pubkey, ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, ASN1_INTEGER **sno); + +int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert); + +int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek, + ASN1_OCTET_STRING **keyid, ASN1_GENERALIZEDTIME **tm, + CMS_OtherKeyAttribute **other, X509_NAME **issuer, ASN1_INTEGER **sno); +int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek, + X509 *cert); +int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk); +EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri); +int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, + CMS_RecipientInfo *ri, CMS_RecipientEncryptedKey *rek); + +int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, + ASN1_OCTET_STRING *ukm, int keylen); + +/* Backward compatibility for spelling errors. */ +#define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM +#define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \ + CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + +int ERR_load_CMS_strings(void); + +/* + * CMS function codes. + */ +#define CMS_F_CHECK_CONTENT 99 +#define CMS_F_CMS_ADD0_CERT 164 +#define CMS_F_CMS_ADD0_RECIPIENT_KEY 100 +#define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165 +#define CMS_F_CMS_ADD1_RECEIPTREQUEST 158 +#define CMS_F_CMS_ADD1_RECIPIENT_CERT 101 +#define CMS_F_CMS_ADD1_SIGNER 102 +#define CMS_F_CMS_ADD1_SIGNINGTIME 103 +#define CMS_F_CMS_COMPRESS 104 +#define CMS_F_CMS_COMPRESSEDDATA_CREATE 105 +#define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106 +#define CMS_F_CMS_COPY_CONTENT 107 +#define CMS_F_CMS_COPY_MESSAGEDIGEST 108 +#define CMS_F_CMS_DATA 109 +#define CMS_F_CMS_DATAFINAL 110 +#define CMS_F_CMS_DATAINIT 111 +#define CMS_F_CMS_DECRYPT 112 +#define CMS_F_CMS_DECRYPT_SET1_KEY 113 +#define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166 +#define CMS_F_CMS_DECRYPT_SET1_PKEY 114 +#define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115 +#define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116 +#define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117 +#define CMS_F_CMS_DIGEST_VERIFY 118 +#define CMS_F_CMS_ENCODE_RECEIPT 161 +#define CMS_F_CMS_ENCRYPT 119 +#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT 179 +#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120 +#define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121 +#define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122 +#define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123 +#define CMS_F_CMS_ENVELOPEDDATA_CREATE 124 +#define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125 +#define CMS_F_CMS_ENVELOPED_DATA_INIT 126 +#define CMS_F_CMS_ENV_ASN1_CTRL 171 +#define CMS_F_CMS_FINAL 127 +#define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128 +#define CMS_F_CMS_GET0_CONTENT 129 +#define CMS_F_CMS_GET0_ECONTENT_TYPE 130 +#define CMS_F_CMS_GET0_ENVELOPED 131 +#define CMS_F_CMS_GET0_REVOCATION_CHOICES 132 +#define CMS_F_CMS_GET0_SIGNED 133 +#define CMS_F_CMS_MSGSIGDIGEST_ADD1 162 +#define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159 +#define CMS_F_CMS_RECEIPT_VERIFY 160 +#define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134 +#define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169 +#define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178 +#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175 +#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173 +#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172 +#define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143 +#define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167 +#define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144 +#define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168 +#define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145 +#define CMS_F_CMS_SD_ASN1_CTRL 170 +#define CMS_F_CMS_SET1_IAS 176 +#define CMS_F_CMS_SET1_KEYID 177 +#define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146 +#define CMS_F_CMS_SET_DETACHED 147 +#define CMS_F_CMS_SIGN 148 +#define CMS_F_CMS_SIGNED_DATA_INIT 149 +#define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150 +#define CMS_F_CMS_SIGNERINFO_SIGN 151 +#define CMS_F_CMS_SIGNERINFO_VERIFY 152 +#define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153 +#define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154 +#define CMS_F_CMS_SIGN_RECEIPT 163 +#define CMS_F_CMS_STREAM 155 +#define CMS_F_CMS_UNCOMPRESS 156 +#define CMS_F_CMS_VERIFY 157 +#define CMS_F_KEK_UNWRAP_KEY 180 + +/* + * CMS reason codes. + */ +#define CMS_R_ADD_SIGNER_ERROR 99 +#define CMS_R_CERTIFICATE_ALREADY_PRESENT 175 +#define CMS_R_CERTIFICATE_HAS_NO_KEYID 160 +#define CMS_R_CERTIFICATE_VERIFY_ERROR 100 +#define CMS_R_CIPHER_INITIALISATION_ERROR 101 +#define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102 +#define CMS_R_CMS_DATAFINAL_ERROR 103 +#define CMS_R_CMS_LIB 104 +#define CMS_R_CONTENTIDENTIFIER_MISMATCH 170 +#define CMS_R_CONTENT_NOT_FOUND 105 +#define CMS_R_CONTENT_TYPE_MISMATCH 171 +#define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106 +#define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107 +#define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108 +#define CMS_R_CONTENT_VERIFY_ERROR 109 +#define CMS_R_CTRL_ERROR 110 +#define CMS_R_CTRL_FAILURE 111 +#define CMS_R_DECRYPT_ERROR 112 +#define CMS_R_ERROR_GETTING_PUBLIC_KEY 113 +#define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114 +#define CMS_R_ERROR_SETTING_KEY 115 +#define CMS_R_ERROR_SETTING_RECIPIENTINFO 116 +#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117 +#define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176 +#define CMS_R_INVALID_KEY_LENGTH 118 +#define CMS_R_MD_BIO_INIT_ERROR 119 +#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120 +#define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121 +#define CMS_R_MSGSIGDIGEST_ERROR 172 +#define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162 +#define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163 +#define CMS_R_NEED_ONE_SIGNER 164 +#define CMS_R_NOT_A_SIGNED_RECEIPT 165 +#define CMS_R_NOT_ENCRYPTED_DATA 122 +#define CMS_R_NOT_KEK 123 +#define CMS_R_NOT_KEY_AGREEMENT 181 +#define CMS_R_NOT_KEY_TRANSPORT 124 +#define CMS_R_NOT_PWRI 177 +#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125 +#define CMS_R_NO_CIPHER 126 +#define CMS_R_NO_CONTENT 127 +#define CMS_R_NO_CONTENT_TYPE 173 +#define CMS_R_NO_DEFAULT_DIGEST 128 +#define CMS_R_NO_DIGEST_SET 129 +#define CMS_R_NO_KEY 130 +#define CMS_R_NO_KEY_OR_CERT 174 +#define CMS_R_NO_MATCHING_DIGEST 131 +#define CMS_R_NO_MATCHING_RECIPIENT 132 +#define CMS_R_NO_MATCHING_SIGNATURE 166 +#define CMS_R_NO_MSGSIGDIGEST 167 +#define CMS_R_NO_PASSWORD 178 +#define CMS_R_NO_PRIVATE_KEY 133 +#define CMS_R_NO_PUBLIC_KEY 134 +#define CMS_R_NO_RECEIPT_REQUEST 168 +#define CMS_R_NO_SIGNERS 135 +#define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136 +#define CMS_R_RECEIPT_DECODE_ERROR 169 +#define CMS_R_RECIPIENT_ERROR 137 +#define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138 +#define CMS_R_SIGNFINAL_ERROR 139 +#define CMS_R_SMIME_TEXT_ERROR 140 +#define CMS_R_STORE_INIT_ERROR 141 +#define CMS_R_TYPE_NOT_COMPRESSED_DATA 142 +#define CMS_R_TYPE_NOT_DATA 143 +#define CMS_R_TYPE_NOT_DIGESTED_DATA 144 +#define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145 +#define CMS_R_TYPE_NOT_ENVELOPED_DATA 146 +#define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147 +#define CMS_R_UNKNOWN_CIPHER 148 +#define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149 +#define CMS_R_UNKNOWN_ID 150 +#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151 +#define CMS_R_UNSUPPORTED_CONTENT_TYPE 152 +#define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153 +#define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179 +#define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155 +#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154 +#define CMS_R_UNSUPPORTED_TYPE 156 +#define CMS_R_UNWRAP_ERROR 157 +#define CMS_R_UNWRAP_FAILURE 180 +#define CMS_R_VERIFICATION_FAILURE 158 +#define CMS_R_WRAP_ERROR 159 + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/comp.h b/code/contrib/libfido2/include/openssl/comp.h new file mode 100644 index 0000000..7c99ead --- /dev/null +++ b/code/contrib/libfido2/include/openssl/comp.h @@ -0,0 +1,46 @@ +/* $OpenBSD: comp.h,v 1.9 2022/01/14 08:21:12 tb Exp $ */ + +#ifndef HEADER_COMP_H +#define HEADER_COMP_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); +void COMP_CTX_free(COMP_CTX *ctx); +int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen); +int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen); +COMP_METHOD *COMP_rle(void ); +COMP_METHOD *COMP_zlib(void ); +void COMP_zlib_cleanup(void); + +#ifdef HEADER_BIO_H +#ifdef ZLIB +BIO_METHOD *BIO_f_zlib(void); +#endif +#endif + +void ERR_load_COMP_strings(void); + +/* Error codes for the COMP functions. */ + +/* Function codes. */ +#define COMP_F_BIO_ZLIB_FLUSH 99 +#define COMP_F_BIO_ZLIB_NEW 100 +#define COMP_F_BIO_ZLIB_READ 101 +#define COMP_F_BIO_ZLIB_WRITE 102 + +/* Reason codes. */ +#define COMP_R_ZLIB_DEFLATE_ERROR 99 +#define COMP_R_ZLIB_INFLATE_ERROR 100 +#define COMP_R_ZLIB_NOT_SUPPORTED 101 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/conf.h b/code/contrib/libfido2/include/openssl/conf.h new file mode 100644 index 0000000..bea6a87 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/conf.h @@ -0,0 +1,250 @@ +/* $OpenBSD: conf.h,v 1.15 2020/02/17 12:51:48 inoguchi Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CONF_H +#define HEADER_CONF_H + +#include + +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + char *section; + char *name; + char *value; +} CONF_VALUE; + +DECLARE_STACK_OF(CONF_VALUE) +DECLARE_LHASH_OF(CONF_VALUE); + +struct conf_st; +struct conf_method_st; +typedef struct conf_method_st CONF_METHOD; + +struct conf_method_st { + const char *name; + CONF *(*create)(CONF_METHOD *meth); + int (*init)(CONF *conf); + int (*destroy)(CONF *conf); + int (*destroy_data)(CONF *conf); + int (*load_bio)(CONF *conf, BIO *bp, long *eline); + int (*dump)(const CONF *conf, BIO *bp); + int (*is_number)(const CONF *conf, char c); + int (*to_int)(const CONF *conf, char c); + int (*load)(CONF *conf, const char *name, long *eline); +}; + +/* Module definitions */ + +typedef struct conf_imodule_st CONF_IMODULE; +typedef struct conf_module_st CONF_MODULE; + +DECLARE_STACK_OF(CONF_MODULE) +DECLARE_STACK_OF(CONF_IMODULE) + +/* DSO module function typedefs */ +typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); +typedef void conf_finish_func(CONF_IMODULE *md); + +#define CONF_MFLAGS_IGNORE_ERRORS 0x1 +#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 +#define CONF_MFLAGS_SILENT 0x4 +#define CONF_MFLAGS_NO_DSO 0x8 +#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 +#define CONF_MFLAGS_DEFAULT_SECTION 0x20 + +int CONF_set_default_method(CONF_METHOD *meth); +void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); +LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, + long *eline); +LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, + long *eline); +LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline); +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, + const char *section); +char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, + const char *name); +long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, + const char *name); +void CONF_free(LHASH_OF(CONF_VALUE) *conf); +int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); +int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); + +void OPENSSL_config(const char *config_name); +void OPENSSL_no_config(void); + +/* New conf code. The semantics are different from the functions above. + If that wasn't the case, the above functions would have been replaced */ + +struct conf_st { + CONF_METHOD *meth; + void *meth_data; + LHASH_OF(CONF_VALUE) *data; +}; + +CONF *NCONF_new(CONF_METHOD *meth); +CONF_METHOD *NCONF_default(void); +CONF_METHOD *NCONF_WIN32(void); +void NCONF_free(CONF *conf); +void NCONF_free_data(CONF *conf); + +int NCONF_load(CONF *conf, const char *file, long *eline); +int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); +int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); +STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section); +char *NCONF_get_string(const CONF *conf, const char *group, const char *name); +int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, + long *result); +int NCONF_dump_fp(const CONF *conf, FILE *out); +int NCONF_dump_bio(const CONF *conf, BIO *out); + +#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) + +/* Module functions */ + +int CONF_modules_load(const CONF *cnf, const char *appname, + unsigned long flags); +int CONF_modules_load_file(const char *filename, const char *appname, + unsigned long flags); +void CONF_modules_unload(int all); +void CONF_modules_finish(void); +void CONF_modules_free(void); +int CONF_module_add(const char *name, conf_init_func *ifunc, + conf_finish_func *ffunc); + +const char *CONF_imodule_get_name(const CONF_IMODULE *md); +const char *CONF_imodule_get_value(const CONF_IMODULE *md); +void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); +void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); +CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); +unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); +void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); +void *CONF_module_get_usr_data(CONF_MODULE *pmod); +void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); + +char *CONF_get1_default_config_file(void); + +int CONF_parse_list(const char *list, int sep, int nospc, + int (*list_cb)(const char *elem, int len, void *usr), void *arg); + +void OPENSSL_load_builtin_modules(void); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_CONF_strings(void); + +/* Error codes for the CONF functions. */ + +/* Function codes. */ +#define CONF_F_CONF_DUMP_FP 104 +#define CONF_F_CONF_LOAD 100 +#define CONF_F_CONF_LOAD_BIO 102 +#define CONF_F_CONF_LOAD_FP 103 +#define CONF_F_CONF_MODULES_LOAD 116 +#define CONF_F_CONF_PARSE_LIST 119 +#define CONF_F_DEF_LOAD 120 +#define CONF_F_DEF_LOAD_BIO 121 +#define CONF_F_MODULE_INIT 115 +#define CONF_F_MODULE_LOAD_DSO 117 +#define CONF_F_MODULE_RUN 118 +#define CONF_F_NCONF_DUMP_BIO 105 +#define CONF_F_NCONF_DUMP_FP 106 +#define CONF_F_NCONF_GET_NUMBER 107 +#define CONF_F_NCONF_GET_NUMBER_E 112 +#define CONF_F_NCONF_GET_SECTION 108 +#define CONF_F_NCONF_GET_STRING 109 +#define CONF_F_NCONF_LOAD 113 +#define CONF_F_NCONF_LOAD_BIO 110 +#define CONF_F_NCONF_LOAD_FP 114 +#define CONF_F_NCONF_NEW 111 +#define CONF_F_STR_COPY 101 + +/* Reason codes. */ +#define CONF_R_ERROR_LOADING_DSO 110 +#define CONF_R_LIST_CANNOT_BE_NULL 115 +#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 +#define CONF_R_MISSING_EQUAL_SIGN 101 +#define CONF_R_MISSING_FINISH_FUNCTION 111 +#define CONF_R_MISSING_INIT_FUNCTION 112 +#define CONF_R_MODULE_INITIALIZATION_ERROR 109 +#define CONF_R_NO_CLOSE_BRACE 102 +#define CONF_R_NO_CONF 105 +#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 +#define CONF_R_NO_SECTION 107 +#define CONF_R_NO_SUCH_FILE 114 +#define CONF_R_NO_VALUE 108 +#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 +#define CONF_R_UNKNOWN_MODULE_NAME 113 +#define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 +#define CONF_R_VARIABLE_HAS_NO_VALUE 104 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/conf_api.h b/code/contrib/libfido2/include/openssl/conf_api.h new file mode 100644 index 0000000..95f9386 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/conf_api.h @@ -0,0 +1,88 @@ +/* $OpenBSD: conf_api.h,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CONF_API_H +#define HEADER_CONF_API_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Up until OpenSSL 0.9.5a, this was new_section */ +CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); +/* Up until OpenSSL 0.9.5a, this was get_section */ +CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); +/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ +STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + const char *section); + +int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); +char *_CONF_get_string(const CONF *conf, const char *section, + const char *name); +long _CONF_get_number(const CONF *conf, const char *section, const char *name); + +int _CONF_new_data(CONF *conf); +void _CONF_free_data(CONF *conf); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/crypto.h b/code/contrib/libfido2/include/openssl/crypto.h new file mode 100644 index 0000000..5524fee --- /dev/null +++ b/code/contrib/libfido2/include/openssl/crypto.h @@ -0,0 +1,573 @@ +/* $OpenBSD: crypto.h,v 1.54 2022/01/14 08:23:25 tb Exp $ */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#include +#include +#include + +#ifndef HEADER_CRYPTO_H +#define HEADER_CRYPTO_H + +#include + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Backward compatibility to SSLeay */ +/* This is more to be used to check the correct DLL is being used + * in the MS world. */ +#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER +#define SSLEAY_VERSION 0 +/* #define SSLEAY_OPTIONS 1 no longer supported */ +#define SSLEAY_CFLAGS 2 +#define SSLEAY_BUILT_ON 3 +#define SSLEAY_PLATFORM 4 +#define SSLEAY_DIR 5 + +/* When changing the CRYPTO_LOCK_* list, be sure to maintain the text lock + * names in cryptlib.c + */ + +#define CRYPTO_LOCK_ERR 1 +#define CRYPTO_LOCK_EX_DATA 2 +#define CRYPTO_LOCK_X509 3 +#define CRYPTO_LOCK_X509_INFO 4 +#define CRYPTO_LOCK_X509_PKEY 5 +#define CRYPTO_LOCK_X509_CRL 6 +#define CRYPTO_LOCK_X509_REQ 7 +#define CRYPTO_LOCK_DSA 8 +#define CRYPTO_LOCK_RSA 9 +#define CRYPTO_LOCK_EVP_PKEY 10 +#define CRYPTO_LOCK_X509_STORE 11 +#define CRYPTO_LOCK_SSL_CTX 12 +#define CRYPTO_LOCK_SSL_CERT 13 +#define CRYPTO_LOCK_SSL_SESSION 14 +#define CRYPTO_LOCK_SSL_SESS_CERT 15 +#define CRYPTO_LOCK_SSL 16 +#define CRYPTO_LOCK_SSL_METHOD 17 +#define CRYPTO_LOCK_RAND 18 +#define CRYPTO_LOCK_RAND2 19 +#define CRYPTO_LOCK_MALLOC 20 +#define CRYPTO_LOCK_BIO 21 +#define CRYPTO_LOCK_GETHOSTBYNAME 22 +#define CRYPTO_LOCK_GETSERVBYNAME 23 +#define CRYPTO_LOCK_READDIR 24 +#define CRYPTO_LOCK_RSA_BLINDING 25 +#define CRYPTO_LOCK_DH 26 +#define CRYPTO_LOCK_MALLOC2 27 +#define CRYPTO_LOCK_DSO 28 +#define CRYPTO_LOCK_DYNLOCK 29 +#define CRYPTO_LOCK_ENGINE 30 +#define CRYPTO_LOCK_UI 31 +#define CRYPTO_LOCK_ECDSA 32 +#define CRYPTO_LOCK_EC 33 +#define CRYPTO_LOCK_ECDH 34 +#define CRYPTO_LOCK_BN 35 +#define CRYPTO_LOCK_EC_PRE_COMP 36 +#define CRYPTO_LOCK_STORE 37 +#define CRYPTO_LOCK_COMP 38 +#define CRYPTO_LOCK_FIPS 39 +#define CRYPTO_LOCK_FIPS2 40 +#define CRYPTO_NUM_LOCKS 41 + +#define CRYPTO_LOCK 1 +#define CRYPTO_UNLOCK 2 +#define CRYPTO_READ 4 +#define CRYPTO_WRITE 8 + +#ifndef CRYPTO_w_lock +#define CRYPTO_w_lock(type) \ + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,NULL,0) +#define CRYPTO_w_unlock(type) \ + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,NULL,0) +#define CRYPTO_r_lock(type) \ + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,NULL,0) +#define CRYPTO_r_unlock(type) \ + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,NULL,0) +#define CRYPTO_add(addr,amount,type) \ + CRYPTO_add_lock(addr,amount,type,NULL,0) +#endif + +/* Some applications as well as some parts of OpenSSL need to allocate + and deallocate locks in a dynamic fashion. The following typedef + makes this possible in a type-safe manner. */ +/* struct CRYPTO_dynlock_value has to be defined by the application. */ +typedef struct { + int references; + struct CRYPTO_dynlock_value *data; +} CRYPTO_dynlock; + + +/* The following can be used to detect memory leaks in the SSLeay library. + * It used, it turns on malloc checking */ + +#define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */ +#define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */ +#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */ +#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */ + +/* The following are bit values to turn on or off options connected to the + * malloc checking functionality */ + +/* Adds time to the memory checking information */ +#define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */ +/* Adds thread number to the memory checking information */ +#define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */ + +#define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD) + + +/* predec of the BIO type */ +typedef struct bio_st BIO_dummy; + +struct crypto_ex_data_st { + STACK_OF(void) *sk; +}; +DECLARE_STACK_OF(void) + +/* This stuff is basically class callback functions + * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */ + +typedef struct crypto_ex_data_func_st { + long argl; /* Arbitary long */ + void *argp; /* Arbitary void * */ + CRYPTO_EX_new *new_func; + CRYPTO_EX_free *free_func; + CRYPTO_EX_dup *dup_func; +} CRYPTO_EX_DATA_FUNCS; + +DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) + +/* Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA + * entry. + */ + +#define CRYPTO_EX_INDEX_BIO 0 +#define CRYPTO_EX_INDEX_SSL 1 +#define CRYPTO_EX_INDEX_SSL_CTX 2 +#define CRYPTO_EX_INDEX_SSL_SESSION 3 +#define CRYPTO_EX_INDEX_X509_STORE 4 +#define CRYPTO_EX_INDEX_X509_STORE_CTX 5 +#define CRYPTO_EX_INDEX_RSA 6 +#define CRYPTO_EX_INDEX_DSA 7 +#define CRYPTO_EX_INDEX_DH 8 +#define CRYPTO_EX_INDEX_ENGINE 9 +#define CRYPTO_EX_INDEX_X509 10 +#define CRYPTO_EX_INDEX_UI 11 +#define CRYPTO_EX_INDEX_ECDSA 12 +#define CRYPTO_EX_INDEX_ECDH 13 +#define CRYPTO_EX_INDEX_COMP 14 +#define CRYPTO_EX_INDEX_STORE 15 +#define CRYPTO_EX_INDEX_EC_KEY 16 + +/* Dynamically assigned indexes start from this value (don't use directly, use + * via CRYPTO_ex_data_new_class). */ +#define CRYPTO_EX_INDEX_USER 100 + +#ifndef LIBRESSL_INTERNAL +#define CRYPTO_malloc_init() (0) +#define CRYPTO_malloc_debug_init() (0) + +#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD +# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */ +# define CRYPTO_MDEBUG +# endif +#endif + +int CRYPTO_mem_ctrl(int mode); +int CRYPTO_is_mem_check_on(void); + +/* for applications */ +#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) +#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) + +#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,NULL,0) +#define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0) +#define OPENSSL_realloc(addr,num) \ + CRYPTO_realloc((char *)addr,(int)num,NULL,0) +#define OPENSSL_realloc_clean(addr,old_num,num) \ + CRYPTO_realloc_clean(addr,old_num,num,NULL,0) +#define OPENSSL_remalloc(addr,num) \ + CRYPTO_remalloc((char **)addr,(int)num,NULL,0) +#define OPENSSL_freeFunc CRYPTO_free +#define OPENSSL_free(addr) CRYPTO_free(addr) + +#define OPENSSL_malloc_locked(num) \ + CRYPTO_malloc_locked((int)num,NULL,0) +#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) +#endif + +const char *OpenSSL_version(int type); +#define OPENSSL_VERSION 0 +#define OPENSSL_CFLAGS 1 +#define OPENSSL_BUILT_ON 2 +#define OPENSSL_PLATFORM 3 +#define OPENSSL_DIR 4 +#define OPENSSL_ENGINES_DIR 5 +unsigned long OpenSSL_version_num(void); + +const char *SSLeay_version(int type); +unsigned long SSLeay(void); + +/* An opaque type representing an implementation of "ex_data" support */ +typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL; +/* Return an opaque pointer to the current "ex_data" implementation */ +const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void); +/* Sets the "ex_data" implementation to be used (if it's not too late) */ +int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i); +/* Get a new "ex_data" class, and return the corresponding "class_index" */ +int CRYPTO_ex_data_new_class(void); +/* Within a given class, get/register a new index */ +int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, + CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, + CRYPTO_EX_free *free_func); +/* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a given + * class (invokes whatever per-class callbacks are applicable) */ +int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); +int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, + CRYPTO_EX_DATA *from); +void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); +/* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular index + * (relative to the class type involved) */ +int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); +void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx); +/* This function cleans up all "ex_data" state. It mustn't be called under + * potential race-conditions. */ +void CRYPTO_cleanup_all_ex_data(void); + +void CRYPTO_lock(int mode, int type, const char *file, int line); +int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, + int line); + +/* Don't use this structure directly. */ +typedef struct crypto_threadid_st { + void *ptr; + unsigned long val; +} CRYPTO_THREADID; +void CRYPTO_THREADID_current(CRYPTO_THREADID *id); +int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b); +void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src); +unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id); + +#ifndef LIBRESSL_INTERNAL +/* These functions are deprecated no-op stubs */ +void CRYPTO_set_id_callback(unsigned long (*func)(void)); +unsigned long (*CRYPTO_get_id_callback(void))(void); +unsigned long CRYPTO_thread_id(void); + +int CRYPTO_get_new_lockid(char *name); +const char *CRYPTO_get_lock_name(int type); + +int CRYPTO_num_locks(void); +void CRYPTO_set_locking_callback(void (*func)(int mode, int type, + const char *file, int line)); +void (*CRYPTO_get_locking_callback(void))(int mode, int type, + const char *file, int line); +void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int type, + const char *file, int line)); +int (*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, + const char *file, int line); + +void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val); +void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr); +int CRYPTO_THREADID_set_callback(void (*threadid_func)(CRYPTO_THREADID *)); +void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *); + +int CRYPTO_get_new_dynlockid(void); +void CRYPTO_destroy_dynlockid(int i); +struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i); +void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, int line)); +void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)); +void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, const char *file, int line)); +struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file, int line); +void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line); +void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file, int line); +#endif + +/* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- + * call the latter last if you need different functions */ +int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *)); +int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *)); +int CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), + void *(*r)(void *, size_t, const char *, int), void (*f)(void *)); +int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int), + void (*free_func)(void *)); +int CRYPTO_set_mem_debug_functions( + void (*m)(void *, int, const char *, int, int), + void (*r)(void *, void *, int, const char *, int, int), + void (*f)(void *, int), void (*so)(long), long (*go)(void)); +void CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t), + void (**f)(void *)); +void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); +void CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int), + void *(**r)(void *, size_t, const char *, int), void (**f)(void *)); +void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int), + void (**f)(void *)); +void CRYPTO_get_mem_debug_functions( + void (**m)(void *, int, const char *, int, int), + void (**r)(void *, void *, int, const char *, int, int), + void (**f)(void *, int), void (**so)(long), long (**go)(void)); + +#ifndef LIBRESSL_INTERNAL +void *CRYPTO_malloc_locked(int num, const char *file, int line); +void CRYPTO_free_locked(void *ptr); +void *CRYPTO_malloc(int num, const char *file, int line); +char *CRYPTO_strdup(const char *str, const char *file, int line); +void CRYPTO_free(void *ptr); +void *CRYPTO_realloc(void *addr, int num, const char *file, int line); +#endif + +void *CRYPTO_realloc_clean(void *addr, int old_num, int num, + const char *file, int line); +void *CRYPTO_remalloc(void *addr, int num, const char *file, int line); + +#ifndef LIBRESSL_INTERNAL +void OPENSSL_cleanse(void *ptr, size_t len); +#endif + +void CRYPTO_set_mem_debug_options(long bits); +long CRYPTO_get_mem_debug_options(void); + +#define CRYPTO_push_info(info) \ + CRYPTO_push_info_(info, NULL, 0); +int CRYPTO_push_info_(const char *info, const char *file, int line); +int CRYPTO_pop_info(void); +int CRYPTO_remove_all_info(void); + + +/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro; + * used as default in CRYPTO_MDEBUG compilations): */ +/* The last argument has the following significance: + * + * 0: called before the actual memory allocation has taken place + * 1: called after the actual memory allocation has taken place + */ +void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, int before_p) + __attribute__ ((deprecated)); +void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file, int line, int before_p) + __attribute__ ((deprecated)); +void CRYPTO_dbg_free(void *addr, int before_p) + __attribute__ ((deprecated)); +/* Tell the debugging code about options. By default, the following values + * apply: + * + * 0: Clear all options. + * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option. + * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option. + * V_CRYPTO_MDEBUG_ALL (3): 1 + 2 + */ +void CRYPTO_dbg_set_options(long bits) + __attribute__ ((deprecated)); +long CRYPTO_dbg_get_options(void) + __attribute__ ((deprecated)); + + +int CRYPTO_mem_leaks_fp(FILE *); +int CRYPTO_mem_leaks(struct bio_st *bio); +/* unsigned long order, char *file, int line, int num_bytes, char *addr */ +typedef int *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); +int CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); + +/* die if we have to */ +void OpenSSLDie(const char *file, int line, const char *assertion); +#define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) + +uint64_t OPENSSL_cpu_caps(void); + +int OPENSSL_isservice(void); + +#ifndef LIBRESSL_INTERNAL +int FIPS_mode(void); +int FIPS_mode_set(int r); + +void OPENSSL_init(void); + +/* CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. It + * takes an amount of time dependent on |len|, but independent of the contents + * of |a| and |b|. Unlike memcmp, it cannot be used to put elements into a + * defined order as the return value when a != b is undefined, other than to be + * non-zero. */ +int CRYPTO_memcmp(const void *a, const void *b, size_t len); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_CRYPTO_strings(void); + +/* Error codes for the CRYPTO functions. */ + +/* Function codes. */ +#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 +#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103 +#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 +#define CRYPTO_F_CRYPTO_SET_EX_DATA 102 +#define CRYPTO_F_DEF_ADD_INDEX 104 +#define CRYPTO_F_DEF_GET_CLASS 105 +#define CRYPTO_F_FIPS_MODE_SET 109 +#define CRYPTO_F_INT_DUP_EX_DATA 106 +#define CRYPTO_F_INT_FREE_EX_DATA 107 +#define CRYPTO_F_INT_NEW_EX_DATA 108 + +/* Reason codes. */ +#define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 +#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 + +/* + * OpenSSL compatible OPENSSL_INIT options. + */ + +#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000001L +#define OPENSSL_INIT_LOAD_CONFIG 0x00000002L + +/* LibreSSL specific */ +#define _OPENSSL_INIT_FLAG_NOOP 0x80000000L + +/* + * These are provided for compatibiliy, but have no effect + * on how LibreSSL is initialized. + */ +#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ADD_ALL_CIPHERS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ADD_ALL_DIGESTS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ASYNC _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_RDRAND _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_DYNAMIC _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_OPENSSL _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_CRYPTODEV _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_CAPI _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_PADLOCK _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_AFALG _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_reserved_internal _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ATFORK _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_ENGINE_ALL_BUILTIN _OPENSSL_INIT_FLAG_NOOP + +int OPENSSL_init_crypto(uint64_t opts, const void *settings); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ct.h b/code/contrib/libfido2/include/openssl/ct.h new file mode 100644 index 0000000..2b54903 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ct.h @@ -0,0 +1,514 @@ +/* $OpenBSD: ct.h,v 1.6 2021/12/18 16:50:40 tb Exp $ */ +/* + * Public API for Certificate Transparency (CT). + * Written by Rob Percival (robpercival@google.com) for the OpenSSL project. + */ +/* ==================================================================== + * Copyright (c) 2016 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + +#ifndef HEADER_CT_H +#define HEADER_CT_H + +#include + +#ifndef OPENSSL_NO_CT +#include +#include +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* Minimum RSA key size, from RFC6962 */ +#define SCT_MIN_RSA_BITS 2048 + +/* All hashes are SHA256 in v1 of Certificate Transparency */ +#define CT_V1_HASHLEN SHA256_DIGEST_LENGTH + +typedef enum { + CT_LOG_ENTRY_TYPE_NOT_SET = -1, + CT_LOG_ENTRY_TYPE_X509 = 0, + CT_LOG_ENTRY_TYPE_PRECERT = 1 +} ct_log_entry_type_t; + +typedef enum { + SCT_VERSION_NOT_SET = -1, + SCT_VERSION_V1 = 0 +} sct_version_t; + +typedef enum { + SCT_SOURCE_UNKNOWN, + SCT_SOURCE_TLS_EXTENSION, + SCT_SOURCE_X509V3_EXTENSION, + SCT_SOURCE_OCSP_STAPLED_RESPONSE +} sct_source_t; + +typedef enum { + SCT_VALIDATION_STATUS_NOT_SET, + SCT_VALIDATION_STATUS_UNKNOWN_LOG, + SCT_VALIDATION_STATUS_VALID, + SCT_VALIDATION_STATUS_INVALID, + SCT_VALIDATION_STATUS_UNVERIFIED, + SCT_VALIDATION_STATUS_UNKNOWN_VERSION +} sct_validation_status_t; + +DECLARE_STACK_OF(SCT) +DECLARE_STACK_OF(CTLOG) + +/****************************************** + * CT policy evaluation context functions * + ******************************************/ + +/* + * Creates a new, empty policy evaluation context. + * The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished + * with the CT_POLICY_EVAL_CTX. + */ +CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void); + +/* Deletes a policy evaluation context and anything it owns. */ +void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx); + +/* Gets the peer certificate that the SCTs are for */ +X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the certificate associated with the received SCTs. + * Increments the reference count of cert. + * Returns 1 on success, 0 otherwise. + */ +int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert); + +/* Gets the issuer of the aforementioned certificate */ +X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the issuer of the certificate associated with the received SCTs. + * Increments the reference count of issuer. + * Returns 1 on success, 0 otherwise. + */ +int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer); + +/* Gets the CT logs that are trusted sources of SCTs */ +const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx); + +/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */ +void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, + CTLOG_STORE *log_store); + +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + +/***************** + * SCT functions * + *****************/ + +/* + * Creates a new, blank SCT. + * The caller is responsible for calling SCT_free when finished with the SCT. + */ +SCT *SCT_new(void); + +/* + * Creates a new SCT from some base64-encoded strings. + * The caller is responsible for calling SCT_free when finished with the SCT. + */ +SCT *SCT_new_from_base64(unsigned char version, const char *logid_base64, + ct_log_entry_type_t entry_type, uint64_t timestamp, + const char *extensions_base64, const char *signature_base64); + +/* + * Frees the SCT and the underlying data structures. + */ +void SCT_free(SCT *sct); + +/* + * Free a stack of SCTs, and the underlying SCTs themselves. + * Intended to be compatible with X509V3_EXT_FREE. + */ +void SCT_LIST_free(STACK_OF(SCT) *a); + +/* + * Returns the version of the SCT. + */ +sct_version_t SCT_get_version(const SCT *sct); + +/* + * Set the version of an SCT. + * Returns 1 on success, 0 if the version is unrecognized. + */ +int SCT_set_version(SCT *sct, sct_version_t version); + +/* + * Returns the log entry type of the SCT. + */ +ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct); + +/* + * Set the log entry type of an SCT. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type); + +/* + * Gets the ID of the log that an SCT came from. + * Ownership of the log ID remains with the SCT. + * Returns the length of the log ID. + */ +size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id); + +/* + * Set the log ID of an SCT to point directly to the *log_id specified. + * The SCT takes ownership of the specified pointer. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len); + +/* + * Set the log ID of an SCT. + * This makes a copy of the log_id. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set1_log_id(SCT *sct, const unsigned char *log_id, + size_t log_id_len); + +/* + * Returns the timestamp for the SCT (epoch time in milliseconds). + */ +uint64_t SCT_get_timestamp(const SCT *sct); + +/* + * Set the timestamp of an SCT (epoch time in milliseconds). + */ +void SCT_set_timestamp(SCT *sct, uint64_t timestamp); + +/* + * Return the NID for the signature used by the SCT. + * For CT v1, this will be either NID_sha256WithRSAEncryption or + * NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset). + */ +int SCT_get_signature_nid(const SCT *sct); + +/* + * Set the signature type of an SCT + * For CT v1, this should be either NID_sha256WithRSAEncryption or + * NID_ecdsa_with_SHA256. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set_signature_nid(SCT *sct, int nid); + +/* + * Set *ext to point to the extension data for the SCT. ext must not be NULL. + * The SCT retains ownership of this pointer. + * Returns length of the data pointed to. + */ +size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext); + +/* + * Set the extensions of an SCT to point directly to the *ext specified. + * The SCT takes ownership of the specified pointer. + */ +void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len); + +/* + * Set the extensions of an SCT. + * This takes a copy of the ext. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set1_extensions(SCT *sct, const unsigned char *ext, + size_t ext_len); + +/* + * Set *sig to point to the signature for the SCT. sig must not be NULL. + * The SCT retains ownership of this pointer. + * Returns length of the data pointed to. + */ +size_t SCT_get0_signature(const SCT *sct, unsigned char **sig); + +/* + * Set the signature of an SCT to point directly to the *sig specified. + * The SCT takes ownership of the specified pointer. + */ +void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len); + +/* + * Set the signature of an SCT to be a copy of the *sig specified. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set1_signature(SCT *sct, const unsigned char *sig, + size_t sig_len); + +/* + * The origin of this SCT, e.g. TLS extension, OCSP response, etc. + */ +sct_source_t SCT_get_source(const SCT *sct); + +/* + * Set the origin of this SCT, e.g. TLS extension, OCSP response, etc. + * Returns 1 on success, 0 otherwise. + */ +int SCT_set_source(SCT *sct, sct_source_t source); + +/* + * Returns a text string describing the validation status of |sct|. + */ +const char *SCT_validation_status_string(const SCT *sct); + +/* + * Pretty-prints an |sct| to |out|. + * It will be indented by the number of spaces specified by |indent|. + * If |logs| is not NULL, it will be used to lookup the CT log that the SCT came + * from, so that the log name can be printed. + */ +void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs); + +/* + * Pretty-prints an |sct_list| to |out|. + * It will be indented by the number of spaces specified by |indent|. + * SCTs will be delimited by |separator|. + * If |logs| is not NULL, it will be used to lookup the CT log that each SCT + * came from, so that the log names can be printed. + */ +void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent, + const char *separator, const CTLOG_STORE *logs); + +/* + * Gets the last result of validating this SCT. + * If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET. + */ +sct_validation_status_t SCT_get_validation_status(const SCT *sct); + +/* + * Validates the given SCT with the provided context. + * Sets the "validation_status" field of the SCT. + * Returns 1 if the SCT is valid and the signature verifies. + * Returns 0 if the SCT is invalid or could not be verified. + * Returns -1 if an error occurs. + */ +int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx); + +/* + * Validates the given list of SCTs with the provided context. + * Sets the "validation_status" field of each SCT. + * Returns 1 if there are no invalid SCTs and all signatures verify. + * Returns 0 if at least one SCT is invalid or could not be verified. + * Returns a negative integer if an error occurs. + */ +int SCT_LIST_validate(const STACK_OF(SCT) *scts, + CT_POLICY_EVAL_CTX *ctx); + + +/********************************* + * SCT parsing and serialisation * + *********************************/ + +/* + * Serialize (to TLS format) a stack of SCTs and return the length. + * "a" must not be NULL. + * If "pp" is NULL, just return the length of what would have been serialized. + * If "pp" is not NULL and "*pp" is null, function will allocate a new pointer + * for data that caller is responsible for freeing (only if function returns + * successfully). + * If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring + * that "*pp" is large enough to accept all of the serialized data. + * Returns < 0 on error, >= 0 indicating bytes written (or would have been) + * on success. + */ +int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); + +/* + * Convert TLS format SCT list to a stack of SCTs. + * If "a" or "*a" is NULL, a new stack will be created that the caller is + * responsible for freeing (by calling SCT_LIST_free). + * "**pp" and "*pp" must not be NULL. + * Upon success, "*pp" will point to after the last bytes read, and a stack + * will be returned. + * Upon failure, a NULL pointer will be returned, and the position of "*pp" is + * not defined. + */ +STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + size_t len); + +/* + * Serialize (to DER format) a stack of SCTs and return the length. + * "a" must not be NULL. + * If "pp" is NULL, just returns the length of what would have been serialized. + * If "pp" is not NULL and "*pp" is null, function will allocate a new pointer + * for data that caller is responsible for freeing (only if function returns + * successfully). + * If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring + * that "*pp" is large enough to accept all of the serialized data. + * Returns < 0 on error, >= 0 indicating bytes written (or would have been) + * on success. + */ +int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); + +/* + * Parses an SCT list in DER format and returns it. + * If "a" or "*a" is NULL, a new stack will be created that the caller is + * responsible for freeing (by calling SCT_LIST_free). + * "**pp" and "*pp" must not be NULL. + * Upon success, "*pp" will point to after the last bytes read, and a stack + * will be returned. + * Upon failure, a NULL pointer will be returned, and the position of "*pp" is + * not defined. + */ +STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + long len); + +/* + * Serialize (to TLS format) an |sct| and write it to |out|. + * If |out| is null, no SCT will be output but the length will still be returned. + * If |out| points to a null pointer, a string will be allocated to hold the + * TLS-format SCT. It is the responsibility of the caller to free it. + * If |out| points to an allocated string, the TLS-format SCT will be written + * to it. + * The length of the SCT in TLS format will be returned. + */ +int i2o_SCT(const SCT *sct, unsigned char **out); + +/* + * Parses an SCT in TLS format and returns it. + * If |psct| is not null, it will end up pointing to the parsed SCT. If it + * already points to a non-null pointer, the pointer will be free'd. + * |in| should be a pointer to a string containing the TLS-format SCT. + * |in| will be advanced to the end of the SCT if parsing succeeds. + * |len| should be the length of the SCT in |in|. + * Returns NULL if an error occurs. + * If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len' + * fields will be populated (with |in| and |len| respectively). + */ +SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len); + +/******************** + * CT log functions * + ********************/ + +/* + * Creates a new CT log instance with the given |public_key| and |name|. + * Takes ownership of |public_key| but copies |name|. + * Returns NULL if malloc fails or if |public_key| cannot be converted to DER. + * Should be deleted by the caller using CTLOG_free when no longer needed. + */ +CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name); + +/* + * Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER + * in |pkey_base64|. The |name| is a string to help users identify this log. + * Returns 1 on success, 0 on failure. + * Should be deleted by the caller using CTLOG_free when no longer needed. + */ +int CTLOG_new_from_base64(CTLOG **ct_log, const char *pkey_base64, + const char *name); + +/* + * Deletes a CT log instance and its fields. + */ +void CTLOG_free(CTLOG *log); + +/* Gets the name of the CT log */ +const char *CTLOG_get0_name(const CTLOG *log); +/* Gets the ID of the CT log */ +void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id, + size_t *log_id_len); +/* Gets the public key of the CT log */ +EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); + +/************************** + * CT log store functions * + **************************/ + +/* + * Creates a new CT log store. + * Should be deleted by the caller using CTLOG_STORE_free when no longer needed. + */ +CTLOG_STORE *CTLOG_STORE_new(void); + +/* + * Deletes a CT log store and all of the CT log instances held within. + */ +void CTLOG_STORE_free(CTLOG_STORE *store); + +/* + * Finds a CT log in the store based on its log ID. + * Returns the CT log, or NULL if no match is found. + */ +const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store, + const uint8_t *log_id, size_t log_id_len); + +/* + * Loads a CT log list into a |store| from a |file|. + * Returns 1 if loading is successful, or 0 otherwise. + */ +int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file); + +/* + * Loads the default CT log list into a |store|. + * Returns 1 if loading is successful, or 0 otherwise. + */ +int CTLOG_STORE_load_default_file(CTLOG_STORE *store); + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/cterr.h b/code/contrib/libfido2/include/openssl/cterr.h new file mode 100644 index 0000000..07ae519 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/cterr.h @@ -0,0 +1,127 @@ +/* $OpenBSD: cterr.h,v 1.5 2021/12/18 16:50:40 tb Exp $ */ +/* ==================================================================== + * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +/* NOTE: this file was auto generated by the mkerr.pl script: any changes + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. + */ + +#ifndef HEADER_CTERR_H +# define HEADER_CTERR_H + +# include + +# ifndef OPENSSL_NO_CT + +#ifdef __cplusplus +extern "C" +#endif + +int ERR_load_CT_strings(void); + +/* + * CT function codes. + */ +# define CT_F_CTLOG_NEW 117 +# define CT_F_CTLOG_NEW_FROM_BASE64 118 +# define CT_F_CTLOG_NEW_FROM_CONF 119 +# define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 +# define CT_F_CTLOG_STORE_LOAD_FILE 123 +# define CT_F_CTLOG_STORE_LOAD_LOG 130 +# define CT_F_CTLOG_STORE_NEW 131 +# define CT_F_CT_BASE64_DECODE 124 +# define CT_F_CT_POLICY_EVAL_CTX_NEW 133 +# define CT_F_CT_V1_LOG_ID_FROM_PKEY 125 +# define CT_F_I2O_SCT 107 +# define CT_F_I2O_SCT_LIST 108 +# define CT_F_I2O_SCT_SIGNATURE 109 +# define CT_F_O2I_SCT 110 +# define CT_F_O2I_SCT_LIST 111 +# define CT_F_O2I_SCT_SIGNATURE 112 +# define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_CTX_VERIFY 128 +# define CT_F_SCT_NEW 100 +# define CT_F_SCT_NEW_FROM_BASE64 127 +# define CT_F_SCT_SET0_LOG_ID 101 +# define CT_F_SCT_SET1_EXTENSIONS 114 +# define CT_F_SCT_SET1_LOG_ID 115 +# define CT_F_SCT_SET1_SIGNATURE 116 +# define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 +# define CT_F_SCT_SET_SIGNATURE_NID 103 +# define CT_F_SCT_SET_VERSION 104 + +/* + * CT reason codes. + */ +# define CT_R_BASE64_DECODE_ERROR 108 +# define CT_R_INVALID_LOG_ID_LENGTH 100 +# define CT_R_LOG_CONF_INVALID 109 +# define CT_R_LOG_CONF_INVALID_KEY 110 +# define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 +# define CT_R_LOG_CONF_MISSING_KEY 112 +# define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_FUTURE_TIMESTAMP 116 +# define CT_R_SCT_INVALID 104 +# define CT_R_SCT_INVALID_SIGNATURE 107 +# define CT_R_SCT_LIST_INVALID 105 +# define CT_R_SCT_LOG_ID_MISMATCH 114 +# define CT_R_SCT_NOT_SET 106 +# define CT_R_SCT_UNSUPPORTED_VERSION 115 +# define CT_R_UNRECOGNIZED_SIGNATURE_NID 101 +# define CT_R_UNSUPPORTED_ENTRY_TYPE 102 +# define CT_R_UNSUPPORTED_VERSION 103 + +# endif +#endif diff --git a/code/contrib/libfido2/include/openssl/curve25519.h b/code/contrib/libfido2/include/openssl/curve25519.h new file mode 100644 index 0000000..c16a4e2 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/curve25519.h @@ -0,0 +1,68 @@ +/* $OpenBSD: curve25519.h,v 1.3 2019/05/11 15:55:52 tb Exp $ */ +/* + * Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CURVE25519_H +#define HEADER_CURVE25519_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Curve25519. + * + * Curve25519 is an elliptic curve. See https://tools.ietf.org/html/rfc7748. + */ + +/* + * X25519. + * + * X25519 is the Diffie-Hellman primitive built from curve25519. It is + * sometimes referred to as curve25519, but X25519 is a more precise name. + * See http://cr.yp.to/ecdh.html and https://tools.ietf.org/html/rfc7748. + */ + +#define X25519_KEY_LENGTH 32 + +/* + * X25519_keypair sets |out_public_value| and |out_private_key| to a freshly + * generated, public/private key pair. + */ +void X25519_keypair(uint8_t out_public_value[X25519_KEY_LENGTH], + uint8_t out_private_key[X25519_KEY_LENGTH]); + +/* + * X25519 writes a shared key to |out_shared_key| that is calculated from the + * given private key and the peer's public value. It returns one on success and + * zero on error. + * + * Don't use the shared key directly, rather use a KDF and also include the two + * public values as inputs. + */ +int X25519(uint8_t out_shared_key[X25519_KEY_LENGTH], + const uint8_t private_key[X25519_KEY_LENGTH], + const uint8_t peers_public_value[X25519_KEY_LENGTH]); + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* HEADER_CURVE25519_H */ diff --git a/code/contrib/libfido2/include/openssl/des.h b/code/contrib/libfido2/include/openssl/des.h new file mode 100644 index 0000000..e1331d3 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/des.h @@ -0,0 +1,219 @@ +/* $OpenBSD: des.h,v 1.19 2015/02/07 13:19:15 doug Exp $ */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_NEW_DES_H +#define HEADER_NEW_DES_H + +#include + +#ifdef OPENSSL_NO_DES +#error DES is disabled. +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned char DES_cblock[8]; +typedef /* const */ unsigned char const_DES_cblock[8]; +/* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * + * and const_DES_cblock * are incompatible pointer types. */ + +typedef struct DES_ks + { + union + { + DES_cblock cblock; + /* make sure things are correct size on machines with + * 8 byte longs */ + DES_LONG deslong[2]; + } ks[16]; + } DES_key_schedule; + +#define DES_KEY_SZ (sizeof(DES_cblock)) +#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) + +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#define DES_CBC_MODE 0 +#define DES_PCBC_MODE 1 + +#define DES_ecb2_encrypt(i,o,k1,k2,e) \ + DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) + +#define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ + DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) + +#define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ + DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) + +#define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ + DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) + +extern int DES_check_key; /* defaults to false */ +extern int DES_rw_mode; /* defaults to DES_PCBC_MODE */ + +const char *DES_options(void); +void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, + DES_key_schedule *ks1,DES_key_schedule *ks2, + DES_key_schedule *ks3, int enc); +DES_LONG DES_cbc_cksum(const unsigned char *input,DES_cblock *output, + long length,DES_key_schedule *schedule, + const_DES_cblock *ivec); +/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ +void DES_cbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +void DES_ncbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +void DES_xcbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + const_DES_cblock *inw,const_DES_cblock *outw,int enc); +void DES_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +void DES_ecb_encrypt(const_DES_cblock *input,DES_cblock *output, + DES_key_schedule *ks,int enc); + +/* This is the DES encryption function that gets called by just about + every other DES routine in the library. You should not use this + function except to implement 'modes' of DES. I say this because the + functions that call this routine do the conversion from 'char *' to + long, and this needs to be done to make sure 'non-aligned' memory + access do not occur. The characters are loaded 'little endian'. + Data is a pointer to 2 unsigned long's and ks is the + DES_key_schedule to use. enc, is non zero specifies encryption, + zero if decryption. */ +void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc); + +/* This functions is the same as DES_encrypt1() except that the DES + initial permutation (IP) and final permutation (FP) have been left + out. As for DES_encrypt1(), you should not use this function. + It is used by the routines in the library that implement triple DES. + IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same + as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */ +void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc); + +void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3); +void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3); +void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output, + long length, + DES_key_schedule *ks1,DES_key_schedule *ks2, + DES_key_schedule *ks3,DES_cblock *ivec,int enc); +void DES_ede3_cbcm_encrypt(const unsigned char *in,unsigned char *out, + long length, + DES_key_schedule *ks1,DES_key_schedule *ks2, + DES_key_schedule *ks3, + DES_cblock *ivec1,DES_cblock *ivec2, + int enc); +void DES_ede3_cfb64_encrypt(const unsigned char *in,unsigned char *out, + long length,DES_key_schedule *ks1, + DES_key_schedule *ks2,DES_key_schedule *ks3, + DES_cblock *ivec,int *num,int enc); +void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out, + int numbits,long length,DES_key_schedule *ks1, + DES_key_schedule *ks2,DES_key_schedule *ks3, + DES_cblock *ivec,int enc); +void DES_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out, + long length,DES_key_schedule *ks1, + DES_key_schedule *ks2,DES_key_schedule *ks3, + DES_cblock *ivec,int *num); +int DES_enc_read(int fd,void *buf,int len,DES_key_schedule *sched, + DES_cblock *iv); +int DES_enc_write(int fd,const void *buf,int len,DES_key_schedule *sched, + DES_cblock *iv); +char *DES_fcrypt(const char *buf,const char *salt, char *ret); +char *DES_crypt(const char *buf,const char *salt); +void DES_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits, + long length,DES_key_schedule *schedule,DES_cblock *ivec); +void DES_pcbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +DES_LONG DES_quad_cksum(const unsigned char *input,DES_cblock output[], + long length,int out_count,DES_cblock *seed); +int DES_random_key(DES_cblock *ret); +void DES_set_odd_parity(DES_cblock *key); +int DES_check_key_parity(const_DES_cblock *key); +int DES_is_weak_key(const_DES_cblock *key); +/* DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked if global variable DES_check_key is set, + * DES_set_key_unchecked otherwise. */ +int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule); +int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule); +int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule); +void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); +void DES_string_to_key(const char *str,DES_cblock *key); +void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2); +void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length, + DES_key_schedule *schedule,DES_cblock *ivec,int *num, + int enc); +void DES_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length, + DES_key_schedule *schedule,DES_cblock *ivec,int *num); + +#define DES_fixup_key_parity DES_set_odd_parity + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/dh.h b/code/contrib/libfido2/include/openssl/dh.h new file mode 100644 index 0000000..ef10495 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/dh.h @@ -0,0 +1,253 @@ +/* $OpenBSD: dh.h,v 1.32 2022/01/14 08:25:44 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_DH_H +#define HEADER_DH_H + +#include + +#ifdef OPENSSL_NO_DH +#error DH is disabled. +#endif + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifndef OPENSSL_DH_MAX_MODULUS_BITS +# define OPENSSL_DH_MAX_MODULUS_BITS 10000 +#endif + +#define DH_FLAG_CACHE_MONT_P 0x01 + +/* If this flag is set the DH method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its reposibility + * to ensure the result is compliant. + */ + +#define DH_FLAG_FIPS_METHOD 0x0400 + +/* If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define DH_FLAG_NON_FIPS_ALLOW 0x0400 + +#ifdef __cplusplus +extern "C" { +#endif + +#define DH_GENERATOR_2 2 +/* #define DH_GENERATOR_3 3 */ +#define DH_GENERATOR_5 5 + +/* DH_check error codes */ +#define DH_CHECK_P_NOT_PRIME 0x01 +#define DH_CHECK_P_NOT_SAFE_PRIME 0x02 +#define DH_UNABLE_TO_CHECK_GENERATOR 0x04 +#define DH_NOT_SUITABLE_GENERATOR 0x08 +#define DH_CHECK_Q_NOT_PRIME 0x10 +#define DH_CHECK_INVALID_Q_VALUE 0x20 +#define DH_CHECK_INVALID_J_VALUE 0x40 + +/* DH_check_pub_key error codes */ +#define DH_CHECK_PUBKEY_TOO_SMALL 0x01 +#define DH_CHECK_PUBKEY_TOO_LARGE 0x02 +#define DH_CHECK_PUBKEY_INVALID 0x04 + +/* primes p where (p-1)/2 is prime too are called "safe"; we define + this for backward compatibility: */ +#define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME + +DH *d2i_DHparams_bio(BIO *bp, DH **a); +int i2d_DHparams_bio(BIO *bp, DH *a); +DH *d2i_DHparams_fp(FILE *fp, DH **a); +int i2d_DHparams_fp(FILE *fp, DH *a); + +DH *DHparams_dup(DH *); + +const DH_METHOD *DH_OpenSSL(void); + +void DH_set_default_method(const DH_METHOD *meth); +const DH_METHOD *DH_get_default_method(void); +int DH_set_method(DH *dh, const DH_METHOD *meth); +DH *DH_new_method(ENGINE *engine); + +DH * DH_new(void); +void DH_free(DH *dh); +int DH_up_ref(DH *dh); +int DH_size(const DH *dh); +int DH_bits(const DH *dh); +int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int DH_set_ex_data(DH *d, int idx, void *arg); +void *DH_get_ex_data(DH *d, int idx); + +ENGINE *DH_get0_engine(DH *d); +void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, + const BIGNUM **g); +int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); +void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key); +int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); +const BIGNUM *DH_get0_p(const DH *dh); +const BIGNUM *DH_get0_q(const DH *dh); +const BIGNUM *DH_get0_g(const DH *dh); +const BIGNUM *DH_get0_priv_key(const DH *dh); +const BIGNUM *DH_get0_pub_key(const DH *dh); +void DH_clear_flags(DH *dh, int flags); +int DH_test_flags(const DH *dh, int flags); +void DH_set_flags(DH *dh, int flags); +long DH_get_length(const DH *dh); +int DH_set_length(DH *dh, long length); + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED +DH * DH_generate_parameters(int prime_len,int generator, + void (*callback)(int,int,void *),void *cb_arg); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* New version */ +int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb); + +int DH_check(const DH *dh,int *codes); +int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes); +int DH_generate_key(DH *dh); +int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh); +DH * d2i_DHparams(DH **a,const unsigned char **pp, long length); +int i2d_DHparams(const DH *a,unsigned char **pp); +int DHparams_print_fp(FILE *fp, const DH *x); +#ifndef OPENSSL_NO_BIO +int DHparams_print(BIO *bp, const DH *x); +#else +int DHparams_print(char *bp, const DH *x); +#endif + +#define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) + +#define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) + +#define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2) + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_DH_strings(void); + +/* Error codes for the DH functions. */ + +/* Function codes. */ +#define DH_F_COMPUTE_KEY 102 +#define DH_F_DHPARAMS_PRINT_FP 101 +#define DH_F_DH_BUILTIN_GENPARAMS 106 +#define DH_F_DH_COMPUTE_KEY 114 +#define DH_F_DH_GENERATE_KEY 115 +#define DH_F_DH_GENERATE_PARAMETERS_EX 116 +#define DH_F_DH_NEW_METHOD 105 +#define DH_F_DH_PARAM_DECODE 107 +#define DH_F_DH_PRIV_DECODE 110 +#define DH_F_DH_PRIV_ENCODE 111 +#define DH_F_DH_PUB_DECODE 108 +#define DH_F_DH_PUB_ENCODE 109 +#define DH_F_DO_DH_PRINT 100 +#define DH_F_GENERATE_KEY 103 +#define DH_F_GENERATE_PARAMETERS 104 +#define DH_F_PKEY_DH_DERIVE 112 +#define DH_F_PKEY_DH_KEYGEN 113 + +/* Reason codes. */ +#define DH_R_BAD_GENERATOR 101 +#define DH_R_BN_DECODE_ERROR 109 +#define DH_R_BN_ERROR 106 +#define DH_R_DECODE_ERROR 104 +#define DH_R_INVALID_PUBKEY 102 +#define DH_R_KEYS_NOT_SET 108 +#define DH_R_KEY_SIZE_TOO_SMALL 110 +#define DH_R_MODULUS_TOO_LARGE 103 +#define DH_R_NON_FIPS_METHOD 111 +#define DH_R_NO_PARAMETERS_SET 107 +#define DH_R_NO_PRIVATE_VALUE 100 +#define DH_R_PARAMETER_ENCODING_ERROR 105 +#define DH_R_CHECK_INVALID_J_VALUE 115 +#define DH_R_CHECK_INVALID_Q_VALUE 116 +#define DH_R_CHECK_PUBKEY_INVALID 122 +#define DH_R_CHECK_PUBKEY_TOO_LARGE 123 +#define DH_R_CHECK_PUBKEY_TOO_SMALL 124 +#define DH_R_CHECK_P_NOT_PRIME 117 +#define DH_R_CHECK_P_NOT_SAFE_PRIME 118 +#define DH_R_CHECK_Q_NOT_PRIME 119 +#define DH_R_MISSING_PUBKEY 125 +#define DH_R_NOT_SUITABLE_GENERATOR 120 +#define DH_R_UNABLE_TO_CHECK_GENERATOR 121 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/dsa.h b/code/contrib/libfido2/include/openssl/dsa.h new file mode 100644 index 0000000..4fafce3 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/dsa.h @@ -0,0 +1,286 @@ +/* $OpenBSD: dsa.h,v 1.35 2022/01/14 08:27:23 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +/* + * The DSS routines are based on patches supplied by + * Steven Schoch . He basically did the + * work and I have just tweaked them a little to fit into my + * stylistic vision for SSLeay :-) */ + +#ifndef HEADER_DSA_H +#define HEADER_DSA_H + +#include + +#ifdef OPENSSL_NO_DSA +#error DSA is disabled. +#endif + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include + +#ifndef OPENSSL_NO_DEPRECATED +#include +#ifndef OPENSSL_NO_DH +# include +#endif +#endif + +#ifndef OPENSSL_DSA_MAX_MODULUS_BITS +# define OPENSSL_DSA_MAX_MODULUS_BITS 10000 +#endif + +#define DSA_FLAG_CACHE_MONT_P 0x01 + +/* If this flag is set the DSA method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its reposibility + * to ensure the result is compliant. + */ + +#define DSA_FLAG_FIPS_METHOD 0x0400 + +/* If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define DSA_FLAG_NON_FIPS_ALLOW 0x0400 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct DSA_SIG_st DSA_SIG; + +DSA *d2i_DSAparams_bio(BIO *bp, DSA **a); +int i2d_DSAparams_bio(BIO *bp, DSA *a); +DSA *d2i_DSAparams_fp(FILE *fp, DSA **a); +int i2d_DSAparams_fp(FILE *fp, DSA *a); + +DSA *DSAparams_dup(DSA *x); +DSA_SIG * DSA_SIG_new(void); +void DSA_SIG_free(DSA_SIG *a); +int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); +DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); +void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); +int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s); + +DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); +int DSA_do_verify(const unsigned char *dgst,int dgst_len, + DSA_SIG *sig,DSA *dsa); + +const DSA_METHOD *DSA_OpenSSL(void); + +void DSA_set_default_method(const DSA_METHOD *); +const DSA_METHOD *DSA_get_default_method(void); +int DSA_set_method(DSA *dsa, const DSA_METHOD *); + +DSA * DSA_new(void); +DSA * DSA_new_method(ENGINE *engine); +void DSA_free(DSA *r); +/* "up" the DSA object's reference count */ +int DSA_up_ref(DSA *r); +int DSA_size(const DSA *); +int DSA_bits(const DSA *d); + /* next 4 return -1 on error */ +int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); +int DSA_sign(int type,const unsigned char *dgst,int dlen, + unsigned char *sig, unsigned int *siglen, DSA *dsa); +int DSA_verify(int type,const unsigned char *dgst,int dgst_len, + const unsigned char *sigbuf, int siglen, DSA *dsa); +int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int DSA_set_ex_data(DSA *d, int idx, void *arg); +void *DSA_get_ex_data(DSA *d, int idx); + +DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); +int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); +extern const ASN1_ITEM DSAPublicKey_it; + +DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); +int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); +extern const ASN1_ITEM DSAPrivateKey_it; + +DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length); +int i2d_DSAparams(const DSA *a,unsigned char **pp); +extern const ASN1_ITEM DSAparams_it; + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED +DSA * DSA_generate_parameters(int bits, + unsigned char *seed,int seed_len, + int *counter_ret, unsigned long *h_ret,void + (*callback)(int, int, void *),void *cb_arg); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* New version */ +int DSA_generate_parameters_ex(DSA *dsa, int bits, + const unsigned char *seed,int seed_len, + int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); + +int DSA_generate_key(DSA *a); + +#ifndef OPENSSL_NO_BIO +int DSAparams_print(BIO *bp, const DSA *x); +int DSA_print(BIO *bp, const DSA *x, int off); +#endif +int DSAparams_print_fp(FILE *fp, const DSA *x); +int DSA_print_fp(FILE *bp, const DSA *x, int off); + +/* + * Primality test according to FIPS PUB 186-4, Appendix C.3. Set the number + * to 64 rounds of Miller-Rabin, which corresponds to 128 bits of security. + * This is necessary for keys of size >= 3072. + */ +#define DSS_prime_checks 64 +#define DSA_is_prime(n, callback, cb_arg) \ + BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + +#ifndef OPENSSL_NO_DH +/* Convert DSA structure (key or just parameters) into DH structure + * (be careful to avoid small subgroup attacks when using this!) */ +DH *DSA_dup_DH(const DSA *r); +#endif + +void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, + const BIGNUM **g); +int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g); +void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key); +int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key); +const BIGNUM *DSA_get0_p(const DSA *d); +const BIGNUM *DSA_get0_q(const DSA *d); +const BIGNUM *DSA_get0_g(const DSA *d); +const BIGNUM *DSA_get0_pub_key(const DSA *d); +const BIGNUM *DSA_get0_priv_key(const DSA *d); +void DSA_clear_flags(DSA *d, int flags); +int DSA_test_flags(const DSA *d, int flags); +void DSA_set_flags(DSA *d, int flags); +ENGINE *DSA_get0_engine(DSA *d); + +DSA_METHOD *DSA_meth_new(const char *name, int flags); +void DSA_meth_free(DSA_METHOD *meth); +DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); +int DSA_meth_set_sign(DSA_METHOD *meth, + DSA_SIG *(*sign)(const unsigned char *, int, DSA *)); +int DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *)); + +#define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) + +#define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3) + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_DSA_strings(void); + +/* Error codes for the DSA functions. */ + +/* Function codes. */ +#define DSA_F_D2I_DSA_SIG 110 +#define DSA_F_DO_DSA_PRINT 104 +#define DSA_F_DSAPARAMS_PRINT 100 +#define DSA_F_DSAPARAMS_PRINT_FP 101 +#define DSA_F_DSA_DO_SIGN 112 +#define DSA_F_DSA_DO_VERIFY 113 +#define DSA_F_DSA_GENERATE_KEY 124 +#define DSA_F_DSA_GENERATE_PARAMETERS_EX 123 +#define DSA_F_DSA_NEW_METHOD 103 +#define DSA_F_DSA_PARAM_DECODE 119 +#define DSA_F_DSA_PRINT_FP 105 +#define DSA_F_DSA_PRIV_DECODE 115 +#define DSA_F_DSA_PRIV_ENCODE 116 +#define DSA_F_DSA_PUB_DECODE 117 +#define DSA_F_DSA_PUB_ENCODE 118 +#define DSA_F_DSA_SIGN 106 +#define DSA_F_DSA_SIGN_SETUP 107 +#define DSA_F_DSA_SIG_NEW 109 +#define DSA_F_DSA_SIG_PRINT 125 +#define DSA_F_DSA_VERIFY 108 +#define DSA_F_I2D_DSA_SIG 111 +#define DSA_F_OLD_DSA_PRIV_DECODE 122 +#define DSA_F_PKEY_DSA_CTRL 120 +#define DSA_F_PKEY_DSA_KEYGEN 121 +#define DSA_F_SIG_CB 114 + +/* Reason codes. */ +#define DSA_R_BAD_Q_VALUE 102 +#define DSA_R_BN_DECODE_ERROR 108 +#define DSA_R_BN_ERROR 109 +#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 +#define DSA_R_DECODE_ERROR 104 +#define DSA_R_INVALID_DIGEST_TYPE 106 +#define DSA_R_MISSING_PARAMETERS 101 +#define DSA_R_MODULUS_TOO_LARGE 103 +#define DSA_R_NEED_NEW_SETUP_VALUES 110 +#define DSA_R_NON_FIPS_DSA_METHOD 111 +#define DSA_R_NO_PARAMETERS_SET 107 +#define DSA_R_PARAMETER_ENCODING_ERROR 105 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/dso.h b/code/contrib/libfido2/include/openssl/dso.h new file mode 100644 index 0000000..6c982c9 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/dso.h @@ -0,0 +1,386 @@ +/* $OpenBSD: dso.h,v 1.12 2016/03/15 20:50:22 krw Exp $ */ +/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_DSO_H +#define HEADER_DSO_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These values are used as commands to DSO_ctrl() */ +#define DSO_CTRL_GET_FLAGS 1 +#define DSO_CTRL_SET_FLAGS 2 +#define DSO_CTRL_OR_FLAGS 3 + +/* By default, DSO_load() will translate the provided filename into a form + * typical for the platform (more specifically the DSO_METHOD) using the + * dso_name_converter function of the method. Eg. win32 will transform "blah" + * into "blah.dll", and dlfcn will transform it into "libblah.so". The + * behaviour can be overridden by setting the name_converter callback in the DSO + * object (using DSO_set_name_converter()). This callback could even utilise + * the DSO_METHOD's converter too if it only wants to override behaviour for + * one or two possible DSO methods. However, the following flag can be set in a + * DSO to prevent *any* native name-translation at all - eg. if the caller has + * prompted the user for a path to a driver library so the filename should be + * interpreted as-is. */ +#define DSO_FLAG_NO_NAME_TRANSLATION 0x01 +/* An extra flag to give if only the extension should be added as + * translation. This is obviously only of importance on Unix and + * other operating systems where the translation also may prefix + * the name with something, like 'lib', and ignored everywhere else. + * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used + * at the same time. */ +#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02 + +/* The following flag controls the translation of symbol names to upper + * case. This is currently only being implemented for OpenVMS. + */ +#define DSO_FLAG_UPCASE_SYMBOL 0x10 + +/* This flag loads the library with public symbols. + * Meaning: The exported symbols of this library are public + * to all libraries loaded after this library. + * At the moment only implemented in unix. + */ +#define DSO_FLAG_GLOBAL_SYMBOLS 0x20 + + +typedef void (*DSO_FUNC_TYPE)(void); + +typedef struct dso_st DSO; + +/* The function prototype used for method functions (or caller-provided + * callbacks) that transform filenames. They are passed a DSO structure pointer + * (or NULL if they are to be used independantly of a DSO object) and a + * filename to transform. They should either return NULL (if there is an error + * condition) or a newly allocated string containing the transformed form that + * the caller will need to free with free() when done. */ +typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *); +/* The function prototype used for method functions (or caller-provided + * callbacks) that merge two file specifications. They are passed a + * DSO structure pointer (or NULL if they are to be used independantly of + * a DSO object) and two file specifications to merge. They should + * either return NULL (if there is an error condition) or a newly allocated + * string containing the result of merging that the caller will need + * to free with free() when done. + * Here, merging means that bits and pieces are taken from each of the + * file specifications and added together in whatever fashion that is + * sensible for the DSO method in question. The only rule that really + * applies is that if the two specification contain pieces of the same + * type, the copy from the first string takes priority. One could see + * it as the first specification is the one given by the user and the + * second being a bunch of defaults to add on if they're missing in the + * first. */ +typedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *); + +typedef struct dso_meth_st { + const char *name; + /* Loads a shared library, NB: new DSO_METHODs must ensure that a + * successful load populates the loaded_filename field, and likewise a + * successful unload frees and NULLs it out. */ + int (*dso_load)(DSO *dso); + /* Unloads a shared library */ + int (*dso_unload)(DSO *dso); + /* Binds a variable */ + void *(*dso_bind_var)(DSO *dso, const char *symname); + /* Binds a function - assumes a return type of DSO_FUNC_TYPE. + * This should be cast to the real function prototype by the + * caller. Platforms that don't have compatible representations + * for different prototypes (this is possible within ANSI C) + * are highly unlikely to have shared libraries at all, let + * alone a DSO_METHOD implemented for them. */ + DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname); + + /* The generic (yuck) "ctrl()" function. NB: Negative return + * values (rather than zero) indicate errors. */ + long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg); + /* The default DSO_METHOD-specific function for converting filenames to + * a canonical native form. */ + DSO_NAME_CONVERTER_FUNC dso_name_converter; + /* The default DSO_METHOD-specific function for converting filenames to + * a canonical native form. */ + DSO_MERGER_FUNC dso_merger; + + /* [De]Initialisation handlers. */ + int (*init)(DSO *dso); + int (*finish)(DSO *dso); + + /* Return pathname of the module containing location */ + int (*pathbyaddr)(void *addr, char *path, int sz); + /* Perform global symbol lookup, i.e. among *all* modules */ + void *(*globallookup)(const char *symname); +} DSO_METHOD; + +/**********************************************************************/ +/* The low-level handle type used to refer to a loaded shared library */ + +struct dso_st { + DSO_METHOD *meth; + /* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS + * doesn't use anything but will need to cache the filename + * for use in the dso_bind handler. All in all, let each + * method control its own destiny. "Handles" and such go in + * a STACK. */ + STACK_OF(void) *meth_data; + int references; + int flags; + /* For use by applications etc ... use this for your bits'n'pieces, + * don't touch meth_data! */ + CRYPTO_EX_DATA ex_data; + /* If this callback function pointer is set to non-NULL, then it will + * be used in DSO_load() in place of meth->dso_name_converter. NB: This + * should normally set using DSO_set_name_converter(). */ + DSO_NAME_CONVERTER_FUNC name_converter; + /* If this callback function pointer is set to non-NULL, then it will + * be used in DSO_load() in place of meth->dso_merger. NB: This + * should normally set using DSO_set_merger(). */ + DSO_MERGER_FUNC merger; + /* This is populated with (a copy of) the platform-independant + * filename used for this DSO. */ + char *filename; + /* This is populated with (a copy of) the translated filename by which + * the DSO was actually loaded. It is NULL iff the DSO is not currently + * loaded. NB: This is here because the filename translation process + * may involve a callback being invoked more than once not only to + * convert to a platform-specific form, but also to try different + * filenames in the process of trying to perform a load. As such, this + * variable can be used to indicate (a) whether this DSO structure + * corresponds to a loaded library or not, and (b) the filename with + * which it was actually loaded. */ + char *loaded_filename; +}; + + +DSO * DSO_new(void); +DSO * DSO_new_method(DSO_METHOD *method); +int DSO_free(DSO *dso); +int DSO_flags(DSO *dso); +int DSO_up_ref(DSO *dso); +long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg); + +/* This function sets the DSO's name_converter callback. If it is non-NULL, + * then it will be used instead of the associated DSO_METHOD's function. If + * oldcb is non-NULL then it is set to the function pointer value being + * replaced. Return value is non-zero for success. */ +int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb, + DSO_NAME_CONVERTER_FUNC *oldcb); +/* These functions can be used to get/set the platform-independant filename + * used for a DSO. NB: set will fail if the DSO is already loaded. */ +const char *DSO_get_filename(DSO *dso); +int DSO_set_filename(DSO *dso, const char *filename); +/* This function will invoke the DSO's name_converter callback to translate a + * filename, or if the callback isn't set it will instead use the DSO_METHOD's + * converter. If "filename" is NULL, the "filename" in the DSO itself will be + * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is + * simply duplicated. NB: This function is usually called from within a + * DSO_METHOD during the processing of a DSO_load() call, and is exposed so that + * caller-created DSO_METHODs can do the same thing. A non-NULL return value + * will need to be free()'d. */ +char *DSO_convert_filename(DSO *dso, const char *filename); +/* This function will invoke the DSO's merger callback to merge two file + * specifications, or if the callback isn't set it will instead use the + * DSO_METHOD's merger. A non-NULL return value will need to be + * free()'d. */ +char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2); +/* If the DSO is currently loaded, this returns the filename that it was loaded + * under, otherwise it returns NULL. So it is also useful as a test as to + * whether the DSO is currently loaded. NB: This will not necessarily return + * the same value as DSO_convert_filename(dso, dso->filename), because the + * DSO_METHOD's load function may have tried a variety of filenames (with + * and/or without the aid of the converters) before settling on the one it + * actually loaded. */ +const char *DSO_get_loaded_filename(DSO *dso); + +void DSO_set_default_method(DSO_METHOD *meth); +DSO_METHOD *DSO_get_default_method(void); +DSO_METHOD *DSO_get_method(DSO *dso); +DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth); + +/* The all-singing all-dancing load function, you normally pass NULL + * for the first and third parameters. Use DSO_up and DSO_free for + * subsequent reference count handling. Any flags passed in will be set + * in the constructed DSO after its init() function but before the + * load operation. If 'dso' is non-NULL, 'flags' is ignored. */ +DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags); + +/* This function binds to a variable inside a shared library. */ +void *DSO_bind_var(DSO *dso, const char *symname); + +/* This function binds to a function inside a shared library. */ +DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname); + +/* This method is the default, but will beg, borrow, or steal whatever + * method should be the default on any particular platform (including + * DSO_METH_null() if necessary). */ +DSO_METHOD *DSO_METHOD_openssl(void); + +/* This method is defined for all platforms - if a platform has no + * DSO support then this will be the only method! */ +DSO_METHOD *DSO_METHOD_null(void); + +/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions + * (dlopen, dlclose, dlsym, etc) will be used and incorporated into + * this method. If not, this method will return NULL. */ +DSO_METHOD *DSO_METHOD_dlfcn(void); + +/* This function writes null-terminated pathname of DSO module + * containing 'addr' into 'sz' large caller-provided 'path' and + * returns the number of characters [including trailing zero] + * written to it. If 'sz' is 0 or negative, 'path' is ignored and + * required amount of charachers [including trailing zero] to + * accommodate pathname is returned. If 'addr' is NULL, then + * pathname of cryptolib itself is returned. Negative or zero + * return value denotes error. + */ +int DSO_pathbyaddr(void *addr, char *path, int sz); + +/* This function should be used with caution! It looks up symbols in + * *all* loaded modules and if module gets unloaded by somebody else + * attempt to dereference the pointer is doomed to have fatal + * consequences. Primary usage for this function is to probe *core* + * system functionality, e.g. check if getnameinfo(3) is available + * at run-time without bothering about OS-specific details such as + * libc.so.versioning or where does it actually reside: in libc + * itself or libsocket. */ +void *DSO_global_lookup(const char *name); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_DSO_strings(void); + +/* Error codes for the DSO functions. */ + +/* Function codes. */ +#define DSO_F_BEOS_BIND_FUNC 144 +#define DSO_F_BEOS_BIND_VAR 145 +#define DSO_F_BEOS_LOAD 146 +#define DSO_F_BEOS_NAME_CONVERTER 147 +#define DSO_F_BEOS_UNLOAD 148 +#define DSO_F_DLFCN_BIND_FUNC 100 +#define DSO_F_DLFCN_BIND_VAR 101 +#define DSO_F_DLFCN_LOAD 102 +#define DSO_F_DLFCN_MERGER 130 +#define DSO_F_DLFCN_NAME_CONVERTER 123 +#define DSO_F_DLFCN_UNLOAD 103 +#define DSO_F_DL_BIND_FUNC 104 +#define DSO_F_DL_BIND_VAR 105 +#define DSO_F_DL_LOAD 106 +#define DSO_F_DL_MERGER 131 +#define DSO_F_DL_NAME_CONVERTER 124 +#define DSO_F_DL_UNLOAD 107 +#define DSO_F_DSO_BIND_FUNC 108 +#define DSO_F_DSO_BIND_VAR 109 +#define DSO_F_DSO_CONVERT_FILENAME 126 +#define DSO_F_DSO_CTRL 110 +#define DSO_F_DSO_FREE 111 +#define DSO_F_DSO_GET_FILENAME 127 +#define DSO_F_DSO_GET_LOADED_FILENAME 128 +#define DSO_F_DSO_GLOBAL_LOOKUP 139 +#define DSO_F_DSO_LOAD 112 +#define DSO_F_DSO_MERGE 132 +#define DSO_F_DSO_NEW_METHOD 113 +#define DSO_F_DSO_PATHBYADDR 140 +#define DSO_F_DSO_SET_FILENAME 129 +#define DSO_F_DSO_SET_NAME_CONVERTER 122 +#define DSO_F_DSO_UP_REF 114 +#define DSO_F_GLOBAL_LOOKUP_FUNC 138 +#define DSO_F_PATHBYADDR 137 +#define DSO_F_VMS_BIND_SYM 115 +#define DSO_F_VMS_LOAD 116 +#define DSO_F_VMS_MERGER 133 +#define DSO_F_VMS_UNLOAD 117 +#define DSO_F_WIN32_BIND_FUNC 118 +#define DSO_F_WIN32_BIND_VAR 119 +#define DSO_F_WIN32_GLOBALLOOKUP 142 +#define DSO_F_WIN32_GLOBALLOOKUP_FUNC 143 +#define DSO_F_WIN32_JOINER 135 +#define DSO_F_WIN32_LOAD 120 +#define DSO_F_WIN32_MERGER 134 +#define DSO_F_WIN32_NAME_CONVERTER 125 +#define DSO_F_WIN32_PATHBYADDR 141 +#define DSO_F_WIN32_SPLITTER 136 +#define DSO_F_WIN32_UNLOAD 121 + +/* Reason codes. */ +#define DSO_R_CTRL_FAILED 100 +#define DSO_R_DSO_ALREADY_LOADED 110 +#define DSO_R_EMPTY_FILE_STRUCTURE 113 +#define DSO_R_FAILURE 114 +#define DSO_R_FILENAME_TOO_BIG 101 +#define DSO_R_FINISH_FAILED 102 +#define DSO_R_INCORRECT_FILE_SYNTAX 115 +#define DSO_R_LOAD_FAILED 103 +#define DSO_R_NAME_TRANSLATION_FAILED 109 +#define DSO_R_NO_FILENAME 111 +#define DSO_R_NO_FILE_SPECIFICATION 116 +#define DSO_R_NULL_HANDLE 104 +#define DSO_R_SET_FILENAME_FAILED 112 +#define DSO_R_STACK_ERROR 105 +#define DSO_R_SYM_FAILURE 106 +#define DSO_R_UNLOAD_FAILED 107 +#define DSO_R_UNSUPPORTED 108 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/dtls1.h b/code/contrib/libfido2/include/openssl/dtls1.h new file mode 100644 index 0000000..79542c8 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/dtls1.h @@ -0,0 +1,107 @@ +/* $OpenBSD: dtls1.h,v 1.27 2021/05/16 13:56:30 jsing Exp $ */ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_DTLS1_H +#define HEADER_DTLS1_H + +#if defined(_WIN32) +#include +#else +#include +#endif + +#include +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define DTLS1_VERSION 0xFEFF +#define DTLS1_2_VERSION 0xFEFD +#define DTLS1_VERSION_MAJOR 0xFE + +/* lengths of messages */ +#define DTLS1_COOKIE_LENGTH 256 + +#define DTLS1_RT_HEADER_LENGTH 13 + +#define DTLS1_HM_HEADER_LENGTH 12 + +#define DTLS1_HM_BAD_FRAGMENT -2 +#define DTLS1_HM_FRAGMENT_RETRY -3 + +#define DTLS1_CCS_HEADER_LENGTH 1 + +#define DTLS1_AL_HEADER_LENGTH 2 + +/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ +#define DTLS1_TMO_READ_COUNT 2 +#define DTLS1_TMO_WRITE_COUNT 2 + +#define DTLS1_TMO_ALERT_COUNT 12 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ec.h b/code/contrib/libfido2/include/openssl/ec.h new file mode 100644 index 0000000..d8ff42c --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ec.h @@ -0,0 +1,1328 @@ +/* $OpenBSD: ec.h,v 1.27 2021/09/12 16:23:19 tb Exp $ */ +/* + * Originally written by Bodo Moeller for the OpenSSL project. + */ +/** + * \file crypto/ec/ec.h Include file for the OpenSSL EC functions + * \author Originally written by Bodo Moeller for the OpenSSL project + */ +/* ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. + * + */ + +#ifndef HEADER_EC_H +#define HEADER_EC_H + +#include + +#ifdef OPENSSL_NO_EC +#error EC is disabled. +#endif + +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#elif defined(__SUNPRO_C) +# if __SUNPRO_C >= 0x520 +# pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) +# endif +#endif + + +#ifndef OPENSSL_ECC_MAX_FIELD_BITS +#define OPENSSL_ECC_MAX_FIELD_BITS 661 +#endif + +/** Enum for the point conversion form as defined in X9.62 (ECDSA) + * for the encoding of a elliptic curve point (x,y) */ +typedef enum { + /** the point is encoded as z||x, where the octet z specifies + * which solution of the quadratic equation y is */ + POINT_CONVERSION_COMPRESSED = 2, + /** the point is encoded as z||x||y, where z is the octet 0x02 */ + POINT_CONVERSION_UNCOMPRESSED = 4, + /** the point is encoded as z||x||y, where the octet z specifies + * which solution of the quadratic equation y is */ + POINT_CONVERSION_HYBRID = 6 +} point_conversion_form_t; + + +typedef struct ec_method_st EC_METHOD; + +typedef struct ec_group_st + /* + EC_METHOD *meth; + -- field definition + -- curve coefficients + -- optional generator with associated information (order, cofactor) + -- optional extra data (precomputed table for fast computation of multiples of generator) + -- ASN1 stuff + */ + EC_GROUP; + +typedef struct ec_point_st EC_POINT; + + +/********************************************************************/ +/* EC_METHODs for curves over GF(p) */ +/********************************************************************/ + +/** Returns the basic GFp ec methods which provides the basis for the + * optimized methods. + * \return EC_METHOD object + */ +const EC_METHOD *EC_GFp_simple_method(void); + +/** Returns GFp methods using montgomery multiplication. + * \return EC_METHOD object + */ +const EC_METHOD *EC_GFp_mont_method(void); + +/** Returns GFp methods using optimized methods for NIST recommended curves + * \return EC_METHOD object + */ +const EC_METHOD *EC_GFp_nist_method(void); + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +/** Returns 64-bit optimized methods for nistp224 + * \return EC_METHOD object + */ +const EC_METHOD *EC_GFp_nistp224_method(void); + +/** Returns 64-bit optimized methods for nistp256 + * \return EC_METHOD object + */ +const EC_METHOD *EC_GFp_nistp256_method(void); + +/** Returns 64-bit optimized methods for nistp521 + * \return EC_METHOD object + */ +const EC_METHOD *EC_GFp_nistp521_method(void); +#endif + +#ifndef OPENSSL_NO_EC2M +/********************************************************************/ +/* EC_METHOD for curves over GF(2^m) */ +/********************************************************************/ + +/** Returns the basic GF2m ec method + * \return EC_METHOD object + */ +const EC_METHOD *EC_GF2m_simple_method(void); + +#endif + + +/********************************************************************/ +/* EC_GROUP functions */ +/********************************************************************/ + +/** Creates a new EC_GROUP object + * \param meth EC_METHOD to use + * \return newly created EC_GROUP object or NULL in case of an error. + */ +EC_GROUP *EC_GROUP_new(const EC_METHOD *meth); + +/** Frees a EC_GROUP object + * \param group EC_GROUP object to be freed. + */ +void EC_GROUP_free(EC_GROUP *group); + +/** Clears and frees a EC_GROUP object + * \param group EC_GROUP object to be cleared and freed. + */ +void EC_GROUP_clear_free(EC_GROUP *group); + +/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD. + * \param dst destination EC_GROUP object + * \param src source EC_GROUP object + * \return 1 on success and 0 if an error occurred. + */ +int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src); + +/** Creates a new EC_GROUP object and copies the copies the content + * form src to the newly created EC_KEY object + * \param src source EC_GROUP object + * \return newly created EC_GROUP object or NULL in case of an error. + */ +EC_GROUP *EC_GROUP_dup(const EC_GROUP *src); + +/** Returns the EC_METHOD of the EC_GROUP object. + * \param group EC_GROUP object + * \return EC_METHOD used in this EC_GROUP object. + */ +const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); + +/** Returns the field type of the EC_METHOD. + * \param meth EC_METHOD object + * \return NID of the underlying field type OID. + */ +int EC_METHOD_get_field_type(const EC_METHOD *meth); + +/** Sets the generator and it's order/cofactor of a EC_GROUP object. + * \param group EC_GROUP object + * \param generator EC_POINT object with the generator. + * \param order the order of the group generated by the generator. + * \param cofactor the index of the sub-group generated by the generator + * in the group of all points on the elliptic curve. + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); + +/** Returns the generator of a EC_GROUP object. + * \param group EC_GROUP object + * \return the currently used generator (possibly NULL). + */ +const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); + +/** Gets the order of a EC_GROUP + * \param group EC_GROUP object + * \param order BIGNUM to which the order is copied + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); + +int EC_GROUP_order_bits(const EC_GROUP *group); + +/** Gets the cofactor of a EC_GROUP + * \param group EC_GROUP object + * \param cofactor BIGNUM to which the cofactor is copied + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx); + +/** Sets the name of a EC_GROUP object + * \param group EC_GROUP object + * \param nid NID of the curve name OID + */ +void EC_GROUP_set_curve_name(EC_GROUP *group, int nid); + +/** Returns the curve name of a EC_GROUP object + * \param group EC_GROUP object + * \return NID of the curve name OID or 0 if not set. + */ +int EC_GROUP_get_curve_name(const EC_GROUP *group); + +void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); +int EC_GROUP_get_asn1_flag(const EC_GROUP *group); + +void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form); +point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); + +unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x); +size_t EC_GROUP_get_seed_len(const EC_GROUP *); +size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); + +int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); +int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, + BN_CTX *ctx); +#if !defined(LIBRESSL_INTERNAL) +/** Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b + * \param group EC_GROUP object + * \param p BIGNUM with the prime number + * \param a BIGNUM with parameter a of the equation + * \param b BIGNUM with parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +/** Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b + * \param group EC_GROUP object + * \param p BIGNUM for the prime number + * \param a BIGNUM for parameter a of the equation + * \param b BIGNUM for parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); + +#ifndef OPENSSL_NO_EC2M +/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b + * \param group EC_GROUP object + * \param p BIGNUM with the polynomial defining the underlying field + * \param a BIGNUM with parameter a of the equation + * \param b BIGNUM with parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +/** Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b + * \param group EC_GROUP object + * \param p BIGNUM for the polynomial defining the underlying field + * \param a BIGNUM for parameter a of the equation + * \param b BIGNUM for parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); +#endif +#endif + +/** Returns the number of bits needed to represent a field element + * \param group EC_GROUP object + * \return number of bits needed to represent a field element + */ +int EC_GROUP_get_degree(const EC_GROUP *group); + +/** Checks whether the parameter in the EC_GROUP define a valid ec group + * \param group EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 1 if group is a valid ec group and 0 otherwise + */ +int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx); + +/** Checks whether the discriminant of the elliptic curve is zero or not + * \param group EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 1 if the discriminant is not zero and 0 otherwise + */ +int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx); + +/** Compares two EC_GROUP objects + * \param a first EC_GROUP object + * \param b second EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 0 if both groups are equal and 1 otherwise + */ +int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx); + +/* EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() + * after choosing an appropriate EC_METHOD */ + +/** Creates a new EC_GROUP object with the specified parameters defined + * over GFp (defined by the equation y^2 = x^3 + a*x + b) + * \param p BIGNUM with the prime number + * \param a BIGNUM with the parameter a of the equation + * \param b BIGNUM with the parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return newly created EC_GROUP object with the specified parameters + */ +EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +#ifndef OPENSSL_NO_EC2M +/** Creates a new EC_GROUP object with the specified parameters defined + * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b) + * \param p BIGNUM with the polynomial defining the underlying field + * \param a BIGNUM with the parameter a of the equation + * \param b BIGNUM with the parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return newly created EC_GROUP object with the specified parameters + */ +EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +#endif +/** Creates a EC_GROUP object with a curve specified by a NID + * \param nid NID of the OID of the curve name + * \return newly created EC_GROUP object with specified curve or NULL + * if an error occurred + */ +EC_GROUP *EC_GROUP_new_by_curve_name(int nid); + + +/********************************************************************/ +/* handling of internal curves */ +/********************************************************************/ + +typedef struct { + int nid; + const char *comment; + } EC_builtin_curve; + +/* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number + * of all available curves or zero if a error occurred. + * In case r ist not zero nitems EC_builtin_curve structures + * are filled with the data of the first nitems internal groups */ +size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems); + +const char *EC_curve_nid2nist(int nid); +int EC_curve_nist2nid(const char *name); + +/********************************************************************/ +/* EC_POINT functions */ +/********************************************************************/ + +/** Creates a new EC_POINT object for the specified EC_GROUP + * \param group EC_GROUP the underlying EC_GROUP object + * \return newly created EC_POINT object or NULL if an error occurred + */ +EC_POINT *EC_POINT_new(const EC_GROUP *group); + +/** Frees a EC_POINT object + * \param point EC_POINT object to be freed + */ +void EC_POINT_free(EC_POINT *point); + +/** Clears and frees a EC_POINT object + * \param point EC_POINT object to be cleared and freed + */ +void EC_POINT_clear_free(EC_POINT *point); + +/** Copies EC_POINT object + * \param dst destination EC_POINT object + * \param src source EC_POINT object + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); + +/** Creates a new EC_POINT object and copies the content of the supplied + * EC_POINT + * \param src source EC_POINT object + * \param group underlying the EC_GROUP object + * \return newly created EC_POINT object or NULL if an error occurred + */ +EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group); + +/** Returns the EC_METHOD used in EC_POINT object + * \param point EC_POINT object + * \return the EC_METHOD used + */ +const EC_METHOD *EC_POINT_method_of(const EC_POINT *point); + +/** Sets a point to infinity (neutral element) + * \param group underlying EC_GROUP object + * \param point EC_POINT to set to infinity + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); + +int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); +int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p, + BIGNUM *x, BIGNUM *y, BN_CTX *ctx); +int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, int y_bit, BN_CTX *ctx); + +#if defined(LIBRESSL_INTERNAL) + +int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); +int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group, + const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); + +#else + +/** Sets the jacobian projective coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param z BIGNUM with the z-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); + +/** Gets the jacobian projective coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param z BIGNUM for the z-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, + const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); + +/** Sets the affine coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); + +/** Gets the affine coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, + const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); + +/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with x-coordinate + * \param y_bit integer with the y-Bit (either 0 or 1) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, int y_bit, BN_CTX *ctx); + +#ifndef OPENSSL_NO_EC2M +/** Sets the affine coordinates of a EC_POINT over GF2m + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); + +/** Gets the affine coordinates of a EC_POINT over GF2m + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, + const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); + +/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with x-coordinate + * \param y_bit integer with the y-Bit (either 0 or 1) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, int y_bit, BN_CTX *ctx); +#endif /* OPENSSL_NO_EC2M */ +#endif /* !LIBRESSL_INTERNAL */ + +/** Encodes a EC_POINT object to a octet string + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param form point conversion form + * \param buf memory buffer for the result. If NULL the function returns + * required buffer size. + * \param len length of the memory buffer + * \param ctx BN_CTX object (optional) + * \return the length of the encoded octet string or 0 if an error occurred + */ +size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p, + point_conversion_form_t form, + unsigned char *buf, size_t len, BN_CTX *ctx); + +/** Decodes a EC_POINT from a octet string + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param buf memory buffer with the encoded ec point + * \param len length of the encoded ec point + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, + const unsigned char *buf, size_t len, BN_CTX *ctx); + +/* other interfaces to point2oct/oct2point: */ +BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *, + point_conversion_form_t form, BIGNUM *, BN_CTX *); +EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *, + EC_POINT *, BN_CTX *); +char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *, + point_conversion_form_t form, BN_CTX *); +EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *, + EC_POINT *, BN_CTX *); + + +/********************************************************************/ +/* functions for doing EC_POINT arithmetic */ +/********************************************************************/ + +/** Computes the sum of two EC_POINT + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result (r = a + b) + * \param a EC_POINT object with the first summand + * \param b EC_POINT object with the second summand + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); + +/** Computes the double of a EC_POINT + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result (r = 2 * a) + * \param a EC_POINT object + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx); + +/** Computes the inverse of a EC_POINT + * \param group underlying EC_GROUP object + * \param a EC_POINT object to be inverted (it's used for the result as well) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); + +/** Checks whether the point is the neutral element of the group + * \param group the underlying EC_GROUP object + * \param p EC_POINT object + * \return 1 if the point is the neutral element and 0 otherwise + */ +int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p); + +/** Checks whether the point is on the curve + * \param group underlying EC_GROUP object + * \param point EC_POINT object to check + * \param ctx BN_CTX object (optional) + * \return 1 if point if on the curve and 0 otherwise + */ +int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx); + +/** Compares two EC_POINTs + * \param group underlying EC_GROUP object + * \param a first EC_POINT object + * \param b second EC_POINT object + * \param ctx BN_CTX object (optional) + * \return 0 if both points are equal and a value != 0 otherwise + */ +int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); + +int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx); +int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx); + +/** Computes r = generator * n sum_{i=0}^num p[i] * m[i] + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result + * \param n BIGNUM with the multiplier for the group generator (optional) + * \param num number futher summands + * \param p array of size num of EC_POINT objects + * \param m array of size num of BIGNUM objects + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx); + +/** Computes r = generator * n + q * m + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result + * \param n BIGNUM with the multiplier for the group generator (optional) + * \param q EC_POINT object with the first factor of the second summand + * \param m BIGNUM with the second factor of the second summand + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); + +/** Stores multiples of generator for faster point multiplication + * \param group EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occured + */ +int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); + +/** Reports whether a precomputation has been done + * \param group EC_GROUP object + * \return 1 if a pre-computation has been done and 0 otherwise + */ +int EC_GROUP_have_precompute_mult(const EC_GROUP *group); + + +/********************************************************************/ +/* ASN1 stuff */ +/********************************************************************/ + +/* EC_GROUP_get_basis_type() returns the NID of the basis type + * used to represent the field elements */ +int EC_GROUP_get_basis_type(const EC_GROUP *); +#ifndef OPENSSL_NO_EC2M +int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); +int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, + unsigned int *k2, unsigned int *k3); +#endif + +#define OPENSSL_EC_EXPLICIT_CURVE 0x000 +#define OPENSSL_EC_NAMED_CURVE 0x001 + +typedef struct ecpk_parameters_st ECPKPARAMETERS; + +EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); +int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); + +#define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) +#define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) +#define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \ + (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) +#define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \ + (unsigned char *)(x)) + +#ifndef OPENSSL_NO_BIO +int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off); +#endif +int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); + + +/********************************************************************/ +/* EC_KEY functions */ +/********************************************************************/ + +typedef struct ec_key_st EC_KEY; +typedef struct ec_key_method_st EC_KEY_METHOD; + +/* some values for the encoding_flag */ +#define EC_PKEY_NO_PARAMETERS 0x001 +#define EC_PKEY_NO_PUBKEY 0x002 + +/* some values for the flags field */ +#define EC_FLAG_NON_FIPS_ALLOW 0x1 +#define EC_FLAG_FIPS_CHECKED 0x2 +#define EC_FLAG_COFACTOR_ECDH 0x1000 + +/** Creates a new EC_KEY object. + * \return EC_KEY object or NULL if an error occurred. + */ +EC_KEY *EC_KEY_new(void); + +int EC_KEY_get_flags(const EC_KEY *key); + +void EC_KEY_set_flags(EC_KEY *key, int flags); + +void EC_KEY_clear_flags(EC_KEY *key, int flags); + +/** Creates a new EC_KEY object using a named curve as underlying + * EC_GROUP object. + * \param nid NID of the named curve. + * \return EC_KEY object or NULL if an error occurred. + */ +EC_KEY *EC_KEY_new_by_curve_name(int nid); + +/** Frees a EC_KEY object. + * \param key EC_KEY object to be freed. + */ +void EC_KEY_free(EC_KEY *key); + +/** Copies a EC_KEY object. + * \param dst destination EC_KEY object + * \param src src EC_KEY object + * \return dst or NULL if an error occurred. + */ +EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src); + +/** Creates a new EC_KEY object and copies the content from src to it. + * \param src the source EC_KEY object + * \return newly created EC_KEY object or NULL if an error occurred. + */ +EC_KEY *EC_KEY_dup(const EC_KEY *src); + +/** Increases the internal reference count of a EC_KEY object. + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred. + */ +int EC_KEY_up_ref(EC_KEY *key); + +/** Returns the EC_GROUP object of a EC_KEY object + * \param key EC_KEY object + * \return the EC_GROUP object (possibly NULL). + */ +const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key); + +/** Sets the EC_GROUP of a EC_KEY object. + * \param key EC_KEY object + * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY + * object will use an own copy of the EC_GROUP). + * \return 1 on success and 0 if an error occurred. + */ +int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group); + +/** Returns the private key of a EC_KEY object. + * \param key EC_KEY object + * \return a BIGNUM with the private key (possibly NULL). + */ +const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key); + +/** Sets the private key of a EC_KEY object. + * \param key EC_KEY object + * \param prv BIGNUM with the private key (note: the EC_KEY object + * will use an own copy of the BIGNUM). + * \return 1 on success and 0 if an error occurred. + */ +int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv); + +/** Returns the public key of a EC_KEY object. + * \param key the EC_KEY object + * \return a EC_POINT object with the public key (possibly NULL) + */ +const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key); + +/** Sets the public key of a EC_KEY object. + * \param key EC_KEY object + * \param pub EC_POINT object with the public key (note: the EC_KEY object + * will use an own copy of the EC_POINT object). + * \return 1 on success and 0 if an error occurred. + */ +int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); + +unsigned EC_KEY_get_enc_flags(const EC_KEY *key); +void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags); +point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key); +void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform); +/* functions to set/get method specific data */ +void *EC_KEY_get_key_method_data(EC_KEY *key, + void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); +/** Sets the key method data of an EC_KEY object, if none has yet been set. + * \param key EC_KEY object + * \param data opaque data to install. + * \param dup_func a function that duplicates |data|. + * \param free_func a function that frees |data|. + * \param clear_free_func a function that wipes and frees |data|. + * \return the previously set data pointer, or NULL if |data| was inserted. + */ +void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data, + void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); +/* wrapper functions for the underlying EC_GROUP object */ +void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag); + +/** Creates a table of pre-computed multiples of the generator to + * accelerate further EC_KEY operations. + * \param key EC_KEY object + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred. + */ +int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx); + +/** Creates a new ec private (and optional a new public) key. + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred. + */ +int EC_KEY_generate_key(EC_KEY *key); + +/** Verifies that a private and/or public key is valid. + * \param key the EC_KEY object + * \return 1 on success and 0 otherwise. + */ +int EC_KEY_check_key(const EC_KEY *key); + +/** Sets a public key from affine coordindates performing + * neccessary NIST PKV tests. + * \param key the EC_KEY object + * \param x public key x coordinate + * \param y public key y coordinate + * \return 1 on success and 0 otherwise. + */ +int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y); + + +/********************************************************************/ +/* de- and encoding functions for SEC1 ECPrivateKey */ +/********************************************************************/ + +/** Decodes a private key from a memory buffer. + * \param key a pointer to a EC_KEY object which should be used (or NULL) + * \param in pointer to memory with the DER encoded private key + * \param len length of the DER encoded private key + * \return the decoded private key or NULL if an error occurred. + */ +EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len); + +/** Encodes a private key object and stores the result in a buffer. + * \param key the EC_KEY object to encode + * \param out the buffer for the result (if NULL the function returns number + * of bytes needed). + * \return 1 on success and 0 if an error occurred. + */ +int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out); + + +/********************************************************************/ +/* de- and encoding functions for EC parameters */ +/********************************************************************/ + +/** Decodes ec parameter from a memory buffer. + * \param key a pointer to a EC_KEY object which should be used (or NULL) + * \param in pointer to memory with the DER encoded ec parameters + * \param len length of the DER encoded ec parameters + * \return a EC_KEY object with the decoded parameters or NULL if an error + * occurred. + */ +EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len); + +/** Encodes ec parameter and stores the result in a buffer. + * \param key the EC_KEY object with ec paramters to encode + * \param out the buffer for the result (if NULL the function returns number + * of bytes needed). + * \return 1 on success and 0 if an error occurred. + */ +int i2d_ECParameters(EC_KEY *key, unsigned char **out); + + +/********************************************************************/ +/* de- and encoding functions for EC public key */ +/* (octet string, not DER -- hence 'o2i' and 'i2o') */ +/********************************************************************/ + +/** Decodes a ec public key from a octet string. + * \param key a pointer to a EC_KEY object which should be used + * \param in memory buffer with the encoded public key + * \param len length of the encoded public key + * \return EC_KEY object with decoded public key or NULL if an error + * occurred. + */ +EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len); + +/** Encodes a ec public key in an octet string. + * \param key the EC_KEY object with the public key + * \param out the buffer for the result (if NULL the function returns number + * of bytes needed). + * \return 1 on success and 0 if an error occurred + */ +int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out); + +#ifndef OPENSSL_NO_BIO +/** Prints out the ec parameters on human readable form. + * \param bp BIO object to which the information is printed + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred + */ +int ECParameters_print(BIO *bp, const EC_KEY *key); + +/** Prints out the contents of a EC_KEY object + * \param bp BIO object to which the information is printed + * \param key EC_KEY object + * \param off line offset + * \return 1 on success and 0 if an error occurred + */ +int EC_KEY_print(BIO *bp, const EC_KEY *key, int off); + +#endif +/** Prints out the ec parameters on human readable form. + * \param fp file descriptor to which the information is printed + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred + */ +int ECParameters_print_fp(FILE *fp, const EC_KEY *key); + +/** Prints out the contents of a EC_KEY object + * \param fp file descriptor to which the information is printed + * \param key EC_KEY object + * \param off line offset + * \return 1 on success and 0 if an error occurred + */ +int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); + +#define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef) +int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg); +void *EC_KEY_get_ex_data(const EC_KEY *key, int idx); + +const EC_KEY_METHOD *EC_KEY_OpenSSL(void); +const EC_KEY_METHOD *EC_KEY_get_default_method(void); +void EC_KEY_set_default_method(const EC_KEY_METHOD *meth); +const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key); +int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth); +EC_KEY *EC_KEY_new_method(ENGINE *engine); +EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth); +void EC_KEY_METHOD_free(EC_KEY_METHOD *meth); +void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth, + int (*init)(EC_KEY *key), + void (*finish)(EC_KEY *key), + int (*copy)(EC_KEY *dest, const EC_KEY *src), + int (*set_group)(EC_KEY *key, const EC_GROUP *grp), + int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), + int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)); +void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth, + int (*keygen)(EC_KEY *key)); +void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, + int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))); +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, + int (**pinit)(EC_KEY *key), + void (**pfinish)(EC_KEY *key), + int (**pcopy)(EC_KEY *dest, const EC_KEY *src), + int (**pset_group)(EC_KEY *key, const EC_GROUP *grp), + int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), + int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, + int (**pkeygen)(EC_KEY *key)); +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, + int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen))); + +EC_KEY *ECParameters_dup(EC_KEY *key); + +#ifndef __cplusplus +#if defined(__SUNPRO_C) +# if __SUNPRO_C >= 0x520 +# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) +# endif +# endif +#endif + +#define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL) + +#define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL) + +#define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL) + +#define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL) + +#define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL) + +#define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL) + +#define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)(md)) + +#define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)(pmd)) + +#define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL) + +#define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, \ + (void *)(plen)) + +#define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)(p)) + +#define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)(p)) + +/* SM2 will skip the operation check so no need to pass operation here */ +#define EVP_PKEY_CTX_set1_id(ctx, id, id_len) \ + EVP_PKEY_CTX_ctrl(ctx, -1, -1, \ + EVP_PKEY_CTRL_SET1_ID, (int)id_len, (void*)(id)) + +#define EVP_PKEY_CTX_get1_id(ctx, id) \ + EVP_PKEY_CTX_ctrl(ctx, -1, -1, \ + EVP_PKEY_CTRL_GET1_ID, 0, (void*)(id)) + +#define EVP_PKEY_CTX_get1_id_len(ctx, id_len) \ + EVP_PKEY_CTX_ctrl(ctx, -1, -1, \ + EVP_PKEY_CTRL_GET1_ID_LEN, 0, (void*)(id_len)) + +#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5) +#define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8) +#define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10) +#define EVP_PKEY_CTRL_SET1_ID (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_GET1_ID (EVP_PKEY_ALG_CTRL + 12) +#define EVP_PKEY_CTRL_GET1_ID_LEN (EVP_PKEY_ALG_CTRL + 13) + +/* KDF types */ +#define EVP_PKEY_ECDH_KDF_NONE 1 +#define EVP_PKEY_ECDH_KDF_X9_63 2 + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_EC_strings(void); + +/* Error codes for the EC functions. */ + +/* Function codes. */ +#define EC_F_BN_TO_FELEM 224 +#define EC_F_COMPUTE_WNAF 143 +#define EC_F_D2I_ECPARAMETERS 144 +#define EC_F_D2I_ECPKPARAMETERS 145 +#define EC_F_D2I_ECPRIVATEKEY 146 +#define EC_F_DO_EC_KEY_PRINT 221 +#define EC_F_ECKEY_PARAM2TYPE 223 +#define EC_F_ECKEY_PARAM_DECODE 212 +#define EC_F_ECKEY_PRIV_DECODE 213 +#define EC_F_ECKEY_PRIV_ENCODE 214 +#define EC_F_ECKEY_PUB_DECODE 215 +#define EC_F_ECKEY_PUB_ENCODE 216 +#define EC_F_ECKEY_TYPE2PARAM 220 +#define EC_F_ECPARAMETERS_PRINT 147 +#define EC_F_ECPARAMETERS_PRINT_FP 148 +#define EC_F_ECPKPARAMETERS_PRINT 149 +#define EC_F_ECPKPARAMETERS_PRINT_FP 150 +#define EC_F_ECP_NIST_MOD_192 203 +#define EC_F_ECP_NIST_MOD_224 204 +#define EC_F_ECP_NIST_MOD_256 205 +#define EC_F_ECP_NIST_MOD_521 206 +#define EC_F_ECP_NISTZ256_GET_AFFINE 240 +#define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 243 +#define EC_F_ECP_NISTZ256_POINTS_MUL 241 +#define EC_F_ECP_NISTZ256_PRE_COMP_NEW 244 +#define EC_F_ECP_NISTZ256_SET_WORDS 245 +#define EC_F_ECP_NISTZ256_WINDOWED_MUL 242 +#define EC_F_EC_ASN1_GROUP2CURVE 153 +#define EC_F_EC_ASN1_GROUP2FIELDID 154 +#define EC_F_EC_ASN1_GROUP2PARAMETERS 155 +#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156 +#define EC_F_EC_ASN1_PARAMETERS2GROUP 157 +#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158 +#define EC_F_EC_EX_DATA_SET_DATA 211 +#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 +#define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 +#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 +#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161 +#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162 +#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163 +#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 +#define EC_F_EC_GFP_MONT_FIELD_DECODE 133 +#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +#define EC_F_EC_GFP_MONT_FIELD_MUL 131 +#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 +#define EC_F_EC_GFP_MONT_FIELD_SQR 132 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 +#define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225 +#define EC_F_EC_GFP_NISTP224_POINTS_MUL 228 +#define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226 +#define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230 +#define EC_F_EC_GFP_NISTP256_POINTS_MUL 231 +#define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232 +#define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233 +#define EC_F_EC_GFP_NISTP521_POINTS_MUL 234 +#define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235 +#define EC_F_EC_GFP_NIST_FIELD_MUL 200 +#define EC_F_EC_GFP_NIST_FIELD_SQR 201 +#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101 +#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 +#define EC_F_EC_GFP_SIMPLE_OCT2POINT 103 +#define EC_F_EC_GFP_SIMPLE_POINT2OCT 104 +#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137 +#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167 +#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105 +#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168 +#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128 +#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169 +#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129 +#define EC_F_EC_GROUP_CHECK 170 +#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171 +#define EC_F_EC_GROUP_COPY 106 +#define EC_F_EC_GROUP_GET0_GENERATOR 139 +#define EC_F_EC_GROUP_GET_COFACTOR 140 +#define EC_F_EC_GROUP_GET_CURVE_GF2M 172 +#define EC_F_EC_GROUP_GET_CURVE_GFP 130 +#define EC_F_EC_GROUP_GET_DEGREE 173 +#define EC_F_EC_GROUP_GET_ORDER 141 +#define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193 +#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194 +#define EC_F_EC_GROUP_NEW 108 +#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174 +#define EC_F_EC_GROUP_NEW_FROM_DATA 175 +#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142 +#define EC_F_EC_GROUP_SET_CURVE_GF2M 176 +#define EC_F_EC_GROUP_SET_CURVE_GFP 109 +#define EC_F_EC_GROUP_SET_EXTRA_DATA 110 +#define EC_F_EC_GROUP_SET_GENERATOR 111 +#define EC_F_EC_KEY_CHECK_KEY 177 +#define EC_F_EC_KEY_COPY 178 +#define EC_F_EC_KEY_GENERATE_KEY 179 +#define EC_F_EC_KEY_NEW 182 +#define EC_F_EC_KEY_PRINT 180 +#define EC_F_EC_KEY_PRINT_FP 181 +#define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229 +#define EC_F_EC_POINTS_MAKE_AFFINE 136 +#define EC_F_EC_POINT_ADD 112 +#define EC_F_EC_POINT_CMP 113 +#define EC_F_EC_POINT_COPY 114 +#define EC_F_EC_POINT_DBL 115 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116 +#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117 +#define EC_F_EC_POINT_INVERT 210 +#define EC_F_EC_POINT_IS_AT_INFINITY 118 +#define EC_F_EC_POINT_IS_ON_CURVE 119 +#define EC_F_EC_POINT_MAKE_AFFINE 120 +#define EC_F_EC_POINT_MUL 184 +#define EC_F_EC_POINT_NEW 121 +#define EC_F_EC_POINT_OCT2POINT 122 +#define EC_F_EC_POINT_POINT2OCT 123 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125 +#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126 +#define EC_F_EC_POINT_SET_TO_INFINITY 127 +#define EC_F_EC_PRE_COMP_DUP 207 +#define EC_F_EC_PRE_COMP_NEW 196 +#define EC_F_EC_WNAF_MUL 187 +#define EC_F_EC_WNAF_PRECOMPUTE_MULT 188 +#define EC_F_I2D_ECPARAMETERS 190 +#define EC_F_I2D_ECPKPARAMETERS 191 +#define EC_F_I2D_ECPRIVATEKEY 192 +#define EC_F_I2O_ECPUBLICKEY 151 +#define EC_F_NISTP224_PRE_COMP_NEW 227 +#define EC_F_NISTP256_PRE_COMP_NEW 236 +#define EC_F_NISTP521_PRE_COMP_NEW 237 +#define EC_F_O2I_ECPUBLICKEY 152 +#define EC_F_OLD_EC_PRIV_DECODE 222 +#define EC_F_PKEY_EC_CTRL 197 +#define EC_F_PKEY_EC_CTRL_STR 198 +#define EC_F_PKEY_EC_DERIVE 217 +#define EC_F_PKEY_EC_KEYGEN 199 +#define EC_F_PKEY_EC_PARAMGEN 219 +#define EC_F_PKEY_EC_SIGN 218 + +/* Reason codes. */ +#define EC_R_ASN1_ERROR 115 +#define EC_R_ASN1_UNKNOWN_FIELD 116 +#define EC_R_BIGNUM_OUT_OF_RANGE 144 +#define EC_R_BUFFER_TOO_SMALL 100 +#define EC_R_COORDINATES_OUT_OF_RANGE 146 +#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117 +#define EC_R_DECODE_ERROR 142 +#define EC_R_DISCRIMINANT_IS_ZERO 118 +#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 +#define EC_R_FIELD_TOO_LARGE 143 +#define EC_R_GF2M_NOT_SUPPORTED 147 +#define EC_R_GROUP2PKPARAMETERS_FAILURE 120 +#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 +#define EC_R_INCOMPATIBLE_OBJECTS 101 +#define EC_R_INVALID_ARGUMENT 112 +#define EC_R_INVALID_COMPRESSED_POINT 110 +#define EC_R_INVALID_COMPRESSION_BIT 109 +#define EC_R_INVALID_CURVE 141 +#define EC_R_INVALID_DIGEST 151 +#define EC_R_INVALID_DIGEST_TYPE 138 +#define EC_R_INVALID_ENCODING 102 +#define EC_R_INVALID_FIELD 103 +#define EC_R_INVALID_FORM 104 +#define EC_R_INVALID_GROUP_ORDER 122 +#define EC_R_INVALID_PENTANOMIAL_BASIS 132 +#define EC_R_INVALID_PRIVATE_KEY 123 +#define EC_R_INVALID_TRINOMIAL_BASIS 137 +#define EC_R_KDF_PARAMETER_ERROR 148 +#define EC_R_KEYS_NOT_SET 140 +#define EC_R_MISSING_PARAMETERS 124 +#define EC_R_MISSING_PRIVATE_KEY 125 +#define EC_R_NOT_A_NIST_PRIME 135 +#define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136 +#define EC_R_NOT_IMPLEMENTED 126 +#define EC_R_NOT_INITIALIZED 111 +#define EC_R_NO_FIELD_MOD 133 +#define EC_R_NO_PARAMETERS_SET 139 +#define EC_R_PASSED_NULL_PARAMETER 134 +#define EC_R_PEER_KEY_ERROR 149 +#define EC_R_PKPARAMETERS2GROUP_FAILURE 127 +#define EC_R_POINT_AT_INFINITY 106 +#define EC_R_POINT_IS_NOT_ON_CURVE 107 +#define EC_R_SHARED_INFO_ERROR 150 +#define EC_R_SLOT_FULL 108 +#define EC_R_UNDEFINED_GENERATOR 113 +#define EC_R_UNDEFINED_ORDER 128 +#define EC_R_UNKNOWN_COFACTOR 164 +#define EC_R_UNKNOWN_GROUP 129 +#define EC_R_UNKNOWN_ORDER 114 +#define EC_R_UNSUPPORTED_FIELD 131 +#define EC_R_WRONG_CURVE_PARAMETERS 145 +#define EC_R_WRONG_ORDER 130 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ecdh.h b/code/contrib/libfido2/include/openssl/ecdh.h new file mode 100644 index 0000000..ccc1312 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ecdh.h @@ -0,0 +1,128 @@ +/* $OpenBSD: ecdh.h,v 1.5 2015/09/13 12:03:07 jsing Exp $ */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ECDH_H +#define HEADER_ECDH_H + +#include + +#ifdef OPENSSL_NO_ECDH +#error ECDH is disabled. +#endif + +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +const ECDH_METHOD *ECDH_OpenSSL(void); + +void ECDH_set_default_method(const ECDH_METHOD *); +const ECDH_METHOD *ECDH_get_default_method(void); +int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); + +int ECDH_size(const EC_KEY *ecdh); +int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, + EC_KEY *ecdh, + void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); + +int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new +*new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); +void *ECDH_get_ex_data(EC_KEY *d, int idx); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ECDH_strings(void); + +/* Error codes for the ECDH functions. */ + +/* Function codes. */ +#define ECDH_F_ECDH_CHECK 102 +#define ECDH_F_ECDH_COMPUTE_KEY 100 +#define ECDH_F_ECDH_DATA_NEW_METHOD 101 + +/* Reason codes. */ +#define ECDH_R_KDF_FAILED 102 +#define ECDH_R_KEY_TRUNCATION 104 +#define ECDH_R_NON_FIPS_METHOD 103 +#define ECDH_R_NO_PRIVATE_VALUE 100 +#define ECDH_R_POINT_ARITHMETIC_FAILURE 101 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ecdsa.h b/code/contrib/libfido2/include/openssl/ecdsa.h new file mode 100644 index 0000000..eccca65 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ecdsa.h @@ -0,0 +1,325 @@ +/* $OpenBSD: ecdsa.h,v 1.11 2022/01/14 08:31:03 tb Exp $ */ +/** + * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions + * \author Written by Nils Larsch for the OpenSSL project + */ +/* ==================================================================== + * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ECDSA_H +#define HEADER_ECDSA_H + +#include + +#ifdef OPENSSL_NO_ECDSA +#error ECDSA is disabled. +#endif + +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ECDSA_SIG_st ECDSA_SIG; + +struct ecdsa_method { + const char *name; + ECDSA_SIG *(*ecdsa_do_sign)(const unsigned char *dgst, int dgst_len, + const BIGNUM *inv, const BIGNUM *rp, EC_KEY *eckey); + int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, + BIGNUM **r); + int (*ecdsa_do_verify)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey); + int flags; + char *app_data; +}; + +/* If this flag is set the ECDSA method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its responsibility + * to ensure the result is compliant. + */ + +#define ECDSA_FLAG_FIPS_METHOD 0x1 + +/** Allocates and initialize a ECDSA_SIG structure + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +ECDSA_SIG *ECDSA_SIG_new(void); + +/** frees a ECDSA_SIG structure + * \param sig pointer to the ECDSA_SIG structure + */ +void ECDSA_SIG_free(ECDSA_SIG *sig); + +/** DER encode content of ECDSA_SIG object (note: this function modifies *pp + * (*pp += length of the DER encoded signature)). + * \param sig pointer to the ECDSA_SIG object + * \param pp pointer to a unsigned char pointer for the output or NULL + * \return the length of the DER encoded ECDSA_SIG object or 0 + */ +int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); + +/** Decodes a DER encoded ECDSA signature (note: this function changes *pp + * (*pp += len)). + * \param sig pointer to ECDSA_SIG pointer (may be NULL) + * \param pp memory buffer with the DER encoded signature + * \param len length of the buffer + * \return pointer to the decoded ECDSA_SIG structure (or NULL) + */ +ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); + +/** Accessor for r and s fields of ECDSA_SIG + * \param sig pointer to ECDSA_SIG pointer + * \param pr pointer to BIGNUM pointer for r (may be NULL) + * \param ps pointer to BIGNUM pointer for s (may be NULL) + */ +void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); + +const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig); +const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig); + +/** Setter for r and s fields of ECDSA_SIG + * \param sig pointer to ECDSA_SIG pointer + * \param r pointer to BIGNUM for r (may be NULL) + * \param s pointer to BIGNUM for s (may be NULL) + */ +int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); + +/** Computes the ECDSA signature of the given hash value using + * the supplied private key and returns the created signature. + * \param dgst pointer to the hash value + * \param dgst_len length of the hash value + * \param eckey EC_KEY object containing a private EC key + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len, + EC_KEY *eckey); + +/** Computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param kinv BIGNUM with a pre-computed inverse k (optional) + * \param rp BIGNUM with a pre-computed rp value (optioanl), + * see ECDSA_sign_setup + * \param eckey EC_KEY object containing a private EC key + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, + const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey); + +/** Verifies that the supplied signature is a valid ECDSA + * signature of the supplied hash value using the supplied public key. + * \param dgst pointer to the hash value + * \param dgst_len length of the hash value + * \param sig ECDSA_SIG structure + * \param eckey EC_KEY object containing a public EC key + * \return 1 if the signature is valid, 0 if the signature is invalid + * and -1 on error + */ +int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY* eckey); + +const ECDSA_METHOD *ECDSA_OpenSSL(void); + +/** Sets the default ECDSA method + * \param meth new default ECDSA_METHOD + */ +void ECDSA_set_default_method(const ECDSA_METHOD *meth); + +/** Returns the default ECDSA method + * \return pointer to ECDSA_METHOD structure containing the default method + */ +const ECDSA_METHOD *ECDSA_get_default_method(void); + +/** Sets method to be used for the ECDSA operations + * \param eckey EC_KEY object + * \param meth new method + * \return 1 on success and 0 otherwise + */ +int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth); + +/** Returns the maximum length of the DER encoded signature + * \param eckey EC_KEY object + * \return numbers of bytes required for the DER encoded signature + */ +int ECDSA_size(const EC_KEY *eckey); + +/** Precompute parts of the signing operation + * \param eckey EC_KEY object containing a private EC key + * \param ctx BN_CTX object (optional) + * \param kinv BIGNUM pointer for the inverse of k + * \param rp BIGNUM pointer for x coordinate of k * generator + * \return 1 on success and 0 otherwise + */ +int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, + BIGNUM **rp); + +/** Computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param type this parameter is ignored + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param sig memory for the DER encoded created signature + * \param siglen pointer to the length of the returned signature + * \param eckey EC_KEY object containing a private EC key + * \return 1 on success and 0 otherwise + */ +int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen, + unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); + + +/** Computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param type this parameter is ignored + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param sig buffer to hold the DER encoded signature + * \param siglen pointer to the length of the returned signature + * \param kinv BIGNUM with a pre-computed inverse k (optional) + * \param rp BIGNUM with a pre-computed rp value (optioanl), + * see ECDSA_sign_setup + * \param eckey EC_KEY object containing a private EC key + * \return 1 on success and 0 otherwise + */ +int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen, + unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, + const BIGNUM *rp, EC_KEY *eckey); + +/** Verifies that the given signature is valid ECDSA signature + * of the supplied hash value using the specified public key. + * \param type this parameter is ignored + * \param dgst pointer to the hash value + * \param dgstlen length of the hash value + * \param sig pointer to the DER encoded signature + * \param siglen length of the DER encoded signature + * \param eckey EC_KEY object containing a public EC key + * \return 1 if the signature is valid, 0 if the signature is invalid + * and -1 on error + */ +int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen, + const unsigned char *sig, int siglen, EC_KEY *eckey); + +/* the standard ex_data functions */ +int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); +void *ECDSA_get_ex_data(EC_KEY *d, int idx); + + +/* XXX should be in ec.h, but needs ECDSA_SIG */ +void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth, + int (*sign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), + int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, + int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, + EC_KEY *eckey)); +void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, + int (*verify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), + int (*verify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey)); +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, + int (**psign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey), + int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(**psign_sig)(const unsigned char *dgst, + int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, + EC_KEY *eckey)); +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, + int (**pverify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, int sig_len, EC_KEY *eckey), + int (**pverify_sig)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey)); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ECDSA_strings(void); + +/* Error codes for the ECDSA functions. */ + +/* Function codes. */ +#define ECDSA_F_ECDSA_CHECK 104 +#define ECDSA_F_ECDSA_DATA_NEW_METHOD 100 +#define ECDSA_F_ECDSA_DO_SIGN 101 +#define ECDSA_F_ECDSA_DO_VERIFY 102 +#define ECDSA_F_ECDSA_SIGN_SETUP 103 + +/* Reason codes. */ +#define ECDSA_R_BAD_SIGNATURE 100 +#define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101 +#define ECDSA_R_ERR_EC_LIB 102 +#define ECDSA_R_MISSING_PARAMETERS 103 +#define ECDSA_R_NEED_NEW_SETUP_VALUES 106 +#define ECDSA_R_NON_FIPS_METHOD 107 +#define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104 +#define ECDSA_R_SIGNATURE_MALLOC_FAILED 105 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/engine.h b/code/contrib/libfido2/include/openssl/engine.h new file mode 100644 index 0000000..dc14be8 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/engine.h @@ -0,0 +1,814 @@ +/* $OpenBSD: engine.h,v 1.33 2019/01/19 01:07:00 tb Exp $ */ +/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_ENGINE_H +#define HEADER_ENGINE_H + +#include + +#ifdef OPENSSL_NO_ENGINE +#error ENGINE is disabled. +#endif + +#ifndef OPENSSL_NO_DEPRECATED +#include +#ifndef OPENSSL_NO_RSA +#include +#endif +#ifndef OPENSSL_NO_DSA +#include +#endif +#ifndef OPENSSL_NO_DH +#include +#endif +#ifndef OPENSSL_NO_ECDH +#include +#endif +#ifndef OPENSSL_NO_ECDSA +#include +#endif +#ifndef OPENSSL_NO_EC +#include +#endif +#include +#include +#endif + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These flags are used to control combinations of algorithm (methods) + * by bitwise "OR"ing. */ +#define ENGINE_METHOD_RSA (unsigned int)0x0001 +#define ENGINE_METHOD_DSA (unsigned int)0x0002 +#define ENGINE_METHOD_DH (unsigned int)0x0004 +#define ENGINE_METHOD_RAND (unsigned int)0x0008 +#define ENGINE_METHOD_ECDH (unsigned int)0x0010 +#define ENGINE_METHOD_ECDSA (unsigned int)0x0020 +#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040 +#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080 +#define ENGINE_METHOD_STORE (unsigned int)0x0100 +#define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200 +#define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400 +#define ENGINE_METHOD_EC (unsigned int)0x0800 +/* Obvious all-or-nothing cases. */ +#define ENGINE_METHOD_ALL (unsigned int)0xFFFF +#define ENGINE_METHOD_NONE (unsigned int)0x0000 + +/* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used + * internally to control registration of ENGINE implementations, and can be set + * by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to + * initialise registered ENGINEs if they are not already initialised. */ +#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001 + +/* ENGINE flags that can be set by ENGINE_set_flags(). */ +/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ /* Not used */ + +/* This flag is for ENGINEs that wish to handle the various 'CMD'-related + * control commands on their own. Without this flag, ENGINE_ctrl() handles these + * control commands on behalf of the ENGINE using their "cmd_defns" data. */ +#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002 + +/* This flag is for ENGINEs who return new duplicate structures when found via + * "ENGINE_by_id()". When an ENGINE must store state (eg. if ENGINE_ctrl() + * commands are called in sequence as part of some stateful process like + * key-generation setup and execution), it can set this flag - then each attempt + * to obtain the ENGINE will result in it being copied into a new structure. + * Normally, ENGINEs don't declare this flag so ENGINE_by_id() just increments + * the existing ENGINE's structural reference count. */ +#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 + +/* This flag if for an ENGINE that does not want its methods registered as + * part of ENGINE_register_all_complete() for example if the methods are + * not usable as default methods. + */ + +#define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008 + +/* ENGINEs can support their own command types, and these flags are used in + * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each + * command expects. Currently only numeric and string input is supported. If a + * control command supports none of the _NUMERIC, _STRING, or _NO_INPUT options, + * then it is regarded as an "internal" control command - and not for use in + * config setting situations. As such, they're not available to the + * ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl() access. Changes to + * this list of 'command types' should be reflected carefully in + * ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). */ + +/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */ +#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 +/* accepts string input (cast from 'void*' to 'const char *', 4th parameter to + * ENGINE_ctrl) */ +#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 +/* Indicates that the control command takes *no* input. Ie. the control command + * is unparameterised. */ +#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 +/* Indicates that the control command is internal. This control command won't + * be shown in any output, and is only usable through the ENGINE_ctrl_cmd() + * function. */ +#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 + +/* NB: These 3 control commands are deprecated and should not be used. ENGINEs + * relying on these commands should compile conditional support for + * compatibility (eg. if these symbols are defined) but should also migrate the + * same functionality to their own ENGINE-specific control functions that can be + * "discovered" by calling applications. The fact these control commands + * wouldn't be "executable" (ie. usable by text-based config) doesn't change the + * fact that application code can find and use them without requiring per-ENGINE + * hacking. */ + +/* These flags are used to tell the ctrl function what should be done. + * All command numbers are shared between all engines, even if some don't + * make sense to some engines. In such a case, they do nothing but return + * the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */ +#define ENGINE_CTRL_SET_LOGSTREAM 1 +#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2 +#define ENGINE_CTRL_HUP 3 /* Close and reinitialise any + handles/connections etc. */ +#define ENGINE_CTRL_SET_USER_INTERFACE 4 /* Alternative to callback */ +#define ENGINE_CTRL_SET_CALLBACK_DATA 5 /* User-specific data, used + when calling the password + callback and the user + interface */ +#define ENGINE_CTRL_LOAD_CONFIGURATION 6 /* Load a configuration, given + a string that represents a + file name or so */ +#define ENGINE_CTRL_LOAD_SECTION 7 /* Load data from a given + section in the already loaded + configuration */ + +/* These control commands allow an application to deal with an arbitrary engine + * in a dynamic way. Warn: Negative return values indicate errors FOR THESE + * COMMANDS because zero is used to indicate 'end-of-list'. Other commands, + * including ENGINE-specific command types, return zero for an error. + * + * An ENGINE can choose to implement these ctrl functions, and can internally + * manage things however it chooses - it does so by setting the + * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise the + * ENGINE_ctrl() code handles this on the ENGINE's behalf using the cmd_defns + * data (set using ENGINE_set_cmd_defns()). This means an ENGINE's ctrl() + * handler need only implement its own commands - the above "meta" commands will + * be taken care of. */ + +/* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", then + * all the remaining control commands will return failure, so it is worth + * checking this first if the caller is trying to "discover" the engine's + * capabilities and doesn't want errors generated unnecessarily. */ +#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10 +/* Returns a positive command number for the first command supported by the + * engine. Returns zero if no ctrl commands are supported. */ +#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 +/* The 'long' argument specifies a command implemented by the engine, and the + * return value is the next command supported, or zero if there are no more. */ +#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 +/* The 'void*' argument is a command name (cast from 'const char *'), and the + * return value is the command that corresponds to it. */ +#define ENGINE_CTRL_GET_CMD_FROM_NAME 13 +/* The next two allow a command to be converted into its corresponding string + * form. In each case, the 'long' argument supplies the command. In the NAME_LEN + * case, the return value is the length of the command name (not counting a + * trailing EOL). In the NAME case, the 'void*' argument must be a string buffer + * large enough, and it will be populated with the name of the command (WITH a + * trailing EOL). */ +#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 +#define ENGINE_CTRL_GET_NAME_FROM_CMD 15 +/* The next two are similar but give a "short description" of a command. */ +#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 +#define ENGINE_CTRL_GET_DESC_FROM_CMD 17 +/* With this command, the return value is the OR'd combination of + * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given + * engine-specific ctrl command expects. */ +#define ENGINE_CTRL_GET_CMD_FLAGS 18 + +/* ENGINE implementations should start the numbering of their own control + * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */ +#define ENGINE_CMD_BASE 200 + +/* If an ENGINE supports its own specific control commands and wishes the + * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on its + * behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN entries + * to ENGINE_set_cmd_defns(). It should also implement a ctrl() handler that + * supports the stated commands (ie. the "cmd_num" entries as described by the + * array). NB: The array must be ordered in increasing order of cmd_num. + * "null-terminated" means that the last ENGINE_CMD_DEFN element has cmd_num set + * to zero and/or cmd_name set to NULL. */ +typedef struct ENGINE_CMD_DEFN_st { + unsigned int cmd_num; /* The command number */ + const char *cmd_name; /* The command name itself */ + const char *cmd_desc; /* A short description of the command */ + unsigned int cmd_flags; /* The input the command expects */ +} ENGINE_CMD_DEFN; + +/* Generic function pointer */ +typedef int (*ENGINE_GEN_FUNC_PTR)(void); +/* Generic function pointer taking no arguments */ +typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *); +/* Specific control function pointer */ +typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, + void (*f)(void)); +/* Generic load_key function pointer */ +typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, + UI_METHOD *ui_method, void *callback_data); +typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl, + STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey, + STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data); + +/* These callback types are for an ENGINE's handler for cipher and digest logic. + * These handlers have these prototypes; + * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); + * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid); + * Looking at how to implement these handlers in the case of cipher support, if + * the framework wants the EVP_CIPHER for 'nid', it will call; + * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) + * If the framework wants a list of supported 'nid's, it will call; + * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) + */ +/* Returns to a pointer to the array of supported cipher 'nid's. If the second + * parameter is non-NULL it is set to the size of the returned array. */ +typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, + const int **, int); +typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int); +typedef int (*ENGINE_PKEY_METHS_PTR)(ENGINE *, EVP_PKEY_METHOD **, + const int **, int); +typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **, + const int **, int); + +/* STRUCTURE functions ... all of these functions deal with pointers to ENGINE + * structures where the pointers have a "structural reference". This means that + * their reference is to allowed access to the structure but it does not imply + * that the structure is functional. To simply increment or decrement the + * structural reference count, use ENGINE_by_id and ENGINE_free. NB: This is not + * required when iterating using ENGINE_get_next as it will automatically + * decrement the structural reference count of the "current" ENGINE and + * increment the structural reference count of the ENGINE it returns (unless it + * is NULL). */ + +/* Get the first/last "ENGINE" type available. */ +ENGINE *ENGINE_get_first(void); +ENGINE *ENGINE_get_last(void); +/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */ +ENGINE *ENGINE_get_next(ENGINE *e); +ENGINE *ENGINE_get_prev(ENGINE *e); +/* Add another "ENGINE" type into the array. */ +int ENGINE_add(ENGINE *e); +/* Remove an existing "ENGINE" type from the array. */ +int ENGINE_remove(ENGINE *e); +/* Retrieve an engine from the list by its unique "id" value. */ +ENGINE *ENGINE_by_id(const char *id); +/* Add all the built-in engines. */ +void ENGINE_load_openssl(void); +void ENGINE_load_dynamic(void); +#ifndef OPENSSL_NO_STATIC_ENGINE +void ENGINE_load_padlock(void); +#endif +void ENGINE_load_builtin_engines(void); + +/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + * "registry" handling. */ +unsigned int ENGINE_get_table_flags(void); +void ENGINE_set_table_flags(unsigned int flags); + +/* Manage registration of ENGINEs per "table". For each type, there are 3 + * functions; + * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + * ENGINE_unregister_***(e) - unregister the implementation from 'e' + * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + * Cleanup is automatically registered from each table when required, so + * ENGINE_cleanup() will reverse any "register" operations. */ + +int ENGINE_register_RSA(ENGINE *e); +void ENGINE_unregister_RSA(ENGINE *e); +void ENGINE_register_all_RSA(void); + +int ENGINE_register_DSA(ENGINE *e); +void ENGINE_unregister_DSA(ENGINE *e); +void ENGINE_register_all_DSA(void); + +int ENGINE_register_ECDH(ENGINE *e); +void ENGINE_unregister_ECDH(ENGINE *e); +void ENGINE_register_all_ECDH(void); + +int ENGINE_register_ECDSA(ENGINE *e); +void ENGINE_unregister_ECDSA(ENGINE *e); +void ENGINE_register_all_ECDSA(void); + +int ENGINE_register_EC(ENGINE *e); +void ENGINE_unregister_EC(ENGINE *e); +void ENGINE_register_all_EC(void); + +int ENGINE_register_DH(ENGINE *e); +void ENGINE_unregister_DH(ENGINE *e); +void ENGINE_register_all_DH(void); + +int ENGINE_register_RAND(ENGINE *e); +void ENGINE_unregister_RAND(ENGINE *e); +void ENGINE_register_all_RAND(void); + +int ENGINE_register_STORE(ENGINE *e); +void ENGINE_unregister_STORE(ENGINE *e); +void ENGINE_register_all_STORE(void); + +int ENGINE_register_ciphers(ENGINE *e); +void ENGINE_unregister_ciphers(ENGINE *e); +void ENGINE_register_all_ciphers(void); + +int ENGINE_register_digests(ENGINE *e); +void ENGINE_unregister_digests(ENGINE *e); +void ENGINE_register_all_digests(void); + +int ENGINE_register_pkey_meths(ENGINE *e); +void ENGINE_unregister_pkey_meths(ENGINE *e); +void ENGINE_register_all_pkey_meths(void); + +int ENGINE_register_pkey_asn1_meths(ENGINE *e); +void ENGINE_unregister_pkey_asn1_meths(ENGINE *e); +void ENGINE_register_all_pkey_asn1_meths(void); + +/* These functions register all support from the above categories. Note, use of + * these functions can result in static linkage of code your application may not + * need. If you only need a subset of functionality, consider using more + * selective initialisation. */ +int ENGINE_register_complete(ENGINE *e); +int ENGINE_register_all_complete(void); + +/* Send parametrised control commands to the engine. The possibilities to send + * down an integer, a pointer to data or a function pointer are provided. Any of + * the parameters may or may not be NULL, depending on the command number. In + * actuality, this function only requires a structural (rather than functional) + * reference to an engine, but many control commands may require the engine be + * functional. The caller should be aware of trying commands that require an + * operational ENGINE, and only use functional references in such situations. */ +int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)); + +/* This function tests if an ENGINE-specific command is usable as a "setting". + * Eg. in an application's config file that gets processed through + * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). */ +int ENGINE_cmd_is_executable(ENGINE *e, int cmd); + +/* This function works like ENGINE_ctrl() with the exception of taking a + * command name instead of a command number, and can handle optional commands. + * See the comment on ENGINE_ctrl_cmd_string() for an explanation on how to + * use the cmd_name and cmd_optional. */ +int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, + long i, void *p, void (*f)(void), int cmd_optional); + +/* This function passes a command-name and argument to an ENGINE. The cmd_name + * is converted to a command number and the control command is called using + * 'arg' as an argument (unless the ENGINE doesn't support such a command, in + * which case no control command is called). The command is checked for input + * flags, and if necessary the argument will be converted to a numeric value. If + * cmd_optional is non-zero, then if the ENGINE doesn't support the given + * cmd_name the return value will be success anyway. This function is intended + * for applications to use so that users (or config files) can supply + * engine-specific config data to the ENGINE at run-time to control behaviour of + * specific engines. As such, it shouldn't be used for calling ENGINE_ctrl() + * functions that return data, deal with binary data, or that are otherwise + * supposed to be used directly through ENGINE_ctrl() in application code. Any + * "return" data from an ENGINE_ctrl() operation in this function will be lost - + * the return value is interpreted as failure if the return value is zero, + * success otherwise, and this function returns a boolean value as a result. In + * other words, vendors of 'ENGINE'-enabled devices should write ENGINE + * implementations with parameterisations that work in this scheme, so that + * compliant ENGINE-based applications can work consistently with the same + * configuration for the same ENGINE-enabled devices, across applications. */ +int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, + int cmd_optional); + +/* These functions are useful for manufacturing new ENGINE structures. They + * don't address reference counting at all - one uses them to populate an ENGINE + * structure with personalised implementations of things prior to using it + * directly or adding it to the builtin ENGINE list in OpenSSL. These are also + * here so that the ENGINE structure doesn't have to be exposed and break binary + * compatibility! */ +ENGINE *ENGINE_new(void); +int ENGINE_free(ENGINE *e); +int ENGINE_up_ref(ENGINE *e); +int ENGINE_set_id(ENGINE *e, const char *id); +int ENGINE_set_name(ENGINE *e, const char *name); +int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); +int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); +int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth); +int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth); +int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ec_meth); +int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); +int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); +int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth); +int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); +int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); +int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); +int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); +int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); +int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); +int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, + ENGINE_SSL_CLIENT_CERT_PTR loadssl_f); +int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); +int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); +int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f); +int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f); +int ENGINE_set_flags(ENGINE *e, int flags); +int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); +/* These functions allow control over any per-structure ENGINE data. */ +int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); +void *ENGINE_get_ex_data(const ENGINE *e, int idx); + +/* This function cleans up anything that needs it. Eg. the ENGINE_add() function + * automatically ensures the list cleanup function is registered to be called + * from ENGINE_cleanup(). Similarly, all ENGINE_register_*** functions ensure + * ENGINE_cleanup() will clean up after them. */ +void ENGINE_cleanup(void); + +/* These return values from within the ENGINE structure. These can be useful + * with functional references as well as structural references - it depends + * which you obtained. Using the result for functional purposes if you only + * obtained a structural reference may be problematic! */ +const char *ENGINE_get_id(const ENGINE *e); +const char *ENGINE_get_name(const ENGINE *e); +const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); +const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); +const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e); +const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e); +const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e); +const DH_METHOD *ENGINE_get_DH(const ENGINE *e); +const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); +const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e); +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); +ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); +ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); +ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); +ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e); +ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); +ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); +ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e); +ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e); +const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); +const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); +const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid); +const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid); +const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e, + const char *str, int len); +const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe, + const char *str, int len); +const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); +int ENGINE_get_flags(const ENGINE *e); + +/* FUNCTIONAL functions. These functions deal with ENGINE structures + * that have (or will) be initialised for use. Broadly speaking, the + * structural functions are useful for iterating the list of available + * engine types, creating new engine types, and other "list" operations. + * These functions actually deal with ENGINEs that are to be used. As + * such these functions can fail (if applicable) when particular + * engines are unavailable - eg. if a hardware accelerator is not + * attached or not functioning correctly. Each ENGINE has 2 reference + * counts; structural and functional. Every time a functional reference + * is obtained or released, a corresponding structural reference is + * automatically obtained or released too. */ + +/* Initialise a engine type for use (or up its reference count if it's + * already in use). This will fail if the engine is not currently + * operational and cannot initialise. */ +int ENGINE_init(ENGINE *e); +/* Free a functional reference to a engine type. This does not require + * a corresponding call to ENGINE_free as it also releases a structural + * reference. */ +int ENGINE_finish(ENGINE *e); + +/* The following functions handle keys that are stored in some secondary + * location, handled by the engine. The storage may be on a card or + * whatever. */ +EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, + UI_METHOD *ui_method, void *callback_data); +EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, + UI_METHOD *ui_method, void *callback_data); +int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, + STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey, + STACK_OF(X509) **pother, + UI_METHOD *ui_method, void *callback_data); + +/* This returns a pointer for the current ENGINE structure that + * is (by default) performing any RSA operations. The value returned + * is an incremented reference, so it should be free'd (ENGINE_finish) + * before it is discarded. */ +ENGINE *ENGINE_get_default_RSA(void); +/* Same for the other "methods" */ +ENGINE *ENGINE_get_default_DSA(void); +ENGINE *ENGINE_get_default_ECDH(void); +ENGINE *ENGINE_get_default_ECDSA(void); +ENGINE *ENGINE_get_default_EC(void); +ENGINE *ENGINE_get_default_DH(void); +ENGINE *ENGINE_get_default_RAND(void); +/* These functions can be used to get a functional reference to perform + * ciphering or digesting corresponding to "nid". */ +ENGINE *ENGINE_get_cipher_engine(int nid); +ENGINE *ENGINE_get_digest_engine(int nid); +ENGINE *ENGINE_get_pkey_meth_engine(int nid); +ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid); + +/* This sets a new default ENGINE structure for performing RSA + * operations. If the result is non-zero (success) then the ENGINE + * structure will have had its reference count up'd so the caller + * should still free their own reference 'e'. */ +int ENGINE_set_default_RSA(ENGINE *e); +int ENGINE_set_default_string(ENGINE *e, const char *def_list); +/* Same for the other "methods" */ +int ENGINE_set_default_DSA(ENGINE *e); +int ENGINE_set_default_ECDH(ENGINE *e); +int ENGINE_set_default_ECDSA(ENGINE *e); +int ENGINE_set_default_EC(ENGINE *e); +int ENGINE_set_default_DH(ENGINE *e); +int ENGINE_set_default_RAND(ENGINE *e); +int ENGINE_set_default_ciphers(ENGINE *e); +int ENGINE_set_default_digests(ENGINE *e); +int ENGINE_set_default_pkey_meths(ENGINE *e); +int ENGINE_set_default_pkey_asn1_meths(ENGINE *e); + +/* The combination "set" - the flags are bitwise "OR"d from the + * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + * function, this function can result in unnecessary static linkage. If your + * application requires only specific functionality, consider using more + * selective functions. */ +int ENGINE_set_default(ENGINE *e, unsigned int flags); + +void ENGINE_add_conf_module(void); + +/* Deprecated functions ... */ +/* int ENGINE_clear_defaults(void); */ + +/**************************/ +/* DYNAMIC ENGINE SUPPORT */ +/**************************/ + +/* Binary/behaviour compatibility levels */ +#define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000 +/* Binary versions older than this are too old for us (whether we're a loader or + * a loadee) */ +#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000 + +/* When compiling an ENGINE entirely as an external shared library, loadable by + * the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure + * type provides the calling application's (or library's) error functionality + * and memory management function pointers to the loaded library. These should + * be used/set in the loaded library code so that the loading application's + * 'state' will be used/changed in all operations. The 'static_state' pointer + * allows the loaded library to know if it shares the same static data as the + * calling application (or library), and thus whether these callbacks need to be + * set or not. */ +typedef void *(*dyn_MEM_malloc_cb)(size_t); +typedef void *(*dyn_MEM_realloc_cb)(void *, size_t); +typedef void (*dyn_MEM_free_cb)(void *); +typedef struct st_dynamic_MEM_fns { + dyn_MEM_malloc_cb malloc_cb; + dyn_MEM_realloc_cb realloc_cb; + dyn_MEM_free_cb free_cb; +} dynamic_MEM_fns; +/* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use + * these types so we (and any other dependant code) can simplify a bit?? */ +typedef void (*dyn_lock_locking_cb)(int, int, const char *, int); +typedef int (*dyn_lock_add_lock_cb)(int*, int, int, const char *, int); +typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)( + const char *, int); +typedef void (*dyn_dynlock_lock_cb)(int, struct CRYPTO_dynlock_value *, + const char *, int); +typedef void (*dyn_dynlock_destroy_cb)(struct CRYPTO_dynlock_value *, + const char *, int); +typedef struct st_dynamic_LOCK_fns { + dyn_lock_locking_cb lock_locking_cb; + dyn_lock_add_lock_cb lock_add_lock_cb; + dyn_dynlock_create_cb dynlock_create_cb; + dyn_dynlock_lock_cb dynlock_lock_cb; + dyn_dynlock_destroy_cb dynlock_destroy_cb; +} dynamic_LOCK_fns; +/* The top-level structure */ +typedef struct st_dynamic_fns { + void *static_state; + const ERR_FNS *err_fns; + const CRYPTO_EX_DATA_IMPL *ex_data_fns; + dynamic_MEM_fns mem_fns; + dynamic_LOCK_fns lock_fns; +} dynamic_fns; + +/* The version checking function should be of this prototype. NB: The + * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading code. + * If this function returns zero, it indicates a (potential) version + * incompatibility and the loaded library doesn't believe it can proceed. + * Otherwise, the returned value is the (latest) version supported by the + * loading library. The loader may still decide that the loaded code's version + * is unsatisfactory and could veto the load. The function is expected to + * be implemented with the symbol name "v_check", and a default implementation + * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ +typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); +#define IMPLEMENT_DYNAMIC_CHECK_FN() \ + extern unsigned long v_check(unsigned long v); \ + extern unsigned long v_check(unsigned long v) { \ + if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ + return 0; } + +/* This function is passed the ENGINE structure to initialise with its own + * function and command settings. It should not adjust the structural or + * functional reference counts. If this function returns zero, (a) the load will + * be aborted, (b) the previous ENGINE state will be memcpy'd back onto the + * structure, and (c) the shared library will be unloaded. So implementations + * should do their own internal cleanup in failure circumstances otherwise they + * could leak. The 'id' parameter, if non-NULL, represents the ENGINE id that + * the loader is looking for. If this is NULL, the shared library can choose to + * return failure or to initialise a 'default' ENGINE. If non-NULL, the shared + * library must initialise only an ENGINE matching the passed 'id'. The function + * is expected to be implemented with the symbol name "bind_engine". A standard + * implementation can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where + * the parameter 'fn' is a callback function that populates the ENGINE structure + * and returns an int value (zero for failure). 'fn' should have prototype; + * [static] int fn(ENGINE *e, const char *id); */ +typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, + const dynamic_fns *fns); +#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + extern \ + int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ + extern \ + int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ + if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ + if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ + fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ + return 0; \ + if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ + return 0; \ + if(!ERR_set_implementation(fns->err_fns)) return 0; \ + skip_cbs: \ + if(!fn(e,id)) return 0; \ + return 1; } + +/* If the loading application (or library) and the loaded ENGINE library share + * the same static data (eg. they're both dynamically linked to the same + * libcrypto.so) we need a way to avoid trying to set system callbacks - this + * would fail, and for the same reason that it's unnecessary to try. If the + * loaded ENGINE has (or gets from through the loader) its own copy of the + * libcrypto static data, we will need to set the callbacks. The easiest way to + * detect this is to have a function that returns a pointer to some static data + * and let the loading application and loaded ENGINE compare their respective + * values. */ + void *ENGINE_get_static_state(void); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ENGINE_strings(void); + +/* Error codes for the ENGINE functions. */ + +/* Function codes. */ +#define ENGINE_F_DYNAMIC_CTRL 180 +#define ENGINE_F_DYNAMIC_GET_DATA_CTX 181 +#define ENGINE_F_DYNAMIC_LOAD 182 +#define ENGINE_F_DYNAMIC_SET_DATA_CTX 183 +#define ENGINE_F_ENGINE_ADD 105 +#define ENGINE_F_ENGINE_BY_ID 106 +#define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170 +#define ENGINE_F_ENGINE_CTRL 142 +#define ENGINE_F_ENGINE_CTRL_CMD 178 +#define ENGINE_F_ENGINE_CTRL_CMD_STRING 171 +#define ENGINE_F_ENGINE_FINISH 107 +#define ENGINE_F_ENGINE_FREE_UTIL 108 +#define ENGINE_F_ENGINE_GET_CIPHER 185 +#define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177 +#define ENGINE_F_ENGINE_GET_DIGEST 186 +#define ENGINE_F_ENGINE_GET_NEXT 115 +#define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193 +#define ENGINE_F_ENGINE_GET_PKEY_METH 192 +#define ENGINE_F_ENGINE_GET_PREV 116 +#define ENGINE_F_ENGINE_INIT 119 +#define ENGINE_F_ENGINE_LIST_ADD 120 +#define ENGINE_F_ENGINE_LIST_REMOVE 121 +#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150 +#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151 +#define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 194 +#define ENGINE_F_ENGINE_NEW 122 +#define ENGINE_F_ENGINE_REMOVE 123 +#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189 +#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126 +#define ENGINE_F_ENGINE_SET_ID 129 +#define ENGINE_F_ENGINE_SET_NAME 130 +#define ENGINE_F_ENGINE_TABLE_REGISTER 184 +#define ENGINE_F_ENGINE_UNLOAD_KEY 152 +#define ENGINE_F_ENGINE_UNLOCKED_FINISH 191 +#define ENGINE_F_ENGINE_UP_REF 190 +#define ENGINE_F_INT_CTRL_HELPER 172 +#define ENGINE_F_INT_ENGINE_CONFIGURE 188 +#define ENGINE_F_INT_ENGINE_MODULE_INIT 187 +#define ENGINE_F_LOG_MESSAGE 141 + +/* Reason codes. */ +#define ENGINE_R_ALREADY_LOADED 100 +#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133 +#define ENGINE_R_CMD_NOT_EXECUTABLE 134 +#define ENGINE_R_COMMAND_TAKES_INPUT 135 +#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136 +#define ENGINE_R_CONFLICTING_ENGINE_ID 103 +#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119 +#define ENGINE_R_DH_NOT_IMPLEMENTED 139 +#define ENGINE_R_DSA_NOT_IMPLEMENTED 140 +#define ENGINE_R_DSO_FAILURE 104 +#define ENGINE_R_DSO_NOT_FOUND 132 +#define ENGINE_R_ENGINES_SECTION_ERROR 148 +#define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102 +#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105 +#define ENGINE_R_ENGINE_SECTION_ERROR 149 +#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128 +#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 +#define ENGINE_R_FINISH_FAILED 106 +#define ENGINE_R_GET_HANDLE_FAILED 107 +#define ENGINE_R_ID_OR_NAME_MISSING 108 +#define ENGINE_R_INIT_FAILED 109 +#define ENGINE_R_INTERNAL_LIST_ERROR 110 +#define ENGINE_R_INVALID_ARGUMENT 143 +#define ENGINE_R_INVALID_CMD_NAME 137 +#define ENGINE_R_INVALID_CMD_NUMBER 138 +#define ENGINE_R_INVALID_INIT_VALUE 151 +#define ENGINE_R_INVALID_STRING 150 +#define ENGINE_R_NOT_INITIALISED 117 +#define ENGINE_R_NOT_LOADED 112 +#define ENGINE_R_NO_CONTROL_FUNCTION 120 +#define ENGINE_R_NO_INDEX 144 +#define ENGINE_R_NO_LOAD_FUNCTION 125 +#define ENGINE_R_NO_REFERENCE 130 +#define ENGINE_R_NO_SUCH_ENGINE 116 +#define ENGINE_R_NO_UNLOAD_FUNCTION 126 +#define ENGINE_R_PROVIDE_PARAMETERS 113 +#define ENGINE_R_RSA_NOT_IMPLEMENTED 141 +#define ENGINE_R_UNIMPLEMENTED_CIPHER 146 +#define ENGINE_R_UNIMPLEMENTED_DIGEST 147 +#define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101 +#define ENGINE_R_VERSION_INCOMPATIBILITY 145 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/err.h b/code/contrib/libfido2/include/openssl/err.h new file mode 100644 index 0000000..20fa908 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/err.h @@ -0,0 +1,424 @@ +/* $OpenBSD: err.h,v 1.26 2021/11/24 01:12:43 beck Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_ERR_H +#define HEADER_ERR_H + +#include + +#include +#include + +#include +#ifndef OPENSSL_NO_BIO +#include +#endif +#ifndef OPENSSL_NO_LHASH +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_ERR +#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) +#else +#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) +#endif + +#include + +#define ERR_TXT_MALLOCED 0x01 +#define ERR_TXT_STRING 0x02 + +#define ERR_FLAG_MARK 0x01 + +#define ERR_NUM_ERRORS 16 +typedef struct err_state_st { + CRYPTO_THREADID tid; + int err_flags[ERR_NUM_ERRORS]; + unsigned long err_buffer[ERR_NUM_ERRORS]; + char *err_data[ERR_NUM_ERRORS]; + int err_data_flags[ERR_NUM_ERRORS]; + const char *err_file[ERR_NUM_ERRORS]; + int err_line[ERR_NUM_ERRORS]; + int top, bottom; +} ERR_STATE; + +/* library */ +#define ERR_LIB_NONE 1 +#define ERR_LIB_SYS 2 +#define ERR_LIB_BN 3 +#define ERR_LIB_RSA 4 +#define ERR_LIB_DH 5 +#define ERR_LIB_EVP 6 +#define ERR_LIB_BUF 7 +#define ERR_LIB_OBJ 8 +#define ERR_LIB_PEM 9 +#define ERR_LIB_DSA 10 +#define ERR_LIB_X509 11 +/* #define ERR_LIB_METH 12 */ +#define ERR_LIB_ASN1 13 +#define ERR_LIB_CONF 14 +#define ERR_LIB_CRYPTO 15 +#define ERR_LIB_EC 16 +#define ERR_LIB_SSL 20 +/* #define ERR_LIB_SSL23 21 */ +/* #define ERR_LIB_SSL2 22 */ +/* #define ERR_LIB_SSL3 23 */ +/* #define ERR_LIB_RSAREF 30 */ +/* #define ERR_LIB_PROXY 31 */ +#define ERR_LIB_BIO 32 +#define ERR_LIB_PKCS7 33 +#define ERR_LIB_X509V3 34 +#define ERR_LIB_PKCS12 35 +#define ERR_LIB_RAND 36 +#define ERR_LIB_DSO 37 +#define ERR_LIB_ENGINE 38 +#define ERR_LIB_OCSP 39 +#define ERR_LIB_UI 40 +#define ERR_LIB_COMP 41 +#define ERR_LIB_ECDSA 42 +#define ERR_LIB_ECDH 43 +#define ERR_LIB_STORE 44 +#define ERR_LIB_FIPS 45 +#define ERR_LIB_CMS 46 +#define ERR_LIB_TS 47 +#define ERR_LIB_HMAC 48 +#define ERR_LIB_JPAKE 49 +#define ERR_LIB_GOST 50 +#define ERR_LIB_CT 51 + +#define ERR_LIB_USER 128 + +#ifndef LIBRESSL_INTERNAL +#define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) +#define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) +#define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) +#define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) +#define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) +#define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) +#define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) +#define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) +#define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) +#define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) +#define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) +#define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) +#define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) +#define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) +#define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) +#define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) +#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) +#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) +#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) +#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) +#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) +#define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) +#define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) +#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) +#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) +#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) +#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) +#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) +#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) +#define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__) +#define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__) +#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) +#define GOSTerr(f,r) ERR_PUT_error(ERR_LIB_GOST,(f),(r),__FILE__,__LINE__) +#define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) +#define CTerr(f, r) ERR_PUT_error(ERR_LIB_CT,(f),(r),__FILE__,__LINE__) +#endif + +#ifdef LIBRESSL_INTERNAL +#define SYSerror(r) ERR_PUT_error(ERR_LIB_SYS,(0xfff),(r),__FILE__,__LINE__) +#define BNerror(r) ERR_PUT_error(ERR_LIB_BN,(0xfff),(r),__FILE__,__LINE__) +#define RSAerror(r) ERR_PUT_error(ERR_LIB_RSA,(0xfff),(r),__FILE__,__LINE__) +#define DHerror(r) ERR_PUT_error(ERR_LIB_DH,(0xfff),(r),__FILE__,__LINE__) +#define EVPerror(r) ERR_PUT_error(ERR_LIB_EVP,(0xfff),(r),__FILE__,__LINE__) +#define BUFerror(r) ERR_PUT_error(ERR_LIB_BUF,(0xfff),(r),__FILE__,__LINE__) +#define OBJerror(r) ERR_PUT_error(ERR_LIB_OBJ,(0xfff),(r),__FILE__,__LINE__) +#define PEMerror(r) ERR_PUT_error(ERR_LIB_PEM,(0xfff),(r),__FILE__,__LINE__) +#define DSAerror(r) ERR_PUT_error(ERR_LIB_DSA,(0xfff),(r),__FILE__,__LINE__) +#define X509error(r) ERR_PUT_error(ERR_LIB_X509,(0xfff),(r),__FILE__,__LINE__) +#define ASN1error(r) ERR_PUT_error(ERR_LIB_ASN1,(0xfff),(r),__FILE__,__LINE__) +#define CONFerror(r) ERR_PUT_error(ERR_LIB_CONF,(0xfff),(r),__FILE__,__LINE__) +#define CRYPTOerror(r) ERR_PUT_error(ERR_LIB_CRYPTO,(0xfff),(r),__FILE__,__LINE__) +#define ECerror(r) ERR_PUT_error(ERR_LIB_EC,(0xfff),(r),__FILE__,__LINE__) +#define BIOerror(r) ERR_PUT_error(ERR_LIB_BIO,(0xfff),(r),__FILE__,__LINE__) +#define PKCS7error(r) ERR_PUT_error(ERR_LIB_PKCS7,(0xfff),(r),__FILE__,__LINE__) +#define X509V3error(r) ERR_PUT_error(ERR_LIB_X509V3,(0xfff),(r),__FILE__,__LINE__) +#define PKCS12error(r) ERR_PUT_error(ERR_LIB_PKCS12,(0xfff),(r),__FILE__,__LINE__) +#define RANDerror(r) ERR_PUT_error(ERR_LIB_RAND,(0xfff),(r),__FILE__,__LINE__) +#define DSOerror(r) ERR_PUT_error(ERR_LIB_DSO,(0xfff),(r),__FILE__,__LINE__) +#define ENGINEerror(r) ERR_PUT_error(ERR_LIB_ENGINE,(0xfff),(r),__FILE__,__LINE__) +#define OCSPerror(r) ERR_PUT_error(ERR_LIB_OCSP,(0xfff),(r),__FILE__,__LINE__) +#define UIerror(r) ERR_PUT_error(ERR_LIB_UI,(0xfff),(r),__FILE__,__LINE__) +#define COMPerror(r) ERR_PUT_error(ERR_LIB_COMP,(0xfff),(r),__FILE__,__LINE__) +#define ECDSAerror(r) ERR_PUT_error(ERR_LIB_ECDSA,(0xfff),(r),__FILE__,__LINE__) +#define ECDHerror(r) ERR_PUT_error(ERR_LIB_ECDH,(0xfff),(r),__FILE__,__LINE__) +#define STOREerror(r) ERR_PUT_error(ERR_LIB_STORE,(0xfff),(r),__FILE__,__LINE__) +#define FIPSerror(r) ERR_PUT_error(ERR_LIB_FIPS,(0xfff),(r),__FILE__,__LINE__) +#define CMSerror(r) ERR_PUT_error(ERR_LIB_CMS,(0xfff),(r),__FILE__,__LINE__) +#define TSerror(r) ERR_PUT_error(ERR_LIB_TS,(0xfff),(r),__FILE__,__LINE__) +#define HMACerror(r) ERR_PUT_error(ERR_LIB_HMAC,(0xfff),(r),__FILE__,__LINE__) +#define JPAKEerror(r) ERR_PUT_error(ERR_LIB_JPAKE,(0xfff),(r),__FILE__,__LINE__) +#define GOSTerror(r) ERR_PUT_error(ERR_LIB_GOST,(0xfff),(r),__FILE__,__LINE__) +#define CTerror(r) ERR_PUT_error(ERR_LIB_CT,(0xfff),(r),__FILE__,__LINE__) +#endif + +#define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)<<24L)| \ + ((((unsigned long)f)&0xfffL)<<12L)| \ + ((((unsigned long)r)&0xfffL))) +#define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) +#define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) +#define ERR_GET_REASON(l) (int)((l)&0xfffL) +#define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) + + +/* OS functions */ +#define SYS_F_FOPEN 1 +#define SYS_F_CONNECT 2 +#define SYS_F_GETSERVBYNAME 3 +#define SYS_F_SOCKET 4 +#define SYS_F_IOCTLSOCKET 5 +#define SYS_F_BIND 6 +#define SYS_F_LISTEN 7 +#define SYS_F_ACCEPT 8 +#define SYS_F_WSASTARTUP 9 /* Winsock stuff */ +#define SYS_F_OPENDIR 10 +#define SYS_F_FREAD 11 + + +/* reasons */ +#define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */ +#define ERR_R_BN_LIB ERR_LIB_BN /* 3 */ +#define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */ +#define ERR_R_DH_LIB ERR_LIB_DH /* 5 */ +#define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */ +#define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */ +#define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */ +#define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */ +#define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */ +#define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */ +#define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */ +#define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */ +#define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO /* 15 */ +#define ERR_R_EC_LIB ERR_LIB_EC /* 16 */ +#define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */ +#define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */ +#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */ +#define ERR_R_X509V3_LIB ERR_LIB_X509V3 /* 34 */ +#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* 35 */ +#define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */ +#define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */ +#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE /* 38 */ +#define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ +#define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ +#define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ +#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */ +#define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */ +#define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */ +#define ERR_R_TS_LIB ERR_LIB_TS /* 45 */ + +#define ERR_R_NESTED_ASN1_ERROR 58 +#define ERR_R_BAD_ASN1_OBJECT_HEADER 59 +#define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60 +#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61 +#define ERR_R_ASN1_LENGTH_MISMATCH 62 +#define ERR_R_MISSING_ASN1_EOS 63 + +/* fatal error */ +#define ERR_R_FATAL 64 +#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) +#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) +#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) +#define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) +#define ERR_R_DISABLED (5|ERR_R_FATAL) + +/* 99 is the maximum possible ERR_R_... code, higher values + * are reserved for the individual libraries */ + + +typedef struct ERR_string_data_st { + unsigned long error; + const char *string; +} ERR_STRING_DATA; + +void ERR_put_error(int lib, int func, int reason, const char *file, int line); +void ERR_set_error_data(char *data, int flags); + +unsigned long ERR_get_error(void); +unsigned long ERR_get_error_line(const char **file, int *line); +unsigned long ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags); +unsigned long ERR_peek_error(void); +unsigned long ERR_peek_error_line(const char **file, int *line); +unsigned long ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags); +unsigned long ERR_peek_last_error(void); +unsigned long ERR_peek_last_error_line(const char **file, int *line); +unsigned long ERR_peek_last_error_line_data(const char **file, int *line, + const char **data, int *flags); +void ERR_clear_error(void ); +char *ERR_error_string(unsigned long e, char *buf); +void ERR_error_string_n(unsigned long e, char *buf, size_t len); +const char *ERR_lib_error_string(unsigned long e); +const char *ERR_func_error_string(unsigned long e); +const char *ERR_reason_error_string(unsigned long e); +void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), + void *u); +void ERR_print_errors_fp(FILE *fp); +#ifndef OPENSSL_NO_BIO +void ERR_print_errors(BIO *bp); +#endif +void ERR_asprintf_error_data(char * format, ...); +#ifndef LIBRESSL_INTERNAL +void ERR_add_error_data(int num, ...); +void ERR_add_error_vdata(int num, va_list args); +#endif +void ERR_load_strings(int lib, ERR_STRING_DATA str[]); +void ERR_unload_strings(int lib, ERR_STRING_DATA str[]); +void ERR_load_ERR_strings(void); +void ERR_load_crypto_strings(void); +void ERR_free_strings(void); + +void ERR_remove_thread_state(const CRYPTO_THREADID *tid); +#ifndef OPENSSL_NO_DEPRECATED +void ERR_remove_state(unsigned long pid); /* if zero we look it up */ +#endif +ERR_STATE *ERR_get_state(void); + +#ifndef OPENSSL_NO_LHASH +LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void); +LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void); +void ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash); +#endif + +int ERR_get_next_error_library(void); + +int ERR_set_mark(void); +int ERR_pop_to_mark(void); + +/* Already defined in ossl_typ.h */ +/* typedef struct st_ERR_FNS ERR_FNS; */ +/* An application can use this function and provide the return value to loaded + * modules that should use the application's ERR state/functionality */ +const ERR_FNS *ERR_get_implementation(void); +/* A loaded module should call this function prior to any ERR operations using + * the application's "ERR_FNS". */ +int ERR_set_implementation(const ERR_FNS *fns); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/evp.h b/code/contrib/libfido2/include/openssl/evp.h new file mode 100644 index 0000000..a80cf18 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/evp.h @@ -0,0 +1,1448 @@ +/* $OpenBSD: evp.h,v 1.99 2022/01/14 08:38:05 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ENVELOPE_H +#define HEADER_ENVELOPE_H + +#include + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif + +/* +#define EVP_RC2_KEY_SIZE 16 +#define EVP_RC4_KEY_SIZE 16 +#define EVP_BLOWFISH_KEY_SIZE 16 +#define EVP_CAST5_KEY_SIZE 16 +#define EVP_RC5_32_12_16_KEY_SIZE 16 +*/ +#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ +#define EVP_MAX_KEY_LENGTH 64 +#define EVP_MAX_IV_LENGTH 16 +#define EVP_MAX_BLOCK_LENGTH 32 + +#define PKCS5_SALT_LEN 8 +/* Default PKCS#5 iteration count */ +#define PKCS5_DEFAULT_ITER 2048 + +#include + +#define EVP_PK_RSA 0x0001 +#define EVP_PK_DSA 0x0002 +#define EVP_PK_DH 0x0004 +#define EVP_PK_EC 0x0008 +#define EVP_PKT_SIGN 0x0010 +#define EVP_PKT_ENC 0x0020 +#define EVP_PKT_EXCH 0x0040 +#define EVP_PKS_RSA 0x0100 +#define EVP_PKS_DSA 0x0200 +#define EVP_PKS_EC 0x0400 +#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */ + +#define EVP_PKEY_NONE NID_undef +#define EVP_PKEY_RSA NID_rsaEncryption +#define EVP_PKEY_RSA_PSS NID_rsassaPss +#define EVP_PKEY_RSA2 NID_rsa +#define EVP_PKEY_DSA NID_dsa +#define EVP_PKEY_DSA1 NID_dsa_2 +#define EVP_PKEY_DSA2 NID_dsaWithSHA +#define EVP_PKEY_DSA3 NID_dsaWithSHA1 +#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 +#define EVP_PKEY_DH NID_dhKeyAgreement +#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey +#define EVP_PKEY_GOSTR01 NID_id_GostR3410_2001 +#define EVP_PKEY_GOSTIMIT NID_id_Gost28147_89_MAC +#define EVP_PKEY_HMAC NID_hmac +#define EVP_PKEY_CMAC NID_cmac +#define EVP_PKEY_GOSTR12_256 NID_id_tc26_gost3410_2012_256 +#define EVP_PKEY_GOSTR12_512 NID_id_tc26_gost3410_2012_512 + +#ifdef __cplusplus +extern "C" { +#endif + +#define EVP_PKEY_MO_SIGN 0x0001 +#define EVP_PKEY_MO_VERIFY 0x0002 +#define EVP_PKEY_MO_ENCRYPT 0x0004 +#define EVP_PKEY_MO_DECRYPT 0x0008 + +#ifndef EVP_MD +#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single + * block */ + +/* DigestAlgorithmIdentifier flags... */ + +#define EVP_MD_FLAG_DIGALGID_MASK 0x0018 + +/* NULL or absent parameter accepted. Use NULL */ + +#define EVP_MD_FLAG_DIGALGID_NULL 0x0000 + +/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ + +#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008 + +/* Custom handling via ctrl */ + +#define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 + +#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */ + +/* Digest ctrls */ + +#define EVP_MD_CTRL_DIGALGID 0x1 +#define EVP_MD_CTRL_MICALG 0x2 +#define EVP_MD_CTRL_SET_KEY 0x3 +#define EVP_MD_CTRL_GOST_SET_SBOX 0x4 + +/* Minimum Algorithm specific ctrl value */ + +#define EVP_MD_CTRL_ALG_CTRL 0x1000 + +#endif /* !EVP_MD */ + +/* values for EVP_MD_CTX flags */ + +#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called + * once only */ +#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been + * cleaned */ +#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data + * in EVP_MD_CTX_cleanup */ +/* FIPS and pad options are ignored in 1.0.0, definitions are here + * so we don't accidentally reuse the values for other purposes. + */ + +#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest + * in FIPS mode */ + +/* The following PAD options are also currently ignored in 1.0.0, digest + * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() + * instead. + */ +#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */ +#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */ +#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */ +#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */ + +#define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */ + +/* Values for cipher flags */ + +/* Modes for ciphers */ + +#define EVP_CIPH_STREAM_CIPHER 0x0 +#define EVP_CIPH_ECB_MODE 0x1 +#define EVP_CIPH_CBC_MODE 0x2 +#define EVP_CIPH_CFB_MODE 0x3 +#define EVP_CIPH_OFB_MODE 0x4 +#define EVP_CIPH_CTR_MODE 0x5 +#define EVP_CIPH_GCM_MODE 0x6 +#define EVP_CIPH_CCM_MODE 0x7 +#define EVP_CIPH_XTS_MODE 0x10001 +#define EVP_CIPH_WRAP_MODE 0x10002 +#define EVP_CIPH_MODE 0xF0007 +/* Set if variable length cipher */ +#define EVP_CIPH_VARIABLE_LENGTH 0x8 +/* Set if the iv handling should be done by the cipher itself */ +#define EVP_CIPH_CUSTOM_IV 0x10 +/* Set if the cipher's init() function should be called if key is NULL */ +#define EVP_CIPH_ALWAYS_CALL_INIT 0x20 +/* Call ctrl() to init cipher parameters */ +#define EVP_CIPH_CTRL_INIT 0x40 +/* Don't use standard key length function */ +#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 +/* Don't use standard block padding */ +#define EVP_CIPH_NO_PADDING 0x100 +/* cipher handles random key generation */ +#define EVP_CIPH_RAND_KEY 0x200 +/* cipher has its own additional copying logic */ +#define EVP_CIPH_CUSTOM_COPY 0x400 +/* Allow use default ASN1 get/set iv */ +#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 +/* Buffer length in bits not bytes: CFB1 mode only */ +#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 +/* Note if suitable for use in FIPS mode */ +#define EVP_CIPH_FLAG_FIPS 0x4000 +/* Allow non FIPS cipher in FIPS mode */ +#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000 +/* Cipher handles any and all padding logic as well + * as finalisation. + */ +#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 +#define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 + +/* + * Cipher context flag to indicate that we can handle wrap mode: if allowed in + * older applications, it could overflow buffers. + */ +#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1 + +/* ctrl() values */ + +#define EVP_CTRL_INIT 0x0 +#define EVP_CTRL_SET_KEY_LENGTH 0x1 +#define EVP_CTRL_GET_RC2_KEY_BITS 0x2 +#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 +#define EVP_CTRL_GET_RC5_ROUNDS 0x4 +#define EVP_CTRL_SET_RC5_ROUNDS 0x5 +#define EVP_CTRL_RAND_KEY 0x6 +#define EVP_CTRL_PBE_PRF_NID 0x7 +#define EVP_CTRL_COPY 0x8 +#define EVP_CTRL_AEAD_SET_IVLEN 0x9 +#define EVP_CTRL_AEAD_GET_TAG 0x10 +#define EVP_CTRL_AEAD_SET_TAG 0x11 +#define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_GCM_SET_IV_FIXED 0x12 +#define EVP_CTRL_GCM_IV_GEN 0x13 +#define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_CCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_CCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_CCM_SET_L 0x14 +#define EVP_CTRL_CCM_SET_MSGLEN 0x15 +/* AEAD cipher deduces payload length and returns number of bytes + * required to store MAC and eventual padding. Subsequent call to + * EVP_Cipher even appends/verifies MAC. + */ +#define EVP_CTRL_AEAD_TLS1_AAD 0x16 +/* Used by composite AEAD ciphers, no-op in GCM, CCM... */ +#define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 +/* Set the GCM invocation field, decrypt only */ +#define EVP_CTRL_GCM_SET_IV_INV 0x18 +/* Set the S-BOX NID for GOST ciphers */ +#define EVP_CTRL_GOST_SET_SBOX 0x19 + +/* GCM TLS constants */ +/* Length of fixed part of IV derived from PRF */ +#define EVP_GCM_TLS_FIXED_IV_LEN 4 +/* Length of explicit part of IV part of TLS records */ +#define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 +/* Length of tag for TLS */ +#define EVP_GCM_TLS_TAG_LEN 16 + +typedef struct evp_cipher_info_st { + const EVP_CIPHER *cipher; + unsigned char iv[EVP_MAX_IV_LENGTH]; +} EVP_CIPHER_INFO; + +/* Password based encryption function */ +typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de); + +#ifndef OPENSSL_NO_RSA +#define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ + (char *)(rsa)) +#endif + +#ifndef OPENSSL_NO_DSA +#define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ + (char *)(dsa)) +#endif + +#ifndef OPENSSL_NO_DH +#define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ + (char *)(dh)) +#endif + +#ifndef OPENSSL_NO_EC +#define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\ + (char *)(eckey)) +#endif + +#ifndef OPENSSL_NO_GOST +#define EVP_PKEY_assign_GOST(pkey,gostkey) EVP_PKEY_assign((pkey),EVP_PKEY_GOSTR01,\ + (char *)(gostkey)) +#endif + +/* Add some extra combinations */ +#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) +#define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) +#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) +#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) + +int EVP_MD_type(const EVP_MD *md); +#define EVP_MD_nid(e) EVP_MD_type(e) +#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) +int EVP_MD_pkey_type(const EVP_MD *md); +int EVP_MD_size(const EVP_MD *md); +int EVP_MD_block_size(const EVP_MD *md); +unsigned long EVP_MD_flags(const EVP_MD *md); + +EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type); +void EVP_MD_meth_free(EVP_MD *md); +EVP_MD *EVP_MD_meth_dup(const EVP_MD *md); +int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize); +int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize); +int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize); +int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags); +int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)); +int EVP_MD_meth_set_update(EVP_MD *md, + int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count)); +int EVP_MD_meth_set_final(EVP_MD *md, + int (*final)(EVP_MD_CTX *ctx, unsigned char *md)); +int EVP_MD_meth_set_copy(EVP_MD *md, + int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from)); +int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)); +int EVP_MD_meth_set_ctrl(EVP_MD *md, + int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)); + +const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); +void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); +EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx); +void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx); +#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) +#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) +#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) + +int EVP_CIPHER_nid(const EVP_CIPHER *cipher); +#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) +int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); +int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); +int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); +unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); +#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) + +const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_get_iv(const EVP_CIPHER_CTX *ctx, + unsigned char *iv, size_t len); +int EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx, + const unsigned char *iv, size_t len); +int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); +void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); +void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); +void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx); +void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data); +unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) +unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE) + +#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) +#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) + +#define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) +#define EVP_SignInit(a,b) EVP_DigestInit(a,b) +#define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) +#define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) +#define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) +#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) +#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) +#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) +#define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) +#define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) + +#define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) +#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) +#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) +#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp) +#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) +#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) + +int EVP_Cipher(EVP_CIPHER_CTX *c, unsigned char *out, const unsigned char *in, + unsigned int inl); + +#define EVP_add_cipher_alias(n,alias) \ + OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) +#define EVP_add_digest_alias(n,alias) \ + OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) +#define EVP_delete_cipher_alias(alias) \ + OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); +#define EVP_delete_digest_alias(alias) \ + OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); + +EVP_MD_CTX *EVP_MD_CTX_new(void); +void EVP_MD_CTX_free(EVP_MD_CTX *ctx); +void EVP_MD_CTX_init(EVP_MD_CTX *ctx); +int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); +EVP_MD_CTX *EVP_MD_CTX_create(void); +void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); +int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); +int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); +void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); +void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); +int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr); +int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); + +int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); +int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); +int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); +int EVP_Digest(const void *data, size_t count, unsigned char *md, + unsigned int *size, const EVP_MD *type, ENGINE *impl); + +int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in); +int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); +int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); + +int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify); +int EVP_read_pw_string_min(char *buf, int minlen, int maxlen, + const char *prompt, int verify); +void EVP_set_pw_prompt(const char *prompt); +char *EVP_get_pw_prompt(void); + +int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, + const unsigned char *salt, const unsigned char *data, int datal, int count, + unsigned char *key, unsigned char *iv); + +void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); +void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); +int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags); + +int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv); +int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const unsigned char *key, const unsigned char *iv); +int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); +#ifndef LIBRESSL_INTERNAL +int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); +#endif + +int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv); +int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const unsigned char *key, const unsigned char *iv); +int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); +#ifndef LIBRESSL_INTERNAL +int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); +#endif + +int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv, int enc); +int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + ENGINE *impl, const unsigned char *key, const unsigned char *iv, int enc); +int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); +#ifndef LIBRESSL_INTERNAL +int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); +#endif + +int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, + EVP_PKEY *pkey); + +int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey); + +int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); +int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen); + +int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen, + const unsigned char *tbs, size_t tbslen); + +int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); +int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen); + +int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, + size_t siglen, const unsigned char *tbs, size_t tbslen); + +int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, + const unsigned char *ek, int ekl, const unsigned char *iv, EVP_PKEY *priv); +int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + +int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, + unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, + int npubk); +int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + +EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void); +void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx); +void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); +int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); +int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); + +void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); +int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); +int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); + +void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); +void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); +int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); +int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); +int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); + +#ifndef OPENSSL_NO_BIO +const BIO_METHOD *BIO_f_md(void); +const BIO_METHOD *BIO_f_base64(void); +const BIO_METHOD *BIO_f_cipher(void); +int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, + const unsigned char *i, int enc); +#endif + +const EVP_MD *EVP_md_null(void); +#ifndef OPENSSL_NO_MD4 +const EVP_MD *EVP_md4(void); +#endif +#ifndef OPENSSL_NO_MD5 +const EVP_MD *EVP_md5(void); +const EVP_MD *EVP_md5_sha1(void); +#endif +#ifndef OPENSSL_NO_SHA +const EVP_MD *EVP_sha1(void); +#endif +#ifndef OPENSSL_NO_SHA256 +const EVP_MD *EVP_sha224(void); +const EVP_MD *EVP_sha256(void); +#endif +#ifndef OPENSSL_NO_SHA512 +const EVP_MD *EVP_sha384(void); +const EVP_MD *EVP_sha512(void); +#endif +#ifndef OPENSSL_NO_SM3 +const EVP_MD *EVP_sm3(void); +#endif +#ifndef OPENSSL_NO_RIPEMD +const EVP_MD *EVP_ripemd160(void); +#endif +#ifndef OPENSSL_NO_WHIRLPOOL +const EVP_MD *EVP_whirlpool(void); +#endif +#ifndef OPENSSL_NO_GOST +const EVP_MD *EVP_gostr341194(void); +const EVP_MD *EVP_gost2814789imit(void); +const EVP_MD *EVP_streebog256(void); +const EVP_MD *EVP_streebog512(void); +#endif +const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ +#ifndef OPENSSL_NO_DES +const EVP_CIPHER *EVP_des_ecb(void); +const EVP_CIPHER *EVP_des_ede(void); +const EVP_CIPHER *EVP_des_ede3(void); +const EVP_CIPHER *EVP_des_ede_ecb(void); +const EVP_CIPHER *EVP_des_ede3_ecb(void); +const EVP_CIPHER *EVP_des_cfb64(void); +# define EVP_des_cfb EVP_des_cfb64 +const EVP_CIPHER *EVP_des_cfb1(void); +const EVP_CIPHER *EVP_des_cfb8(void); +const EVP_CIPHER *EVP_des_ede_cfb64(void); +# define EVP_des_ede_cfb EVP_des_ede_cfb64 +const EVP_CIPHER *EVP_des_ede3_cfb64(void); +# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 +const EVP_CIPHER *EVP_des_ede3_cfb1(void); +const EVP_CIPHER *EVP_des_ede3_cfb8(void); +const EVP_CIPHER *EVP_des_ofb(void); +const EVP_CIPHER *EVP_des_ede_ofb(void); +const EVP_CIPHER *EVP_des_ede3_ofb(void); +const EVP_CIPHER *EVP_des_cbc(void); +const EVP_CIPHER *EVP_des_ede_cbc(void); +const EVP_CIPHER *EVP_des_ede3_cbc(void); +const EVP_CIPHER *EVP_desx_cbc(void); +#endif +#ifndef OPENSSL_NO_RC4 +const EVP_CIPHER *EVP_rc4(void); +const EVP_CIPHER *EVP_rc4_40(void); +#ifndef OPENSSL_NO_MD5 +const EVP_CIPHER *EVP_rc4_hmac_md5(void); +#endif +#endif +#ifndef OPENSSL_NO_IDEA +const EVP_CIPHER *EVP_idea_ecb(void); +const EVP_CIPHER *EVP_idea_cfb64(void); +# define EVP_idea_cfb EVP_idea_cfb64 +const EVP_CIPHER *EVP_idea_ofb(void); +const EVP_CIPHER *EVP_idea_cbc(void); +#endif +#ifndef OPENSSL_NO_RC2 +const EVP_CIPHER *EVP_rc2_ecb(void); +const EVP_CIPHER *EVP_rc2_cbc(void); +const EVP_CIPHER *EVP_rc2_40_cbc(void); +const EVP_CIPHER *EVP_rc2_64_cbc(void); +const EVP_CIPHER *EVP_rc2_cfb64(void); +# define EVP_rc2_cfb EVP_rc2_cfb64 +const EVP_CIPHER *EVP_rc2_ofb(void); +#endif +#ifndef OPENSSL_NO_BF +const EVP_CIPHER *EVP_bf_ecb(void); +const EVP_CIPHER *EVP_bf_cbc(void); +const EVP_CIPHER *EVP_bf_cfb64(void); +# define EVP_bf_cfb EVP_bf_cfb64 +const EVP_CIPHER *EVP_bf_ofb(void); +#endif +#ifndef OPENSSL_NO_CAST +const EVP_CIPHER *EVP_cast5_ecb(void); +const EVP_CIPHER *EVP_cast5_cbc(void); +const EVP_CIPHER *EVP_cast5_cfb64(void); +# define EVP_cast5_cfb EVP_cast5_cfb64 +const EVP_CIPHER *EVP_cast5_ofb(void); +#endif +#ifndef OPENSSL_NO_AES +const EVP_CIPHER *EVP_aes_128_ecb(void); +const EVP_CIPHER *EVP_aes_128_cbc(void); +const EVP_CIPHER *EVP_aes_128_cfb1(void); +const EVP_CIPHER *EVP_aes_128_cfb8(void); +const EVP_CIPHER *EVP_aes_128_cfb128(void); +# define EVP_aes_128_cfb EVP_aes_128_cfb128 +const EVP_CIPHER *EVP_aes_128_ofb(void); +const EVP_CIPHER *EVP_aes_128_ctr(void); +const EVP_CIPHER *EVP_aes_128_ccm(void); +const EVP_CIPHER *EVP_aes_128_gcm(void); +const EVP_CIPHER *EVP_aes_128_wrap(void); +const EVP_CIPHER *EVP_aes_128_xts(void); +const EVP_CIPHER *EVP_aes_192_ecb(void); +const EVP_CIPHER *EVP_aes_192_cbc(void); +const EVP_CIPHER *EVP_aes_192_cfb1(void); +const EVP_CIPHER *EVP_aes_192_cfb8(void); +const EVP_CIPHER *EVP_aes_192_cfb128(void); +# define EVP_aes_192_cfb EVP_aes_192_cfb128 +const EVP_CIPHER *EVP_aes_192_ofb(void); +const EVP_CIPHER *EVP_aes_192_ctr(void); +const EVP_CIPHER *EVP_aes_192_ccm(void); +const EVP_CIPHER *EVP_aes_192_gcm(void); +const EVP_CIPHER *EVP_aes_192_wrap(void); +const EVP_CIPHER *EVP_aes_256_ecb(void); +const EVP_CIPHER *EVP_aes_256_cbc(void); +const EVP_CIPHER *EVP_aes_256_cfb1(void); +const EVP_CIPHER *EVP_aes_256_cfb8(void); +const EVP_CIPHER *EVP_aes_256_cfb128(void); +# define EVP_aes_256_cfb EVP_aes_256_cfb128 +const EVP_CIPHER *EVP_aes_256_ofb(void); +const EVP_CIPHER *EVP_aes_256_ctr(void); +const EVP_CIPHER *EVP_aes_256_ccm(void); +const EVP_CIPHER *EVP_aes_256_gcm(void); +const EVP_CIPHER *EVP_aes_256_wrap(void); +const EVP_CIPHER *EVP_aes_256_xts(void); +#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) +const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); +const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void); +#endif +#endif +#ifndef OPENSSL_NO_CAMELLIA +const EVP_CIPHER *EVP_camellia_128_ecb(void); +const EVP_CIPHER *EVP_camellia_128_cbc(void); +const EVP_CIPHER *EVP_camellia_128_cfb1(void); +const EVP_CIPHER *EVP_camellia_128_cfb8(void); +const EVP_CIPHER *EVP_camellia_128_cfb128(void); +# define EVP_camellia_128_cfb EVP_camellia_128_cfb128 +const EVP_CIPHER *EVP_camellia_128_ofb(void); +const EVP_CIPHER *EVP_camellia_192_ecb(void); +const EVP_CIPHER *EVP_camellia_192_cbc(void); +const EVP_CIPHER *EVP_camellia_192_cfb1(void); +const EVP_CIPHER *EVP_camellia_192_cfb8(void); +const EVP_CIPHER *EVP_camellia_192_cfb128(void); +# define EVP_camellia_192_cfb EVP_camellia_192_cfb128 +const EVP_CIPHER *EVP_camellia_192_ofb(void); +const EVP_CIPHER *EVP_camellia_256_ecb(void); +const EVP_CIPHER *EVP_camellia_256_cbc(void); +const EVP_CIPHER *EVP_camellia_256_cfb1(void); +const EVP_CIPHER *EVP_camellia_256_cfb8(void); +const EVP_CIPHER *EVP_camellia_256_cfb128(void); +# define EVP_camellia_256_cfb EVP_camellia_256_cfb128 +const EVP_CIPHER *EVP_camellia_256_ofb(void); +#endif + +#ifndef OPENSSL_NO_CHACHA +const EVP_CIPHER *EVP_chacha20(void); +#endif + +#ifndef OPENSSL_NO_GOST +const EVP_CIPHER *EVP_gost2814789_ecb(void); +const EVP_CIPHER *EVP_gost2814789_cfb64(void); +const EVP_CIPHER *EVP_gost2814789_cnt(void); +#endif + +#ifndef OPENSSL_NO_SM4 +const EVP_CIPHER *EVP_sm4_ecb(void); +const EVP_CIPHER *EVP_sm4_cbc(void); +const EVP_CIPHER *EVP_sm4_cfb128(void); +#define EVP_sm4_cfb EVP_sm4_cfb128 +const EVP_CIPHER *EVP_sm4_ofb(void); +const EVP_CIPHER *EVP_sm4_ctr(void); +#endif + +void OPENSSL_add_all_algorithms_noconf(void); +void OPENSSL_add_all_algorithms_conf(void); + +#ifdef OPENSSL_LOAD_CONF +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() +#else +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() +#endif + +void OpenSSL_add_all_ciphers(void); +void OpenSSL_add_all_digests(void); + +#define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() +#define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() +#define SSLeay_add_all_digests() OpenSSL_add_all_digests() + +int EVP_add_cipher(const EVP_CIPHER *cipher); +int EVP_add_digest(const EVP_MD *digest); + +const EVP_CIPHER *EVP_get_cipherbyname(const char *name); +const EVP_MD *EVP_get_digestbyname(const char *name); +void EVP_cleanup(void); + +void EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *ciph, const char *from, + const char *to, void *x), void *arg); +void EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *ciph, + const char *from, const char *to, void *x), void *arg); + +void EVP_MD_do_all(void (*fn)(const EVP_MD *ciph, const char *from, + const char *to, void *x), void *arg); +void EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *ciph, const char *from, + const char *to, void *x), void *arg); + +int EVP_PKEY_decrypt_old(unsigned char *dec_key, const unsigned char *enc_key, + int enc_key_len, EVP_PKEY *private_key); +int EVP_PKEY_encrypt_old(unsigned char *enc_key, const unsigned char *key, + int key_len, EVP_PKEY *pub_key); +int EVP_PKEY_type(int type); +int EVP_PKEY_id(const EVP_PKEY *pkey); +int EVP_PKEY_base_id(const EVP_PKEY *pkey); +int EVP_PKEY_bits(const EVP_PKEY *pkey); +int EVP_PKEY_size(const EVP_PKEY *pkey); +int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); +int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); +void *EVP_PKEY_get0(const EVP_PKEY *pkey); +const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); + +#ifndef OPENSSL_NO_RSA +struct rsa_st; +struct rsa_st *EVP_PKEY_get0_RSA(EVP_PKEY *pkey); +struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); +#endif +#ifndef OPENSSL_NO_DSA +struct dsa_st; +struct dsa_st *EVP_PKEY_get0_DSA(EVP_PKEY *pkey); +struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); +#endif +#ifndef OPENSSL_NO_DH +struct dh_st; +struct dh_st *EVP_PKEY_get0_DH(EVP_PKEY *pkey); +struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); +int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); +#endif +#ifndef OPENSSL_NO_EC +struct ec_key_st; +struct ec_key_st *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey); +struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); +int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); +#endif +#ifndef OPENSSL_NO_GOST +struct gost_key_st; +#endif + +EVP_PKEY *EVP_PKEY_new(void); +void EVP_PKEY_free(EVP_PKEY *pkey); +int EVP_PKEY_up_ref(EVP_PKEY *pkey); + +EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); + +EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, + long length); +EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); + +int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); +int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); +int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode); +int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); + +int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); + +int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); +int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); +int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx); + +int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid); + +int EVP_CIPHER_type(const EVP_CIPHER *ctx); + +/* calls methods */ +int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); +int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); + +/* These are used by EVP_CIPHER methods */ +int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); +int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); + +/* PKCS5 password based encryption */ +int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de); +int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, int keylen, + unsigned char *out); +int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, const unsigned char *salt, + int saltlen, int iter, const EVP_MD *digest, int keylen, + unsigned char *out); +int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, + int en_de); + +void PKCS5_PBE_add(void); + +int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, + ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); + +/* PBE type */ + +/* Can appear as the outermost AlgorithmIdentifier */ +#define EVP_PBE_TYPE_OUTER 0x0 +/* Is an PRF type OID */ +#define EVP_PBE_TYPE_PRF 0x1 + +int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid, + EVP_PBE_KEYGEN *keygen); +int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, + EVP_PBE_KEYGEN *keygen); +int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid, + EVP_PBE_KEYGEN **pkeygen); +void EVP_PBE_cleanup(void); + +#define ASN1_PKEY_ALIAS 0x1 +#define ASN1_PKEY_DYNAMIC 0x2 +#define ASN1_PKEY_SIGPARAM_NULL 0x4 + +#define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1 +#define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2 +#define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3 +#define ASN1_PKEY_CTRL_CMS_SIGN 0x5 +#define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7 +#define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8 + +int EVP_PKEY_asn1_get_count(void); +const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); +const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); +const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, + const char *str, int len); +int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth); +int EVP_PKEY_asn1_add_alias(int to, int from); +int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags, + const char **pinfo, const char **ppem_str, + const EVP_PKEY_ASN1_METHOD *ameth); + +const EVP_PKEY_ASN1_METHOD* EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); +EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, + const char *info); +void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, + const EVP_PKEY_ASN1_METHOD *src); +void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth); +void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, + int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub), + int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk), + int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), + int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx), + int (*pkey_size)(const EVP_PKEY *pk), + int (*pkey_bits)(const EVP_PKEY *pk)); +void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, + int (*priv_decode)(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf), + int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk), + int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx)); +void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, + int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, int derlen), + int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder), + int (*param_missing)(const EVP_PKEY *pk), + int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from), + int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), + int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, + ASN1_PCTX *pctx)); + +void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, + void (*pkey_free)(EVP_PKEY *pkey)); +void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)); + +void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_check)(const EVP_PKEY *pk)); +void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_public_check)(const EVP_PKEY *pk)); +void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_check)(const EVP_PKEY *pk)); + +#define EVP_PKEY_OP_UNDEFINED 0 +#define EVP_PKEY_OP_PARAMGEN (1<<1) +#define EVP_PKEY_OP_KEYGEN (1<<2) +#define EVP_PKEY_OP_SIGN (1<<3) +#define EVP_PKEY_OP_VERIFY (1<<4) +#define EVP_PKEY_OP_VERIFYRECOVER (1<<5) +#define EVP_PKEY_OP_SIGNCTX (1<<6) +#define EVP_PKEY_OP_VERIFYCTX (1<<7) +#define EVP_PKEY_OP_ENCRYPT (1<<8) +#define EVP_PKEY_OP_DECRYPT (1<<9) +#define EVP_PKEY_OP_DERIVE (1<<10) + +#define EVP_PKEY_OP_TYPE_SIG \ + (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \ + | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX) + +#define EVP_PKEY_OP_TYPE_CRYPT \ + (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) + +#define EVP_PKEY_OP_TYPE_NOGEN \ + (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE) + +#define EVP_PKEY_OP_TYPE_GEN \ + (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN) + +#define EVP_PKEY_CTX_set_signature_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \ + EVP_PKEY_CTRL_MD, 0, (void *)md) + +#define EVP_PKEY_CTX_get_signature_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \ + EVP_PKEY_CTRL_GET_MD, 0, (void *)(pmd)) + +#define EVP_PKEY_CTRL_MD 1 +#define EVP_PKEY_CTRL_PEER_KEY 2 + +#define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3 +#define EVP_PKEY_CTRL_PKCS7_DECRYPT 4 + +#define EVP_PKEY_CTRL_PKCS7_SIGN 5 + +#define EVP_PKEY_CTRL_SET_MAC_KEY 6 + +#define EVP_PKEY_CTRL_DIGESTINIT 7 + +/* Used by GOST key encryption in TLS */ +#define EVP_PKEY_CTRL_SET_IV 8 + +#define EVP_PKEY_CTRL_CMS_ENCRYPT 9 +#define EVP_PKEY_CTRL_CMS_DECRYPT 10 +#define EVP_PKEY_CTRL_CMS_SIGN 11 + +#define EVP_PKEY_CTRL_CIPHER 12 + +#define EVP_PKEY_CTRL_GET_MD 13 + +#define EVP_PKEY_ALG_CTRL 0x1000 + + +#define EVP_PKEY_FLAG_AUTOARGLEN 2 +/* Method handles all operations: don't assume any digest related + * defaults. + */ +#define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 + +const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); +EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags); +void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, + const EVP_PKEY_METHOD *meth); +void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src); +void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); +int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); + +EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); +EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e); +EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx); +void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, + int p1, void *p2); +int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, + const char *value); + +int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); +void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); + +EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, const unsigned char *key, + int keylen); +EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, + size_t len, const EVP_CIPHER *cipher); + +void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); +void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); +EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); + +EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx); + +void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data); +void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen); +int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen); +int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, unsigned char *rout, + size_t *routlen, const unsigned char *sig, size_t siglen); +int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); +int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); + +int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); +int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); + +typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +int EVP_PKEY_check(EVP_PKEY_CTX *ctx); +int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx); +int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx); + +void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); +EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); + +void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, + int (*init)(EVP_PKEY_CTX *ctx)); + +void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, + int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); + +void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, + void (*cleanup)(EVP_PKEY_CTX *ctx)); + +void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, + int (*paramgen_init)(EVP_PKEY_CTX *ctx), + int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); + +void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, + int (*keygen_init)(EVP_PKEY_CTX *ctx), + int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); + +void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, + int (*sign_init)(EVP_PKEY_CTX *ctx), + int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); + +void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, + int (*verify_init)(EVP_PKEY_CTX *ctx), + int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen)); + +void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, + int (*verify_recover_init)(EVP_PKEY_CTX *ctx), + int (*verify_recover)(EVP_PKEY_CTX *ctx, unsigned char *sig, + size_t *siglen, const unsigned char *tbs, size_t tbslen)); + +void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, + int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), + int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + EVP_MD_CTX *mctx)); + +void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, + int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), + int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, + EVP_MD_CTX *mctx)); + +void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, + int (*encrypt_init)(EVP_PKEY_CTX *ctx), + int (*encryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); + +void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, + int (*decrypt_init)(EVP_PKEY_CTX *ctx), + int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); + +void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, + int (*derive_init)(EVP_PKEY_CTX *ctx), + int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); + +void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, + int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2), + int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value)); + +void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, + int (*check)(EVP_PKEY *pkey)); +void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth, + int (*public_check)(EVP_PKEY *pkey)); +void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth, + int (*param_check)(EVP_PKEY *pkey)); + +/* Authenticated Encryption with Additional Data. + * + * AEAD couples confidentiality and integrity in a single primtive. AEAD + * algorithms take a key and then can seal and open individual messages. Each + * message has a unique, per-message nonce and, optionally, additional data + * which is authenticated but not included in the output. */ + +typedef struct evp_aead_st EVP_AEAD; + +#ifndef OPENSSL_NO_AES +/* EVP_aes_128_gcm is AES-128 in Galois Counter Mode. */ +const EVP_AEAD *EVP_aead_aes_128_gcm(void); +/* EVP_aes_256_gcm is AES-256 in Galois Counter Mode. */ +const EVP_AEAD *EVP_aead_aes_256_gcm(void); +#endif + +#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) +/* EVP_aead_chacha20_poly1305 is ChaCha20 with a Poly1305 authenticator. */ +const EVP_AEAD *EVP_aead_chacha20_poly1305(void); +/* EVP_aead_xchacha20_poly1305 is XChaCha20 with a Poly1305 authenticator. */ +const EVP_AEAD *EVP_aead_xchacha20_poly1305(void); +#endif + +/* EVP_AEAD_key_length returns the length of the keys used. */ +size_t EVP_AEAD_key_length(const EVP_AEAD *aead); + +/* EVP_AEAD_nonce_length returns the length of the per-message nonce. */ +size_t EVP_AEAD_nonce_length(const EVP_AEAD *aead); + +/* EVP_AEAD_max_overhead returns the maximum number of additional bytes added + * by the act of sealing data with the AEAD. */ +size_t EVP_AEAD_max_overhead(const EVP_AEAD *aead); + +/* EVP_AEAD_max_tag_len returns the maximum tag length when using this AEAD. + * This * is the largest value that can be passed as a tag length to + * EVP_AEAD_CTX_init. */ +size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead); + +/* An EVP_AEAD_CTX represents an AEAD algorithm configured with a specific key + * and message-independent IV. */ +typedef struct evp_aead_ctx_st EVP_AEAD_CTX; + +/* EVP_AEAD_MAX_TAG_LENGTH is the maximum tag length used by any AEAD + * defined in this header. */ +#define EVP_AEAD_MAX_TAG_LENGTH 16 + +/* EVP_AEAD_DEFAULT_TAG_LENGTH is a magic value that can be passed to + * EVP_AEAD_CTX_init to indicate that the default tag length for an AEAD + * should be used. */ +#define EVP_AEAD_DEFAULT_TAG_LENGTH 0 + +/* EVP_AEAD_CTX_new allocates a new context for use with EVP_AEAD_CTX_init. + * It can be cleaned up for reuse with EVP_AEAD_CTX_cleanup and must be freed + * with EVP_AEAD_CTX_free. */ +EVP_AEAD_CTX *EVP_AEAD_CTX_new(void); + +/* EVP_AEAD_CTX_free releases all memory owned by the context. */ +void EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx); + +/* EVP_AEAD_CTX_init initializes the context for the given AEAD algorithm. + * The implementation argument may be NULL to choose the default implementation. + * Authentication tags may be truncated by passing a tag length. A tag length + * of zero indicates the default tag length should be used. */ +int EVP_AEAD_CTX_init(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead, + const unsigned char *key, size_t key_len, size_t tag_len, ENGINE *impl); + +/* EVP_AEAD_CTX_cleanup frees any data allocated for this context. */ +void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx); + +/* EVP_AEAD_CTX_seal encrypts and authenticates the input and authenticates + * any additional data (AD), the result being written as output. One is + * returned on success, otherwise zero. + * + * This function may be called (with the same EVP_AEAD_CTX) concurrently with + * itself or EVP_AEAD_CTX_open. + * + * At most max_out_len bytes are written as output and, in order to ensure + * success, this value should be the length of the input plus the result of + * EVP_AEAD_overhead. On successful return, out_len is set to the actual + * number of bytes written. + * + * The length of the nonce is must be equal to the result of + * EVP_AEAD_nonce_length for this AEAD. + * + * EVP_AEAD_CTX_seal never results in a partial output. If max_out_len is + * insufficient, zero will be returned and out_len will be set to zero. + * + * If the input and output are aliased then out must be <= in. */ +int EVP_AEAD_CTX_seal(const EVP_AEAD_CTX *ctx, unsigned char *out, + size_t *out_len, size_t max_out_len, const unsigned char *nonce, + size_t nonce_len, const unsigned char *in, size_t in_len, + const unsigned char *ad, size_t ad_len); + +/* EVP_AEAD_CTX_open authenticates the input and additional data, decrypting + * the input and writing it as output. One is returned on success, otherwise + * zero. + * + * This function may be called (with the same EVP_AEAD_CTX) concurrently with + * itself or EVP_AEAD_CTX_seal. + * + * At most the number of input bytes are written as output. In order to ensure + * success, max_out_len should be at least the same as the input length. On + * successful return out_len is set to the actual number of bytes written. + * + * The length of nonce must be equal to the result of EVP_AEAD_nonce_length + * for this AEAD. + * + * EVP_AEAD_CTX_open never results in a partial output. If max_out_len is + * insufficient, zero will be returned and out_len will be set to zero. + * + * If the input and output are aliased then out must be <= in. */ +int EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, unsigned char *out, + size_t *out_len, size_t max_out_len, const unsigned char *nonce, + size_t nonce_len, const unsigned char *in, size_t in_len, + const unsigned char *ad, size_t ad_len); + +void EVP_add_alg_module(void); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_EVP_strings(void); + +/* Error codes for the EVP functions. */ + +/* Function codes. */ +#define EVP_F_AEAD_AES_GCM_INIT 187 +#define EVP_F_AEAD_AES_GCM_OPEN 188 +#define EVP_F_AEAD_AES_GCM_SEAL 189 +#define EVP_F_AEAD_CHACHA20_POLY1305_INIT 192 +#define EVP_F_AEAD_CHACHA20_POLY1305_OPEN 193 +#define EVP_F_AEAD_CHACHA20_POLY1305_SEAL 194 +#define EVP_F_AEAD_CTX_OPEN 185 +#define EVP_F_AEAD_CTX_SEAL 186 +#define EVP_F_AESNI_INIT_KEY 165 +#define EVP_F_AESNI_XTS_CIPHER 176 +#define EVP_F_AES_INIT_KEY 133 +#define EVP_F_AES_XTS 172 +#define EVP_F_AES_XTS_CIPHER 175 +#define EVP_F_ALG_MODULE_INIT 177 +#define EVP_F_CAMELLIA_INIT_KEY 159 +#define EVP_F_CMAC_INIT 173 +#define EVP_F_D2I_PKEY 100 +#define EVP_F_DO_SIGVER_INIT 161 +#define EVP_F_DSAPKEY2PKCS8 134 +#define EVP_F_DSA_PKEY2PKCS8 135 +#define EVP_F_ECDSA_PKEY2PKCS8 129 +#define EVP_F_ECKEY_PKEY2PKCS8 132 +#define EVP_F_EVP_AEAD_CTX_INIT 180 +#define EVP_F_EVP_AEAD_CTX_OPEN 190 +#define EVP_F_EVP_AEAD_CTX_SEAL 191 +#define EVP_F_EVP_BYTESTOKEY 200 +#define EVP_F_EVP_CIPHERINIT_EX 123 +#define EVP_F_EVP_CIPHER_CTX_COPY 163 +#define EVP_F_EVP_CIPHER_CTX_CTRL 124 +#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 +#define EVP_F_EVP_CIPHER_GET_ASN1_IV 201 +#define EVP_F_EVP_CIPHER_SET_ASN1_IV 202 +#define EVP_F_EVP_DECRYPTFINAL_EX 101 +#define EVP_F_EVP_DECRYPTUPDATE 199 +#define EVP_F_EVP_DIGESTFINAL_EX 196 +#define EVP_F_EVP_DIGESTINIT_EX 128 +#define EVP_F_EVP_ENCRYPTFINAL_EX 127 +#define EVP_F_EVP_ENCRYPTUPDATE 198 +#define EVP_F_EVP_MD_CTX_COPY_EX 110 +#define EVP_F_EVP_MD_CTX_CTRL 195 +#define EVP_F_EVP_MD_SIZE 162 +#define EVP_F_EVP_OPENINIT 102 +#define EVP_F_EVP_PBE_ALG_ADD 115 +#define EVP_F_EVP_PBE_ALG_ADD_TYPE 160 +#define EVP_F_EVP_PBE_CIPHERINIT 116 +#define EVP_F_EVP_PKCS82PKEY 111 +#define EVP_F_EVP_PKCS82PKEY_BROKEN 136 +#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113 +#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 +#define EVP_F_EVP_PKEY_CTX_CTRL 137 +#define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 +#define EVP_F_EVP_PKEY_CTX_DUP 156 +#define EVP_F_EVP_PKEY_DECRYPT 104 +#define EVP_F_EVP_PKEY_DECRYPT_INIT 138 +#define EVP_F_EVP_PKEY_DECRYPT_OLD 151 +#define EVP_F_EVP_PKEY_DERIVE 153 +#define EVP_F_EVP_PKEY_DERIVE_INIT 154 +#define EVP_F_EVP_PKEY_DERIVE_SET_PEER 155 +#define EVP_F_EVP_PKEY_ENCRYPT 105 +#define EVP_F_EVP_PKEY_ENCRYPT_INIT 139 +#define EVP_F_EVP_PKEY_ENCRYPT_OLD 152 +#define EVP_F_EVP_PKEY_GET1_DH 119 +#define EVP_F_EVP_PKEY_GET1_DSA 120 +#define EVP_F_EVP_PKEY_GET1_ECDSA 130 +#define EVP_F_EVP_PKEY_GET1_EC_KEY 131 +#define EVP_F_EVP_PKEY_GET1_RSA 121 +#define EVP_F_EVP_PKEY_KEYGEN 146 +#define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +#define EVP_F_EVP_PKEY_NEW 106 +#define EVP_F_EVP_PKEY_PARAMGEN 148 +#define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 +#define EVP_F_EVP_PKEY_SIGN 140 +#define EVP_F_EVP_PKEY_SIGN_INIT 141 +#define EVP_F_EVP_PKEY_VERIFY 142 +#define EVP_F_EVP_PKEY_VERIFY_INIT 143 +#define EVP_F_EVP_PKEY_VERIFY_RECOVER 144 +#define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 145 +#define EVP_F_EVP_RIJNDAEL 126 +#define EVP_F_EVP_SIGNFINAL 107 +#define EVP_F_EVP_VERIFYFINAL 108 +#define EVP_F_FIPS_CIPHERINIT 166 +#define EVP_F_FIPS_CIPHER_CTX_COPY 170 +#define EVP_F_FIPS_CIPHER_CTX_CTRL 167 +#define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171 +#define EVP_F_FIPS_DIGESTINIT 168 +#define EVP_F_FIPS_MD_CTX_COPY 169 +#define EVP_F_HMAC_INIT_EX 174 +#define EVP_F_INT_CTX_NEW 157 +#define EVP_F_PKCS5_PBE_KEYIVGEN 117 +#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 +#define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164 +#define EVP_F_PKCS8_SET_BROKEN 112 +#define EVP_F_PKEY_SET_TYPE 158 +#define EVP_F_RC2_GET_ASN1_TYPE_AND_IV 197 +#define EVP_F_RC2_MAGIC_TO_METH 109 +#define EVP_F_RC5_CTRL 125 + +/* Reason codes. */ +#define EVP_R_AES_IV_SETUP_FAILED 162 +#define EVP_R_AES_KEY_SETUP_FAILED 143 +#define EVP_R_ASN1_LIB 140 +#define EVP_R_BAD_BLOCK_LENGTH 136 +#define EVP_R_BAD_DECRYPT 100 +#define EVP_R_BAD_KEY_LENGTH 137 +#define EVP_R_BN_DECODE_ERROR 112 +#define EVP_R_BN_PUBKEY_ERROR 113 +#define EVP_R_BUFFER_TOO_SMALL 155 +#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157 +#define EVP_R_CIPHER_PARAMETER_ERROR 122 +#define EVP_R_COMMAND_NOT_SUPPORTED 147 +#define EVP_R_CTRL_NOT_IMPLEMENTED 132 +#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 +#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 +#define EVP_R_DECODE_ERROR 114 +#define EVP_R_DIFFERENT_KEY_TYPES 101 +#define EVP_R_DIFFERENT_PARAMETERS 153 +#define EVP_R_DISABLED_FOR_FIPS 163 +#define EVP_R_ENCODE_ERROR 115 +#define EVP_R_ERROR_LOADING_SECTION 165 +#define EVP_R_ERROR_SETTING_FIPS_MODE 166 +#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 +#define EVP_R_EXPECTING_AN_HMAC_KEY 174 +#define EVP_R_EXPECTING_AN_RSA_KEY 127 +#define EVP_R_EXPECTING_A_DH_KEY 128 +#define EVP_R_EXPECTING_A_DSA_KEY 129 +#define EVP_R_EXPECTING_A_ECDSA_KEY 141 +#define EVP_R_EXPECTING_A_EC_KEY 142 +#define EVP_R_FIPS_MODE_NOT_SUPPORTED 167 +#define EVP_R_INITIALIZATION_ERROR 134 +#define EVP_R_INPUT_NOT_INITIALIZED 111 +#define EVP_R_INVALID_DIGEST 152 +#define EVP_R_INVALID_FIPS_MODE 168 +#define EVP_R_INVALID_IV_LENGTH 194 +#define EVP_R_INVALID_KEY_LENGTH 130 +#define EVP_R_INVALID_OPERATION 148 +#define EVP_R_IV_TOO_LARGE 102 +#define EVP_R_KEYGEN_FAILURE 120 +#define EVP_R_KEY_SETUP_FAILED 180 +#define EVP_R_MESSAGE_DIGEST_IS_NULL 159 +#define EVP_R_METHOD_NOT_SUPPORTED 144 +#define EVP_R_MISSING_PARAMETERS 103 +#define EVP_R_NO_CIPHER_SET 131 +#define EVP_R_NO_DEFAULT_DIGEST 158 +#define EVP_R_NO_DIGEST_SET 139 +#define EVP_R_NO_DSA_PARAMETERS 116 +#define EVP_R_NO_KEY_SET 154 +#define EVP_R_NO_OPERATION_SET 149 +#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 +#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 +#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 +#define EVP_R_OPERATON_NOT_INITIALIZED 151 +#define EVP_R_OUTPUT_ALIASES_INPUT 172 +#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 +#define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 +#define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 +#define EVP_R_PUBLIC_KEY_NOT_RSA 106 +#define EVP_R_TAG_TOO_LARGE 171 +#define EVP_R_TOO_LARGE 164 +#define EVP_R_UNKNOWN_CIPHER 160 +#define EVP_R_UNKNOWN_DIGEST 161 +#define EVP_R_UNKNOWN_OPTION 169 +#define EVP_R_UNKNOWN_PBE_ALGORITHM 121 +#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135 +#define EVP_R_UNSUPPORTED_ALGORITHM 156 +#define EVP_R_UNSUPPORTED_CIPHER 107 +#define EVP_R_UNSUPPORTED_KEYLENGTH 123 +#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 +#define EVP_R_UNSUPPORTED_KEY_SIZE 108 +#define EVP_R_UNSUPPORTED_PRF 125 +#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 +#define EVP_R_WRAP_MODE_NOT_ALLOWED 170 +#define EVP_R_UNSUPPORTED_SALT_TYPE 126 +#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 +#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/gost.h b/code/contrib/libfido2/include/openssl/gost.h new file mode 100644 index 0000000..092f96f --- /dev/null +++ b/code/contrib/libfido2/include/openssl/gost.h @@ -0,0 +1,266 @@ +/* $OpenBSD: gost.h,v 1.3 2016/09/04 17:02:31 jsing Exp $ */ +/* + * Copyright (c) 2014 Dmitry Eremin-Solenikov + * Copyright (c) 2005-2006 Cryptocom LTD + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + +#ifndef HEADER_GOST_H +#define HEADER_GOST_H + +#include + +#ifdef OPENSSL_NO_GOST +#error GOST is disabled. +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct gost2814789_key_st { + unsigned int key[8]; + unsigned int k87[256],k65[256],k43[256],k21[256]; + unsigned int count; + unsigned key_meshing : 1; +} GOST2814789_KEY; + +int Gost2814789_set_sbox(GOST2814789_KEY *key, int nid); +int Gost2814789_set_key(GOST2814789_KEY *key, + const unsigned char *userKey, const int bits); +void Gost2814789_ecb_encrypt(const unsigned char *in, unsigned char *out, + GOST2814789_KEY *key, const int enc); +void Gost2814789_cfb64_encrypt(const unsigned char *in, unsigned char *out, + size_t length, GOST2814789_KEY *key, + unsigned char *ivec, int *num, const int enc); +void Gost2814789_cnt_encrypt(const unsigned char *in, unsigned char *out, + size_t length, GOST2814789_KEY *key, + unsigned char *ivec, unsigned char *cnt_buf, int *num); + +typedef struct { + ASN1_OCTET_STRING *iv; + ASN1_OBJECT *enc_param_set; +} GOST_CIPHER_PARAMS; + +GOST_CIPHER_PARAMS *GOST_CIPHER_PARAMS_new(void); +void GOST_CIPHER_PARAMS_free(GOST_CIPHER_PARAMS *a); +GOST_CIPHER_PARAMS *d2i_GOST_CIPHER_PARAMS(GOST_CIPHER_PARAMS **a, const unsigned char **in, long len); +int i2d_GOST_CIPHER_PARAMS(GOST_CIPHER_PARAMS *a, unsigned char **out); +extern const ASN1_ITEM GOST_CIPHER_PARAMS_it; + +#define GOST2814789IMIT_LENGTH 4 +#define GOST2814789IMIT_CBLOCK 8 +#define GOST2814789IMIT_LONG unsigned int + +typedef struct GOST2814789IMITstate_st { + GOST2814789IMIT_LONG Nl, Nh; + unsigned char data[GOST2814789IMIT_CBLOCK]; + unsigned int num; + + GOST2814789_KEY cipher; + unsigned char mac[GOST2814789IMIT_CBLOCK]; +} GOST2814789IMIT_CTX; + +/* Note, also removed second parameter and removed dctx->cipher setting */ +int GOST2814789IMIT_Init(GOST2814789IMIT_CTX *c, int nid); +int GOST2814789IMIT_Update(GOST2814789IMIT_CTX *c, const void *data, size_t len); +int GOST2814789IMIT_Final(unsigned char *md, GOST2814789IMIT_CTX *c); +void GOST2814789IMIT_Transform(GOST2814789IMIT_CTX *c, const unsigned char *data); +unsigned char *GOST2814789IMIT(const unsigned char *d, size_t n, + unsigned char *md, int nid, + const unsigned char *key, const unsigned char *iv); + +#define GOSTR341194_LONG unsigned int + +#define GOSTR341194_LENGTH 32 +#define GOSTR341194_CBLOCK 32 +#define GOSTR341194_LBLOCK (GOSTR341194_CBLOCK/4) + +typedef struct GOSTR341194state_st { + GOSTR341194_LONG Nl, Nh; + GOSTR341194_LONG data[GOSTR341194_LBLOCK]; + unsigned int num; + + GOST2814789_KEY cipher; + unsigned char H[GOSTR341194_CBLOCK]; + unsigned char S[GOSTR341194_CBLOCK]; +} GOSTR341194_CTX; + +/* Note, also removed second parameter and removed dctx->cipher setting */ +int GOSTR341194_Init(GOSTR341194_CTX *c, int nid); +int GOSTR341194_Update(GOSTR341194_CTX *c, const void *data, size_t len); +int GOSTR341194_Final(unsigned char *md, GOSTR341194_CTX *c); +void GOSTR341194_Transform(GOSTR341194_CTX *c, const unsigned char *data); +unsigned char *GOSTR341194(const unsigned char *d, size_t n,unsigned char *md, int nid); + +#if defined(_LP64) +#define STREEBOG_LONG64 unsigned long +#define U64(C) C##UL +#else +#define STREEBOG_LONG64 unsigned long long +#define U64(C) C##ULL +#endif + +#define STREEBOG_LBLOCK 8 +#define STREEBOG_CBLOCK 64 +#define STREEBOG256_LENGTH 32 +#define STREEBOG512_LENGTH 64 + +typedef struct STREEBOGstate_st { + STREEBOG_LONG64 data[STREEBOG_LBLOCK]; + unsigned int num; + unsigned int md_len; + STREEBOG_LONG64 h[STREEBOG_LBLOCK]; + STREEBOG_LONG64 N[STREEBOG_LBLOCK]; + STREEBOG_LONG64 Sigma[STREEBOG_LBLOCK]; +} STREEBOG_CTX; + +int STREEBOG256_Init(STREEBOG_CTX *c); +int STREEBOG256_Update(STREEBOG_CTX *c, const void *data, size_t len); +int STREEBOG256_Final(unsigned char *md, STREEBOG_CTX *c); +void STREEBOG256_Transform(STREEBOG_CTX *c, const unsigned char *data); +unsigned char *STREEBOG256(const unsigned char *d, size_t n,unsigned char *md); + +int STREEBOG512_Init(STREEBOG_CTX *c); +int STREEBOG512_Update(STREEBOG_CTX *c, const void *data, size_t len); +int STREEBOG512_Final(unsigned char *md, STREEBOG_CTX *c); +void STREEBOG512_Transform(STREEBOG_CTX *c, const unsigned char *data); +unsigned char *STREEBOG512(const unsigned char *d, size_t n,unsigned char *md); + +typedef struct gost_key_st GOST_KEY; +GOST_KEY *GOST_KEY_new(void); +void GOST_KEY_free(GOST_KEY * r); +int GOST_KEY_check_key(const GOST_KEY * eckey); +int GOST_KEY_set_public_key_affine_coordinates(GOST_KEY * key, BIGNUM * x, BIGNUM * y); +const EC_GROUP * GOST_KEY_get0_group(const GOST_KEY * key); +int GOST_KEY_set_group(GOST_KEY * key, const EC_GROUP * group); +int GOST_KEY_get_digest(const GOST_KEY * key); +int GOST_KEY_set_digest(GOST_KEY * key, int digest_nid); +const BIGNUM * GOST_KEY_get0_private_key(const GOST_KEY * key); +int GOST_KEY_set_private_key(GOST_KEY * key, const BIGNUM * priv_key); +const EC_POINT * GOST_KEY_get0_public_key(const GOST_KEY * key); +int GOST_KEY_set_public_key(GOST_KEY * key, const EC_POINT * pub_key); +size_t GOST_KEY_get_size(const GOST_KEY * r); + +/* Gost-specific pmeth control-function parameters */ +/* For GOST R34.10 parameters */ +#define EVP_PKEY_CTRL_GOST_PARAMSET (EVP_PKEY_ALG_CTRL+1) +#define EVP_PKEY_CTRL_GOST_SIG_FORMAT (EVP_PKEY_ALG_CTRL+2) +#define EVP_PKEY_CTRL_GOST_SET_DIGEST (EVP_PKEY_ALG_CTRL+3) +#define EVP_PKEY_CTRL_GOST_GET_DIGEST (EVP_PKEY_ALG_CTRL+4) + +#define GOST_SIG_FORMAT_SR_BE 0 +#define GOST_SIG_FORMAT_RS_LE 1 + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_GOST_strings(void); + +/* Error codes for the GOST functions. */ + +/* Function codes. */ +#define GOST_F_DECODE_GOST01_ALGOR_PARAMS 104 +#define GOST_F_ENCODE_GOST01_ALGOR_PARAMS 105 +#define GOST_F_GOST2001_COMPUTE_PUBLIC 106 +#define GOST_F_GOST2001_DO_SIGN 107 +#define GOST_F_GOST2001_DO_VERIFY 108 +#define GOST_F_GOST2001_KEYGEN 109 +#define GOST_F_GOST89_GET_ASN1_PARAMETERS 102 +#define GOST_F_GOST89_SET_ASN1_PARAMETERS 103 +#define GOST_F_GOST_KEY_CHECK_KEY 124 +#define GOST_F_GOST_KEY_NEW 125 +#define GOST_F_GOST_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 126 +#define GOST_F_PARAM_COPY_GOST01 110 +#define GOST_F_PARAM_DECODE_GOST01 111 +#define GOST_F_PKEY_GOST01_CTRL 116 +#define GOST_F_PKEY_GOST01_DECRYPT 112 +#define GOST_F_PKEY_GOST01_DERIVE 113 +#define GOST_F_PKEY_GOST01_ENCRYPT 114 +#define GOST_F_PKEY_GOST01_PARAMGEN 115 +#define GOST_F_PKEY_GOST01_SIGN 123 +#define GOST_F_PKEY_GOST_MAC_CTRL 100 +#define GOST_F_PKEY_GOST_MAC_KEYGEN 101 +#define GOST_F_PRIV_DECODE_GOST01 117 +#define GOST_F_PUB_DECODE_GOST01 118 +#define GOST_F_PUB_ENCODE_GOST01 119 +#define GOST_F_PUB_PRINT_GOST01 120 +#define GOST_F_UNPACK_SIGNATURE_CP 121 +#define GOST_F_UNPACK_SIGNATURE_LE 122 + +/* Reason codes. */ +#define GOST_R_BAD_KEY_PARAMETERS_FORMAT 104 +#define GOST_R_BAD_PKEY_PARAMETERS_FORMAT 105 +#define GOST_R_CANNOT_PACK_EPHEMERAL_KEY 106 +#define GOST_R_CTRL_CALL_FAILED 107 +#define GOST_R_ERROR_COMPUTING_SHARED_KEY 108 +#define GOST_R_ERROR_PARSING_KEY_TRANSPORT_INFO 109 +#define GOST_R_INCOMPATIBLE_ALGORITHMS 110 +#define GOST_R_INCOMPATIBLE_PEER_KEY 111 +#define GOST_R_INVALID_DIGEST_TYPE 100 +#define GOST_R_INVALID_IV_LENGTH 103 +#define GOST_R_INVALID_MAC_KEY_LENGTH 101 +#define GOST_R_KEY_IS_NOT_INITIALIZED 112 +#define GOST_R_KEY_PARAMETERS_MISSING 113 +#define GOST_R_MAC_KEY_NOT_SET 102 +#define GOST_R_NO_PARAMETERS_SET 115 +#define GOST_R_NO_PEER_KEY 116 +#define GOST_R_NO_PRIVATE_PART_OF_NON_EPHEMERAL_KEYPAIR 117 +#define GOST_R_PUBLIC_KEY_UNDEFINED 118 +#define GOST_R_RANDOM_NUMBER_GENERATOR_FAILED 120 +#define GOST_R_SIGNATURE_MISMATCH 121 +#define GOST_R_SIGNATURE_PARTS_GREATER_THAN_Q 122 +#define GOST_R_UKM_NOT_SET 123 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/hkdf.h b/code/contrib/libfido2/include/openssl/hkdf.h new file mode 100644 index 0000000..34450f9 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/hkdf.h @@ -0,0 +1,65 @@ +/* $OpenBSD: hkdf.h,v 1.2 2018/04/03 13:33:53 tb Exp $ */ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HKDF_H +#define OPENSSL_HEADER_HKDF_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * HKDF computes HKDF (as specified by RFC 5869) of initial keying + * material |secret| with |salt| and |info| using |digest|, and + * outputs |out_len| bytes to |out_key|. It returns one on success and + * zero on error. + * + * HKDF is an Extract-and-Expand algorithm. It does not do any key + * stretching, and as such, is not suited to be used alone to generate + * a key from a password. + */ + +int HKDF(uint8_t *out_key, size_t out_len, const struct env_md_st *digest, + const uint8_t *secret, size_t secret_len, const uint8_t *salt, + size_t salt_len, const uint8_t *info, size_t info_len); + +/* + * HKDF_extract computes a HKDF PRK (as specified by RFC 5869) from + * initial keying material |secret| and salt |salt| using |digest|, + * and outputs |out_len| bytes to |out_key|. The maximum output size + * is |EVP_MAX_MD_SIZE|. It returns one on success and zero on error. + */ +int HKDF_extract(uint8_t *out_key, size_t *out_len, + const struct env_md_st *digest, const uint8_t *secret, + size_t secret_len, const uint8_t *salt, size_t salt_len); + +/* + * HKDF_expand computes a HKDF OKM (as specified by RFC 5869) of + * length |out_len| from the PRK |prk| and info |info| using |digest|, + * and outputs the result to |out_key|. It returns one on success and + * zero on error. + */ +int HKDF_expand(uint8_t *out_key, size_t out_len, + const EVP_MD *digest, const uint8_t *prk, size_t prk_len, + const uint8_t *info, size_t info_len); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_HKDF_H */ diff --git a/code/contrib/libfido2/include/openssl/hmac.h b/code/contrib/libfido2/include/openssl/hmac.h new file mode 100644 index 0000000..ff01ae2 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/hmac.h @@ -0,0 +1,98 @@ +/* $OpenBSD: hmac.h,v 1.16 2022/01/14 08:06:03 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +#ifndef HEADER_HMAC_H +#define HEADER_HMAC_H + +#include + +#ifdef OPENSSL_NO_HMAC +#error HMAC is disabled. +#endif + +#include + +#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define HMAC_size(e) (EVP_MD_size(HMAC_CTX_get_md((e)))) + +HMAC_CTX *HMAC_CTX_new(void); +void HMAC_CTX_free(HMAC_CTX *ctx); +int HMAC_CTX_reset(HMAC_CTX *ctx); + +int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md); /* deprecated */ +int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, + ENGINE *impl); +int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); +int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); +unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, + const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len); +int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); + +void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); +const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/idea.h b/code/contrib/libfido2/include/openssl/idea.h new file mode 100644 index 0000000..f76bcae --- /dev/null +++ b/code/contrib/libfido2/include/openssl/idea.h @@ -0,0 +1,100 @@ +/* $OpenBSD: idea.h,v 1.10 2014/06/12 15:49:29 deraadt Exp $ */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_IDEA_H +#define HEADER_IDEA_H + +#include /* IDEA_INT, OPENSSL_NO_IDEA */ + +#ifdef OPENSSL_NO_IDEA +#error IDEA is disabled. +#endif + +#define IDEA_ENCRYPT 1 +#define IDEA_DECRYPT 0 + +#define IDEA_BLOCK 8 +#define IDEA_KEY_LENGTH 16 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct idea_key_st + { + IDEA_INT data[9][6]; + } IDEA_KEY_SCHEDULE; + +const char *idea_options(void); +void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, + IDEA_KEY_SCHEDULE *ks); +void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); +void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); +void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, + long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc); +void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, + int *num,int enc); +void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); +void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/lhash.h b/code/contrib/libfido2/include/openssl/lhash.h new file mode 100644 index 0000000..9c63657 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/lhash.h @@ -0,0 +1,235 @@ +/* $OpenBSD: lhash.h,v 1.12 2014/06/12 15:49:29 deraadt Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +/* Header for dynamic hash table routines + * Author - Eric Young + */ + +#ifndef HEADER_LHASH_H +#define HEADER_LHASH_H + +#include + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct lhash_node_st { + void *data; + struct lhash_node_st *next; +#ifndef OPENSSL_NO_HASH_COMP + unsigned long hash; +#endif +} LHASH_NODE; + +typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); +typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); +typedef void (*LHASH_DOALL_FN_TYPE)(void *); +typedef void (*LHASH_DOALL_ARG_FN_TYPE)(void *, void *); + +/* Macros for declaring and implementing type-safe wrappers for LHASH callbacks. + * This way, callbacks can be provided to LHASH structures without function + * pointer casting and the macro-defined callbacks provide per-variable casting + * before deferring to the underlying type-specific callbacks. NB: It is + * possible to place a "static" in front of both the DECLARE and IMPLEMENT + * macros if the functions are strictly internal. */ + +/* First: "hash" functions */ +#define DECLARE_LHASH_HASH_FN(name, o_type) \ + unsigned long name##_LHASH_HASH(const void *); +#define IMPLEMENT_LHASH_HASH_FN(name, o_type) \ + unsigned long name##_LHASH_HASH(const void *arg) { \ + const o_type *a = arg; \ + return name##_hash(a); } +#define LHASH_HASH_FN(name) name##_LHASH_HASH + +/* Second: "compare" functions */ +#define DECLARE_LHASH_COMP_FN(name, o_type) \ + int name##_LHASH_COMP(const void *, const void *); +#define IMPLEMENT_LHASH_COMP_FN(name, o_type) \ + int name##_LHASH_COMP(const void *arg1, const void *arg2) { \ + const o_type *a = arg1; \ + const o_type *b = arg2; \ + return name##_cmp(a,b); } +#define LHASH_COMP_FN(name) name##_LHASH_COMP + +/* Third: "doall" functions */ +#define DECLARE_LHASH_DOALL_FN(name, o_type) \ + void name##_LHASH_DOALL(void *); +#define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \ + void name##_LHASH_DOALL(void *arg) { \ + o_type *a = arg; \ + name##_doall(a); } +#define LHASH_DOALL_FN(name) name##_LHASH_DOALL + +/* Fourth: "doall_arg" functions */ +#define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ + void name##_LHASH_DOALL_ARG(void *, void *); +#define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ + void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ + o_type *a = arg1; \ + a_type *b = arg2; \ + name##_doall_arg(a, b); } +#define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG + +typedef struct lhash_st { + LHASH_NODE **b; + LHASH_COMP_FN_TYPE comp; + LHASH_HASH_FN_TYPE hash; + unsigned int num_nodes; + unsigned int num_alloc_nodes; + unsigned int p; + unsigned int pmax; + unsigned long up_load; /* load times 256 */ + unsigned long down_load; /* load times 256 */ + unsigned long num_items; + + unsigned long num_expands; + unsigned long num_expand_reallocs; + unsigned long num_contracts; + unsigned long num_contract_reallocs; + unsigned long num_hash_calls; + unsigned long num_comp_calls; + unsigned long num_insert; + unsigned long num_replace; + unsigned long num_delete; + unsigned long num_no_delete; + unsigned long num_retrieve; + unsigned long num_retrieve_miss; + unsigned long num_hash_comps; + + int error; +} _LHASH; /* Do not use _LHASH directly, use LHASH_OF + * and friends */ + +#define LH_LOAD_MULT 256 + +/* Indicates a malloc() error in the last call, this is only bad + * in lh_insert(). */ +#define lh_error(lh) ((lh)->error) + +_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); +void lh_free(_LHASH *lh); +void *lh_insert(_LHASH *lh, void *data); +void *lh_delete(_LHASH *lh, const void *data); +void *lh_retrieve(_LHASH *lh, const void *data); +void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func); +void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); +unsigned long lh_strhash(const char *c); +unsigned long lh_num_items(const _LHASH *lh); + +void lh_stats(const _LHASH *lh, FILE *out); +void lh_node_stats(const _LHASH *lh, FILE *out); +void lh_node_usage_stats(const _LHASH *lh, FILE *out); + +#ifndef OPENSSL_NO_BIO +void lh_stats_bio(const _LHASH *lh, BIO *out); +void lh_node_stats_bio(const _LHASH *lh, BIO *out); +void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); +#endif + +/* Type checking... */ + +#define LHASH_OF(type) struct lhash_st_##type + +#define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; } + +#define CHECKED_LHASH_OF(type,lh) \ + ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh)) + +/* Define wrapper functions. */ +#define LHM_lh_new(type, name) \ + ((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name))) +#define LHM_lh_error(type, lh) \ + lh_error(CHECKED_LHASH_OF(type,lh)) +#define LHM_lh_insert(type, lh, inst) \ + ((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \ + CHECKED_PTR_OF(type, inst))) +#define LHM_lh_retrieve(type, lh, inst) \ + ((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \ + CHECKED_PTR_OF(type, inst))) +#define LHM_lh_delete(type, lh, inst) \ + ((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \ + CHECKED_PTR_OF(type, inst))) +#define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn) +#define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \ + lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg)) +#define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh)) +#define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load) +#define LHM_lh_node_stats_bio(type, lh, out) \ + lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out) +#define LHM_lh_node_usage_stats_bio(type, lh, out) \ + lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out) +#define LHM_lh_stats_bio(type, lh, out) \ + lh_stats_bio(CHECKED_LHASH_OF(type, lh), out) +#define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh)) + +DECLARE_LHASH_OF(OPENSSL_STRING); +DECLARE_LHASH_OF(OPENSSL_CSTRING); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/md4.h b/code/contrib/libfido2/include/openssl/md4.h new file mode 100644 index 0000000..04aacc9 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/md4.h @@ -0,0 +1,103 @@ +/* $OpenBSD: md4.h,v 1.16 2015/09/14 01:45:03 doug Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#ifndef HEADER_MD4_H +#define HEADER_MD4_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_MD4 +#error MD4 is disabled. +#endif + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! MD4_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#define MD4_LONG unsigned int + +#define MD4_CBLOCK 64 +#define MD4_LBLOCK (MD4_CBLOCK/4) +#define MD4_DIGEST_LENGTH 16 + +typedef struct MD4state_st + { + MD4_LONG A,B,C,D; + MD4_LONG Nl,Nh; + MD4_LONG data[MD4_LBLOCK]; + unsigned int num; + } MD4_CTX; + +int MD4_Init(MD4_CTX *c); +int MD4_Update(MD4_CTX *c, const void *data, size_t len); +int MD4_Final(unsigned char *md, MD4_CTX *c); +unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); +void MD4_Transform(MD4_CTX *c, const unsigned char *b); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/md5.h b/code/contrib/libfido2/include/openssl/md5.h new file mode 100644 index 0000000..e2c511c --- /dev/null +++ b/code/contrib/libfido2/include/openssl/md5.h @@ -0,0 +1,108 @@ +/* $OpenBSD: md5.h,v 1.20 2014/10/20 13:06:54 bcook Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#ifndef HEADER_MD5_H +#define HEADER_MD5_H +#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__) +#define __bounded__(x, y, z) +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_MD5 +#error MD5 is disabled. +#endif + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! MD5_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#define MD5_LONG unsigned int + +#define MD5_CBLOCK 64 +#define MD5_LBLOCK (MD5_CBLOCK/4) +#define MD5_DIGEST_LENGTH 16 + +typedef struct MD5state_st + { + MD5_LONG A,B,C,D; + MD5_LONG Nl,Nh; + MD5_LONG data[MD5_LBLOCK]; + unsigned int num; + } MD5_CTX; + +int MD5_Init(MD5_CTX *c); +int MD5_Update(MD5_CTX *c, const void *data, size_t len) + __attribute__ ((__bounded__(__buffer__,2,3))); +int MD5_Final(unsigned char *md, MD5_CTX *c); +unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) + __attribute__ ((__bounded__(__buffer__,1,2))); +void MD5_Transform(MD5_CTX *c, const unsigned char *b); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/modes.h b/code/contrib/libfido2/include/openssl/modes.h new file mode 100644 index 0000000..67ec751 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/modes.h @@ -0,0 +1,144 @@ +/* $OpenBSD: modes.h,v 1.3 2018/07/24 10:47:19 bcook Exp $ */ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Rights for redistribution and usage in source and binary + * forms are granted according to the OpenSSL license. + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*block128_f)(const unsigned char in[16], + unsigned char out[16], + const void *key); + +typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int enc); + +typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out, + size_t blocks, const void *key, + const unsigned char ivec[16]); + +typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out, + size_t blocks, const void *key, + const unsigned char ivec[16],unsigned char cmac[16]); + +void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); +void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); + +void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], unsigned char ecount_buf[16], + unsigned int *num, block128_f block); + +void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], unsigned char ecount_buf[16], + unsigned int *num, ctr128_f ctr); + +void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int *num, + block128_f block); + +void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int *num, + int enc, block128_f block); +void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const void *key, + unsigned char ivec[16], int *num, + int enc, block128_f block); +void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, + size_t bits, const void *key, + unsigned char ivec[16], int *num, + int enc, block128_f block); + +size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); +size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); +size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); +size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); + +size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); +size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); +size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); +size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); + +typedef struct gcm128_context GCM128_CONTEXT; + +GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block); +void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block); +void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv, + size_t len); +int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad, + size_t len); +int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len); +int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len); +int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len, ctr128_f stream); +int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len, ctr128_f stream); +int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, + size_t len); +void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len); +void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx); + +typedef struct ccm128_context CCM128_CONTEXT; + +void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, + unsigned int M, unsigned int L, void *key,block128_f block); +int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, + const unsigned char *nonce, size_t nlen, size_t mlen); +void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, + const unsigned char *aad, size_t alen); +int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, + const unsigned char *inp, unsigned char *out, size_t len); +int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, + const unsigned char *inp, unsigned char *out, size_t len); +int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, + const unsigned char *inp, unsigned char *out, size_t len, + ccm128_f stream); +int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, + const unsigned char *inp, unsigned char *out, size_t len, + ccm128_f stream); +size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len); + +typedef struct xts128_context XTS128_CONTEXT; + +int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], + const unsigned char *inp, unsigned char *out, size_t len, int enc); + +#ifdef __cplusplus +} +#endif diff --git a/code/contrib/libfido2/include/openssl/obj_mac.h b/code/contrib/libfido2/include/openssl/obj_mac.h new file mode 100644 index 0000000..5da2b5d --- /dev/null +++ b/code/contrib/libfido2/include/openssl/obj_mac.h @@ -0,0 +1,4478 @@ +/* crypto/objects/obj_mac.h */ + +/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the + * following command: + * perl objects.pl objects.txt obj_mac.num obj_mac.h + */ + +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#define SN_undef "UNDEF" +#define LN_undef "undefined" +#define NID_undef 0 +#define OBJ_undef 0L + +#define SN_itu_t "ITU-T" +#define LN_itu_t "itu-t" +#define NID_itu_t 645 +#define OBJ_itu_t 0L + +#define NID_ccitt 404 +#define OBJ_ccitt OBJ_itu_t + +#define SN_iso "ISO" +#define LN_iso "iso" +#define NID_iso 181 +#define OBJ_iso 1L + +#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T" +#define LN_joint_iso_itu_t "joint-iso-itu-t" +#define NID_joint_iso_itu_t 646 +#define OBJ_joint_iso_itu_t 2L + +#define NID_joint_iso_ccitt 393 +#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t + +#define SN_member_body "member-body" +#define LN_member_body "ISO Member Body" +#define NID_member_body 182 +#define OBJ_member_body OBJ_iso,2L + +#define SN_identified_organization "identified-organization" +#define NID_identified_organization 676 +#define OBJ_identified_organization OBJ_iso,3L + +#define SN_hmac_md5 "HMAC-MD5" +#define LN_hmac_md5 "hmac-md5" +#define NID_hmac_md5 780 +#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L + +#define SN_hmac_sha1 "HMAC-SHA1" +#define LN_hmac_sha1 "hmac-sha1" +#define NID_hmac_sha1 781 +#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L + +#define SN_certicom_arc "certicom-arc" +#define NID_certicom_arc 677 +#define OBJ_certicom_arc OBJ_identified_organization,132L + +#define SN_international_organizations "international-organizations" +#define LN_international_organizations "International Organizations" +#define NID_international_organizations 647 +#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L + +#define SN_wap "wap" +#define NID_wap 678 +#define OBJ_wap OBJ_international_organizations,43L + +#define SN_wap_wsg "wap-wsg" +#define NID_wap_wsg 679 +#define OBJ_wap_wsg OBJ_wap,1L + +#define SN_selected_attribute_types "selected-attribute-types" +#define LN_selected_attribute_types "Selected Attribute Types" +#define NID_selected_attribute_types 394 +#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L + +#define SN_clearance "clearance" +#define NID_clearance 395 +#define OBJ_clearance OBJ_selected_attribute_types,55L + +#define SN_ISO_US "ISO-US" +#define LN_ISO_US "ISO US Member Body" +#define NID_ISO_US 183 +#define OBJ_ISO_US OBJ_member_body,840L + +#define SN_X9_57 "X9-57" +#define LN_X9_57 "X9.57" +#define NID_X9_57 184 +#define OBJ_X9_57 OBJ_ISO_US,10040L + +#define SN_X9cm "X9cm" +#define LN_X9cm "X9.57 CM ?" +#define NID_X9cm 185 +#define OBJ_X9cm OBJ_X9_57,4L + +#define SN_dsa "DSA" +#define LN_dsa "dsaEncryption" +#define NID_dsa 116 +#define OBJ_dsa OBJ_X9cm,1L + +#define SN_dsaWithSHA1 "DSA-SHA1" +#define LN_dsaWithSHA1 "dsaWithSHA1" +#define NID_dsaWithSHA1 113 +#define OBJ_dsaWithSHA1 OBJ_X9cm,3L + +#define SN_ansi_X9_62 "ansi-X9-62" +#define LN_ansi_X9_62 "ANSI X9.62" +#define NID_ansi_X9_62 405 +#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L + +#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L + +#define SN_X9_62_prime_field "prime-field" +#define NID_X9_62_prime_field 406 +#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L + +#define SN_X9_62_characteristic_two_field "characteristic-two-field" +#define NID_X9_62_characteristic_two_field 407 +#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L + +#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis" +#define NID_X9_62_id_characteristic_two_basis 680 +#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L + +#define SN_X9_62_onBasis "onBasis" +#define NID_X9_62_onBasis 681 +#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L + +#define SN_X9_62_tpBasis "tpBasis" +#define NID_X9_62_tpBasis 682 +#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L + +#define SN_X9_62_ppBasis "ppBasis" +#define NID_X9_62_ppBasis 683 +#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L + +#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L + +#define SN_X9_62_id_ecPublicKey "id-ecPublicKey" +#define NID_X9_62_id_ecPublicKey 408 +#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L + +#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L + +#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L + +#define SN_X9_62_c2pnb163v1 "c2pnb163v1" +#define NID_X9_62_c2pnb163v1 684 +#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L + +#define SN_X9_62_c2pnb163v2 "c2pnb163v2" +#define NID_X9_62_c2pnb163v2 685 +#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L + +#define SN_X9_62_c2pnb163v3 "c2pnb163v3" +#define NID_X9_62_c2pnb163v3 686 +#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L + +#define SN_X9_62_c2pnb176v1 "c2pnb176v1" +#define NID_X9_62_c2pnb176v1 687 +#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L + +#define SN_X9_62_c2tnb191v1 "c2tnb191v1" +#define NID_X9_62_c2tnb191v1 688 +#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L + +#define SN_X9_62_c2tnb191v2 "c2tnb191v2" +#define NID_X9_62_c2tnb191v2 689 +#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L + +#define SN_X9_62_c2tnb191v3 "c2tnb191v3" +#define NID_X9_62_c2tnb191v3 690 +#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L + +#define SN_X9_62_c2onb191v4 "c2onb191v4" +#define NID_X9_62_c2onb191v4 691 +#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L + +#define SN_X9_62_c2onb191v5 "c2onb191v5" +#define NID_X9_62_c2onb191v5 692 +#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L + +#define SN_X9_62_c2pnb208w1 "c2pnb208w1" +#define NID_X9_62_c2pnb208w1 693 +#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L + +#define SN_X9_62_c2tnb239v1 "c2tnb239v1" +#define NID_X9_62_c2tnb239v1 694 +#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L + +#define SN_X9_62_c2tnb239v2 "c2tnb239v2" +#define NID_X9_62_c2tnb239v2 695 +#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L + +#define SN_X9_62_c2tnb239v3 "c2tnb239v3" +#define NID_X9_62_c2tnb239v3 696 +#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L + +#define SN_X9_62_c2onb239v4 "c2onb239v4" +#define NID_X9_62_c2onb239v4 697 +#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L + +#define SN_X9_62_c2onb239v5 "c2onb239v5" +#define NID_X9_62_c2onb239v5 698 +#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L + +#define SN_X9_62_c2pnb272w1 "c2pnb272w1" +#define NID_X9_62_c2pnb272w1 699 +#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L + +#define SN_X9_62_c2pnb304w1 "c2pnb304w1" +#define NID_X9_62_c2pnb304w1 700 +#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L + +#define SN_X9_62_c2tnb359v1 "c2tnb359v1" +#define NID_X9_62_c2tnb359v1 701 +#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L + +#define SN_X9_62_c2pnb368w1 "c2pnb368w1" +#define NID_X9_62_c2pnb368w1 702 +#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L + +#define SN_X9_62_c2tnb431r1 "c2tnb431r1" +#define NID_X9_62_c2tnb431r1 703 +#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L + +#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L + +#define SN_X9_62_prime192v1 "prime192v1" +#define NID_X9_62_prime192v1 409 +#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L + +#define SN_X9_62_prime192v2 "prime192v2" +#define NID_X9_62_prime192v2 410 +#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L + +#define SN_X9_62_prime192v3 "prime192v3" +#define NID_X9_62_prime192v3 411 +#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L + +#define SN_X9_62_prime239v1 "prime239v1" +#define NID_X9_62_prime239v1 412 +#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L + +#define SN_X9_62_prime239v2 "prime239v2" +#define NID_X9_62_prime239v2 413 +#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L + +#define SN_X9_62_prime239v3 "prime239v3" +#define NID_X9_62_prime239v3 414 +#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L + +#define SN_X9_62_prime256v1 "prime256v1" +#define NID_X9_62_prime256v1 415 +#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L + +#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L + +#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1" +#define NID_ecdsa_with_SHA1 416 +#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L + +#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended" +#define NID_ecdsa_with_Recommended 791 +#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L + +#define SN_ecdsa_with_Specified "ecdsa-with-Specified" +#define NID_ecdsa_with_Specified 792 +#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L + +#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224" +#define NID_ecdsa_with_SHA224 793 +#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L + +#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256" +#define NID_ecdsa_with_SHA256 794 +#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L + +#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384" +#define NID_ecdsa_with_SHA384 795 +#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L + +#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512" +#define NID_ecdsa_with_SHA512 796 +#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L + +#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L + +#define SN_secp112r1 "secp112r1" +#define NID_secp112r1 704 +#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L + +#define SN_secp112r2 "secp112r2" +#define NID_secp112r2 705 +#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L + +#define SN_secp128r1 "secp128r1" +#define NID_secp128r1 706 +#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L + +#define SN_secp128r2 "secp128r2" +#define NID_secp128r2 707 +#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L + +#define SN_secp160k1 "secp160k1" +#define NID_secp160k1 708 +#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L + +#define SN_secp160r1 "secp160r1" +#define NID_secp160r1 709 +#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L + +#define SN_secp160r2 "secp160r2" +#define NID_secp160r2 710 +#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L + +#define SN_secp192k1 "secp192k1" +#define NID_secp192k1 711 +#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L + +#define SN_secp224k1 "secp224k1" +#define NID_secp224k1 712 +#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L + +#define SN_secp224r1 "secp224r1" +#define NID_secp224r1 713 +#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L + +#define SN_secp256k1 "secp256k1" +#define NID_secp256k1 714 +#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L + +#define SN_secp384r1 "secp384r1" +#define NID_secp384r1 715 +#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L + +#define SN_secp521r1 "secp521r1" +#define NID_secp521r1 716 +#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L + +#define SN_sect113r1 "sect113r1" +#define NID_sect113r1 717 +#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L + +#define SN_sect113r2 "sect113r2" +#define NID_sect113r2 718 +#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L + +#define SN_sect131r1 "sect131r1" +#define NID_sect131r1 719 +#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L + +#define SN_sect131r2 "sect131r2" +#define NID_sect131r2 720 +#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L + +#define SN_sect163k1 "sect163k1" +#define NID_sect163k1 721 +#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L + +#define SN_sect163r1 "sect163r1" +#define NID_sect163r1 722 +#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L + +#define SN_sect163r2 "sect163r2" +#define NID_sect163r2 723 +#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L + +#define SN_sect193r1 "sect193r1" +#define NID_sect193r1 724 +#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L + +#define SN_sect193r2 "sect193r2" +#define NID_sect193r2 725 +#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L + +#define SN_sect233k1 "sect233k1" +#define NID_sect233k1 726 +#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L + +#define SN_sect233r1 "sect233r1" +#define NID_sect233r1 727 +#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L + +#define SN_sect239k1 "sect239k1" +#define NID_sect239k1 728 +#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L + +#define SN_sect283k1 "sect283k1" +#define NID_sect283k1 729 +#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L + +#define SN_sect283r1 "sect283r1" +#define NID_sect283r1 730 +#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L + +#define SN_sect409k1 "sect409k1" +#define NID_sect409k1 731 +#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L + +#define SN_sect409r1 "sect409r1" +#define NID_sect409r1 732 +#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L + +#define SN_sect571k1 "sect571k1" +#define NID_sect571k1 733 +#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L + +#define SN_sect571r1 "sect571r1" +#define NID_sect571r1 734 +#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L + +#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L + +#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1" +#define NID_wap_wsg_idm_ecid_wtls1 735 +#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L + +#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3" +#define NID_wap_wsg_idm_ecid_wtls3 736 +#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L + +#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4" +#define NID_wap_wsg_idm_ecid_wtls4 737 +#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L + +#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5" +#define NID_wap_wsg_idm_ecid_wtls5 738 +#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L + +#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6" +#define NID_wap_wsg_idm_ecid_wtls6 739 +#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L + +#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7" +#define NID_wap_wsg_idm_ecid_wtls7 740 +#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L + +#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8" +#define NID_wap_wsg_idm_ecid_wtls8 741 +#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L + +#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9" +#define NID_wap_wsg_idm_ecid_wtls9 742 +#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L + +#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10" +#define NID_wap_wsg_idm_ecid_wtls10 743 +#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L + +#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11" +#define NID_wap_wsg_idm_ecid_wtls11 744 +#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L + +#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12" +#define NID_wap_wsg_idm_ecid_wtls12 745 +#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L + +#define SN_cast5_cbc "CAST5-CBC" +#define LN_cast5_cbc "cast5-cbc" +#define NID_cast5_cbc 108 +#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L + +#define SN_cast5_ecb "CAST5-ECB" +#define LN_cast5_ecb "cast5-ecb" +#define NID_cast5_ecb 109 + +#define SN_cast5_cfb64 "CAST5-CFB" +#define LN_cast5_cfb64 "cast5-cfb" +#define NID_cast5_cfb64 110 + +#define SN_cast5_ofb64 "CAST5-OFB" +#define LN_cast5_ofb64 "cast5-ofb" +#define NID_cast5_ofb64 111 + +#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" +#define NID_pbeWithMD5AndCast5_CBC 112 +#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L + +#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC" +#define LN_id_PasswordBasedMAC "password based MAC" +#define NID_id_PasswordBasedMAC 782 +#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L + +#define SN_id_DHBasedMac "id-DHBasedMac" +#define LN_id_DHBasedMac "Diffie-Hellman based MAC" +#define NID_id_DHBasedMac 783 +#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L + +#define SN_rsadsi "rsadsi" +#define LN_rsadsi "RSA Data Security, Inc." +#define NID_rsadsi 1 +#define OBJ_rsadsi OBJ_ISO_US,113549L + +#define SN_pkcs "pkcs" +#define LN_pkcs "RSA Data Security, Inc. PKCS" +#define NID_pkcs 2 +#define OBJ_pkcs OBJ_rsadsi,1L + +#define SN_pkcs1 "pkcs1" +#define NID_pkcs1 186 +#define OBJ_pkcs1 OBJ_pkcs,1L + +#define LN_rsaEncryption "rsaEncryption" +#define NID_rsaEncryption 6 +#define OBJ_rsaEncryption OBJ_pkcs1,1L + +#define SN_md2WithRSAEncryption "RSA-MD2" +#define LN_md2WithRSAEncryption "md2WithRSAEncryption" +#define NID_md2WithRSAEncryption 7 +#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L + +#define SN_md4WithRSAEncryption "RSA-MD4" +#define LN_md4WithRSAEncryption "md4WithRSAEncryption" +#define NID_md4WithRSAEncryption 396 +#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L + +#define SN_md5WithRSAEncryption "RSA-MD5" +#define LN_md5WithRSAEncryption "md5WithRSAEncryption" +#define NID_md5WithRSAEncryption 8 +#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L + +#define SN_sha1WithRSAEncryption "RSA-SHA1" +#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" +#define NID_sha1WithRSAEncryption 65 +#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L + +#define SN_rsaesOaep "RSAES-OAEP" +#define LN_rsaesOaep "rsaesOaep" +#define NID_rsaesOaep 919 +#define OBJ_rsaesOaep OBJ_pkcs1,7L + +#define SN_mgf1 "MGF1" +#define LN_mgf1 "mgf1" +#define NID_mgf1 911 +#define OBJ_mgf1 OBJ_pkcs1,8L + +#define SN_pSpecified "PSPECIFIED" +#define LN_pSpecified "pSpecified" +#define NID_pSpecified 992 +#define OBJ_pSpecified OBJ_pkcs1,9L + +#define SN_rsassaPss "RSASSA-PSS" +#define LN_rsassaPss "rsassaPss" +#define NID_rsassaPss 912 +#define OBJ_rsassaPss OBJ_pkcs1,10L + +#define SN_sha256WithRSAEncryption "RSA-SHA256" +#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" +#define NID_sha256WithRSAEncryption 668 +#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L + +#define SN_sha384WithRSAEncryption "RSA-SHA384" +#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption" +#define NID_sha384WithRSAEncryption 669 +#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L + +#define SN_sha512WithRSAEncryption "RSA-SHA512" +#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption" +#define NID_sha512WithRSAEncryption 670 +#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L + +#define SN_sha224WithRSAEncryption "RSA-SHA224" +#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption" +#define NID_sha224WithRSAEncryption 671 +#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L + +#define SN_pkcs3 "pkcs3" +#define NID_pkcs3 27 +#define OBJ_pkcs3 OBJ_pkcs,3L + +#define LN_dhKeyAgreement "dhKeyAgreement" +#define NID_dhKeyAgreement 28 +#define OBJ_dhKeyAgreement OBJ_pkcs3,1L + +#define SN_pkcs5 "pkcs5" +#define NID_pkcs5 187 +#define OBJ_pkcs5 OBJ_pkcs,5L + +#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" +#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" +#define NID_pbeWithMD2AndDES_CBC 9 +#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L + +#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" +#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" +#define NID_pbeWithMD5AndDES_CBC 10 +#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L + +#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" +#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" +#define NID_pbeWithMD2AndRC2_CBC 168 +#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L + +#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" +#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" +#define NID_pbeWithMD5AndRC2_CBC 169 +#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L + +#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" +#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" +#define NID_pbeWithSHA1AndDES_CBC 170 +#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L + +#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" +#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" +#define NID_pbeWithSHA1AndRC2_CBC 68 +#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L + +#define LN_id_pbkdf2 "PBKDF2" +#define NID_id_pbkdf2 69 +#define OBJ_id_pbkdf2 OBJ_pkcs5,12L + +#define LN_pbes2 "PBES2" +#define NID_pbes2 161 +#define OBJ_pbes2 OBJ_pkcs5,13L + +#define LN_pbmac1 "PBMAC1" +#define NID_pbmac1 162 +#define OBJ_pbmac1 OBJ_pkcs5,14L + +#define SN_pkcs7 "pkcs7" +#define NID_pkcs7 20 +#define OBJ_pkcs7 OBJ_pkcs,7L + +#define LN_pkcs7_data "pkcs7-data" +#define NID_pkcs7_data 21 +#define OBJ_pkcs7_data OBJ_pkcs7,1L + +#define LN_pkcs7_signed "pkcs7-signedData" +#define NID_pkcs7_signed 22 +#define OBJ_pkcs7_signed OBJ_pkcs7,2L + +#define LN_pkcs7_enveloped "pkcs7-envelopedData" +#define NID_pkcs7_enveloped 23 +#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L + +#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" +#define NID_pkcs7_signedAndEnveloped 24 +#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L + +#define LN_pkcs7_digest "pkcs7-digestData" +#define NID_pkcs7_digest 25 +#define OBJ_pkcs7_digest OBJ_pkcs7,5L + +#define LN_pkcs7_encrypted "pkcs7-encryptedData" +#define NID_pkcs7_encrypted 26 +#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L + +#define SN_pkcs9 "pkcs9" +#define NID_pkcs9 47 +#define OBJ_pkcs9 OBJ_pkcs,9L + +#define LN_pkcs9_emailAddress "emailAddress" +#define NID_pkcs9_emailAddress 48 +#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L + +#define LN_pkcs9_unstructuredName "unstructuredName" +#define NID_pkcs9_unstructuredName 49 +#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L + +#define LN_pkcs9_contentType "contentType" +#define NID_pkcs9_contentType 50 +#define OBJ_pkcs9_contentType OBJ_pkcs9,3L + +#define LN_pkcs9_messageDigest "messageDigest" +#define NID_pkcs9_messageDigest 51 +#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L + +#define LN_pkcs9_signingTime "signingTime" +#define NID_pkcs9_signingTime 52 +#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L + +#define LN_pkcs9_countersignature "countersignature" +#define NID_pkcs9_countersignature 53 +#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L + +#define LN_pkcs9_challengePassword "challengePassword" +#define NID_pkcs9_challengePassword 54 +#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L + +#define LN_pkcs9_unstructuredAddress "unstructuredAddress" +#define NID_pkcs9_unstructuredAddress 55 +#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L + +#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" +#define NID_pkcs9_extCertAttributes 56 +#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L + +#define SN_ext_req "extReq" +#define LN_ext_req "Extension Request" +#define NID_ext_req 172 +#define OBJ_ext_req OBJ_pkcs9,14L + +#define SN_SMIMECapabilities "SMIME-CAPS" +#define LN_SMIMECapabilities "S/MIME Capabilities" +#define NID_SMIMECapabilities 167 +#define OBJ_SMIMECapabilities OBJ_pkcs9,15L + +#define SN_SMIME "SMIME" +#define LN_SMIME "S/MIME" +#define NID_SMIME 188 +#define OBJ_SMIME OBJ_pkcs9,16L + +#define SN_id_smime_mod "id-smime-mod" +#define NID_id_smime_mod 189 +#define OBJ_id_smime_mod OBJ_SMIME,0L + +#define SN_id_smime_ct "id-smime-ct" +#define NID_id_smime_ct 190 +#define OBJ_id_smime_ct OBJ_SMIME,1L + +#define SN_id_smime_aa "id-smime-aa" +#define NID_id_smime_aa 191 +#define OBJ_id_smime_aa OBJ_SMIME,2L + +#define SN_id_smime_alg "id-smime-alg" +#define NID_id_smime_alg 192 +#define OBJ_id_smime_alg OBJ_SMIME,3L + +#define SN_id_smime_cd "id-smime-cd" +#define NID_id_smime_cd 193 +#define OBJ_id_smime_cd OBJ_SMIME,4L + +#define SN_id_smime_spq "id-smime-spq" +#define NID_id_smime_spq 194 +#define OBJ_id_smime_spq OBJ_SMIME,5L + +#define SN_id_smime_cti "id-smime-cti" +#define NID_id_smime_cti 195 +#define OBJ_id_smime_cti OBJ_SMIME,6L + +#define SN_id_smime_mod_cms "id-smime-mod-cms" +#define NID_id_smime_mod_cms 196 +#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L + +#define SN_id_smime_mod_ess "id-smime-mod-ess" +#define NID_id_smime_mod_ess 197 +#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L + +#define SN_id_smime_mod_oid "id-smime-mod-oid" +#define NID_id_smime_mod_oid 198 +#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L + +#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3" +#define NID_id_smime_mod_msg_v3 199 +#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L + +#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88" +#define NID_id_smime_mod_ets_eSignature_88 200 +#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L + +#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97" +#define NID_id_smime_mod_ets_eSignature_97 201 +#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L + +#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88" +#define NID_id_smime_mod_ets_eSigPolicy_88 202 +#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L + +#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97" +#define NID_id_smime_mod_ets_eSigPolicy_97 203 +#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L + +#define SN_id_smime_ct_receipt "id-smime-ct-receipt" +#define NID_id_smime_ct_receipt 204 +#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L + +#define SN_id_smime_ct_authData "id-smime-ct-authData" +#define NID_id_smime_ct_authData 205 +#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L + +#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert" +#define NID_id_smime_ct_publishCert 206 +#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L + +#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo" +#define NID_id_smime_ct_TSTInfo 207 +#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L + +#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo" +#define NID_id_smime_ct_TDTInfo 208 +#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L + +#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo" +#define NID_id_smime_ct_contentInfo 209 +#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L + +#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData" +#define NID_id_smime_ct_DVCSRequestData 210 +#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L + +#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData" +#define NID_id_smime_ct_DVCSResponseData 211 +#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L + +#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData" +#define NID_id_smime_ct_compressedData 786 +#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L + +#define SN_id_ct_routeOriginAuthz "id-ct-routeOriginAuthz" +#define NID_id_ct_routeOriginAuthz 1001 +#define OBJ_id_ct_routeOriginAuthz OBJ_id_smime_ct,24L + +#define SN_id_ct_rpkiManifest "id-ct-rpkiManifest" +#define NID_id_ct_rpkiManifest 1002 +#define OBJ_id_ct_rpkiManifest OBJ_id_smime_ct,26L + +#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF" +#define NID_id_ct_asciiTextWithCRLF 787 +#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L + +#define SN_id_ct_rpkiGhostbusters "id-ct-rpkiGhostbusters" +#define NID_id_ct_rpkiGhostbusters 1003 +#define OBJ_id_ct_rpkiGhostbusters OBJ_id_smime_ct,35L + +#define SN_id_ct_resourceTaggedAttest "id-ct-resourceTaggedAttest" +#define NID_id_ct_resourceTaggedAttest 1004 +#define OBJ_id_ct_resourceTaggedAttest OBJ_id_smime_ct,36L + +#define SN_id_ct_geofeedCSVwithCRLF "id-ct-geofeedCSVwithCRLF" +#define NID_id_ct_geofeedCSVwithCRLF 1013 +#define OBJ_id_ct_geofeedCSVwithCRLF OBJ_id_smime_ct,47L + +#define SN_id_ct_signedChecklist "id-ct-signedChecklist" +#define NID_id_ct_signedChecklist 1014 +#define OBJ_id_ct_signedChecklist OBJ_id_smime_ct,48L + +#define SN_id_ct_ASPA "id-ct-ASPA" +#define NID_id_ct_ASPA 1017 +#define OBJ_id_ct_ASPA OBJ_id_smime_ct,49L + +#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest" +#define NID_id_smime_aa_receiptRequest 212 +#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L + +#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel" +#define NID_id_smime_aa_securityLabel 213 +#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L + +#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory" +#define NID_id_smime_aa_mlExpandHistory 214 +#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L + +#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint" +#define NID_id_smime_aa_contentHint 215 +#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L + +#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest" +#define NID_id_smime_aa_msgSigDigest 216 +#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L + +#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType" +#define NID_id_smime_aa_encapContentType 217 +#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L + +#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier" +#define NID_id_smime_aa_contentIdentifier 218 +#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L + +#define SN_id_smime_aa_macValue "id-smime-aa-macValue" +#define NID_id_smime_aa_macValue 219 +#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L + +#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels" +#define NID_id_smime_aa_equivalentLabels 220 +#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L + +#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference" +#define NID_id_smime_aa_contentReference 221 +#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L + +#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref" +#define NID_id_smime_aa_encrypKeyPref 222 +#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L + +#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate" +#define NID_id_smime_aa_signingCertificate 223 +#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L + +#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts" +#define NID_id_smime_aa_smimeEncryptCerts 224 +#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L + +#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken" +#define NID_id_smime_aa_timeStampToken 225 +#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L + +#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId" +#define NID_id_smime_aa_ets_sigPolicyId 226 +#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L + +#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType" +#define NID_id_smime_aa_ets_commitmentType 227 +#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L + +#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation" +#define NID_id_smime_aa_ets_signerLocation 228 +#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L + +#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr" +#define NID_id_smime_aa_ets_signerAttr 229 +#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L + +#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert" +#define NID_id_smime_aa_ets_otherSigCert 230 +#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L + +#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp" +#define NID_id_smime_aa_ets_contentTimestamp 231 +#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L + +#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs" +#define NID_id_smime_aa_ets_CertificateRefs 232 +#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L + +#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs" +#define NID_id_smime_aa_ets_RevocationRefs 233 +#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L + +#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues" +#define NID_id_smime_aa_ets_certValues 234 +#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L + +#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues" +#define NID_id_smime_aa_ets_revocationValues 235 +#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L + +#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp" +#define NID_id_smime_aa_ets_escTimeStamp 236 +#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L + +#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp" +#define NID_id_smime_aa_ets_certCRLTimestamp 237 +#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L + +#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp" +#define NID_id_smime_aa_ets_archiveTimeStamp 238 +#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L + +#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType" +#define NID_id_smime_aa_signatureType 239 +#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L + +#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc" +#define NID_id_smime_aa_dvcs_dvc 240 +#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L + +#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES" +#define NID_id_smime_alg_ESDHwith3DES 241 +#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L + +#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2" +#define NID_id_smime_alg_ESDHwithRC2 242 +#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L + +#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap" +#define NID_id_smime_alg_3DESwrap 243 +#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L + +#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap" +#define NID_id_smime_alg_RC2wrap 244 +#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L + +#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH" +#define NID_id_smime_alg_ESDH 245 +#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L + +#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap" +#define NID_id_smime_alg_CMS3DESwrap 246 +#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L + +#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap" +#define NID_id_smime_alg_CMSRC2wrap 247 +#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L + +#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK" +#define NID_id_alg_PWRI_KEK 893 +#define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L + +#define SN_id_smime_cd_ldap "id-smime-cd-ldap" +#define NID_id_smime_cd_ldap 248 +#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L + +#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri" +#define NID_id_smime_spq_ets_sqt_uri 249 +#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L + +#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice" +#define NID_id_smime_spq_ets_sqt_unotice 250 +#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L + +#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin" +#define NID_id_smime_cti_ets_proofOfOrigin 251 +#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L + +#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt" +#define NID_id_smime_cti_ets_proofOfReceipt 252 +#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L + +#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery" +#define NID_id_smime_cti_ets_proofOfDelivery 253 +#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L + +#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender" +#define NID_id_smime_cti_ets_proofOfSender 254 +#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L + +#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval" +#define NID_id_smime_cti_ets_proofOfApproval 255 +#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L + +#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation" +#define NID_id_smime_cti_ets_proofOfCreation 256 +#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L + +#define LN_friendlyName "friendlyName" +#define NID_friendlyName 156 +#define OBJ_friendlyName OBJ_pkcs9,20L + +#define LN_localKeyID "localKeyID" +#define NID_localKeyID 157 +#define OBJ_localKeyID OBJ_pkcs9,21L + +#define SN_ms_csp_name "CSPName" +#define LN_ms_csp_name "Microsoft CSP Name" +#define NID_ms_csp_name 417 +#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L + +#define SN_LocalKeySet "LocalKeySet" +#define LN_LocalKeySet "Microsoft Local Key set" +#define NID_LocalKeySet 856 +#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L + +#define OBJ_certTypes OBJ_pkcs9,22L + +#define LN_x509Certificate "x509Certificate" +#define NID_x509Certificate 158 +#define OBJ_x509Certificate OBJ_certTypes,1L + +#define LN_sdsiCertificate "sdsiCertificate" +#define NID_sdsiCertificate 159 +#define OBJ_sdsiCertificate OBJ_certTypes,2L + +#define OBJ_crlTypes OBJ_pkcs9,23L + +#define LN_x509Crl "x509Crl" +#define NID_x509Crl 160 +#define OBJ_x509Crl OBJ_crlTypes,1L + +#define OBJ_pkcs12 OBJ_pkcs,12L + +#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L + +#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" +#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" +#define NID_pbe_WithSHA1And128BitRC4 144 +#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L + +#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" +#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" +#define NID_pbe_WithSHA1And40BitRC4 145 +#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L + +#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" +#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 +#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L + +#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" +#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 +#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L + +#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" +#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" +#define NID_pbe_WithSHA1And128BitRC2_CBC 148 +#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L + +#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" +#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" +#define NID_pbe_WithSHA1And40BitRC2_CBC 149 +#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L + +#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L + +#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L + +#define LN_keyBag "keyBag" +#define NID_keyBag 150 +#define OBJ_keyBag OBJ_pkcs12_BagIds,1L + +#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" +#define NID_pkcs8ShroudedKeyBag 151 +#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L + +#define LN_certBag "certBag" +#define NID_certBag 152 +#define OBJ_certBag OBJ_pkcs12_BagIds,3L + +#define LN_crlBag "crlBag" +#define NID_crlBag 153 +#define OBJ_crlBag OBJ_pkcs12_BagIds,4L + +#define LN_secretBag "secretBag" +#define NID_secretBag 154 +#define OBJ_secretBag OBJ_pkcs12_BagIds,5L + +#define LN_safeContentsBag "safeContentsBag" +#define NID_safeContentsBag 155 +#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L + +#define SN_md2 "MD2" +#define LN_md2 "md2" +#define NID_md2 3 +#define OBJ_md2 OBJ_rsadsi,2L,2L + +#define SN_md4 "MD4" +#define LN_md4 "md4" +#define NID_md4 257 +#define OBJ_md4 OBJ_rsadsi,2L,4L + +#define SN_md5 "MD5" +#define LN_md5 "md5" +#define NID_md5 4 +#define OBJ_md5 OBJ_rsadsi,2L,5L + +#define SN_md5_sha1 "MD5-SHA1" +#define LN_md5_sha1 "md5-sha1" +#define NID_md5_sha1 114 + +#define LN_hmacWithMD5 "hmacWithMD5" +#define NID_hmacWithMD5 797 +#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L + +#define LN_hmacWithSHA1 "hmacWithSHA1" +#define NID_hmacWithSHA1 163 +#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L + +#define LN_hmacWithSHA224 "hmacWithSHA224" +#define NID_hmacWithSHA224 798 +#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L + +#define LN_hmacWithSHA256 "hmacWithSHA256" +#define NID_hmacWithSHA256 799 +#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L + +#define LN_hmacWithSHA384 "hmacWithSHA384" +#define NID_hmacWithSHA384 800 +#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L + +#define LN_hmacWithSHA512 "hmacWithSHA512" +#define NID_hmacWithSHA512 801 +#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L + +#define SN_rc2_cbc "RC2-CBC" +#define LN_rc2_cbc "rc2-cbc" +#define NID_rc2_cbc 37 +#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L + +#define SN_rc2_ecb "RC2-ECB" +#define LN_rc2_ecb "rc2-ecb" +#define NID_rc2_ecb 38 + +#define SN_rc2_cfb64 "RC2-CFB" +#define LN_rc2_cfb64 "rc2-cfb" +#define NID_rc2_cfb64 39 + +#define SN_rc2_ofb64 "RC2-OFB" +#define LN_rc2_ofb64 "rc2-ofb" +#define NID_rc2_ofb64 40 + +#define SN_rc2_40_cbc "RC2-40-CBC" +#define LN_rc2_40_cbc "rc2-40-cbc" +#define NID_rc2_40_cbc 98 + +#define SN_rc2_64_cbc "RC2-64-CBC" +#define LN_rc2_64_cbc "rc2-64-cbc" +#define NID_rc2_64_cbc 166 + +#define SN_rc4 "RC4" +#define LN_rc4 "rc4" +#define NID_rc4 5 +#define OBJ_rc4 OBJ_rsadsi,3L,4L + +#define SN_rc4_40 "RC4-40" +#define LN_rc4_40 "rc4-40" +#define NID_rc4_40 97 + +#define SN_des_ede3_cbc "DES-EDE3-CBC" +#define LN_des_ede3_cbc "des-ede3-cbc" +#define NID_des_ede3_cbc 44 +#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L + +#define SN_rc5_cbc "RC5-CBC" +#define LN_rc5_cbc "rc5-cbc" +#define NID_rc5_cbc 120 +#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L + +#define SN_rc5_ecb "RC5-ECB" +#define LN_rc5_ecb "rc5-ecb" +#define NID_rc5_ecb 121 + +#define SN_rc5_cfb64 "RC5-CFB" +#define LN_rc5_cfb64 "rc5-cfb" +#define NID_rc5_cfb64 122 + +#define SN_rc5_ofb64 "RC5-OFB" +#define LN_rc5_ofb64 "rc5-ofb" +#define NID_rc5_ofb64 123 + +#define SN_ms_ext_req "msExtReq" +#define LN_ms_ext_req "Microsoft Extension Request" +#define NID_ms_ext_req 171 +#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L + +#define SN_ms_code_ind "msCodeInd" +#define LN_ms_code_ind "Microsoft Individual Code Signing" +#define NID_ms_code_ind 134 +#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L + +#define SN_ms_code_com "msCodeCom" +#define LN_ms_code_com "Microsoft Commercial Code Signing" +#define NID_ms_code_com 135 +#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L + +#define SN_ms_ctl_sign "msCTLSign" +#define LN_ms_ctl_sign "Microsoft Trust List Signing" +#define NID_ms_ctl_sign 136 +#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L + +#define SN_ms_sgc "msSGC" +#define LN_ms_sgc "Microsoft Server Gated Crypto" +#define NID_ms_sgc 137 +#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L + +#define SN_ms_efs "msEFS" +#define LN_ms_efs "Microsoft Encrypted File System" +#define NID_ms_efs 138 +#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L + +#define SN_ms_smartcard_login "msSmartcardLogin" +#define LN_ms_smartcard_login "Microsoft Smartcardlogin" +#define NID_ms_smartcard_login 648 +#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L + +#define SN_ms_upn "msUPN" +#define LN_ms_upn "Microsoft Universal Principal Name" +#define NID_ms_upn 649 +#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L + +#define SN_idea_cbc "IDEA-CBC" +#define LN_idea_cbc "idea-cbc" +#define NID_idea_cbc 34 +#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + +#define SN_idea_ecb "IDEA-ECB" +#define LN_idea_ecb "idea-ecb" +#define NID_idea_ecb 36 + +#define SN_idea_cfb64 "IDEA-CFB" +#define LN_idea_cfb64 "idea-cfb" +#define NID_idea_cfb64 35 + +#define SN_idea_ofb64 "IDEA-OFB" +#define LN_idea_ofb64 "idea-ofb" +#define NID_idea_ofb64 46 + +#define SN_bf_cbc "BF-CBC" +#define LN_bf_cbc "bf-cbc" +#define NID_bf_cbc 91 +#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L + +#define SN_bf_ecb "BF-ECB" +#define LN_bf_ecb "bf-ecb" +#define NID_bf_ecb 92 + +#define SN_bf_cfb64 "BF-CFB" +#define LN_bf_cfb64 "bf-cfb" +#define NID_bf_cfb64 93 + +#define SN_bf_ofb64 "BF-OFB" +#define LN_bf_ofb64 "bf-ofb" +#define NID_bf_ofb64 94 + +#define SN_id_pkix "PKIX" +#define NID_id_pkix 127 +#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L + +#define SN_id_pkix_mod "id-pkix-mod" +#define NID_id_pkix_mod 258 +#define OBJ_id_pkix_mod OBJ_id_pkix,0L + +#define SN_id_pe "id-pe" +#define NID_id_pe 175 +#define OBJ_id_pe OBJ_id_pkix,1L + +#define SN_id_qt "id-qt" +#define NID_id_qt 259 +#define OBJ_id_qt OBJ_id_pkix,2L + +#define SN_id_kp "id-kp" +#define NID_id_kp 128 +#define OBJ_id_kp OBJ_id_pkix,3L + +#define SN_id_it "id-it" +#define NID_id_it 260 +#define OBJ_id_it OBJ_id_pkix,4L + +#define SN_id_pkip "id-pkip" +#define NID_id_pkip 261 +#define OBJ_id_pkip OBJ_id_pkix,5L + +#define SN_id_alg "id-alg" +#define NID_id_alg 262 +#define OBJ_id_alg OBJ_id_pkix,6L + +#define SN_id_cmc "id-cmc" +#define NID_id_cmc 263 +#define OBJ_id_cmc OBJ_id_pkix,7L + +#define SN_id_on "id-on" +#define NID_id_on 264 +#define OBJ_id_on OBJ_id_pkix,8L + +#define SN_id_pda "id-pda" +#define NID_id_pda 265 +#define OBJ_id_pda OBJ_id_pkix,9L + +#define SN_id_aca "id-aca" +#define NID_id_aca 266 +#define OBJ_id_aca OBJ_id_pkix,10L + +#define SN_id_qcs "id-qcs" +#define NID_id_qcs 267 +#define OBJ_id_qcs OBJ_id_pkix,11L + +#define SN_id_cct "id-cct" +#define NID_id_cct 268 +#define OBJ_id_cct OBJ_id_pkix,12L + +#define SN_id_cp "id-cp" +#define NID_id_cp 1005 +#define OBJ_id_cp OBJ_id_pkix,14L + +#define SN_id_ppl "id-ppl" +#define NID_id_ppl 662 +#define OBJ_id_ppl OBJ_id_pkix,21L + +#define SN_id_ad "id-ad" +#define NID_id_ad 176 +#define OBJ_id_ad OBJ_id_pkix,48L + +#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88" +#define NID_id_pkix1_explicit_88 269 +#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L + +#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88" +#define NID_id_pkix1_implicit_88 270 +#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L + +#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93" +#define NID_id_pkix1_explicit_93 271 +#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L + +#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93" +#define NID_id_pkix1_implicit_93 272 +#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L + +#define SN_id_mod_crmf "id-mod-crmf" +#define NID_id_mod_crmf 273 +#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L + +#define SN_id_mod_cmc "id-mod-cmc" +#define NID_id_mod_cmc 274 +#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L + +#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88" +#define NID_id_mod_kea_profile_88 275 +#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L + +#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93" +#define NID_id_mod_kea_profile_93 276 +#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L + +#define SN_id_mod_cmp "id-mod-cmp" +#define NID_id_mod_cmp 277 +#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L + +#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88" +#define NID_id_mod_qualified_cert_88 278 +#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L + +#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93" +#define NID_id_mod_qualified_cert_93 279 +#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L + +#define SN_id_mod_attribute_cert "id-mod-attribute-cert" +#define NID_id_mod_attribute_cert 280 +#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L + +#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol" +#define NID_id_mod_timestamp_protocol 281 +#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L + +#define SN_id_mod_ocsp "id-mod-ocsp" +#define NID_id_mod_ocsp 282 +#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L + +#define SN_id_mod_dvcs "id-mod-dvcs" +#define NID_id_mod_dvcs 283 +#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L + +#define SN_id_mod_cmp2000 "id-mod-cmp2000" +#define NID_id_mod_cmp2000 284 +#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L + +#define SN_info_access "authorityInfoAccess" +#define LN_info_access "Authority Information Access" +#define NID_info_access 177 +#define OBJ_info_access OBJ_id_pe,1L + +#define SN_biometricInfo "biometricInfo" +#define LN_biometricInfo "Biometric Info" +#define NID_biometricInfo 285 +#define OBJ_biometricInfo OBJ_id_pe,2L + +#define SN_qcStatements "qcStatements" +#define NID_qcStatements 286 +#define OBJ_qcStatements OBJ_id_pe,3L + +#define SN_ac_auditEntity "ac-auditEntity" +#define NID_ac_auditEntity 287 +#define OBJ_ac_auditEntity OBJ_id_pe,4L + +#define SN_ac_targeting "ac-targeting" +#define NID_ac_targeting 288 +#define OBJ_ac_targeting OBJ_id_pe,5L + +#define SN_aaControls "aaControls" +#define NID_aaControls 289 +#define OBJ_aaControls OBJ_id_pe,6L + +#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock" +#define NID_sbgp_ipAddrBlock 290 +#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L + +#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum" +#define NID_sbgp_autonomousSysNum 291 +#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L + +#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier" +#define NID_sbgp_routerIdentifier 292 +#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L + +#define SN_ac_proxying "ac-proxying" +#define NID_ac_proxying 397 +#define OBJ_ac_proxying OBJ_id_pe,10L + +#define SN_sinfo_access "subjectInfoAccess" +#define LN_sinfo_access "Subject Information Access" +#define NID_sinfo_access 398 +#define OBJ_sinfo_access OBJ_id_pe,11L + +#define SN_proxyCertInfo "proxyCertInfo" +#define LN_proxyCertInfo "Proxy Certificate Information" +#define NID_proxyCertInfo 663 +#define OBJ_proxyCertInfo OBJ_id_pe,14L + +#define SN_tlsfeature "tlsfeature" +#define LN_tlsfeature "TLS Feature" +#define NID_tlsfeature 1016 +#define OBJ_tlsfeature OBJ_id_pe,24L + +#define SN_sbgp_ipAddrBlockv2 "sbgp-ipAddrBlockv2" +#define NID_sbgp_ipAddrBlockv2 1006 +#define OBJ_sbgp_ipAddrBlockv2 OBJ_id_pe,28L + +#define SN_sbgp_autonomousSysNumv2 "sbgp-autonomousSysNumv2" +#define NID_sbgp_autonomousSysNumv2 1007 +#define OBJ_sbgp_autonomousSysNumv2 OBJ_id_pe,29L + +#define SN_id_qt_cps "id-qt-cps" +#define LN_id_qt_cps "Policy Qualifier CPS" +#define NID_id_qt_cps 164 +#define OBJ_id_qt_cps OBJ_id_qt,1L + +#define SN_id_qt_unotice "id-qt-unotice" +#define LN_id_qt_unotice "Policy Qualifier User Notice" +#define NID_id_qt_unotice 165 +#define OBJ_id_qt_unotice OBJ_id_qt,2L + +#define SN_textNotice "textNotice" +#define NID_textNotice 293 +#define OBJ_textNotice OBJ_id_qt,3L + +#define SN_server_auth "serverAuth" +#define LN_server_auth "TLS Web Server Authentication" +#define NID_server_auth 129 +#define OBJ_server_auth OBJ_id_kp,1L + +#define SN_client_auth "clientAuth" +#define LN_client_auth "TLS Web Client Authentication" +#define NID_client_auth 130 +#define OBJ_client_auth OBJ_id_kp,2L + +#define SN_code_sign "codeSigning" +#define LN_code_sign "Code Signing" +#define NID_code_sign 131 +#define OBJ_code_sign OBJ_id_kp,3L + +#define SN_email_protect "emailProtection" +#define LN_email_protect "E-mail Protection" +#define NID_email_protect 132 +#define OBJ_email_protect OBJ_id_kp,4L + +#define SN_ipsecEndSystem "ipsecEndSystem" +#define LN_ipsecEndSystem "IPSec End System" +#define NID_ipsecEndSystem 294 +#define OBJ_ipsecEndSystem OBJ_id_kp,5L + +#define SN_ipsecTunnel "ipsecTunnel" +#define LN_ipsecTunnel "IPSec Tunnel" +#define NID_ipsecTunnel 295 +#define OBJ_ipsecTunnel OBJ_id_kp,6L + +#define SN_ipsecUser "ipsecUser" +#define LN_ipsecUser "IPSec User" +#define NID_ipsecUser 296 +#define OBJ_ipsecUser OBJ_id_kp,7L + +#define SN_time_stamp "timeStamping" +#define LN_time_stamp "Time Stamping" +#define NID_time_stamp 133 +#define OBJ_time_stamp OBJ_id_kp,8L + +#define SN_OCSP_sign "OCSPSigning" +#define LN_OCSP_sign "OCSP Signing" +#define NID_OCSP_sign 180 +#define OBJ_OCSP_sign OBJ_id_kp,9L + +#define SN_dvcs "DVCS" +#define LN_dvcs "dvcs" +#define NID_dvcs 297 +#define OBJ_dvcs OBJ_id_kp,10L + +#define SN_id_kp_bgpsec_router "id-kp-bgpsec-router" +#define LN_id_kp_bgpsec_router "BGPsec Router" +#define NID_id_kp_bgpsec_router 1015 +#define OBJ_id_kp_bgpsec_router OBJ_id_kp,30L + +#define SN_id_it_caProtEncCert "id-it-caProtEncCert" +#define NID_id_it_caProtEncCert 298 +#define OBJ_id_it_caProtEncCert OBJ_id_it,1L + +#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes" +#define NID_id_it_signKeyPairTypes 299 +#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L + +#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes" +#define NID_id_it_encKeyPairTypes 300 +#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L + +#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg" +#define NID_id_it_preferredSymmAlg 301 +#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L + +#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo" +#define NID_id_it_caKeyUpdateInfo 302 +#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L + +#define SN_id_it_currentCRL "id-it-currentCRL" +#define NID_id_it_currentCRL 303 +#define OBJ_id_it_currentCRL OBJ_id_it,6L + +#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs" +#define NID_id_it_unsupportedOIDs 304 +#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L + +#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest" +#define NID_id_it_subscriptionRequest 305 +#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L + +#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse" +#define NID_id_it_subscriptionResponse 306 +#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L + +#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq" +#define NID_id_it_keyPairParamReq 307 +#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L + +#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep" +#define NID_id_it_keyPairParamRep 308 +#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L + +#define SN_id_it_revPassphrase "id-it-revPassphrase" +#define NID_id_it_revPassphrase 309 +#define OBJ_id_it_revPassphrase OBJ_id_it,12L + +#define SN_id_it_implicitConfirm "id-it-implicitConfirm" +#define NID_id_it_implicitConfirm 310 +#define OBJ_id_it_implicitConfirm OBJ_id_it,13L + +#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime" +#define NID_id_it_confirmWaitTime 311 +#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L + +#define SN_id_it_origPKIMessage "id-it-origPKIMessage" +#define NID_id_it_origPKIMessage 312 +#define OBJ_id_it_origPKIMessage OBJ_id_it,15L + +#define SN_id_it_suppLangTags "id-it-suppLangTags" +#define NID_id_it_suppLangTags 784 +#define OBJ_id_it_suppLangTags OBJ_id_it,16L + +#define SN_id_regCtrl "id-regCtrl" +#define NID_id_regCtrl 313 +#define OBJ_id_regCtrl OBJ_id_pkip,1L + +#define SN_id_regInfo "id-regInfo" +#define NID_id_regInfo 314 +#define OBJ_id_regInfo OBJ_id_pkip,2L + +#define SN_id_regCtrl_regToken "id-regCtrl-regToken" +#define NID_id_regCtrl_regToken 315 +#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L + +#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator" +#define NID_id_regCtrl_authenticator 316 +#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L + +#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo" +#define NID_id_regCtrl_pkiPublicationInfo 317 +#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L + +#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions" +#define NID_id_regCtrl_pkiArchiveOptions 318 +#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L + +#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID" +#define NID_id_regCtrl_oldCertID 319 +#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L + +#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey" +#define NID_id_regCtrl_protocolEncrKey 320 +#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L + +#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs" +#define NID_id_regInfo_utf8Pairs 321 +#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L + +#define SN_id_regInfo_certReq "id-regInfo-certReq" +#define NID_id_regInfo_certReq 322 +#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L + +#define SN_id_alg_des40 "id-alg-des40" +#define NID_id_alg_des40 323 +#define OBJ_id_alg_des40 OBJ_id_alg,1L + +#define SN_id_alg_noSignature "id-alg-noSignature" +#define NID_id_alg_noSignature 324 +#define OBJ_id_alg_noSignature OBJ_id_alg,2L + +#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1" +#define NID_id_alg_dh_sig_hmac_sha1 325 +#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L + +#define SN_id_alg_dh_pop "id-alg-dh-pop" +#define NID_id_alg_dh_pop 326 +#define OBJ_id_alg_dh_pop OBJ_id_alg,4L + +#define SN_id_cmc_statusInfo "id-cmc-statusInfo" +#define NID_id_cmc_statusInfo 327 +#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L + +#define SN_id_cmc_identification "id-cmc-identification" +#define NID_id_cmc_identification 328 +#define OBJ_id_cmc_identification OBJ_id_cmc,2L + +#define SN_id_cmc_identityProof "id-cmc-identityProof" +#define NID_id_cmc_identityProof 329 +#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L + +#define SN_id_cmc_dataReturn "id-cmc-dataReturn" +#define NID_id_cmc_dataReturn 330 +#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L + +#define SN_id_cmc_transactionId "id-cmc-transactionId" +#define NID_id_cmc_transactionId 331 +#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L + +#define SN_id_cmc_senderNonce "id-cmc-senderNonce" +#define NID_id_cmc_senderNonce 332 +#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L + +#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce" +#define NID_id_cmc_recipientNonce 333 +#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L + +#define SN_id_cmc_addExtensions "id-cmc-addExtensions" +#define NID_id_cmc_addExtensions 334 +#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L + +#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP" +#define NID_id_cmc_encryptedPOP 335 +#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L + +#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP" +#define NID_id_cmc_decryptedPOP 336 +#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L + +#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness" +#define NID_id_cmc_lraPOPWitness 337 +#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L + +#define SN_id_cmc_getCert "id-cmc-getCert" +#define NID_id_cmc_getCert 338 +#define OBJ_id_cmc_getCert OBJ_id_cmc,15L + +#define SN_id_cmc_getCRL "id-cmc-getCRL" +#define NID_id_cmc_getCRL 339 +#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L + +#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest" +#define NID_id_cmc_revokeRequest 340 +#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L + +#define SN_id_cmc_regInfo "id-cmc-regInfo" +#define NID_id_cmc_regInfo 341 +#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L + +#define SN_id_cmc_responseInfo "id-cmc-responseInfo" +#define NID_id_cmc_responseInfo 342 +#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L + +#define SN_id_cmc_queryPending "id-cmc-queryPending" +#define NID_id_cmc_queryPending 343 +#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L + +#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom" +#define NID_id_cmc_popLinkRandom 344 +#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L + +#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness" +#define NID_id_cmc_popLinkWitness 345 +#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L + +#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance" +#define NID_id_cmc_confirmCertAcceptance 346 +#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L + +#define SN_id_on_personalData "id-on-personalData" +#define NID_id_on_personalData 347 +#define OBJ_id_on_personalData OBJ_id_on,1L + +#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier" +#define LN_id_on_permanentIdentifier "Permanent Identifier" +#define NID_id_on_permanentIdentifier 858 +#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L + +#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth" +#define NID_id_pda_dateOfBirth 348 +#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L + +#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth" +#define NID_id_pda_placeOfBirth 349 +#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L + +#define SN_id_pda_gender "id-pda-gender" +#define NID_id_pda_gender 351 +#define OBJ_id_pda_gender OBJ_id_pda,3L + +#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship" +#define NID_id_pda_countryOfCitizenship 352 +#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L + +#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence" +#define NID_id_pda_countryOfResidence 353 +#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L + +#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo" +#define NID_id_aca_authenticationInfo 354 +#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L + +#define SN_id_aca_accessIdentity "id-aca-accessIdentity" +#define NID_id_aca_accessIdentity 355 +#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L + +#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity" +#define NID_id_aca_chargingIdentity 356 +#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L + +#define SN_id_aca_group "id-aca-group" +#define NID_id_aca_group 357 +#define OBJ_id_aca_group OBJ_id_aca,4L + +#define SN_id_aca_role "id-aca-role" +#define NID_id_aca_role 358 +#define OBJ_id_aca_role OBJ_id_aca,5L + +#define SN_id_aca_encAttrs "id-aca-encAttrs" +#define NID_id_aca_encAttrs 399 +#define OBJ_id_aca_encAttrs OBJ_id_aca,6L + +#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1" +#define NID_id_qcs_pkixQCSyntax_v1 359 +#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L + +#define SN_id_cct_crs "id-cct-crs" +#define NID_id_cct_crs 360 +#define OBJ_id_cct_crs OBJ_id_cct,1L + +#define SN_id_cct_PKIData "id-cct-PKIData" +#define NID_id_cct_PKIData 361 +#define OBJ_id_cct_PKIData OBJ_id_cct,2L + +#define SN_id_cct_PKIResponse "id-cct-PKIResponse" +#define NID_id_cct_PKIResponse 362 +#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L + +#define SN_ipAddr_asNumber "ipAddr-asNumber" +#define NID_ipAddr_asNumber 1008 +#define OBJ_ipAddr_asNumber OBJ_id_cp,2L + +#define SN_ipAddr_asNumberv2 "ipAddr-asNumberv2" +#define NID_ipAddr_asNumberv2 1009 +#define OBJ_ipAddr_asNumberv2 OBJ_id_cp,3L + +#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage" +#define LN_id_ppl_anyLanguage "Any language" +#define NID_id_ppl_anyLanguage 664 +#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L + +#define SN_id_ppl_inheritAll "id-ppl-inheritAll" +#define LN_id_ppl_inheritAll "Inherit all" +#define NID_id_ppl_inheritAll 665 +#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L + +#define SN_Independent "id-ppl-independent" +#define LN_Independent "Independent" +#define NID_Independent 667 +#define OBJ_Independent OBJ_id_ppl,2L + +#define SN_ad_OCSP "OCSP" +#define LN_ad_OCSP "OCSP" +#define NID_ad_OCSP 178 +#define OBJ_ad_OCSP OBJ_id_ad,1L + +#define SN_ad_ca_issuers "caIssuers" +#define LN_ad_ca_issuers "CA Issuers" +#define NID_ad_ca_issuers 179 +#define OBJ_ad_ca_issuers OBJ_id_ad,2L + +#define SN_ad_timeStamping "ad_timestamping" +#define LN_ad_timeStamping "AD Time Stamping" +#define NID_ad_timeStamping 363 +#define OBJ_ad_timeStamping OBJ_id_ad,3L + +#define SN_ad_dvcs "AD_DVCS" +#define LN_ad_dvcs "ad dvcs" +#define NID_ad_dvcs 364 +#define OBJ_ad_dvcs OBJ_id_ad,4L + +#define SN_caRepository "caRepository" +#define LN_caRepository "CA Repository" +#define NID_caRepository 785 +#define OBJ_caRepository OBJ_id_ad,5L + +#define SN_rpkiManifest "rpkiManifest" +#define LN_rpkiManifest "RPKI Manifest" +#define NID_rpkiManifest 1010 +#define OBJ_rpkiManifest OBJ_id_ad,10L + +#define SN_signedObject "signedObject" +#define LN_signedObject "Signed Object" +#define NID_signedObject 1011 +#define OBJ_signedObject OBJ_id_ad,11L + +#define SN_rpkiNotify "rpkiNotify" +#define LN_rpkiNotify "RPKI Notify" +#define NID_rpkiNotify 1012 +#define OBJ_rpkiNotify OBJ_id_ad,13L + +#define OBJ_id_pkix_OCSP OBJ_ad_OCSP + +#define SN_id_pkix_OCSP_basic "basicOCSPResponse" +#define LN_id_pkix_OCSP_basic "Basic OCSP Response" +#define NID_id_pkix_OCSP_basic 365 +#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L + +#define SN_id_pkix_OCSP_Nonce "Nonce" +#define LN_id_pkix_OCSP_Nonce "OCSP Nonce" +#define NID_id_pkix_OCSP_Nonce 366 +#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L + +#define SN_id_pkix_OCSP_CrlID "CrlID" +#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID" +#define NID_id_pkix_OCSP_CrlID 367 +#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L + +#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses" +#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses" +#define NID_id_pkix_OCSP_acceptableResponses 368 +#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L + +#define SN_id_pkix_OCSP_noCheck "noCheck" +#define LN_id_pkix_OCSP_noCheck "OCSP No Check" +#define NID_id_pkix_OCSP_noCheck 369 +#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L + +#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff" +#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff" +#define NID_id_pkix_OCSP_archiveCutoff 370 +#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L + +#define SN_id_pkix_OCSP_serviceLocator "serviceLocator" +#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator" +#define NID_id_pkix_OCSP_serviceLocator 371 +#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L + +#define SN_id_pkix_OCSP_extendedStatus "extendedStatus" +#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status" +#define NID_id_pkix_OCSP_extendedStatus 372 +#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L + +#define SN_id_pkix_OCSP_valid "valid" +#define NID_id_pkix_OCSP_valid 373 +#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L + +#define SN_id_pkix_OCSP_path "path" +#define NID_id_pkix_OCSP_path 374 +#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L + +#define SN_id_pkix_OCSP_trustRoot "trustRoot" +#define LN_id_pkix_OCSP_trustRoot "Trust Root" +#define NID_id_pkix_OCSP_trustRoot 375 +#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L + +#define SN_algorithm "algorithm" +#define LN_algorithm "algorithm" +#define NID_algorithm 376 +#define OBJ_algorithm 1L,3L,14L,3L,2L + +#define SN_md5WithRSA "RSA-NP-MD5" +#define LN_md5WithRSA "md5WithRSA" +#define NID_md5WithRSA 104 +#define OBJ_md5WithRSA OBJ_algorithm,3L + +#define SN_des_ecb "DES-ECB" +#define LN_des_ecb "des-ecb" +#define NID_des_ecb 29 +#define OBJ_des_ecb OBJ_algorithm,6L + +#define SN_des_cbc "DES-CBC" +#define LN_des_cbc "des-cbc" +#define NID_des_cbc 31 +#define OBJ_des_cbc OBJ_algorithm,7L + +#define SN_des_ofb64 "DES-OFB" +#define LN_des_ofb64 "des-ofb" +#define NID_des_ofb64 45 +#define OBJ_des_ofb64 OBJ_algorithm,8L + +#define SN_des_cfb64 "DES-CFB" +#define LN_des_cfb64 "des-cfb" +#define NID_des_cfb64 30 +#define OBJ_des_cfb64 OBJ_algorithm,9L + +#define SN_rsaSignature "rsaSignature" +#define NID_rsaSignature 377 +#define OBJ_rsaSignature OBJ_algorithm,11L + +#define SN_dsa_2 "DSA-old" +#define LN_dsa_2 "dsaEncryption-old" +#define NID_dsa_2 67 +#define OBJ_dsa_2 OBJ_algorithm,12L + +#define SN_dsaWithSHA "DSA-SHA" +#define LN_dsaWithSHA "dsaWithSHA" +#define NID_dsaWithSHA 66 +#define OBJ_dsaWithSHA OBJ_algorithm,13L + +#define SN_shaWithRSAEncryption "RSA-SHA" +#define LN_shaWithRSAEncryption "shaWithRSAEncryption" +#define NID_shaWithRSAEncryption 42 +#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L + +#define SN_des_ede_ecb "DES-EDE" +#define LN_des_ede_ecb "des-ede" +#define NID_des_ede_ecb 32 +#define OBJ_des_ede_ecb OBJ_algorithm,17L + +#define SN_des_ede3_ecb "DES-EDE3" +#define LN_des_ede3_ecb "des-ede3" +#define NID_des_ede3_ecb 33 + +#define SN_des_ede_cbc "DES-EDE-CBC" +#define LN_des_ede_cbc "des-ede-cbc" +#define NID_des_ede_cbc 43 + +#define SN_des_ede_cfb64 "DES-EDE-CFB" +#define LN_des_ede_cfb64 "des-ede-cfb" +#define NID_des_ede_cfb64 60 + +#define SN_des_ede3_cfb64 "DES-EDE3-CFB" +#define LN_des_ede3_cfb64 "des-ede3-cfb" +#define NID_des_ede3_cfb64 61 + +#define SN_des_ede_ofb64 "DES-EDE-OFB" +#define LN_des_ede_ofb64 "des-ede-ofb" +#define NID_des_ede_ofb64 62 + +#define SN_des_ede3_ofb64 "DES-EDE3-OFB" +#define LN_des_ede3_ofb64 "des-ede3-ofb" +#define NID_des_ede3_ofb64 63 + +#define SN_desx_cbc "DESX-CBC" +#define LN_desx_cbc "desx-cbc" +#define NID_desx_cbc 80 + +#define SN_sha "SHA" +#define LN_sha "sha" +#define NID_sha 41 +#define OBJ_sha OBJ_algorithm,18L + +#define SN_sha1 "SHA1" +#define LN_sha1 "sha1" +#define NID_sha1 64 +#define OBJ_sha1 OBJ_algorithm,26L + +#define SN_dsaWithSHA1_2 "DSA-SHA1-old" +#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" +#define NID_dsaWithSHA1_2 70 +#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L + +#define SN_sha1WithRSA "RSA-SHA1-2" +#define LN_sha1WithRSA "sha1WithRSA" +#define NID_sha1WithRSA 115 +#define OBJ_sha1WithRSA OBJ_algorithm,29L + +#define SN_ripemd160 "RIPEMD160" +#define LN_ripemd160 "ripemd160" +#define NID_ripemd160 117 +#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L + +#define SN_ripemd160WithRSA "RSA-RIPEMD160" +#define LN_ripemd160WithRSA "ripemd160WithRSA" +#define NID_ripemd160WithRSA 119 +#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L + +#define SN_sxnet "SXNetID" +#define LN_sxnet "Strong Extranet ID" +#define NID_sxnet 143 +#define OBJ_sxnet 1L,3L,101L,1L,4L,1L + +#define SN_X500 "X500" +#define LN_X500 "directory services (X.500)" +#define NID_X500 11 +#define OBJ_X500 2L,5L + +#define SN_X509 "X509" +#define NID_X509 12 +#define OBJ_X509 OBJ_X500,4L + +#define SN_commonName "CN" +#define LN_commonName "commonName" +#define NID_commonName 13 +#define OBJ_commonName OBJ_X509,3L + +#define SN_surname "SN" +#define LN_surname "surname" +#define NID_surname 100 +#define OBJ_surname OBJ_X509,4L + +#define LN_serialNumber "serialNumber" +#define NID_serialNumber 105 +#define OBJ_serialNumber OBJ_X509,5L + +#define SN_countryName "C" +#define LN_countryName "countryName" +#define NID_countryName 14 +#define OBJ_countryName OBJ_X509,6L + +#define SN_localityName "L" +#define LN_localityName "localityName" +#define NID_localityName 15 +#define OBJ_localityName OBJ_X509,7L + +#define SN_stateOrProvinceName "ST" +#define LN_stateOrProvinceName "stateOrProvinceName" +#define NID_stateOrProvinceName 16 +#define OBJ_stateOrProvinceName OBJ_X509,8L + +#define SN_streetAddress "street" +#define LN_streetAddress "streetAddress" +#define NID_streetAddress 660 +#define OBJ_streetAddress OBJ_X509,9L + +#define SN_organizationName "O" +#define LN_organizationName "organizationName" +#define NID_organizationName 17 +#define OBJ_organizationName OBJ_X509,10L + +#define SN_organizationalUnitName "OU" +#define LN_organizationalUnitName "organizationalUnitName" +#define NID_organizationalUnitName 18 +#define OBJ_organizationalUnitName OBJ_X509,11L + +#define SN_title "title" +#define LN_title "title" +#define NID_title 106 +#define OBJ_title OBJ_X509,12L + +#define LN_description "description" +#define NID_description 107 +#define OBJ_description OBJ_X509,13L + +#define LN_searchGuide "searchGuide" +#define NID_searchGuide 859 +#define OBJ_searchGuide OBJ_X509,14L + +#define LN_businessCategory "businessCategory" +#define NID_businessCategory 860 +#define OBJ_businessCategory OBJ_X509,15L + +#define LN_postalAddress "postalAddress" +#define NID_postalAddress 861 +#define OBJ_postalAddress OBJ_X509,16L + +#define LN_postalCode "postalCode" +#define NID_postalCode 661 +#define OBJ_postalCode OBJ_X509,17L + +#define LN_postOfficeBox "postOfficeBox" +#define NID_postOfficeBox 862 +#define OBJ_postOfficeBox OBJ_X509,18L + +#define LN_physicalDeliveryOfficeName "physicalDeliveryOfficeName" +#define NID_physicalDeliveryOfficeName 863 +#define OBJ_physicalDeliveryOfficeName OBJ_X509,19L + +#define LN_telephoneNumber "telephoneNumber" +#define NID_telephoneNumber 864 +#define OBJ_telephoneNumber OBJ_X509,20L + +#define LN_telexNumber "telexNumber" +#define NID_telexNumber 865 +#define OBJ_telexNumber OBJ_X509,21L + +#define LN_teletexTerminalIdentifier "teletexTerminalIdentifier" +#define NID_teletexTerminalIdentifier 866 +#define OBJ_teletexTerminalIdentifier OBJ_X509,22L + +#define LN_facsimileTelephoneNumber "facsimileTelephoneNumber" +#define NID_facsimileTelephoneNumber 867 +#define OBJ_facsimileTelephoneNumber OBJ_X509,23L + +#define LN_x121Address "x121Address" +#define NID_x121Address 868 +#define OBJ_x121Address OBJ_X509,24L + +#define LN_internationaliSDNNumber "internationaliSDNNumber" +#define NID_internationaliSDNNumber 869 +#define OBJ_internationaliSDNNumber OBJ_X509,25L + +#define LN_registeredAddress "registeredAddress" +#define NID_registeredAddress 870 +#define OBJ_registeredAddress OBJ_X509,26L + +#define LN_destinationIndicator "destinationIndicator" +#define NID_destinationIndicator 871 +#define OBJ_destinationIndicator OBJ_X509,27L + +#define LN_preferredDeliveryMethod "preferredDeliveryMethod" +#define NID_preferredDeliveryMethod 872 +#define OBJ_preferredDeliveryMethod OBJ_X509,28L + +#define LN_presentationAddress "presentationAddress" +#define NID_presentationAddress 873 +#define OBJ_presentationAddress OBJ_X509,29L + +#define LN_supportedApplicationContext "supportedApplicationContext" +#define NID_supportedApplicationContext 874 +#define OBJ_supportedApplicationContext OBJ_X509,30L + +#define SN_member "member" +#define NID_member 875 +#define OBJ_member OBJ_X509,31L + +#define SN_owner "owner" +#define NID_owner 876 +#define OBJ_owner OBJ_X509,32L + +#define LN_roleOccupant "roleOccupant" +#define NID_roleOccupant 877 +#define OBJ_roleOccupant OBJ_X509,33L + +#define SN_seeAlso "seeAlso" +#define NID_seeAlso 878 +#define OBJ_seeAlso OBJ_X509,34L + +#define LN_userPassword "userPassword" +#define NID_userPassword 879 +#define OBJ_userPassword OBJ_X509,35L + +#define LN_userCertificate "userCertificate" +#define NID_userCertificate 880 +#define OBJ_userCertificate OBJ_X509,36L + +#define LN_cACertificate "cACertificate" +#define NID_cACertificate 881 +#define OBJ_cACertificate OBJ_X509,37L + +#define LN_authorityRevocationList "authorityRevocationList" +#define NID_authorityRevocationList 882 +#define OBJ_authorityRevocationList OBJ_X509,38L + +#define LN_certificateRevocationList "certificateRevocationList" +#define NID_certificateRevocationList 883 +#define OBJ_certificateRevocationList OBJ_X509,39L + +#define LN_crossCertificatePair "crossCertificatePair" +#define NID_crossCertificatePair 884 +#define OBJ_crossCertificatePair OBJ_X509,40L + +#define SN_name "name" +#define LN_name "name" +#define NID_name 173 +#define OBJ_name OBJ_X509,41L + +#define SN_givenName "GN" +#define LN_givenName "givenName" +#define NID_givenName 99 +#define OBJ_givenName OBJ_X509,42L + +#define SN_initials "initials" +#define LN_initials "initials" +#define NID_initials 101 +#define OBJ_initials OBJ_X509,43L + +#define LN_generationQualifier "generationQualifier" +#define NID_generationQualifier 509 +#define OBJ_generationQualifier OBJ_X509,44L + +#define LN_x500UniqueIdentifier "x500UniqueIdentifier" +#define NID_x500UniqueIdentifier 503 +#define OBJ_x500UniqueIdentifier OBJ_X509,45L + +#define SN_dnQualifier "dnQualifier" +#define LN_dnQualifier "dnQualifier" +#define NID_dnQualifier 174 +#define OBJ_dnQualifier OBJ_X509,46L + +#define LN_enhancedSearchGuide "enhancedSearchGuide" +#define NID_enhancedSearchGuide 885 +#define OBJ_enhancedSearchGuide OBJ_X509,47L + +#define LN_protocolInformation "protocolInformation" +#define NID_protocolInformation 886 +#define OBJ_protocolInformation OBJ_X509,48L + +#define LN_distinguishedName "distinguishedName" +#define NID_distinguishedName 887 +#define OBJ_distinguishedName OBJ_X509,49L + +#define LN_uniqueMember "uniqueMember" +#define NID_uniqueMember 888 +#define OBJ_uniqueMember OBJ_X509,50L + +#define LN_houseIdentifier "houseIdentifier" +#define NID_houseIdentifier 889 +#define OBJ_houseIdentifier OBJ_X509,51L + +#define LN_supportedAlgorithms "supportedAlgorithms" +#define NID_supportedAlgorithms 890 +#define OBJ_supportedAlgorithms OBJ_X509,52L + +#define LN_deltaRevocationList "deltaRevocationList" +#define NID_deltaRevocationList 891 +#define OBJ_deltaRevocationList OBJ_X509,53L + +#define SN_dmdName "dmdName" +#define NID_dmdName 892 +#define OBJ_dmdName OBJ_X509,54L + +#define LN_pseudonym "pseudonym" +#define NID_pseudonym 510 +#define OBJ_pseudonym OBJ_X509,65L + +#define SN_role "role" +#define LN_role "role" +#define NID_role 400 +#define OBJ_role OBJ_X509,72L + +#define SN_X500algorithms "X500algorithms" +#define LN_X500algorithms "directory services - algorithms" +#define NID_X500algorithms 378 +#define OBJ_X500algorithms OBJ_X500,8L + +#define SN_rsa "RSA" +#define LN_rsa "rsa" +#define NID_rsa 19 +#define OBJ_rsa OBJ_X500algorithms,1L,1L + +#define SN_mdc2WithRSA "RSA-MDC2" +#define LN_mdc2WithRSA "mdc2WithRSA" +#define NID_mdc2WithRSA 96 +#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L + +#define SN_mdc2 "MDC2" +#define LN_mdc2 "mdc2" +#define NID_mdc2 95 +#define OBJ_mdc2 OBJ_X500algorithms,3L,101L + +#define SN_id_ce "id-ce" +#define NID_id_ce 81 +#define OBJ_id_ce OBJ_X500,29L + +#define SN_subject_directory_attributes "subjectDirectoryAttributes" +#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes" +#define NID_subject_directory_attributes 769 +#define OBJ_subject_directory_attributes OBJ_id_ce,9L + +#define SN_subject_key_identifier "subjectKeyIdentifier" +#define LN_subject_key_identifier "X509v3 Subject Key Identifier" +#define NID_subject_key_identifier 82 +#define OBJ_subject_key_identifier OBJ_id_ce,14L + +#define SN_key_usage "keyUsage" +#define LN_key_usage "X509v3 Key Usage" +#define NID_key_usage 83 +#define OBJ_key_usage OBJ_id_ce,15L + +#define SN_private_key_usage_period "privateKeyUsagePeriod" +#define LN_private_key_usage_period "X509v3 Private Key Usage Period" +#define NID_private_key_usage_period 84 +#define OBJ_private_key_usage_period OBJ_id_ce,16L + +#define SN_subject_alt_name "subjectAltName" +#define LN_subject_alt_name "X509v3 Subject Alternative Name" +#define NID_subject_alt_name 85 +#define OBJ_subject_alt_name OBJ_id_ce,17L + +#define SN_issuer_alt_name "issuerAltName" +#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" +#define NID_issuer_alt_name 86 +#define OBJ_issuer_alt_name OBJ_id_ce,18L + +#define SN_basic_constraints "basicConstraints" +#define LN_basic_constraints "X509v3 Basic Constraints" +#define NID_basic_constraints 87 +#define OBJ_basic_constraints OBJ_id_ce,19L + +#define SN_crl_number "crlNumber" +#define LN_crl_number "X509v3 CRL Number" +#define NID_crl_number 88 +#define OBJ_crl_number OBJ_id_ce,20L + +#define SN_crl_reason "CRLReason" +#define LN_crl_reason "X509v3 CRL Reason Code" +#define NID_crl_reason 141 +#define OBJ_crl_reason OBJ_id_ce,21L + +#define SN_invalidity_date "invalidityDate" +#define LN_invalidity_date "Invalidity Date" +#define NID_invalidity_date 142 +#define OBJ_invalidity_date OBJ_id_ce,24L + +#define SN_delta_crl "deltaCRL" +#define LN_delta_crl "X509v3 Delta CRL Indicator" +#define NID_delta_crl 140 +#define OBJ_delta_crl OBJ_id_ce,27L + +#define SN_issuing_distribution_point "issuingDistributionPoint" +#define LN_issuing_distribution_point "X509v3 Issuing Distribution Point" +#define NID_issuing_distribution_point 770 +#define OBJ_issuing_distribution_point OBJ_id_ce,28L + +#define SN_certificate_issuer "certificateIssuer" +#define LN_certificate_issuer "X509v3 Certificate Issuer" +#define NID_certificate_issuer 771 +#define OBJ_certificate_issuer OBJ_id_ce,29L + +#define SN_name_constraints "nameConstraints" +#define LN_name_constraints "X509v3 Name Constraints" +#define NID_name_constraints 666 +#define OBJ_name_constraints OBJ_id_ce,30L + +#define SN_crl_distribution_points "crlDistributionPoints" +#define LN_crl_distribution_points "X509v3 CRL Distribution Points" +#define NID_crl_distribution_points 103 +#define OBJ_crl_distribution_points OBJ_id_ce,31L + +#define SN_certificate_policies "certificatePolicies" +#define LN_certificate_policies "X509v3 Certificate Policies" +#define NID_certificate_policies 89 +#define OBJ_certificate_policies OBJ_id_ce,32L + +#define SN_any_policy "anyPolicy" +#define LN_any_policy "X509v3 Any Policy" +#define NID_any_policy 746 +#define OBJ_any_policy OBJ_certificate_policies,0L + +#define SN_policy_mappings "policyMappings" +#define LN_policy_mappings "X509v3 Policy Mappings" +#define NID_policy_mappings 747 +#define OBJ_policy_mappings OBJ_id_ce,33L + +#define SN_authority_key_identifier "authorityKeyIdentifier" +#define LN_authority_key_identifier "X509v3 Authority Key Identifier" +#define NID_authority_key_identifier 90 +#define OBJ_authority_key_identifier OBJ_id_ce,35L + +#define SN_policy_constraints "policyConstraints" +#define LN_policy_constraints "X509v3 Policy Constraints" +#define NID_policy_constraints 401 +#define OBJ_policy_constraints OBJ_id_ce,36L + +#define SN_ext_key_usage "extendedKeyUsage" +#define LN_ext_key_usage "X509v3 Extended Key Usage" +#define NID_ext_key_usage 126 +#define OBJ_ext_key_usage OBJ_id_ce,37L + +#define SN_freshest_crl "freshestCRL" +#define LN_freshest_crl "X509v3 Freshest CRL" +#define NID_freshest_crl 857 +#define OBJ_freshest_crl OBJ_id_ce,46L + +#define SN_inhibit_any_policy "inhibitAnyPolicy" +#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy" +#define NID_inhibit_any_policy 748 +#define OBJ_inhibit_any_policy OBJ_id_ce,54L + +#define SN_target_information "targetInformation" +#define LN_target_information "X509v3 AC Targeting" +#define NID_target_information 402 +#define OBJ_target_information OBJ_id_ce,55L + +#define SN_no_rev_avail "noRevAvail" +#define LN_no_rev_avail "X509v3 No Revocation Available" +#define NID_no_rev_avail 403 +#define OBJ_no_rev_avail OBJ_id_ce,56L + +#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage" +#define LN_anyExtendedKeyUsage "Any Extended Key Usage" +#define NID_anyExtendedKeyUsage 910 +#define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L + +#define SN_netscape "Netscape" +#define LN_netscape "Netscape Communications Corp." +#define NID_netscape 57 +#define OBJ_netscape 2L,16L,840L,1L,113730L + +#define SN_netscape_cert_extension "nsCertExt" +#define LN_netscape_cert_extension "Netscape Certificate Extension" +#define NID_netscape_cert_extension 58 +#define OBJ_netscape_cert_extension OBJ_netscape,1L + +#define SN_netscape_data_type "nsDataType" +#define LN_netscape_data_type "Netscape Data Type" +#define NID_netscape_data_type 59 +#define OBJ_netscape_data_type OBJ_netscape,2L + +#define SN_netscape_cert_type "nsCertType" +#define LN_netscape_cert_type "Netscape Cert Type" +#define NID_netscape_cert_type 71 +#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L + +#define SN_netscape_base_url "nsBaseUrl" +#define LN_netscape_base_url "Netscape Base Url" +#define NID_netscape_base_url 72 +#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L + +#define SN_netscape_revocation_url "nsRevocationUrl" +#define LN_netscape_revocation_url "Netscape Revocation Url" +#define NID_netscape_revocation_url 73 +#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L + +#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" +#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" +#define NID_netscape_ca_revocation_url 74 +#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L + +#define SN_netscape_renewal_url "nsRenewalUrl" +#define LN_netscape_renewal_url "Netscape Renewal Url" +#define NID_netscape_renewal_url 75 +#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L + +#define SN_netscape_ca_policy_url "nsCaPolicyUrl" +#define LN_netscape_ca_policy_url "Netscape CA Policy Url" +#define NID_netscape_ca_policy_url 76 +#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L + +#define SN_netscape_ssl_server_name "nsSslServerName" +#define LN_netscape_ssl_server_name "Netscape SSL Server Name" +#define NID_netscape_ssl_server_name 77 +#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L + +#define SN_netscape_comment "nsComment" +#define LN_netscape_comment "Netscape Comment" +#define NID_netscape_comment 78 +#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L + +#define SN_netscape_cert_sequence "nsCertSequence" +#define LN_netscape_cert_sequence "Netscape Certificate Sequence" +#define NID_netscape_cert_sequence 79 +#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L + +#define SN_ns_sgc "nsSGC" +#define LN_ns_sgc "Netscape Server Gated Crypto" +#define NID_ns_sgc 139 +#define OBJ_ns_sgc OBJ_netscape,4L,1L + +#define SN_org "ORG" +#define LN_org "org" +#define NID_org 379 +#define OBJ_org OBJ_iso,3L + +#define SN_dod "DOD" +#define LN_dod "dod" +#define NID_dod 380 +#define OBJ_dod OBJ_org,6L + +#define SN_iana "IANA" +#define LN_iana "iana" +#define NID_iana 381 +#define OBJ_iana OBJ_dod,1L + +#define OBJ_internet OBJ_iana + +#define SN_Directory "directory" +#define LN_Directory "Directory" +#define NID_Directory 382 +#define OBJ_Directory OBJ_internet,1L + +#define SN_Management "mgmt" +#define LN_Management "Management" +#define NID_Management 383 +#define OBJ_Management OBJ_internet,2L + +#define SN_Experimental "experimental" +#define LN_Experimental "Experimental" +#define NID_Experimental 384 +#define OBJ_Experimental OBJ_internet,3L + +#define SN_Private "private" +#define LN_Private "Private" +#define NID_Private 385 +#define OBJ_Private OBJ_internet,4L + +#define SN_Security "security" +#define LN_Security "Security" +#define NID_Security 386 +#define OBJ_Security OBJ_internet,5L + +#define SN_SNMPv2 "snmpv2" +#define LN_SNMPv2 "SNMPv2" +#define NID_SNMPv2 387 +#define OBJ_SNMPv2 OBJ_internet,6L + +#define LN_Mail "Mail" +#define NID_Mail 388 +#define OBJ_Mail OBJ_internet,7L + +#define SN_Enterprises "enterprises" +#define LN_Enterprises "Enterprises" +#define NID_Enterprises 389 +#define OBJ_Enterprises OBJ_Private,1L + +#define SN_dcObject "dcobject" +#define LN_dcObject "dcObject" +#define NID_dcObject 390 +#define OBJ_dcObject OBJ_Enterprises,1466L,344L + +#define OBJ_extendedValidation OBJ_Enterprises,311L,60L + +#define LN_jurisdictionLocalityName "jurisdictionLocalityName" +#define NID_jurisdictionLocalityName 956 +#define OBJ_jurisdictionLocalityName OBJ_extendedValidation,2L,1L,1L + +#define LN_jurisdictionStateOrProvinceName "jurisdictionStateOrProvinceName" +#define NID_jurisdictionStateOrProvinceName 957 +#define OBJ_jurisdictionStateOrProvinceName OBJ_extendedValidation,2L,1L,2L + +#define LN_jurisdictionCountryName "jurisdictionCountryName" +#define NID_jurisdictionCountryName 958 +#define OBJ_jurisdictionCountryName OBJ_extendedValidation,2L,1L,3L + +#define SN_mime_mhs "mime-mhs" +#define LN_mime_mhs "MIME MHS" +#define NID_mime_mhs 504 +#define OBJ_mime_mhs OBJ_Mail,1L + +#define SN_mime_mhs_headings "mime-mhs-headings" +#define LN_mime_mhs_headings "mime-mhs-headings" +#define NID_mime_mhs_headings 505 +#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L + +#define SN_mime_mhs_bodies "mime-mhs-bodies" +#define LN_mime_mhs_bodies "mime-mhs-bodies" +#define NID_mime_mhs_bodies 506 +#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L + +#define SN_id_hex_partial_message "id-hex-partial-message" +#define LN_id_hex_partial_message "id-hex-partial-message" +#define NID_id_hex_partial_message 507 +#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L + +#define SN_id_hex_multipart_message "id-hex-multipart-message" +#define LN_id_hex_multipart_message "id-hex-multipart-message" +#define NID_id_hex_multipart_message 508 +#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L + +#define SN_rle_compression "RLE" +#define LN_rle_compression "run length compression" +#define NID_rle_compression 124 +#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L + +#define SN_zlib_compression "ZLIB" +#define LN_zlib_compression "zlib compression" +#define NID_zlib_compression 125 +#define OBJ_zlib_compression OBJ_id_smime_alg,8L + +#define OBJ_csor 2L,16L,840L,1L,101L,3L + +#define OBJ_nistAlgorithms OBJ_csor,4L + +#define OBJ_aes OBJ_nistAlgorithms,1L + +#define SN_aes_128_ecb "AES-128-ECB" +#define LN_aes_128_ecb "aes-128-ecb" +#define NID_aes_128_ecb 418 +#define OBJ_aes_128_ecb OBJ_aes,1L + +#define SN_aes_128_cbc "AES-128-CBC" +#define LN_aes_128_cbc "aes-128-cbc" +#define NID_aes_128_cbc 419 +#define OBJ_aes_128_cbc OBJ_aes,2L + +#define SN_aes_128_ofb128 "AES-128-OFB" +#define LN_aes_128_ofb128 "aes-128-ofb" +#define NID_aes_128_ofb128 420 +#define OBJ_aes_128_ofb128 OBJ_aes,3L + +#define SN_aes_128_cfb128 "AES-128-CFB" +#define LN_aes_128_cfb128 "aes-128-cfb" +#define NID_aes_128_cfb128 421 +#define OBJ_aes_128_cfb128 OBJ_aes,4L + +#define SN_id_aes128_wrap "id-aes128-wrap" +#define NID_id_aes128_wrap 788 +#define OBJ_id_aes128_wrap OBJ_aes,5L + +#define SN_aes_128_gcm "id-aes128-GCM" +#define LN_aes_128_gcm "aes-128-gcm" +#define NID_aes_128_gcm 895 +#define OBJ_aes_128_gcm OBJ_aes,6L + +#define SN_aes_128_ccm "id-aes128-CCM" +#define LN_aes_128_ccm "aes-128-ccm" +#define NID_aes_128_ccm 896 +#define OBJ_aes_128_ccm OBJ_aes,7L + +#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad" +#define NID_id_aes128_wrap_pad 897 +#define OBJ_id_aes128_wrap_pad OBJ_aes,8L + +#define SN_aes_192_ecb "AES-192-ECB" +#define LN_aes_192_ecb "aes-192-ecb" +#define NID_aes_192_ecb 422 +#define OBJ_aes_192_ecb OBJ_aes,21L + +#define SN_aes_192_cbc "AES-192-CBC" +#define LN_aes_192_cbc "aes-192-cbc" +#define NID_aes_192_cbc 423 +#define OBJ_aes_192_cbc OBJ_aes,22L + +#define SN_aes_192_ofb128 "AES-192-OFB" +#define LN_aes_192_ofb128 "aes-192-ofb" +#define NID_aes_192_ofb128 424 +#define OBJ_aes_192_ofb128 OBJ_aes,23L + +#define SN_aes_192_cfb128 "AES-192-CFB" +#define LN_aes_192_cfb128 "aes-192-cfb" +#define NID_aes_192_cfb128 425 +#define OBJ_aes_192_cfb128 OBJ_aes,24L + +#define SN_id_aes192_wrap "id-aes192-wrap" +#define NID_id_aes192_wrap 789 +#define OBJ_id_aes192_wrap OBJ_aes,25L + +#define SN_aes_192_gcm "id-aes192-GCM" +#define LN_aes_192_gcm "aes-192-gcm" +#define NID_aes_192_gcm 898 +#define OBJ_aes_192_gcm OBJ_aes,26L + +#define SN_aes_192_ccm "id-aes192-CCM" +#define LN_aes_192_ccm "aes-192-ccm" +#define NID_aes_192_ccm 899 +#define OBJ_aes_192_ccm OBJ_aes,27L + +#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad" +#define NID_id_aes192_wrap_pad 900 +#define OBJ_id_aes192_wrap_pad OBJ_aes,28L + +#define SN_aes_256_ecb "AES-256-ECB" +#define LN_aes_256_ecb "aes-256-ecb" +#define NID_aes_256_ecb 426 +#define OBJ_aes_256_ecb OBJ_aes,41L + +#define SN_aes_256_cbc "AES-256-CBC" +#define LN_aes_256_cbc "aes-256-cbc" +#define NID_aes_256_cbc 427 +#define OBJ_aes_256_cbc OBJ_aes,42L + +#define SN_aes_256_ofb128 "AES-256-OFB" +#define LN_aes_256_ofb128 "aes-256-ofb" +#define NID_aes_256_ofb128 428 +#define OBJ_aes_256_ofb128 OBJ_aes,43L + +#define SN_aes_256_cfb128 "AES-256-CFB" +#define LN_aes_256_cfb128 "aes-256-cfb" +#define NID_aes_256_cfb128 429 +#define OBJ_aes_256_cfb128 OBJ_aes,44L + +#define SN_id_aes256_wrap "id-aes256-wrap" +#define NID_id_aes256_wrap 790 +#define OBJ_id_aes256_wrap OBJ_aes,45L + +#define SN_aes_256_gcm "id-aes256-GCM" +#define LN_aes_256_gcm "aes-256-gcm" +#define NID_aes_256_gcm 901 +#define OBJ_aes_256_gcm OBJ_aes,46L + +#define SN_aes_256_ccm "id-aes256-CCM" +#define LN_aes_256_ccm "aes-256-ccm" +#define NID_aes_256_ccm 902 +#define OBJ_aes_256_ccm OBJ_aes,47L + +#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad" +#define NID_id_aes256_wrap_pad 903 +#define OBJ_id_aes256_wrap_pad OBJ_aes,48L + +#define SN_aes_128_cfb1 "AES-128-CFB1" +#define LN_aes_128_cfb1 "aes-128-cfb1" +#define NID_aes_128_cfb1 650 + +#define SN_aes_192_cfb1 "AES-192-CFB1" +#define LN_aes_192_cfb1 "aes-192-cfb1" +#define NID_aes_192_cfb1 651 + +#define SN_aes_256_cfb1 "AES-256-CFB1" +#define LN_aes_256_cfb1 "aes-256-cfb1" +#define NID_aes_256_cfb1 652 + +#define SN_aes_128_cfb8 "AES-128-CFB8" +#define LN_aes_128_cfb8 "aes-128-cfb8" +#define NID_aes_128_cfb8 653 + +#define SN_aes_192_cfb8 "AES-192-CFB8" +#define LN_aes_192_cfb8 "aes-192-cfb8" +#define NID_aes_192_cfb8 654 + +#define SN_aes_256_cfb8 "AES-256-CFB8" +#define LN_aes_256_cfb8 "aes-256-cfb8" +#define NID_aes_256_cfb8 655 + +#define SN_aes_128_ctr "AES-128-CTR" +#define LN_aes_128_ctr "aes-128-ctr" +#define NID_aes_128_ctr 904 + +#define SN_aes_192_ctr "AES-192-CTR" +#define LN_aes_192_ctr "aes-192-ctr" +#define NID_aes_192_ctr 905 + +#define SN_aes_256_ctr "AES-256-CTR" +#define LN_aes_256_ctr "aes-256-ctr" +#define NID_aes_256_ctr 906 + +#define SN_aes_128_xts "AES-128-XTS" +#define LN_aes_128_xts "aes-128-xts" +#define NID_aes_128_xts 913 + +#define SN_aes_256_xts "AES-256-XTS" +#define LN_aes_256_xts "aes-256-xts" +#define NID_aes_256_xts 914 + +#define SN_des_cfb1 "DES-CFB1" +#define LN_des_cfb1 "des-cfb1" +#define NID_des_cfb1 656 + +#define SN_des_cfb8 "DES-CFB8" +#define LN_des_cfb8 "des-cfb8" +#define NID_des_cfb8 657 + +#define SN_des_ede3_cfb1 "DES-EDE3-CFB1" +#define LN_des_ede3_cfb1 "des-ede3-cfb1" +#define NID_des_ede3_cfb1 658 + +#define SN_des_ede3_cfb8 "DES-EDE3-CFB8" +#define LN_des_ede3_cfb8 "des-ede3-cfb8" +#define NID_des_ede3_cfb8 659 + +#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L + +#define SN_sha256 "SHA256" +#define LN_sha256 "sha256" +#define NID_sha256 672 +#define OBJ_sha256 OBJ_nist_hashalgs,1L + +#define SN_sha384 "SHA384" +#define LN_sha384 "sha384" +#define NID_sha384 673 +#define OBJ_sha384 OBJ_nist_hashalgs,2L + +#define SN_sha512 "SHA512" +#define LN_sha512 "sha512" +#define NID_sha512 674 +#define OBJ_sha512 OBJ_nist_hashalgs,3L + +#define SN_sha224 "SHA224" +#define LN_sha224 "sha224" +#define NID_sha224 675 +#define OBJ_sha224 OBJ_nist_hashalgs,4L + +#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L + +#define SN_dsa_with_SHA224 "dsa_with_SHA224" +#define NID_dsa_with_SHA224 802 +#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L + +#define SN_dsa_with_SHA256 "dsa_with_SHA256" +#define NID_dsa_with_SHA256 803 +#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L + +#define SN_hold_instruction_code "holdInstructionCode" +#define LN_hold_instruction_code "Hold Instruction Code" +#define NID_hold_instruction_code 430 +#define OBJ_hold_instruction_code OBJ_id_ce,23L + +#define OBJ_holdInstruction OBJ_X9_57,2L + +#define SN_hold_instruction_none "holdInstructionNone" +#define LN_hold_instruction_none "Hold Instruction None" +#define NID_hold_instruction_none 431 +#define OBJ_hold_instruction_none OBJ_holdInstruction,1L + +#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer" +#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer" +#define NID_hold_instruction_call_issuer 432 +#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L + +#define SN_hold_instruction_reject "holdInstructionReject" +#define LN_hold_instruction_reject "Hold Instruction Reject" +#define NID_hold_instruction_reject 433 +#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L + +#define SN_data "data" +#define NID_data 434 +#define OBJ_data OBJ_itu_t,9L + +#define SN_pss "pss" +#define NID_pss 435 +#define OBJ_pss OBJ_data,2342L + +#define SN_ucl "ucl" +#define NID_ucl 436 +#define OBJ_ucl OBJ_pss,19200300L + +#define SN_pilot "pilot" +#define NID_pilot 437 +#define OBJ_pilot OBJ_ucl,100L + +#define LN_pilotAttributeType "pilotAttributeType" +#define NID_pilotAttributeType 438 +#define OBJ_pilotAttributeType OBJ_pilot,1L + +#define LN_pilotAttributeSyntax "pilotAttributeSyntax" +#define NID_pilotAttributeSyntax 439 +#define OBJ_pilotAttributeSyntax OBJ_pilot,3L + +#define LN_pilotObjectClass "pilotObjectClass" +#define NID_pilotObjectClass 440 +#define OBJ_pilotObjectClass OBJ_pilot,4L + +#define LN_pilotGroups "pilotGroups" +#define NID_pilotGroups 441 +#define OBJ_pilotGroups OBJ_pilot,10L + +#define LN_iA5StringSyntax "iA5StringSyntax" +#define NID_iA5StringSyntax 442 +#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L + +#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax" +#define NID_caseIgnoreIA5StringSyntax 443 +#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L + +#define LN_pilotObject "pilotObject" +#define NID_pilotObject 444 +#define OBJ_pilotObject OBJ_pilotObjectClass,3L + +#define LN_pilotPerson "pilotPerson" +#define NID_pilotPerson 445 +#define OBJ_pilotPerson OBJ_pilotObjectClass,4L + +#define SN_account "account" +#define NID_account 446 +#define OBJ_account OBJ_pilotObjectClass,5L + +#define SN_document "document" +#define NID_document 447 +#define OBJ_document OBJ_pilotObjectClass,6L + +#define SN_room "room" +#define NID_room 448 +#define OBJ_room OBJ_pilotObjectClass,7L + +#define LN_documentSeries "documentSeries" +#define NID_documentSeries 449 +#define OBJ_documentSeries OBJ_pilotObjectClass,9L + +#define SN_Domain "domain" +#define LN_Domain "Domain" +#define NID_Domain 392 +#define OBJ_Domain OBJ_pilotObjectClass,13L + +#define LN_rFC822localPart "rFC822localPart" +#define NID_rFC822localPart 450 +#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L + +#define LN_dNSDomain "dNSDomain" +#define NID_dNSDomain 451 +#define OBJ_dNSDomain OBJ_pilotObjectClass,15L + +#define LN_domainRelatedObject "domainRelatedObject" +#define NID_domainRelatedObject 452 +#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L + +#define LN_friendlyCountry "friendlyCountry" +#define NID_friendlyCountry 453 +#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L + +#define LN_simpleSecurityObject "simpleSecurityObject" +#define NID_simpleSecurityObject 454 +#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L + +#define LN_pilotOrganization "pilotOrganization" +#define NID_pilotOrganization 455 +#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L + +#define LN_pilotDSA "pilotDSA" +#define NID_pilotDSA 456 +#define OBJ_pilotDSA OBJ_pilotObjectClass,21L + +#define LN_qualityLabelledData "qualityLabelledData" +#define NID_qualityLabelledData 457 +#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L + +#define SN_userId "UID" +#define LN_userId "userId" +#define NID_userId 458 +#define OBJ_userId OBJ_pilotAttributeType,1L + +#define LN_textEncodedORAddress "textEncodedORAddress" +#define NID_textEncodedORAddress 459 +#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L + +#define SN_rfc822Mailbox "mail" +#define LN_rfc822Mailbox "rfc822Mailbox" +#define NID_rfc822Mailbox 460 +#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L + +#define SN_info "info" +#define NID_info 461 +#define OBJ_info OBJ_pilotAttributeType,4L + +#define LN_favouriteDrink "favouriteDrink" +#define NID_favouriteDrink 462 +#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L + +#define LN_roomNumber "roomNumber" +#define NID_roomNumber 463 +#define OBJ_roomNumber OBJ_pilotAttributeType,6L + +#define SN_photo "photo" +#define NID_photo 464 +#define OBJ_photo OBJ_pilotAttributeType,7L + +#define LN_userClass "userClass" +#define NID_userClass 465 +#define OBJ_userClass OBJ_pilotAttributeType,8L + +#define SN_host "host" +#define NID_host 466 +#define OBJ_host OBJ_pilotAttributeType,9L + +#define SN_manager "manager" +#define NID_manager 467 +#define OBJ_manager OBJ_pilotAttributeType,10L + +#define LN_documentIdentifier "documentIdentifier" +#define NID_documentIdentifier 468 +#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L + +#define LN_documentTitle "documentTitle" +#define NID_documentTitle 469 +#define OBJ_documentTitle OBJ_pilotAttributeType,12L + +#define LN_documentVersion "documentVersion" +#define NID_documentVersion 470 +#define OBJ_documentVersion OBJ_pilotAttributeType,13L + +#define LN_documentAuthor "documentAuthor" +#define NID_documentAuthor 471 +#define OBJ_documentAuthor OBJ_pilotAttributeType,14L + +#define LN_documentLocation "documentLocation" +#define NID_documentLocation 472 +#define OBJ_documentLocation OBJ_pilotAttributeType,15L + +#define LN_homeTelephoneNumber "homeTelephoneNumber" +#define NID_homeTelephoneNumber 473 +#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L + +#define SN_secretary "secretary" +#define NID_secretary 474 +#define OBJ_secretary OBJ_pilotAttributeType,21L + +#define LN_otherMailbox "otherMailbox" +#define NID_otherMailbox 475 +#define OBJ_otherMailbox OBJ_pilotAttributeType,22L + +#define LN_lastModifiedTime "lastModifiedTime" +#define NID_lastModifiedTime 476 +#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L + +#define LN_lastModifiedBy "lastModifiedBy" +#define NID_lastModifiedBy 477 +#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L + +#define SN_domainComponent "DC" +#define LN_domainComponent "domainComponent" +#define NID_domainComponent 391 +#define OBJ_domainComponent OBJ_pilotAttributeType,25L + +#define LN_aRecord "aRecord" +#define NID_aRecord 478 +#define OBJ_aRecord OBJ_pilotAttributeType,26L + +#define LN_pilotAttributeType27 "pilotAttributeType27" +#define NID_pilotAttributeType27 479 +#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L + +#define LN_mXRecord "mXRecord" +#define NID_mXRecord 480 +#define OBJ_mXRecord OBJ_pilotAttributeType,28L + +#define LN_nSRecord "nSRecord" +#define NID_nSRecord 481 +#define OBJ_nSRecord OBJ_pilotAttributeType,29L + +#define LN_sOARecord "sOARecord" +#define NID_sOARecord 482 +#define OBJ_sOARecord OBJ_pilotAttributeType,30L + +#define LN_cNAMERecord "cNAMERecord" +#define NID_cNAMERecord 483 +#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L + +#define LN_associatedDomain "associatedDomain" +#define NID_associatedDomain 484 +#define OBJ_associatedDomain OBJ_pilotAttributeType,37L + +#define LN_associatedName "associatedName" +#define NID_associatedName 485 +#define OBJ_associatedName OBJ_pilotAttributeType,38L + +#define LN_homePostalAddress "homePostalAddress" +#define NID_homePostalAddress 486 +#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L + +#define LN_personalTitle "personalTitle" +#define NID_personalTitle 487 +#define OBJ_personalTitle OBJ_pilotAttributeType,40L + +#define LN_mobileTelephoneNumber "mobileTelephoneNumber" +#define NID_mobileTelephoneNumber 488 +#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L + +#define LN_pagerTelephoneNumber "pagerTelephoneNumber" +#define NID_pagerTelephoneNumber 489 +#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L + +#define LN_friendlyCountryName "friendlyCountryName" +#define NID_friendlyCountryName 490 +#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L + +#define LN_organizationalStatus "organizationalStatus" +#define NID_organizationalStatus 491 +#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L + +#define LN_janetMailbox "janetMailbox" +#define NID_janetMailbox 492 +#define OBJ_janetMailbox OBJ_pilotAttributeType,46L + +#define LN_mailPreferenceOption "mailPreferenceOption" +#define NID_mailPreferenceOption 493 +#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L + +#define LN_buildingName "buildingName" +#define NID_buildingName 494 +#define OBJ_buildingName OBJ_pilotAttributeType,48L + +#define LN_dSAQuality "dSAQuality" +#define NID_dSAQuality 495 +#define OBJ_dSAQuality OBJ_pilotAttributeType,49L + +#define LN_singleLevelQuality "singleLevelQuality" +#define NID_singleLevelQuality 496 +#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L + +#define LN_subtreeMinimumQuality "subtreeMinimumQuality" +#define NID_subtreeMinimumQuality 497 +#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L + +#define LN_subtreeMaximumQuality "subtreeMaximumQuality" +#define NID_subtreeMaximumQuality 498 +#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L + +#define LN_personalSignature "personalSignature" +#define NID_personalSignature 499 +#define OBJ_personalSignature OBJ_pilotAttributeType,53L + +#define LN_dITRedirect "dITRedirect" +#define NID_dITRedirect 500 +#define OBJ_dITRedirect OBJ_pilotAttributeType,54L + +#define SN_audio "audio" +#define NID_audio 501 +#define OBJ_audio OBJ_pilotAttributeType,55L + +#define LN_documentPublisher "documentPublisher" +#define NID_documentPublisher 502 +#define OBJ_documentPublisher OBJ_pilotAttributeType,56L + +#define SN_id_set "id-set" +#define LN_id_set "Secure Electronic Transactions" +#define NID_id_set 512 +#define OBJ_id_set OBJ_international_organizations,42L + +#define SN_set_ctype "set-ctype" +#define LN_set_ctype "content types" +#define NID_set_ctype 513 +#define OBJ_set_ctype OBJ_id_set,0L + +#define SN_set_msgExt "set-msgExt" +#define LN_set_msgExt "message extensions" +#define NID_set_msgExt 514 +#define OBJ_set_msgExt OBJ_id_set,1L + +#define SN_set_attr "set-attr" +#define NID_set_attr 515 +#define OBJ_set_attr OBJ_id_set,3L + +#define SN_set_policy "set-policy" +#define NID_set_policy 516 +#define OBJ_set_policy OBJ_id_set,5L + +#define SN_set_certExt "set-certExt" +#define LN_set_certExt "certificate extensions" +#define NID_set_certExt 517 +#define OBJ_set_certExt OBJ_id_set,7L + +#define SN_set_brand "set-brand" +#define NID_set_brand 518 +#define OBJ_set_brand OBJ_id_set,8L + +#define SN_setct_PANData "setct-PANData" +#define NID_setct_PANData 519 +#define OBJ_setct_PANData OBJ_set_ctype,0L + +#define SN_setct_PANToken "setct-PANToken" +#define NID_setct_PANToken 520 +#define OBJ_setct_PANToken OBJ_set_ctype,1L + +#define SN_setct_PANOnly "setct-PANOnly" +#define NID_setct_PANOnly 521 +#define OBJ_setct_PANOnly OBJ_set_ctype,2L + +#define SN_setct_OIData "setct-OIData" +#define NID_setct_OIData 522 +#define OBJ_setct_OIData OBJ_set_ctype,3L + +#define SN_setct_PI "setct-PI" +#define NID_setct_PI 523 +#define OBJ_setct_PI OBJ_set_ctype,4L + +#define SN_setct_PIData "setct-PIData" +#define NID_setct_PIData 524 +#define OBJ_setct_PIData OBJ_set_ctype,5L + +#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned" +#define NID_setct_PIDataUnsigned 525 +#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L + +#define SN_setct_HODInput "setct-HODInput" +#define NID_setct_HODInput 526 +#define OBJ_setct_HODInput OBJ_set_ctype,7L + +#define SN_setct_AuthResBaggage "setct-AuthResBaggage" +#define NID_setct_AuthResBaggage 527 +#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L + +#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage" +#define NID_setct_AuthRevReqBaggage 528 +#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L + +#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage" +#define NID_setct_AuthRevResBaggage 529 +#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L + +#define SN_setct_CapTokenSeq "setct-CapTokenSeq" +#define NID_setct_CapTokenSeq 530 +#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L + +#define SN_setct_PInitResData "setct-PInitResData" +#define NID_setct_PInitResData 531 +#define OBJ_setct_PInitResData OBJ_set_ctype,12L + +#define SN_setct_PI_TBS "setct-PI-TBS" +#define NID_setct_PI_TBS 532 +#define OBJ_setct_PI_TBS OBJ_set_ctype,13L + +#define SN_setct_PResData "setct-PResData" +#define NID_setct_PResData 533 +#define OBJ_setct_PResData OBJ_set_ctype,14L + +#define SN_setct_AuthReqTBS "setct-AuthReqTBS" +#define NID_setct_AuthReqTBS 534 +#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L + +#define SN_setct_AuthResTBS "setct-AuthResTBS" +#define NID_setct_AuthResTBS 535 +#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L + +#define SN_setct_AuthResTBSX "setct-AuthResTBSX" +#define NID_setct_AuthResTBSX 536 +#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L + +#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS" +#define NID_setct_AuthTokenTBS 537 +#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L + +#define SN_setct_CapTokenData "setct-CapTokenData" +#define NID_setct_CapTokenData 538 +#define OBJ_setct_CapTokenData OBJ_set_ctype,20L + +#define SN_setct_CapTokenTBS "setct-CapTokenTBS" +#define NID_setct_CapTokenTBS 539 +#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L + +#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg" +#define NID_setct_AcqCardCodeMsg 540 +#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L + +#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS" +#define NID_setct_AuthRevReqTBS 541 +#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L + +#define SN_setct_AuthRevResData "setct-AuthRevResData" +#define NID_setct_AuthRevResData 542 +#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L + +#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS" +#define NID_setct_AuthRevResTBS 543 +#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L + +#define SN_setct_CapReqTBS "setct-CapReqTBS" +#define NID_setct_CapReqTBS 544 +#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L + +#define SN_setct_CapReqTBSX "setct-CapReqTBSX" +#define NID_setct_CapReqTBSX 545 +#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L + +#define SN_setct_CapResData "setct-CapResData" +#define NID_setct_CapResData 546 +#define OBJ_setct_CapResData OBJ_set_ctype,28L + +#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS" +#define NID_setct_CapRevReqTBS 547 +#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L + +#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX" +#define NID_setct_CapRevReqTBSX 548 +#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L + +#define SN_setct_CapRevResData "setct-CapRevResData" +#define NID_setct_CapRevResData 549 +#define OBJ_setct_CapRevResData OBJ_set_ctype,31L + +#define SN_setct_CredReqTBS "setct-CredReqTBS" +#define NID_setct_CredReqTBS 550 +#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L + +#define SN_setct_CredReqTBSX "setct-CredReqTBSX" +#define NID_setct_CredReqTBSX 551 +#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L + +#define SN_setct_CredResData "setct-CredResData" +#define NID_setct_CredResData 552 +#define OBJ_setct_CredResData OBJ_set_ctype,34L + +#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS" +#define NID_setct_CredRevReqTBS 553 +#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L + +#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX" +#define NID_setct_CredRevReqTBSX 554 +#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L + +#define SN_setct_CredRevResData "setct-CredRevResData" +#define NID_setct_CredRevResData 555 +#define OBJ_setct_CredRevResData OBJ_set_ctype,37L + +#define SN_setct_PCertReqData "setct-PCertReqData" +#define NID_setct_PCertReqData 556 +#define OBJ_setct_PCertReqData OBJ_set_ctype,38L + +#define SN_setct_PCertResTBS "setct-PCertResTBS" +#define NID_setct_PCertResTBS 557 +#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L + +#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData" +#define NID_setct_BatchAdminReqData 558 +#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L + +#define SN_setct_BatchAdminResData "setct-BatchAdminResData" +#define NID_setct_BatchAdminResData 559 +#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L + +#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS" +#define NID_setct_CardCInitResTBS 560 +#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L + +#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS" +#define NID_setct_MeAqCInitResTBS 561 +#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L + +#define SN_setct_RegFormResTBS "setct-RegFormResTBS" +#define NID_setct_RegFormResTBS 562 +#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L + +#define SN_setct_CertReqData "setct-CertReqData" +#define NID_setct_CertReqData 563 +#define OBJ_setct_CertReqData OBJ_set_ctype,45L + +#define SN_setct_CertReqTBS "setct-CertReqTBS" +#define NID_setct_CertReqTBS 564 +#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L + +#define SN_setct_CertResData "setct-CertResData" +#define NID_setct_CertResData 565 +#define OBJ_setct_CertResData OBJ_set_ctype,47L + +#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS" +#define NID_setct_CertInqReqTBS 566 +#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L + +#define SN_setct_ErrorTBS "setct-ErrorTBS" +#define NID_setct_ErrorTBS 567 +#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L + +#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE" +#define NID_setct_PIDualSignedTBE 568 +#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L + +#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE" +#define NID_setct_PIUnsignedTBE 569 +#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L + +#define SN_setct_AuthReqTBE "setct-AuthReqTBE" +#define NID_setct_AuthReqTBE 570 +#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L + +#define SN_setct_AuthResTBE "setct-AuthResTBE" +#define NID_setct_AuthResTBE 571 +#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L + +#define SN_setct_AuthResTBEX "setct-AuthResTBEX" +#define NID_setct_AuthResTBEX 572 +#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L + +#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE" +#define NID_setct_AuthTokenTBE 573 +#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L + +#define SN_setct_CapTokenTBE "setct-CapTokenTBE" +#define NID_setct_CapTokenTBE 574 +#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L + +#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX" +#define NID_setct_CapTokenTBEX 575 +#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L + +#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE" +#define NID_setct_AcqCardCodeMsgTBE 576 +#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L + +#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE" +#define NID_setct_AuthRevReqTBE 577 +#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L + +#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE" +#define NID_setct_AuthRevResTBE 578 +#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L + +#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB" +#define NID_setct_AuthRevResTBEB 579 +#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L + +#define SN_setct_CapReqTBE "setct-CapReqTBE" +#define NID_setct_CapReqTBE 580 +#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L + +#define SN_setct_CapReqTBEX "setct-CapReqTBEX" +#define NID_setct_CapReqTBEX 581 +#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L + +#define SN_setct_CapResTBE "setct-CapResTBE" +#define NID_setct_CapResTBE 582 +#define OBJ_setct_CapResTBE OBJ_set_ctype,64L + +#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE" +#define NID_setct_CapRevReqTBE 583 +#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L + +#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX" +#define NID_setct_CapRevReqTBEX 584 +#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L + +#define SN_setct_CapRevResTBE "setct-CapRevResTBE" +#define NID_setct_CapRevResTBE 585 +#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L + +#define SN_setct_CredReqTBE "setct-CredReqTBE" +#define NID_setct_CredReqTBE 586 +#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L + +#define SN_setct_CredReqTBEX "setct-CredReqTBEX" +#define NID_setct_CredReqTBEX 587 +#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L + +#define SN_setct_CredResTBE "setct-CredResTBE" +#define NID_setct_CredResTBE 588 +#define OBJ_setct_CredResTBE OBJ_set_ctype,70L + +#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE" +#define NID_setct_CredRevReqTBE 589 +#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L + +#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX" +#define NID_setct_CredRevReqTBEX 590 +#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L + +#define SN_setct_CredRevResTBE "setct-CredRevResTBE" +#define NID_setct_CredRevResTBE 591 +#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L + +#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE" +#define NID_setct_BatchAdminReqTBE 592 +#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L + +#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE" +#define NID_setct_BatchAdminResTBE 593 +#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L + +#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE" +#define NID_setct_RegFormReqTBE 594 +#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L + +#define SN_setct_CertReqTBE "setct-CertReqTBE" +#define NID_setct_CertReqTBE 595 +#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L + +#define SN_setct_CertReqTBEX "setct-CertReqTBEX" +#define NID_setct_CertReqTBEX 596 +#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L + +#define SN_setct_CertResTBE "setct-CertResTBE" +#define NID_setct_CertResTBE 597 +#define OBJ_setct_CertResTBE OBJ_set_ctype,79L + +#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS" +#define NID_setct_CRLNotificationTBS 598 +#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L + +#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS" +#define NID_setct_CRLNotificationResTBS 599 +#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L + +#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS" +#define NID_setct_BCIDistributionTBS 600 +#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L + +#define SN_setext_genCrypt "setext-genCrypt" +#define LN_setext_genCrypt "generic cryptogram" +#define NID_setext_genCrypt 601 +#define OBJ_setext_genCrypt OBJ_set_msgExt,1L + +#define SN_setext_miAuth "setext-miAuth" +#define LN_setext_miAuth "merchant initiated auth" +#define NID_setext_miAuth 602 +#define OBJ_setext_miAuth OBJ_set_msgExt,3L + +#define SN_setext_pinSecure "setext-pinSecure" +#define NID_setext_pinSecure 603 +#define OBJ_setext_pinSecure OBJ_set_msgExt,4L + +#define SN_setext_pinAny "setext-pinAny" +#define NID_setext_pinAny 604 +#define OBJ_setext_pinAny OBJ_set_msgExt,5L + +#define SN_setext_track2 "setext-track2" +#define NID_setext_track2 605 +#define OBJ_setext_track2 OBJ_set_msgExt,7L + +#define SN_setext_cv "setext-cv" +#define LN_setext_cv "additional verification" +#define NID_setext_cv 606 +#define OBJ_setext_cv OBJ_set_msgExt,8L + +#define SN_set_policy_root "set-policy-root" +#define NID_set_policy_root 607 +#define OBJ_set_policy_root OBJ_set_policy,0L + +#define SN_setCext_hashedRoot "setCext-hashedRoot" +#define NID_setCext_hashedRoot 608 +#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L + +#define SN_setCext_certType "setCext-certType" +#define NID_setCext_certType 609 +#define OBJ_setCext_certType OBJ_set_certExt,1L + +#define SN_setCext_merchData "setCext-merchData" +#define NID_setCext_merchData 610 +#define OBJ_setCext_merchData OBJ_set_certExt,2L + +#define SN_setCext_cCertRequired "setCext-cCertRequired" +#define NID_setCext_cCertRequired 611 +#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L + +#define SN_setCext_tunneling "setCext-tunneling" +#define NID_setCext_tunneling 612 +#define OBJ_setCext_tunneling OBJ_set_certExt,4L + +#define SN_setCext_setExt "setCext-setExt" +#define NID_setCext_setExt 613 +#define OBJ_setCext_setExt OBJ_set_certExt,5L + +#define SN_setCext_setQualf "setCext-setQualf" +#define NID_setCext_setQualf 614 +#define OBJ_setCext_setQualf OBJ_set_certExt,6L + +#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities" +#define NID_setCext_PGWYcapabilities 615 +#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L + +#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier" +#define NID_setCext_TokenIdentifier 616 +#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L + +#define SN_setCext_Track2Data "setCext-Track2Data" +#define NID_setCext_Track2Data 617 +#define OBJ_setCext_Track2Data OBJ_set_certExt,9L + +#define SN_setCext_TokenType "setCext-TokenType" +#define NID_setCext_TokenType 618 +#define OBJ_setCext_TokenType OBJ_set_certExt,10L + +#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities" +#define NID_setCext_IssuerCapabilities 619 +#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L + +#define SN_setAttr_Cert "setAttr-Cert" +#define NID_setAttr_Cert 620 +#define OBJ_setAttr_Cert OBJ_set_attr,0L + +#define SN_setAttr_PGWYcap "setAttr-PGWYcap" +#define LN_setAttr_PGWYcap "payment gateway capabilities" +#define NID_setAttr_PGWYcap 621 +#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L + +#define SN_setAttr_TokenType "setAttr-TokenType" +#define NID_setAttr_TokenType 622 +#define OBJ_setAttr_TokenType OBJ_set_attr,2L + +#define SN_setAttr_IssCap "setAttr-IssCap" +#define LN_setAttr_IssCap "issuer capabilities" +#define NID_setAttr_IssCap 623 +#define OBJ_setAttr_IssCap OBJ_set_attr,3L + +#define SN_set_rootKeyThumb "set-rootKeyThumb" +#define NID_set_rootKeyThumb 624 +#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L + +#define SN_set_addPolicy "set-addPolicy" +#define NID_set_addPolicy 625 +#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L + +#define SN_setAttr_Token_EMV "setAttr-Token-EMV" +#define NID_setAttr_Token_EMV 626 +#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L + +#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime" +#define NID_setAttr_Token_B0Prime 627 +#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L + +#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM" +#define NID_setAttr_IssCap_CVM 628 +#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L + +#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2" +#define NID_setAttr_IssCap_T2 629 +#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L + +#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig" +#define NID_setAttr_IssCap_Sig 630 +#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L + +#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm" +#define LN_setAttr_GenCryptgrm "generate cryptogram" +#define NID_setAttr_GenCryptgrm 631 +#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L + +#define SN_setAttr_T2Enc "setAttr-T2Enc" +#define LN_setAttr_T2Enc "encrypted track 2" +#define NID_setAttr_T2Enc 632 +#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L + +#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt" +#define LN_setAttr_T2cleartxt "cleartext track 2" +#define NID_setAttr_T2cleartxt 633 +#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L + +#define SN_setAttr_TokICCsig "setAttr-TokICCsig" +#define LN_setAttr_TokICCsig "ICC or token signature" +#define NID_setAttr_TokICCsig 634 +#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L + +#define SN_setAttr_SecDevSig "setAttr-SecDevSig" +#define LN_setAttr_SecDevSig "secure device signature" +#define NID_setAttr_SecDevSig 635 +#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L + +#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA" +#define NID_set_brand_IATA_ATA 636 +#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L + +#define SN_set_brand_Diners "set-brand-Diners" +#define NID_set_brand_Diners 637 +#define OBJ_set_brand_Diners OBJ_set_brand,30L + +#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress" +#define NID_set_brand_AmericanExpress 638 +#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L + +#define SN_set_brand_JCB "set-brand-JCB" +#define NID_set_brand_JCB 639 +#define OBJ_set_brand_JCB OBJ_set_brand,35L + +#define SN_set_brand_Visa "set-brand-Visa" +#define NID_set_brand_Visa 640 +#define OBJ_set_brand_Visa OBJ_set_brand,4L + +#define SN_set_brand_MasterCard "set-brand-MasterCard" +#define NID_set_brand_MasterCard 641 +#define OBJ_set_brand_MasterCard OBJ_set_brand,5L + +#define SN_set_brand_Novus "set-brand-Novus" +#define NID_set_brand_Novus 642 +#define OBJ_set_brand_Novus OBJ_set_brand,6011L + +#define SN_des_cdmf "DES-CDMF" +#define LN_des_cdmf "des-cdmf" +#define NID_des_cdmf 643 +#define OBJ_des_cdmf OBJ_rsadsi,3L,10L + +#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET" +#define NID_rsaOAEPEncryptionSET 644 +#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L + +#define SN_ipsec3 "Oakley-EC2N-3" +#define LN_ipsec3 "ipsec3" +#define NID_ipsec3 749 + +#define SN_ipsec4 "Oakley-EC2N-4" +#define LN_ipsec4 "ipsec4" +#define NID_ipsec4 750 + +#define SN_whirlpool "whirlpool" +#define NID_whirlpool 804 +#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L + +#define SN_cryptopro "cryptopro" +#define NID_cryptopro 805 +#define OBJ_cryptopro OBJ_member_body,643L,2L,2L + +#define SN_cryptocom "cryptocom" +#define NID_cryptocom 806 +#define OBJ_cryptocom OBJ_member_body,643L,2L,9L + +#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001" +#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001" +#define NID_id_GostR3411_94_with_GostR3410_2001 807 +#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L + +#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94" +#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94" +#define NID_id_GostR3411_94_with_GostR3410_94 808 +#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L + +#define SN_id_GostR3411_94 "md_gost94" +#define LN_id_GostR3411_94 "GOST R 34.11-94" +#define NID_id_GostR3411_94 809 +#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L + +#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94" +#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94" +#define NID_id_HMACGostR3411_94 810 +#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L + +#define SN_id_GostR3410_2001 "gost2001" +#define LN_id_GostR3410_2001 "GOST R 34.10-2001" +#define NID_id_GostR3410_2001 811 +#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L + +#define SN_id_GostR3410_94 "gost94" +#define LN_id_GostR3410_94 "GOST R 34.10-94" +#define NID_id_GostR3410_94 812 +#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L + +#define SN_id_Gost28147_89 "gost89" +#define LN_id_Gost28147_89 "GOST 28147-89" +#define NID_id_Gost28147_89 813 +#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L + +#define SN_gost89_cnt "gost89-cnt" +#define NID_gost89_cnt 814 + +#define SN_id_Gost28147_89_MAC "gost-mac" +#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC" +#define NID_id_Gost28147_89_MAC 815 +#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L + +#define SN_id_GostR3411_94_prf "prf-gostr3411-94" +#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF" +#define NID_id_GostR3411_94_prf 816 +#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L + +#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH" +#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH" +#define NID_id_GostR3410_2001DH 817 +#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L + +#define SN_id_GostR3410_94DH "id-GostR3410-94DH" +#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH" +#define NID_id_GostR3410_94DH 818 +#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L + +#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing" +#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819 +#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L + +#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing" +#define NID_id_Gost28147_89_None_KeyMeshing 820 +#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L + +#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet" +#define NID_id_GostR3411_94_TestParamSet 821 +#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L + +#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet" +#define NID_id_GostR3411_94_CryptoProParamSet 822 +#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L + +#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet" +#define NID_id_Gost28147_89_TestParamSet 823 +#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L + +#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824 +#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L + +#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825 +#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L + +#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826 +#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L + +#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827 +#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L + +#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830 +#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L + +#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet" +#define NID_id_GostR3410_94_TestParamSet 831 +#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L + +#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832 +#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L + +#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833 +#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L + +#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834 +#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L + +#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835 +#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L + +#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836 +#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L + +#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837 +#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L + +#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838 +#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L + +#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet" +#define NID_id_GostR3410_2001_TestParamSet 839 +#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L + +#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840 +#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L + +#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841 +#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L + +#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842 +#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L + +#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843 +#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L + +#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844 +#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L + +#define SN_id_GostR3410_94_a "id-GostR3410-94-a" +#define NID_id_GostR3410_94_a 845 +#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L + +#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis" +#define NID_id_GostR3410_94_aBis 846 +#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L + +#define SN_id_GostR3410_94_b "id-GostR3410-94-b" +#define NID_id_GostR3410_94_b 847 +#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L + +#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis" +#define NID_id_GostR3410_94_bBis 848 +#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L + +#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc" +#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet" +#define NID_id_Gost28147_89_cc 849 +#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L + +#define SN_id_GostR3410_94_cc "gost94cc" +#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom" +#define NID_id_GostR3410_94_cc 850 +#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L + +#define SN_id_GostR3410_2001_cc "gost2001cc" +#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom" +#define NID_id_GostR3410_2001_cc 851 +#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L + +#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc" +#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_94_cc 852 +#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L + +#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc" +#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853 +#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L + +#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc" +#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom" +#define NID_id_GostR3410_2001_ParamSet_cc 854 +#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L + +#define SN_sm3 "SM3" +#define LN_sm3 "sm3" +#define NID_sm3 968 +#define OBJ_sm3 1L,2L,156L,10197L,1L,401L + +#define SN_sm3WithRSAEncryption "RSA-SM3" +#define LN_sm3WithRSAEncryption "sm3WithRSAEncryption" +#define NID_sm3WithRSAEncryption 969 +#define OBJ_sm3WithRSAEncryption 1L,2L,156L,10197L,1L,504L + +#define SN_camellia_128_cbc "CAMELLIA-128-CBC" +#define LN_camellia_128_cbc "camellia-128-cbc" +#define NID_camellia_128_cbc 751 +#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L + +#define SN_camellia_192_cbc "CAMELLIA-192-CBC" +#define LN_camellia_192_cbc "camellia-192-cbc" +#define NID_camellia_192_cbc 752 +#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L + +#define SN_camellia_256_cbc "CAMELLIA-256-CBC" +#define LN_camellia_256_cbc "camellia-256-cbc" +#define NID_camellia_256_cbc 753 +#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L + +#define SN_id_camellia128_wrap "id-camellia128-wrap" +#define NID_id_camellia128_wrap 907 +#define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L + +#define SN_id_camellia192_wrap "id-camellia192-wrap" +#define NID_id_camellia192_wrap 908 +#define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L + +#define SN_id_camellia256_wrap "id-camellia256-wrap" +#define NID_id_camellia256_wrap 909 +#define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L + +#define OBJ_ntt_ds 0L,3L,4401L,5L + +#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L + +#define SN_camellia_128_ecb "CAMELLIA-128-ECB" +#define LN_camellia_128_ecb "camellia-128-ecb" +#define NID_camellia_128_ecb 754 +#define OBJ_camellia_128_ecb OBJ_camellia,1L + +#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB" +#define LN_camellia_128_ofb128 "camellia-128-ofb" +#define NID_camellia_128_ofb128 766 +#define OBJ_camellia_128_ofb128 OBJ_camellia,3L + +#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB" +#define LN_camellia_128_cfb128 "camellia-128-cfb" +#define NID_camellia_128_cfb128 757 +#define OBJ_camellia_128_cfb128 OBJ_camellia,4L + +#define SN_camellia_192_ecb "CAMELLIA-192-ECB" +#define LN_camellia_192_ecb "camellia-192-ecb" +#define NID_camellia_192_ecb 755 +#define OBJ_camellia_192_ecb OBJ_camellia,21L + +#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB" +#define LN_camellia_192_ofb128 "camellia-192-ofb" +#define NID_camellia_192_ofb128 767 +#define OBJ_camellia_192_ofb128 OBJ_camellia,23L + +#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB" +#define LN_camellia_192_cfb128 "camellia-192-cfb" +#define NID_camellia_192_cfb128 758 +#define OBJ_camellia_192_cfb128 OBJ_camellia,24L + +#define SN_camellia_256_ecb "CAMELLIA-256-ECB" +#define LN_camellia_256_ecb "camellia-256-ecb" +#define NID_camellia_256_ecb 756 +#define OBJ_camellia_256_ecb OBJ_camellia,41L + +#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB" +#define LN_camellia_256_ofb128 "camellia-256-ofb" +#define NID_camellia_256_ofb128 768 +#define OBJ_camellia_256_ofb128 OBJ_camellia,43L + +#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB" +#define LN_camellia_256_cfb128 "camellia-256-cfb" +#define NID_camellia_256_cfb128 759 +#define OBJ_camellia_256_cfb128 OBJ_camellia,44L + +#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1" +#define LN_camellia_128_cfb1 "camellia-128-cfb1" +#define NID_camellia_128_cfb1 760 + +#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1" +#define LN_camellia_192_cfb1 "camellia-192-cfb1" +#define NID_camellia_192_cfb1 761 + +#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1" +#define LN_camellia_256_cfb1 "camellia-256-cfb1" +#define NID_camellia_256_cfb1 762 + +#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8" +#define LN_camellia_128_cfb8 "camellia-128-cfb8" +#define NID_camellia_128_cfb8 763 + +#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8" +#define LN_camellia_192_cfb8 "camellia-192-cfb8" +#define NID_camellia_192_cfb8 764 + +#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8" +#define LN_camellia_256_cfb8 "camellia-256-cfb8" +#define NID_camellia_256_cfb8 765 + +#define SN_kisa "KISA" +#define LN_kisa "kisa" +#define NID_kisa 773 +#define OBJ_kisa OBJ_member_body,410L,200004L + +#define SN_seed_ecb "SEED-ECB" +#define LN_seed_ecb "seed-ecb" +#define NID_seed_ecb 776 +#define OBJ_seed_ecb OBJ_kisa,1L,3L + +#define SN_seed_cbc "SEED-CBC" +#define LN_seed_cbc "seed-cbc" +#define NID_seed_cbc 777 +#define OBJ_seed_cbc OBJ_kisa,1L,4L + +#define SN_seed_cfb128 "SEED-CFB" +#define LN_seed_cfb128 "seed-cfb" +#define NID_seed_cfb128 779 +#define OBJ_seed_cfb128 OBJ_kisa,1L,5L + +#define SN_seed_ofb128 "SEED-OFB" +#define LN_seed_ofb128 "seed-ofb" +#define NID_seed_ofb128 778 +#define OBJ_seed_ofb128 OBJ_kisa,1L,6L + +#define SN_ISO_CN "ISO-CN" +#define LN_ISO_CN "ISO CN Member Body" +#define NID_ISO_CN 970 +#define OBJ_ISO_CN OBJ_member_body,156L + +#define SN_oscca "oscca" +#define NID_oscca 971 +#define OBJ_oscca OBJ_ISO_CN,10197L + +#define SN_sm_scheme "sm-scheme" +#define NID_sm_scheme 972 +#define OBJ_sm_scheme OBJ_oscca,1L + +#define SN_sm4_ecb "SM4-ECB" +#define LN_sm4_ecb "sm4-ecb" +#define NID_sm4_ecb 973 +#define OBJ_sm4_ecb OBJ_sm_scheme,104L,1L + +#define SN_sm4_cbc "SM4-CBC" +#define LN_sm4_cbc "sm4-cbc" +#define NID_sm4_cbc 974 +#define OBJ_sm4_cbc OBJ_sm_scheme,104L,2L + +#define SN_sm4_ofb128 "SM4-OFB" +#define LN_sm4_ofb128 "sm4-ofb" +#define NID_sm4_ofb128 975 +#define OBJ_sm4_ofb128 OBJ_sm_scheme,104L,3L + +#define SN_sm4_cfb128 "SM4-CFB" +#define LN_sm4_cfb128 "sm4-cfb" +#define NID_sm4_cfb128 976 +#define OBJ_sm4_cfb128 OBJ_sm_scheme,104L,4L + +#define SN_sm4_cfb1 "SM4-CFB1" +#define LN_sm4_cfb1 "sm4-cfb1" +#define NID_sm4_cfb1 977 +#define OBJ_sm4_cfb1 OBJ_sm_scheme,104L,5L + +#define SN_sm4_cfb8 "SM4-CFB8" +#define LN_sm4_cfb8 "sm4-cfb8" +#define NID_sm4_cfb8 978 +#define OBJ_sm4_cfb8 OBJ_sm_scheme,104L,6L + +#define SN_sm4_ctr "SM4-CTR" +#define LN_sm4_ctr "sm4-ctr" +#define NID_sm4_ctr 979 +#define OBJ_sm4_ctr OBJ_sm_scheme,104L,7L + +#define SN_hmac "HMAC" +#define LN_hmac "hmac" +#define NID_hmac 855 + +#define SN_cmac "CMAC" +#define LN_cmac "cmac" +#define NID_cmac 894 + +#define SN_rc4_hmac_md5 "RC4-HMAC-MD5" +#define LN_rc4_hmac_md5 "rc4-hmac-md5" +#define NID_rc4_hmac_md5 915 + +#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1" +#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1" +#define NID_aes_128_cbc_hmac_sha1 916 + +#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1" +#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1" +#define NID_aes_192_cbc_hmac_sha1 917 + +#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1" +#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1" +#define NID_aes_256_cbc_hmac_sha1 918 + +#define OBJ_x9_63_scheme 1L,3L,133L,16L,840L,63L,0L + +#define OBJ_secg_scheme OBJ_certicom_arc,1L + +#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme" +#define NID_dhSinglePass_stdDH_sha1kdf_scheme 980 +#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme OBJ_x9_63_scheme,2L + +#define SN_dhSinglePass_stdDH_sha224kdf_scheme "dhSinglePass-stdDH-sha224kdf-scheme" +#define NID_dhSinglePass_stdDH_sha224kdf_scheme 981 +#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme OBJ_secg_scheme,11L,0L + +#define SN_dhSinglePass_stdDH_sha256kdf_scheme "dhSinglePass-stdDH-sha256kdf-scheme" +#define NID_dhSinglePass_stdDH_sha256kdf_scheme 982 +#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme OBJ_secg_scheme,11L,1L + +#define SN_dhSinglePass_stdDH_sha384kdf_scheme "dhSinglePass-stdDH-sha384kdf-scheme" +#define NID_dhSinglePass_stdDH_sha384kdf_scheme 983 +#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme OBJ_secg_scheme,11L,2L + +#define SN_dhSinglePass_stdDH_sha512kdf_scheme "dhSinglePass-stdDH-sha512kdf-scheme" +#define NID_dhSinglePass_stdDH_sha512kdf_scheme 984 +#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme OBJ_secg_scheme,11L,3L + +#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme "dhSinglePass-cofactorDH-sha1kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 985 +#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme OBJ_x9_63_scheme,3L + +#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme "dhSinglePass-cofactorDH-sha224kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 986 +#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme OBJ_secg_scheme,14L,0L + +#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme "dhSinglePass-cofactorDH-sha256kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 987 +#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme OBJ_secg_scheme,14L,1L + +#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme "dhSinglePass-cofactorDH-sha384kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 988 +#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme OBJ_secg_scheme,14L,2L + +#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme "dhSinglePass-cofactorDH-sha512kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 989 +#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme OBJ_secg_scheme,14L,3L + +#define SN_dh_std_kdf "dh-std-kdf" +#define NID_dh_std_kdf 990 + +#define SN_dh_cofactor_kdf "dh-cofactor-kdf" +#define NID_dh_cofactor_kdf 991 + +#define SN_ct_precert_scts "ct_precert_scts" +#define LN_ct_precert_scts "CT Precertificate SCTs" +#define NID_ct_precert_scts 1018 +#define OBJ_ct_precert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L + +#define SN_ct_precert_poison "ct_precert_poison" +#define LN_ct_precert_poison "CT Precertificate Poison" +#define NID_ct_precert_poison 1019 +#define OBJ_ct_precert_poison 1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L + +#define SN_ct_precert_signer "ct_precert_signer" +#define LN_ct_precert_signer "CT Precertificate Signer" +#define NID_ct_precert_signer 1020 +#define OBJ_ct_precert_signer 1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L + +#define SN_ct_cert_scts "ct_cert_scts" +#define LN_ct_cert_scts "CT Certificate SCTs" +#define NID_ct_cert_scts 1021 +#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L + +#define SN_teletrust "teletrust" +#define NID_teletrust 920 +#define OBJ_teletrust OBJ_identified_organization,36L + +#define SN_brainpool "brainpool" +#define NID_brainpool 921 +#define OBJ_brainpool OBJ_teletrust,3L,3L,2L,8L,1L + +#define SN_brainpoolP160r1 "brainpoolP160r1" +#define NID_brainpoolP160r1 922 +#define OBJ_brainpoolP160r1 OBJ_brainpool,1L,1L + +#define SN_brainpoolP160t1 "brainpoolP160t1" +#define NID_brainpoolP160t1 923 +#define OBJ_brainpoolP160t1 OBJ_brainpool,1L,2L + +#define SN_brainpoolP192r1 "brainpoolP192r1" +#define NID_brainpoolP192r1 924 +#define OBJ_brainpoolP192r1 OBJ_brainpool,1L,3L + +#define SN_brainpoolP192t1 "brainpoolP192t1" +#define NID_brainpoolP192t1 925 +#define OBJ_brainpoolP192t1 OBJ_brainpool,1L,4L + +#define SN_brainpoolP224r1 "brainpoolP224r1" +#define NID_brainpoolP224r1 926 +#define OBJ_brainpoolP224r1 OBJ_brainpool,1L,5L + +#define SN_brainpoolP224t1 "brainpoolP224t1" +#define NID_brainpoolP224t1 927 +#define OBJ_brainpoolP224t1 OBJ_brainpool,1L,6L + +#define SN_brainpoolP256r1 "brainpoolP256r1" +#define NID_brainpoolP256r1 928 +#define OBJ_brainpoolP256r1 OBJ_brainpool,1L,7L + +#define SN_brainpoolP256t1 "brainpoolP256t1" +#define NID_brainpoolP256t1 929 +#define OBJ_brainpoolP256t1 OBJ_brainpool,1L,8L + +#define SN_brainpoolP320r1 "brainpoolP320r1" +#define NID_brainpoolP320r1 930 +#define OBJ_brainpoolP320r1 OBJ_brainpool,1L,9L + +#define SN_brainpoolP320t1 "brainpoolP320t1" +#define NID_brainpoolP320t1 931 +#define OBJ_brainpoolP320t1 OBJ_brainpool,1L,10L + +#define SN_brainpoolP384r1 "brainpoolP384r1" +#define NID_brainpoolP384r1 932 +#define OBJ_brainpoolP384r1 OBJ_brainpool,1L,11L + +#define SN_brainpoolP384t1 "brainpoolP384t1" +#define NID_brainpoolP384t1 933 +#define OBJ_brainpoolP384t1 OBJ_brainpool,1L,12L + +#define SN_brainpoolP512r1 "brainpoolP512r1" +#define NID_brainpoolP512r1 934 +#define OBJ_brainpoolP512r1 OBJ_brainpool,1L,13L + +#define SN_brainpoolP512t1 "brainpoolP512t1" +#define NID_brainpoolP512t1 935 +#define OBJ_brainpoolP512t1 OBJ_brainpool,1L,14L + +#define SN_FRP256v1 "FRP256v1" +#define NID_FRP256v1 936 +#define OBJ_FRP256v1 1L,2L,250L,1L,223L,101L,256L,1L + +#define SN_chacha20 "ChaCha" +#define LN_chacha20 "chacha" +#define NID_chacha20 937 + +#define SN_chacha20_poly1305 "ChaCha20-Poly1305" +#define LN_chacha20_poly1305 "chacha20-poly1305" +#define NID_chacha20_poly1305 967 + +#define SN_gost89_ecb "gost89-ecb" +#define NID_gost89_ecb 938 + +#define SN_gost89_cbc "gost89-cbc" +#define NID_gost89_cbc 939 + +#define SN_tc26 "tc26" +#define NID_tc26 940 +#define OBJ_tc26 OBJ_member_body,643L,7L,1L + +#define SN_id_tc26_gost3411_2012_256 "streebog256" +#define LN_id_tc26_gost3411_2012_256 "GOST R 34.11-2012 (256 bit)" +#define NID_id_tc26_gost3411_2012_256 941 +#define OBJ_id_tc26_gost3411_2012_256 OBJ_tc26,1L,2L,2L + +#define SN_id_tc26_gost3411_2012_512 "streebog512" +#define LN_id_tc26_gost3411_2012_512 "GOST R 34-11-2012 (512 bit)" +#define NID_id_tc26_gost3411_2012_512 942 +#define OBJ_id_tc26_gost3411_2012_512 OBJ_tc26,1L,2L,3L + +#define SN_id_tc26_hmac_gost_3411_12_256 "id-tc26-hmac-gost-3411-12-256" +#define LN_id_tc26_hmac_gost_3411_12_256 "HMAC STREEBOG 256" +#define NID_id_tc26_hmac_gost_3411_12_256 999 +#define OBJ_id_tc26_hmac_gost_3411_12_256 OBJ_tc26,1L,4L,1L + +#define SN_id_tc26_hmac_gost_3411_12_512 "id-tc26-hmac-gost-3411-12-512" +#define LN_id_tc26_hmac_gost_3411_12_512 "HMAC STREEBOG 512" +#define NID_id_tc26_hmac_gost_3411_12_512 1000 +#define OBJ_id_tc26_hmac_gost_3411_12_512 OBJ_tc26,1L,4L,2L + +#define SN_id_tc26_gost_3410_12_256_paramSetA "id-tc26-gost-3410-12-256-paramSetA" +#define LN_id_tc26_gost_3410_12_256_paramSetA "GOST R 34.10-2012 (256 bit) ParamSet A" +#define NID_id_tc26_gost_3410_12_256_paramSetA 993 +#define OBJ_id_tc26_gost_3410_12_256_paramSetA OBJ_tc26,2L,1L,1L,1L + +#define SN_id_tc26_gost_3410_12_256_paramSetB "id-tc26-gost-3410-12-256-paramSetB" +#define LN_id_tc26_gost_3410_12_256_paramSetB "GOST R 34.10-2012 (256 bit) ParamSet B" +#define NID_id_tc26_gost_3410_12_256_paramSetB 994 +#define OBJ_id_tc26_gost_3410_12_256_paramSetB OBJ_tc26,2L,1L,1L,2L + +#define SN_id_tc26_gost_3410_12_256_paramSetC "id-tc26-gost-3410-12-256-paramSetC" +#define LN_id_tc26_gost_3410_12_256_paramSetC "GOST R 34.10-2012 (256 bit) ParamSet C" +#define NID_id_tc26_gost_3410_12_256_paramSetC 995 +#define OBJ_id_tc26_gost_3410_12_256_paramSetC OBJ_tc26,2L,1L,1L,3L + +#define SN_id_tc26_gost_3410_12_256_paramSetD "id-tc26-gost-3410-12-256-paramSetD" +#define LN_id_tc26_gost_3410_12_256_paramSetD "GOST R 34.10-2012 (256 bit) ParamSet D" +#define NID_id_tc26_gost_3410_12_256_paramSetD 996 +#define OBJ_id_tc26_gost_3410_12_256_paramSetD OBJ_tc26,2L,1L,1L,4L + +#define SN_id_tc26_gost_3410_12_512_paramSetTest "id-tc26-gost-3410-12-512-paramSetTest" +#define LN_id_tc26_gost_3410_12_512_paramSetTest "GOST R 34.10-2012 (512 bit) testing parameter set" +#define NID_id_tc26_gost_3410_12_512_paramSetTest 997 +#define OBJ_id_tc26_gost_3410_12_512_paramSetTest OBJ_tc26,2L,1L,2L,0L + +#define SN_id_tc26_gost_3410_12_512_paramSetA "id-tc26-gost-3410-12-512-paramSetA" +#define LN_id_tc26_gost_3410_12_512_paramSetA "GOST R 34.10-2012 (512 bit) ParamSet A" +#define NID_id_tc26_gost_3410_12_512_paramSetA 943 +#define OBJ_id_tc26_gost_3410_12_512_paramSetA OBJ_tc26,2L,1L,2L,1L + +#define SN_id_tc26_gost_3410_12_512_paramSetB "id-tc26-gost-3410-12-512-paramSetB" +#define LN_id_tc26_gost_3410_12_512_paramSetB "GOST R 34.10-2012 (512 bit) ParamSet B" +#define NID_id_tc26_gost_3410_12_512_paramSetB 944 +#define OBJ_id_tc26_gost_3410_12_512_paramSetB OBJ_tc26,2L,1L,2L,2L + +#define SN_id_tc26_gost_3410_12_512_paramSetC "id-tc26-gost-3410-12-512-paramSetC" +#define LN_id_tc26_gost_3410_12_512_paramSetC "GOST R 34.10-2012 (512 bit) ParamSet C" +#define NID_id_tc26_gost_3410_12_512_paramSetC 998 +#define OBJ_id_tc26_gost_3410_12_512_paramSetC OBJ_tc26,2L,1L,2L,3L + +#define SN_id_tc26_gost_28147_param_Z "id-tc26-gost-28147-param-Z" +#define NID_id_tc26_gost_28147_param_Z 945 +#define OBJ_id_tc26_gost_28147_param_Z OBJ_tc26,2L,5L,1L,1L + +#define SN_id_tc26_gost3410_2012_256 "id-tc26-gost3410-2012-256" +#define LN_id_tc26_gost3410_2012_256 "GOST R 34.10-2012 (256 bit)" +#define NID_id_tc26_gost3410_2012_256 946 +#define OBJ_id_tc26_gost3410_2012_256 OBJ_tc26,1L,1L,1L + +#define SN_id_tc26_gost3410_2012_512 "id-tc26-gost3410-2012-512" +#define LN_id_tc26_gost3410_2012_512 "GOST R 34.10-2012 (512 bit)" +#define NID_id_tc26_gost3410_2012_512 947 +#define OBJ_id_tc26_gost3410_2012_512 OBJ_tc26,1L,1L,2L + +#define SN_id_tc26_signwithdigest_gost3410_2012_256 "id-tc26-signwithdigest-gost3410-2012-256" +#define LN_id_tc26_signwithdigest_gost3410_2012_256 "GOST R 34.11-2012 with GOST R 34.10-2012 (256 bit)" +#define NID_id_tc26_signwithdigest_gost3410_2012_256 948 +#define OBJ_id_tc26_signwithdigest_gost3410_2012_256 OBJ_tc26,1L,3L,2L + +#define SN_id_tc26_signwithdigest_gost3410_2012_512 "id-tc26-signwithdigest-gost3410-2012-512" +#define LN_id_tc26_signwithdigest_gost3410_2012_512 "GOST R 34.11-2012 with GOST R 34.10-2012 (512 bit)" +#define NID_id_tc26_signwithdigest_gost3410_2012_512 949 +#define OBJ_id_tc26_signwithdigest_gost3410_2012_512 OBJ_tc26,1L,3L,3L + +#define SN_X25519 "X25519" +#define NID_X25519 950 +#define OBJ_X25519 1L,3L,101L,110L + +#define SN_X448 "X448" +#define NID_X448 951 +#define OBJ_X448 1L,3L,101L,111L + +#define SN_Ed25519 "Ed25519" +#define NID_Ed25519 952 +#define OBJ_Ed25519 1L,3L,101L,112L + +#define SN_Ed448 "Ed448" +#define NID_Ed448 953 +#define OBJ_Ed448 1L,3L,101L,113L + +#define SN_Ed25519ph "Ed25519ph" +#define NID_Ed25519ph 954 +#define OBJ_Ed25519ph 1L,3L,101L,114L + +#define SN_Ed448ph "Ed448ph" +#define NID_Ed448ph 955 +#define OBJ_Ed448ph 1L,3L,101L,115L + +#define SN_kx_rsa "KxRSA" +#define LN_kx_rsa "kx-rsa" +#define NID_kx_rsa 959 + +#define SN_kx_ecdhe "KxECDHE" +#define LN_kx_ecdhe "kx-ecdhe" +#define NID_kx_ecdhe 960 + +#define SN_kx_dhe "KxDHE" +#define LN_kx_dhe "kx-dhe" +#define NID_kx_dhe 961 + +#define SN_kx_gost "KxGOST" +#define LN_kx_gost "kx-gost" +#define NID_kx_gost 962 + +#define SN_auth_rsa "AuthRSA" +#define LN_auth_rsa "auth-rsa" +#define NID_auth_rsa 963 + +#define SN_auth_ecdsa "AuthECDSA" +#define LN_auth_ecdsa "auth-ecdsa" +#define NID_auth_ecdsa 964 + +#define SN_auth_gost01 "AuthGOST01" +#define LN_auth_gost01 "auth-gost01" +#define NID_auth_gost01 965 + +#define SN_auth_null "AuthNULL" +#define LN_auth_null "auth-null" +#define NID_auth_null 966 + diff --git a/code/contrib/libfido2/include/openssl/objects.h b/code/contrib/libfido2/include/openssl/objects.h new file mode 100644 index 0000000..918928e --- /dev/null +++ b/code/contrib/libfido2/include/openssl/objects.h @@ -0,0 +1,1065 @@ +/* $OpenBSD: objects.h,v 1.17 2022/01/14 08:56:00 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_OBJECTS_H +#define HEADER_OBJECTS_H + +#define USE_OBJ_MAC + +#ifdef USE_OBJ_MAC +#include +#else +#define SN_undef "UNDEF" +#define LN_undef "undefined" +#define NID_undef 0 +#define OBJ_undef 0L + +#define SN_Algorithm "Algorithm" +#define LN_algorithm "algorithm" +#define NID_algorithm 38 +#define OBJ_algorithm 1L,3L,14L,3L,2L + +#define LN_rsadsi "rsadsi" +#define NID_rsadsi 1 +#define OBJ_rsadsi 1L,2L,840L,113549L + +#define LN_pkcs "pkcs" +#define NID_pkcs 2 +#define OBJ_pkcs OBJ_rsadsi,1L + +#define SN_md2 "MD2" +#define LN_md2 "md2" +#define NID_md2 3 +#define OBJ_md2 OBJ_rsadsi,2L,2L + +#define SN_md5 "MD5" +#define LN_md5 "md5" +#define NID_md5 4 +#define OBJ_md5 OBJ_rsadsi,2L,5L + +#define SN_rc4 "RC4" +#define LN_rc4 "rc4" +#define NID_rc4 5 +#define OBJ_rc4 OBJ_rsadsi,3L,4L + +#define LN_rsaEncryption "rsaEncryption" +#define NID_rsaEncryption 6 +#define OBJ_rsaEncryption OBJ_pkcs,1L,1L + +#define SN_md2WithRSAEncryption "RSA-MD2" +#define LN_md2WithRSAEncryption "md2WithRSAEncryption" +#define NID_md2WithRSAEncryption 7 +#define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L + +#define SN_md5WithRSAEncryption "RSA-MD5" +#define LN_md5WithRSAEncryption "md5WithRSAEncryption" +#define NID_md5WithRSAEncryption 8 +#define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L + +#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" +#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" +#define NID_pbeWithMD2AndDES_CBC 9 +#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L + +#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" +#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" +#define NID_pbeWithMD5AndDES_CBC 10 +#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L + +#define LN_X500 "X500" +#define NID_X500 11 +#define OBJ_X500 2L,5L + +#define LN_X509 "X509" +#define NID_X509 12 +#define OBJ_X509 OBJ_X500,4L + +#define SN_commonName "CN" +#define LN_commonName "commonName" +#define NID_commonName 13 +#define OBJ_commonName OBJ_X509,3L + +#define SN_countryName "C" +#define LN_countryName "countryName" +#define NID_countryName 14 +#define OBJ_countryName OBJ_X509,6L + +#define SN_localityName "L" +#define LN_localityName "localityName" +#define NID_localityName 15 +#define OBJ_localityName OBJ_X509,7L + +/* Postal Address? PA */ + +/* should be "ST" (rfc1327) but MS uses 'S' */ +#define SN_stateOrProvinceName "ST" +#define LN_stateOrProvinceName "stateOrProvinceName" +#define NID_stateOrProvinceName 16 +#define OBJ_stateOrProvinceName OBJ_X509,8L + +#define SN_organizationName "O" +#define LN_organizationName "organizationName" +#define NID_organizationName 17 +#define OBJ_organizationName OBJ_X509,10L + +#define SN_organizationalUnitName "OU" +#define LN_organizationalUnitName "organizationalUnitName" +#define NID_organizationalUnitName 18 +#define OBJ_organizationalUnitName OBJ_X509,11L + +#define SN_rsa "RSA" +#define LN_rsa "rsa" +#define NID_rsa 19 +#define OBJ_rsa OBJ_X500,8L,1L,1L + +#define LN_pkcs7 "pkcs7" +#define NID_pkcs7 20 +#define OBJ_pkcs7 OBJ_pkcs,7L + +#define LN_pkcs7_data "pkcs7-data" +#define NID_pkcs7_data 21 +#define OBJ_pkcs7_data OBJ_pkcs7,1L + +#define LN_pkcs7_signed "pkcs7-signedData" +#define NID_pkcs7_signed 22 +#define OBJ_pkcs7_signed OBJ_pkcs7,2L + +#define LN_pkcs7_enveloped "pkcs7-envelopedData" +#define NID_pkcs7_enveloped 23 +#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L + +#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" +#define NID_pkcs7_signedAndEnveloped 24 +#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L + +#define LN_pkcs7_digest "pkcs7-digestData" +#define NID_pkcs7_digest 25 +#define OBJ_pkcs7_digest OBJ_pkcs7,5L + +#define LN_pkcs7_encrypted "pkcs7-encryptedData" +#define NID_pkcs7_encrypted 26 +#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L + +#define LN_pkcs3 "pkcs3" +#define NID_pkcs3 27 +#define OBJ_pkcs3 OBJ_pkcs,3L + +#define LN_dhKeyAgreement "dhKeyAgreement" +#define NID_dhKeyAgreement 28 +#define OBJ_dhKeyAgreement OBJ_pkcs3,1L + +#define SN_des_ecb "DES-ECB" +#define LN_des_ecb "des-ecb" +#define NID_des_ecb 29 +#define OBJ_des_ecb OBJ_algorithm,6L + +#define SN_des_cfb64 "DES-CFB" +#define LN_des_cfb64 "des-cfb" +#define NID_des_cfb64 30 +/* IV + num */ +#define OBJ_des_cfb64 OBJ_algorithm,9L + +#define SN_des_cbc "DES-CBC" +#define LN_des_cbc "des-cbc" +#define NID_des_cbc 31 +/* IV */ +#define OBJ_des_cbc OBJ_algorithm,7L + +#define SN_des_ede "DES-EDE" +#define LN_des_ede "des-ede" +#define NID_des_ede 32 +/* ?? */ +#define OBJ_des_ede OBJ_algorithm,17L + +#define SN_des_ede3 "DES-EDE3" +#define LN_des_ede3 "des-ede3" +#define NID_des_ede3 33 + +#define SN_idea_cbc "IDEA-CBC" +#define LN_idea_cbc "idea-cbc" +#define NID_idea_cbc 34 +#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + +#define SN_idea_cfb64 "IDEA-CFB" +#define LN_idea_cfb64 "idea-cfb" +#define NID_idea_cfb64 35 + +#define SN_idea_ecb "IDEA-ECB" +#define LN_idea_ecb "idea-ecb" +#define NID_idea_ecb 36 + +#define SN_rc2_cbc "RC2-CBC" +#define LN_rc2_cbc "rc2-cbc" +#define NID_rc2_cbc 37 +#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L + +#define SN_rc2_ecb "RC2-ECB" +#define LN_rc2_ecb "rc2-ecb" +#define NID_rc2_ecb 38 + +#define SN_rc2_cfb64 "RC2-CFB" +#define LN_rc2_cfb64 "rc2-cfb" +#define NID_rc2_cfb64 39 + +#define SN_rc2_ofb64 "RC2-OFB" +#define LN_rc2_ofb64 "rc2-ofb" +#define NID_rc2_ofb64 40 + +#define SN_sha "SHA" +#define LN_sha "sha" +#define NID_sha 41 +#define OBJ_sha OBJ_algorithm,18L + +#define SN_shaWithRSAEncryption "RSA-SHA" +#define LN_shaWithRSAEncryption "shaWithRSAEncryption" +#define NID_shaWithRSAEncryption 42 +#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L + +#define SN_des_ede_cbc "DES-EDE-CBC" +#define LN_des_ede_cbc "des-ede-cbc" +#define NID_des_ede_cbc 43 + +#define SN_des_ede3_cbc "DES-EDE3-CBC" +#define LN_des_ede3_cbc "des-ede3-cbc" +#define NID_des_ede3_cbc 44 +#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L + +#define SN_des_ofb64 "DES-OFB" +#define LN_des_ofb64 "des-ofb" +#define NID_des_ofb64 45 +#define OBJ_des_ofb64 OBJ_algorithm,8L + +#define SN_idea_ofb64 "IDEA-OFB" +#define LN_idea_ofb64 "idea-ofb" +#define NID_idea_ofb64 46 + +#define LN_pkcs9 "pkcs9" +#define NID_pkcs9 47 +#define OBJ_pkcs9 OBJ_pkcs,9L + +#define SN_pkcs9_emailAddress "Email" +#define LN_pkcs9_emailAddress "emailAddress" +#define NID_pkcs9_emailAddress 48 +#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L + +#define LN_pkcs9_unstructuredName "unstructuredName" +#define NID_pkcs9_unstructuredName 49 +#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L + +#define LN_pkcs9_contentType "contentType" +#define NID_pkcs9_contentType 50 +#define OBJ_pkcs9_contentType OBJ_pkcs9,3L + +#define LN_pkcs9_messageDigest "messageDigest" +#define NID_pkcs9_messageDigest 51 +#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L + +#define LN_pkcs9_signingTime "signingTime" +#define NID_pkcs9_signingTime 52 +#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L + +#define LN_pkcs9_countersignature "countersignature" +#define NID_pkcs9_countersignature 53 +#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L + +#define LN_pkcs9_challengePassword "challengePassword" +#define NID_pkcs9_challengePassword 54 +#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L + +#define LN_pkcs9_unstructuredAddress "unstructuredAddress" +#define NID_pkcs9_unstructuredAddress 55 +#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L + +#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" +#define NID_pkcs9_extCertAttributes 56 +#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L + +#define SN_netscape "Netscape" +#define LN_netscape "Netscape Communications Corp." +#define NID_netscape 57 +#define OBJ_netscape 2L,16L,840L,1L,113730L + +#define SN_netscape_cert_extension "nsCertExt" +#define LN_netscape_cert_extension "Netscape Certificate Extension" +#define NID_netscape_cert_extension 58 +#define OBJ_netscape_cert_extension OBJ_netscape,1L + +#define SN_netscape_data_type "nsDataType" +#define LN_netscape_data_type "Netscape Data Type" +#define NID_netscape_data_type 59 +#define OBJ_netscape_data_type OBJ_netscape,2L + +#define SN_des_ede_cfb64 "DES-EDE-CFB" +#define LN_des_ede_cfb64 "des-ede-cfb" +#define NID_des_ede_cfb64 60 + +#define SN_des_ede3_cfb64 "DES-EDE3-CFB" +#define LN_des_ede3_cfb64 "des-ede3-cfb" +#define NID_des_ede3_cfb64 61 + +#define SN_des_ede_ofb64 "DES-EDE-OFB" +#define LN_des_ede_ofb64 "des-ede-ofb" +#define NID_des_ede_ofb64 62 + +#define SN_des_ede3_ofb64 "DES-EDE3-OFB" +#define LN_des_ede3_ofb64 "des-ede3-ofb" +#define NID_des_ede3_ofb64 63 + +/* I'm not sure about the object ID */ +#define SN_sha1 "SHA1" +#define LN_sha1 "sha1" +#define NID_sha1 64 +#define OBJ_sha1 OBJ_algorithm,26L +/* 28 Jun 1996 - eay */ +/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */ + +#define SN_sha1WithRSAEncryption "RSA-SHA1" +#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" +#define NID_sha1WithRSAEncryption 65 +#define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L + +#define SN_dsaWithSHA "DSA-SHA" +#define LN_dsaWithSHA "dsaWithSHA" +#define NID_dsaWithSHA 66 +#define OBJ_dsaWithSHA OBJ_algorithm,13L + +#define SN_dsa_2 "DSA-old" +#define LN_dsa_2 "dsaEncryption-old" +#define NID_dsa_2 67 +#define OBJ_dsa_2 OBJ_algorithm,12L + +/* proposed by microsoft to RSA */ +#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" +#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" +#define NID_pbeWithSHA1AndRC2_CBC 68 +#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L + +/* proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now + * defined explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something + * completely different. + */ +#define LN_id_pbkdf2 "PBKDF2" +#define NID_id_pbkdf2 69 +#define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L + +#define SN_dsaWithSHA1_2 "DSA-SHA1-old" +#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" +#define NID_dsaWithSHA1_2 70 +/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */ +#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L + +#define SN_netscape_cert_type "nsCertType" +#define LN_netscape_cert_type "Netscape Cert Type" +#define NID_netscape_cert_type 71 +#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L + +#define SN_netscape_base_url "nsBaseUrl" +#define LN_netscape_base_url "Netscape Base Url" +#define NID_netscape_base_url 72 +#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L + +#define SN_netscape_revocation_url "nsRevocationUrl" +#define LN_netscape_revocation_url "Netscape Revocation Url" +#define NID_netscape_revocation_url 73 +#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L + +#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" +#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" +#define NID_netscape_ca_revocation_url 74 +#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L + +#define SN_netscape_renewal_url "nsRenewalUrl" +#define LN_netscape_renewal_url "Netscape Renewal Url" +#define NID_netscape_renewal_url 75 +#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L + +#define SN_netscape_ca_policy_url "nsCaPolicyUrl" +#define LN_netscape_ca_policy_url "Netscape CA Policy Url" +#define NID_netscape_ca_policy_url 76 +#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L + +#define SN_netscape_ssl_server_name "nsSslServerName" +#define LN_netscape_ssl_server_name "Netscape SSL Server Name" +#define NID_netscape_ssl_server_name 77 +#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L + +#define SN_netscape_comment "nsComment" +#define LN_netscape_comment "Netscape Comment" +#define NID_netscape_comment 78 +#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L + +#define SN_netscape_cert_sequence "nsCertSequence" +#define LN_netscape_cert_sequence "Netscape Certificate Sequence" +#define NID_netscape_cert_sequence 79 +#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L + +#define SN_desx_cbc "DESX-CBC" +#define LN_desx_cbc "desx-cbc" +#define NID_desx_cbc 80 + +#define SN_id_ce "id-ce" +#define NID_id_ce 81 +#define OBJ_id_ce 2L,5L,29L + +#define SN_subject_key_identifier "subjectKeyIdentifier" +#define LN_subject_key_identifier "X509v3 Subject Key Identifier" +#define NID_subject_key_identifier 82 +#define OBJ_subject_key_identifier OBJ_id_ce,14L + +#define SN_key_usage "keyUsage" +#define LN_key_usage "X509v3 Key Usage" +#define NID_key_usage 83 +#define OBJ_key_usage OBJ_id_ce,15L + +#define SN_private_key_usage_period "privateKeyUsagePeriod" +#define LN_private_key_usage_period "X509v3 Private Key Usage Period" +#define NID_private_key_usage_period 84 +#define OBJ_private_key_usage_period OBJ_id_ce,16L + +#define SN_subject_alt_name "subjectAltName" +#define LN_subject_alt_name "X509v3 Subject Alternative Name" +#define NID_subject_alt_name 85 +#define OBJ_subject_alt_name OBJ_id_ce,17L + +#define SN_issuer_alt_name "issuerAltName" +#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" +#define NID_issuer_alt_name 86 +#define OBJ_issuer_alt_name OBJ_id_ce,18L + +#define SN_basic_constraints "basicConstraints" +#define LN_basic_constraints "X509v3 Basic Constraints" +#define NID_basic_constraints 87 +#define OBJ_basic_constraints OBJ_id_ce,19L + +#define SN_crl_number "crlNumber" +#define LN_crl_number "X509v3 CRL Number" +#define NID_crl_number 88 +#define OBJ_crl_number OBJ_id_ce,20L + +#define SN_certificate_policies "certificatePolicies" +#define LN_certificate_policies "X509v3 Certificate Policies" +#define NID_certificate_policies 89 +#define OBJ_certificate_policies OBJ_id_ce,32L + +#define SN_authority_key_identifier "authorityKeyIdentifier" +#define LN_authority_key_identifier "X509v3 Authority Key Identifier" +#define NID_authority_key_identifier 90 +#define OBJ_authority_key_identifier OBJ_id_ce,35L + +#define SN_bf_cbc "BF-CBC" +#define LN_bf_cbc "bf-cbc" +#define NID_bf_cbc 91 +#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L + +#define SN_bf_ecb "BF-ECB" +#define LN_bf_ecb "bf-ecb" +#define NID_bf_ecb 92 + +#define SN_bf_cfb64 "BF-CFB" +#define LN_bf_cfb64 "bf-cfb" +#define NID_bf_cfb64 93 + +#define SN_bf_ofb64 "BF-OFB" +#define LN_bf_ofb64 "bf-ofb" +#define NID_bf_ofb64 94 + +#define SN_mdc2 "MDC2" +#define LN_mdc2 "mdc2" +#define NID_mdc2 95 +#define OBJ_mdc2 2L,5L,8L,3L,101L +/* An alternative? 1L,3L,14L,3L,2L,19L */ + +#define SN_mdc2WithRSA "RSA-MDC2" +#define LN_mdc2WithRSA "mdc2withRSA" +#define NID_mdc2WithRSA 96 +#define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L + +#define SN_rc4_40 "RC4-40" +#define LN_rc4_40 "rc4-40" +#define NID_rc4_40 97 + +#define SN_rc2_40_cbc "RC2-40-CBC" +#define LN_rc2_40_cbc "rc2-40-cbc" +#define NID_rc2_40_cbc 98 + +#define SN_givenName "G" +#define LN_givenName "givenName" +#define NID_givenName 99 +#define OBJ_givenName OBJ_X509,42L + +#define SN_surname "S" +#define LN_surname "surname" +#define NID_surname 100 +#define OBJ_surname OBJ_X509,4L + +#define SN_initials "I" +#define LN_initials "initials" +#define NID_initials 101 +#define OBJ_initials OBJ_X509,43L + +#define SN_uniqueIdentifier "UID" +#define LN_uniqueIdentifier "uniqueIdentifier" +#define NID_uniqueIdentifier 102 +#define OBJ_uniqueIdentifier OBJ_X509,45L + +#define SN_crl_distribution_points "crlDistributionPoints" +#define LN_crl_distribution_points "X509v3 CRL Distribution Points" +#define NID_crl_distribution_points 103 +#define OBJ_crl_distribution_points OBJ_id_ce,31L + +#define SN_md5WithRSA "RSA-NP-MD5" +#define LN_md5WithRSA "md5WithRSA" +#define NID_md5WithRSA 104 +#define OBJ_md5WithRSA OBJ_algorithm,3L + +#define SN_serialNumber "SN" +#define LN_serialNumber "serialNumber" +#define NID_serialNumber 105 +#define OBJ_serialNumber OBJ_X509,5L + +#define SN_title "T" +#define LN_title "title" +#define NID_title 106 +#define OBJ_title OBJ_X509,12L + +#define SN_description "D" +#define LN_description "description" +#define NID_description 107 +#define OBJ_description OBJ_X509,13L + +/* CAST5 is CAST-128, I'm just sticking with the documentation */ +#define SN_cast5_cbc "CAST5-CBC" +#define LN_cast5_cbc "cast5-cbc" +#define NID_cast5_cbc 108 +#define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L + +#define SN_cast5_ecb "CAST5-ECB" +#define LN_cast5_ecb "cast5-ecb" +#define NID_cast5_ecb 109 + +#define SN_cast5_cfb64 "CAST5-CFB" +#define LN_cast5_cfb64 "cast5-cfb" +#define NID_cast5_cfb64 110 + +#define SN_cast5_ofb64 "CAST5-OFB" +#define LN_cast5_ofb64 "cast5-ofb" +#define NID_cast5_ofb64 111 + +#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" +#define NID_pbeWithMD5AndCast5_CBC 112 +#define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L + +/* This is one sun will soon be using :-( + * id-dsa-with-sha1 ID ::= { + * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 } + */ +#define SN_dsaWithSHA1 "DSA-SHA1" +#define LN_dsaWithSHA1 "dsaWithSHA1" +#define NID_dsaWithSHA1 113 +#define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L + +#define NID_md5_sha1 114 +#define SN_md5_sha1 "MD5-SHA1" +#define LN_md5_sha1 "md5-sha1" + +#define SN_sha1WithRSA "RSA-SHA1-2" +#define LN_sha1WithRSA "sha1WithRSA" +#define NID_sha1WithRSA 115 +#define OBJ_sha1WithRSA OBJ_algorithm,29L + +#define SN_dsa "DSA" +#define LN_dsa "dsaEncryption" +#define NID_dsa 116 +#define OBJ_dsa 1L,2L,840L,10040L,4L,1L + +#define SN_ripemd160 "RIPEMD160" +#define LN_ripemd160 "ripemd160" +#define NID_ripemd160 117 +#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L + +/* The name should actually be rsaSignatureWithripemd160, but I'm going + * to continue using the convention I'm using with the other ciphers */ +#define SN_ripemd160WithRSA "RSA-RIPEMD160" +#define LN_ripemd160WithRSA "ripemd160WithRSA" +#define NID_ripemd160WithRSA 119 +#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L + +/* Taken from rfc2040 + * RC5_CBC_Parameters ::= SEQUENCE { + * version INTEGER (v1_0(16)), + * rounds INTEGER (8..127), + * blockSizeInBits INTEGER (64, 128), + * iv OCTET STRING OPTIONAL + * } + */ +#define SN_rc5_cbc "RC5-CBC" +#define LN_rc5_cbc "rc5-cbc" +#define NID_rc5_cbc 120 +#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L + +#define SN_rc5_ecb "RC5-ECB" +#define LN_rc5_ecb "rc5-ecb" +#define NID_rc5_ecb 121 + +#define SN_rc5_cfb64 "RC5-CFB" +#define LN_rc5_cfb64 "rc5-cfb" +#define NID_rc5_cfb64 122 + +#define SN_rc5_ofb64 "RC5-OFB" +#define LN_rc5_ofb64 "rc5-ofb" +#define NID_rc5_ofb64 123 + +#define SN_rle_compression "RLE" +#define LN_rle_compression "run length compression" +#define NID_rle_compression 124 +#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L + +#define SN_zlib_compression "ZLIB" +#define LN_zlib_compression "zlib compression" +#define NID_zlib_compression 125 +#define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L + +#define SN_ext_key_usage "extendedKeyUsage" +#define LN_ext_key_usage "X509v3 Extended Key Usage" +#define NID_ext_key_usage 126 +#define OBJ_ext_key_usage OBJ_id_ce,37 + +#define SN_id_pkix "PKIX" +#define NID_id_pkix 127 +#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L + +#define SN_id_kp "id-kp" +#define NID_id_kp 128 +#define OBJ_id_kp OBJ_id_pkix,3L + +/* PKIX extended key usage OIDs */ + +#define SN_server_auth "serverAuth" +#define LN_server_auth "TLS Web Server Authentication" +#define NID_server_auth 129 +#define OBJ_server_auth OBJ_id_kp,1L + +#define SN_client_auth "clientAuth" +#define LN_client_auth "TLS Web Client Authentication" +#define NID_client_auth 130 +#define OBJ_client_auth OBJ_id_kp,2L + +#define SN_code_sign "codeSigning" +#define LN_code_sign "Code Signing" +#define NID_code_sign 131 +#define OBJ_code_sign OBJ_id_kp,3L + +#define SN_email_protect "emailProtection" +#define LN_email_protect "E-mail Protection" +#define NID_email_protect 132 +#define OBJ_email_protect OBJ_id_kp,4L + +#define SN_time_stamp "timeStamping" +#define LN_time_stamp "Time Stamping" +#define NID_time_stamp 133 +#define OBJ_time_stamp OBJ_id_kp,8L + +/* Additional extended key usage OIDs: Microsoft */ + +#define SN_ms_code_ind "msCodeInd" +#define LN_ms_code_ind "Microsoft Individual Code Signing" +#define NID_ms_code_ind 134 +#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L + +#define SN_ms_code_com "msCodeCom" +#define LN_ms_code_com "Microsoft Commercial Code Signing" +#define NID_ms_code_com 135 +#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L + +#define SN_ms_ctl_sign "msCTLSign" +#define LN_ms_ctl_sign "Microsoft Trust List Signing" +#define NID_ms_ctl_sign 136 +#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L + +#define SN_ms_sgc "msSGC" +#define LN_ms_sgc "Microsoft Server Gated Crypto" +#define NID_ms_sgc 137 +#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L + +#define SN_ms_efs "msEFS" +#define LN_ms_efs "Microsoft Encrypted File System" +#define NID_ms_efs 138 +#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L + +/* Additional usage: Netscape */ + +#define SN_ns_sgc "nsSGC" +#define LN_ns_sgc "Netscape Server Gated Crypto" +#define NID_ns_sgc 139 +#define OBJ_ns_sgc OBJ_netscape,4L,1L + +#define SN_delta_crl "deltaCRL" +#define LN_delta_crl "X509v3 Delta CRL Indicator" +#define NID_delta_crl 140 +#define OBJ_delta_crl OBJ_id_ce,27L + +#define SN_crl_reason "CRLReason" +#define LN_crl_reason "CRL Reason Code" +#define NID_crl_reason 141 +#define OBJ_crl_reason OBJ_id_ce,21L + +#define SN_invalidity_date "invalidityDate" +#define LN_invalidity_date "Invalidity Date" +#define NID_invalidity_date 142 +#define OBJ_invalidity_date OBJ_id_ce,24L + +#define SN_sxnet "SXNetID" +#define LN_sxnet "Strong Extranet ID" +#define NID_sxnet 143 +#define OBJ_sxnet 1L,3L,101L,1L,4L,1L + +/* PKCS12 and related OBJECT IDENTIFIERS */ + +#define OBJ_pkcs12 OBJ_pkcs,12L +#define OBJ_pkcs12_pbeids OBJ_pkcs12, 1 + +#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" +#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" +#define NID_pbe_WithSHA1And128BitRC4 144 +#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L + +#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" +#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" +#define NID_pbe_WithSHA1And40BitRC4 145 +#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L + +#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" +#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 +#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L + +#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" +#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 +#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L + +#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" +#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" +#define NID_pbe_WithSHA1And128BitRC2_CBC 148 +#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L + +#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" +#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" +#define NID_pbe_WithSHA1And40BitRC2_CBC 149 +#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L + +#define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L + +#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L + +#define LN_keyBag "keyBag" +#define NID_keyBag 150 +#define OBJ_keyBag OBJ_pkcs12_BagIds, 1L + +#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" +#define NID_pkcs8ShroudedKeyBag 151 +#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L + +#define LN_certBag "certBag" +#define NID_certBag 152 +#define OBJ_certBag OBJ_pkcs12_BagIds, 3L + +#define LN_crlBag "crlBag" +#define NID_crlBag 153 +#define OBJ_crlBag OBJ_pkcs12_BagIds, 4L + +#define LN_secretBag "secretBag" +#define NID_secretBag 154 +#define OBJ_secretBag OBJ_pkcs12_BagIds, 5L + +#define LN_safeContentsBag "safeContentsBag" +#define NID_safeContentsBag 155 +#define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L + +#define LN_friendlyName "friendlyName" +#define NID_friendlyName 156 +#define OBJ_friendlyName OBJ_pkcs9, 20L + +#define LN_localKeyID "localKeyID" +#define NID_localKeyID 157 +#define OBJ_localKeyID OBJ_pkcs9, 21L + +#define OBJ_certTypes OBJ_pkcs9, 22L + +#define LN_x509Certificate "x509Certificate" +#define NID_x509Certificate 158 +#define OBJ_x509Certificate OBJ_certTypes, 1L + +#define LN_sdsiCertificate "sdsiCertificate" +#define NID_sdsiCertificate 159 +#define OBJ_sdsiCertificate OBJ_certTypes, 2L + +#define OBJ_crlTypes OBJ_pkcs9, 23L + +#define LN_x509Crl "x509Crl" +#define NID_x509Crl 160 +#define OBJ_x509Crl OBJ_crlTypes, 1L + +/* PKCS#5 v2 OIDs */ + +#define LN_pbes2 "PBES2" +#define NID_pbes2 161 +#define OBJ_pbes2 OBJ_pkcs,5L,13L + +#define LN_pbmac1 "PBMAC1" +#define NID_pbmac1 162 +#define OBJ_pbmac1 OBJ_pkcs,5L,14L + +#define LN_hmacWithSHA1 "hmacWithSHA1" +#define NID_hmacWithSHA1 163 +#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L + +/* Policy Qualifier Ids */ + +#define LN_id_qt_cps "Policy Qualifier CPS" +#define SN_id_qt_cps "id-qt-cps" +#define NID_id_qt_cps 164 +#define OBJ_id_qt_cps OBJ_id_pkix,2L,1L + +#define LN_id_qt_unotice "Policy Qualifier User Notice" +#define SN_id_qt_unotice "id-qt-unotice" +#define NID_id_qt_unotice 165 +#define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L + +#define SN_rc2_64_cbc "RC2-64-CBC" +#define LN_rc2_64_cbc "rc2-64-cbc" +#define NID_rc2_64_cbc 166 + +#define SN_SMIMECapabilities "SMIME-CAPS" +#define LN_SMIMECapabilities "S/MIME Capabilities" +#define NID_SMIMECapabilities 167 +#define OBJ_SMIMECapabilities OBJ_pkcs9,15L + +#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" +#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" +#define NID_pbeWithMD2AndRC2_CBC 168 +#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L + +#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" +#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" +#define NID_pbeWithMD5AndRC2_CBC 169 +#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L + +#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" +#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" +#define NID_pbeWithSHA1AndDES_CBC 170 +#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L + +/* Extension request OIDs */ + +#define LN_ms_ext_req "Microsoft Extension Request" +#define SN_ms_ext_req "msExtReq" +#define NID_ms_ext_req 171 +#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L + +#define LN_ext_req "Extension Request" +#define SN_ext_req "extReq" +#define NID_ext_req 172 +#define OBJ_ext_req OBJ_pkcs9,14L + +#define SN_name "name" +#define LN_name "name" +#define NID_name 173 +#define OBJ_name OBJ_X509,41L + +#define SN_dnQualifier "dnQualifier" +#define LN_dnQualifier "dnQualifier" +#define NID_dnQualifier 174 +#define OBJ_dnQualifier OBJ_X509,46L + +#define SN_id_pe "id-pe" +#define NID_id_pe 175 +#define OBJ_id_pe OBJ_id_pkix,1L + +#define SN_id_ad "id-ad" +#define NID_id_ad 176 +#define OBJ_id_ad OBJ_id_pkix,48L + +#define SN_info_access "authorityInfoAccess" +#define LN_info_access "Authority Information Access" +#define NID_info_access 177 +#define OBJ_info_access OBJ_id_pe,1L + +#define SN_ad_OCSP "OCSP" +#define LN_ad_OCSP "OCSP" +#define NID_ad_OCSP 178 +#define OBJ_ad_OCSP OBJ_id_ad,1L + +#define SN_ad_ca_issuers "caIssuers" +#define LN_ad_ca_issuers "CA Issuers" +#define NID_ad_ca_issuers 179 +#define OBJ_ad_ca_issuers OBJ_id_ad,2L + +#define SN_OCSP_sign "OCSPSigning" +#define LN_OCSP_sign "OCSP Signing" +#define NID_OCSP_sign 180 +#define OBJ_OCSP_sign OBJ_id_kp,9L +#endif /* USE_OBJ_MAC */ + +#include +#include + +#define OBJ_NAME_TYPE_UNDEF 0x00 +#define OBJ_NAME_TYPE_MD_METH 0x01 +#define OBJ_NAME_TYPE_CIPHER_METH 0x02 +#define OBJ_NAME_TYPE_PKEY_METH 0x03 +#define OBJ_NAME_TYPE_COMP_METH 0x04 +#define OBJ_NAME_TYPE_NUM 0x05 + +#define OBJ_NAME_ALIAS 0x8000 + +#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01 +#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02 + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct obj_name_st { + int type; + int alias; + const char *name; + const char *data; +} OBJ_NAME; + +#define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c) + + +int OBJ_NAME_init(void); +int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), + int (*cmp_func)(const char *, const char *), + void (*free_func)(const char *, int, const char *)); +const char *OBJ_NAME_get(const char *name, int type); +int OBJ_NAME_add(const char *name, int type, const char *data); +int OBJ_NAME_remove(const char *name, int type); +void OBJ_NAME_cleanup(int type); /* -1 for everything */ +void OBJ_NAME_do_all(int type, void (*fn)(const OBJ_NAME *, void *arg), + void *arg); +void OBJ_NAME_do_all_sorted(int type, void (*fn)(const OBJ_NAME *, void *arg), + void *arg); + +ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o); +ASN1_OBJECT * OBJ_nid2obj(int n); +const char * OBJ_nid2ln(int n); +const char * OBJ_nid2sn(int n); +int OBJ_obj2nid(const ASN1_OBJECT *o); +ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name); +int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); +int OBJ_txt2nid(const char *s); +int OBJ_ln2nid(const char *s); +int OBJ_sn2nid(const char *s); +int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b); + +#if defined(LIBRESSL_INTERNAL) +const void * OBJ_bsearch_(const void *key, const void *base, int num, + int size, int (*cmp)(const void *, const void *)); +const void * OBJ_bsearch_ex_(const void *key, const void *base, int num, + int size, int (*cmp)(const void *, const void *), + int flags); +#endif + +int OBJ_new_nid(int num); +int OBJ_add_object(const ASN1_OBJECT *obj); +int OBJ_create(const char *oid, const char *sn, const char *ln); +void OBJ_cleanup(void); +int OBJ_create_objects(BIO *in); + +size_t OBJ_length(const ASN1_OBJECT *obj); +const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj); + +int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid); +int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid); +int OBJ_add_sigid(int signid, int dig_id, int pkey_id); +void OBJ_sigid_free(void); + +#if defined(LIBRESSL_CRYPTO_INTERNAL) +extern int obj_cleanup_defer; +void check_defer(int nid); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_OBJ_strings(void); + +/* Error codes for the OBJ functions. */ + +/* Function codes. */ +#define OBJ_F_OBJ_ADD_OBJECT 105 +#define OBJ_F_OBJ_CREATE 100 +#define OBJ_F_OBJ_DUP 101 +#define OBJ_F_OBJ_NAME_NEW_INDEX 106 +#define OBJ_F_OBJ_NID2LN 102 +#define OBJ_F_OBJ_NID2OBJ 103 +#define OBJ_F_OBJ_NID2SN 104 + +/* Reason codes. */ +#define OBJ_R_MALLOC_FAILURE 100 +#define OBJ_R_UNKNOWN_NID 101 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ocsp.h b/code/contrib/libfido2/include/openssl/ocsp.h new file mode 100644 index 0000000..f869f8a --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ocsp.h @@ -0,0 +1,488 @@ +/* $OpenBSD: ocsp.h,v 1.19 2022/01/14 08:32:26 tb Exp $ */ +/* Written by Tom Titchener for the OpenSSL + * project. */ + +/* History: + This file was transfered to Richard Levitte from CertCo by Kathy + Weinhold in mid-spring 2000 to be included in OpenSSL or released + as a patch kit. */ + +/* ==================================================================== + * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_OCSP_H +#define HEADER_OCSP_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * CRLReason ::= ENUMERATED { + * unspecified (0), + * keyCompromise (1), + * cACompromise (2), + * affiliationChanged (3), + * superseded (4), + * cessationOfOperation (5), + * certificateHold (6), + * removeFromCRL (8) } + */ +#define OCSP_REVOKED_STATUS_NOSTATUS -1 +#define OCSP_REVOKED_STATUS_UNSPECIFIED 0 +#define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1 +#define OCSP_REVOKED_STATUS_CACOMPROMISE 2 +#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3 +#define OCSP_REVOKED_STATUS_SUPERSEDED 4 +#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5 +#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6 +#define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8 + + +/* Various flags and values */ + +#define OCSP_DEFAULT_NONCE_LENGTH 16 + +#define OCSP_NOCERTS 0x1 +#define OCSP_NOINTERN 0x2 +#define OCSP_NOSIGS 0x4 +#define OCSP_NOCHAIN 0x8 +#define OCSP_NOVERIFY 0x10 +#define OCSP_NOEXPLICIT 0x20 +#define OCSP_NOCASIGN 0x40 +#define OCSP_NODELEGATED 0x80 +#define OCSP_NOCHECKS 0x100 +#define OCSP_TRUSTOTHER 0x200 +#define OCSP_RESPID_KEY 0x400 +#define OCSP_NOTIME 0x800 + +typedef struct ocsp_cert_id_st OCSP_CERTID; + +DECLARE_STACK_OF(OCSP_CERTID) + +typedef struct ocsp_one_request_st OCSP_ONEREQ; + +DECLARE_STACK_OF(OCSP_ONEREQ) + +typedef struct ocsp_req_info_st OCSP_REQINFO; +typedef struct ocsp_signature_st OCSP_SIGNATURE; +typedef struct ocsp_request_st OCSP_REQUEST; + +#define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 +#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 +#define OCSP_RESPONSE_STATUS_INTERNALERROR 2 +#define OCSP_RESPONSE_STATUS_TRYLATER 3 +#define OCSP_RESPONSE_STATUS_SIGREQUIRED 5 +#define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6 + +typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; + +#define V_OCSP_RESPID_NAME 0 +#define V_OCSP_RESPID_KEY 1 + +DECLARE_STACK_OF(OCSP_RESPID) + +OCSP_RESPID *OCSP_RESPID_new(void); +void OCSP_RESPID_free(OCSP_RESPID *a); +OCSP_RESPID *d2i_OCSP_RESPID(OCSP_RESPID **a, const unsigned char **in, long len); +int i2d_OCSP_RESPID(OCSP_RESPID *a, unsigned char **out); +extern const ASN1_ITEM OCSP_RESPID_it; + +typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; + +#define V_OCSP_CERTSTATUS_GOOD 0 +#define V_OCSP_CERTSTATUS_REVOKED 1 +#define V_OCSP_CERTSTATUS_UNKNOWN 2 + +typedef struct ocsp_cert_status_st OCSP_CERTSTATUS; +typedef struct ocsp_single_response_st OCSP_SINGLERESP; + +DECLARE_STACK_OF(OCSP_SINGLERESP) + +typedef struct ocsp_response_data_st OCSP_RESPDATA; + +typedef struct ocsp_basic_response_st OCSP_BASICRESP; + +typedef struct ocsp_crl_id_st OCSP_CRLID; +typedef struct ocsp_service_locator_st OCSP_SERVICELOC; + +#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST" +#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE" + +#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) \ + (OCSP_REQUEST *)PEM_ASN1_read_bio((char *(*)())d2i_OCSP_REQUEST, \ + PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL) + +#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb) \ + (OCSP_RESPONSE *)PEM_ASN1_read_bio((char *(*)())d2i_OCSP_RESPONSE, \ + PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL) + +#define PEM_write_bio_OCSP_REQUEST(bp,o) \ + PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\ + bp,(char *)o, NULL,NULL,0,NULL,NULL) + +#define PEM_write_bio_OCSP_RESPONSE(bp,o) \ + PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\ + bp,(char *)o, NULL,NULL,0,NULL,NULL) + +#define ASN1_BIT_STRING_digest(data,type,md,len) \ + ASN1_item_digest(&ASN1_BIT_STRING_it,type,data,md,len) + +#define OCSP_CERTSTATUS_dup(cs) \ + ASN1_item_dup(&OCSP_CERTSTATUS_it, cs) + +OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id); + +OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req); +OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req, + int maxline); +int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); +void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); +int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); +int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name, + const char *value); + +OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, + const X509 *issuer); + +OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, const X509_NAME *issuerName, + const ASN1_BIT_STRING *issuerKey, const ASN1_INTEGER *serialNumber); + +OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); + +int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len); +int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len); +int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs); +int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req); + +int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm); +int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert); + +int OCSP_request_sign(OCSP_REQUEST *req, X509 *signer, EVP_PKEY *key, + const EVP_MD *dgst, STACK_OF(X509) *certs, unsigned long flags); + +int OCSP_response_status(OCSP_RESPONSE *resp); +OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); + +const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); + +int OCSP_resp_count(OCSP_BASICRESP *bs); +OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); +const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs); +const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, + const ASN1_OCTET_STRING **pid, const X509_NAME **pname); + +int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); +int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, + ASN1_GENERALIZEDTIME **revtime, ASN1_GENERALIZEDTIME **thisupd, + ASN1_GENERALIZEDTIME **nextupd); +int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, + int *reason, ASN1_GENERALIZEDTIME **revtime, + ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **nextupd); +int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, + ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec); + +int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, + X509_STORE *store, unsigned long flags); + +int OCSP_parse_url(const char *url, char **phost, char **pport, + char **ppath, int *pssl); + +int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b); +int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b); + +int OCSP_request_onereq_count(OCSP_REQUEST *req); +OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i); +OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one); +int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, + ASN1_OCTET_STRING **pikeyHash, ASN1_INTEGER **pserial, + OCSP_CERTID *cid); +int OCSP_request_is_signed(OCSP_REQUEST *req); +OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs); +OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid, + int status, int reason, ASN1_TIME *revtime, ASN1_TIME *thisupd, + ASN1_TIME *nextupd); +int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); +int OCSP_basic_sign(OCSP_BASICRESP *brsp, X509 *signer, EVP_PKEY *key, + const EVP_MD *dgst, STACK_OF(X509) *certs, unsigned long flags); + +X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim); + +X509_EXTENSION *OCSP_accept_responses_new(char **oids); + +X509_EXTENSION *OCSP_archive_cutoff_new(char* tim); + +X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, const char **urls); + +int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); +int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); +int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj, + int lastpos); +int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, + int lastpos); +X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); +X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); +void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx); +int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, + int crit, unsigned long flags); +int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); + +int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); +int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); +int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, + int lastpos); +int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); +X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); +X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); +void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); +int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); + +int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); +int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); +int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj, + int lastpos); +int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, + int lastpos); +X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); +X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); +void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, + int *idx); +int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, + int crit, unsigned long flags); +int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); + +int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); +int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, + int lastpos); +int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, + const ASN1_OBJECT *obj, int lastpos); +int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, + int lastpos); +X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); +X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); +void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, + int *idx); +int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, + int crit, unsigned long flags); +int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, + int loc); +const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); + +OCSP_SINGLERESP *OCSP_SINGLERESP_new(void); +void OCSP_SINGLERESP_free(OCSP_SINGLERESP *a); +OCSP_SINGLERESP *d2i_OCSP_SINGLERESP(OCSP_SINGLERESP **a, const unsigned char **in, long len); +int i2d_OCSP_SINGLERESP(OCSP_SINGLERESP *a, unsigned char **out); +extern const ASN1_ITEM OCSP_SINGLERESP_it; +OCSP_CERTSTATUS *OCSP_CERTSTATUS_new(void); +void OCSP_CERTSTATUS_free(OCSP_CERTSTATUS *a); +OCSP_CERTSTATUS *d2i_OCSP_CERTSTATUS(OCSP_CERTSTATUS **a, const unsigned char **in, long len); +int i2d_OCSP_CERTSTATUS(OCSP_CERTSTATUS *a, unsigned char **out); +extern const ASN1_ITEM OCSP_CERTSTATUS_it; +OCSP_REVOKEDINFO *OCSP_REVOKEDINFO_new(void); +void OCSP_REVOKEDINFO_free(OCSP_REVOKEDINFO *a); +OCSP_REVOKEDINFO *d2i_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO **a, const unsigned char **in, long len); +int i2d_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO *a, unsigned char **out); +extern const ASN1_ITEM OCSP_REVOKEDINFO_it; +OCSP_BASICRESP *OCSP_BASICRESP_new(void); +void OCSP_BASICRESP_free(OCSP_BASICRESP *a); +OCSP_BASICRESP *d2i_OCSP_BASICRESP(OCSP_BASICRESP **a, const unsigned char **in, long len); +int i2d_OCSP_BASICRESP(OCSP_BASICRESP *a, unsigned char **out); +extern const ASN1_ITEM OCSP_BASICRESP_it; +OCSP_RESPDATA *OCSP_RESPDATA_new(void); +void OCSP_RESPDATA_free(OCSP_RESPDATA *a); +OCSP_RESPDATA *d2i_OCSP_RESPDATA(OCSP_RESPDATA **a, const unsigned char **in, long len); +int i2d_OCSP_RESPDATA(OCSP_RESPDATA *a, unsigned char **out); +extern const ASN1_ITEM OCSP_RESPDATA_it; +OCSP_RESPID *OCSP_RESPID_new(void); +void OCSP_RESPID_free(OCSP_RESPID *a); +OCSP_RESPID *d2i_OCSP_RESPID(OCSP_RESPID **a, const unsigned char **in, long len); +int i2d_OCSP_RESPID(OCSP_RESPID *a, unsigned char **out); +extern const ASN1_ITEM OCSP_RESPID_it; +OCSP_RESPONSE *OCSP_RESPONSE_new(void); +void OCSP_RESPONSE_free(OCSP_RESPONSE *a); +OCSP_RESPONSE *d2i_OCSP_RESPONSE(OCSP_RESPONSE **a, const unsigned char **in, long len); +int i2d_OCSP_RESPONSE(OCSP_RESPONSE *a, unsigned char **out); +OCSP_RESPONSE *d2i_OCSP_RESPONSE_bio(BIO *bp, OCSP_RESPONSE **a); +int i2d_OCSP_RESPONSE_bio(BIO *bp, OCSP_RESPONSE *a); +extern const ASN1_ITEM OCSP_RESPONSE_it; +OCSP_RESPBYTES *OCSP_RESPBYTES_new(void); +void OCSP_RESPBYTES_free(OCSP_RESPBYTES *a); +OCSP_RESPBYTES *d2i_OCSP_RESPBYTES(OCSP_RESPBYTES **a, const unsigned char **in, long len); +int i2d_OCSP_RESPBYTES(OCSP_RESPBYTES *a, unsigned char **out); +extern const ASN1_ITEM OCSP_RESPBYTES_it; +OCSP_ONEREQ *OCSP_ONEREQ_new(void); +void OCSP_ONEREQ_free(OCSP_ONEREQ *a); +OCSP_ONEREQ *d2i_OCSP_ONEREQ(OCSP_ONEREQ **a, const unsigned char **in, long len); +int i2d_OCSP_ONEREQ(OCSP_ONEREQ *a, unsigned char **out); +extern const ASN1_ITEM OCSP_ONEREQ_it; +OCSP_CERTID *OCSP_CERTID_new(void); +void OCSP_CERTID_free(OCSP_CERTID *a); +OCSP_CERTID *d2i_OCSP_CERTID(OCSP_CERTID **a, const unsigned char **in, long len); +int i2d_OCSP_CERTID(OCSP_CERTID *a, unsigned char **out); +extern const ASN1_ITEM OCSP_CERTID_it; +OCSP_REQUEST *OCSP_REQUEST_new(void); +void OCSP_REQUEST_free(OCSP_REQUEST *a); +OCSP_REQUEST *d2i_OCSP_REQUEST(OCSP_REQUEST **a, const unsigned char **in, long len); +int i2d_OCSP_REQUEST(OCSP_REQUEST *a, unsigned char **out); +OCSP_REQUEST *d2i_OCSP_REQUEST_bio(BIO *bp, OCSP_REQUEST **a); +int i2d_OCSP_REQUEST_bio(BIO *bp, OCSP_REQUEST *a); +extern const ASN1_ITEM OCSP_REQUEST_it; +OCSP_SIGNATURE *OCSP_SIGNATURE_new(void); +void OCSP_SIGNATURE_free(OCSP_SIGNATURE *a); +OCSP_SIGNATURE *d2i_OCSP_SIGNATURE(OCSP_SIGNATURE **a, const unsigned char **in, long len); +int i2d_OCSP_SIGNATURE(OCSP_SIGNATURE *a, unsigned char **out); +extern const ASN1_ITEM OCSP_SIGNATURE_it; +OCSP_REQINFO *OCSP_REQINFO_new(void); +void OCSP_REQINFO_free(OCSP_REQINFO *a); +OCSP_REQINFO *d2i_OCSP_REQINFO(OCSP_REQINFO **a, const unsigned char **in, long len); +int i2d_OCSP_REQINFO(OCSP_REQINFO *a, unsigned char **out); +extern const ASN1_ITEM OCSP_REQINFO_it; +OCSP_CRLID *OCSP_CRLID_new(void); +void OCSP_CRLID_free(OCSP_CRLID *a); +OCSP_CRLID *d2i_OCSP_CRLID(OCSP_CRLID **a, const unsigned char **in, long len); +int i2d_OCSP_CRLID(OCSP_CRLID *a, unsigned char **out); +extern const ASN1_ITEM OCSP_CRLID_it; +OCSP_SERVICELOC *OCSP_SERVICELOC_new(void); +void OCSP_SERVICELOC_free(OCSP_SERVICELOC *a); +OCSP_SERVICELOC *d2i_OCSP_SERVICELOC(OCSP_SERVICELOC **a, const unsigned char **in, long len); +int i2d_OCSP_SERVICELOC(OCSP_SERVICELOC *a, unsigned char **out); +extern const ASN1_ITEM OCSP_SERVICELOC_it; + +const char *OCSP_response_status_str(long s); +const char *OCSP_cert_status_str(long s); +const char *OCSP_crl_reason_str(long s); + +int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags); +int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags); + +int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, + X509_STORE *st, unsigned long flags); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_OCSP_strings(void); + +/* Error codes for the OCSP functions. */ + +/* Function codes. */ +#define OCSP_F_ASN1_STRING_ENCODE 100 +#define OCSP_F_D2I_OCSP_NONCE 102 +#define OCSP_F_OCSP_BASIC_ADD1_STATUS 103 +#define OCSP_F_OCSP_BASIC_SIGN 104 +#define OCSP_F_OCSP_BASIC_VERIFY 105 +#define OCSP_F_OCSP_CERT_ID_NEW 101 +#define OCSP_F_OCSP_CHECK_DELEGATED 106 +#define OCSP_F_OCSP_CHECK_IDS 107 +#define OCSP_F_OCSP_CHECK_ISSUER 108 +#define OCSP_F_OCSP_CHECK_VALIDITY 115 +#define OCSP_F_OCSP_MATCH_ISSUERID 109 +#define OCSP_F_OCSP_PARSE_URL 114 +#define OCSP_F_OCSP_REQUEST_SIGN 110 +#define OCSP_F_OCSP_REQUEST_VERIFY 116 +#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 +#define OCSP_F_OCSP_SENDREQ_BIO 112 +#define OCSP_F_OCSP_SENDREQ_NBIO 117 +#define OCSP_F_PARSE_HTTP_LINE1 118 +#define OCSP_F_REQUEST_VERIFY 113 + +/* Reason codes. */ +#define OCSP_R_BAD_DATA 100 +#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 +#define OCSP_R_DIGEST_ERR 102 +#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 +#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 +#define OCSP_R_ERROR_PARSING_URL 121 +#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 +#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 +#define OCSP_R_NOT_BASIC_RESPONSE 104 +#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 +#define OCSP_R_NO_CONTENT 106 +#define OCSP_R_NO_PUBLIC_KEY 107 +#define OCSP_R_NO_RESPONSE_DATA 108 +#define OCSP_R_NO_REVOKED_TIME 109 +#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 +#define OCSP_R_REQUEST_NOT_SIGNED 128 +#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 +#define OCSP_R_ROOT_CA_NOT_TRUSTED 112 +#define OCSP_R_SERVER_READ_ERROR 113 +#define OCSP_R_SERVER_RESPONSE_ERROR 114 +#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115 +#define OCSP_R_SERVER_WRITE_ERROR 116 +#define OCSP_R_SIGNATURE_FAILURE 117 +#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 +#define OCSP_R_STATUS_EXPIRED 125 +#define OCSP_R_STATUS_NOT_YET_VALID 126 +#define OCSP_R_STATUS_TOO_OLD 127 +#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 +#define OCSP_R_UNKNOWN_NID 120 +#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/opensslconf.h b/code/contrib/libfido2/include/openssl/opensslconf.h new file mode 100644 index 0000000..bb71768 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/opensslconf.h @@ -0,0 +1,153 @@ +#include +/* crypto/opensslconf.h.in */ + +#if defined(_MSC_VER) && !defined(__attribute__) +#define __attribute__(a) +#endif + +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define OPENSSLDIR "/etc/ssl" +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#define RC4_CHUNK unsigned long +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned int +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#undef BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#undef RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#undef DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#undef DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ diff --git a/code/contrib/libfido2/include/openssl/opensslfeatures.h b/code/contrib/libfido2/include/openssl/opensslfeatures.h new file mode 100644 index 0000000..49a5f15 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/opensslfeatures.h @@ -0,0 +1,120 @@ +/* + * Feature flags for LibreSSL... so you can actually tell when things + * are enabled, rather than not being able to tell when things are + * enabled (or possibly not yet not implemented, or removed!). + */ +#define LIBRESSL_HAS_TLS1_3 +#define LIBRESSL_HAS_DTLS1_2 + +#define OPENSSL_THREADS + +#define OPENSSL_NO_BUF_FREELISTS +#define OPENSSL_NO_GMP +#define OPENSSL_NO_JPAKE +#define OPENSSL_NO_KRB5 +#define OPENSSL_NO_RSAX +#define OPENSSL_NO_SHA0 +#define OPENSSL_NO_SSL2 +#define OPENSSL_NO_STORE + +/* + * OPENSSL_NO_* flags that currently appear in OpenSSL. + */ + +/* #define OPENSSL_NO_AFALGENG */ +/* #define OPENSSL_NO_ALGORITHMS */ +/* #define OPENSSL_NO_ARIA */ +/* #define OPENSSL_NO_ASM */ +#define OPENSSL_NO_ASYNC +/* #define OPENSSL_NO_AUTOALGINIT */ +/* #define OPENSSL_NO_AUTOERRINIT */ +/* #define OPENSSL_NO_AUTOLOAD_CONFIG */ +/* #define OPENSSL_NO_BF */ +/* #define OPENSSL_NO_BLAKE2 */ +/* #define OPENSSL_NO_CAMELLIA */ +/* #define OPENSSL_NO_CAPIENG */ +/* #define OPENSSL_NO_CAST */ +/* #define OPENSSL_NO_CHACHA */ +/* #define OPENSSL_NO_CMAC */ +/* #define OPENSSL_NO_CMS */ +#define OPENSSL_NO_COMP /* XXX */ +/* #define OPENSSL_NO_CRYPTO_MDEBUG */ +/* #define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE */ +/* #define OPENSSL_NO_CT */ +/* #define OPENSSL_NO_DECC_INIT */ +/* #define OPENSSL_NO_DES */ +/* #define OPENSSL_NO_DEVCRYPTOENG */ +/* #define OPENSSL_NO_DGRAM */ +/* #define OPENSSL_NO_DH */ +/* #define OPENSSL_NO_DSA */ +/* #define OPENSSL_NO_DSO */ +/* #define OPENSSL_NO_DTLS */ +/* #define OPENSSL_NO_DTLS1 */ +/* #define OPENSSL_NO_DTLS1_2 */ +/* #define OPENSSL_NO_DTLS1_2_METHOD */ +/* #define OPENSSL_NO_DTLS1_METHOD */ +#define OPENSSL_NO_DYNAMIC_ENGINE +/* #define OPENSSL_NO_EC */ +/* #define OPENSSL_NO_EC2M */ +#define OPENSSL_NO_EC_NISTP_64_GCC_128 +#define OPENSSL_NO_EGD +/* #define OPENSSL_NO_ENGINE */ +/* #define OPENSSL_NO_ERR */ +/* #define OPENSSL_NO_FUZZ_AFL */ +/* #define OPENSSL_NO_FUZZ_LIBFUZZER */ +/* #define OPENSSL_NO_GOST */ +#define OPENSSL_NO_HEARTBEATS +/* #define OPENSSL_NO_HW */ +/* #define OPENSSL_NO_HW_PADLOCK */ +/* #define OPENSSL_NO_IDEA */ +/* #define OPENSSL_NO_INLINE_ASM */ +#define OPENSSL_NO_MD2 +/* #define OPENSSL_NO_MD4 */ +/* #define OPENSSL_NO_MD5 */ +#define OPENSSL_NO_MDC2 +/* #define OPENSSL_NO_MULTIBLOCK */ +/* #define OPENSSL_NO_NEXTPROTONEG */ +/* #define OPENSSL_NO_OCB */ +/* #define OPENSSL_NO_OCSP */ +/* #define OPENSSL_NO_PINSHARED */ +/* #define OPENSSL_NO_POLY1305 */ +/* #define OPENSSL_NO_POSIX_IO */ +#define OPENSSL_NO_PSK +/* #define OPENSSL_NO_RC2 */ +/* #define OPENSSL_NO_RC4 */ +#define OPENSSL_NO_RC5 +/* #define OPENSSL_NO_RDRAND */ +/* #define OPENSSL_NO_RFC3779 */ +/* #define OPENSSL_NO_RMD160 */ +/* #define OPENSSL_NO_RSA */ +/* #define OPENSSL_NO_SCRYPT */ +#define OPENSSL_NO_SCTP +/* #define OPENSSL_NO_SECURE_MEMORY */ +#define OPENSSL_NO_SEED +/* #define OPENSSL_NO_SIPHASH */ +/* #define OPENSSL_NO_SM2 */ +/* #define OPENSSL_NO_SM3 */ +/* #define OPENSSL_NO_SM4 */ +/* #define OPENSSL_NO_SOCK */ +#define OPENSSL_NO_SRP +/* #define OPENSSL_NO_SRTP */ +#define OPENSSL_NO_SSL3 +#define OPENSSL_NO_SSL3_METHOD +#define OPENSSL_NO_SSL_TRACE +/* #define OPENSSL_NO_STATIC_ENGINE */ +/* #define OPENSSL_NO_STDIO */ +/* #define OPENSSL_NO_TLS */ +/* #define OPENSSL_NO_TLS1 */ +/* #define OPENSSL_NO_TLS1_1 */ +/* #define OPENSSL_NO_TLS1_1_METHOD */ +/* #define OPENSSL_NO_TLS1_2 */ +/* #define OPENSSL_NO_TLS1_2_METHOD */ +#ifndef LIBRESSL_HAS_TLS1_3 +#define OPENSSL_NO_TLS1_3 +#endif +/* #define OPENSSL_NO_TLS1_METHOD */ +/* #define OPENSSL_NO_TS */ +/* #define OPENSSL_NO_UI_CONSOLE */ +/* #define OPENSSL_NO_UNIT_TEST */ +/* #define OPENSSL_NO_WEAK_SSL_CIPHERS */ +/* #define OPENSSL_NO_WHIRLPOOL */ diff --git a/code/contrib/libfido2/include/openssl/opensslv.h b/code/contrib/libfido2/include/openssl/opensslv.h new file mode 100644 index 0000000..1cafae6 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/opensslv.h @@ -0,0 +1,18 @@ +/* $OpenBSD: opensslv.h,v 1.69 2022/03/15 21:15:08 bcook Exp $ */ +#ifndef HEADER_OPENSSLV_H +#define HEADER_OPENSSLV_H + +/* These will change with each release of LibreSSL-portable */ +#define LIBRESSL_VERSION_NUMBER 0x3050200fL +/* ^ Patch starts here */ +#define LIBRESSL_VERSION_TEXT "LibreSSL 3.5.2" + +/* These will never change */ +#define OPENSSL_VERSION_NUMBER 0x20000000L +#define OPENSSL_VERSION_TEXT LIBRESSL_VERSION_TEXT +#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT + +#define SHLIB_VERSION_HISTORY "" +#define SHLIB_VERSION_NUMBER "1.0.0" + +#endif /* HEADER_OPENSSLV_H */ diff --git a/code/contrib/libfido2/include/openssl/ossl_typ.h b/code/contrib/libfido2/include/openssl/ossl_typ.h new file mode 100644 index 0000000..f4796ba --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ossl_typ.h @@ -0,0 +1,212 @@ +/* $OpenBSD: ossl_typ.h,v 1.21 2022/01/14 08:59:30 tb Exp $ */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_OPENSSL_TYPES_H +#define HEADER_OPENSSL_TYPES_H + +#include + +typedef struct asn1_string_st ASN1_INTEGER; +typedef struct asn1_string_st ASN1_ENUMERATED; +typedef struct asn1_string_st ASN1_BIT_STRING; +typedef struct asn1_string_st ASN1_OCTET_STRING; +typedef struct asn1_string_st ASN1_PRINTABLESTRING; +typedef struct asn1_string_st ASN1_T61STRING; +typedef struct asn1_string_st ASN1_IA5STRING; +typedef struct asn1_string_st ASN1_GENERALSTRING; +typedef struct asn1_string_st ASN1_UNIVERSALSTRING; +typedef struct asn1_string_st ASN1_BMPSTRING; +typedef struct asn1_string_st ASN1_UTCTIME; +typedef struct asn1_string_st ASN1_TIME; +typedef struct asn1_string_st ASN1_GENERALIZEDTIME; +typedef struct asn1_string_st ASN1_VISIBLESTRING; +typedef struct asn1_string_st ASN1_UTF8STRING; +typedef struct asn1_string_st ASN1_STRING; +typedef int ASN1_BOOLEAN; +typedef int ASN1_NULL; + +typedef struct asn1_object_st ASN1_OBJECT; + +typedef struct ASN1_ITEM_st ASN1_ITEM; +typedef struct asn1_pctx_st ASN1_PCTX; + +#if defined(_WIN32) && defined(__WINCRYPT_H__) +#ifndef LIBRESSL_INTERNAL +#ifdef _MSC_VER +#pragma message("Warning, overriding WinCrypt defines") +#else +#warning overriding WinCrypt defines +#endif +#endif +#undef X509_NAME +#undef X509_CERT_PAIR +#undef X509_EXTENSIONS +#undef OCSP_REQUEST +#undef OCSP_RESPONSE +#undef PKCS7_ISSUER_AND_SERIAL +#endif + +#ifdef BIGNUM +#undef BIGNUM +#endif +typedef struct bignum_st BIGNUM; +typedef struct bignum_ctx BN_CTX; +typedef struct bn_blinding_st BN_BLINDING; +typedef struct bn_mont_ctx_st BN_MONT_CTX; +typedef struct bn_recp_ctx_st BN_RECP_CTX; +typedef struct bn_gencb_st BN_GENCB; + +typedef struct bio_st BIO; +typedef struct buf_mem_st BUF_MEM; + +typedef struct comp_ctx_st COMP_CTX; +typedef struct comp_method_st COMP_METHOD; + +typedef struct evp_cipher_st EVP_CIPHER; +typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; +typedef struct env_md_st EVP_MD; +typedef struct env_md_ctx_st EVP_MD_CTX; +typedef struct evp_pkey_st EVP_PKEY; + +typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; + +typedef struct evp_pkey_method_st EVP_PKEY_METHOD; +typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; + +typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX; + +typedef struct hmac_ctx_st HMAC_CTX; + +typedef struct dh_st DH; +typedef struct dh_method DH_METHOD; + +typedef struct dsa_st DSA; +typedef struct dsa_method DSA_METHOD; + +typedef struct rsa_st RSA; +typedef struct rsa_meth_st RSA_METHOD; +typedef struct rsa_pss_params_st RSA_PSS_PARAMS; + +typedef struct rand_meth_st RAND_METHOD; + +typedef struct ecdh_method ECDH_METHOD; +typedef struct ecdsa_method ECDSA_METHOD; + +typedef struct x509_st X509; +typedef struct X509_algor_st X509_ALGOR; +typedef struct X509_crl_st X509_CRL; +typedef struct x509_crl_method_st X509_CRL_METHOD; +typedef struct x509_revoked_st X509_REVOKED; +typedef struct X509_name_st X509_NAME; +typedef struct X509_pubkey_st X509_PUBKEY; +typedef struct x509_store_st X509_STORE; +typedef struct x509_store_ctx_st X509_STORE_CTX; + +typedef struct x509_object_st X509_OBJECT; +typedef struct x509_lookup_st X509_LOOKUP; +typedef struct x509_lookup_method_st X509_LOOKUP_METHOD; +typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM; + +typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; + +typedef struct v3_ext_ctx X509V3_CTX; +typedef struct conf_st CONF; + +typedef struct store_st STORE; +typedef struct store_method_st STORE_METHOD; + +typedef struct ui_st UI; +typedef struct ui_method_st UI_METHOD; + +typedef struct st_ERR_FNS ERR_FNS; + +typedef struct engine_st ENGINE; +typedef struct ssl_st SSL; +typedef struct ssl_ctx_st SSL_CTX; + +typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; +typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; +typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; +typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; + +typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; +typedef struct DIST_POINT_st DIST_POINT; +typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; +typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; + +/* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ +#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ +#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ + +typedef struct crypto_ex_data_st CRYPTO_EX_DATA; +/* Callback types for crypto.h */ +typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, + void *from_d, int idx, long argl, void *argp); + +typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; +typedef struct ocsp_response_st OCSP_RESPONSE; +typedef struct ocsp_responder_id_st OCSP_RESPID; + +typedef struct sct_st SCT; +typedef struct sct_ctx_st SCT_CTX; +typedef struct ctlog_st CTLOG; +typedef struct ctlog_store_st CTLOG_STORE; +typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX; + +#endif /* def HEADER_OPENSSL_TYPES_H */ diff --git a/code/contrib/libfido2/include/openssl/pem.h b/code/contrib/libfido2/include/openssl/pem.h new file mode 100644 index 0000000..95f1e03 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/pem.h @@ -0,0 +1,602 @@ +/* $OpenBSD: pem.h,v 1.23 2022/01/14 07:52:24 tb Exp $ */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_PEM_H +#define HEADER_PEM_H + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif +#ifndef OPENSSL_NO_STACK +#include +#endif +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PEM_BUFSIZE 1024 + +#define PEM_OBJ_UNDEF 0 +#define PEM_OBJ_X509 1 +#define PEM_OBJ_X509_REQ 2 +#define PEM_OBJ_CRL 3 +#define PEM_OBJ_SSL_SESSION 4 +#define PEM_OBJ_PRIV_KEY 10 +#define PEM_OBJ_PRIV_RSA 11 +#define PEM_OBJ_PRIV_DSA 12 +#define PEM_OBJ_PRIV_DH 13 +#define PEM_OBJ_PUB_RSA 14 +#define PEM_OBJ_PUB_DSA 15 +#define PEM_OBJ_PUB_DH 16 +#define PEM_OBJ_DHPARAMS 17 +#define PEM_OBJ_DSAPARAMS 18 +#define PEM_OBJ_PRIV_RSA_PUBLIC 19 +#define PEM_OBJ_PRIV_ECDSA 20 +#define PEM_OBJ_PUB_ECDSA 21 +#define PEM_OBJ_ECPARAMETERS 22 + +#define PEM_ERROR 30 +#define PEM_DEK_DES_CBC 40 +#define PEM_DEK_IDEA_CBC 45 +#define PEM_DEK_DES_EDE 50 +#define PEM_DEK_DES_ECB 60 +#define PEM_DEK_RSA 70 +#define PEM_DEK_RSA_MD2 80 +#define PEM_DEK_RSA_MD5 90 + +#define PEM_MD_MD2 NID_md2 +#define PEM_MD_MD5 NID_md5 +#define PEM_MD_SHA NID_sha +#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption +#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption +#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption + +#define PEM_STRING_X509_OLD "X509 CERTIFICATE" +#define PEM_STRING_X509 "CERTIFICATE" +#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" +#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" +#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" +#define PEM_STRING_X509_CRL "X509 CRL" +#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" +#define PEM_STRING_PUBLIC "PUBLIC KEY" +#define PEM_STRING_RSA "RSA PRIVATE KEY" +#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" +#define PEM_STRING_DSA "DSA PRIVATE KEY" +#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" +#define PEM_STRING_PKCS7 "PKCS7" +#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" +#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" +#define PEM_STRING_PKCS8INF "PRIVATE KEY" +#define PEM_STRING_DHPARAMS "DH PARAMETERS" +#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" +#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" +#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" +#define PEM_STRING_ECPARAMETERS "EC PARAMETERS" +#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" +#define PEM_STRING_PARAMETERS "PARAMETERS" +#define PEM_STRING_CMS "CMS" + +/* enc_type is one off */ +#define PEM_TYPE_ENCRYPTED 10 +#define PEM_TYPE_MIC_ONLY 20 +#define PEM_TYPE_MIC_CLEAR 30 +#define PEM_TYPE_CLEAR 40 + +typedef struct pem_recip_st { + char *name; + X509_NAME *dn; + + int cipher; + int key_enc; + /* char iv[8]; unused and wrong size */ +} PEM_USER; + +typedef struct pem_ctx_st { + int type; /* what type of object */ + + struct { + int version; + int mode; + } proc_type; + + char *domain; + + struct { + int cipher; + /* unused, and wrong size + unsigned char iv[8]; */ + } DEK_info; + + PEM_USER *originator; + + int num_recipient; + PEM_USER **recipient; + + /* XXX(ben): don#t think this is used! + STACK *x509_chain; / * certificate chain */ + EVP_MD *md; /* signature type */ + + int md_enc; /* is the md encrypted or not? */ + int md_len; /* length of md_data */ + char *md_data; /* message digest, could be pkey encrypted */ + + EVP_CIPHER *dec; /* date encryption cipher */ + int key_len; /* key length */ + unsigned char *key; /* key */ + /* unused, and wrong size + unsigned char iv[8]; */ + + int data_enc; /* is the data encrypted */ + int data_len; + unsigned char *data; +} PEM_CTX; + +#ifndef LIBRESSL_INTERNAL +/* These macros make the PEM_read/PEM_write functions easier to maintain and + * write. Now they are all implemented with either: + * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) + */ + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ +type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ +{ \ +return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \ +} + +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, type *x) \ +{ \ +return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \ +} + +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, const type *x) \ +{ \ +return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \ +} + +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, \ + void *u) \ + { \ + return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ + } + +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, \ + void *u) \ + { \ + return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ + } + + +#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ +type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ +{ \ +return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \ +} + +#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, type *x) \ +{ \ +return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \ +} + +#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, const type *x) \ +{ \ +return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \ +} + +#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ + { \ + return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \ + } + +#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ + { \ + return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \ + } + +#define IMPLEMENT_PEM_write(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_read_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb(name, type, str, asn1) + +#endif + +/* These are the same except they are for the declarations */ + + +#define DECLARE_PEM_read_fp(name, type) \ + type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_fp(name, type) \ + int PEM_write_##name(FILE *fp, type *x); + +#define DECLARE_PEM_write_fp_const(name, type) \ + int PEM_write_##name(FILE *fp, const type *x); + +#define DECLARE_PEM_write_cb_fp(name, type) \ + int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + + +#ifndef OPENSSL_NO_BIO +#define DECLARE_PEM_read_bio(name, type) \ + type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_bio(name, type) \ + int PEM_write_bio_##name(BIO *bp, type *x); + +#define DECLARE_PEM_write_bio_const(name, type) \ + int PEM_write_bio_##name(BIO *bp, const type *x); + +#define DECLARE_PEM_write_cb_bio(name, type) \ + int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + +#else + +#define DECLARE_PEM_read_bio(name, type) /**/ +#define DECLARE_PEM_write_bio(name, type) /**/ +#define DECLARE_PEM_write_bio_const(name, type) /**/ +#define DECLARE_PEM_write_cb_bio(name, type) /**/ + +#endif + +#define DECLARE_PEM_write(name, type) \ + DECLARE_PEM_write_bio(name, type) \ + DECLARE_PEM_write_fp(name, type) + +#define DECLARE_PEM_write_const(name, type) \ + DECLARE_PEM_write_bio_const(name, type) \ + DECLARE_PEM_write_fp_const(name, type) + +#define DECLARE_PEM_write_cb(name, type) \ + DECLARE_PEM_write_cb_bio(name, type) \ + DECLARE_PEM_write_cb_fp(name, type) + +#define DECLARE_PEM_read(name, type) \ + DECLARE_PEM_read_bio(name, type) \ + DECLARE_PEM_read_fp(name, type) + +#define DECLARE_PEM_rw(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write(name, type) + +#define DECLARE_PEM_rw_const(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_const(name, type) + +#define DECLARE_PEM_rw_cb(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_cb(name, type) + +typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); + +int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); +int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data, long *len, + pem_password_cb *callback, void *u); + +#ifndef OPENSSL_NO_BIO +int PEM_read_bio(BIO *bp, char **name, char **header, + unsigned char **data, long *len); +int PEM_write_bio(BIO *bp, const char *name, const char *hdr, + const unsigned char *data, long len); +int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, + const char *name, BIO *bp, pem_password_cb *cb, void *u); +void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, + void **x, pem_password_cb *cb, void *u); +int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x, + const EVP_CIPHER *enc, unsigned char *kstr, int klen, + pem_password_cb *cb, void *u); + +STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, + STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); +int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, + unsigned char *kstr, int klen, pem_password_cb *cd, void *u); +#endif + +int PEM_read(FILE *fp, char **name, char **header, + unsigned char **data, long *len); +int PEM_write(FILE *fp, const char *name, const char *hdr, + const unsigned char *data, long len); +void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, + pem_password_cb *cb, void *u); +int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, + void *x, const EVP_CIPHER *enc, unsigned char *kstr, + int klen, pem_password_cb *callback, void *u); +STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u); + +int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); +int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); +int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, + unsigned int *siglen, EVP_PKEY *pkey); + +int PEM_def_callback(char *buf, int num, int w, void *key); +void PEM_proc_type(char *buf, int type); +void PEM_dek_info(char *buf, const char *type, int len, char *str); + + +DECLARE_PEM_rw(X509, X509) + +DECLARE_PEM_rw(X509_AUX, X509) + +DECLARE_PEM_rw(X509_REQ, X509_REQ) +DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) + +DECLARE_PEM_rw(X509_CRL, X509_CRL) + +DECLARE_PEM_rw(PKCS7, PKCS7) + +DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) + +DECLARE_PEM_rw(PKCS8, X509_SIG) + +DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +#ifndef OPENSSL_NO_RSA + +DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) + +DECLARE_PEM_rw_const(RSAPublicKey, RSA) +DECLARE_PEM_rw(RSA_PUBKEY, RSA) + +#endif + +#ifndef OPENSSL_NO_DSA + +DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) + +DECLARE_PEM_rw(DSA_PUBKEY, DSA) + +DECLARE_PEM_rw_const(DSAparams, DSA) + +#endif + +#ifndef OPENSSL_NO_EC +DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP) +DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) +DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) +#endif + +#ifndef OPENSSL_NO_DH + +DECLARE_PEM_rw_const(DHparams, DH) + +#endif + +DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) + +DECLARE_PEM_rw(PUBKEY, EVP_PKEY) + +int PEM_write_bio_PrivateKey_traditional(BIO *bp, EVP_PKEY *x, + const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, + void *u); +int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, + char *, int, pem_password_cb *, void *); +int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); +EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, + void *u); + +int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); + +EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, + void *u); + +int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, pem_password_cb *cd, void *u); + +EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x); +int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x); + + +EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length); +EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length); +EVP_PKEY *b2i_PrivateKey_bio(BIO *in); +EVP_PKEY *b2i_PublicKey_bio(BIO *in); +int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk); +int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk); +#ifndef OPENSSL_NO_RC4 +EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u); +int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, + void *u); +#endif + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_PEM_strings(void); + +/* Error codes for the PEM functions. */ + +/* Function codes. */ +#define PEM_F_B2I_DSS 127 +#define PEM_F_B2I_PVK_BIO 128 +#define PEM_F_B2I_RSA 129 +#define PEM_F_CHECK_BITLEN_DSA 130 +#define PEM_F_CHECK_BITLEN_RSA 131 +#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 +#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 +#define PEM_F_DO_B2I 132 +#define PEM_F_DO_B2I_BIO 133 +#define PEM_F_DO_BLOB_HEADER 134 +#define PEM_F_DO_PK8PKEY 126 +#define PEM_F_DO_PK8PKEY_FP 125 +#define PEM_F_DO_PVK_BODY 135 +#define PEM_F_DO_PVK_HEADER 136 +#define PEM_F_I2B_PVK 137 +#define PEM_F_I2B_PVK_BIO 138 +#define PEM_F_LOAD_IV 101 +#define PEM_F_PEM_ASN1_READ 102 +#define PEM_F_PEM_ASN1_READ_BIO 103 +#define PEM_F_PEM_ASN1_WRITE 104 +#define PEM_F_PEM_ASN1_WRITE_BIO 105 +#define PEM_F_PEM_DEF_CALLBACK 100 +#define PEM_F_PEM_DO_HEADER 106 +#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 +#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 +#define PEM_F_PEM_PK8PKEY 119 +#define PEM_F_PEM_READ 108 +#define PEM_F_PEM_READ_BIO 109 +#define PEM_F_PEM_READ_BIO_PARAMETERS 140 +#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 +#define PEM_F_PEM_READ_PRIVATEKEY 124 +#define PEM_F_PEM_SEALFINAL 110 +#define PEM_F_PEM_SEALINIT 111 +#define PEM_F_PEM_SIGNFINAL 112 +#define PEM_F_PEM_WRITE 113 +#define PEM_F_PEM_WRITE_BIO 114 +#define PEM_F_PEM_WRITE_PRIVATEKEY 139 +#define PEM_F_PEM_X509_INFO_READ 115 +#define PEM_F_PEM_X509_INFO_READ_BIO 116 +#define PEM_F_PEM_X509_INFO_WRITE_BIO 117 + +/* Reason codes. */ +#define PEM_R_BAD_BASE64_DECODE 100 +#define PEM_R_BAD_DECRYPT 101 +#define PEM_R_BAD_END_LINE 102 +#define PEM_R_BAD_IV_CHARS 103 +#define PEM_R_BAD_MAGIC_NUMBER 116 +#define PEM_R_BAD_PASSWORD_READ 104 +#define PEM_R_BAD_VERSION_NUMBER 117 +#define PEM_R_BIO_WRITE_FAILURE 118 +#define PEM_R_CIPHER_IS_NULL 127 +#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 +#define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 +#define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 +#define PEM_R_INCONSISTENT_HEADER 121 +#define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 +#define PEM_R_KEYBLOB_TOO_SHORT 123 +#define PEM_R_NOT_DEK_INFO 105 +#define PEM_R_NOT_ENCRYPTED 106 +#define PEM_R_NOT_PROC_TYPE 107 +#define PEM_R_NO_START_LINE 108 +#define PEM_R_PROBLEMS_GETTING_PASSWORD 109 +#define PEM_R_PUBLIC_KEY_NO_RSA 110 +#define PEM_R_PVK_DATA_TOO_SHORT 124 +#define PEM_R_PVK_TOO_SHORT 125 +#define PEM_R_READ_KEY 111 +#define PEM_R_SHORT_HEADER 112 +#define PEM_R_UNSUPPORTED_CIPHER 113 +#define PEM_R_UNSUPPORTED_ENCRYPTION 114 +#define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/pem2.h b/code/contrib/libfido2/include/openssl/pem2.h new file mode 100644 index 0000000..19525b4 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/pem2.h @@ -0,0 +1,71 @@ +/* $OpenBSD: pem2.h,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +/* + * This header only exists to break a circular dependency between pem and err + * Ben 30 Jan 1999. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef HEADER_PEM_H +void ERR_load_PEM_strings(void); +#endif + +#ifdef __cplusplus +} +#endif diff --git a/code/contrib/libfido2/include/openssl/pkcs12.h b/code/contrib/libfido2/include/openssl/pkcs12.h new file mode 100644 index 0000000..56635f9 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/pkcs12.h @@ -0,0 +1,352 @@ +/* $OpenBSD: pkcs12.h,v 1.24 2018/05/30 15:32:11 tb Exp $ */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_PKCS12_H +#define HEADER_PKCS12_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PKCS12_KEY_ID 1 +#define PKCS12_IV_ID 2 +#define PKCS12_MAC_ID 3 + +/* Default iteration count */ +#ifndef PKCS12_DEFAULT_ITER +#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER +#endif + +#define PKCS12_MAC_KEY_LENGTH 20 + +#define PKCS12_SALT_LEN 8 + +/* Uncomment out next line for unicode password and names, otherwise ASCII */ + +/*#define PBE_UNICODE*/ + +#ifdef PBE_UNICODE +#define PKCS12_key_gen PKCS12_key_gen_uni +#define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni +#else +#define PKCS12_key_gen PKCS12_key_gen_asc +#define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc +#endif + +/* MS key usage constants */ + +#define KEY_EX 0x10 +#define KEY_SIG 0x80 + +typedef struct { + X509_SIG *dinfo; + ASN1_OCTET_STRING *salt; + ASN1_INTEGER *iter; /* defaults to 1 */ +} PKCS12_MAC_DATA; + +typedef struct { + ASN1_INTEGER *version; + PKCS12_MAC_DATA *mac; + PKCS7 *authsafes; +} PKCS12; + +typedef struct { + ASN1_OBJECT *type; + union { + struct pkcs12_bag_st *bag; /* secret, crl and certbag */ + struct pkcs8_priv_key_info_st *keybag; /* keybag */ + X509_SIG *shkeybag; /* shrouded key bag */ + STACK_OF(PKCS12_SAFEBAG) *safes; + ASN1_TYPE *other; + } value; + STACK_OF(X509_ATTRIBUTE) *attrib; +} PKCS12_SAFEBAG; + +DECLARE_STACK_OF(PKCS12_SAFEBAG) +DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG) + +typedef struct pkcs12_bag_st { + ASN1_OBJECT *type; + union { + ASN1_OCTET_STRING *x509cert; + ASN1_OCTET_STRING *x509crl; + ASN1_OCTET_STRING *octet; + ASN1_IA5STRING *sdsicert; + ASN1_TYPE *other; /* Secret or other bag */ + } value; +} PKCS12_BAGS; + +#define PKCS12_ERROR 0 +#define PKCS12_OK 1 + +#ifndef LIBRESSL_INTERNAL + +/* Compatibility macros */ + +#define M_PKCS12_x5092certbag PKCS12_x5092certbag +#define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag + +#define M_PKCS12_certbag2x509 PKCS12_certbag2x509 +#define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl + +#define M_PKCS12_unpack_p7data PKCS12_unpack_p7data +#define M_PKCS12_pack_authsafes PKCS12_pack_authsafes +#define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes +#define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata + +#define M_PKCS12_decrypt_skey PKCS12_decrypt_skey +#define M_PKCS8_decrypt PKCS8_decrypt + +#define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type) +#define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type) +#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type + +#endif /* !LIBRESSL_INTERNAL */ + +#define PKCS12_get_attr(bag, attr_nid) \ + PKCS12_get_attr_gen(bag->attrib, attr_nid) + +#define PKCS8_get_attr(p8, attr_nid) \ + PKCS12_get_attr_gen(p8->attributes, attr_nid) + +#define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) + + +PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); +PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); +X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); +X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); + +PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, + int nid1, int nid2); +PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass, + int passlen); +PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, + const char *pass, int passlen); +X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, + const char *pass, int passlen, unsigned char *salt, int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8); +PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, + int passlen, unsigned char *salt, int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8); +PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, STACK_OF(PKCS12_SAFEBAG) *bags); +STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, + int passlen); + +int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); + +int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, + int namelen); +int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, + int namelen); +int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); +ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs, + int attr_nid); +char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); +unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor, const char *pass, + int passlen, const unsigned char *in, int inlen, unsigned char **data, + int *datalen, int en_de); +void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, const ASN1_OCTET_STRING *oct, int zbuf); +ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, + const ASN1_ITEM *it, const char *pass, int passlen, void *obj, int zbuf); +PKCS12 *PKCS12_init(int mode); +int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, unsigned char *out, + const EVP_MD *md_type); +int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, unsigned char *out, + const EVP_MD *md_type); +int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type, + int en_de); +int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, + unsigned char *mac, unsigned int *maclen); +int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); +int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + const EVP_MD *md_type); +int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, + int saltlen, const EVP_MD *md_type); +unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, + unsigned char **uni, int *unilen); +char *OPENSSL_uni2asc(const unsigned char *uni, int unilen); + +PKCS12 *PKCS12_new(void); +void PKCS12_free(PKCS12 *a); +PKCS12 *d2i_PKCS12(PKCS12 **a, const unsigned char **in, long len); +int i2d_PKCS12(PKCS12 *a, unsigned char **out); +extern const ASN1_ITEM PKCS12_it; +PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void); +void PKCS12_MAC_DATA_free(PKCS12_MAC_DATA *a); +PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a, const unsigned char **in, long len); +int i2d_PKCS12_MAC_DATA(PKCS12_MAC_DATA *a, unsigned char **out); +extern const ASN1_ITEM PKCS12_MAC_DATA_it; +PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void); +void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a); +PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, const unsigned char **in, long len); +int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **out); +extern const ASN1_ITEM PKCS12_SAFEBAG_it; +PKCS12_BAGS *PKCS12_BAGS_new(void); +void PKCS12_BAGS_free(PKCS12_BAGS *a); +PKCS12_BAGS *d2i_PKCS12_BAGS(PKCS12_BAGS **a, const unsigned char **in, long len); +int i2d_PKCS12_BAGS(PKCS12_BAGS *a, unsigned char **out); +extern const ASN1_ITEM PKCS12_BAGS_it; + +extern const ASN1_ITEM PKCS12_SAFEBAGS_it; +extern const ASN1_ITEM PKCS12_AUTHSAFES_it; + +void PKCS12_PBE_add(void); +int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, + STACK_OF(X509) **ca); +PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, + int mac_iter, int keytype); + +PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); +PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, + int key_usage, int iter, int key_nid, const char *pass); +int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, + int safe_nid, int iter, const char *pass); +PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); + +int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); +int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); +PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); +PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); +int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_PKCS12_strings(void); + +/* Error codes for the PKCS12 functions. */ + +/* Function codes. */ +#define PKCS12_F_PARSE_BAG 129 +#define PKCS12_F_PARSE_BAGS 103 +#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100 +#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127 +#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102 +#define PKCS12_F_PKCS12_ADD_LOCALKEYID 104 +#define PKCS12_F_PKCS12_CREATE 105 +#define PKCS12_F_PKCS12_GEN_MAC 107 +#define PKCS12_F_PKCS12_INIT 109 +#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106 +#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108 +#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117 +#define PKCS12_F_PKCS12_KEY_GEN_ASC 110 +#define PKCS12_F_PKCS12_KEY_GEN_UNI 111 +#define PKCS12_F_PKCS12_MAKE_KEYBAG 112 +#define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113 +#define PKCS12_F_PKCS12_NEWPASS 128 +#define PKCS12_F_PKCS12_PACK_P7DATA 114 +#define PKCS12_F_PKCS12_PACK_P7ENCDATA 115 +#define PKCS12_F_PKCS12_PARSE 118 +#define PKCS12_F_PKCS12_PBE_CRYPT 119 +#define PKCS12_F_PKCS12_PBE_KEYIVGEN 120 +#define PKCS12_F_PKCS12_SETUP_MAC 122 +#define PKCS12_F_PKCS12_SET_MAC 123 +#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130 +#define PKCS12_F_PKCS12_UNPACK_P7DATA 131 +#define PKCS12_F_PKCS12_VERIFY_MAC 126 +#define PKCS12_F_PKCS8_ADD_KEYUSAGE 124 +#define PKCS12_F_PKCS8_ENCRYPT 125 + +/* Reason codes. */ +#define PKCS12_R_CANT_PACK_STRUCTURE 100 +#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 +#define PKCS12_R_DECODE_ERROR 101 +#define PKCS12_R_ENCODE_ERROR 102 +#define PKCS12_R_ENCRYPT_ERROR 103 +#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 +#define PKCS12_R_INVALID_NULL_ARGUMENT 104 +#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 +#define PKCS12_R_IV_GEN_ERROR 106 +#define PKCS12_R_KEY_GEN_ERROR 107 +#define PKCS12_R_MAC_ABSENT 108 +#define PKCS12_R_MAC_GENERATION_ERROR 109 +#define PKCS12_R_MAC_SETUP_ERROR 110 +#define PKCS12_R_MAC_STRING_SET_ERROR 111 +#define PKCS12_R_MAC_VERIFY_ERROR 112 +#define PKCS12_R_MAC_VERIFY_FAILURE 113 +#define PKCS12_R_PARSE_ERROR 114 +#define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115 +#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 +#define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117 +#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 +#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/pkcs7.h b/code/contrib/libfido2/include/openssl/pkcs7.h new file mode 100644 index 0000000..cff7c96 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/pkcs7.h @@ -0,0 +1,529 @@ +/* $OpenBSD: pkcs7.h,v 1.18 2016/12/27 16:12:47 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_PKCS7_H +#define HEADER_PKCS7_H + +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) && defined(__WINCRYPT_H__) +#ifndef LIBRESSL_INTERNAL +#ifdef _MSC_VER +#pragma message("Warning, overriding WinCrypt defines") +#else +#warning overriding WinCrypt defines +#endif +#endif +#undef PKCS7_ISSUER_AND_SERIAL +#undef PKCS7_SIGNER_INFO +#endif + +/* +Encryption_ID DES-CBC +Digest_ID MD5 +Digest_Encryption_ID rsaEncryption +Key_Encryption_ID rsaEncryption +*/ + +typedef struct pkcs7_issuer_and_serial_st { + X509_NAME *issuer; + ASN1_INTEGER *serial; +} PKCS7_ISSUER_AND_SERIAL; + +typedef struct pkcs7_signer_info_st { + ASN1_INTEGER *version; /* version 1 */ + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; + X509_ALGOR *digest_alg; + STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ + X509_ALGOR *digest_enc_alg; + ASN1_OCTET_STRING *enc_digest; + STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ + + /* The private key to sign with */ + EVP_PKEY *pkey; +} PKCS7_SIGNER_INFO; + +DECLARE_STACK_OF(PKCS7_SIGNER_INFO) + +typedef struct pkcs7_recip_info_st { + ASN1_INTEGER *version; /* version 0 */ + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; + X509_ALGOR *key_enc_algor; + ASN1_OCTET_STRING *enc_key; + X509 *cert; /* get the pub-key from this */ +} PKCS7_RECIP_INFO; + +DECLARE_STACK_OF(PKCS7_RECIP_INFO) + +typedef struct pkcs7_signed_st { + ASN1_INTEGER *version; /* version 1 */ + STACK_OF(X509_ALGOR) *md_algs; /* md used */ + STACK_OF(X509) *cert; /* [ 0 ] */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ + STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + + struct pkcs7_st *contents; +} PKCS7_SIGNED; +/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. + * How about merging the two */ + +typedef struct pkcs7_enc_content_st { + ASN1_OBJECT *content_type; + X509_ALGOR *algorithm; + ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ + const EVP_CIPHER *cipher; +} PKCS7_ENC_CONTENT; + +typedef struct pkcs7_enveloped_st { + ASN1_INTEGER *version; /* version 0 */ + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; + PKCS7_ENC_CONTENT *enc_data; +} PKCS7_ENVELOPE; + +typedef struct pkcs7_signedandenveloped_st { + ASN1_INTEGER *version; /* version 1 */ + STACK_OF(X509_ALGOR) *md_algs; /* md used */ + STACK_OF(X509) *cert; /* [ 0 ] */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ + STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + + PKCS7_ENC_CONTENT *enc_data; + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; +} PKCS7_SIGN_ENVELOPE; + +typedef struct pkcs7_digest_st { + ASN1_INTEGER *version; /* version 0 */ + X509_ALGOR *md; /* md used */ + struct pkcs7_st *contents; + ASN1_OCTET_STRING *digest; +} PKCS7_DIGEST; + +typedef struct pkcs7_encrypted_st { + ASN1_INTEGER *version; /* version 0 */ + PKCS7_ENC_CONTENT *enc_data; +} PKCS7_ENCRYPT; + +typedef struct pkcs7_st { + /* The following is non NULL if it contains ASN1 encoding of + * this structure */ + unsigned char *asn1; + long length; + +#define PKCS7_S_HEADER 0 +#define PKCS7_S_BODY 1 +#define PKCS7_S_TAIL 2 + int state; /* used during processing */ + + int detached; + + ASN1_OBJECT *type; + /* content as defined by the type */ + /* all encryption/message digests are applied to the 'contents', + * leaving out the 'type' field. */ + union { + char *ptr; + + /* NID_pkcs7_data */ + ASN1_OCTET_STRING *data; + + /* NID_pkcs7_signed */ + PKCS7_SIGNED *sign; + + /* NID_pkcs7_enveloped */ + PKCS7_ENVELOPE *enveloped; + + /* NID_pkcs7_signedAndEnveloped */ + PKCS7_SIGN_ENVELOPE *signed_and_enveloped; + + /* NID_pkcs7_digest */ + PKCS7_DIGEST *digest; + + /* NID_pkcs7_encrypted */ + PKCS7_ENCRYPT *encrypted; + + /* Anything else */ + ASN1_TYPE *other; + } d; +} PKCS7; + +DECLARE_STACK_OF(PKCS7) +DECLARE_PKCS12_STACK_OF(PKCS7) + +#define PKCS7_OP_SET_DETACHED_SIGNATURE 1 +#define PKCS7_OP_GET_DETACHED_SIGNATURE 2 + +#define PKCS7_get_signed_attributes(si) ((si)->auth_attr) +#define PKCS7_get_attributes(si) ((si)->unauth_attr) + +#define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) +#define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) +#define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) +#define PKCS7_type_is_signedAndEnveloped(a) \ + (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) +#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) +#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) +#define PKCS7_type_is_encrypted(a) \ + (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) + +#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) + +#define PKCS7_set_detached(p,v) \ + PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL) +#define PKCS7_get_detached(p) \ + PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) + +#define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) + +/* S/MIME related flags */ + +#define PKCS7_TEXT 0x1 +#define PKCS7_NOCERTS 0x2 +#define PKCS7_NOSIGS 0x4 +#define PKCS7_NOCHAIN 0x8 +#define PKCS7_NOINTERN 0x10 +#define PKCS7_NOVERIFY 0x20 +#define PKCS7_DETACHED 0x40 +#define PKCS7_BINARY 0x80 +#define PKCS7_NOATTR 0x100 +#define PKCS7_NOSMIMECAP 0x200 +#define PKCS7_NOOLDMIMETYPE 0x400 +#define PKCS7_CRLFEOL 0x800 +#define PKCS7_STREAM 0x1000 +#define PKCS7_NOCRL 0x2000 +#define PKCS7_PARTIAL 0x4000 +#define PKCS7_REUSE_DIGEST 0x8000 + +/* Flags: for compatibility with older code */ + +#define SMIME_TEXT PKCS7_TEXT +#define SMIME_NOCERTS PKCS7_NOCERTS +#define SMIME_NOSIGS PKCS7_NOSIGS +#define SMIME_NOCHAIN PKCS7_NOCHAIN +#define SMIME_NOINTERN PKCS7_NOINTERN +#define SMIME_NOVERIFY PKCS7_NOVERIFY +#define SMIME_DETACHED PKCS7_DETACHED +#define SMIME_BINARY PKCS7_BINARY +#define SMIME_NOATTR PKCS7_NOATTR + +PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new(void); +void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a); +PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL **a, const unsigned char **in, long len); +int i2d_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_ISSUER_AND_SERIAL_it; + +int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, + const EVP_MD *type, unsigned char *md, unsigned int *len); +PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); +int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7); +PKCS7 *PKCS7_dup(PKCS7 *p7); +PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); +int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7); +int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); +int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); + +PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void); +void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a); +PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a, const unsigned char **in, long len); +int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_SIGNER_INFO_it; +PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void); +void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a); +PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a, const unsigned char **in, long len); +int i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_RECIP_INFO_it; +PKCS7_SIGNED *PKCS7_SIGNED_new(void); +void PKCS7_SIGNED_free(PKCS7_SIGNED *a); +PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, const unsigned char **in, long len); +int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_SIGNED_it; +PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new(void); +void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a); +PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **a, const unsigned char **in, long len); +int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_ENC_CONTENT_it; +PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void); +void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a); +PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, const unsigned char **in, long len); +int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_ENVELOPE_it; +PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void); +void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a); +PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a, const unsigned char **in, long len); +int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_SIGN_ENVELOPE_it; +PKCS7_DIGEST *PKCS7_DIGEST_new(void); +void PKCS7_DIGEST_free(PKCS7_DIGEST *a); +PKCS7_DIGEST *d2i_PKCS7_DIGEST(PKCS7_DIGEST **a, const unsigned char **in, long len); +int i2d_PKCS7_DIGEST(PKCS7_DIGEST *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_DIGEST_it; +PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void); +void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a); +PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **a, const unsigned char **in, long len); +int i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_ENCRYPT_it; +PKCS7 *PKCS7_new(void); +void PKCS7_free(PKCS7 *a); +PKCS7 *d2i_PKCS7(PKCS7 **a, const unsigned char **in, long len); +int i2d_PKCS7(PKCS7 *a, unsigned char **out); +extern const ASN1_ITEM PKCS7_it; + +extern const ASN1_ITEM PKCS7_ATTR_SIGN_it; +extern const ASN1_ITEM PKCS7_ATTR_VERIFY_it; + +int i2d_PKCS7_NDEF(PKCS7 *a, unsigned char **out); +int PKCS7_print_ctx(BIO *out, PKCS7 *x, int indent, const ASN1_PCTX *pctx); + +long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); + +int PKCS7_set_type(PKCS7 *p7, int type); +int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); +int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); +int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, + const EVP_MD *dgst); +int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); +int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); +int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); +int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); +int PKCS7_content_new(PKCS7 *p7, int nid); +int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, + BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); +int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, + X509 *x509); + +BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); +int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); +BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); + + +PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, + EVP_PKEY *pkey, const EVP_MD *dgst); +X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); +int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); +STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); + +PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); +void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, + X509_ALGOR **pdig, X509_ALGOR **psig); +void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); +int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); +int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); +int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher); +int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7); + +PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); +ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); +int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type, + void *data); +int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, + void *value); +ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); +ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); +int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, + STACK_OF(X509_ATTRIBUTE) *sk); +int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK_OF(X509_ATTRIBUTE) *sk); + + +PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags); + +PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, + X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, + int flags); + +int PKCS7_final(PKCS7 *p7, BIO *data, int flags); +int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, + BIO *indata, BIO *out, int flags); +STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); +PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, + int flags); +int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); + +int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, + STACK_OF(X509_ALGOR) *cap); +STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); +int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); + +int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); +int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); +int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, + const unsigned char *md, int mdlen); + +int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); +PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); + +BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_PKCS7_strings(void); + +/* Error codes for the PKCS7 functions. */ + +/* Function codes. */ +#define PKCS7_F_B64_READ_PKCS7 120 +#define PKCS7_F_B64_WRITE_PKCS7 121 +#define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136 +#define PKCS7_F_I2D_PKCS7_BIO_STREAM 140 +#define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135 +#define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118 +#define PKCS7_F_PKCS7_ADD_CERTIFICATE 100 +#define PKCS7_F_PKCS7_ADD_CRL 101 +#define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102 +#define PKCS7_F_PKCS7_ADD_SIGNATURE 131 +#define PKCS7_F_PKCS7_ADD_SIGNER 103 +#define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125 +#define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138 +#define PKCS7_F_PKCS7_CTRL 104 +#define PKCS7_F_PKCS7_DATADECODE 112 +#define PKCS7_F_PKCS7_DATAFINAL 128 +#define PKCS7_F_PKCS7_DATAINIT 105 +#define PKCS7_F_PKCS7_DATASIGN 106 +#define PKCS7_F_PKCS7_DATAVERIFY 107 +#define PKCS7_F_PKCS7_DECRYPT 114 +#define PKCS7_F_PKCS7_DECRYPT_RINFO 133 +#define PKCS7_F_PKCS7_ENCODE_RINFO 132 +#define PKCS7_F_PKCS7_ENCRYPT 115 +#define PKCS7_F_PKCS7_FINAL 134 +#define PKCS7_F_PKCS7_FIND_DIGEST 127 +#define PKCS7_F_PKCS7_GET0_SIGNERS 124 +#define PKCS7_F_PKCS7_RECIP_INFO_SET 130 +#define PKCS7_F_PKCS7_SET_CIPHER 108 +#define PKCS7_F_PKCS7_SET_CONTENT 109 +#define PKCS7_F_PKCS7_SET_DIGEST 126 +#define PKCS7_F_PKCS7_SET_TYPE 110 +#define PKCS7_F_PKCS7_SIGN 116 +#define PKCS7_F_PKCS7_SIGNATUREVERIFY 113 +#define PKCS7_F_PKCS7_SIGNER_INFO_SET 129 +#define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139 +#define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137 +#define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119 +#define PKCS7_F_PKCS7_VERIFY 117 +#define PKCS7_F_SMIME_READ_PKCS7 122 +#define PKCS7_F_SMIME_TEXT 123 + +/* Reason codes. */ +#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 +#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 +#define PKCS7_R_CIPHER_NOT_INITIALIZED 116 +#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 +#define PKCS7_R_CTRL_ERROR 152 +#define PKCS7_R_DECODE_ERROR 130 +#define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100 +#define PKCS7_R_DECRYPT_ERROR 119 +#define PKCS7_R_DIGEST_FAILURE 101 +#define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149 +#define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150 +#define PKCS7_R_ERROR_ADDING_RECIPIENT 120 +#define PKCS7_R_ERROR_SETTING_CIPHER 121 +#define PKCS7_R_INVALID_MIME_TYPE 131 +#define PKCS7_R_INVALID_NULL_POINTER 143 +#define PKCS7_R_MIME_NO_CONTENT_TYPE 132 +#define PKCS7_R_MIME_PARSE_ERROR 133 +#define PKCS7_R_MIME_SIG_PARSE_ERROR 134 +#define PKCS7_R_MISSING_CERIPEND_INFO 103 +#define PKCS7_R_NO_CONTENT 122 +#define PKCS7_R_NO_CONTENT_TYPE 135 +#define PKCS7_R_NO_DEFAULT_DIGEST 151 +#define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154 +#define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136 +#define PKCS7_R_NO_MULTIPART_BOUNDARY 137 +#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 +#define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146 +#define PKCS7_R_NO_SIGNATURES_ON_DATA 123 +#define PKCS7_R_NO_SIGNERS 142 +#define PKCS7_R_NO_SIG_CONTENT_TYPE 138 +#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 +#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 +#define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153 +#define PKCS7_R_PKCS7_DATAFINAL 126 +#define PKCS7_R_PKCS7_DATAFINAL_ERROR 125 +#define PKCS7_R_PKCS7_DATASIGN 145 +#define PKCS7_R_PKCS7_PARSE_ERROR 139 +#define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140 +#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 +#define PKCS7_R_SIGNATURE_FAILURE 105 +#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 +#define PKCS7_R_SIGNING_CTRL_FAILURE 147 +#define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148 +#define PKCS7_R_SIG_INVALID_MIME_TYPE 141 +#define PKCS7_R_SMIME_TEXT_ERROR 129 +#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 +#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 +#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 +#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 +#define PKCS7_R_UNKNOWN_OPERATION 110 +#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 +#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 +#define PKCS7_R_WRONG_CONTENT_TYPE 113 +#define PKCS7_R_WRONG_PKCS7_TYPE 114 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/poly1305.h b/code/contrib/libfido2/include/openssl/poly1305.h new file mode 100644 index 0000000..00ab0bf --- /dev/null +++ b/code/contrib/libfido2/include/openssl/poly1305.h @@ -0,0 +1,49 @@ +/* $OpenBSD: poly1305.h,v 1.3 2014/07/25 14:04:51 jsing Exp $ */ +/* + * Copyright (c) 2014 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_POLY1305_H +#define HEADER_POLY1305_H + +#include + +#if defined(OPENSSL_NO_POLY1305) +#error Poly1305 is disabled. +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct poly1305_context { + size_t aligner; + unsigned char opaque[136]; +} poly1305_context; + +typedef struct poly1305_context poly1305_state; + +void CRYPTO_poly1305_init(poly1305_context *ctx, const unsigned char key[32]); +void CRYPTO_poly1305_update(poly1305_context *ctx, const unsigned char *in, + size_t len); +void CRYPTO_poly1305_finish(poly1305_context *ctx, unsigned char mac[16]); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_POLY1305_H */ diff --git a/code/contrib/libfido2/include/openssl/rand.h b/code/contrib/libfido2/include/openssl/rand.h new file mode 100644 index 0000000..fcb2e92 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/rand.h @@ -0,0 +1,127 @@ +/* $OpenBSD: rand.h,v 1.22 2014/10/22 14:02:52 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#ifndef HEADER_RAND_H +#define HEADER_RAND_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct rand_meth_st RAND_METHOD; */ + +struct rand_meth_st { + void (*seed)(const void *buf, int num); + int (*bytes)(unsigned char *buf, int num); + void (*cleanup)(void); + void (*add)(const void *buf, int num, double entropy); + int (*pseudorand)(unsigned char *buf, int num); + int (*status)(void); +}; + +int RAND_set_rand_method(const RAND_METHOD *meth); +const RAND_METHOD *RAND_get_rand_method(void); +#ifndef OPENSSL_NO_ENGINE +int RAND_set_rand_engine(ENGINE *engine); +#endif +RAND_METHOD *RAND_SSLeay(void); + +#ifndef LIBRESSL_INTERNAL +void RAND_cleanup(void ); +int RAND_bytes(unsigned char *buf, int num); +int RAND_pseudo_bytes(unsigned char *buf, int num); +void RAND_seed(const void *buf, int num); +void RAND_add(const void *buf, int num, double entropy); +int RAND_load_file(const char *file, long max_bytes); +int RAND_write_file(const char *file); +const char *RAND_file_name(char *file, size_t num); +int RAND_status(void); +int RAND_poll(void); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_RAND_strings(void); + +/* Error codes for the RAND functions. (no longer used) */ + +/* Function codes. */ +#define RAND_F_RAND_GET_RAND_METHOD 101 +#define RAND_F_RAND_INIT_FIPS 102 +#define RAND_F_SSLEAY_RAND_BYTES 100 + +/* Reason codes. */ +#define RAND_R_DUAL_EC_DRBG_DISABLED 104 +#define RAND_R_ERROR_INITIALISING_DRBG 102 +#define RAND_R_ERROR_INSTANTIATING_DRBG 103 +#define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 +#define RAND_R_PRNG_NOT_SEEDED 100 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/rc2.h b/code/contrib/libfido2/include/openssl/rc2.h new file mode 100644 index 0000000..21511ff --- /dev/null +++ b/code/contrib/libfido2/include/openssl/rc2.h @@ -0,0 +1,101 @@ +/* $OpenBSD: rc2.h,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RC2_H +#define HEADER_RC2_H + +#include /* OPENSSL_NO_RC2, RC2_INT */ + +#ifdef OPENSSL_NO_RC2 +#error RC2 is disabled. +#endif + +#define RC2_ENCRYPT 1 +#define RC2_DECRYPT 0 + +#define RC2_BLOCK 8 +#define RC2_KEY_LENGTH 16 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct rc2_key_st + { + RC2_INT data[64]; + } RC2_KEY; + +void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); +void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, + int enc); +void RC2_encrypt(unsigned long *data,RC2_KEY *key); +void RC2_decrypt(unsigned long *data,RC2_KEY *key); +void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + RC2_KEY *ks, unsigned char *iv, int enc); +void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, RC2_KEY *schedule, unsigned char *ivec, + int *num, int enc); +void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, RC2_KEY *schedule, unsigned char *ivec, + int *num); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/rc4.h b/code/contrib/libfido2/include/openssl/rc4.h new file mode 100644 index 0000000..f59185e --- /dev/null +++ b/code/contrib/libfido2/include/openssl/rc4.h @@ -0,0 +1,89 @@ +/* $OpenBSD: rc4.h,v 1.13 2015/10/20 15:50:13 jsing Exp $ */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RC4_H +#define HEADER_RC4_H + +#include /* OPENSSL_NO_RC4, RC4_INT */ + +#ifdef OPENSSL_NO_RC4 +#error RC4 is disabled. +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct rc4_key_st { + RC4_INT x, y; + RC4_INT data[256]; +} RC4_KEY; + +const char *RC4_options(void); +void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); +void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); +void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, + unsigned char *outdata); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/ripemd.h b/code/contrib/libfido2/include/openssl/ripemd.h new file mode 100644 index 0000000..a5f3a12 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ripemd.h @@ -0,0 +1,105 @@ +/* $OpenBSD: ripemd.h,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#ifndef HEADER_RIPEMD_H +#define HEADER_RIPEMD_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_RIPEMD +#error RIPEMD is disabled. +#endif + +#if defined(__LP32__) +#define RIPEMD160_LONG unsigned long +#elif defined(__ILP64__) +#define RIPEMD160_LONG unsigned long +#define RIPEMD160_LONG_LOG2 3 +#else +#define RIPEMD160_LONG unsigned int +#endif + +#define RIPEMD160_CBLOCK 64 +#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) +#define RIPEMD160_DIGEST_LENGTH 20 + +typedef struct RIPEMD160state_st + { + RIPEMD160_LONG A,B,C,D,E; + RIPEMD160_LONG Nl,Nh; + RIPEMD160_LONG data[RIPEMD160_LBLOCK]; + unsigned int num; + } RIPEMD160_CTX; + +int RIPEMD160_Init(RIPEMD160_CTX *c); +int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); +int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); +unsigned char *RIPEMD160(const unsigned char *d, size_t n, + unsigned char *md); +void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/rsa.h b/code/contrib/libfido2/include/openssl/rsa.h new file mode 100644 index 0000000..d59fd03 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/rsa.h @@ -0,0 +1,616 @@ +/* $OpenBSD: rsa.h,v 1.55 2022/01/14 08:34:39 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RSA_H +#define HEADER_RSA_H + +#include + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef OPENSSL_NO_RSA +#error RSA is disabled. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct rsa_pss_params_st { + X509_ALGOR *hashAlgorithm; + X509_ALGOR *maskGenAlgorithm; + ASN1_INTEGER *saltLength; + ASN1_INTEGER *trailerField; + + /* Hash algorithm decoded from maskGenAlgorithm. */ + X509_ALGOR *maskHash; +} /* RSA_PSS_PARAMS */; + +typedef struct rsa_oaep_params_st { + X509_ALGOR *hashFunc; + X509_ALGOR *maskGenFunc; + X509_ALGOR *pSourceFunc; + + /* Hash algorithm decoded from maskGenFunc. */ + X509_ALGOR *maskHash; +} RSA_OAEP_PARAMS; + +#ifndef OPENSSL_RSA_MAX_MODULUS_BITS +# define OPENSSL_RSA_MAX_MODULUS_BITS 16384 +#endif + +#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS +# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072 +#endif +#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS +# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 /* exponent limit enforced for "large" modulus only */ +#endif + +#define RSA_3 0x3L +#define RSA_F4 0x10001L + +/* Don't check pub/private match. */ +#define RSA_METHOD_FLAG_NO_CHECK 0x0001 + +#define RSA_FLAG_CACHE_PUBLIC 0x0002 +#define RSA_FLAG_CACHE_PRIVATE 0x0004 +#define RSA_FLAG_BLINDING 0x0008 +#define RSA_FLAG_THREAD_SAFE 0x0010 + +/* + * This flag means the private key operations will be handled by rsa_mod_exp + * and that they do not depend on the private key components being present: + * for example a key stored in external hardware. Without this flag bn_mod_exp + * gets called when private key components are absent. + */ +#define RSA_FLAG_EXT_PKEY 0x0020 + +/* + * This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions. + */ +#define RSA_FLAG_SIGN_VER 0x0040 + +/* + * The built-in RSA implementation uses blinding by default, but other engines + * might not need it. + */ +#define RSA_FLAG_NO_BLINDING 0x0080 + +/* Salt length matches digest */ +#define RSA_PSS_SALTLEN_DIGEST -1 +/* Verify only: auto detect salt length */ +#define RSA_PSS_SALTLEN_AUTO -2 +/* Set salt length to maximum possible */ +#define RSA_PSS_SALTLEN_MAX -3 + +#define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \ + RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_RSA_PADDING, pad, NULL) + +#define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \ + RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad) + +#define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ + RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ + EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL) + +#define EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL) + +#define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \ + RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ + EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, 0, plen) + +#define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ + RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) + +#define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \ + RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) + +#define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \ + RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \ + EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md)) + +#define EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md)) + +#define EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ + EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)(md)) + +#define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \ + RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \ + EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)(pmd)) + +#define EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ + EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)(pmd)) + +#define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ + EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)(l)) + +#define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ + EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)(l)) + +#define EVP_PKEY_CTX_set_rsa_pss_keygen_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, \ + EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_MD, 0, (void *)(md)) + +#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) + +#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5) + +#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8) + +#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10) + +#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) + +#define RSA_PKCS1_PADDING 1 +#define RSA_SSLV23_PADDING 2 +#define RSA_NO_PADDING 3 +#define RSA_PKCS1_OAEP_PADDING 4 +#define RSA_X931_PADDING 5 +/* EVP_PKEY_ only */ +#define RSA_PKCS1_PSS_PADDING 6 + +#define RSA_PKCS1_PADDING_SIZE 11 + +#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) +#define RSA_get_app_data(s) RSA_get_ex_data(s,0) + +RSA *RSA_new(void); +RSA *RSA_new_method(ENGINE *engine); +int RSA_bits(const RSA *rsa); +int RSA_size(const RSA *rsa); + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED +RSA *RSA_generate_key(int bits, unsigned long e, + void (*callback)(int, int, void *), void *cb_arg); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* New version */ +int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); + +int RSA_check_key(const RSA *); +/* next 4 return -1 on error */ +int RSA_public_encrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding); +int RSA_private_encrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding); +int RSA_public_decrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding); +int RSA_private_decrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding); +void RSA_free(RSA *r); +/* "up" the RSA object's reference count */ +int RSA_up_ref(RSA *r); + +int RSA_flags(const RSA *r); + +void RSA_set_default_method(const RSA_METHOD *meth); +const RSA_METHOD *RSA_get_default_method(void); +const RSA_METHOD *RSA_get_method(const RSA *rsa); +int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); + +const RSA_METHOD *RSA_PKCS1_OpenSSL(void); +const RSA_METHOD *RSA_PKCS1_SSLeay(void); + +const RSA_METHOD *RSA_null_method(void); + +int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2); + +RSA *d2i_RSAPublicKey(RSA **a, const unsigned char **in, long len); +int i2d_RSAPublicKey(const RSA *a, unsigned char **out); +extern const ASN1_ITEM RSAPublicKey_it; +RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **in, long len); +int i2d_RSAPrivateKey(const RSA *a, unsigned char **out); +extern const ASN1_ITEM RSAPrivateKey_it; + +RSA_PSS_PARAMS *RSA_PSS_PARAMS_new(void); +void RSA_PSS_PARAMS_free(RSA_PSS_PARAMS *a); +RSA_PSS_PARAMS *d2i_RSA_PSS_PARAMS(RSA_PSS_PARAMS **a, const unsigned char **in, long len); +int i2d_RSA_PSS_PARAMS(RSA_PSS_PARAMS *a, unsigned char **out); +extern const ASN1_ITEM RSA_PSS_PARAMS_it; + +RSA_OAEP_PARAMS *RSA_OAEP_PARAMS_new(void); +void RSA_OAEP_PARAMS_free(RSA_OAEP_PARAMS *a); +RSA_OAEP_PARAMS *d2i_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS **a, const unsigned char **in, long len); +int i2d_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS *a, unsigned char **out); +extern const ASN1_ITEM RSA_OAEP_PARAMS_it; + +int RSA_print_fp(FILE *fp, const RSA *r, int offset); + +#ifndef OPENSSL_NO_BIO +int RSA_print(BIO *bp, const RSA *r, int offset); +#endif + +/* The following 2 functions sign and verify a X509_SIG ASN1 object + * inside PKCS#1 padded RSA encryption */ +int RSA_sign(int type, const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, RSA *rsa); +int RSA_verify(int type, const unsigned char *m, unsigned int m_length, + const unsigned char *sigbuf, unsigned int siglen, RSA *rsa); + +/* The following 2 function sign and verify a ASN1_OCTET_STRING + * object inside PKCS#1 padded RSA encryption */ +int RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m, + unsigned int m_length, unsigned char *sigret, unsigned int *siglen, + RSA *rsa); +int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m, + unsigned int m_length, unsigned char *sigbuf, unsigned int siglen, + RSA *rsa); + +int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); +void RSA_blinding_off(RSA *rsa); +BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); + +int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, + const unsigned char *f, int fl); +int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, + const unsigned char *f, int fl, int rsa_len); +int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, + const unsigned char *f, int fl); +int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, + const unsigned char *f, int fl, int rsa_len); +int PKCS1_MGF1(unsigned char *mask, long len, + const unsigned char *seed, long seedlen, const EVP_MD *dgst); +int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, + const unsigned char *f, int fl, + const unsigned char *p, int pl); +int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, + const unsigned char *f, int fl, int rsa_len, + const unsigned char *p, int pl); +int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, + const unsigned char *from, int flen, const unsigned char *param, int plen, + const EVP_MD *md, const EVP_MD *mgf1md); +int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, + const unsigned char *from, int flen, int num, const unsigned char *param, + int plen, const EVP_MD *md, const EVP_MD *mgf1md); +int RSA_padding_add_none(unsigned char *to, int tlen, + const unsigned char *f, int fl); +int RSA_padding_check_none(unsigned char *to, int tlen, + const unsigned char *f, int fl, int rsa_len); +int RSA_padding_add_X931(unsigned char *to, int tlen, + const unsigned char *f, int fl); +int RSA_padding_check_X931(unsigned char *to, int tlen, + const unsigned char *f, int fl, int rsa_len); +int RSA_X931_hash_id(int nid); + +int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, + const EVP_MD *Hash, const unsigned char *EM, int sLen); +int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, + const unsigned char *mHash, const EVP_MD *Hash, int sLen); + +int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, + const EVP_MD *Hash, const EVP_MD *mgf1Hash, const unsigned char *EM, + int sLen); + +int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, + const unsigned char *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, + int sLen); + +int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int RSA_set_ex_data(RSA *r, int idx, void *arg); +void *RSA_get_ex_data(const RSA *r, int idx); + +void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, + const BIGNUM **d); +int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d); +void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, + const BIGNUM **iqmp); +int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp); +void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q); +int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q); +const BIGNUM *RSA_get0_n(const RSA *r); +const BIGNUM *RSA_get0_e(const RSA *r); +const BIGNUM *RSA_get0_d(const RSA *r); +const BIGNUM *RSA_get0_p(const RSA *r); +const BIGNUM *RSA_get0_q(const RSA *r); +const BIGNUM *RSA_get0_dmp1(const RSA *r); +const BIGNUM *RSA_get0_dmq1(const RSA *r); +const BIGNUM *RSA_get0_iqmp(const RSA *r); +const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r); +void RSA_clear_flags(RSA *r, int flags); +int RSA_test_flags(const RSA *r, int flags); +void RSA_set_flags(RSA *r, int flags); + +RSA *RSAPublicKey_dup(RSA *rsa); +RSA *RSAPrivateKey_dup(RSA *rsa); + +/* If this flag is set the RSA method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its responsibility + * to ensure the result is compliant. + */ + +#define RSA_FLAG_FIPS_METHOD 0x0400 + +/* If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define RSA_FLAG_NON_FIPS_ALLOW 0x0400 +/* Application has decided PRNG is good enough to generate a key: don't + * check. + */ +#define RSA_FLAG_CHECKED 0x0800 + +RSA_METHOD *RSA_meth_new(const char *name, int flags); +void RSA_meth_free(RSA_METHOD *meth); +RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); +int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); +int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa); +int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)); +int RSA_meth_set_pub_enc(RSA_METHOD *meth, int (*pub_enc)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int RSA_meth_set_pub_dec(RSA_METHOD *meth, int (*pub_dec)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int RSA_meth_set_mod_exp(RSA_METHOD *meth, int (*mod_exp)(BIGNUM *r0, + const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); +int RSA_meth_set_bn_mod_exp(RSA_METHOD *meth, int (*bn_mod_exp)(BIGNUM *r, + const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx)); +int RSA_meth_set_init(RSA_METHOD *meth, int (*init)(RSA *rsa)); +int RSA_meth_set_keygen(RSA_METHOD *meth, int (*keygen)(RSA *rsa, int bits, + BIGNUM *e, BN_GENCB *cb)); +int RSA_meth_set_flags(RSA_METHOD *meth, int flags); +int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); +const char *RSA_meth_get0_name(const RSA_METHOD *); +int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0, const BIGNUM *i, + RSA *rsa, BN_CTX *ctx); +int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r, + const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx); +int (*RSA_meth_get_init(const RSA_METHOD *meth))(RSA *rsa); +int (*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb); +int RSA_meth_get_flags(const RSA_METHOD *meth); +void *RSA_meth_get0_app_data(const RSA_METHOD *meth); +int (*RSA_meth_get_sign(const RSA_METHOD *meth))(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, + const RSA *rsa); +int RSA_meth_set_sign(RSA_METHOD *rsa, int (*sign)(int type, + const unsigned char *m, unsigned int m_length, unsigned char *sigret, + unsigned int *siglen, const RSA *rsa)); +int (*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype, + const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa); +int RSA_meth_set_verify(RSA_METHOD *rsa, int (*verify)(int dtype, + const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa)); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_RSA_strings(void); + +/* Error codes for the RSA functions. */ + +/* Function codes. */ +#define RSA_F_CHECK_PADDING_MD 140 +#define RSA_F_DO_RSA_PRINT 146 +#define RSA_F_INT_RSA_VERIFY 145 +#define RSA_F_MEMORY_LOCK 100 +#define RSA_F_OLD_RSA_PRIV_DECODE 147 +#define RSA_F_PKEY_RSA_CTRL 143 +#define RSA_F_PKEY_RSA_CTRL_STR 144 +#define RSA_F_PKEY_RSA_SIGN 142 +#define RSA_F_PKEY_RSA_VERIFY 154 +#define RSA_F_PKEY_RSA_VERIFYRECOVER 141 +#define RSA_F_RSA_BUILTIN_KEYGEN 129 +#define RSA_F_RSA_CHECK_KEY 123 +#define RSA_F_RSA_EAY_MOD_EXP 157 +#define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 +#define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 +#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 +#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 +#define RSA_F_RSA_GENERATE_KEY 105 +#define RSA_F_RSA_GENERATE_KEY_EX 155 +#define RSA_F_RSA_ITEM_VERIFY 156 +#define RSA_F_RSA_MEMORY_LOCK 130 +#define RSA_F_RSA_NEW_METHOD 106 +#define RSA_F_RSA_NULL 124 +#define RSA_F_RSA_NULL_MOD_EXP 131 +#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132 +#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133 +#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134 +#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135 +#define RSA_F_RSA_PADDING_ADD_NONE 107 +#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 +#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 +#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148 +#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 +#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 +#define RSA_F_RSA_PADDING_ADD_X931 127 +#define RSA_F_RSA_PADDING_CHECK_NONE 111 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 +#define RSA_F_RSA_PADDING_CHECK_X931 128 +#define RSA_F_RSA_PRINT 115 +#define RSA_F_RSA_PRINT_FP 116 +#define RSA_F_RSA_PRIVATE_DECRYPT 150 +#define RSA_F_RSA_PRIVATE_ENCRYPT 151 +#define RSA_F_RSA_PRIV_DECODE 137 +#define RSA_F_RSA_PRIV_ENCODE 138 +#define RSA_F_RSA_PUBLIC_DECRYPT 152 +#define RSA_F_RSA_PUBLIC_ENCRYPT 153 +#define RSA_F_RSA_PUB_DECODE 139 +#define RSA_F_RSA_SETUP_BLINDING 136 +#define RSA_F_RSA_SIGN 117 +#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 +#define RSA_F_RSA_VERIFY 119 +#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 +#define RSA_F_RSA_VERIFY_PKCS1_PSS 126 +#define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149 + +/* Reason codes. */ +#define RSA_R_ALGORITHM_MISMATCH 100 +#define RSA_R_BAD_E_VALUE 101 +#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 +#define RSA_R_BAD_PAD_BYTE_COUNT 103 +#define RSA_R_BAD_SIGNATURE 104 +#define RSA_R_BLOCK_TYPE_IS_NOT_01 106 +#define RSA_R_BLOCK_TYPE_IS_NOT_02 107 +#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 +#define RSA_R_DATA_TOO_LARGE 109 +#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 +#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 +#define RSA_R_DATA_TOO_SMALL 111 +#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 +#define RSA_R_DIGEST_DOES_NOT_MATCH 158 +#define RSA_R_DIGEST_NOT_ALLOWED 145 +#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 +#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 +#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 +#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 +#define RSA_R_FIRST_OCTET_INVALID 133 +#define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144 +#define RSA_R_INVALID_DIGEST 157 +#define RSA_R_INVALID_DIGEST_LENGTH 143 +#define RSA_R_INVALID_HEADER 137 +#define RSA_R_INVALID_KEYBITS 145 +#define RSA_R_INVALID_LABEL 160 +#define RSA_R_INVALID_MESSAGE_LENGTH 131 +#define RSA_R_INVALID_MGF1_MD 156 +#define RSA_R_INVALID_OAEP_PARAMETERS 161 +#define RSA_R_INVALID_PADDING 138 +#define RSA_R_INVALID_PADDING_MODE 141 +#define RSA_R_INVALID_PSS_PARAMETERS 149 +#define RSA_R_INVALID_PSS_SALTLEN 146 +#define RSA_R_INVALID_SALT_LENGTH 150 +#define RSA_R_INVALID_TRAILER 139 +#define RSA_R_INVALID_X931_DIGEST 142 +#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 +#define RSA_R_KEY_SIZE_TOO_SMALL 120 +#define RSA_R_LAST_OCTET_INVALID 134 +#define RSA_R_MODULUS_TOO_LARGE 105 +#define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152 +#define RSA_R_NON_FIPS_RSA_METHOD 157 +#define RSA_R_NO_PUBLIC_EXPONENT 140 +#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 +#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 +#define RSA_R_OAEP_DECODING_ERROR 121 +#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158 +#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 +#define RSA_R_PADDING_CHECK_FAILED 114 +#define RSA_R_PSS_SALTLEN_TOO_SMALL 164 +#define RSA_R_P_NOT_PRIME 128 +#define RSA_R_Q_NOT_PRIME 129 +#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 +#define RSA_R_SLEN_CHECK_FAILED 136 +#define RSA_R_SLEN_RECOVERY_FAILED 135 +#define RSA_R_SSLV3_ROLLBACK_ATTACK 115 +#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 +#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 +#define RSA_R_UNKNOWN_DIGEST 166 +#define RSA_R_UNKNOWN_MASK_DIGEST 151 +#define RSA_R_UNKNOWN_PADDING_TYPE 118 +#define RSA_R_UNKNOWN_PSS_DIGEST 152 +#define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162 +#define RSA_R_UNSUPPORTED_LABEL_SOURCE 163 +#define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153 +#define RSA_R_UNSUPPORTED_MASK_PARAMETER 154 +#define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155 +#define RSA_R_VALUE_MISSING 147 +#define RSA_R_WRONG_SIGNATURE_LENGTH 119 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/safestack.h b/code/contrib/libfido2/include/openssl/safestack.h new file mode 100644 index 0000000..e1e7e24 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/safestack.h @@ -0,0 +1,2226 @@ +/* $OpenBSD: safestack.h,v 1.21 2022/01/14 08:59:30 tb Exp $ */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_SAFESTACK_H +#define HEADER_SAFESTACK_H + +#include + +#ifndef CHECKED_PTR_OF +#define CHECKED_PTR_OF(type, p) \ + ((void*) (1 ? p : (type*)0)) +#endif + +/* In C++ we get problems because an explicit cast is needed from (void *) + * we use CHECKED_STACK_OF to ensure the correct type is passed in the macros + * below. + */ + +#define CHECKED_STACK_OF(type, p) \ + ((_STACK*) (1 ? p : (STACK_OF(type)*)0)) + +#define CHECKED_SK_FREE_FUNC(type, p) \ + ((void (*)(void *)) ((1 ? p : (void (*)(type *))0))) + +#define CHECKED_SK_FREE_FUNC2(type, p) \ + ((void (*)(void *)) ((1 ? p : (void (*)(type))0))) + +#define CHECKED_SK_CMP_FUNC(type, p) \ + ((int (*)(const void *, const void *)) \ + ((1 ? p : (int (*)(const type * const *, const type * const *))0))) + +#define STACK_OF(type) struct stack_st_##type +#define PREDECLARE_STACK_OF(type) STACK_OF(type); + +#define DECLARE_STACK_OF(type) \ +STACK_OF(type) \ + { \ + _STACK stack; \ + }; +#define DECLARE_SPECIAL_STACK_OF(type, type2) \ +STACK_OF(type) \ + { \ + _STACK stack; \ + }; + +#define IMPLEMENT_STACK_OF(type) /* nada (obsolete in new safestack approach)*/ + + +/* Strings are special: normally an lhash entry will point to a single + * (somewhat) mutable object. In the case of strings: + * + * a) Instead of a single char, there is an array of chars, NUL-terminated. + * b) The string may have be immutable. + * + * So, they need their own declarations. Especially important for + * type-checking tools, such as Deputy. + * +o * In practice, however, it appears to be hard to have a const + * string. For now, I'm settling for dealing with the fact it is a + * string at all. + */ +typedef char *OPENSSL_STRING; + +typedef const char *OPENSSL_CSTRING; + +/* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but + * STACK_OF(STRING) is really more like STACK_OF(char), only, as + * mentioned above, instead of a single char each entry is a + * NUL-terminated array of chars. So, we have to implement STRING + * specially for STACK_OF. This is dealt with in the autogenerated + * macros below. + */ + +DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char) + +/* Similarly, we sometimes use a block of characters, NOT + * nul-terminated. These should also be distinguished from "normal" + * stacks. */ + +typedef void *OPENSSL_BLOCK; +DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) + +/* SKM_sk_... stack macros are internal to safestack.h: + * never use them directly, use sk__... instead */ +#define SKM_sk_new(type, cmp) \ + ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp))) +#define SKM_sk_new_null(type) \ + ((STACK_OF(type) *)sk_new_null()) +#define SKM_sk_free(type, st) \ + sk_free(CHECKED_STACK_OF(type, st)) +#define SKM_sk_num(type, st) \ + sk_num(CHECKED_STACK_OF(type, st)) +#define SKM_sk_value(type, st,i) \ + ((type *)sk_value(CHECKED_STACK_OF(type, st), i)) +#define SKM_sk_set(type, st,i,val) \ + sk_set(CHECKED_STACK_OF(type, st), i, CHECKED_PTR_OF(type, val)) +#define SKM_sk_zero(type, st) \ + sk_zero(CHECKED_STACK_OF(type, st)) +#define SKM_sk_push(type, st, val) \ + sk_push(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val)) +#define SKM_sk_unshift(type, st, val) \ + sk_unshift(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val)) +#define SKM_sk_find(type, st, val) \ + sk_find(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val)) +#define SKM_sk_find_ex(type, st, val) \ + sk_find_ex(CHECKED_STACK_OF(type, st), \ + CHECKED_PTR_OF(type, val)) +#define SKM_sk_delete(type, st, i) \ + (type *)sk_delete(CHECKED_STACK_OF(type, st), i) +#define SKM_sk_delete_ptr(type, st, ptr) \ + (type *)sk_delete_ptr(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, ptr)) +#define SKM_sk_insert(type, st,val, i) \ + sk_insert(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val), i) +#define SKM_sk_set_cmp_func(type, st, cmp) \ + ((int (*)(const type * const *,const type * const *)) \ + sk_set_cmp_func(CHECKED_STACK_OF(type, st), CHECKED_SK_CMP_FUNC(type, cmp))) +#define SKM_sk_dup(type, st) \ + (STACK_OF(type) *)sk_dup(CHECKED_STACK_OF(type, st)) +#define SKM_sk_pop_free(type, st, free_func) \ + sk_pop_free(CHECKED_STACK_OF(type, st), CHECKED_SK_FREE_FUNC(type, free_func)) +#define SKM_sk_shift(type, st) \ + (type *)sk_shift(CHECKED_STACK_OF(type, st)) +#define SKM_sk_pop(type, st) \ + (type *)sk_pop(CHECKED_STACK_OF(type, st)) +#define SKM_sk_sort(type, st) \ + sk_sort(CHECKED_STACK_OF(type, st)) +#define SKM_sk_is_sorted(type, st) \ + sk_is_sorted(CHECKED_STACK_OF(type, st)) + +#define sk_ACCESS_DESCRIPTION_new(cmp) SKM_sk_new(ACCESS_DESCRIPTION, (cmp)) +#define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION) +#define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i)) +#define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val)) +#define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i)) +#define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr)) +#define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i)) +#define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp)) +#define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st) +#define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func)) +#define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st)) + +#define sk_ASIdOrRange_new(cmp) SKM_sk_new(ASIdOrRange, (cmp)) +#define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange) +#define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st)) +#define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st)) +#define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i)) +#define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val)) +#define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st)) +#define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i)) +#define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr)) +#define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i)) +#define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp)) +#define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st) +#define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func)) +#define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st)) +#define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st)) +#define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st)) +#define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st)) + +#define sk_ASN1_GENERALSTRING_new(cmp) SKM_sk_new(ASN1_GENERALSTRING, (cmp)) +#define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING) +#define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i)) +#define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val)) +#define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i)) +#define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr)) +#define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i)) +#define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp)) +#define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st) +#define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func)) +#define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st)) + +#define sk_ASN1_INTEGER_new(cmp) SKM_sk_new(ASN1_INTEGER, (cmp)) +#define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER) +#define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i)) +#define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val)) +#define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i)) +#define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr)) +#define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i)) +#define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp)) +#define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st) +#define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func)) +#define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st)) + +#define sk_ASN1_OBJECT_new(cmp) SKM_sk_new(ASN1_OBJECT, (cmp)) +#define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT) +#define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i)) +#define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val)) +#define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i)) +#define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr)) +#define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i)) +#define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp)) +#define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st) +#define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func)) +#define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st)) + +#define sk_ASN1_STRING_TABLE_new(cmp) SKM_sk_new(ASN1_STRING_TABLE, (cmp)) +#define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE) +#define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i)) +#define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val)) +#define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i)) +#define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr)) +#define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i)) +#define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp)) +#define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st) +#define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func)) +#define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st)) + +#define sk_ASN1_TYPE_new(cmp) SKM_sk_new(ASN1_TYPE, (cmp)) +#define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE) +#define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i)) +#define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val)) +#define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i)) +#define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr)) +#define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i)) +#define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp)) +#define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st) +#define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func)) +#define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st)) + +#define sk_ASN1_UTF8STRING_new(cmp) SKM_sk_new(ASN1_UTF8STRING, (cmp)) +#define sk_ASN1_UTF8STRING_new_null() SKM_sk_new_null(ASN1_UTF8STRING) +#define sk_ASN1_UTF8STRING_free(st) SKM_sk_free(ASN1_UTF8STRING, (st)) +#define sk_ASN1_UTF8STRING_num(st) SKM_sk_num(ASN1_UTF8STRING, (st)) +#define sk_ASN1_UTF8STRING_value(st, i) SKM_sk_value(ASN1_UTF8STRING, (st), (i)) +#define sk_ASN1_UTF8STRING_set(st, i, val) SKM_sk_set(ASN1_UTF8STRING, (st), (i), (val)) +#define sk_ASN1_UTF8STRING_zero(st) SKM_sk_zero(ASN1_UTF8STRING, (st)) +#define sk_ASN1_UTF8STRING_push(st, val) SKM_sk_push(ASN1_UTF8STRING, (st), (val)) +#define sk_ASN1_UTF8STRING_unshift(st, val) SKM_sk_unshift(ASN1_UTF8STRING, (st), (val)) +#define sk_ASN1_UTF8STRING_find(st, val) SKM_sk_find(ASN1_UTF8STRING, (st), (val)) +#define sk_ASN1_UTF8STRING_find_ex(st, val) SKM_sk_find_ex(ASN1_UTF8STRING, (st), (val)) +#define sk_ASN1_UTF8STRING_delete(st, i) SKM_sk_delete(ASN1_UTF8STRING, (st), (i)) +#define sk_ASN1_UTF8STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_UTF8STRING, (st), (ptr)) +#define sk_ASN1_UTF8STRING_insert(st, val, i) SKM_sk_insert(ASN1_UTF8STRING, (st), (val), (i)) +#define sk_ASN1_UTF8STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_UTF8STRING, (st), (cmp)) +#define sk_ASN1_UTF8STRING_dup(st) SKM_sk_dup(ASN1_UTF8STRING, st) +#define sk_ASN1_UTF8STRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_UTF8STRING, (st), (free_func)) +#define sk_ASN1_UTF8STRING_shift(st) SKM_sk_shift(ASN1_UTF8STRING, (st)) +#define sk_ASN1_UTF8STRING_pop(st) SKM_sk_pop(ASN1_UTF8STRING, (st)) +#define sk_ASN1_UTF8STRING_sort(st) SKM_sk_sort(ASN1_UTF8STRING, (st)) +#define sk_ASN1_UTF8STRING_is_sorted(st) SKM_sk_is_sorted(ASN1_UTF8STRING, (st)) + +#define sk_ASN1_VALUE_new(cmp) SKM_sk_new(ASN1_VALUE, (cmp)) +#define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE) +#define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i)) +#define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val)) +#define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i)) +#define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr)) +#define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i)) +#define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp)) +#define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st) +#define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func)) +#define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st)) + +#define sk_BIO_new(cmp) SKM_sk_new(BIO, (cmp)) +#define sk_BIO_new_null() SKM_sk_new_null(BIO) +#define sk_BIO_free(st) SKM_sk_free(BIO, (st)) +#define sk_BIO_num(st) SKM_sk_num(BIO, (st)) +#define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i)) +#define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val)) +#define sk_BIO_zero(st) SKM_sk_zero(BIO, (st)) +#define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val)) +#define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val)) +#define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val)) +#define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val)) +#define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i)) +#define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr)) +#define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i)) +#define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp)) +#define sk_BIO_dup(st) SKM_sk_dup(BIO, st) +#define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func)) +#define sk_BIO_shift(st) SKM_sk_shift(BIO, (st)) +#define sk_BIO_pop(st) SKM_sk_pop(BIO, (st)) +#define sk_BIO_sort(st) SKM_sk_sort(BIO, (st)) +#define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st)) + +#define sk_BY_DIR_ENTRY_new(cmp) SKM_sk_new(BY_DIR_ENTRY, (cmp)) +#define sk_BY_DIR_ENTRY_new_null() SKM_sk_new_null(BY_DIR_ENTRY) +#define sk_BY_DIR_ENTRY_free(st) SKM_sk_free(BY_DIR_ENTRY, (st)) +#define sk_BY_DIR_ENTRY_num(st) SKM_sk_num(BY_DIR_ENTRY, (st)) +#define sk_BY_DIR_ENTRY_value(st, i) SKM_sk_value(BY_DIR_ENTRY, (st), (i)) +#define sk_BY_DIR_ENTRY_set(st, i, val) SKM_sk_set(BY_DIR_ENTRY, (st), (i), (val)) +#define sk_BY_DIR_ENTRY_zero(st) SKM_sk_zero(BY_DIR_ENTRY, (st)) +#define sk_BY_DIR_ENTRY_push(st, val) SKM_sk_push(BY_DIR_ENTRY, (st), (val)) +#define sk_BY_DIR_ENTRY_unshift(st, val) SKM_sk_unshift(BY_DIR_ENTRY, (st), (val)) +#define sk_BY_DIR_ENTRY_find(st, val) SKM_sk_find(BY_DIR_ENTRY, (st), (val)) +#define sk_BY_DIR_ENTRY_find_ex(st, val) SKM_sk_find_ex(BY_DIR_ENTRY, (st), (val)) +#define sk_BY_DIR_ENTRY_delete(st, i) SKM_sk_delete(BY_DIR_ENTRY, (st), (i)) +#define sk_BY_DIR_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_ENTRY, (st), (ptr)) +#define sk_BY_DIR_ENTRY_insert(st, val, i) SKM_sk_insert(BY_DIR_ENTRY, (st), (val), (i)) +#define sk_BY_DIR_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_ENTRY, (st), (cmp)) +#define sk_BY_DIR_ENTRY_dup(st) SKM_sk_dup(BY_DIR_ENTRY, st) +#define sk_BY_DIR_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_ENTRY, (st), (free_func)) +#define sk_BY_DIR_ENTRY_shift(st) SKM_sk_shift(BY_DIR_ENTRY, (st)) +#define sk_BY_DIR_ENTRY_pop(st) SKM_sk_pop(BY_DIR_ENTRY, (st)) +#define sk_BY_DIR_ENTRY_sort(st) SKM_sk_sort(BY_DIR_ENTRY, (st)) +#define sk_BY_DIR_ENTRY_is_sorted(st) SKM_sk_is_sorted(BY_DIR_ENTRY, (st)) + +#define sk_BY_DIR_HASH_new(cmp) SKM_sk_new(BY_DIR_HASH, (cmp)) +#define sk_BY_DIR_HASH_new_null() SKM_sk_new_null(BY_DIR_HASH) +#define sk_BY_DIR_HASH_free(st) SKM_sk_free(BY_DIR_HASH, (st)) +#define sk_BY_DIR_HASH_num(st) SKM_sk_num(BY_DIR_HASH, (st)) +#define sk_BY_DIR_HASH_value(st, i) SKM_sk_value(BY_DIR_HASH, (st), (i)) +#define sk_BY_DIR_HASH_set(st, i, val) SKM_sk_set(BY_DIR_HASH, (st), (i), (val)) +#define sk_BY_DIR_HASH_zero(st) SKM_sk_zero(BY_DIR_HASH, (st)) +#define sk_BY_DIR_HASH_push(st, val) SKM_sk_push(BY_DIR_HASH, (st), (val)) +#define sk_BY_DIR_HASH_unshift(st, val) SKM_sk_unshift(BY_DIR_HASH, (st), (val)) +#define sk_BY_DIR_HASH_find(st, val) SKM_sk_find(BY_DIR_HASH, (st), (val)) +#define sk_BY_DIR_HASH_find_ex(st, val) SKM_sk_find_ex(BY_DIR_HASH, (st), (val)) +#define sk_BY_DIR_HASH_delete(st, i) SKM_sk_delete(BY_DIR_HASH, (st), (i)) +#define sk_BY_DIR_HASH_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_HASH, (st), (ptr)) +#define sk_BY_DIR_HASH_insert(st, val, i) SKM_sk_insert(BY_DIR_HASH, (st), (val), (i)) +#define sk_BY_DIR_HASH_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_HASH, (st), (cmp)) +#define sk_BY_DIR_HASH_dup(st) SKM_sk_dup(BY_DIR_HASH, st) +#define sk_BY_DIR_HASH_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_HASH, (st), (free_func)) +#define sk_BY_DIR_HASH_shift(st) SKM_sk_shift(BY_DIR_HASH, (st)) +#define sk_BY_DIR_HASH_pop(st) SKM_sk_pop(BY_DIR_HASH, (st)) +#define sk_BY_DIR_HASH_sort(st) SKM_sk_sort(BY_DIR_HASH, (st)) +#define sk_BY_DIR_HASH_is_sorted(st) SKM_sk_is_sorted(BY_DIR_HASH, (st)) + +#define sk_CMS_CertificateChoices_new(cmp) SKM_sk_new(CMS_CertificateChoices, (cmp)) +#define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices) +#define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i)) +#define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val)) +#define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i)) +#define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr)) +#define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i)) +#define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp)) +#define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st) +#define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func)) +#define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st)) + +#define sk_CMS_RecipientEncryptedKey_new(cmp) SKM_sk_new(CMS_RecipientEncryptedKey, (cmp)) +#define sk_CMS_RecipientEncryptedKey_new_null() SKM_sk_new_null(CMS_RecipientEncryptedKey) +#define sk_CMS_RecipientEncryptedKey_free(st) SKM_sk_free(CMS_RecipientEncryptedKey, (st)) +#define sk_CMS_RecipientEncryptedKey_num(st) SKM_sk_num(CMS_RecipientEncryptedKey, (st)) +#define sk_CMS_RecipientEncryptedKey_value(st, i) SKM_sk_value(CMS_RecipientEncryptedKey, (st), (i)) +#define sk_CMS_RecipientEncryptedKey_set(st, i, val) SKM_sk_set(CMS_RecipientEncryptedKey, (st), (i), (val)) +#define sk_CMS_RecipientEncryptedKey_zero(st) SKM_sk_zero(CMS_RecipientEncryptedKey, (st)) +#define sk_CMS_RecipientEncryptedKey_push(st, val) SKM_sk_push(CMS_RecipientEncryptedKey, (st), (val)) +#define sk_CMS_RecipientEncryptedKey_unshift(st, val) SKM_sk_unshift(CMS_RecipientEncryptedKey, (st), (val)) +#define sk_CMS_RecipientEncryptedKey_find(st, val) SKM_sk_find(CMS_RecipientEncryptedKey, (st), (val)) +#define sk_CMS_RecipientEncryptedKey_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientEncryptedKey, (st), (val)) +#define sk_CMS_RecipientEncryptedKey_delete(st, i) SKM_sk_delete(CMS_RecipientEncryptedKey, (st), (i)) +#define sk_CMS_RecipientEncryptedKey_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientEncryptedKey, (st), (ptr)) +#define sk_CMS_RecipientEncryptedKey_insert(st, val, i) SKM_sk_insert(CMS_RecipientEncryptedKey, (st), (val), (i)) +#define sk_CMS_RecipientEncryptedKey_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientEncryptedKey, (st), (cmp)) +#define sk_CMS_RecipientEncryptedKey_dup(st) SKM_sk_dup(CMS_RecipientEncryptedKey, st) +#define sk_CMS_RecipientEncryptedKey_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientEncryptedKey, (st), (free_func)) +#define sk_CMS_RecipientEncryptedKey_shift(st) SKM_sk_shift(CMS_RecipientEncryptedKey, (st)) +#define sk_CMS_RecipientEncryptedKey_pop(st) SKM_sk_pop(CMS_RecipientEncryptedKey, (st)) +#define sk_CMS_RecipientEncryptedKey_sort(st) SKM_sk_sort(CMS_RecipientEncryptedKey, (st)) +#define sk_CMS_RecipientEncryptedKey_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientEncryptedKey, (st)) + +#define sk_CMS_RecipientInfo_new(cmp) SKM_sk_new(CMS_RecipientInfo, (cmp)) +#define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo) +#define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i)) +#define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val)) +#define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i)) +#define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr)) +#define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i)) +#define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp)) +#define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st) +#define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func)) +#define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st)) + +#define sk_CMS_RevocationInfoChoice_new(cmp) SKM_sk_new(CMS_RevocationInfoChoice, (cmp)) +#define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice) +#define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i)) +#define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val)) +#define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i)) +#define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr)) +#define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i)) +#define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp)) +#define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st) +#define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func)) +#define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st)) + +#define sk_CMS_SignerInfo_new(cmp) SKM_sk_new(CMS_SignerInfo, (cmp)) +#define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo) +#define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i)) +#define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val)) +#define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i)) +#define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr)) +#define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i)) +#define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp)) +#define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st) +#define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func)) +#define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st)) + +#define sk_CONF_IMODULE_new(cmp) SKM_sk_new(CONF_IMODULE, (cmp)) +#define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE) +#define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i)) +#define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val)) +#define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i)) +#define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr)) +#define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i)) +#define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp)) +#define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st) +#define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func)) +#define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st)) + +#define sk_CONF_MODULE_new(cmp) SKM_sk_new(CONF_MODULE, (cmp)) +#define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE) +#define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st)) +#define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st)) +#define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i)) +#define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val)) +#define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st)) +#define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i)) +#define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr)) +#define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i)) +#define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp)) +#define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st) +#define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func)) +#define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st)) +#define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st)) +#define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st)) +#define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st)) + +#define sk_CONF_VALUE_new(cmp) SKM_sk_new(CONF_VALUE, (cmp)) +#define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE) +#define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st)) +#define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st)) +#define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i)) +#define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val)) +#define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st)) +#define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i)) +#define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr)) +#define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i)) +#define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp)) +#define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st) +#define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func)) +#define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st)) +#define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st)) +#define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st)) +#define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st)) + +#define sk_CRYPTO_EX_DATA_FUNCS_new(cmp) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (cmp)) +#define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS) +#define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i)) +#define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i)) +#define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr)) +#define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i)) +#define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp)) +#define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st) +#define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func)) +#define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st)) + +#define sk_CRYPTO_dynlock_new(cmp) SKM_sk_new(CRYPTO_dynlock, (cmp)) +#define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock) +#define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i)) +#define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val)) +#define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i)) +#define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr)) +#define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i)) +#define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp)) +#define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st) +#define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func)) +#define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st)) + +#define sk_CTLOG_new(cmp) SKM_sk_new(CTLOG, (cmp)) +#define sk_CTLOG_new_null() SKM_sk_new_null(CTLOG) +#define sk_CTLOG_free(st) SKM_sk_free(CTLOG, (st)) +#define sk_CTLOG_num(st) SKM_sk_num(CTLOG, (st)) +#define sk_CTLOG_value(st, i) SKM_sk_value(CTLOG, (st), (i)) +#define sk_CTLOG_set(st, i, val) SKM_sk_set(CTLOG, (st), (i), (val)) +#define sk_CTLOG_zero(st) SKM_sk_zero(CTLOG, (st)) +#define sk_CTLOG_push(st, val) SKM_sk_push(CTLOG, (st), (val)) +#define sk_CTLOG_unshift(st, val) SKM_sk_unshift(CTLOG, (st), (val)) +#define sk_CTLOG_find(st, val) SKM_sk_find(CTLOG, (st), (val)) +#define sk_CTLOG_find_ex(st, val) SKM_sk_find_ex(CTLOG, (st), (val)) +#define sk_CTLOG_delete(st, i) SKM_sk_delete(CTLOG, (st), (i)) +#define sk_CTLOG_delete_ptr(st, ptr) SKM_sk_delete_ptr(CTLOG, (st), (ptr)) +#define sk_CTLOG_insert(st, val, i) SKM_sk_insert(CTLOG, (st), (val), (i)) +#define sk_CTLOG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CTLOG, (st), (cmp)) +#define sk_CTLOG_dup(st) SKM_sk_dup(CTLOG, st) +#define sk_CTLOG_pop_free(st, free_func) SKM_sk_pop_free(CTLOG, (st), (free_func)) +#define sk_CTLOG_shift(st) SKM_sk_shift(CTLOG, (st)) +#define sk_CTLOG_pop(st) SKM_sk_pop(CTLOG, (st)) +#define sk_CTLOG_sort(st) SKM_sk_sort(CTLOG, (st)) +#define sk_CTLOG_is_sorted(st) SKM_sk_is_sorted(CTLOG, (st)) + +#define sk_DIST_POINT_new(cmp) SKM_sk_new(DIST_POINT, (cmp)) +#define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT) +#define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st)) +#define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st)) +#define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i)) +#define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val)) +#define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st)) +#define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i)) +#define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr)) +#define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i)) +#define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp)) +#define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st) +#define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func)) +#define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st)) +#define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st)) +#define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st)) +#define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st)) + +#define sk_ENGINE_new(cmp) SKM_sk_new(ENGINE, (cmp)) +#define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE) +#define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st)) +#define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st)) +#define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i)) +#define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val)) +#define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st)) +#define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val)) +#define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val)) +#define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val)) +#define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val)) +#define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i)) +#define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr)) +#define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i)) +#define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp)) +#define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st) +#define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func)) +#define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st)) +#define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st)) +#define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st)) +#define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st)) + +#define sk_ENGINE_CLEANUP_ITEM_new(cmp) SKM_sk_new(ENGINE_CLEANUP_ITEM, (cmp)) +#define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM) +#define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i)) +#define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val)) +#define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i)) +#define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr)) +#define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i)) +#define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp)) +#define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st) +#define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func)) +#define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st)) + +#define sk_ESS_CERT_ID_new(cmp) SKM_sk_new(ESS_CERT_ID, (cmp)) +#define sk_ESS_CERT_ID_new_null() SKM_sk_new_null(ESS_CERT_ID) +#define sk_ESS_CERT_ID_free(st) SKM_sk_free(ESS_CERT_ID, (st)) +#define sk_ESS_CERT_ID_num(st) SKM_sk_num(ESS_CERT_ID, (st)) +#define sk_ESS_CERT_ID_value(st, i) SKM_sk_value(ESS_CERT_ID, (st), (i)) +#define sk_ESS_CERT_ID_set(st, i, val) SKM_sk_set(ESS_CERT_ID, (st), (i), (val)) +#define sk_ESS_CERT_ID_zero(st) SKM_sk_zero(ESS_CERT_ID, (st)) +#define sk_ESS_CERT_ID_push(st, val) SKM_sk_push(ESS_CERT_ID, (st), (val)) +#define sk_ESS_CERT_ID_unshift(st, val) SKM_sk_unshift(ESS_CERT_ID, (st), (val)) +#define sk_ESS_CERT_ID_find(st, val) SKM_sk_find(ESS_CERT_ID, (st), (val)) +#define sk_ESS_CERT_ID_find_ex(st, val) SKM_sk_find_ex(ESS_CERT_ID, (st), (val)) +#define sk_ESS_CERT_ID_delete(st, i) SKM_sk_delete(ESS_CERT_ID, (st), (i)) +#define sk_ESS_CERT_ID_delete_ptr(st, ptr) SKM_sk_delete_ptr(ESS_CERT_ID, (st), (ptr)) +#define sk_ESS_CERT_ID_insert(st, val, i) SKM_sk_insert(ESS_CERT_ID, (st), (val), (i)) +#define sk_ESS_CERT_ID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ESS_CERT_ID, (st), (cmp)) +#define sk_ESS_CERT_ID_dup(st) SKM_sk_dup(ESS_CERT_ID, st) +#define sk_ESS_CERT_ID_pop_free(st, free_func) SKM_sk_pop_free(ESS_CERT_ID, (st), (free_func)) +#define sk_ESS_CERT_ID_shift(st) SKM_sk_shift(ESS_CERT_ID, (st)) +#define sk_ESS_CERT_ID_pop(st) SKM_sk_pop(ESS_CERT_ID, (st)) +#define sk_ESS_CERT_ID_sort(st) SKM_sk_sort(ESS_CERT_ID, (st)) +#define sk_ESS_CERT_ID_is_sorted(st) SKM_sk_is_sorted(ESS_CERT_ID, (st)) + +#define sk_EVP_MD_new(cmp) SKM_sk_new(EVP_MD, (cmp)) +#define sk_EVP_MD_new_null() SKM_sk_new_null(EVP_MD) +#define sk_EVP_MD_free(st) SKM_sk_free(EVP_MD, (st)) +#define sk_EVP_MD_num(st) SKM_sk_num(EVP_MD, (st)) +#define sk_EVP_MD_value(st, i) SKM_sk_value(EVP_MD, (st), (i)) +#define sk_EVP_MD_set(st, i, val) SKM_sk_set(EVP_MD, (st), (i), (val)) +#define sk_EVP_MD_zero(st) SKM_sk_zero(EVP_MD, (st)) +#define sk_EVP_MD_push(st, val) SKM_sk_push(EVP_MD, (st), (val)) +#define sk_EVP_MD_unshift(st, val) SKM_sk_unshift(EVP_MD, (st), (val)) +#define sk_EVP_MD_find(st, val) SKM_sk_find(EVP_MD, (st), (val)) +#define sk_EVP_MD_find_ex(st, val) SKM_sk_find_ex(EVP_MD, (st), (val)) +#define sk_EVP_MD_delete(st, i) SKM_sk_delete(EVP_MD, (st), (i)) +#define sk_EVP_MD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_MD, (st), (ptr)) +#define sk_EVP_MD_insert(st, val, i) SKM_sk_insert(EVP_MD, (st), (val), (i)) +#define sk_EVP_MD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_MD, (st), (cmp)) +#define sk_EVP_MD_dup(st) SKM_sk_dup(EVP_MD, st) +#define sk_EVP_MD_pop_free(st, free_func) SKM_sk_pop_free(EVP_MD, (st), (free_func)) +#define sk_EVP_MD_shift(st) SKM_sk_shift(EVP_MD, (st)) +#define sk_EVP_MD_pop(st) SKM_sk_pop(EVP_MD, (st)) +#define sk_EVP_MD_sort(st) SKM_sk_sort(EVP_MD, (st)) +#define sk_EVP_MD_is_sorted(st) SKM_sk_is_sorted(EVP_MD, (st)) + +#define sk_EVP_PBE_CTL_new(cmp) SKM_sk_new(EVP_PBE_CTL, (cmp)) +#define sk_EVP_PBE_CTL_new_null() SKM_sk_new_null(EVP_PBE_CTL) +#define sk_EVP_PBE_CTL_free(st) SKM_sk_free(EVP_PBE_CTL, (st)) +#define sk_EVP_PBE_CTL_num(st) SKM_sk_num(EVP_PBE_CTL, (st)) +#define sk_EVP_PBE_CTL_value(st, i) SKM_sk_value(EVP_PBE_CTL, (st), (i)) +#define sk_EVP_PBE_CTL_set(st, i, val) SKM_sk_set(EVP_PBE_CTL, (st), (i), (val)) +#define sk_EVP_PBE_CTL_zero(st) SKM_sk_zero(EVP_PBE_CTL, (st)) +#define sk_EVP_PBE_CTL_push(st, val) SKM_sk_push(EVP_PBE_CTL, (st), (val)) +#define sk_EVP_PBE_CTL_unshift(st, val) SKM_sk_unshift(EVP_PBE_CTL, (st), (val)) +#define sk_EVP_PBE_CTL_find(st, val) SKM_sk_find(EVP_PBE_CTL, (st), (val)) +#define sk_EVP_PBE_CTL_find_ex(st, val) SKM_sk_find_ex(EVP_PBE_CTL, (st), (val)) +#define sk_EVP_PBE_CTL_delete(st, i) SKM_sk_delete(EVP_PBE_CTL, (st), (i)) +#define sk_EVP_PBE_CTL_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PBE_CTL, (st), (ptr)) +#define sk_EVP_PBE_CTL_insert(st, val, i) SKM_sk_insert(EVP_PBE_CTL, (st), (val), (i)) +#define sk_EVP_PBE_CTL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PBE_CTL, (st), (cmp)) +#define sk_EVP_PBE_CTL_dup(st) SKM_sk_dup(EVP_PBE_CTL, st) +#define sk_EVP_PBE_CTL_pop_free(st, free_func) SKM_sk_pop_free(EVP_PBE_CTL, (st), (free_func)) +#define sk_EVP_PBE_CTL_shift(st) SKM_sk_shift(EVP_PBE_CTL, (st)) +#define sk_EVP_PBE_CTL_pop(st) SKM_sk_pop(EVP_PBE_CTL, (st)) +#define sk_EVP_PBE_CTL_sort(st) SKM_sk_sort(EVP_PBE_CTL, (st)) +#define sk_EVP_PBE_CTL_is_sorted(st) SKM_sk_is_sorted(EVP_PBE_CTL, (st)) + +#define sk_EVP_PKEY_ASN1_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_ASN1_METHOD, (cmp)) +#define sk_EVP_PKEY_ASN1_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_ASN1_METHOD) +#define sk_EVP_PKEY_ASN1_METHOD_free(st) SKM_sk_free(EVP_PKEY_ASN1_METHOD, (st)) +#define sk_EVP_PKEY_ASN1_METHOD_num(st) SKM_sk_num(EVP_PKEY_ASN1_METHOD, (st)) +#define sk_EVP_PKEY_ASN1_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_ASN1_METHOD, (st), (i)) +#define sk_EVP_PKEY_ASN1_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_ASN1_METHOD, (st), (i), (val)) +#define sk_EVP_PKEY_ASN1_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_ASN1_METHOD, (st)) +#define sk_EVP_PKEY_ASN1_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_ASN1_METHOD, (st), (val)) +#define sk_EVP_PKEY_ASN1_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_ASN1_METHOD, (st), (val)) +#define sk_EVP_PKEY_ASN1_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_ASN1_METHOD, (st), (val)) +#define sk_EVP_PKEY_ASN1_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_ASN1_METHOD, (st), (val)) +#define sk_EVP_PKEY_ASN1_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_ASN1_METHOD, (st), (i)) +#define sk_EVP_PKEY_ASN1_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_ASN1_METHOD, (st), (ptr)) +#define sk_EVP_PKEY_ASN1_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_ASN1_METHOD, (st), (val), (i)) +#define sk_EVP_PKEY_ASN1_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_ASN1_METHOD, (st), (cmp)) +#define sk_EVP_PKEY_ASN1_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_ASN1_METHOD, st) +#define sk_EVP_PKEY_ASN1_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_ASN1_METHOD, (st), (free_func)) +#define sk_EVP_PKEY_ASN1_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_ASN1_METHOD, (st)) +#define sk_EVP_PKEY_ASN1_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_ASN1_METHOD, (st)) +#define sk_EVP_PKEY_ASN1_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_ASN1_METHOD, (st)) +#define sk_EVP_PKEY_ASN1_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_ASN1_METHOD, (st)) + +#define sk_EVP_PKEY_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_METHOD, (cmp)) +#define sk_EVP_PKEY_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_METHOD) +#define sk_EVP_PKEY_METHOD_free(st) SKM_sk_free(EVP_PKEY_METHOD, (st)) +#define sk_EVP_PKEY_METHOD_num(st) SKM_sk_num(EVP_PKEY_METHOD, (st)) +#define sk_EVP_PKEY_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_METHOD, (st), (i)) +#define sk_EVP_PKEY_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_METHOD, (st), (i), (val)) +#define sk_EVP_PKEY_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_METHOD, (st)) +#define sk_EVP_PKEY_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_METHOD, (st), (val)) +#define sk_EVP_PKEY_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_METHOD, (st), (val)) +#define sk_EVP_PKEY_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_METHOD, (st), (val)) +#define sk_EVP_PKEY_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_METHOD, (st), (val)) +#define sk_EVP_PKEY_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_METHOD, (st), (i)) +#define sk_EVP_PKEY_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_METHOD, (st), (ptr)) +#define sk_EVP_PKEY_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_METHOD, (st), (val), (i)) +#define sk_EVP_PKEY_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_METHOD, (st), (cmp)) +#define sk_EVP_PKEY_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_METHOD, st) +#define sk_EVP_PKEY_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_METHOD, (st), (free_func)) +#define sk_EVP_PKEY_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_METHOD, (st)) +#define sk_EVP_PKEY_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_METHOD, (st)) +#define sk_EVP_PKEY_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_METHOD, (st)) +#define sk_EVP_PKEY_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_METHOD, (st)) + +#define sk_GENERAL_NAME_new(cmp) SKM_sk_new(GENERAL_NAME, (cmp)) +#define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME) +#define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i)) +#define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val)) +#define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i)) +#define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr)) +#define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i)) +#define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp)) +#define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st) +#define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func)) +#define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st)) + +#define sk_GENERAL_NAMES_new(cmp) SKM_sk_new(GENERAL_NAMES, (cmp)) +#define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES) +#define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i)) +#define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val)) +#define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i)) +#define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr)) +#define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i)) +#define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp)) +#define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st) +#define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func)) +#define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st)) + +#define sk_GENERAL_SUBTREE_new(cmp) SKM_sk_new(GENERAL_SUBTREE, (cmp)) +#define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE) +#define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i)) +#define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val)) +#define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i)) +#define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr)) +#define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i)) +#define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp)) +#define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st) +#define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func)) +#define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st)) + +#define sk_IPAddressFamily_new(cmp) SKM_sk_new(IPAddressFamily, (cmp)) +#define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily) +#define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st)) +#define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st)) +#define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i)) +#define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val)) +#define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st)) +#define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i)) +#define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr)) +#define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i)) +#define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp)) +#define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st) +#define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func)) +#define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st)) +#define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st)) +#define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st)) +#define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st)) + +#define sk_IPAddressOrRange_new(cmp) SKM_sk_new(IPAddressOrRange, (cmp)) +#define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange) +#define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i)) +#define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val)) +#define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i)) +#define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr)) +#define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i)) +#define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp)) +#define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st) +#define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func)) +#define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st)) + +#define sk_MEM_OBJECT_DATA_new(cmp) SKM_sk_new(MEM_OBJECT_DATA, (cmp)) +#define sk_MEM_OBJECT_DATA_new_null() SKM_sk_new_null(MEM_OBJECT_DATA) +#define sk_MEM_OBJECT_DATA_free(st) SKM_sk_free(MEM_OBJECT_DATA, (st)) +#define sk_MEM_OBJECT_DATA_num(st) SKM_sk_num(MEM_OBJECT_DATA, (st)) +#define sk_MEM_OBJECT_DATA_value(st, i) SKM_sk_value(MEM_OBJECT_DATA, (st), (i)) +#define sk_MEM_OBJECT_DATA_set(st, i, val) SKM_sk_set(MEM_OBJECT_DATA, (st), (i), (val)) +#define sk_MEM_OBJECT_DATA_zero(st) SKM_sk_zero(MEM_OBJECT_DATA, (st)) +#define sk_MEM_OBJECT_DATA_push(st, val) SKM_sk_push(MEM_OBJECT_DATA, (st), (val)) +#define sk_MEM_OBJECT_DATA_unshift(st, val) SKM_sk_unshift(MEM_OBJECT_DATA, (st), (val)) +#define sk_MEM_OBJECT_DATA_find(st, val) SKM_sk_find(MEM_OBJECT_DATA, (st), (val)) +#define sk_MEM_OBJECT_DATA_find_ex(st, val) SKM_sk_find_ex(MEM_OBJECT_DATA, (st), (val)) +#define sk_MEM_OBJECT_DATA_delete(st, i) SKM_sk_delete(MEM_OBJECT_DATA, (st), (i)) +#define sk_MEM_OBJECT_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(MEM_OBJECT_DATA, (st), (ptr)) +#define sk_MEM_OBJECT_DATA_insert(st, val, i) SKM_sk_insert(MEM_OBJECT_DATA, (st), (val), (i)) +#define sk_MEM_OBJECT_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MEM_OBJECT_DATA, (st), (cmp)) +#define sk_MEM_OBJECT_DATA_dup(st) SKM_sk_dup(MEM_OBJECT_DATA, st) +#define sk_MEM_OBJECT_DATA_pop_free(st, free_func) SKM_sk_pop_free(MEM_OBJECT_DATA, (st), (free_func)) +#define sk_MEM_OBJECT_DATA_shift(st) SKM_sk_shift(MEM_OBJECT_DATA, (st)) +#define sk_MEM_OBJECT_DATA_pop(st) SKM_sk_pop(MEM_OBJECT_DATA, (st)) +#define sk_MEM_OBJECT_DATA_sort(st) SKM_sk_sort(MEM_OBJECT_DATA, (st)) +#define sk_MEM_OBJECT_DATA_is_sorted(st) SKM_sk_is_sorted(MEM_OBJECT_DATA, (st)) + +#define sk_MIME_HEADER_new(cmp) SKM_sk_new(MIME_HEADER, (cmp)) +#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER) +#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st)) +#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st)) +#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i)) +#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val)) +#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st)) +#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i)) +#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr)) +#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i)) +#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp)) +#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st) +#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func)) +#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st)) +#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st)) +#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) +#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) + +#define sk_MIME_PARAM_new(cmp) SKM_sk_new(MIME_PARAM, (cmp)) +#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) +#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) +#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st)) +#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i)) +#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val)) +#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st)) +#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i)) +#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr)) +#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i)) +#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp)) +#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st) +#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func)) +#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st)) +#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st)) +#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st)) +#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st)) + +#define sk_NAME_FUNCS_new(cmp) SKM_sk_new(NAME_FUNCS, (cmp)) +#define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS) +#define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i)) +#define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val)) +#define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i)) +#define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr)) +#define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i)) +#define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp)) +#define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st) +#define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func)) +#define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st)) + +#define sk_OCSP_CERTID_new(cmp) SKM_sk_new(OCSP_CERTID, (cmp)) +#define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID) +#define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i)) +#define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val)) +#define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i)) +#define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr)) +#define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i)) +#define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp)) +#define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st) +#define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func)) +#define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st)) + +#define sk_OCSP_ONEREQ_new(cmp) SKM_sk_new(OCSP_ONEREQ, (cmp)) +#define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ) +#define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i)) +#define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val)) +#define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i)) +#define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr)) +#define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i)) +#define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp)) +#define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st) +#define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func)) +#define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st)) + +#define sk_OCSP_RESPID_new(cmp) SKM_sk_new(OCSP_RESPID, (cmp)) +#define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID) +#define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i)) +#define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val)) +#define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i)) +#define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr)) +#define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i)) +#define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp)) +#define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st) +#define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func)) +#define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st)) + +#define sk_OCSP_SINGLERESP_new(cmp) SKM_sk_new(OCSP_SINGLERESP, (cmp)) +#define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP) +#define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i)) +#define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val)) +#define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i)) +#define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr)) +#define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i)) +#define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp)) +#define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st) +#define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func)) +#define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st)) + +#define sk_PKCS12_SAFEBAG_new(cmp) SKM_sk_new(PKCS12_SAFEBAG, (cmp)) +#define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG) +#define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i)) +#define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val)) +#define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i)) +#define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr)) +#define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i)) +#define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp)) +#define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st) +#define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func)) +#define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st)) + +#define sk_PKCS7_new(cmp) SKM_sk_new(PKCS7, (cmp)) +#define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7) +#define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st)) +#define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st)) +#define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i)) +#define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val)) +#define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st)) +#define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val)) +#define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val)) +#define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val)) +#define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val)) +#define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i)) +#define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr)) +#define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i)) +#define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp)) +#define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st) +#define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func)) +#define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st)) +#define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st)) +#define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st)) +#define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st)) + +#define sk_PKCS7_RECIP_INFO_new(cmp) SKM_sk_new(PKCS7_RECIP_INFO, (cmp)) +#define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO) +#define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i)) +#define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val)) +#define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i)) +#define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr)) +#define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i)) +#define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp)) +#define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st) +#define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func)) +#define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st)) + +#define sk_PKCS7_SIGNER_INFO_new(cmp) SKM_sk_new(PKCS7_SIGNER_INFO, (cmp)) +#define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO) +#define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i)) +#define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val)) +#define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i)) +#define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr)) +#define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i)) +#define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp)) +#define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st) +#define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func)) +#define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st)) + +#define sk_POLICYINFO_new(cmp) SKM_sk_new(POLICYINFO, (cmp)) +#define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO) +#define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st)) +#define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st)) +#define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i)) +#define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val)) +#define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st)) +#define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i)) +#define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr)) +#define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i)) +#define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp)) +#define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st) +#define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func)) +#define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st)) +#define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st)) +#define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st)) +#define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st)) + +#define sk_POLICYQUALINFO_new(cmp) SKM_sk_new(POLICYQUALINFO, (cmp)) +#define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO) +#define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i)) +#define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val)) +#define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i)) +#define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr)) +#define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i)) +#define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp)) +#define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st) +#define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func)) +#define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st)) + +#define sk_POLICY_MAPPING_new(cmp) SKM_sk_new(POLICY_MAPPING, (cmp)) +#define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING) +#define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i)) +#define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val)) +#define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i)) +#define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr)) +#define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i)) +#define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp)) +#define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st) +#define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func)) +#define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) + +#define sk_SCT_new(cmp) SKM_sk_new(SCT, (cmp)) +#define sk_SCT_new_null() SKM_sk_new_null(SCT) +#define sk_SCT_free(st) SKM_sk_free(SCT, (st)) +#define sk_SCT_num(st) SKM_sk_num(SCT, (st)) +#define sk_SCT_value(st, i) SKM_sk_value(SCT, (st), (i)) +#define sk_SCT_set(st, i, val) SKM_sk_set(SCT, (st), (i), (val)) +#define sk_SCT_zero(st) SKM_sk_zero(SCT, (st)) +#define sk_SCT_push(st, val) SKM_sk_push(SCT, (st), (val)) +#define sk_SCT_unshift(st, val) SKM_sk_unshift(SCT, (st), (val)) +#define sk_SCT_find(st, val) SKM_sk_find(SCT, (st), (val)) +#define sk_SCT_find_ex(st, val) SKM_sk_find_ex(SCT, (st), (val)) +#define sk_SCT_delete(st, i) SKM_sk_delete(SCT, (st), (i)) +#define sk_SCT_delete_ptr(st, ptr) SKM_sk_delete_ptr(SCT, (st), (ptr)) +#define sk_SCT_insert(st, val, i) SKM_sk_insert(SCT, (st), (val), (i)) +#define sk_SCT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SCT, (st), (cmp)) +#define sk_SCT_dup(st) SKM_sk_dup(SCT, st) +#define sk_SCT_pop_free(st, free_func) SKM_sk_pop_free(SCT, (st), (free_func)) +#define sk_SCT_shift(st) SKM_sk_shift(SCT, (st)) +#define sk_SCT_pop(st) SKM_sk_pop(SCT, (st)) +#define sk_SCT_sort(st) SKM_sk_sort(SCT, (st)) +#define sk_SCT_is_sorted(st) SKM_sk_is_sorted(SCT, (st)) + +#define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp)) +#define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE) +#define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st)) +#define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st)) +#define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i)) +#define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val)) +#define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st)) +#define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val)) +#define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val)) +#define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val)) +#define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val)) +#define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i)) +#define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr)) +#define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i)) +#define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp)) +#define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st) +#define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func)) +#define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st)) +#define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st)) +#define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st)) +#define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st)) + +#define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp)) +#define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER) +#define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i)) +#define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val)) +#define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i)) +#define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr)) +#define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i)) +#define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp)) +#define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st) +#define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func)) +#define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st)) + +#define sk_SSL_COMP_new(cmp) SKM_sk_new(SSL_COMP, (cmp)) +#define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP) +#define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st)) +#define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st)) +#define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i)) +#define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val)) +#define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st)) +#define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i)) +#define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr)) +#define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i)) +#define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp)) +#define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st) +#define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func)) +#define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st)) +#define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st)) +#define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st)) +#define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st)) + +#define sk_STACK_OF_X509_NAME_ENTRY_new(cmp) SKM_sk_new(STACK_OF_X509_NAME_ENTRY, (cmp)) +#define sk_STACK_OF_X509_NAME_ENTRY_new_null() SKM_sk_new_null(STACK_OF_X509_NAME_ENTRY) +#define sk_STACK_OF_X509_NAME_ENTRY_free(st) SKM_sk_free(STACK_OF_X509_NAME_ENTRY, (st)) +#define sk_STACK_OF_X509_NAME_ENTRY_num(st) SKM_sk_num(STACK_OF_X509_NAME_ENTRY, (st)) +#define sk_STACK_OF_X509_NAME_ENTRY_value(st, i) SKM_sk_value(STACK_OF_X509_NAME_ENTRY, (st), (i)) +#define sk_STACK_OF_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(STACK_OF_X509_NAME_ENTRY, (st), (i), (val)) +#define sk_STACK_OF_X509_NAME_ENTRY_zero(st) SKM_sk_zero(STACK_OF_X509_NAME_ENTRY, (st)) +#define sk_STACK_OF_X509_NAME_ENTRY_push(st, val) SKM_sk_push(STACK_OF_X509_NAME_ENTRY, (st), (val)) +#define sk_STACK_OF_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(STACK_OF_X509_NAME_ENTRY, (st), (val)) +#define sk_STACK_OF_X509_NAME_ENTRY_find(st, val) SKM_sk_find(STACK_OF_X509_NAME_ENTRY, (st), (val)) +#define sk_STACK_OF_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(STACK_OF_X509_NAME_ENTRY, (st), (val)) +#define sk_STACK_OF_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(STACK_OF_X509_NAME_ENTRY, (st), (i)) +#define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(STACK_OF_X509_NAME_ENTRY, (st), (ptr)) +#define sk_STACK_OF_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(STACK_OF_X509_NAME_ENTRY, (st), (val), (i)) +#define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STACK_OF_X509_NAME_ENTRY, (st), (cmp)) +#define sk_STACK_OF_X509_NAME_ENTRY_dup(st) SKM_sk_dup(STACK_OF_X509_NAME_ENTRY, st) +#define sk_STACK_OF_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(STACK_OF_X509_NAME_ENTRY, (st), (free_func)) +#define sk_STACK_OF_X509_NAME_ENTRY_shift(st) SKM_sk_shift(STACK_OF_X509_NAME_ENTRY, (st)) +#define sk_STACK_OF_X509_NAME_ENTRY_pop(st) SKM_sk_pop(STACK_OF_X509_NAME_ENTRY, (st)) +#define sk_STACK_OF_X509_NAME_ENTRY_sort(st) SKM_sk_sort(STACK_OF_X509_NAME_ENTRY, (st)) +#define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(STACK_OF_X509_NAME_ENTRY, (st)) + +#define sk_STORE_ATTR_INFO_new(cmp) SKM_sk_new(STORE_ATTR_INFO, (cmp)) +#define sk_STORE_ATTR_INFO_new_null() SKM_sk_new_null(STORE_ATTR_INFO) +#define sk_STORE_ATTR_INFO_free(st) SKM_sk_free(STORE_ATTR_INFO, (st)) +#define sk_STORE_ATTR_INFO_num(st) SKM_sk_num(STORE_ATTR_INFO, (st)) +#define sk_STORE_ATTR_INFO_value(st, i) SKM_sk_value(STORE_ATTR_INFO, (st), (i)) +#define sk_STORE_ATTR_INFO_set(st, i, val) SKM_sk_set(STORE_ATTR_INFO, (st), (i), (val)) +#define sk_STORE_ATTR_INFO_zero(st) SKM_sk_zero(STORE_ATTR_INFO, (st)) +#define sk_STORE_ATTR_INFO_push(st, val) SKM_sk_push(STORE_ATTR_INFO, (st), (val)) +#define sk_STORE_ATTR_INFO_unshift(st, val) SKM_sk_unshift(STORE_ATTR_INFO, (st), (val)) +#define sk_STORE_ATTR_INFO_find(st, val) SKM_sk_find(STORE_ATTR_INFO, (st), (val)) +#define sk_STORE_ATTR_INFO_find_ex(st, val) SKM_sk_find_ex(STORE_ATTR_INFO, (st), (val)) +#define sk_STORE_ATTR_INFO_delete(st, i) SKM_sk_delete(STORE_ATTR_INFO, (st), (i)) +#define sk_STORE_ATTR_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_ATTR_INFO, (st), (ptr)) +#define sk_STORE_ATTR_INFO_insert(st, val, i) SKM_sk_insert(STORE_ATTR_INFO, (st), (val), (i)) +#define sk_STORE_ATTR_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_ATTR_INFO, (st), (cmp)) +#define sk_STORE_ATTR_INFO_dup(st) SKM_sk_dup(STORE_ATTR_INFO, st) +#define sk_STORE_ATTR_INFO_pop_free(st, free_func) SKM_sk_pop_free(STORE_ATTR_INFO, (st), (free_func)) +#define sk_STORE_ATTR_INFO_shift(st) SKM_sk_shift(STORE_ATTR_INFO, (st)) +#define sk_STORE_ATTR_INFO_pop(st) SKM_sk_pop(STORE_ATTR_INFO, (st)) +#define sk_STORE_ATTR_INFO_sort(st) SKM_sk_sort(STORE_ATTR_INFO, (st)) +#define sk_STORE_ATTR_INFO_is_sorted(st) SKM_sk_is_sorted(STORE_ATTR_INFO, (st)) + +#define sk_STORE_OBJECT_new(cmp) SKM_sk_new(STORE_OBJECT, (cmp)) +#define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT) +#define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i)) +#define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val)) +#define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i)) +#define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr)) +#define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i)) +#define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp)) +#define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st) +#define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func)) +#define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st)) + +#define sk_SXNETID_new(cmp) SKM_sk_new(SXNETID, (cmp)) +#define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID) +#define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st)) +#define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st)) +#define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i)) +#define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val)) +#define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st)) +#define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val)) +#define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val)) +#define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val)) +#define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val)) +#define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i)) +#define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr)) +#define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i)) +#define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp)) +#define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st) +#define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func)) +#define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st)) +#define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st)) +#define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st)) +#define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st)) + +#define sk_UI_STRING_new(cmp) SKM_sk_new(UI_STRING, (cmp)) +#define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING) +#define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st)) +#define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st)) +#define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i)) +#define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val)) +#define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st)) +#define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val)) +#define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val)) +#define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val)) +#define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val)) +#define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i)) +#define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr)) +#define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i)) +#define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp)) +#define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st) +#define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func)) +#define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st)) +#define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st)) +#define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st)) +#define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st)) + +#define sk_X509_new(cmp) SKM_sk_new(X509, (cmp)) +#define sk_X509_new_null() SKM_sk_new_null(X509) +#define sk_X509_free(st) SKM_sk_free(X509, (st)) +#define sk_X509_num(st) SKM_sk_num(X509, (st)) +#define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i)) +#define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val)) +#define sk_X509_zero(st) SKM_sk_zero(X509, (st)) +#define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val)) +#define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val)) +#define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val)) +#define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val)) +#define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i)) +#define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr)) +#define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i)) +#define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp)) +#define sk_X509_dup(st) SKM_sk_dup(X509, st) +#define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func)) +#define sk_X509_shift(st) SKM_sk_shift(X509, (st)) +#define sk_X509_pop(st) SKM_sk_pop(X509, (st)) +#define sk_X509_sort(st) SKM_sk_sort(X509, (st)) +#define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st)) + +#define sk_X509V3_EXT_METHOD_new(cmp) SKM_sk_new(X509V3_EXT_METHOD, (cmp)) +#define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD) +#define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i)) +#define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val)) +#define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i)) +#define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr)) +#define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i)) +#define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp)) +#define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st) +#define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func)) +#define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st)) + +#define sk_X509_ALGOR_new(cmp) SKM_sk_new(X509_ALGOR, (cmp)) +#define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR) +#define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st)) +#define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st)) +#define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i)) +#define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val)) +#define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st)) +#define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i)) +#define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr)) +#define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i)) +#define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp)) +#define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st) +#define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func)) +#define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st)) +#define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st)) +#define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st)) +#define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st)) + +#define sk_X509_ATTRIBUTE_new(cmp) SKM_sk_new(X509_ATTRIBUTE, (cmp)) +#define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE) +#define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i)) +#define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val)) +#define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i)) +#define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr)) +#define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i)) +#define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp)) +#define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st) +#define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func)) +#define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st)) + +#define sk_X509_CRL_new(cmp) SKM_sk_new(X509_CRL, (cmp)) +#define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL) +#define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st)) +#define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st)) +#define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i)) +#define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val)) +#define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st)) +#define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val)) +#define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val)) +#define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val)) +#define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val)) +#define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i)) +#define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr)) +#define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i)) +#define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp)) +#define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st) +#define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func)) +#define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st)) +#define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st)) +#define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st)) +#define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st)) + +#define sk_X509_EXTENSION_new(cmp) SKM_sk_new(X509_EXTENSION, (cmp)) +#define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION) +#define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i)) +#define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val)) +#define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i)) +#define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr)) +#define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i)) +#define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp)) +#define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st) +#define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func)) +#define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st)) + +#define sk_X509_INFO_new(cmp) SKM_sk_new(X509_INFO, (cmp)) +#define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO) +#define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st)) +#define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st)) +#define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i)) +#define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val)) +#define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st)) +#define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val)) +#define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val)) +#define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val)) +#define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val)) +#define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i)) +#define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr)) +#define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i)) +#define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp)) +#define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st) +#define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func)) +#define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st)) +#define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st)) +#define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st)) +#define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st)) + +#define sk_X509_LOOKUP_new(cmp) SKM_sk_new(X509_LOOKUP, (cmp)) +#define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP) +#define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i)) +#define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val)) +#define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i)) +#define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr)) +#define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i)) +#define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp)) +#define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st) +#define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func)) +#define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st)) + +#define sk_X509_NAME_new(cmp) SKM_sk_new(X509_NAME, (cmp)) +#define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME) +#define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st)) +#define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st)) +#define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i)) +#define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val)) +#define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st)) +#define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val)) +#define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val)) +#define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val)) +#define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val)) +#define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i)) +#define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr)) +#define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i)) +#define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp)) +#define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st) +#define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func)) +#define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st)) +#define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st)) +#define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st)) +#define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st)) + +#define sk_X509_NAME_ENTRY_new(cmp) SKM_sk_new(X509_NAME_ENTRY, (cmp)) +#define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY) +#define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i)) +#define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val)) +#define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i)) +#define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr)) +#define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i)) +#define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp)) +#define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st) +#define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func)) +#define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st)) + +#define sk_X509_OBJECT_new(cmp) SKM_sk_new(X509_OBJECT, (cmp)) +#define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT) +#define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st)) +#define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st)) +#define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i)) +#define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val)) +#define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st)) +#define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i)) +#define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr)) +#define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i)) +#define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp)) +#define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st) +#define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func)) +#define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st)) +#define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st)) +#define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st)) +#define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st)) + +#define sk_X509_POLICY_DATA_new(cmp) SKM_sk_new(X509_POLICY_DATA, (cmp)) +#define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA) +#define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i)) +#define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val)) +#define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i)) +#define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr)) +#define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i)) +#define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp)) +#define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st) +#define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func)) +#define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st)) + +#define sk_X509_POLICY_NODE_new(cmp) SKM_sk_new(X509_POLICY_NODE, (cmp)) +#define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE) +#define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i)) +#define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val)) +#define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i)) +#define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr)) +#define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i)) +#define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp)) +#define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st) +#define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func)) +#define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st)) + +#define sk_X509_PURPOSE_new(cmp) SKM_sk_new(X509_PURPOSE, (cmp)) +#define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE) +#define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i)) +#define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val)) +#define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i)) +#define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr)) +#define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i)) +#define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp)) +#define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st) +#define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func)) +#define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st)) + +#define sk_X509_REVOKED_new(cmp) SKM_sk_new(X509_REVOKED, (cmp)) +#define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED) +#define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st)) +#define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st)) +#define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i)) +#define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val)) +#define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st)) +#define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i)) +#define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr)) +#define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i)) +#define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp)) +#define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st) +#define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func)) +#define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st)) +#define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st)) +#define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st)) +#define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st)) + +#define sk_X509_TRUST_new(cmp) SKM_sk_new(X509_TRUST, (cmp)) +#define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST) +#define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st)) +#define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st)) +#define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i)) +#define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val)) +#define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st)) +#define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i)) +#define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr)) +#define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i)) +#define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp)) +#define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st) +#define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func)) +#define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st)) +#define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st)) +#define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st)) +#define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st)) + +#define sk_X509_VERIFY_PARAM_new(cmp) SKM_sk_new(X509_VERIFY_PARAM, (cmp)) +#define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM) +#define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i)) +#define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val)) +#define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i)) +#define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr)) +#define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i)) +#define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp)) +#define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st) +#define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func)) +#define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st)) + +#define sk_nid_triple_new(cmp) SKM_sk_new(nid_triple, (cmp)) +#define sk_nid_triple_new_null() SKM_sk_new_null(nid_triple) +#define sk_nid_triple_free(st) SKM_sk_free(nid_triple, (st)) +#define sk_nid_triple_num(st) SKM_sk_num(nid_triple, (st)) +#define sk_nid_triple_value(st, i) SKM_sk_value(nid_triple, (st), (i)) +#define sk_nid_triple_set(st, i, val) SKM_sk_set(nid_triple, (st), (i), (val)) +#define sk_nid_triple_zero(st) SKM_sk_zero(nid_triple, (st)) +#define sk_nid_triple_push(st, val) SKM_sk_push(nid_triple, (st), (val)) +#define sk_nid_triple_unshift(st, val) SKM_sk_unshift(nid_triple, (st), (val)) +#define sk_nid_triple_find(st, val) SKM_sk_find(nid_triple, (st), (val)) +#define sk_nid_triple_find_ex(st, val) SKM_sk_find_ex(nid_triple, (st), (val)) +#define sk_nid_triple_delete(st, i) SKM_sk_delete(nid_triple, (st), (i)) +#define sk_nid_triple_delete_ptr(st, ptr) SKM_sk_delete_ptr(nid_triple, (st), (ptr)) +#define sk_nid_triple_insert(st, val, i) SKM_sk_insert(nid_triple, (st), (val), (i)) +#define sk_nid_triple_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(nid_triple, (st), (cmp)) +#define sk_nid_triple_dup(st) SKM_sk_dup(nid_triple, st) +#define sk_nid_triple_pop_free(st, free_func) SKM_sk_pop_free(nid_triple, (st), (free_func)) +#define sk_nid_triple_shift(st) SKM_sk_shift(nid_triple, (st)) +#define sk_nid_triple_pop(st) SKM_sk_pop(nid_triple, (st)) +#define sk_nid_triple_sort(st) SKM_sk_sort(nid_triple, (st)) +#define sk_nid_triple_is_sorted(st) SKM_sk_is_sorted(nid_triple, (st)) + +#define sk_void_new(cmp) SKM_sk_new(void, (cmp)) +#define sk_void_new_null() SKM_sk_new_null(void) +#define sk_void_free(st) SKM_sk_free(void, (st)) +#define sk_void_num(st) SKM_sk_num(void, (st)) +#define sk_void_value(st, i) SKM_sk_value(void, (st), (i)) +#define sk_void_set(st, i, val) SKM_sk_set(void, (st), (i), (val)) +#define sk_void_zero(st) SKM_sk_zero(void, (st)) +#define sk_void_push(st, val) SKM_sk_push(void, (st), (val)) +#define sk_void_unshift(st, val) SKM_sk_unshift(void, (st), (val)) +#define sk_void_find(st, val) SKM_sk_find(void, (st), (val)) +#define sk_void_find_ex(st, val) SKM_sk_find_ex(void, (st), (val)) +#define sk_void_delete(st, i) SKM_sk_delete(void, (st), (i)) +#define sk_void_delete_ptr(st, ptr) SKM_sk_delete_ptr(void, (st), (ptr)) +#define sk_void_insert(st, val, i) SKM_sk_insert(void, (st), (val), (i)) +#define sk_void_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(void, (st), (cmp)) +#define sk_void_dup(st) SKM_sk_dup(void, st) +#define sk_void_pop_free(st, free_func) SKM_sk_pop_free(void, (st), (free_func)) +#define sk_void_shift(st) SKM_sk_shift(void, (st)) +#define sk_void_pop(st) SKM_sk_pop(void, (st)) +#define sk_void_sort(st) SKM_sk_sort(void, (st)) +#define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st)) + +#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) +#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) +#define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_STACK_OF(OPENSSL_STRING, st), i)) +#define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st) +#define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func)) +#define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val), i) +#define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st) +#define sk_OPENSSL_STRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_STRING, st), i, CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st)) +#define sk_OPENSSL_STRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val)) +#define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i)) +#define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, ptr)) +#define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \ + ((int (*)(const char * const *,const char * const *)) \ + sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_CMP_FUNC(char, cmp))) +#define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st) +#define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st)) +#define sk_OPENSSL_STRING_pop(st) (char *)sk_pop(CHECKED_STACK_OF(OPENSSL_STRING, st)) +#define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) +#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) + +#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) +#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) +#define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) +#define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) +#define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i)) +#define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st) +#define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_FREE_FUNC2(OPENSSL_BLOCK, free_func)) +#define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val), i) +#define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st) +#define sk_OPENSSL_BLOCK_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i, CHECKED_PTR_OF(void, val)) +#define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st)) +#define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) +#define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val)) +#define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i)) +#define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, ptr)) +#define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \ + ((int (*)(const void * const *,const void * const *)) \ + sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_CMP_FUNC(void, cmp))) +#define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st) +#define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st)) +#define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop(CHECKED_STACK_OF(OPENSSL_BLOCK, st)) +#define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st)) +#define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) + +#define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) +#define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) +#define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i)) +#define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) +#define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) +#define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) +#define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) +#define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) +#define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) +#define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) +#define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) +#define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ + ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ + sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) +#define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) +#define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) +#define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st)) +#define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) +#define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) + +#define lh_ADDED_OBJ_new() LHM_lh_new(ADDED_OBJ,added_obj) +#define lh_ADDED_OBJ_insert(lh,inst) LHM_lh_insert(ADDED_OBJ,lh,inst) +#define lh_ADDED_OBJ_retrieve(lh,inst) LHM_lh_retrieve(ADDED_OBJ,lh,inst) +#define lh_ADDED_OBJ_delete(lh,inst) LHM_lh_delete(ADDED_OBJ,lh,inst) +#define lh_ADDED_OBJ_doall(lh,fn) LHM_lh_doall(ADDED_OBJ,lh,fn) +#define lh_ADDED_OBJ_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(ADDED_OBJ,lh,fn,arg_type,arg) +#define lh_ADDED_OBJ_error(lh) LHM_lh_error(ADDED_OBJ,lh) +#define lh_ADDED_OBJ_num_items(lh) LHM_lh_num_items(ADDED_OBJ,lh) +#define lh_ADDED_OBJ_down_load(lh) LHM_lh_down_load(ADDED_OBJ,lh) +#define lh_ADDED_OBJ_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(ADDED_OBJ,lh,out) +#define lh_ADDED_OBJ_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(ADDED_OBJ,lh,out) +#define lh_ADDED_OBJ_stats_bio(lh,out) \ + LHM_lh_stats_bio(ADDED_OBJ,lh,out) +#define lh_ADDED_OBJ_free(lh) LHM_lh_free(ADDED_OBJ,lh) + +#define lh_APP_INFO_new() LHM_lh_new(APP_INFO,app_info) +#define lh_APP_INFO_insert(lh,inst) LHM_lh_insert(APP_INFO,lh,inst) +#define lh_APP_INFO_retrieve(lh,inst) LHM_lh_retrieve(APP_INFO,lh,inst) +#define lh_APP_INFO_delete(lh,inst) LHM_lh_delete(APP_INFO,lh,inst) +#define lh_APP_INFO_doall(lh,fn) LHM_lh_doall(APP_INFO,lh,fn) +#define lh_APP_INFO_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(APP_INFO,lh,fn,arg_type,arg) +#define lh_APP_INFO_error(lh) LHM_lh_error(APP_INFO,lh) +#define lh_APP_INFO_num_items(lh) LHM_lh_num_items(APP_INFO,lh) +#define lh_APP_INFO_down_load(lh) LHM_lh_down_load(APP_INFO,lh) +#define lh_APP_INFO_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(APP_INFO,lh,out) +#define lh_APP_INFO_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(APP_INFO,lh,out) +#define lh_APP_INFO_stats_bio(lh,out) \ + LHM_lh_stats_bio(APP_INFO,lh,out) +#define lh_APP_INFO_free(lh) LHM_lh_free(APP_INFO,lh) + +#define lh_CONF_VALUE_new() LHM_lh_new(CONF_VALUE,conf_value) +#define lh_CONF_VALUE_insert(lh,inst) LHM_lh_insert(CONF_VALUE,lh,inst) +#define lh_CONF_VALUE_retrieve(lh,inst) LHM_lh_retrieve(CONF_VALUE,lh,inst) +#define lh_CONF_VALUE_delete(lh,inst) LHM_lh_delete(CONF_VALUE,lh,inst) +#define lh_CONF_VALUE_doall(lh,fn) LHM_lh_doall(CONF_VALUE,lh,fn) +#define lh_CONF_VALUE_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(CONF_VALUE,lh,fn,arg_type,arg) +#define lh_CONF_VALUE_error(lh) LHM_lh_error(CONF_VALUE,lh) +#define lh_CONF_VALUE_num_items(lh) LHM_lh_num_items(CONF_VALUE,lh) +#define lh_CONF_VALUE_down_load(lh) LHM_lh_down_load(CONF_VALUE,lh) +#define lh_CONF_VALUE_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(CONF_VALUE,lh,out) +#define lh_CONF_VALUE_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(CONF_VALUE,lh,out) +#define lh_CONF_VALUE_stats_bio(lh,out) \ + LHM_lh_stats_bio(CONF_VALUE,lh,out) +#define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh) + +#define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile) +#define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst) +#define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst) +#define lh_ENGINE_PILE_delete(lh,inst) LHM_lh_delete(ENGINE_PILE,lh,inst) +#define lh_ENGINE_PILE_doall(lh,fn) LHM_lh_doall(ENGINE_PILE,lh,fn) +#define lh_ENGINE_PILE_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(ENGINE_PILE,lh,fn,arg_type,arg) +#define lh_ENGINE_PILE_error(lh) LHM_lh_error(ENGINE_PILE,lh) +#define lh_ENGINE_PILE_num_items(lh) LHM_lh_num_items(ENGINE_PILE,lh) +#define lh_ENGINE_PILE_down_load(lh) LHM_lh_down_load(ENGINE_PILE,lh) +#define lh_ENGINE_PILE_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(ENGINE_PILE,lh,out) +#define lh_ENGINE_PILE_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(ENGINE_PILE,lh,out) +#define lh_ENGINE_PILE_stats_bio(lh,out) \ + LHM_lh_stats_bio(ENGINE_PILE,lh,out) +#define lh_ENGINE_PILE_free(lh) LHM_lh_free(ENGINE_PILE,lh) + +#define lh_ERR_STATE_new() LHM_lh_new(ERR_STATE,err_state) +#define lh_ERR_STATE_insert(lh,inst) LHM_lh_insert(ERR_STATE,lh,inst) +#define lh_ERR_STATE_retrieve(lh,inst) LHM_lh_retrieve(ERR_STATE,lh,inst) +#define lh_ERR_STATE_delete(lh,inst) LHM_lh_delete(ERR_STATE,lh,inst) +#define lh_ERR_STATE_doall(lh,fn) LHM_lh_doall(ERR_STATE,lh,fn) +#define lh_ERR_STATE_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(ERR_STATE,lh,fn,arg_type,arg) +#define lh_ERR_STATE_error(lh) LHM_lh_error(ERR_STATE,lh) +#define lh_ERR_STATE_num_items(lh) LHM_lh_num_items(ERR_STATE,lh) +#define lh_ERR_STATE_down_load(lh) LHM_lh_down_load(ERR_STATE,lh) +#define lh_ERR_STATE_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(ERR_STATE,lh,out) +#define lh_ERR_STATE_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(ERR_STATE,lh,out) +#define lh_ERR_STATE_stats_bio(lh,out) \ + LHM_lh_stats_bio(ERR_STATE,lh,out) +#define lh_ERR_STATE_free(lh) LHM_lh_free(ERR_STATE,lh) + +#define lh_ERR_STRING_DATA_new() LHM_lh_new(ERR_STRING_DATA,err_string_data) +#define lh_ERR_STRING_DATA_insert(lh,inst) LHM_lh_insert(ERR_STRING_DATA,lh,inst) +#define lh_ERR_STRING_DATA_retrieve(lh,inst) LHM_lh_retrieve(ERR_STRING_DATA,lh,inst) +#define lh_ERR_STRING_DATA_delete(lh,inst) LHM_lh_delete(ERR_STRING_DATA,lh,inst) +#define lh_ERR_STRING_DATA_doall(lh,fn) LHM_lh_doall(ERR_STRING_DATA,lh,fn) +#define lh_ERR_STRING_DATA_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(ERR_STRING_DATA,lh,fn,arg_type,arg) +#define lh_ERR_STRING_DATA_error(lh) LHM_lh_error(ERR_STRING_DATA,lh) +#define lh_ERR_STRING_DATA_num_items(lh) LHM_lh_num_items(ERR_STRING_DATA,lh) +#define lh_ERR_STRING_DATA_down_load(lh) LHM_lh_down_load(ERR_STRING_DATA,lh) +#define lh_ERR_STRING_DATA_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(ERR_STRING_DATA,lh,out) +#define lh_ERR_STRING_DATA_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(ERR_STRING_DATA,lh,out) +#define lh_ERR_STRING_DATA_stats_bio(lh,out) \ + LHM_lh_stats_bio(ERR_STRING_DATA,lh,out) +#define lh_ERR_STRING_DATA_free(lh) LHM_lh_free(ERR_STRING_DATA,lh) + +#define lh_EX_CLASS_ITEM_new() LHM_lh_new(EX_CLASS_ITEM,ex_class_item) +#define lh_EX_CLASS_ITEM_insert(lh,inst) LHM_lh_insert(EX_CLASS_ITEM,lh,inst) +#define lh_EX_CLASS_ITEM_retrieve(lh,inst) LHM_lh_retrieve(EX_CLASS_ITEM,lh,inst) +#define lh_EX_CLASS_ITEM_delete(lh,inst) LHM_lh_delete(EX_CLASS_ITEM,lh,inst) +#define lh_EX_CLASS_ITEM_doall(lh,fn) LHM_lh_doall(EX_CLASS_ITEM,lh,fn) +#define lh_EX_CLASS_ITEM_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(EX_CLASS_ITEM,lh,fn,arg_type,arg) +#define lh_EX_CLASS_ITEM_error(lh) LHM_lh_error(EX_CLASS_ITEM,lh) +#define lh_EX_CLASS_ITEM_num_items(lh) LHM_lh_num_items(EX_CLASS_ITEM,lh) +#define lh_EX_CLASS_ITEM_down_load(lh) LHM_lh_down_load(EX_CLASS_ITEM,lh) +#define lh_EX_CLASS_ITEM_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(EX_CLASS_ITEM,lh,out) +#define lh_EX_CLASS_ITEM_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(EX_CLASS_ITEM,lh,out) +#define lh_EX_CLASS_ITEM_stats_bio(lh,out) \ + LHM_lh_stats_bio(EX_CLASS_ITEM,lh,out) +#define lh_EX_CLASS_ITEM_free(lh) LHM_lh_free(EX_CLASS_ITEM,lh) + +#define lh_FUNCTION_new() LHM_lh_new(FUNCTION,function) +#define lh_FUNCTION_insert(lh,inst) LHM_lh_insert(FUNCTION,lh,inst) +#define lh_FUNCTION_retrieve(lh,inst) LHM_lh_retrieve(FUNCTION,lh,inst) +#define lh_FUNCTION_delete(lh,inst) LHM_lh_delete(FUNCTION,lh,inst) +#define lh_FUNCTION_doall(lh,fn) LHM_lh_doall(FUNCTION,lh,fn) +#define lh_FUNCTION_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(FUNCTION,lh,fn,arg_type,arg) +#define lh_FUNCTION_error(lh) LHM_lh_error(FUNCTION,lh) +#define lh_FUNCTION_num_items(lh) LHM_lh_num_items(FUNCTION,lh) +#define lh_FUNCTION_down_load(lh) LHM_lh_down_load(FUNCTION,lh) +#define lh_FUNCTION_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(FUNCTION,lh,out) +#define lh_FUNCTION_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(FUNCTION,lh,out) +#define lh_FUNCTION_stats_bio(lh,out) \ + LHM_lh_stats_bio(FUNCTION,lh,out) +#define lh_FUNCTION_free(lh) LHM_lh_free(FUNCTION,lh) + +#define lh_MEM_new() LHM_lh_new(MEM,mem) +#define lh_MEM_insert(lh,inst) LHM_lh_insert(MEM,lh,inst) +#define lh_MEM_retrieve(lh,inst) LHM_lh_retrieve(MEM,lh,inst) +#define lh_MEM_delete(lh,inst) LHM_lh_delete(MEM,lh,inst) +#define lh_MEM_doall(lh,fn) LHM_lh_doall(MEM,lh,fn) +#define lh_MEM_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(MEM,lh,fn,arg_type,arg) +#define lh_MEM_error(lh) LHM_lh_error(MEM,lh) +#define lh_MEM_num_items(lh) LHM_lh_num_items(MEM,lh) +#define lh_MEM_down_load(lh) LHM_lh_down_load(MEM,lh) +#define lh_MEM_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(MEM,lh,out) +#define lh_MEM_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(MEM,lh,out) +#define lh_MEM_stats_bio(lh,out) \ + LHM_lh_stats_bio(MEM,lh,out) +#define lh_MEM_free(lh) LHM_lh_free(MEM,lh) + +#define lh_OBJ_NAME_new() LHM_lh_new(OBJ_NAME,obj_name) +#define lh_OBJ_NAME_insert(lh,inst) LHM_lh_insert(OBJ_NAME,lh,inst) +#define lh_OBJ_NAME_retrieve(lh,inst) LHM_lh_retrieve(OBJ_NAME,lh,inst) +#define lh_OBJ_NAME_delete(lh,inst) LHM_lh_delete(OBJ_NAME,lh,inst) +#define lh_OBJ_NAME_doall(lh,fn) LHM_lh_doall(OBJ_NAME,lh,fn) +#define lh_OBJ_NAME_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(OBJ_NAME,lh,fn,arg_type,arg) +#define lh_OBJ_NAME_error(lh) LHM_lh_error(OBJ_NAME,lh) +#define lh_OBJ_NAME_num_items(lh) LHM_lh_num_items(OBJ_NAME,lh) +#define lh_OBJ_NAME_down_load(lh) LHM_lh_down_load(OBJ_NAME,lh) +#define lh_OBJ_NAME_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(OBJ_NAME,lh,out) +#define lh_OBJ_NAME_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(OBJ_NAME,lh,out) +#define lh_OBJ_NAME_stats_bio(lh,out) \ + LHM_lh_stats_bio(OBJ_NAME,lh,out) +#define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh) + +#define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring) +#define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst) +#define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst) +#define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst) +#define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn) +#define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg) +#define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh) +#define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh) +#define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh) +#define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out) +#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out) +#define lh_OPENSSL_CSTRING_stats_bio(lh,out) \ + LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out) +#define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh) + +#define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string) +#define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst) +#define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst) +#define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst) +#define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn) +#define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg) +#define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh) +#define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh) +#define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh) +#define lh_OPENSSL_STRING_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out) +#define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out) +#define lh_OPENSSL_STRING_stats_bio(lh,out) \ + LHM_lh_stats_bio(OPENSSL_STRING,lh,out) +#define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh) + +#define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session) +#define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst) +#define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst) +#define lh_SSL_SESSION_delete(lh,inst) LHM_lh_delete(SSL_SESSION,lh,inst) +#define lh_SSL_SESSION_doall(lh,fn) LHM_lh_doall(SSL_SESSION,lh,fn) +#define lh_SSL_SESSION_doall_arg(lh,fn,arg_type,arg) \ + LHM_lh_doall_arg(SSL_SESSION,lh,fn,arg_type,arg) +#define lh_SSL_SESSION_error(lh) LHM_lh_error(SSL_SESSION,lh) +#define lh_SSL_SESSION_num_items(lh) LHM_lh_num_items(SSL_SESSION,lh) +#define lh_SSL_SESSION_down_load(lh) LHM_lh_down_load(SSL_SESSION,lh) +#define lh_SSL_SESSION_node_stats_bio(lh,out) \ + LHM_lh_node_stats_bio(SSL_SESSION,lh,out) +#define lh_SSL_SESSION_node_usage_stats_bio(lh,out) \ + LHM_lh_node_usage_stats_bio(SSL_SESSION,lh,out) +#define lh_SSL_SESSION_stats_bio(lh,out) \ + LHM_lh_stats_bio(SSL_SESSION,lh,out) +#define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh) + +#endif /* !defined HEADER_SAFESTACK_H */ diff --git a/code/contrib/libfido2/include/openssl/sha.h b/code/contrib/libfido2/include/openssl/sha.h new file mode 100644 index 0000000..87fdf8d --- /dev/null +++ b/code/contrib/libfido2/include/openssl/sha.h @@ -0,0 +1,192 @@ +/* $OpenBSD: sha.h,v 1.21 2015/09/13 21:09:56 doug Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#ifndef HEADER_SHA_H +#define HEADER_SHA_H +#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__) +#define __bounded__(x, y, z) +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(OPENSSL_NO_SHA) || defined(OPENSSL_NO_SHA1) +#error SHA is disabled. +#endif + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! SHA_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#define SHA_LONG unsigned int + +#define SHA_LBLOCK 16 +#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a + * contiguous array of 32 bit + * wide big-endian values. */ +#define SHA_LAST_BLOCK (SHA_CBLOCK-8) +#define SHA_DIGEST_LENGTH 20 + +typedef struct SHAstate_st + { + SHA_LONG h0,h1,h2,h3,h4; + SHA_LONG Nl,Nh; + SHA_LONG data[SHA_LBLOCK]; + unsigned int num; + } SHA_CTX; + +#ifndef OPENSSL_NO_SHA1 +int SHA1_Init(SHA_CTX *c); +int SHA1_Update(SHA_CTX *c, const void *data, size_t len) + __attribute__ ((__bounded__(__buffer__,2,3))); +int SHA1_Final(unsigned char *md, SHA_CTX *c); +unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) + __attribute__ ((__bounded__(__buffer__,1,2))); +void SHA1_Transform(SHA_CTX *c, const unsigned char *data); +#endif + +#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a + * contiguous array of 32 bit + * wide big-endian values. */ +#define SHA224_DIGEST_LENGTH 28 +#define SHA256_DIGEST_LENGTH 32 + +typedef struct SHA256state_st + { + SHA_LONG h[8]; + SHA_LONG Nl,Nh; + SHA_LONG data[SHA_LBLOCK]; + unsigned int num,md_len; + } SHA256_CTX; + +#ifndef OPENSSL_NO_SHA256 +int SHA224_Init(SHA256_CTX *c); +int SHA224_Update(SHA256_CTX *c, const void *data, size_t len) + __attribute__ ((__bounded__(__buffer__,2,3))); +int SHA224_Final(unsigned char *md, SHA256_CTX *c); +unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md) + __attribute__ ((__bounded__(__buffer__,1,2))); +int SHA256_Init(SHA256_CTX *c); +int SHA256_Update(SHA256_CTX *c, const void *data, size_t len) + __attribute__ ((__bounded__(__buffer__,2,3))); +int SHA256_Final(unsigned char *md, SHA256_CTX *c); +unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md) + __attribute__ ((__bounded__(__buffer__,1,2))); +void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); +#endif + +#define SHA384_DIGEST_LENGTH 48 +#define SHA512_DIGEST_LENGTH 64 + +#ifndef OPENSSL_NO_SHA512 +/* + * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 + * being exactly 64-bit wide. See Implementation Notes in sha512.c + * for further details. + */ +#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a + * contiguous array of 64 bit + * wide big-endian values. */ +#if defined(_LP64) +#define SHA_LONG64 unsigned long +#define U64(C) C##UL +#else +#define SHA_LONG64 unsigned long long +#define U64(C) C##ULL +#endif + +typedef struct SHA512state_st + { + SHA_LONG64 h[8]; + SHA_LONG64 Nl,Nh; + union { + SHA_LONG64 d[SHA_LBLOCK]; + unsigned char p[SHA512_CBLOCK]; + } u; + unsigned int num,md_len; + } SHA512_CTX; +#endif + +#ifndef OPENSSL_NO_SHA512 +int SHA384_Init(SHA512_CTX *c); +int SHA384_Update(SHA512_CTX *c, const void *data, size_t len) + __attribute__ ((__bounded__(__buffer__,2,3))); +int SHA384_Final(unsigned char *md, SHA512_CTX *c); +unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md) + __attribute__ ((__bounded__(__buffer__,1,2))); +int SHA512_Init(SHA512_CTX *c); +int SHA512_Update(SHA512_CTX *c, const void *data, size_t len) + __attribute__ ((__bounded__(__buffer__,2,3))); +int SHA512_Final(unsigned char *md, SHA512_CTX *c); +unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md) + __attribute__ ((__bounded__(__buffer__,1,2))); +void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/sm3.h b/code/contrib/libfido2/include/openssl/sm3.h new file mode 100644 index 0000000..553c64d --- /dev/null +++ b/code/contrib/libfido2/include/openssl/sm3.h @@ -0,0 +1,53 @@ +/* $OpenBSD: sm3.h,v 1.1 2018/11/11 06:53:31 tb Exp $ */ +/* + * Copyright (c) 2018, Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_SM3_H +#define HEADER_SM3_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_SM3 +#error SM3 is disabled. +#endif + +#define SM3_DIGEST_LENGTH 32 +#define SM3_WORD unsigned int + +#define SM3_CBLOCK 64 +#define SM3_LBLOCK (SM3_CBLOCK / 4) + +typedef struct SM3state_st { + SM3_WORD A, B, C, D, E, F, G, H; + SM3_WORD Nl, Nh; + SM3_WORD data[SM3_LBLOCK]; + unsigned int num; +} SM3_CTX; + +int SM3_Init(SM3_CTX *c); +int SM3_Update(SM3_CTX *c, const void *data, size_t len); +int SM3_Final(unsigned char *md, SM3_CTX *c); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_SM3_H */ diff --git a/code/contrib/libfido2/include/openssl/sm4.h b/code/contrib/libfido2/include/openssl/sm4.h new file mode 100644 index 0000000..5931ac7 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/sm4.h @@ -0,0 +1,51 @@ +/* $OpenBSD: sm4.h,v 1.1 2019/03/17 17:42:37 tb Exp $ */ +/* + * Copyright (c) 2017, 2019 Ribose Inc + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_SM4_H +#define HEADER_SM4_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_SM4 +#error SM4 is disabled. +#endif + +#define SM4_DECRYPT 0 +#define SM4_ENCRYPT 1 + +#define SM4_BLOCK_SIZE 16 +#define SM4_KEY_SCHEDULE 32 + +typedef struct sm4_key_st { + unsigned char opaque[128]; +} SM4_KEY; + +int SM4_set_key(const uint8_t *key, SM4_KEY *ks); +void SM4_decrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks); +void SM4_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_SM4_H */ diff --git a/code/contrib/libfido2/include/openssl/srtp.h b/code/contrib/libfido2/include/openssl/srtp.h new file mode 100644 index 0000000..89ce862 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/srtp.h @@ -0,0 +1,146 @@ +/* $OpenBSD: srtp.h,v 1.7 2021/06/11 15:28:13 landry Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* + * DTLS code by Eric Rescorla + * + * Copyright (C) 2006, Network Resonance, Inc. + * Copyright (C) 2011, RTFM, Inc. + */ + +#ifndef HEADER_D1_SRTP_H +#define HEADER_D1_SRTP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define SRTP_AES128_CM_SHA1_80 0x0001 +#define SRTP_AES128_CM_SHA1_32 0x0002 +#define SRTP_AES128_F8_SHA1_80 0x0003 +#define SRTP_AES128_F8_SHA1_32 0x0004 +#define SRTP_NULL_SHA1_80 0x0005 +#define SRTP_NULL_SHA1_32 0x0006 + +/* AEAD SRTP protection profiles from RFC 7714 */ +#define SRTP_AEAD_AES_128_GCM 0x0007 +#define SRTP_AEAD_AES_256_GCM 0x0008 + +int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); +int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); + +STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); +SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/ssl.h b/code/contrib/libfido2/include/openssl/ssl.h new file mode 100644 index 0000000..e313268 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ssl.h @@ -0,0 +1,2065 @@ +/* $OpenBSD: ssl.h,v 1.215 2021/11/01 08:14:36 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. + */ + +#ifndef HEADER_SSL_H +#define HEADER_SSL_H + +#include + +#include + +#include +#include +#include + +#include + +#ifndef OPENSSL_NO_DEPRECATED +#include +#include +#include + +#ifndef OPENSSL_NO_X509 +#include +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* SSLeay version number for ASN.1 encoding of the session information */ +/* Version 0 - initial version + * Version 1 - added the optional peer certificate + */ +#define SSL_SESSION_ASN1_VERSION 0x0001 + +/* text strings for the ciphers */ +#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5 +#define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5 +#define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 +#define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5 +#define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 +#define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5 +#define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5 +#define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA +#define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 +#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA + +/* VRS Additional Kerberos5 entries + */ +#define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA +#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA +#define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA +#define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA +#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 +#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 +#define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5 +#define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5 + +#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA +#define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA +#define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA +#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 +#define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5 +#define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5 + +#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA +#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 +#define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA +#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 +#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA +#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 +#define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256 + +#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 +#define SSL_MAX_SID_CTX_LENGTH 32 + +#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8) +#define SSL_MAX_KEY_ARG_LENGTH 8 +#define SSL_MAX_MASTER_KEY_LENGTH 48 + + +/* These are used to specify which ciphers to use and not to use */ + +#define SSL_TXT_LOW "LOW" +#define SSL_TXT_MEDIUM "MEDIUM" +#define SSL_TXT_HIGH "HIGH" + +#define SSL_TXT_kFZA "kFZA" /* unused! */ +#define SSL_TXT_aFZA "aFZA" /* unused! */ +#define SSL_TXT_eFZA "eFZA" /* unused! */ +#define SSL_TXT_FZA "FZA" /* unused! */ + +#define SSL_TXT_aNULL "aNULL" +#define SSL_TXT_eNULL "eNULL" +#define SSL_TXT_NULL "NULL" + +#define SSL_TXT_kRSA "kRSA" +#define SSL_TXT_kDHr "kDHr" /* no such ciphersuites supported! */ +#define SSL_TXT_kDHd "kDHd" /* no such ciphersuites supported! */ +#define SSL_TXT_kDH "kDH" /* no such ciphersuites supported! */ +#define SSL_TXT_kEDH "kEDH" +#define SSL_TXT_kKRB5 "kKRB5" +#define SSL_TXT_kECDHr "kECDHr" +#define SSL_TXT_kECDHe "kECDHe" +#define SSL_TXT_kECDH "kECDH" +#define SSL_TXT_kEECDH "kEECDH" +#define SSL_TXT_kPSK "kPSK" +#define SSL_TXT_kGOST "kGOST" +#define SSL_TXT_kSRP "kSRP" + +#define SSL_TXT_aRSA "aRSA" +#define SSL_TXT_aDSS "aDSS" +#define SSL_TXT_aDH "aDH" /* no such ciphersuites supported! */ +#define SSL_TXT_aECDH "aECDH" +#define SSL_TXT_aKRB5 "aKRB5" +#define SSL_TXT_aECDSA "aECDSA" +#define SSL_TXT_aPSK "aPSK" +#define SSL_TXT_aGOST94 "aGOST94" +#define SSL_TXT_aGOST01 "aGOST01" +#define SSL_TXT_aGOST "aGOST" + +#define SSL_TXT_DSS "DSS" +#define SSL_TXT_DH "DH" +#define SSL_TXT_DHE "DHE" /* same as "kDHE:-ADH" */ +#define SSL_TXT_EDH "EDH" /* previous name for DHE */ +#define SSL_TXT_ADH "ADH" +#define SSL_TXT_RSA "RSA" +#define SSL_TXT_ECDH "ECDH" +#define SSL_TXT_ECDHE "ECDHE" /* same as "kECDHE:-AECDH" */ +#define SSL_TXT_EECDH "EECDH" /* previous name for ECDHE */ +#define SSL_TXT_AECDH "AECDH" +#define SSL_TXT_ECDSA "ECDSA" +#define SSL_TXT_KRB5 "KRB5" +#define SSL_TXT_PSK "PSK" +#define SSL_TXT_SRP "SRP" + +#define SSL_TXT_DES "DES" +#define SSL_TXT_3DES "3DES" +#define SSL_TXT_RC4 "RC4" +#define SSL_TXT_RC2 "RC2" +#define SSL_TXT_IDEA "IDEA" +#define SSL_TXT_SEED "SEED" +#define SSL_TXT_AES128 "AES128" +#define SSL_TXT_AES256 "AES256" +#define SSL_TXT_AES "AES" +#define SSL_TXT_AES_GCM "AESGCM" +#define SSL_TXT_CAMELLIA128 "CAMELLIA128" +#define SSL_TXT_CAMELLIA256 "CAMELLIA256" +#define SSL_TXT_CAMELLIA "CAMELLIA" +#define SSL_TXT_CHACHA20 "CHACHA20" + +#define SSL_TXT_AEAD "AEAD" +#define SSL_TXT_MD5 "MD5" +#define SSL_TXT_SHA1 "SHA1" +#define SSL_TXT_SHA "SHA" /* same as "SHA1" */ +#define SSL_TXT_GOST94 "GOST94" +#define SSL_TXT_GOST89MAC "GOST89MAC" +#define SSL_TXT_SHA256 "SHA256" +#define SSL_TXT_SHA384 "SHA384" +#define SSL_TXT_STREEBOG256 "STREEBOG256" +#define SSL_TXT_STREEBOG512 "STREEBOG512" + +#define SSL_TXT_DTLS1 "DTLSv1" +#define SSL_TXT_DTLS1_2 "DTLSv1.2" +#define SSL_TXT_SSLV2 "SSLv2" +#define SSL_TXT_SSLV3 "SSLv3" +#define SSL_TXT_TLSV1 "TLSv1" +#define SSL_TXT_TLSV1_1 "TLSv1.1" +#define SSL_TXT_TLSV1_2 "TLSv1.2" +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_TXT_TLSV1_3 "TLSv1.3" +#endif + +#define SSL_TXT_EXP "EXP" +#define SSL_TXT_EXPORT "EXPORT" + +#define SSL_TXT_ALL "ALL" + +/* + * COMPLEMENTOF* definitions. These identifiers are used to (de-select) + * ciphers normally not being used. + * Example: "RC4" will activate all ciphers using RC4 including ciphers + * without authentication, which would normally disabled by DEFAULT (due + * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" + * will make sure that it is also disabled in the specific selection. + * COMPLEMENTOF* identifiers are portable between version, as adjustments + * to the default cipher setup will also be included here. + * + * COMPLEMENTOFDEFAULT does not experience the same special treatment that + * DEFAULT gets, as only selection is being done and no sorting as needed + * for DEFAULT. + */ +#define SSL_TXT_CMPALL "COMPLEMENTOFALL" +#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" + +/* The following cipher list is used by default. + * It also is substituted when an application-defined cipher list string + * starts with 'DEFAULT'. */ +#define SSL_DEFAULT_CIPHER_LIST "ALL:!aNULL:!eNULL:!SSLv2" +/* As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always + * starts with a reasonable order, and all we have to do for DEFAULT is + * throwing out anonymous and unencrypted ciphersuites! + * (The latter are not actually enabled by ALL, but "ALL:RSA" would enable + * some of them.) + */ + +/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ +#define SSL_SENT_SHUTDOWN 1 +#define SSL_RECEIVED_SHUTDOWN 2 + + +#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 +#define SSL_FILETYPE_PEM X509_FILETYPE_PEM + +/* This is needed to stop compilers complaining about the + * 'struct ssl_st *' function parameters used to prototype callbacks + * in SSL_CTX. */ +typedef struct ssl_st *ssl_crock_st; + +typedef struct ssl_method_st SSL_METHOD; +typedef struct ssl_cipher_st SSL_CIPHER; +typedef struct ssl_session_st SSL_SESSION; + +DECLARE_STACK_OF(SSL_CIPHER) + +/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/ +typedef struct srtp_protection_profile_st { + const char *name; + unsigned long id; +} SRTP_PROTECTION_PROFILE; + +DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE) + +typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, + int len, void *arg); +typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, + STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg); + +/* Allow initial connection to servers that don't support RI */ +#define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004L + +/* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added + * in OpenSSL 0.9.6d. Usually (depending on the application protocol) + * the workaround is not needed. + * Unfortunately some broken SSL/TLS implementations cannot handle it + * at all, which is why it was previously included in SSL_OP_ALL. + * Now it's not. + */ +#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L + +/* DTLS options */ +#define SSL_OP_NO_QUERY_MTU 0x00001000L +/* Turn on Cookie Exchange (on relevant for servers) */ +#define SSL_OP_COOKIE_EXCHANGE 0x00002000L +/* Don't use RFC4507 ticket extension */ +#define SSL_OP_NO_TICKET 0x00004000L + +/* As server, disallow session resumption on renegotiation */ +#define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L +/* Disallow client initiated renegotiation. */ +#define SSL_OP_NO_CLIENT_RENEGOTIATION 0x00020000L +/* If set, always create a new key when using tmp_dh parameters */ +#define SSL_OP_SINGLE_DH_USE 0x00100000L +/* Set on servers to choose the cipher according to the server's + * preferences */ +#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L + +#define SSL_OP_NO_TLSv1 0x04000000L +#define SSL_OP_NO_TLSv1_2 0x08000000L +#define SSL_OP_NO_TLSv1_1 0x10000000L + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_OP_NO_TLSv1_3 0x20000000L +#endif + +#define SSL_OP_NO_DTLSv1 0x40000000L +#define SSL_OP_NO_DTLSv1_2 0x80000000L + +/* SSL_OP_ALL: various bug workarounds that should be rather harmless. */ +#define SSL_OP_ALL \ + (SSL_OP_LEGACY_SERVER_CONNECT) + +/* Obsolete flags kept for compatibility. No sane code should use them. */ +#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x0 +#define SSL_OP_CISCO_ANYCONNECT 0x0 +#define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x0 +#define SSL_OP_EPHEMERAL_RSA 0x0 +#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +#define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 +#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +#define SSL_OP_NO_COMPRESSION 0x0 +#define SSL_OP_NO_SSLv2 0x0 +#define SSL_OP_NO_SSLv3 0x0 +#define SSL_OP_PKCS1_CHECK_1 0x0 +#define SSL_OP_PKCS1_CHECK_2 0x0 +#define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x0 +#define SSL_OP_SINGLE_ECDH_USE 0x0 +#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +#define SSL_OP_TLSEXT_PADDING 0x0 +#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +#define SSL_OP_TLS_D5_BUG 0x0 +#define SSL_OP_TLS_ROLLBACK_BUG 0x0 + +/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success + * when just a single record has been written): */ +#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L +/* Make it possible to retry SSL_write() with changed buffer location + * (buffer contents must stay the same!); this is not the default to avoid + * the misconception that non-blocking SSL_write() behaves like + * non-blocking write(): */ +#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L +/* Never bother the application with retries if the transport + * is blocking: */ +#define SSL_MODE_AUTO_RETRY 0x00000004L +/* Don't attempt to automatically build certificate chain */ +#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L +/* Save RAM by releasing read and write buffers when they're empty. (SSL3 and + * TLS only.) "Released" buffers are put onto a free-list in the context + * or just freed (depending on the context's setting for freelist_max_len). */ +#define SSL_MODE_RELEASE_BUFFERS 0x00000010L + +/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, + * they cannot be used to clear bits. */ + +#define SSL_CTX_set_options(ctx,op) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL) +#define SSL_CTX_clear_options(ctx,op) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_OPTIONS,(op),NULL) +#define SSL_CTX_get_options(ctx) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL) +#define SSL_set_options(ssl,op) \ + SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL) +#define SSL_clear_options(ssl,op) \ + SSL_ctrl((ssl),SSL_CTRL_CLEAR_OPTIONS,(op),NULL) +#define SSL_get_options(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL) + +#define SSL_CTX_set_mode(ctx,op) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) +#define SSL_CTX_clear_mode(ctx,op) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) +#define SSL_CTX_get_mode(ctx) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) +#define SSL_clear_mode(ssl,op) \ + SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL) +#define SSL_set_mode(ssl,op) \ + SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) +#define SSL_get_mode(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) +#define SSL_set_mtu(ssl, mtu) \ + SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) + +#define SSL_get_secure_renegotiation_support(ssl) \ + SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) + +void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, + int version, int content_type, const void *buf, size_t len, SSL *ssl, + void *arg)); +void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, + int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); +#define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) +#define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) +typedef void (*SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line); +void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb); +SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx); +int SSL_set_num_tickets(SSL *s, size_t num_tickets); +size_t SSL_get_num_tickets(const SSL *s); +int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets); +size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx); +STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s); + +#ifndef LIBRESSL_INTERNAL +struct ssl_aead_ctx_st; +typedef struct ssl_aead_ctx_st SSL_AEAD_CTX; +#endif + +#define SSL_MAX_CERT_LIST_DEFAULT 1024*100 /* 100k max cert list :-) */ + +#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20) + +/* This callback type is used inside SSL_CTX, SSL, and in the functions that set + * them. It is used to override the generation of SSL/TLS session IDs in a + * server. Return value should be zero on an error, non-zero to proceed. Also, + * callbacks should themselves check if the id they generate is unique otherwise + * the SSL handshake will fail with an error - callbacks can do this using the + * 'ssl' value they're passed by; + * SSL_has_matching_session_id(ssl, id, *id_len) + * The length value passed in is set at the maximum size the session ID can be. + * In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback + * can alter this length to be less if desired, but under SSLv2 session IDs are + * supposed to be fixed at 16 bytes so the id will be padded after the callback + * returns in this case. It is also an error for the callback to set the size to + * zero. */ +typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, + unsigned int *id_len); + +typedef struct ssl_comp_st SSL_COMP; + +#ifdef LIBRESSL_INTERNAL +DECLARE_STACK_OF(SSL_COMP) +struct lhash_st_SSL_SESSION { + int dummy; +}; +#endif + +#define SSL_SESS_CACHE_OFF 0x0000 +#define SSL_SESS_CACHE_CLIENT 0x0001 +#define SSL_SESS_CACHE_SERVER 0x0002 +#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER) +#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 +/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */ +#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 +#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 +#define SSL_SESS_CACHE_NO_INTERNAL \ + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE) + +struct lhash_st_SSL_SESSION *SSL_CTX_sessions(SSL_CTX *ctx); +#define SSL_CTX_sess_number(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) +#define SSL_CTX_sess_connect(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) +#define SSL_CTX_sess_connect_good(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) +#define SSL_CTX_sess_connect_renegotiate(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) +#define SSL_CTX_sess_accept(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) +#define SSL_CTX_sess_accept_renegotiate(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) +#define SSL_CTX_sess_accept_good(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) +#define SSL_CTX_sess_hits(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) +#define SSL_CTX_sess_cb_hits(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) +#define SSL_CTX_sess_misses(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) +#define SSL_CTX_sess_timeouts(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) +#define SSL_CTX_sess_cache_full(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) + +void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, + int (*new_session_cb)(struct ssl_st *ssl, SSL_SESSION *sess)); +int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, + SSL_SESSION *sess); +void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, + void (*remove_session_cb)(struct ssl_ctx_st *ctx, SSL_SESSION *sess)); +void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, + SSL_SESSION *sess); +void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, + SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, + const unsigned char *data, int len, int *copy)); +SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, + const unsigned char *data, int len, int *copy); +void SSL_CTX_set_info_callback(SSL_CTX *ctx, void (*cb)(const SSL *ssl, + int type, int val)); +void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, int type, + int val); +void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, + int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); +int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, + EVP_PKEY **pkey); +#ifndef OPENSSL_NO_ENGINE +int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); +#endif +void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, + int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, + unsigned int *cookie_len)); +void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, + int (*app_verify_cookie_cb)(SSL *ssl, const unsigned char *cookie, + unsigned int cookie_len)); +void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, int (*cb)(SSL *ssl, + const unsigned char **out, unsigned int *outlen, void *arg), void *arg); +void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, int (*cb)(SSL *ssl, + unsigned char **out, unsigned char *outlen, const unsigned char *in, + unsigned int inlen, void *arg), void *arg); + +int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, + const unsigned char *in, unsigned int inlen, const unsigned char *client, + unsigned int client_len); +void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, + unsigned int *len); + +#define OPENSSL_NPN_UNSUPPORTED 0 +#define OPENSSL_NPN_NEGOTIATED 1 +#define OPENSSL_NPN_NO_OVERLAP 2 + +int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, + unsigned int protos_len); +int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos, + unsigned int protos_len); +void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, const unsigned char **out, unsigned char *outlen, + const unsigned char *in, unsigned int inlen, void *arg), void *arg); +void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, + unsigned int *len); + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +typedef int (*SSL_psk_use_session_cb_func)(SSL *ssl, const EVP_MD *md, + const unsigned char **id, size_t *idlen, SSL_SESSION **sess); +void SSL_set_psk_use_session_callback(SSL *s, SSL_psk_use_session_cb_func cb); +#endif + +#define SSL_NOTHING 1 +#define SSL_WRITING 2 +#define SSL_READING 3 +#define SSL_X509_LOOKUP 4 + +/* These will only be used when doing non-blocking IO */ +#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) +#define SSL_want_read(s) (SSL_want(s) == SSL_READING) +#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) +#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) + +#define SSL_MAC_FLAG_READ_MAC_STREAM 1 +#define SSL_MAC_FLAG_WRITE_MAC_STREAM 2 + +#ifdef __cplusplus +} +#endif + +#include +#include +#include /* This is mostly sslv3 with a few tweaks */ +#include /* Datagram TLS */ +#include +#include /* Support for the use_srtp extension */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* compatibility */ +#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg)) +#define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) +#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a)) +#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) +#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) +#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg)) + +/* The following are the possible values for ssl->state are are + * used to indicate where we are up to in the SSL connection establishment. + * The macros that follow are about the only things you should need to use + * and even then, only when using non-blocking IO. + * It can also be useful to work out where you were when the connection + * failed */ + +#define SSL_ST_CONNECT 0x1000 +#define SSL_ST_ACCEPT 0x2000 +#define SSL_ST_MASK 0x0FFF +#define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT) +#define SSL_ST_BEFORE 0x4000 +#define SSL_ST_OK 0x03 +#define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT) + +#define SSL_CB_LOOP 0x01 +#define SSL_CB_EXIT 0x02 +#define SSL_CB_READ 0x04 +#define SSL_CB_WRITE 0x08 +#define SSL_CB_ALERT 0x4000 /* used in callback */ +#define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ) +#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE) +#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP) +#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT) +#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP) +#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT) +#define SSL_CB_HANDSHAKE_START 0x10 +#define SSL_CB_HANDSHAKE_DONE 0x20 + +/* Is the SSL_connection established? */ +#define SSL_get_state(a) (SSL_state((a))) +#define SSL_is_init_finished(a) (SSL_state((a)) == SSL_ST_OK) +#define SSL_in_init(a) (SSL_state((a))&SSL_ST_INIT) +#define SSL_in_before(a) (SSL_state((a))&SSL_ST_BEFORE) +#define SSL_in_connect_init(a) (SSL_state((a))&SSL_ST_CONNECT) +#define SSL_in_accept_init(a) (SSL_state((a))&SSL_ST_ACCEPT) + +/* The following 2 states are kept in ssl->rstate when reads fail, + * you should not need these */ +#define SSL_ST_READ_HEADER 0xF0 +#define SSL_ST_READ_BODY 0xF1 +#define SSL_ST_READ_DONE 0xF2 + +/* Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. */ +size_t SSL_get_finished(const SSL *s, void *buf, size_t count); +size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); + +/* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options + * are 'ored' with SSL_VERIFY_PEER if they are desired */ +#define SSL_VERIFY_NONE 0x00 +#define SSL_VERIFY_PEER 0x01 +#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 +#define SSL_VERIFY_CLIENT_ONCE 0x04 +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_VERIFY_POST_HANDSHAKE 0x08 + +int SSL_verify_client_post_handshake(SSL *s); +void SSL_CTX_set_post_handshake_auth(SSL_CTX *ctx, int val); +void SSL_set_post_handshake_auth(SSL *s, int val); +#endif + +#define OpenSSL_add_ssl_algorithms() SSL_library_init() +#define SSLeay_add_ssl_algorithms() SSL_library_init() + +/* More backward compatibility */ +#define SSL_get_cipher(s) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(s)) +#define SSL_get_cipher_bits(s,np) \ + SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) +#define SSL_get_cipher_version(s) \ + SSL_CIPHER_get_version(SSL_get_current_cipher(s)) +#define SSL_get_cipher_name(s) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(s)) +#define SSL_get_time(a) SSL_SESSION_get_time(a) +#define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) +#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) +#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) + +#define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) +#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) + +SSL_SESSION *PEM_read_bio_SSL_SESSION(BIO *bp, SSL_SESSION **x, + pem_password_cb *cb, void *u); +SSL_SESSION *PEM_read_SSL_SESSION(FILE *fp, SSL_SESSION **x, + pem_password_cb *cb, void *u); +int PEM_write_bio_SSL_SESSION(BIO *bp, SSL_SESSION *x); +int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); + +/* + * TLS Alerts. + * + * https://www.iana.org/assignments/tls-parameters/#tls-parameters-6 + */ + +/* Obsolete alerts. */ +#ifndef LIBRESSL_INTERNAL +#define SSL_AD_DECRYPTION_FAILED 21 /* Removed in TLSv1.1 */ +#define SSL_AD_NO_CERTIFICATE 41 /* Removed in TLSv1.0 */ +#define SSL_AD_EXPORT_RESTRICTION 60 /* Removed in TLSv1.1 */ +#endif + +#define SSL_AD_CLOSE_NOTIFY 0 +#define SSL_AD_UNEXPECTED_MESSAGE 10 +#define SSL_AD_BAD_RECORD_MAC 20 +#define SSL_AD_RECORD_OVERFLOW 22 +#define SSL_AD_DECOMPRESSION_FAILURE 30 /* Removed in TLSv1.3 */ +#define SSL_AD_HANDSHAKE_FAILURE 40 +#define SSL_AD_BAD_CERTIFICATE 42 +#define SSL_AD_UNSUPPORTED_CERTIFICATE 43 +#define SSL_AD_CERTIFICATE_REVOKED 44 +#define SSL_AD_CERTIFICATE_EXPIRED 45 +#define SSL_AD_CERTIFICATE_UNKNOWN 46 +#define SSL_AD_ILLEGAL_PARAMETER 47 +#define SSL_AD_UNKNOWN_CA 48 +#define SSL_AD_ACCESS_DENIED 49 +#define SSL_AD_DECODE_ERROR 50 +#define SSL_AD_DECRYPT_ERROR 51 +#define SSL_AD_PROTOCOL_VERSION 70 +#define SSL_AD_INSUFFICIENT_SECURITY 71 +#define SSL_AD_INTERNAL_ERROR 80 +#define SSL_AD_INAPPROPRIATE_FALLBACK 86 +#define SSL_AD_USER_CANCELLED 90 +#define SSL_AD_NO_RENEGOTIATION 100 /* Removed in TLSv1.3 */ +#define SSL_AD_MISSING_EXTENSION 109 /* Added in TLSv1.3. */ +#define SSL_AD_UNSUPPORTED_EXTENSION 110 +#define SSL_AD_CERTIFICATE_UNOBTAINABLE 111 /* Removed in TLSv1.3 */ +#define SSL_AD_UNRECOGNIZED_NAME 112 +#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 +#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE 114 /* Removed in TLSv1.3 */ +#define SSL_AD_UNKNOWN_PSK_IDENTITY 115 +#define SSL_AD_CERTIFICATE_REQUIRED 116 +#define SSL_AD_NO_APPLICATION_PROTOCOL 120 + +/* Offset to get an SSL_R_... value from an SSL_AD_... value. */ +#define SSL_AD_REASON_OFFSET 1000 + +#define SSL_ERROR_NONE 0 +#define SSL_ERROR_SSL 1 +#define SSL_ERROR_WANT_READ 2 +#define SSL_ERROR_WANT_WRITE 3 +#define SSL_ERROR_WANT_X509_LOOKUP 4 +#define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */ +#define SSL_ERROR_ZERO_RETURN 6 +#define SSL_ERROR_WANT_CONNECT 7 +#define SSL_ERROR_WANT_ACCEPT 8 + +#define SSL_CTRL_NEED_TMP_RSA 1 +#define SSL_CTRL_SET_TMP_RSA 2 +#define SSL_CTRL_SET_TMP_DH 3 +#define SSL_CTRL_SET_TMP_ECDH 4 +#define SSL_CTRL_SET_TMP_RSA_CB 5 +#define SSL_CTRL_SET_TMP_DH_CB 6 +#define SSL_CTRL_SET_TMP_ECDH_CB 7 + +#define SSL_CTRL_GET_SESSION_REUSED 8 +#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9 +#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10 +#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11 +#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12 +#define SSL_CTRL_GET_FLAGS 13 +#define SSL_CTRL_EXTRA_CHAIN_CERT 14 + +#define SSL_CTRL_SET_MSG_CALLBACK 15 +#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16 + +/* only applies to datagram connections */ +#define SSL_CTRL_SET_MTU 17 +/* Stats */ +#define SSL_CTRL_SESS_NUMBER 20 +#define SSL_CTRL_SESS_CONNECT 21 +#define SSL_CTRL_SESS_CONNECT_GOOD 22 +#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 +#define SSL_CTRL_SESS_ACCEPT 24 +#define SSL_CTRL_SESS_ACCEPT_GOOD 25 +#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 +#define SSL_CTRL_SESS_HIT 27 +#define SSL_CTRL_SESS_CB_HIT 28 +#define SSL_CTRL_SESS_MISSES 29 +#define SSL_CTRL_SESS_TIMEOUTS 30 +#define SSL_CTRL_SESS_CACHE_FULL 31 +#define SSL_CTRL_OPTIONS 32 +#define SSL_CTRL_MODE 33 + +#define SSL_CTRL_GET_READ_AHEAD 40 +#define SSL_CTRL_SET_READ_AHEAD 41 +#define SSL_CTRL_SET_SESS_CACHE_SIZE 42 +#define SSL_CTRL_GET_SESS_CACHE_SIZE 43 +#define SSL_CTRL_SET_SESS_CACHE_MODE 44 +#define SSL_CTRL_GET_SESS_CACHE_MODE 45 + +#define SSL_CTRL_GET_MAX_CERT_LIST 50 +#define SSL_CTRL_SET_MAX_CERT_LIST 51 + +#define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52 + +/* see tls1.h for macros based on these */ +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53 +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54 +#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55 +#define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56 +#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 +#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 +#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 + +#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 + +#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75 +#define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76 +#define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77 + +#define SSL_CTRL_SET_SRP_ARG 78 +#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79 +#define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80 +#define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81 + +#define DTLS_CTRL_GET_TIMEOUT 73 +#define DTLS_CTRL_HANDLE_TIMEOUT 74 +#define DTLS_CTRL_LISTEN 75 + +#define SSL_CTRL_GET_RI_SUPPORT 76 +#define SSL_CTRL_CLEAR_OPTIONS 77 +#define SSL_CTRL_CLEAR_MODE 78 + +#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82 +#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 + +#define SSL_CTRL_CHAIN 88 +#define SSL_CTRL_CHAIN_CERT 89 + +#define SSL_CTRL_SET_GROUPS 91 +#define SSL_CTRL_SET_GROUPS_LIST 92 + +#define SSL_CTRL_SET_ECDH_AUTO 94 + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_CTRL_GET_PEER_SIGNATURE_NID 108 +#define SSL_CTRL_GET_PEER_TMP_KEY 109 +#define SSL_CTRL_GET_SERVER_TMP_KEY SSL_CTRL_GET_PEER_TMP_KEY +#else +#define SSL_CTRL_GET_SERVER_TMP_KEY 109 +#endif + +#define SSL_CTRL_GET_CHAIN_CERTS 115 + +#define SSL_CTRL_SET_DH_AUTO 118 + +#define SSL_CTRL_SET_MIN_PROTO_VERSION 123 +#define SSL_CTRL_SET_MAX_PROTO_VERSION 124 +#define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +#define SSL_CTRL_GET_MAX_PROTO_VERSION 131 + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_CTRL_GET_SIGNATURE_NID 132 +#endif + +#define DTLSv1_get_timeout(ssl, arg) \ + SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg) +#define DTLSv1_handle_timeout(ssl) \ + SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL) +#define DTLSv1_listen(ssl, peer) \ + SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, (void *)peer) + +#define SSL_session_reused(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL) +#define SSL_num_renegotiations(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) +#define SSL_clear_num_renegotiations(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) +#define SSL_total_renegotiations(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) + +#define SSL_CTX_need_tmp_RSA(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL) +#define SSL_CTX_set_tmp_rsa(ctx,rsa) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) +#define SSL_CTX_set_tmp_dh(ctx,dh) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh) +#define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) +#define SSL_CTX_set_dh_auto(ctx, onoff) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_DH_AUTO,onoff,NULL) +#define SSL_CTX_set_ecdh_auto(ctx, onoff) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL) + +#define SSL_need_tmp_RSA(ssl) \ + SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL) +#define SSL_set_tmp_rsa(ssl,rsa) \ + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) +#define SSL_set_tmp_dh(ssl,dh) \ + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh) +#define SSL_set_tmp_ecdh(ssl,ecdh) \ + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) +#define SSL_set_dh_auto(s, onoff) \ + SSL_ctrl(s,SSL_CTRL_SET_DH_AUTO,onoff,NULL) +#define SSL_set_ecdh_auto(s, onoff) \ + SSL_ctrl(s,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL) + +int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); +int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain); +int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509); +int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509); +int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, STACK_OF(X509) **out_chain); +int SSL_CTX_clear_chain_certs(SSL_CTX *ctx); + +int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain); +int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain); +int SSL_add0_chain_cert(SSL *ssl, X509 *x509); +int SSL_add1_chain_cert(SSL *ssl, X509 *x509); +int SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain); +int SSL_clear_chain_certs(SSL *ssl); + +int SSL_CTX_set1_groups(SSL_CTX *ctx, const int *groups, size_t groups_len); +int SSL_CTX_set1_groups_list(SSL_CTX *ctx, const char *groups); + +int SSL_set1_groups(SSL *ssl, const int *groups, size_t groups_len); +int SSL_set1_groups_list(SSL *ssl, const char *groups); + +int SSL_CTX_get_min_proto_version(SSL_CTX *ctx); +int SSL_CTX_get_max_proto_version(SSL_CTX *ctx); +int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version); +int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version); + +int SSL_get_min_proto_version(SSL *ssl); +int SSL_get_max_proto_version(SSL *ssl); +int SSL_set_min_proto_version(SSL *ssl, uint16_t version); +int SSL_set_max_proto_version(SSL *ssl, uint16_t version); + +const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx); + +#ifndef LIBRESSL_INTERNAL +#define SSL_CTRL_SET_CURVES SSL_CTRL_SET_GROUPS +#define SSL_CTRL_SET_CURVES_LIST SSL_CTRL_SET_GROUPS_LIST + +#define SSL_CTX_set1_curves SSL_CTX_set1_groups +#define SSL_CTX_set1_curves_list SSL_CTX_set1_groups_list +#define SSL_set1_curves SSL_set1_groups +#define SSL_set1_curves_list SSL_set1_groups_list +#endif + +#define SSL_CTX_add_extra_chain_cert(ctx, x509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, (char *)x509) +#define SSL_CTX_get_extra_chain_certs(ctx, px509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 0, px509) +#define SSL_CTX_get_extra_chain_certs_only(ctx, px509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 1, px509) +#define SSL_CTX_clear_extra_chain_certs(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS, 0, NULL) + +#define SSL_get_server_tmp_key(s, pk) \ + SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk) + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define SSL_get_signature_nid(s, pn) \ + SSL_ctrl(s, SSL_CTRL_GET_SIGNATURE_NID, 0, pn) + +#define SSL_get_peer_signature_nid(s, pn) \ + SSL_ctrl(s, SSL_CTRL_GET_PEER_SIGNATURE_NID, 0, pn) +#define SSL_get_peer_tmp_key(s, pk) \ + SSL_ctrl(s, SSL_CTRL_GET_PEER_TMP_KEY, 0, pk) + +int SSL_get_signature_type_nid(const SSL *ssl, int *nid); +int SSL_get_peer_signature_type_nid(const SSL *ssl, int *nid); + +#endif /* LIBRESSL_HAS_TLS1_3 || LIBRESSL_INTERNAL */ + +#ifndef LIBRESSL_INTERNAL +/* + * Also provide those functions as macros for compatibility with + * existing users. + */ +#define SSL_CTX_set0_chain SSL_CTX_set0_chain +#define SSL_CTX_set1_chain SSL_CTX_set1_chain +#define SSL_CTX_add0_chain_cert SSL_CTX_add0_chain_cert +#define SSL_CTX_add1_chain_cert SSL_CTX_add1_chain_cert +#define SSL_CTX_get0_chain_certs SSL_CTX_get0_chain_certs +#define SSL_CTX_clear_chain_certs SSL_CTX_clear_chain_certs + +#define SSL_add0_chain_cert SSL_add0_chain_cert +#define SSL_add1_chain_cert SSL_add1_chain_cert +#define SSL_set0_chain SSL_set0_chain +#define SSL_set1_chain SSL_set1_chain +#define SSL_get0_chain_certs SSL_get0_chain_certs +#define SSL_clear_chain_certs SSL_clear_chain_certs + +#define SSL_CTX_set1_groups SSL_CTX_set1_groups +#define SSL_CTX_set1_groups_list SSL_CTX_set1_groups_list +#define SSL_set1_groups SSL_set1_groups +#define SSL_set1_groups_list SSL_set1_groups_list + +#define SSL_CTX_get_min_proto_version SSL_CTX_get_min_proto_version +#define SSL_CTX_get_max_proto_version SSL_CTX_get_max_proto_version +#define SSL_CTX_set_min_proto_version SSL_CTX_set_min_proto_version +#define SSL_CTX_set_max_proto_version SSL_CTX_set_max_proto_version + +#define SSL_get_min_proto_version SSL_get_min_proto_version +#define SSL_get_max_proto_version SSL_get_max_proto_version +#define SSL_set_min_proto_version SSL_set_min_proto_version +#define SSL_set_max_proto_version SSL_set_max_proto_version +#endif + +const BIO_METHOD *BIO_f_ssl(void); +BIO *BIO_new_ssl(SSL_CTX *ctx, int client); +BIO *BIO_new_ssl_connect(SSL_CTX *ctx); +BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); +int BIO_ssl_copy_session_id(BIO *to, BIO *from); +void BIO_ssl_shutdown(BIO *ssl_bio); + +STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx); +int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str); +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +int SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str); +#endif +SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth); +void SSL_CTX_free(SSL_CTX *); +int SSL_CTX_up_ref(SSL_CTX *ctx); +long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); +long SSL_CTX_get_timeout(const SSL_CTX *ctx); +X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); +void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *); +X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); +EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); +int SSL_want(const SSL *s); +int SSL_clear(SSL *s); + +void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm); + +const SSL_CIPHER *SSL_get_current_cipher(const SSL *s); +const SSL_CIPHER *SSL_CIPHER_get_by_id(unsigned int id); +const SSL_CIPHER *SSL_CIPHER_get_by_value(uint16_t value); +int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits); +const char * SSL_CIPHER_get_version(const SSL_CIPHER *c); +const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); +unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c); +uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *c); +const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); +int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c); +int SSL_CIPHER_is_aead(const SSL_CIPHER *c); + +int SSL_get_fd(const SSL *s); +int SSL_get_rfd(const SSL *s); +int SSL_get_wfd(const SSL *s); +const char * SSL_get_cipher_list(const SSL *s, int n); +char * SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +int SSL_get_read_ahead(const SSL * s); +int SSL_pending(const SSL *s); +int SSL_set_fd(SSL *s, int fd); +int SSL_set_rfd(SSL *s, int fd); +int SSL_set_wfd(SSL *s, int fd); +void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio); +BIO * SSL_get_rbio(const SSL *s); +void SSL_set0_rbio(SSL *s, BIO *rbio); +BIO * SSL_get_wbio(const SSL *s); +int SSL_set_cipher_list(SSL *s, const char *str); +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +int SSL_set_ciphersuites(SSL *s, const char *str); +#endif +void SSL_set_read_ahead(SSL *s, int yes); +int SSL_get_verify_mode(const SSL *s); +int SSL_get_verify_depth(const SSL *s); +int (*SSL_get_verify_callback(const SSL *s))(int, X509_STORE_CTX *); +void SSL_set_verify(SSL *s, int mode, + int (*callback)(int ok, X509_STORE_CTX *ctx)); +void SSL_set_verify_depth(SSL *s, int depth); +int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); +int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const unsigned char *d, long len); +int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); +int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d, long len); +int SSL_use_certificate(SSL *ssl, X509 *x); +int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); + +int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); +int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type); +int SSL_use_certificate_file(SSL *ssl, const char *file, int type); +int SSL_use_certificate_chain_file(SSL *ssl, const char *file); +int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); +int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); +int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); +int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */ +int SSL_CTX_use_certificate_chain_mem(SSL_CTX *ctx, void *buf, int len); +STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); +int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *file); +int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *dir); + +void SSL_load_error_strings(void ); +const char *SSL_state_string(const SSL *s); +const char *SSL_rstate_string(const SSL *s); +const char *SSL_state_string_long(const SSL *s); +const char *SSL_rstate_string_long(const SSL *s); +const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *ss); +size_t SSL_SESSION_get_master_key(const SSL_SESSION *ss, + unsigned char *out, size_t max_out); +int SSL_SESSION_get_protocol_version(const SSL_SESSION *s); +long SSL_SESSION_get_time(const SSL_SESSION *s); +long SSL_SESSION_set_time(SSL_SESSION *s, long t); +long SSL_SESSION_get_timeout(const SSL_SESSION *s); +long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); +int SSL_copy_session_id(SSL *to, const SSL *from); +X509 *SSL_SESSION_get0_peer(SSL_SESSION *s); +int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid, + unsigned int sid_len); +int SSL_SESSION_set1_id_context(SSL_SESSION *s, + const unsigned char *sid_ctx, unsigned int sid_ctx_len); +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +int SSL_SESSION_is_resumable(const SSL_SESSION *s); +#endif + +SSL_SESSION *SSL_SESSION_new(void); +void SSL_SESSION_free(SSL_SESSION *ses); +int SSL_SESSION_up_ref(SSL_SESSION *ss); +const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *ss, + unsigned int *len); +const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *ss, + unsigned int *len); +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +uint32_t SSL_SESSION_get_max_early_data(const SSL_SESSION *sess); +int SSL_SESSION_set_max_early_data(SSL_SESSION *sess, uint32_t max_early_data); +#endif +unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s); +int SSL_SESSION_has_ticket(const SSL_SESSION *s); +unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *ss); +int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses); +int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses); +int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); +int SSL_set_session(SSL *to, SSL_SESSION *session); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); +int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); +int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); +int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id, + unsigned int id_len); +SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, + long length); + +#ifdef HEADER_X509_H +X509 * SSL_get_peer_certificate(const SSL *s); +#endif + +STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); + +int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); +int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); +int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, + int (*callback)(int, X509_STORE_CTX *)); +void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); +void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(X509_STORE_CTX *, void *), void *arg); +int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); +int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len); +int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); +int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, const unsigned char *d, long len); +int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); +int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); + +pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx); +void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); +void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx); +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); + +int SSL_CTX_check_private_key(const SSL_CTX *ctx); +int SSL_check_private_key(const SSL *ctx); + +int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len); + +int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len); + +int SSL_CTX_set_purpose(SSL_CTX *s, int purpose); +int SSL_set_purpose(SSL *s, int purpose); +int SSL_CTX_set_trust(SSL_CTX *s, int trust); +int SSL_set_trust(SSL *s, int trust); +int SSL_set1_host(SSL *s, const char *hostname); +void SSL_set_hostflags(SSL *s, unsigned int flags); +const char *SSL_get0_peername(SSL *s); + +X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); +int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); +X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); +int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm); + +SSL *SSL_new(SSL_CTX *ctx); +void SSL_free(SSL *ssl); +int SSL_up_ref(SSL *ssl); +int SSL_accept(SSL *ssl); +int SSL_connect(SSL *ssl); +int SSL_is_dtls(const SSL *s); +int SSL_is_server(const SSL *s); +int SSL_read(SSL *ssl, void *buf, int num); +int SSL_peek(SSL *ssl, void *buf, int num); +int SSL_write(SSL *ssl, const void *buf, int num); +int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *bytes_read); +int SSL_peek_ex(SSL *ssl, void *buf, size_t num, size_t *bytes_peeked); +int SSL_write_ex(SSL *ssl, const void *buf, size_t num, size_t *bytes_written); + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +uint32_t SSL_CTX_get_max_early_data(const SSL_CTX *ctx); +int SSL_CTX_set_max_early_data(SSL_CTX *ctx, uint32_t max_early_data); + +uint32_t SSL_get_max_early_data(const SSL *s); +int SSL_set_max_early_data(SSL *s, uint32_t max_early_data); + +#define SSL_EARLY_DATA_NOT_SENT 0 +#define SSL_EARLY_DATA_REJECTED 1 +#define SSL_EARLY_DATA_ACCEPTED 2 +int SSL_get_early_data_status(const SSL *s); + +#define SSL_READ_EARLY_DATA_ERROR 0 +#define SSL_READ_EARLY_DATA_SUCCESS 1 +#define SSL_READ_EARLY_DATA_FINISH 2 +int SSL_read_early_data(SSL *s, void *buf, size_t num, size_t *readbytes); +int SSL_write_early_data(SSL *s, const void *buf, size_t num, size_t *written); +#endif + +long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); +long SSL_callback_ctrl(SSL *, int, void (*)(void)); +long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg); +long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); + +int SSL_get_error(const SSL *s, int ret_code); +const char *SSL_get_version(const SSL *s); + +/* This sets the 'default' SSL version that SSL_new() will create */ +int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); + +const SSL_METHOD *SSLv23_method(void); /* SSLv3 or TLSv1.* */ +const SSL_METHOD *SSLv23_server_method(void); /* SSLv3 or TLSv1.* */ +const SSL_METHOD *SSLv23_client_method(void); /* SSLv3 or TLSv1.* */ + +const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ +const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ +const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ + +const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */ +const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */ +const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */ + +const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */ +const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */ +const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */ + +const SSL_METHOD *TLS_method(void); /* TLS v1.0 or later */ +const SSL_METHOD *TLS_server_method(void); /* TLS v1.0 or later */ +const SSL_METHOD *TLS_client_method(void); /* TLS v1.0 or later */ + +const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ +const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ +const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ + +const SSL_METHOD *DTLSv1_2_method(void); /* DTLSv1.2 */ +const SSL_METHOD *DTLSv1_2_server_method(void); /* DTLSv1.2 */ +const SSL_METHOD *DTLSv1_2_client_method(void); /* DTLSv1.2 */ + +const SSL_METHOD *DTLS_method(void); /* DTLS v1.0 or later */ +const SSL_METHOD *DTLS_server_method(void); /* DTLS v1.0 or later */ +const SSL_METHOD *DTLS_client_method(void); /* DTLS v1.0 or later */ + +STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); +STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const SSL *s); +STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(SSL *s); + +int SSL_do_handshake(SSL *s); +int SSL_renegotiate(SSL *s); +int SSL_renegotiate_abbreviated(SSL *s); +int SSL_renegotiate_pending(SSL *s); +int SSL_shutdown(SSL *s); + +const SSL_METHOD *SSL_get_ssl_method(SSL *s); +int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method); +const char *SSL_alert_type_string_long(int value); +const char *SSL_alert_type_string(int value); +const char *SSL_alert_desc_string_long(int value); +const char *SSL_alert_desc_string(int value); + +void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); +void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); +STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); +STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); +int SSL_add_client_CA(SSL *ssl, X509 *x); +int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); + +void SSL_set_connect_state(SSL *s); +void SSL_set_accept_state(SSL *s); + +long SSL_get_default_timeout(const SSL *s); + +int SSL_library_init(void ); + +char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size); +STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); + +SSL *SSL_dup(SSL *ssl); + +X509 *SSL_get_certificate(const SSL *ssl); +/* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl); + +void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode); +int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); +void SSL_set_quiet_shutdown(SSL *ssl,int mode); +int SSL_get_quiet_shutdown(const SSL *ssl); +void SSL_set_shutdown(SSL *ssl,int mode); +int SSL_get_shutdown(const SSL *ssl); +int SSL_version(const SSL *ssl); +int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); +int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, + const char *CApath); +int SSL_CTX_load_verify_mem(SSL_CTX *ctx, void *buf, int len); +#define SSL_get0_session SSL_get_session /* just peek at pointer */ +SSL_SESSION *SSL_get_session(const SSL *ssl); +SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ +SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); +SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx); +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl, int type, int val)); +void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, int val); +int SSL_state(const SSL *ssl); +void SSL_set_state(SSL *ssl, int state); + +void SSL_set_verify_result(SSL *ssl, long v); +long SSL_get_verify_result(const SSL *ssl); + +int SSL_set_ex_data(SSL *ssl, int idx, void *data); +void *SSL_get_ex_data(const SSL *ssl, int idx); +int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); + +int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data); +void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx); +int SSL_SESSION_get_ex_new_index(long argl, void *argp, + CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, + CRYPTO_EX_free *free_func); + +int SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data); +void *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx); +int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); + +int SSL_get_ex_data_X509_STORE_CTX_idx(void ); + +#define SSL_CTX_sess_set_cache_size(ctx,t) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) +#define SSL_CTX_sess_get_cache_size(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) +#define SSL_CTX_set_session_cache_mode(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) +#define SSL_CTX_get_session_cache_mode(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) + +#define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) +#define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) +#define SSL_CTX_get_read_ahead(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) +#define SSL_CTX_set_read_ahead(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) +#define SSL_CTX_get_max_cert_list(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) +#define SSL_CTX_set_max_cert_list(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) +#define SSL_get_max_cert_list(ssl) \ + SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) +#define SSL_set_max_cert_list(ssl,m) \ + SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + +#define SSL_CTX_set_max_send_fragment(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) +#define SSL_set_max_send_fragment(ssl,m) \ + SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + +/* NB: the keylength is only applicable when is_export is true */ +void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, + RSA *(*cb)(SSL *ssl, int is_export, int keylength)); + +void SSL_set_tmp_rsa_callback(SSL *ssl, + RSA *(*cb)(SSL *ssl, int is_export, int keylength)); +void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, + DH *(*dh)(SSL *ssl, int is_export, int keylength)); +void SSL_set_tmp_dh_callback(SSL *ssl, + DH *(*dh)(SSL *ssl, int is_export, int keylength)); +void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, + EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength)); +void SSL_set_tmp_ecdh_callback(SSL *ssl, + EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength)); + +size_t SSL_get_client_random(const SSL *s, unsigned char *out, size_t max_out); +size_t SSL_get_server_random(const SSL *s, unsigned char *out, size_t max_out); + +const void *SSL_get_current_compression(SSL *s); +const void *SSL_get_current_expansion(SSL *s); + +const char *SSL_COMP_get_name(const void *comp); +void *SSL_COMP_get_compression_methods(void); +int SSL_COMP_add_compression_method(int id, void *cm); + +/* TLS extensions functions */ +int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len); + +int SSL_set_session_ticket_ext_cb(SSL *s, + tls_session_ticket_ext_cb_fn cb, void *arg); + +/* Pre-shared secret session resumption functions */ +int SSL_set_session_secret_cb(SSL *s, + tls_session_secret_cb_fn tls_session_secret_cb, void *arg); + +void SSL_set_debug(SSL *s, int debug); +int SSL_cache_hit(SSL *s); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_SSL_strings(void); + +/* Error codes for the SSL functions. */ + +/* Function codes. */ +#define SSL_F_CLIENT_CERTIFICATE 100 +#define SSL_F_CLIENT_FINISHED 167 +#define SSL_F_CLIENT_HELLO 101 +#define SSL_F_CLIENT_MASTER_KEY 102 +#define SSL_F_D2I_SSL_SESSION 103 +#define SSL_F_DO_DTLS1_WRITE 245 +#define SSL_F_DO_SSL3_WRITE 104 +#define SSL_F_DTLS1_ACCEPT 246 +#define SSL_F_DTLS1_ADD_CERT_TO_BUF 295 +#define SSL_F_DTLS1_BUFFER_RECORD 247 +#define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 316 +#define SSL_F_DTLS1_CLIENT_HELLO 248 +#define SSL_F_DTLS1_CONNECT 249 +#define SSL_F_DTLS1_ENC 250 +#define SSL_F_DTLS1_GET_HELLO_VERIFY 251 +#define SSL_F_DTLS1_GET_MESSAGE 252 +#define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253 +#define SSL_F_DTLS1_GET_RECORD 254 +#define SSL_F_DTLS1_HANDLE_TIMEOUT 297 +#define SSL_F_DTLS1_HEARTBEAT 305 +#define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 +#define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288 +#define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 +#define SSL_F_DTLS1_PROCESS_RECORD 257 +#define SSL_F_DTLS1_READ_BYTES 258 +#define SSL_F_DTLS1_READ_FAILED 259 +#define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260 +#define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261 +#define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262 +#define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263 +#define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264 +#define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265 +#define SSL_F_DTLS1_SEND_SERVER_HELLO 266 +#define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267 +#define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268 +#define SSL_F_GET_CLIENT_FINISHED 105 +#define SSL_F_GET_CLIENT_HELLO 106 +#define SSL_F_GET_CLIENT_MASTER_KEY 107 +#define SSL_F_GET_SERVER_FINISHED 108 +#define SSL_F_GET_SERVER_HELLO 109 +#define SSL_F_GET_SERVER_VERIFY 110 +#define SSL_F_I2D_SSL_SESSION 111 +#define SSL_F_READ_N 112 +#define SSL_F_REQUEST_CERTIFICATE 113 +#define SSL_F_SERVER_FINISH 239 +#define SSL_F_SERVER_HELLO 114 +#define SSL_F_SERVER_VERIFY 240 +#define SSL_F_SSL23_ACCEPT 115 +#define SSL_F_SSL23_CLIENT_HELLO 116 +#define SSL_F_SSL23_CONNECT 117 +#define SSL_F_SSL23_GET_CLIENT_HELLO 118 +#define SSL_F_SSL23_GET_SERVER_HELLO 119 +#define SSL_F_SSL23_PEEK 237 +#define SSL_F_SSL23_READ 120 +#define SSL_F_SSL23_WRITE 121 +#define SSL_F_SSL2_ACCEPT 122 +#define SSL_F_SSL2_CONNECT 123 +#define SSL_F_SSL2_ENC_INIT 124 +#define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241 +#define SSL_F_SSL2_PEEK 234 +#define SSL_F_SSL2_READ 125 +#define SSL_F_SSL2_READ_INTERNAL 236 +#define SSL_F_SSL2_SET_CERTIFICATE 126 +#define SSL_F_SSL2_WRITE 127 +#define SSL_F_SSL3_ACCEPT 128 +#define SSL_F_SSL3_ADD_CERT_TO_BUF 296 +#define SSL_F_SSL3_CALLBACK_CTRL 233 +#define SSL_F_SSL3_CHANGE_CIPHER_STATE 129 +#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130 +#define SSL_F_SSL3_CHECK_CLIENT_HELLO 304 +#define SSL_F_SSL3_CLIENT_HELLO 131 +#define SSL_F_SSL3_CONNECT 132 +#define SSL_F_SSL3_CTRL 213 +#define SSL_F_SSL3_CTX_CTRL 133 +#define SSL_F_SSL3_DIGEST_CACHED_RECORDS 293 +#define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292 +#define SSL_F_SSL3_ENC 134 +#define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 +#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 +#define SSL_F_SSL3_GET_CERT_STATUS 289 +#define SSL_F_SSL3_GET_CERT_VERIFY 136 +#define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137 +#define SSL_F_SSL3_GET_CLIENT_HELLO 138 +#define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139 +#define SSL_F_SSL3_GET_FINISHED 140 +#define SSL_F_SSL3_GET_KEY_EXCHANGE 141 +#define SSL_F_SSL3_GET_MESSAGE 142 +#define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283 +#define SSL_F_SSL3_GET_NEXT_PROTO 306 +#define SSL_F_SSL3_GET_RECORD 143 +#define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 +#define SSL_F_SSL3_GET_SERVER_DONE 145 +#define SSL_F_SSL3_GET_SERVER_HELLO 146 +#define SSL_F_SSL3_HANDSHAKE_MAC 285 +#define SSL_F_SSL3_NEW_SESSION_TICKET 287 +#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147 +#define SSL_F_SSL3_PEEK 235 +#define SSL_F_SSL3_READ_BYTES 148 +#define SSL_F_SSL3_READ_N 149 +#define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150 +#define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151 +#define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152 +#define SSL_F_SSL3_SEND_CLIENT_VERIFY 153 +#define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154 +#define SSL_F_SSL3_SEND_SERVER_HELLO 242 +#define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155 +#define SSL_F_SSL3_SETUP_KEY_BLOCK 157 +#define SSL_F_SSL3_SETUP_READ_BUFFER 156 +#define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 +#define SSL_F_SSL3_WRITE_BYTES 158 +#define SSL_F_SSL3_WRITE_PENDING 159 +#define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298 +#define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277 +#define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307 +#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 +#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 +#define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299 +#define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278 +#define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308 +#define SSL_F_SSL_BAD_METHOD 160 +#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 +#define SSL_F_SSL_CERT_DUP 221 +#define SSL_F_SSL_CERT_INST 222 +#define SSL_F_SSL_CERT_INSTANTIATE 214 +#define SSL_F_SSL_CERT_NEW 162 +#define SSL_F_SSL_CHECK_PRIVATE_KEY 163 +#define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280 +#define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 279 +#define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230 +#define SSL_F_SSL_CIPHER_STRENGTH_SORT 231 +#define SSL_F_SSL_CLEAR 164 +#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165 +#define SSL_F_SSL_CREATE_CIPHER_LIST 166 +#define SSL_F_SSL_CTRL 232 +#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 +#define SSL_F_SSL_CTX_MAKE_PROFILES 309 +#define SSL_F_SSL_CTX_NEW 169 +#define SSL_F_SSL_CTX_SET_CIPHER_LIST 269 +#define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290 +#define SSL_F_SSL_CTX_SET_PURPOSE 226 +#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219 +#define SSL_F_SSL_CTX_SET_SSL_VERSION 170 +#define SSL_F_SSL_CTX_SET_TRUST 229 +#define SSL_F_SSL_CTX_USE_CERTIFICATE 171 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY 174 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176 +#define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 272 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179 +#define SSL_F_SSL_DO_HANDSHAKE 180 +#define SSL_F_SSL_GET_NEW_SESSION 181 +#define SSL_F_SSL_GET_PREV_SESSION 217 +#define SSL_F_SSL_GET_SERVER_SEND_CERT 182 +#define SSL_F_SSL_GET_SERVER_SEND_PKEY 317 +#define SSL_F_SSL_GET_SIGN_PKEY 183 +#define SSL_F_SSL_INIT_WBIO_BUFFER 184 +#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185 +#define SSL_F_SSL_NEW 186 +#define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300 +#define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302 +#define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310 +#define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301 +#define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303 +#define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 +#define SSL_F_SSL_PEEK 270 +#define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281 +#define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282 +#define SSL_F_SSL_READ 223 +#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187 +#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 +#define SSL_F_SSL_SESSION_NEW 189 +#define SSL_F_SSL_SESSION_PRINT_FP 190 +#define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312 +#define SSL_F_SSL_SESS_CERT_NEW 225 +#define SSL_F_SSL_SET_CERT 191 +#define SSL_F_SSL_SET_CIPHER_LIST 271 +#define SSL_F_SSL_SET_FD 192 +#define SSL_F_SSL_SET_PKEY 193 +#define SSL_F_SSL_SET_PURPOSE 227 +#define SSL_F_SSL_SET_RFD 194 +#define SSL_F_SSL_SET_SESSION 195 +#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218 +#define SSL_F_SSL_SET_SESSION_TICKET_EXT 294 +#define SSL_F_SSL_SET_TRUST 228 +#define SSL_F_SSL_SET_WFD 196 +#define SSL_F_SSL_SHUTDOWN 224 +#define SSL_F_SSL_SRP_CTX_INIT 313 +#define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 +#define SSL_F_SSL_UNDEFINED_FUNCTION 197 +#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 +#define SSL_F_SSL_USE_CERTIFICATE 198 +#define SSL_F_SSL_USE_CERTIFICATE_ASN1 199 +#define SSL_F_SSL_USE_CERTIFICATE_FILE 200 +#define SSL_F_SSL_USE_PRIVATEKEY 201 +#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202 +#define SSL_F_SSL_USE_PRIVATEKEY_FILE 203 +#define SSL_F_SSL_USE_PSK_IDENTITY_HINT 273 +#define SSL_F_SSL_USE_RSAPRIVATEKEY 204 +#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205 +#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206 +#define SSL_F_SSL_VERIFY_CERT_CHAIN 207 +#define SSL_F_SSL_WRITE 208 +#define SSL_F_TLS1_AEAD_CTX_INIT 339 +#define SSL_F_TLS1_CERT_VERIFY_MAC 286 +#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 +#define SSL_F_TLS1_CHANGE_CIPHER_STATE_AEAD 340 +#define SSL_F_TLS1_CHANGE_CIPHER_STATE_CIPHER 338 +#define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274 +#define SSL_F_TLS1_ENC 210 +#define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314 +#define SSL_F_TLS1_HEARTBEAT 315 +#define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275 +#define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276 +#define SSL_F_TLS1_PRF 284 +#define SSL_F_TLS1_SETUP_KEY_BLOCK 211 +#define SSL_F_WRITE_PENDING 212 + +/* Reason codes. */ +#define SSL_R_APP_DATA_IN_HANDSHAKE 100 +#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272 +#define SSL_R_BAD_ALERT_RECORD 101 +#define SSL_R_BAD_AUTHENTICATION_TYPE 102 +#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 +#define SSL_R_BAD_CHECKSUM 104 +#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 +#define SSL_R_BAD_DECOMPRESSION 107 +#define SSL_R_BAD_DH_G_LENGTH 108 +#define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +#define SSL_R_BAD_DH_P_LENGTH 110 +#define SSL_R_BAD_DIGEST_LENGTH 111 +#define SSL_R_BAD_DSA_SIGNATURE 112 +#define SSL_R_BAD_ECC_CERT 304 +#define SSL_R_BAD_ECDSA_SIGNATURE 305 +#define SSL_R_BAD_ECPOINT 306 +#define SSL_R_BAD_HANDSHAKE_LENGTH 332 +#define SSL_R_BAD_HELLO_REQUEST 105 +#define SSL_R_BAD_LENGTH 271 +#define SSL_R_BAD_MAC_DECODE 113 +#define SSL_R_BAD_MAC_LENGTH 333 +#define SSL_R_BAD_MESSAGE_TYPE 114 +#define SSL_R_BAD_PACKET_LENGTH 115 +#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116 +#define SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH 316 +#define SSL_R_BAD_RESPONSE_ARGUMENT 117 +#define SSL_R_BAD_RSA_DECRYPT 118 +#define SSL_R_BAD_RSA_ENCRYPT 119 +#define SSL_R_BAD_RSA_E_LENGTH 120 +#define SSL_R_BAD_RSA_MODULUS_LENGTH 121 +#define SSL_R_BAD_RSA_SIGNATURE 122 +#define SSL_R_BAD_SIGNATURE 123 +#define SSL_R_BAD_SRP_A_LENGTH 347 +#define SSL_R_BAD_SRP_B_LENGTH 348 +#define SSL_R_BAD_SRP_G_LENGTH 349 +#define SSL_R_BAD_SRP_N_LENGTH 350 +#define SSL_R_BAD_SRP_S_LENGTH 351 +#define SSL_R_BAD_SRTP_MKI_VALUE 352 +#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353 +#define SSL_R_BAD_SSL_FILETYPE 124 +#define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 +#define SSL_R_BAD_STATE 126 +#define SSL_R_BAD_WRITE_RETRY 127 +#define SSL_R_BIO_NOT_SET 128 +#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129 +#define SSL_R_BN_LIB 130 +#define SSL_R_CA_DN_LENGTH_MISMATCH 131 +#define SSL_R_CA_DN_TOO_LONG 132 +#define SSL_R_CCS_RECEIVED_EARLY 133 +#define SSL_R_CERTIFICATE_VERIFY_FAILED 134 +#define SSL_R_CERT_LENGTH_MISMATCH 135 +#define SSL_R_CHALLENGE_IS_DIFFERENT 136 +#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 +#define SSL_R_CIPHER_COMPRESSION_UNAVAILABLE 371 +#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138 +#define SSL_R_CIPHER_TABLE_SRC_ERROR 139 +#define SSL_R_CLIENTHELLO_TLSEXT 226 +#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 +#define SSL_R_COMPRESSION_DISABLED 343 +#define SSL_R_COMPRESSION_FAILURE 141 +#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307 +#define SSL_R_COMPRESSION_LIBRARY_ERROR 142 +#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143 +#define SSL_R_CONNECTION_TYPE_NOT_SET 144 +#define SSL_R_COOKIE_MISMATCH 308 +#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145 +#define SSL_R_DATA_LENGTH_TOO_LONG 146 +#define SSL_R_DECRYPTION_FAILED 147 +#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281 +#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148 +#define SSL_R_DIGEST_CHECK_FAILED 149 +#define SSL_R_DTLS_MESSAGE_TOO_BIG 334 +#define SSL_R_DUPLICATE_COMPRESSION_ID 309 +#define SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT 317 +#define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318 +#define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322 +#define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323 +#define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310 +#define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354 +#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 +#define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282 +#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 +#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 +#define SSL_R_EXTRA_DATA_IN_MESSAGE 153 +#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 +#define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS 355 +#define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 356 +#define SSL_R_HTTPS_PROXY_REQUEST 155 +#define SSL_R_HTTP_REQUEST 156 +#define SSL_R_ILLEGAL_PADDING 283 +#define SSL_R_INAPPROPRIATE_FALLBACK 373 +#define SSL_R_INCONSISTENT_COMPRESSION 340 +#define SSL_R_INVALID_CHALLENGE_LENGTH 158 +#define SSL_R_INVALID_COMMAND 280 +#define SSL_R_INVALID_COMPRESSION_ALGORITHM 341 +#define SSL_R_INVALID_PURPOSE 278 +#define SSL_R_INVALID_SRP_USERNAME 357 +#define SSL_R_INVALID_STATUS_RESPONSE 328 +#define SSL_R_INVALID_TICKET_KEYS_LENGTH 325 +#define SSL_R_INVALID_TRUST 279 +#define SSL_R_KEY_ARG_TOO_LONG 284 +#define SSL_R_KRB5 285 +#define SSL_R_KRB5_C_CC_PRINC 286 +#define SSL_R_KRB5_C_GET_CRED 287 +#define SSL_R_KRB5_C_INIT 288 +#define SSL_R_KRB5_C_MK_REQ 289 +#define SSL_R_KRB5_S_BAD_TICKET 290 +#define SSL_R_KRB5_S_INIT 291 +#define SSL_R_KRB5_S_RD_REQ 292 +#define SSL_R_KRB5_S_TKT_EXPIRED 293 +#define SSL_R_KRB5_S_TKT_NYV 294 +#define SSL_R_KRB5_S_TKT_SKEW 295 +#define SSL_R_LENGTH_MISMATCH 159 +#define SSL_R_LENGTH_TOO_SHORT 160 +#define SSL_R_LIBRARY_BUG 274 +#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161 +#define SSL_R_MESSAGE_TOO_LONG 296 +#define SSL_R_MISSING_DH_DSA_CERT 162 +#define SSL_R_MISSING_DH_KEY 163 +#define SSL_R_MISSING_DH_RSA_CERT 164 +#define SSL_R_MISSING_DSA_SIGNING_CERT 165 +#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166 +#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167 +#define SSL_R_MISSING_RSA_CERTIFICATE 168 +#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 +#define SSL_R_MISSING_RSA_SIGNING_CERT 170 +#define SSL_R_MISSING_SRP_PARAM 358 +#define SSL_R_MISSING_TMP_DH_KEY 171 +#define SSL_R_MISSING_TMP_ECDH_KEY 311 +#define SSL_R_MISSING_TMP_RSA_KEY 172 +#define SSL_R_MISSING_TMP_RSA_PKEY 173 +#define SSL_R_MISSING_VERIFY_MESSAGE 174 +#define SSL_R_MULTIPLE_SGC_RESTARTS 346 +#define SSL_R_NON_SSLV2_INITIAL_PACKET 175 +#define SSL_R_NO_APPLICATION_PROTOCOL 235 +#define SSL_R_NO_CERTIFICATES_RETURNED 176 +#define SSL_R_NO_CERTIFICATE_ASSIGNED 177 +#define SSL_R_NO_CERTIFICATE_RETURNED 178 +#define SSL_R_NO_CERTIFICATE_SET 179 +#define SSL_R_NO_CERTIFICATE_SPECIFIED 180 +#define SSL_R_NO_CIPHERS_AVAILABLE 181 +#define SSL_R_NO_CIPHERS_PASSED 182 +#define SSL_R_NO_CIPHERS_SPECIFIED 183 +#define SSL_R_NO_CIPHER_LIST 184 +#define SSL_R_NO_CIPHER_MATCH 185 +#define SSL_R_NO_CLIENT_CERT_METHOD 331 +#define SSL_R_NO_CLIENT_CERT_RECEIVED 186 +#define SSL_R_NO_COMPRESSION_SPECIFIED 187 +#define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330 +#define SSL_R_NO_METHOD_SPECIFIED 188 +#define SSL_R_NO_PRIVATEKEY 189 +#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190 +#define SSL_R_NO_PROTOCOLS_AVAILABLE 191 +#define SSL_R_NO_PUBLICKEY 192 +#define SSL_R_NO_RENEGOTIATION 339 +#define SSL_R_NO_REQUIRED_DIGEST 324 +#define SSL_R_NO_SHARED_CIPHER 193 +#define SSL_R_NO_SRTP_PROFILES 359 +#define SSL_R_NO_VERIFY_CALLBACK 194 +#define SSL_R_NULL_SSL_CTX 195 +#define SSL_R_NULL_SSL_METHOD_PASSED 196 +#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 +#define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344 +#define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297 +#define SSL_R_PACKET_LENGTH_TOO_LONG 198 +#define SSL_R_PARSE_TLSEXT 227 +#define SSL_R_PATH_TOO_LONG 270 +#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199 +#define SSL_R_PEER_ERROR 200 +#define SSL_R_PEER_ERROR_CERTIFICATE 201 +#define SSL_R_PEER_ERROR_NO_CERTIFICATE 202 +#define SSL_R_PEER_ERROR_NO_CIPHER 203 +#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204 +#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205 +#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206 +#define SSL_R_PROTOCOL_IS_SHUTDOWN 207 +#define SSL_R_PSK_IDENTITY_NOT_FOUND 223 +#define SSL_R_PSK_NO_CLIENT_CB 224 +#define SSL_R_PSK_NO_SERVER_CB 225 +#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208 +#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209 +#define SSL_R_PUBLIC_KEY_NOT_RSA 210 +#define SSL_R_READ_BIO_NOT_SET 211 +#define SSL_R_READ_TIMEOUT_EXPIRED 312 +#define SSL_R_READ_WRONG_PACKET_TYPE 212 +#define SSL_R_RECORD_LENGTH_MISMATCH 213 +#define SSL_R_RECORD_TOO_LARGE 214 +#define SSL_R_RECORD_TOO_SMALL 298 +#define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335 +#define SSL_R_RENEGOTIATION_ENCODING_ERR 336 +#define SSL_R_RENEGOTIATION_MISMATCH 337 +#define SSL_R_REQUIRED_CIPHER_MISSING 215 +#define SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING 342 +#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216 +#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217 +#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218 +#define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345 +#define SSL_R_SERVERHELLO_TLSEXT 275 +#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 +#define SSL_R_SHORT_READ 219 +#define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 +#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 +#define SSL_R_SRP_A_CALC 361 +#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362 +#define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363 +#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364 +#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 +#define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 +#define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320 +#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300 +#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222 +#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 +#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228 +#define SSL_R_SSL_HANDSHAKE_FAILURE 229 +#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230 +#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301 +#define SSL_R_SSL_SESSION_ID_CONFLICT 302 +#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 +#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303 +#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231 +#define SSL_R_SSL_SESSION_ID_TOO_LONG 408 +#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 +#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086 +#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 +#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 +#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 +#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113 +#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111 +#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 +#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 +#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 +#define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365 +#define SSL_R_TLS_HEARTBEAT_PENDING 366 +#define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367 +#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 +#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 +#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 +#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 +#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 +#define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313 +#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237 +#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238 +#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314 +#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239 +#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240 +#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241 +#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242 +#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 +#define SSL_R_UNEXPECTED_MESSAGE 244 +#define SSL_R_UNEXPECTED_RECORD 245 +#define SSL_R_UNINITIALIZED 276 +#define SSL_R_UNKNOWN_ALERT_TYPE 246 +#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 +#define SSL_R_UNKNOWN_CIPHER_RETURNED 248 +#define SSL_R_UNKNOWN_CIPHER_TYPE 249 +#define SSL_R_UNKNOWN_DIGEST 368 +#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 +#define SSL_R_UNKNOWN_PKEY_TYPE 251 +#define SSL_R_UNKNOWN_PROTOCOL 252 +#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253 +#define SSL_R_UNKNOWN_SSL_VERSION 254 +#define SSL_R_UNKNOWN_STATE 255 +#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338 +#define SSL_R_UNSUPPORTED_CIPHER 256 +#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 +#define SSL_R_UNSUPPORTED_DIGEST_TYPE 326 +#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315 +#define SSL_R_UNSUPPORTED_PROTOCOL 258 +#define SSL_R_UNSUPPORTED_SSL_VERSION 259 +#define SSL_R_UNSUPPORTED_STATUS_TYPE 329 +#define SSL_R_USE_SRTP_NOT_NEGOTIATED 369 +#define SSL_R_WRITE_BIO_NOT_SET 260 +#define SSL_R_WRONG_CIPHER_RETURNED 261 +#define SSL_R_WRONG_CURVE 378 +#define SSL_R_WRONG_MESSAGE_TYPE 262 +#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 +#define SSL_R_WRONG_SIGNATURE_LENGTH 264 +#define SSL_R_WRONG_SIGNATURE_SIZE 265 +#define SSL_R_WRONG_SIGNATURE_TYPE 370 +#define SSL_R_WRONG_SSL_VERSION 266 +#define SSL_R_WRONG_VERSION_NUMBER 267 +#define SSL_R_X509_LIB 268 +#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 +#define SSL_R_PEER_BEHAVING_BADLY 666 +#define SSL_R_UNKNOWN 999 + +/* + * OpenSSL compatible OPENSSL_INIT options + */ + +/* + * These are provided for compatibiliy, but have no effect + * on how LibreSSL is initialized. + */ +#define OPENSSL_INIT_LOAD_SSL_STRINGS _OPENSSL_INIT_FLAG_NOOP +#define OPENSSL_INIT_SSL_DEFAULT _OPENSSL_INIT_FLAG_NOOP + +int OPENSSL_init_ssl(uint64_t opts, const void *settings); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ssl2.h b/code/contrib/libfido2/include/openssl/ssl2.h new file mode 100644 index 0000000..3a8d300 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ssl2.h @@ -0,0 +1,153 @@ +/* $OpenBSD: ssl2.h,v 1.12 2014/12/14 15:30:50 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_SSL2_H +#define HEADER_SSL2_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Protocol Version Codes */ +#define SSL2_VERSION 0x0002 +#define SSL2_VERSION_MAJOR 0x00 +#define SSL2_VERSION_MINOR 0x02 +/* #define SSL2_CLIENT_VERSION 0x0002 */ +/* #define SSL2_SERVER_VERSION 0x0002 */ + +/* Protocol Message Codes */ +#define SSL2_MT_ERROR 0 +#define SSL2_MT_CLIENT_HELLO 1 +#define SSL2_MT_CLIENT_MASTER_KEY 2 +#define SSL2_MT_CLIENT_FINISHED 3 +#define SSL2_MT_SERVER_HELLO 4 +#define SSL2_MT_SERVER_VERIFY 5 +#define SSL2_MT_SERVER_FINISHED 6 +#define SSL2_MT_REQUEST_CERTIFICATE 7 +#define SSL2_MT_CLIENT_CERTIFICATE 8 + +/* Error Message Codes */ +#define SSL2_PE_UNDEFINED_ERROR 0x0000 +#define SSL2_PE_NO_CIPHER 0x0001 +#define SSL2_PE_NO_CERTIFICATE 0x0002 +#define SSL2_PE_BAD_CERTIFICATE 0x0004 +#define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006 + +/* Cipher Kind Values */ +#define SSL2_CK_NULL_WITH_MD5 0x02000000 /* v3 */ +#define SSL2_CK_RC4_128_WITH_MD5 0x02010080 +#define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080 +#define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080 +#define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080 +#define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080 +#define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040 +#define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140 /* v3 */ +#define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0 +#define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0 /* v3 */ +#define SSL2_CK_RC4_64_WITH_MD5 0x02080080 /* MS hack */ + +#define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800 /* SSLeay */ +#define SSL2_CK_NULL 0x02ff0810 /* SSLeay */ + +#define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1" +#define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5" +#define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5" +#define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5" +#define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5" +#define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5" +#define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5" +#define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5" +#define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA" +#define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5" +#define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA" +#define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5" + +#define SSL2_TXT_NULL "NULL" + +/* Flags for the SSL_CIPHER.algorithm2 field */ +#define SSL2_CF_5_BYTE_ENC 0x01 +#define SSL2_CF_8_BYTE_ENC 0x02 + +/* Certificate Type Codes */ +#define SSL2_CT_X509_CERTIFICATE 0x01 + +/* Authentication Type Code */ +#define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01 + +#define SSL2_MAX_SSL_SESSION_ID_LENGTH 32 + +/* Upper/Lower Bounds */ +#define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256 +#define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u /* 2^15-1 */ +#define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383 /* 2^14-1 */ + +#define SSL2_CHALLENGE_LENGTH 16 +/*#define SSL2_CHALLENGE_LENGTH 32 */ +#define SSL2_MIN_CHALLENGE_LENGTH 16 +#define SSL2_MAX_CHALLENGE_LENGTH 32 +#define SSL2_CONNECTION_ID_LENGTH 16 +#define SSL2_MAX_CONNECTION_ID_LENGTH 16 +#define SSL2_SSL_SESSION_ID_LENGTH 16 +#define SSL2_MAX_CERT_CHALLENGE_LENGTH 32 +#define SSL2_MIN_CERT_CHALLENGE_LENGTH 16 +#define SSL2_MAX_KEY_MATERIAL_LENGTH 24 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ssl23.h b/code/contrib/libfido2/include/openssl/ssl23.h new file mode 100644 index 0000000..570e4b0 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ssl23.h @@ -0,0 +1,82 @@ +/* $OpenBSD: ssl23.h,v 1.4 2014/12/14 15:30:50 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_SSL23_H +#define HEADER_SSL23_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*client */ +/* write to server */ +#define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) +#define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) +/* read from server */ +#define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) +#define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) + +/* server */ +/* read from client */ +#define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) +#define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ssl3.h b/code/contrib/libfido2/include/openssl/ssl3.h new file mode 100644 index 0000000..6c6cc2a --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ssl3.h @@ -0,0 +1,455 @@ +/* $OpenBSD: ssl3.h,v 1.57 2021/09/10 14:49:13 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_SSL3_H +#define HEADER_SSL3_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* TLS_EMPTY_RENEGOTIATION_INFO_SCSV from RFC 5746. */ +#define SSL3_CK_SCSV 0x030000FF + +/* TLS_FALLBACK_SCSV from draft-ietf-tls-downgrade-scsv-03. */ +#define SSL3_CK_FALLBACK_SCSV 0x03005600 + +#define SSL3_CK_RSA_NULL_MD5 0x03000001 +#define SSL3_CK_RSA_NULL_SHA 0x03000002 +#define SSL3_CK_RSA_RC4_40_MD5 0x03000003 +#define SSL3_CK_RSA_RC4_128_MD5 0x03000004 +#define SSL3_CK_RSA_RC4_128_SHA 0x03000005 +#define SSL3_CK_RSA_RC2_40_MD5 0x03000006 +#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007 +#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008 +#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009 +#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A + +#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B +#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C +#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D +#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E +#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F +#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010 + +#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011 +#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012 +#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013 +#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014 +#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015 +#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016 + +#define SSL3_CK_ADH_RC4_40_MD5 0x03000017 +#define SSL3_CK_ADH_RC4_128_MD5 0x03000018 +#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019 +#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A +#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B + +/* VRS Additional Kerberos5 entries + */ +#define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E +#define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F +#define SSL3_CK_KRB5_RC4_128_SHA 0x03000020 +#define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021 +#define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022 +#define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023 +#define SSL3_CK_KRB5_RC4_128_MD5 0x03000024 +#define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025 + +#define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026 +#define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027 +#define SSL3_CK_KRB5_RC4_40_SHA 0x03000028 +#define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029 +#define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A +#define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B + +#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5" +#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA" +#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA" +#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5" +#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA" +#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA" + +#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5" +#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5" +#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA" + +#define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA" +#define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA" +#define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA" +#define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA" +#define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5" +#define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5" +#define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5" +#define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5" + +#define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA" +#define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA" +#define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA" +#define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5" +#define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5" +#define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5" + +#define SSL3_SSL_SESSION_ID_LENGTH 32 +#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32 + +#define SSL3_MASTER_SECRET_SIZE 48 +#define SSL3_RANDOM_SIZE 32 +#define SSL3_SEQUENCE_SIZE 8 +#define SSL3_SESSION_ID_SIZE 32 +#define SSL3_CIPHER_VALUE_SIZE 2 + +#define SSL3_RT_HEADER_LENGTH 5 +#define SSL3_HM_HEADER_LENGTH 4 + +#define SSL3_ALIGN_PAYLOAD 8 + +/* This is the maximum MAC (digest) size used by the SSL library. + * Currently maximum of 20 is used by SHA1, but we reserve for + * future extension for 512-bit hashes. + */ + +#define SSL3_RT_MAX_MD_SIZE 64 + +/* Maximum block size used in all ciphersuites. Currently 16 for AES. + */ + +#define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16 + +#define SSL3_RT_MAX_EXTRA (16384) + +/* Maximum plaintext length: defined by SSL/TLS standards */ +#define SSL3_RT_MAX_PLAIN_LENGTH 16384 +/* Maximum compression overhead: defined by SSL/TLS standards */ +#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024 + +/* The standards give a maximum encryption overhead of 1024 bytes. + * In practice the value is lower than this. The overhead is the maximum + * number of padding bytes (256) plus the mac size. + */ +#define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE) + +/* OpenSSL currently only uses a padding length of at most one block so + * the send overhead is smaller. + */ + +#define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \ + (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE) + +/* If compression isn't used don't include the compression overhead */ +#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH +#define SSL3_RT_MAX_ENCRYPTED_LENGTH \ + (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH) +#define SSL3_RT_MAX_PACKET_SIZE \ + (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH) + +#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54" +#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52" + +#define SSL3_VERSION 0x0300 +#define SSL3_VERSION_MAJOR 0x03 +#define SSL3_VERSION_MINOR 0x00 + +#define SSL3_RT_CHANGE_CIPHER_SPEC 20 +#define SSL3_RT_ALERT 21 +#define SSL3_RT_HANDSHAKE 22 +#define SSL3_RT_APPLICATION_DATA 23 + +#define SSL3_AL_WARNING 1 +#define SSL3_AL_FATAL 2 + +#ifndef LIBRESSL_INTERNAL +#define SSL3_AD_CLOSE_NOTIFY 0 +#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */ +#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */ +#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */ +#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */ +#define SSL3_AD_NO_CERTIFICATE 41 +#define SSL3_AD_BAD_CERTIFICATE 42 +#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 +#define SSL3_AD_CERTIFICATE_REVOKED 44 +#define SSL3_AD_CERTIFICATE_EXPIRED 45 +#define SSL3_AD_CERTIFICATE_UNKNOWN 46 +#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */ +#endif + +#define TLS1_HB_REQUEST 1 +#define TLS1_HB_RESPONSE 2 + +#define SSL3_CT_RSA_SIGN 1 +#define SSL3_CT_DSS_SIGN 2 +#define SSL3_CT_RSA_FIXED_DH 3 +#define SSL3_CT_DSS_FIXED_DH 4 +#define SSL3_CT_RSA_EPHEMERAL_DH 5 +#define SSL3_CT_DSS_EPHEMERAL_DH 6 +#define SSL3_CT_FORTEZZA_DMS 20 +/* SSL3_CT_NUMBER is used to size arrays and it must be large + * enough to contain all of the cert types defined either for + * SSLv3 and TLSv1. + */ +#define SSL3_CT_NUMBER 13 + +#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 +#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 +#define TLS1_FLAGS_FREEZE_TRANSCRIPT 0x0020 +#define SSL3_FLAGS_CCS_OK 0x0080 + +/* SSLv3 */ +/*client */ +/* extra state */ +#define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT) +/* write to server */ +#define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT) +#define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT) +/* read from server */ +#define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT) +#define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT) +#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT) +#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT) +#define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT) +#define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT) +#define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT) +#define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT) +/* write to server */ +#define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT) +#define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT) +#define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT) +#define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT) +#define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT) +#define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT) +#define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT) +/* read from server */ +#define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT) +#define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT) +#define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT) +#define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT) +#define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT) +#define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT) + +/* server */ +/* extra state */ +#define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT) +/* read from client */ +/* Do not change the number values, they do matter */ +#define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT) +/* write to client */ +#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT) +#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT) +#define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT) +#define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT) +#define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT) +#define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT) +#define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT) +/* read from client */ +#define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT) +#define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT) +#define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT) +#define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT) +#define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT) +/* write to client */ +#define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT) +#define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT) +#define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT) + +#define SSL3_MT_HELLO_REQUEST 0 +#define SSL3_MT_CLIENT_HELLO 1 +#define SSL3_MT_SERVER_HELLO 2 +#define SSL3_MT_NEWSESSION_TICKET 4 +#define SSL3_MT_CERTIFICATE 11 +#define SSL3_MT_SERVER_KEY_EXCHANGE 12 +#define SSL3_MT_CERTIFICATE_REQUEST 13 +#define SSL3_MT_SERVER_DONE 14 +#define SSL3_MT_CERTIFICATE_VERIFY 15 +#define SSL3_MT_CLIENT_KEY_EXCHANGE 16 +#define SSL3_MT_FINISHED 20 +#define SSL3_MT_CERTIFICATE_STATUS 22 + +#define DTLS1_MT_HELLO_VERIFY_REQUEST 3 + +#define SSL3_MT_CCS 1 + +#ifndef LIBRESSL_INTERNAL +/* These are used when changing over to a new cipher */ +#define SSL3_CC_READ 0x01 +#define SSL3_CC_WRITE 0x02 +#define SSL3_CC_CLIENT 0x10 +#define SSL3_CC_SERVER 0x20 +#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE) +#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ) +#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ) +#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE) +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/stack.h b/code/contrib/libfido2/include/openssl/stack.h new file mode 100644 index 0000000..6bea634 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/stack.h @@ -0,0 +1,107 @@ +/* $OpenBSD: stack.h,v 1.9 2014/06/12 15:49:30 deraadt Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_STACK_H +#define HEADER_STACK_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct stack_st { + int num; + char **data; + int sorted; + + int num_alloc; + int (*comp)(const void *, const void *); +} _STACK; /* Use STACK_OF(...) instead */ + +#define M_sk_num(sk) ((sk) ? (sk)->num:-1) +#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) + +int sk_num(const _STACK *); +void *sk_value(const _STACK *, int); + +void *sk_set(_STACK *, int, void *); + +_STACK *sk_new(int (*cmp)(const void *, const void *)); +_STACK *sk_new_null(void); +void sk_free(_STACK *); +void sk_pop_free(_STACK *st, void (*func)(void *)); +int sk_insert(_STACK *sk, void *data, int where); +void *sk_delete(_STACK *st, int loc); +void *sk_delete_ptr(_STACK *st, void *p); +int sk_find(_STACK *st, void *data); +int sk_find_ex(_STACK *st, void *data); +int sk_push(_STACK *st, void *data); +int sk_unshift(_STACK *st, void *data); +void *sk_shift(_STACK *st); +void *sk_pop(_STACK *st); +void sk_zero(_STACK *st); +int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void *, const void *)))( + const void *, const void *); +_STACK *sk_dup(_STACK *st); +void sk_sort(_STACK *st); +int sk_is_sorted(const _STACK *st); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/tls1.h b/code/contrib/libfido2/include/openssl/tls1.h new file mode 100644 index 0000000..547fb86 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/tls1.h @@ -0,0 +1,773 @@ +/* $OpenBSD: tls1.h,v 1.51 2022/02/05 18:18:18 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * ECC cipher suite support in OpenSSL originally written by + * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. + */ + +#ifndef HEADER_TLS1_H +#define HEADER_TLS1_H + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 + +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLS1_3_VERSION 0x0304 +#endif + +#define TLS1_2_VERSION 0x0303 +#define TLS1_2_VERSION_MAJOR 0x03 +#define TLS1_2_VERSION_MINOR 0x03 + +#define TLS1_1_VERSION 0x0302 +#define TLS1_1_VERSION_MAJOR 0x03 +#define TLS1_1_VERSION_MINOR 0x02 + +#define TLS1_VERSION 0x0301 +#define TLS1_VERSION_MAJOR 0x03 +#define TLS1_VERSION_MINOR 0x01 + +#ifndef LIBRESSL_INTERNAL +#define TLS1_AD_DECRYPTION_FAILED 21 +#define TLS1_AD_RECORD_OVERFLOW 22 +#define TLS1_AD_UNKNOWN_CA 48 /* fatal */ +#define TLS1_AD_ACCESS_DENIED 49 /* fatal */ +#define TLS1_AD_DECODE_ERROR 50 /* fatal */ +#define TLS1_AD_DECRYPT_ERROR 51 +#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */ +#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */ +#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */ +#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */ +/* Code 86 from RFC 7507. */ +#define TLS1_AD_INAPPROPRIATE_FALLBACK 86 /* fatal */ +#define TLS1_AD_USER_CANCELLED 90 +#define TLS1_AD_NO_RENEGOTIATION 100 +/* Codes 110-114 from RFC 3546. */ +#define TLS1_AD_UNSUPPORTED_EXTENSION 110 +#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 +#define TLS1_AD_UNRECOGNIZED_NAME 112 +#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 +#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 +/* Code 115 from RFC 4279. */ +#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ +#endif + +/* + * TLS ExtensionType values. + * + * https://www.iana.org/assignments/tls-extensiontype-values/ + */ + +/* ExtensionType values from RFC 3546, RFC 4366 and RFC 6066. */ +#define TLSEXT_TYPE_server_name 0 +#define TLSEXT_TYPE_max_fragment_length 1 +#define TLSEXT_TYPE_client_certificate_url 2 +#define TLSEXT_TYPE_trusted_ca_keys 3 +#define TLSEXT_TYPE_truncated_hmac 4 +#define TLSEXT_TYPE_status_request 5 + +/* ExtensionType values from RFC 4681. */ +#define TLSEXT_TYPE_user_mapping 6 + +/* ExtensionType values from RFC 5878. */ +#define TLSEXT_TYPE_client_authz 7 +#define TLSEXT_TYPE_server_authz 8 + +/* ExtensionType values from RFC 6091. */ +#define TLSEXT_TYPE_cert_type 9 + +/* ExtensionType values from RFC 7919. */ +#define TLSEXT_TYPE_supported_groups 10 + +/* ExtensionType values from RFC 4492. */ +#ifndef LIBRESSL_INTERNAL +#define TLSEXT_TYPE_elliptic_curves TLSEXT_TYPE_supported_groups +#endif +#define TLSEXT_TYPE_ec_point_formats 11 + +/* ExtensionType value from RFC 5054. */ +#define TLSEXT_TYPE_srp 12 + +/* ExtensionType value from RFC 5246/RFC 8446. */ +#define TLSEXT_TYPE_signature_algorithms 13 + +/* ExtensionType value from RFC 5764. */ +#define TLSEXT_TYPE_use_srtp 14 + +/* ExtensionType value from RFC 5620. */ +#define TLSEXT_TYPE_heartbeat 15 + +/* ExtensionType value from RFC 7301. */ +#define TLSEXT_TYPE_application_layer_protocol_negotiation 16 + +/* ExtensionType value from RFC 7685. */ +#define TLSEXT_TYPE_padding 21 + +/* ExtensionType value from RFC 4507. */ +#define TLSEXT_TYPE_session_ticket 35 + +/* ExtensionType values from RFC 8446 section 4.2 */ +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLSEXT_TYPE_pre_shared_key 41 +#define TLSEXT_TYPE_early_data 42 +#define TLSEXT_TYPE_supported_versions 43 +#define TLSEXT_TYPE_cookie 44 +#define TLSEXT_TYPE_psk_key_exchange_modes 45 +#define TLSEXT_TYPE_certificate_authorities 47 +#define TLSEXT_TYPE_oid_filters 48 +#define TLSEXT_TYPE_post_handshake_auth 49 +#define TLSEXT_TYPE_signature_algorithms_cert 50 +#define TLSEXT_TYPE_key_share 51 +#endif + +/* + * TLS 1.3 extension names from OpenSSL, where they decided to use a different + * name from that given in RFC 8446. + */ +#if defined(LIBRESSL_HAS_TLS1_3) +#define TLSEXT_TYPE_psk TLSEXT_TYPE_pre_shared_key +#define TLSEXT_TYPE_psk_kex_modes TLSEXT_TYPE_psk_key_exchange_modes +#endif + +/* Temporary extension type */ +#define TLSEXT_TYPE_renegotiate 0xff01 + +/* NameType value from RFC 3546. */ +#define TLSEXT_NAMETYPE_host_name 0 +/* status request value from RFC 3546 */ +#define TLSEXT_STATUSTYPE_ocsp 1 + +/* ECPointFormat values from RFC 4492. */ +#define TLSEXT_ECPOINTFORMAT_first 0 +#define TLSEXT_ECPOINTFORMAT_uncompressed 0 +#define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 +#define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 +#define TLSEXT_ECPOINTFORMAT_last 2 + +#define TLSEXT_MAXLEN_host_name 255 + +const char *SSL_get_servername(const SSL *s, const int type); +int SSL_get_servername_type(const SSL *s); +/* SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) + * + * It returns 1 on success and zero otherwise. + */ +int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, + const char *label, size_t llen, const unsigned char *p, size_t plen, + int use_context); + +#define SSL_set_tlsext_host_name(s,name) \ +SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) + +#define SSL_set_tlsext_debug_callback(ssl, cb) \ +SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb) + +#define SSL_set_tlsext_debug_arg(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg) + +#define SSL_get_tlsext_status_type(ssl) \ +SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE, 0, NULL) + +#define SSL_set_tlsext_status_type(ssl, type) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL) + +#define SSL_get_tlsext_status_exts(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) + +#define SSL_set_tlsext_status_exts(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) + +#define SSL_get_tlsext_status_ids(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) + +#define SSL_set_tlsext_status_ids(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) + +#define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg) + +#define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg) + +#define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ +SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb) + +#define SSL_TLSEXT_ERR_OK 0 +#define SSL_TLSEXT_ERR_ALERT_WARNING 1 +#define SSL_TLSEXT_ERR_ALERT_FATAL 2 +#define SSL_TLSEXT_ERR_NOACK 3 + +#define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ +SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg) + +#define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLSEXT_TICKET_KEYS,(keylen),(keys)) +#define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys)) + +#define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ +SSL_CTX_callback_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) +#define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ +SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) + +#define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ +SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,(void *)arg) +#define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ +SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,(void *)arg) + +#define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ +SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) + +/* PSK ciphersuites from RFC 4279. */ +#define TLS1_CK_PSK_WITH_RC4_128_SHA 0x0300008A +#define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008B +#define TLS1_CK_PSK_WITH_AES_128_CBC_SHA 0x0300008C +#define TLS1_CK_PSK_WITH_AES_256_CBC_SHA 0x0300008D + +/* Additional TLS ciphersuites from expired Internet Draft + * draft-ietf-tls-56-bit-ciphersuites-01.txt + * (available if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see + * s3_lib.c). We actually treat them like SSL 3.0 ciphers, which we probably + * shouldn't. Note that the first two are actually not in the IDs. */ +#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060 /* not in ID */ +#define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061 /* not in ID */ +#define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062 +#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063 +#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064 +#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065 +#define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 + +/* AES ciphersuites from RFC 3268. */ + +#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032 +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033 +#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034 + +#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038 +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 +#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A + +/* TLS v1.2 ciphersuites */ +#define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B +#define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C +#define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040 + +/* Camellia ciphersuites from RFC 4132. */ +#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 +#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 + +/* TLS v1.2 ciphersuites */ +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B +#define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C +#define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D + +/* Camellia ciphersuites from RFC 4132. */ +#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088 +#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089 + +/* SEED ciphersuites from RFC 4162. */ +#define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096 +#define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097 +#define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098 +#define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099 +#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A +#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B + +/* TLS v1.2 GCM ciphersuites from RFC 5288. */ +#define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C +#define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D +#define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E +#define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F +#define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0 +#define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1 +#define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2 +#define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3 +#define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4 +#define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5 +#define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6 +#define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7 + +/* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */ +#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BA +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 0x030000BB +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BC +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 0x030000BD +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BE +#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256 0x030000BF + +#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C0 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 0x030000C1 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C2 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 0x030000C3 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C4 +#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256 0x030000C5 + +/* TLS 1.3 cipher suites from RFC 8446 appendix B.4. */ +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLS1_3_CK_AES_128_GCM_SHA256 0x03001301 +#define TLS1_3_CK_AES_256_GCM_SHA384 0x03001302 +#define TLS1_3_CK_CHACHA20_POLY1305_SHA256 0x03001303 +#define TLS1_3_CK_AES_128_CCM_SHA256 0x03001304 +#define TLS1_3_CK_AES_128_CCM_8_SHA256 0x03001305 +#endif + +/* ECC ciphersuites from RFC 4492. */ +#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 +#define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 +#define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005 + +#define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006 +#define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007 +#define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A + +#define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B +#define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C +#define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D +#define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E +#define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F + +#define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010 +#define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011 +#define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014 + +#define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015 +#define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016 +#define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017 +#define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 +#define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 + +/* SRP ciphersuites from RFC 5054. */ +#define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A +#define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B +#define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C +#define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D +#define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E +#define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F +#define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020 +#define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021 +#define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022 + +/* ECDH HMAC based ciphersuites from RFC 5289. */ +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028 +#define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029 +#define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A + +/* ECDH GCM based ciphersuites from RFC 5289. */ +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030 +#define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031 +#define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032 + +/* ChaCha20-Poly1305 based ciphersuites. */ +#define TLS1_CK_ECDHE_RSA_CHACHA20_POLY1305 0x0300CCA8 +#define TLS1_CK_ECDHE_ECDSA_CHACHA20_POLY1305 0x0300CCA9 +#define TLS1_CK_DHE_RSA_CHACHA20_POLY1305 0x0300CCAA + +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5" +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5" +#define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA" +#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA" +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA" +#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA" +#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA" + +/* AES ciphersuites from RFC 3268. */ +#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA" +#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA" + +#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" +#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" + +/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ +#define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA" + +#define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA" +#define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA" +#define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA" + +/* PSK ciphersuites from RFC 4279. */ +#define TLS1_TXT_PSK_WITH_RC4_128_SHA "PSK-RC4-SHA" +#define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA "PSK-3DES-EDE-CBC-SHA" +#define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA" +#define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA" + +/* SRP ciphersuite from RFC 5054. */ +#define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA" + +/* Camellia ciphersuites from RFC 4132. */ +#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA" + +#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA" + +/* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */ +#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256 "CAMELLIA128-SHA256" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 "DH-DSS-CAMELLIA128-SHA256" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 "DH-RSA-CAMELLIA128-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 "DHE-DSS-CAMELLIA128-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 "DHE-RSA-CAMELLIA128-SHA256" +#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256 "ADH-CAMELLIA128-SHA256" + +#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256 "CAMELLIA256-SHA256" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 "DH-DSS-CAMELLIA256-SHA256" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 "DH-RSA-CAMELLIA256-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 "DHE-DSS-CAMELLIA256-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 "DHE-RSA-CAMELLIA256-SHA256" +#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256 "ADH-CAMELLIA256-SHA256" + +/* SEED ciphersuites from RFC 4162. */ +#define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA" +#define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA" +#define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA" +#define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA" +#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" +#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" + +/* TLS v1.2 ciphersuites. */ +#define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256" +#define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256" +#define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256" +#define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256" +#define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256" + +/* TLS v1.2 GCM ciphersuites from RFC 5288. */ +#define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256" +#define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384" +#define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384" +#define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256" +#define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" + +/* ECDH HMAC based ciphersuites from RFC 5289. */ +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384" + +/* ECDH GCM based ciphersuites from RFC 5289. */ +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384" + +/* ChaCha20-Poly1305 based ciphersuites. */ +#define TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305 "ECDHE-RSA-CHACHA20-POLY1305" +#define TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 "ECDHE-ECDSA-CHACHA20-POLY1305" +#define TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305 "DHE-RSA-CHACHA20-POLY1305" + +/* TLS 1.3 cipher suites from RFC 8446 appendix B.4. */ +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +#define TLS1_3_TXT_AES_128_GCM_SHA256 "AEAD-AES128-GCM-SHA256" +#define TLS1_3_TXT_AES_256_GCM_SHA384 "AEAD-AES256-GCM-SHA384" +#define TLS1_3_TXT_CHACHA20_POLY1305_SHA256 "AEAD-CHACHA20-POLY1305-SHA256" +#define TLS1_3_TXT_AES_128_CCM_SHA256 "AEAD-AES128-CCM-SHA256" +#define TLS1_3_TXT_AES_128_CCM_8_SHA256 "AEAD-AES128-CCM-8-SHA256" + +#define TLS1_3_RFC_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" +#define TLS1_3_RFC_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" +#define TLS1_3_RFC_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" +#define TLS1_3_RFC_AES_128_CCM_SHA256 "TLS_AES_128_CCM_SHA256" +#define TLS1_3_RFC_AES_128_CCM_8_SHA256 "TLS_AES_128_CCM_8_SHA256" +#endif + +#define TLS_CT_RSA_SIGN 1 +#define TLS_CT_DSS_SIGN 2 +#define TLS_CT_RSA_FIXED_DH 3 +#define TLS_CT_DSS_FIXED_DH 4 +#define TLS_CT_GOST94_SIGN 21 +#define TLS_CT_GOST01_SIGN 22 +#define TLS_CT_ECDSA_SIGN 64 +#define TLS_CT_RSA_FIXED_ECDH 65 +#define TLS_CT_ECDSA_FIXED_ECDH 66 +#define TLS_CT_GOST12_256_SIGN 67 +#define TLS_CT_GOST12_512_SIGN 68 +#define TLS_CT_GOST12_256_SIGN_COMPAT 238 /* pre-IANA, for compat */ +#define TLS_CT_GOST12_512_SIGN_COMPAT 239 /* pre-IANA, for compat */ +/* when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see + * comment there) */ +#define TLS_CT_NUMBER 13 + +#define TLS1_FINISH_MAC_LENGTH 12 + +#define TLS_MD_MAX_CONST_SIZE 20 +#define TLS_MD_CLIENT_FINISH_CONST "client finished" +#define TLS_MD_CLIENT_FINISH_CONST_SIZE 15 +#define TLS_MD_SERVER_FINISH_CONST "server finished" +#define TLS_MD_SERVER_FINISH_CONST_SIZE 15 +#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" +#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 +#define TLS_MD_KEY_EXPANSION_CONST "key expansion" +#define TLS_MD_KEY_EXPANSION_CONST_SIZE 13 +#define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key" +#define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16 +#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" +#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 +#define TLS_MD_IV_BLOCK_CONST "IV block" +#define TLS_MD_IV_BLOCK_CONST_SIZE 8 +#define TLS_MD_MASTER_SECRET_CONST "master secret" +#define TLS_MD_MASTER_SECRET_CONST_SIZE 13 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ts.h b/code/contrib/libfido2/include/openssl/ts.h new file mode 100644 index 0000000..fa8eb94 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ts.h @@ -0,0 +1,837 @@ +/* $OpenBSD: ts.h,v 1.10 2018/05/13 15:35:46 tb Exp $ */ +/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL + * project 2002, 2003, 2004. + */ +/* ==================================================================== + * Copyright (c) 2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_TS_H +#define HEADER_TS_H + +#include + +#ifndef OPENSSL_NO_BUFFER +#include +#endif +#ifndef OPENSSL_NO_EVP +#include +#endif +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include +#include + +#ifndef OPENSSL_NO_RSA +#include +#endif + +#ifndef OPENSSL_NO_DSA +#include +#endif + +#ifndef OPENSSL_NO_DH +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* +MessageImprint ::= SEQUENCE { + hashAlgorithm AlgorithmIdentifier, + hashedMessage OCTET STRING } +*/ + +typedef struct TS_msg_imprint_st { + X509_ALGOR *hash_algo; + ASN1_OCTET_STRING *hashed_msg; +} TS_MSG_IMPRINT; + +/* +TimeStampReq ::= SEQUENCE { + version INTEGER { v1(1) }, + messageImprint MessageImprint, + --a hash algorithm OID and the hash value of the data to be + --time-stamped + reqPolicy TSAPolicyId OPTIONAL, + nonce INTEGER OPTIONAL, + certReq BOOLEAN DEFAULT FALSE, + extensions [0] IMPLICIT Extensions OPTIONAL } +*/ + +typedef struct TS_req_st { + ASN1_INTEGER *version; + TS_MSG_IMPRINT *msg_imprint; + ASN1_OBJECT *policy_id; /* OPTIONAL */ + ASN1_INTEGER *nonce; /* OPTIONAL */ + ASN1_BOOLEAN cert_req; /* DEFAULT FALSE */ + STACK_OF(X509_EXTENSION) *extensions; /* [0] OPTIONAL */ +} TS_REQ; + +/* +Accuracy ::= SEQUENCE { + seconds INTEGER OPTIONAL, + millis [0] INTEGER (1..999) OPTIONAL, + micros [1] INTEGER (1..999) OPTIONAL } +*/ + +typedef struct TS_accuracy_st { + ASN1_INTEGER *seconds; + ASN1_INTEGER *millis; + ASN1_INTEGER *micros; +} TS_ACCURACY; + +/* +TSTInfo ::= SEQUENCE { + version INTEGER { v1(1) }, + policy TSAPolicyId, + messageImprint MessageImprint, + -- MUST have the same value as the similar field in + -- TimeStampReq + serialNumber INTEGER, + -- Time-Stamping users MUST be ready to accommodate integers + -- up to 160 bits. + genTime GeneralizedTime, + accuracy Accuracy OPTIONAL, + ordering BOOLEAN DEFAULT FALSE, + nonce INTEGER OPTIONAL, + -- MUST be present if the similar field was present + -- in TimeStampReq. In that case it MUST have the same value. + tsa [0] GeneralName OPTIONAL, + extensions [1] IMPLICIT Extensions OPTIONAL } +*/ + +typedef struct TS_tst_info_st { + ASN1_INTEGER *version; + ASN1_OBJECT *policy_id; + TS_MSG_IMPRINT *msg_imprint; + ASN1_INTEGER *serial; + ASN1_GENERALIZEDTIME *time; + TS_ACCURACY *accuracy; + ASN1_BOOLEAN ordering; + ASN1_INTEGER *nonce; + GENERAL_NAME *tsa; + STACK_OF(X509_EXTENSION) *extensions; +} TS_TST_INFO; + +/* +PKIStatusInfo ::= SEQUENCE { + status PKIStatus, + statusString PKIFreeText OPTIONAL, + failInfo PKIFailureInfo OPTIONAL } + +From RFC 1510 - section 3.1.1: +PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String + -- text encoded as UTF-8 String (note: each UTF8String SHOULD + -- include an RFC 1766 language tag to indicate the language + -- of the contained text) +*/ + +/* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */ + +#define TS_STATUS_GRANTED 0 +#define TS_STATUS_GRANTED_WITH_MODS 1 +#define TS_STATUS_REJECTION 2 +#define TS_STATUS_WAITING 3 +#define TS_STATUS_REVOCATION_WARNING 4 +#define TS_STATUS_REVOCATION_NOTIFICATION 5 + +/* Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c */ + +#define TS_INFO_BAD_ALG 0 +#define TS_INFO_BAD_REQUEST 2 +#define TS_INFO_BAD_DATA_FORMAT 5 +#define TS_INFO_TIME_NOT_AVAILABLE 14 +#define TS_INFO_UNACCEPTED_POLICY 15 +#define TS_INFO_UNACCEPTED_EXTENSION 16 +#define TS_INFO_ADD_INFO_NOT_AVAILABLE 17 +#define TS_INFO_SYSTEM_FAILURE 25 + +typedef struct TS_status_info_st { + ASN1_INTEGER *status; + STACK_OF(ASN1_UTF8STRING) *text; + ASN1_BIT_STRING *failure_info; +} TS_STATUS_INFO; + +DECLARE_STACK_OF(ASN1_UTF8STRING) + +/* +TimeStampResp ::= SEQUENCE { + status PKIStatusInfo, + timeStampToken TimeStampToken OPTIONAL } +*/ + +typedef struct TS_resp_st { + TS_STATUS_INFO *status_info; + PKCS7 *token; + TS_TST_INFO *tst_info; +} TS_RESP; + +/* The structure below would belong to the ESS component. */ + +/* +IssuerSerial ::= SEQUENCE { + issuer GeneralNames, + serialNumber CertificateSerialNumber + } +*/ + +typedef struct ESS_issuer_serial { + STACK_OF(GENERAL_NAME) *issuer; + ASN1_INTEGER *serial; +} ESS_ISSUER_SERIAL; + +/* +ESSCertID ::= SEQUENCE { + certHash Hash, + issuerSerial IssuerSerial OPTIONAL +} +*/ + +typedef struct ESS_cert_id { + ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */ + ESS_ISSUER_SERIAL *issuer_serial; +} ESS_CERT_ID; + +DECLARE_STACK_OF(ESS_CERT_ID) + +/* +SigningCertificate ::= SEQUENCE { + certs SEQUENCE OF ESSCertID, + policies SEQUENCE OF PolicyInformation OPTIONAL +} +*/ + +typedef struct ESS_signing_cert { + STACK_OF(ESS_CERT_ID) *cert_ids; + STACK_OF(POLICYINFO) *policy_info; +} ESS_SIGNING_CERT; + + +TS_REQ *TS_REQ_new(void); +void TS_REQ_free(TS_REQ *a); +int i2d_TS_REQ(const TS_REQ *a, unsigned char **pp); +TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length); + +TS_REQ *TS_REQ_dup(TS_REQ *a); + +TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a); +int i2d_TS_REQ_fp(FILE *fp, TS_REQ *a); +TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a); +int i2d_TS_REQ_bio(BIO *fp, TS_REQ *a); + +TS_MSG_IMPRINT *TS_MSG_IMPRINT_new(void); +void TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a); +int i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp); +TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a, + const unsigned char **pp, long length); + +TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a); + +TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a); +int i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a); +TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT **a); +int i2d_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT *a); + +TS_RESP *TS_RESP_new(void); +void TS_RESP_free(TS_RESP *a); +int i2d_TS_RESP(const TS_RESP *a, unsigned char **pp); +TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length); +TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token); +TS_RESP *TS_RESP_dup(TS_RESP *a); + +TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a); +int i2d_TS_RESP_fp(FILE *fp, TS_RESP *a); +TS_RESP *d2i_TS_RESP_bio(BIO *fp, TS_RESP **a); +int i2d_TS_RESP_bio(BIO *fp, TS_RESP *a); + +TS_STATUS_INFO *TS_STATUS_INFO_new(void); +void TS_STATUS_INFO_free(TS_STATUS_INFO *a); +int i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp); +TS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a, + const unsigned char **pp, long length); +TS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a); + +TS_TST_INFO *TS_TST_INFO_new(void); +void TS_TST_INFO_free(TS_TST_INFO *a); +int i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp); +TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp, + long length); +TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a); + +TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a); +int i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a); +TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO **a); +int i2d_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO *a); + +TS_ACCURACY *TS_ACCURACY_new(void); +void TS_ACCURACY_free(TS_ACCURACY *a); +int i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp); +TS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp, + long length); +TS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a); + +ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void); +void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a); +int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, + unsigned char **pp); +ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a, + const unsigned char **pp, long length); +ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a); + +ESS_CERT_ID *ESS_CERT_ID_new(void); +void ESS_CERT_ID_free(ESS_CERT_ID *a); +int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp); +ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp, + long length); +ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a); + +ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void); +void ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a); +int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, + unsigned char **pp); +ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a, + const unsigned char **pp, long length); +ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a); + +void ERR_load_TS_strings(void); + +int TS_REQ_set_version(TS_REQ *a, long version); +long TS_REQ_get_version(const TS_REQ *a); + +int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint); +TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a); + +int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg); +X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a); + +int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len); +ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a); + +int TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy); +ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a); + +int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce); +const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a); + +int TS_REQ_set_cert_req(TS_REQ *a, int cert_req); +int TS_REQ_get_cert_req(const TS_REQ *a); + +STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); +void TS_REQ_ext_free(TS_REQ *a); +int TS_REQ_get_ext_count(TS_REQ *a); +int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos); +int TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos); +int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos); +X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc); +X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc); +int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc); +void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx); + +/* Function declarations for TS_REQ defined in ts/ts_req_print.c */ + +int TS_REQ_print_bio(BIO *bio, TS_REQ *a); + +/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ + +int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info); +TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a); + +/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ +void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info); +PKCS7 *TS_RESP_get_token(TS_RESP *a); +TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a); + +int TS_TST_INFO_set_version(TS_TST_INFO *a, long version); +long TS_TST_INFO_get_version(const TS_TST_INFO *a); + +int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id); +ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a); + +int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint); +TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a); + +int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial); +const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a); + +int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime); +const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a); + +int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy); +TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a); + +int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds); +const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a); + +int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis); +const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a); + +int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros); +const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a); + +int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering); +int TS_TST_INFO_get_ordering(const TS_TST_INFO *a); + +int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce); +const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a); + +int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa); +GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a); + +STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); +void TS_TST_INFO_ext_free(TS_TST_INFO *a); +int TS_TST_INFO_get_ext_count(TS_TST_INFO *a); +int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos); +int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj, + int lastpos); +int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos); +X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc); +X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc); +int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc); +void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx); + +/* Declarations related to response generation, defined in ts/ts_resp_sign.c. */ + +/* Optional flags for response generation. */ + +/* Don't include the TSA name in response. */ +#define TS_TSA_NAME 0x01 + +/* Set ordering to true in response. */ +#define TS_ORDERING 0x02 + +/* + * Include the signer certificate and the other specified certificates in + * the ESS signing certificate attribute beside the PKCS7 signed data. + * Only the signer certificates is included by default. + */ +#define TS_ESS_CERT_ID_CHAIN 0x04 + +/* Forward declaration. */ +struct TS_resp_ctx; + +/* This must return a unique number less than 160 bits long. */ +typedef ASN1_INTEGER *(*TS_serial_cb)(struct TS_resp_ctx *, void *); + +/* This must return the seconds and microseconds since Jan 1, 1970 in + the sec and usec variables allocated by the caller. + Return non-zero for success and zero for failure. */ +typedef int (*TS_time_cb)(struct TS_resp_ctx *, void *, time_t *sec, long *usec); + +/* This must process the given extension. + * It can modify the TS_TST_INFO object of the context. + * Return values: !0 (processed), 0 (error, it must set the + * status info/failure info of the response). + */ +typedef int (*TS_extension_cb)(struct TS_resp_ctx *, X509_EXTENSION *, void *); + +typedef struct TS_resp_ctx { + X509 *signer_cert; + EVP_PKEY *signer_key; + STACK_OF(X509) *certs; /* Certs to include in signed data. */ + STACK_OF(ASN1_OBJECT) *policies; /* Acceptable policies. */ + ASN1_OBJECT *default_policy; /* It may appear in policies, too. */ + STACK_OF(EVP_MD) *mds; /* Acceptable message digests. */ + ASN1_INTEGER *seconds; /* accuracy, 0 means not specified. */ + ASN1_INTEGER *millis; /* accuracy, 0 means not specified. */ + ASN1_INTEGER *micros; /* accuracy, 0 means not specified. */ + unsigned clock_precision_digits; /* fraction of seconds in + time stamp token. */ + unsigned flags; /* Optional info, see values above. */ + + /* Callback functions. */ + TS_serial_cb serial_cb; + void *serial_cb_data; /* User data for serial_cb. */ + + TS_time_cb time_cb; + void *time_cb_data; /* User data for time_cb. */ + + TS_extension_cb extension_cb; + void *extension_cb_data; /* User data for extension_cb. */ + + /* These members are used only while creating the response. */ + TS_REQ *request; + TS_RESP *response; + TS_TST_INFO *tst_info; +} TS_RESP_CTX; + +DECLARE_STACK_OF(EVP_MD) + +/* Creates a response context that can be used for generating responses. */ +TS_RESP_CTX *TS_RESP_CTX_new(void); +void TS_RESP_CTX_free(TS_RESP_CTX *ctx); + +/* This parameter must be set. */ +int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer); + +/* This parameter must be set. */ +int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key); + +/* This parameter must be set. */ +int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *def_policy); + +/* No additional certs are included in the response by default. */ +int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); + +/* Adds a new acceptable policy, only the default policy + is accepted by default. */ +int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy); + +/* Adds a new acceptable message digest. Note that no message digests + are accepted by default. The md argument is shared with the caller. */ +int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md); + +/* Accuracy is not included by default. */ +int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx, + int secs, int millis, int micros); + +/* Clock precision digits, i.e. the number of decimal digits: + '0' means sec, '3' msec, '6' usec, and so on. Default is 0. */ +int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx, + unsigned clock_precision_digits); +/* At most we accept usec precision. */ +#define TS_MAX_CLOCK_PRECISION_DIGITS 6 + +/* No flags are set by default. */ +void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags); + +/* Default callback always returns a constant. */ +void TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data); + +/* Default callback rejects all extensions. The extension callback is called + * when the TS_TST_INFO object is already set up and not signed yet. */ +/* FIXME: extension handling is not tested yet. */ +void TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx, + TS_extension_cb cb, void *data); + +/* The following methods can be used in the callbacks. */ +int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx, + int status, const char *text); + +/* Sets the status info only if it is still TS_STATUS_GRANTED. */ +int TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx, + int status, const char *text); + +int TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure); + +/* The get methods below can be used in the extension callback. */ +TS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx); + +TS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx); + +/* + * Creates the signed TS_TST_INFO and puts it in TS_RESP. + * In case of errors it sets the status info properly. + * Returns NULL only in case of memory allocation/fatal error. + */ +TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio); + +/* + * Declarations related to response verification, + * they are defined in ts/ts_resp_verify.c. + */ + +int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, + X509_STORE *store, X509 **signer_out); + +/* Context structure for the generic verify method. */ + +/* Verify the signer's certificate and the signature of the response. */ +#define TS_VFY_SIGNATURE (1u << 0) +/* Verify the version number of the response. */ +#define TS_VFY_VERSION (1u << 1) +/* Verify if the policy supplied by the user matches the policy of the TSA. */ +#define TS_VFY_POLICY (1u << 2) +/* Verify the message imprint provided by the user. This flag should not be + specified with TS_VFY_DATA. */ +#define TS_VFY_IMPRINT (1u << 3) +/* Verify the message imprint computed by the verify method from the user + provided data and the MD algorithm of the response. This flag should not be + specified with TS_VFY_IMPRINT. */ +#define TS_VFY_DATA (1u << 4) +/* Verify the nonce value. */ +#define TS_VFY_NONCE (1u << 5) +/* Verify if the TSA name field matches the signer certificate. */ +#define TS_VFY_SIGNER (1u << 6) +/* Verify if the TSA name field equals to the user provided name. */ +#define TS_VFY_TSA_NAME (1u << 7) + +/* You can use the following convenience constants. */ +#define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \ + | TS_VFY_VERSION \ + | TS_VFY_POLICY \ + | TS_VFY_IMPRINT \ + | TS_VFY_NONCE \ + | TS_VFY_SIGNER \ + | TS_VFY_TSA_NAME) +#define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \ + | TS_VFY_VERSION \ + | TS_VFY_POLICY \ + | TS_VFY_DATA \ + | TS_VFY_NONCE \ + | TS_VFY_SIGNER \ + | TS_VFY_TSA_NAME) + +typedef struct TS_verify_ctx { + /* Set this to the union of TS_VFY_... flags you want to carry out. */ + unsigned flags; + + /* Must be set only with TS_VFY_SIGNATURE. certs is optional. */ + X509_STORE *store; + STACK_OF(X509) *certs; + + /* Must be set only with TS_VFY_POLICY. */ + ASN1_OBJECT *policy; + + /* Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, + the algorithm from the response is used. */ + X509_ALGOR *md_alg; + unsigned char *imprint; + unsigned imprint_len; + + /* Must be set only with TS_VFY_DATA. */ + BIO *data; + + /* Must be set only with TS_VFY_TSA_NAME. */ + ASN1_INTEGER *nonce; + + /* Must be set only with TS_VFY_TSA_NAME. */ + GENERAL_NAME *tsa_name; +} TS_VERIFY_CTX; + +int TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response); +int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token); + +/* + * Declarations related to response verification context, + * they are defined in ts/ts_verify_ctx.c. + */ + +/* Set all fields to zero. */ +TS_VERIFY_CTX *TS_VERIFY_CTX_new(void); +void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx); +void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx); +void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx); + +/* + * If ctx is NULL, it allocates and returns a new object, otherwise + * it returns ctx. It initialises all the members as follows: + * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) + * certs = NULL + * store = NULL + * policy = policy from the request or NULL if absent (in this case + * TS_VFY_POLICY is cleared from flags as well) + * md_alg = MD algorithm from request + * imprint, imprint_len = imprint from request + * data = NULL + * nonce, nonce_len = nonce from the request or NULL if absent (in this case + * TS_VFY_NONCE is cleared from flags as well) + * tsa_name = NULL + * Important: after calling this method TS_VFY_SIGNATURE should be added! + */ +TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx); + +/* Function declarations for TS_RESP defined in ts/ts_resp_print.c */ + +int TS_RESP_print_bio(BIO *bio, TS_RESP *a); +int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a); +int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a); + +/* Common utility functions defined in ts/ts_lib.c */ + +int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num); +int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj); +int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions); +int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg); +int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg); + +/* Function declarations for handling configuration options, + defined in ts/ts_conf.c */ + +X509 *TS_CONF_load_cert(const char *file); +STACK_OF(X509) *TS_CONF_load_certs(const char *file); +EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass); +const char *TS_CONF_get_tsa_section(CONF *conf, const char *section); +int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb, + TS_RESP_CTX *ctx); +int TS_CONF_set_crypto_device(CONF *conf, const char *section, + const char *device); +int TS_CONF_set_default_engine(const char *name); +int TS_CONF_set_signer_cert(CONF *conf, const char *section, + const char *cert, TS_RESP_CTX *ctx); +int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs, + TS_RESP_CTX *ctx); +int TS_CONF_set_signer_key(CONF *conf, const char *section, + const char *key, const char *pass, TS_RESP_CTX *ctx); +int TS_CONF_set_def_policy(CONF *conf, const char *section, + const char *policy, TS_RESP_CTX *ctx); +int TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_digests(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_clock_precision_digits(CONF *conf, const char *section, + TS_RESP_CTX *ctx); +int TS_CONF_set_ordering(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_tsa_name(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_ess_cert_id_chain(CONF *conf, const char *section, + TS_RESP_CTX *ctx); + +/* -------------------------------------------------- */ +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_TS_strings(void); + +/* Error codes for the TS functions. */ + +/* Function codes. */ +#define TS_F_D2I_TS_RESP 147 +#define TS_F_DEF_SERIAL_CB 110 +#define TS_F_DEF_TIME_CB 111 +#define TS_F_ESS_ADD_SIGNING_CERT 112 +#define TS_F_ESS_CERT_ID_NEW_INIT 113 +#define TS_F_ESS_SIGNING_CERT_NEW_INIT 114 +#define TS_F_INT_TS_RESP_VERIFY_TOKEN 149 +#define TS_F_PKCS7_TO_TS_TST_INFO 148 +#define TS_F_TS_ACCURACY_SET_MICROS 115 +#define TS_F_TS_ACCURACY_SET_MILLIS 116 +#define TS_F_TS_ACCURACY_SET_SECONDS 117 +#define TS_F_TS_CHECK_IMPRINTS 100 +#define TS_F_TS_CHECK_NONCES 101 +#define TS_F_TS_CHECK_POLICY 102 +#define TS_F_TS_CHECK_SIGNING_CERTS 103 +#define TS_F_TS_CHECK_STATUS_INFO 104 +#define TS_F_TS_COMPUTE_IMPRINT 145 +#define TS_F_TS_CONF_SET_DEFAULT_ENGINE 146 +#define TS_F_TS_GET_STATUS_TEXT 105 +#define TS_F_TS_MSG_IMPRINT_SET_ALGO 118 +#define TS_F_TS_REQ_SET_MSG_IMPRINT 119 +#define TS_F_TS_REQ_SET_NONCE 120 +#define TS_F_TS_REQ_SET_POLICY_ID 121 +#define TS_F_TS_RESP_CREATE_RESPONSE 122 +#define TS_F_TS_RESP_CREATE_TST_INFO 123 +#define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 124 +#define TS_F_TS_RESP_CTX_ADD_MD 125 +#define TS_F_TS_RESP_CTX_ADD_POLICY 126 +#define TS_F_TS_RESP_CTX_NEW 127 +#define TS_F_TS_RESP_CTX_SET_ACCURACY 128 +#define TS_F_TS_RESP_CTX_SET_CERTS 129 +#define TS_F_TS_RESP_CTX_SET_DEF_POLICY 130 +#define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 131 +#define TS_F_TS_RESP_CTX_SET_STATUS_INFO 132 +#define TS_F_TS_RESP_GET_POLICY 133 +#define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 134 +#define TS_F_TS_RESP_SET_STATUS_INFO 135 +#define TS_F_TS_RESP_SET_TST_INFO 150 +#define TS_F_TS_RESP_SIGN 136 +#define TS_F_TS_RESP_VERIFY_SIGNATURE 106 +#define TS_F_TS_RESP_VERIFY_TOKEN 107 +#define TS_F_TS_TST_INFO_SET_ACCURACY 137 +#define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 138 +#define TS_F_TS_TST_INFO_SET_NONCE 139 +#define TS_F_TS_TST_INFO_SET_POLICY_ID 140 +#define TS_F_TS_TST_INFO_SET_SERIAL 141 +#define TS_F_TS_TST_INFO_SET_TIME 142 +#define TS_F_TS_TST_INFO_SET_TSA 143 +#define TS_F_TS_VERIFY 108 +#define TS_F_TS_VERIFY_CERT 109 +#define TS_F_TS_VERIFY_CTX_NEW 144 + +/* Reason codes. */ +#define TS_R_BAD_PKCS7_TYPE 132 +#define TS_R_BAD_TYPE 133 +#define TS_R_CERTIFICATE_VERIFY_ERROR 100 +#define TS_R_COULD_NOT_SET_ENGINE 127 +#define TS_R_COULD_NOT_SET_TIME 115 +#define TS_R_D2I_TS_RESP_INT_FAILED 128 +#define TS_R_DETACHED_CONTENT 134 +#define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116 +#define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101 +#define TS_R_INVALID_NULL_POINTER 102 +#define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117 +#define TS_R_MESSAGE_IMPRINT_MISMATCH 103 +#define TS_R_NONCE_MISMATCH 104 +#define TS_R_NONCE_NOT_RETURNED 105 +#define TS_R_NO_CONTENT 106 +#define TS_R_NO_TIME_STAMP_TOKEN 107 +#define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118 +#define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119 +#define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129 +#define TS_R_POLICY_MISMATCH 108 +#define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120 +#define TS_R_RESPONSE_SETUP_ERROR 121 +#define TS_R_SIGNATURE_FAILURE 109 +#define TS_R_THERE_MUST_BE_ONE_SIGNER 110 +#define TS_R_TIME_SYSCALL_ERROR 122 +#define TS_R_TOKEN_NOT_PRESENT 130 +#define TS_R_TOKEN_PRESENT 131 +#define TS_R_TSA_NAME_MISMATCH 111 +#define TS_R_TSA_UNTRUSTED 112 +#define TS_R_TST_INFO_SETUP_ERROR 123 +#define TS_R_TS_DATASIGN 124 +#define TS_R_UNACCEPTABLE_POLICY 125 +#define TS_R_UNSUPPORTED_MD_ALGORITHM 126 +#define TS_R_UNSUPPORTED_VERSION 113 +#define TS_R_WRONG_CONTENT_TYPE 114 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/txt_db.h b/code/contrib/libfido2/include/openssl/txt_db.h new file mode 100644 index 0000000..56b6b42 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/txt_db.h @@ -0,0 +1,112 @@ +/* $OpenBSD: txt_db.h,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_TXT_DB_H +#define HEADER_TXT_DB_H + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include + +#define DB_ERROR_OK 0 +#define DB_ERROR_MALLOC 1 +#define DB_ERROR_INDEX_CLASH 2 +#define DB_ERROR_INDEX_OUT_OF_RANGE 3 +#define DB_ERROR_NO_INDEX 4 +#define DB_ERROR_INSERT_INDEX_CLASH 5 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef OPENSSL_STRING *OPENSSL_PSTRING; +DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) + +typedef struct txt_db_st { + int num_fields; + STACK_OF(OPENSSL_PSTRING) *data; + LHASH_OF(OPENSSL_STRING) **index; + int (**qual)(OPENSSL_STRING *); + long error; + long arg1; + long arg2; + OPENSSL_STRING *arg_row; +} TXT_DB; + +#ifndef OPENSSL_NO_BIO +TXT_DB *TXT_DB_read(BIO *in, int num); +long TXT_DB_write(BIO *out, TXT_DB *db); +#else +TXT_DB *TXT_DB_read(char *in, int num); +long TXT_DB_write(char *out, TXT_DB *db); +#endif +int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), + LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); +void TXT_DB_free(TXT_DB *db); +OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value); +int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/ui.h b/code/contrib/libfido2/include/openssl/ui.h new file mode 100644 index 0000000..5ca65b0 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ui.h @@ -0,0 +1,409 @@ +/* $OpenBSD: ui.h,v 1.12 2020/09/24 19:20:32 tb Exp $ */ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + */ +/* ==================================================================== + * Copyright (c) 2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_UI_H +#define HEADER_UI_H + +#include + +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Declared already in ossl_typ.h */ +/* typedef struct ui_st UI; */ +/* typedef struct ui_method_st UI_METHOD; */ + + +/* + * All the following functions return -1 or NULL on error and in some cases + * (UI_process()) -2 if interrupted or in some other way cancelled. + * When everything is fine, they return 0, a positive value or a non-NULL + * pointer, all depending on their purpose. + */ + +/* Creators and destructor. */ +UI *UI_new(void); +UI *UI_new_method(const UI_METHOD *method); +void UI_free(UI *ui); + +/* + * The following functions are used to add strings to be printed and prompt + * strings to prompt for data. The names are UI_{add,dup}__string + * and UI_{add,dup}_input_boolean. + * + * UI_{add,dup}__string have the following meanings: + * add add a text or prompt string. The pointers given to these + * functions are used verbatim, no copying is done. + * dup make a copy of the text or prompt string, then add the copy + * to the collection of strings in the user interface. + * + * The function is a name for the functionality that the given + * string shall be used for. It can be one of: + * input use the string as data prompt. + * verify use the string as verification prompt. This + * is used to verify a previous input. + * info use the string for informational output. + * error use the string for error output. + * Honestly, there's currently no difference between info and error for the + * moment. + * + * UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + * and are typically used when one wants to prompt for a yes/no response. + * + * All of the functions in this group take a UI and a prompt string. + * The string input and verify addition functions also take a flag argument, + * a buffer for the result to end up in, a minimum input size and a maximum + * input size (the result buffer MUST be large enough to be able to contain + * the maximum number of characters). Additionally, the verify addition + * functions takes another buffer to compare the result against. + * The boolean input functions take an action description string (which should + * be safe to ignore if the expected user action is obvious, for example with + * a dialog box with an OK button and a Cancel button), a string of acceptable + * characters to mean OK and to mean Cancel. The two last strings are checked + * to make sure they don't have common characters. Additionally, the same + * flag argument as for the string input is taken, as well as a result buffer. + * The result buffer is required to be at least one byte long. Depending on + * the answer, the first character from the OK or the Cancel character strings + * will be stored in the first byte of the result buffer. No NUL will be + * added, so the result is *not* a string. + * + * On success, the functions all return an index of the added information. + * That index is useful when retrieving results with UI_get0_result(). + */ +int UI_add_input_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize); +int UI_dup_input_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize); +int UI_add_verify_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize, const char *test_buf); +int UI_dup_verify_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize, const char *test_buf); +int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); +int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); +int UI_add_info_string(UI *ui, const char *text); +int UI_dup_info_string(UI *ui, const char *text); +int UI_add_error_string(UI *ui, const char *text); +int UI_dup_error_string(UI *ui, const char *text); + +/* These are the possible flags. They can be or'ed together. */ +/* Use to have echoing of input */ +#define UI_INPUT_FLAG_ECHO 0x01 +/* + * Use a default password. Where that password is found is completely + * up to the application, it might for example be in the user data set + * with UI_add_user_data(). It is not recommended to have more than + * one input in each UI being marked with this flag, or the application + * might get confused. + */ +#define UI_INPUT_FLAG_DEFAULT_PWD 0x02 + +/* + * Users of these routines may want to define flags of their own. The core + * UI won't look at those, but will pass them on to the method routines. They + * must use higher bits so they don't get confused with the UI bits above. + * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good + * example of use is this: + * + * #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) + */ +#define UI_INPUT_FLAG_USER_BASE 16 + + +/* + * The following function helps construct a prompt. object_desc is a + * textual short description of the object, for example "pass phrase", + * and object_name is the name of the object (might be a card name or + * a file name. + * The returned string shall always be allocated on the heap with + * malloc(), and need to be free'd with free(). + * + * If the ui_method doesn't contain a pointer to a user-defined prompt + * constructor, a default string is built, looking like this: + * + * "Enter {object_desc} for {object_name}:" + * + * So, if object_desc has the value "pass phrase" and object_name has + * the value "foo.key", the resulting string is: + * + * "Enter pass phrase for foo.key:" + */ +char *UI_construct_prompt(UI *ui_method, const char *object_desc, + const char *object_name); + + +/* + * The following function is used to store a pointer to user-specific data. + * Any previous such pointer will be returned and replaced. + * + * For callback purposes, this function makes a lot more sense than using + * ex_data, since the latter requires that different parts of OpenSSL or + * applications share the same ex_data index. + * + * Note that the UI_OpenSSL() method completely ignores the user data. + * Other methods may not, however. + */ +void *UI_add_user_data(UI *ui, void *user_data); +/* We need a user data retrieving function as well. */ +void *UI_get0_user_data(UI *ui); + +/* Return the result associated with a prompt given with the index i. */ +const char *UI_get0_result(UI *ui, int i); + +/* When all strings have been added, process the whole thing. */ +int UI_process(UI *ui); + +/* + * Give a user interface parametrised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as + * be used to get information from a UI. + */ +int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void)); + +/* The commands */ +/* + * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the + * OpenSSL error stack before printing any info or added error messages and + * before any prompting. + */ +#define UI_CTRL_PRINT_ERRORS 1 +/* + * Check if a UI_process() is possible to do again with the same instance of + * a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 + * if not. + */ +#define UI_CTRL_IS_REDOABLE 2 + + +/* Some methods may use extra data */ +#define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) +#define UI_get_app_data(s) UI_get_ex_data(s,0) +int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int UI_set_ex_data(UI *r, int idx, void *arg); +void *UI_get_ex_data(UI *r, int idx); + +/* Use specific methods instead of the built-in one */ +void UI_set_default_method(const UI_METHOD *meth); +const UI_METHOD *UI_get_default_method(void); +const UI_METHOD *UI_get_method(UI *ui); +const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); + +/* The method with all the built-in thingies */ +UI_METHOD *UI_OpenSSL(void); + + +/* + * ---------- For method writers ---------- + * A method contains a number of functions that implement the low level + * of the User Interface. The functions are: + * + * an opener This function starts a session, maybe by opening + * a channel to a tty, or by opening a window. + * a writer This function is called to write a given string, + * maybe to the tty, maybe as a field label in a + * window. + * a flusher This function is called to flush everything that + * has been output so far. It can be used to actually + * display a dialog box after it has been built. + * a reader This function is called to read a given prompt, + * maybe from the tty, maybe from a field in a + * window. Note that it's called wth all string + * structures, not only the prompt ones, so it must + * check such things itself. + * a closer This function closes the session, maybe by closing + * the channel to the tty, or closing the window. + * + * All these functions are expected to return: + * + * 0 on error. + * 1 on success. + * -1 on out-of-band events, for example if some prompting has + * been canceled (by pressing Ctrl-C, for example). This is + * only checked when returned by the flusher or the reader. + * + * The way this is used, the opener is first called, then the writer for all + * strings, then the flusher, then the reader for all strings and finally the + * closer. Note that if you want to prompt from a terminal or other command + * line interface, the best is to have the reader also write the prompts + * instead of having the writer do it. If you want to prompt from a dialog + * box, the writer can be used to build up the contents of the box, and the + * flusher to actually display the box and run the event loop until all data + * has been given, after which the reader only grabs the given data and puts + * them back into the UI strings. + * + * All method functions take a UI as argument. Additionally, the writer and + * the reader take a UI_STRING. + */ + +/* + * The UI_STRING type is the data structure that contains all the needed info + * about a string or a prompt, including test data for a verification prompt. + */ +typedef struct ui_string_st UI_STRING; +DECLARE_STACK_OF(UI_STRING) + +/* + * The different types of strings that are currently supported. + * This is only needed by method authors. + */ +enum UI_string_types { + UIT_NONE = 0, + UIT_PROMPT, /* Prompt for a string */ + UIT_VERIFY, /* Prompt for a string and verify */ + UIT_BOOLEAN, /* Prompt for a yes/no response */ + UIT_INFO, /* Send info to the user */ + UIT_ERROR /* Send an error message to the user */ +}; + +/* Create and manipulate methods */ +UI_METHOD *UI_create_method(const char *name); +void UI_destroy_method(UI_METHOD *ui_method); +int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)); +int UI_method_set_writer(UI_METHOD *method, + int (*writer)(UI *ui, UI_STRING *uis)); +int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui)); +int UI_method_set_reader(UI_METHOD *method, + int (*reader)(UI *ui, UI_STRING *uis)); +int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); +int UI_method_set_prompt_constructor(UI_METHOD *method, + char *(*prompt_constructor)(UI *ui, const char *object_desc, + const char *object_name)); +int (*UI_method_get_opener(const UI_METHOD *method))(UI *); +int (*UI_method_get_writer(const UI_METHOD *method))(UI *, UI_STRING *); +int (*UI_method_get_flusher(const UI_METHOD *method))(UI *); +int (*UI_method_get_reader(const UI_METHOD *method))(UI *, UI_STRING *); +int (*UI_method_get_closer(const UI_METHOD *method))(UI *); +char *(*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI *, + const char *, const char *); + +/* + * The following functions are helpers for method writers to access relevant + * data from a UI_STRING. + */ +/* Return type of the UI_STRING */ +enum UI_string_types UI_get_string_type(UI_STRING *uis); +/* Return input flags of the UI_STRING */ +int UI_get_input_flags(UI_STRING *uis); +/* Return the actual string to output (the prompt, info or error) */ +const char *UI_get0_output_string(UI_STRING *uis); +/* Return the optional action string to output (boolean prompt instruction) */ +const char *UI_get0_action_string(UI_STRING *uis); +/* Return the result of a prompt */ +const char *UI_get0_result_string(UI_STRING *uis); +/* Return the string to test the result against. Only useful with verifies. */ +const char *UI_get0_test_string(UI_STRING *uis); +/* Return the required minimum size of the result */ +int UI_get_result_minsize(UI_STRING *uis); +/* Return the required maximum size of the result */ +int UI_get_result_maxsize(UI_STRING *uis); +/* Set the result of a UI_STRING. */ +int UI_set_result(UI *ui, UI_STRING *uis, const char *result); + +/* A couple of popular utility functions */ +int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, + int verify); +int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, + int verify); + +/* BEGIN ERROR CODES */ +/* + * The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_UI_strings(void); + +/* Error codes for the UI functions. */ + +/* Function codes. */ +#define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 +#define UI_F_GENERAL_ALLOCATE_PROMPT 109 +#define UI_F_GENERAL_ALLOCATE_STRING 100 +#define UI_F_UI_CTRL 111 +#define UI_F_UI_DUP_ERROR_STRING 101 +#define UI_F_UI_DUP_INFO_STRING 102 +#define UI_F_UI_DUP_INPUT_BOOLEAN 110 +#define UI_F_UI_DUP_INPUT_STRING 103 +#define UI_F_UI_DUP_VERIFY_STRING 106 +#define UI_F_UI_GET0_RESULT 107 +#define UI_F_UI_NEW_METHOD 104 +#define UI_F_UI_SET_RESULT 105 + +/* Reason codes. */ +#define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104 +#define UI_R_INDEX_TOO_LARGE 102 +#define UI_R_INDEX_TOO_SMALL 103 +#define UI_R_NO_RESULT_BUFFER 105 +#define UI_R_RESULT_TOO_LARGE 100 +#define UI_R_RESULT_TOO_SMALL 101 +#define UI_R_UNKNOWN_CONTROL_COMMAND 106 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/ui_compat.h b/code/contrib/libfido2/include/openssl/ui_compat.h new file mode 100644 index 0000000..860e80c --- /dev/null +++ b/code/contrib/libfido2/include/openssl/ui_compat.h @@ -0,0 +1,83 @@ +/* $OpenBSD: ui_compat.h,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + */ +/* ==================================================================== + * Copyright (c) 2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_UI_COMPAT_H +#define HEADER_UI_COMPAT_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* The following functions were previously part of the DES section, + and are provided here for backward compatibility reasons. */ + +#define des_read_pw_string(b,l,p,v) \ + _ossl_old_des_read_pw_string((b),(l),(p),(v)) +#define des_read_pw(b,bf,s,p,v) \ + _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) + +int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, int verify); +int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt, int verify); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/whrlpool.h b/code/contrib/libfido2/include/openssl/whrlpool.h new file mode 100644 index 0000000..875d34f --- /dev/null +++ b/code/contrib/libfido2/include/openssl/whrlpool.h @@ -0,0 +1,41 @@ +/* $OpenBSD: whrlpool.h,v 1.5 2014/07/10 22:45:58 jsing Exp $ */ + +#include + +#ifndef HEADER_WHRLPOOL_H +#define HEADER_WHRLPOOL_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define WHIRLPOOL_DIGEST_LENGTH (512/8) +#define WHIRLPOOL_BBLOCK 512 +#define WHIRLPOOL_COUNTER (256/8) + +typedef struct { + union { + unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; + /* double q is here to ensure 64-bit alignment */ + double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; + } H; + unsigned char data[WHIRLPOOL_BBLOCK/8]; + unsigned int bitoff; + size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; + } WHIRLPOOL_CTX; + +#ifndef OPENSSL_NO_WHIRLPOOL +int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); +int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); +void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); +int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); +unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/x509.h b/code/contrib/libfido2/include/openssl/x509.h new file mode 100644 index 0000000..05872e1 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/x509.h @@ -0,0 +1,1226 @@ +/* $OpenBSD: x509.h,v 1.89 2022/01/10 14:13:03 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_X509_H +#define HEADER_X509_H + +#include + +#ifndef OPENSSL_NO_BUFFER +#include +#endif +#ifndef OPENSSL_NO_EVP +#include +#endif +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include +#include + +#ifndef OPENSSL_NO_EC +#include +#endif + +#ifndef OPENSSL_NO_ECDSA +#include +#endif + +#ifndef OPENSSL_NO_ECDH +#include +#endif + +#ifndef OPENSSL_NO_DEPRECATED +#ifndef OPENSSL_NO_RSA +#include +#endif +#ifndef OPENSSL_NO_DSA +#include +#endif +#ifndef OPENSSL_NO_DH +#include +#endif +#endif + +#ifndef OPENSSL_NO_SHA +#include +#endif +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) && defined(__WINCRYPT_H__) +#ifndef LIBRESSL_INTERNAL +#ifdef _MSC_VER +#pragma message("Warning, overriding WinCrypt defines") +#else +#warning overriding WinCrypt defines +#endif +#endif +#undef X509_NAME +#undef X509_CERT_PAIR +#undef X509_EXTENSIONS +#endif + +#define X509_FILETYPE_PEM 1 +#define X509_FILETYPE_ASN1 2 +#define X509_FILETYPE_DEFAULT 3 + +#define X509v3_KU_DIGITAL_SIGNATURE 0x0080 +#define X509v3_KU_NON_REPUDIATION 0x0040 +#define X509v3_KU_KEY_ENCIPHERMENT 0x0020 +#define X509v3_KU_DATA_ENCIPHERMENT 0x0010 +#define X509v3_KU_KEY_AGREEMENT 0x0008 +#define X509v3_KU_KEY_CERT_SIGN 0x0004 +#define X509v3_KU_CRL_SIGN 0x0002 +#define X509v3_KU_ENCIPHER_ONLY 0x0001 +#define X509v3_KU_DECIPHER_ONLY 0x8000 +#define X509v3_KU_UNDEF 0xffff + +struct X509_algor_st { + ASN1_OBJECT *algorithm; + ASN1_TYPE *parameter; +} /* X509_ALGOR */; + +typedef STACK_OF(X509_ALGOR) X509_ALGORS; + +typedef struct X509_val_st { + ASN1_TIME *notBefore; + ASN1_TIME *notAfter; +} X509_VAL; + +typedef struct X509_sig_st X509_SIG; + +typedef struct X509_name_entry_st X509_NAME_ENTRY; + +DECLARE_STACK_OF(X509_NAME_ENTRY) + +DECLARE_STACK_OF(X509_NAME) + +typedef struct X509_extension_st X509_EXTENSION; + +typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; + +DECLARE_STACK_OF(X509_EXTENSION) + +typedef struct x509_attributes_st X509_ATTRIBUTE; + +DECLARE_STACK_OF(X509_ATTRIBUTE) + +typedef struct X509_req_info_st X509_REQ_INFO; + +typedef struct X509_req_st X509_REQ; + +typedef struct x509_cert_aux_st X509_CERT_AUX; + +typedef struct x509_cinf_st X509_CINF; + +DECLARE_STACK_OF(X509) + +/* This is used for a table of trust checking functions */ + +typedef struct x509_trust_st { + int trust; + int flags; + int (*check_trust)(struct x509_trust_st *, X509 *, int); + char *name; + int arg1; + void *arg2; +} X509_TRUST; + +DECLARE_STACK_OF(X509_TRUST) + +/* standard trust ids */ + +/* OpenSSL changed this to 0 */ +#define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */ + +#define X509_TRUST_COMPAT 1 +#define X509_TRUST_SSL_CLIENT 2 +#define X509_TRUST_SSL_SERVER 3 +#define X509_TRUST_EMAIL 4 +#define X509_TRUST_OBJECT_SIGN 5 +#define X509_TRUST_OCSP_SIGN 6 +#define X509_TRUST_OCSP_REQUEST 7 +#define X509_TRUST_TSA 8 + +/* Keep these up to date! */ +#define X509_TRUST_MIN 1 +#define X509_TRUST_MAX 8 + + +/* trust_flags values */ +#define X509_TRUST_DYNAMIC 1 +#define X509_TRUST_DYNAMIC_NAME 2 + +/* check_trust return codes */ + +#define X509_TRUST_TRUSTED 1 +#define X509_TRUST_REJECTED 2 +#define X509_TRUST_UNTRUSTED 3 + +/* Flags for X509_print_ex() */ + +#define X509_FLAG_COMPAT 0 +#define X509_FLAG_NO_HEADER 1L +#define X509_FLAG_NO_VERSION (1L << 1) +#define X509_FLAG_NO_SERIAL (1L << 2) +#define X509_FLAG_NO_SIGNAME (1L << 3) +#define X509_FLAG_NO_ISSUER (1L << 4) +#define X509_FLAG_NO_VALIDITY (1L << 5) +#define X509_FLAG_NO_SUBJECT (1L << 6) +#define X509_FLAG_NO_PUBKEY (1L << 7) +#define X509_FLAG_NO_EXTENSIONS (1L << 8) +#define X509_FLAG_NO_SIGDUMP (1L << 9) +#define X509_FLAG_NO_AUX (1L << 10) +#define X509_FLAG_NO_ATTRIBUTES (1L << 11) + +/* Flags specific to X509_NAME_print_ex() */ + +/* The field separator information */ + +#define XN_FLAG_SEP_MASK (0xf << 16) + +#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */ +#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */ +#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */ +#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */ +#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */ + +#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */ + +/* How the field name is shown */ + +#define XN_FLAG_FN_MASK (0x3 << 21) + +#define XN_FLAG_FN_SN 0 /* Object short name */ +#define XN_FLAG_FN_LN (1 << 21) /* Object long name */ +#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */ +#define XN_FLAG_FN_NONE (3 << 21) /* No field names */ + +#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */ + +/* This determines if we dump fields we don't recognise: + * RFC2253 requires this. + */ + +#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) + +#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */ + +/* Complete set of RFC2253 flags */ + +#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ + XN_FLAG_SEP_COMMA_PLUS | \ + XN_FLAG_DN_REV | \ + XN_FLAG_FN_SN | \ + XN_FLAG_DUMP_UNKNOWN_FIELDS) + +/* readable oneline form */ + +#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ + ASN1_STRFLGS_ESC_QUOTE | \ + XN_FLAG_SEP_CPLUS_SPC | \ + XN_FLAG_SPC_EQ | \ + XN_FLAG_FN_SN) + +/* readable multiline form */ + +#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB | \ + XN_FLAG_SEP_MULTILINE | \ + XN_FLAG_SPC_EQ | \ + XN_FLAG_FN_LN | \ + XN_FLAG_FN_ALIGN) + +DECLARE_STACK_OF(X509_REVOKED) + +typedef struct X509_crl_info_st X509_CRL_INFO; + +DECLARE_STACK_OF(X509_CRL) + +typedef struct private_key_st { + int version; + /* The PKCS#8 data types */ + X509_ALGOR *enc_algor; + ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ + + /* When decrypted, the following will not be NULL */ + EVP_PKEY *dec_pkey; + + /* used to encrypt and decrypt */ + int key_length; + char *key_data; + int key_free; /* true if we should auto free key_data */ + + /* expanded version of 'enc_algor' */ + EVP_CIPHER_INFO cipher; + + int references; +} X509_PKEY; + +#ifndef OPENSSL_NO_EVP +typedef struct X509_info_st { + X509 *x509; + X509_CRL *crl; + X509_PKEY *x_pkey; + + EVP_CIPHER_INFO enc_cipher; + int enc_len; + char *enc_data; + + int references; +} X509_INFO; + +DECLARE_STACK_OF(X509_INFO) +#endif + +/* The next 2 structures and their 8 routines were sent to me by + * Pat Richard and are used to manipulate + * Netscapes spki structures - useful if you are writing a CA web page + */ +typedef struct Netscape_spkac_st { + X509_PUBKEY *pubkey; + ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ +} NETSCAPE_SPKAC; + +typedef struct Netscape_spki_st { + NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ + X509_ALGOR *sig_algor; + ASN1_BIT_STRING *signature; +} NETSCAPE_SPKI; + +/* Netscape certificate sequence structure */ +typedef struct Netscape_certificate_sequence { + ASN1_OBJECT *type; + STACK_OF(X509) *certs; +} NETSCAPE_CERT_SEQUENCE; + + +/* Password based encryption structure */ + +typedef struct PBEPARAM_st { + ASN1_OCTET_STRING *salt; + ASN1_INTEGER *iter; +} PBEPARAM; + +/* Password based encryption V2 structures */ + +typedef struct PBE2PARAM_st { + X509_ALGOR *keyfunc; + X509_ALGOR *encryption; +} PBE2PARAM; + +typedef struct PBKDF2PARAM_st { + /* Usually OCTET STRING but could be anything */ + ASN1_TYPE *salt; + ASN1_INTEGER *iter; + ASN1_INTEGER *keylength; + X509_ALGOR *prf; +} PBKDF2PARAM; + +#ifdef __cplusplus +} +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define X509_extract_key(x) X509_get_pubkey(x) /*****/ +#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) +#define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) + +int X509_CRL_up_ref(X509_CRL *x); +int X509_CRL_get_signature_nid(const X509_CRL *crl); + +int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); + +const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); +long X509_CRL_get_version(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); +ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); +ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl); +X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); +STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); +void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); + +int X509_REQ_get_signature_nid(const X509_REQ *req); + +void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); + +void X509_CRL_set_default_method(const X509_CRL_METHOD *meth); +X509_CRL_METHOD *X509_CRL_METHOD_new( + int (*crl_init)(X509_CRL *crl), + int (*crl_free)(X509_CRL *crl), + int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, + ASN1_INTEGER *ser, X509_NAME *issuer), + int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk)); +void X509_CRL_METHOD_free(X509_CRL_METHOD *m); + +void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); +void *X509_CRL_get_meth_data(X509_CRL *crl); + +X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); + +const char *X509_verify_cert_error_string(long n); + +#ifndef OPENSSL_NO_EVP +int X509_verify(X509 *a, EVP_PKEY *r); + +int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); +int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); +int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); + +NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len); +char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); +EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); +int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); + +int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); + +int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent); +int X509_signature_print(BIO *bp, const X509_ALGOR *alg, + const ASN1_STRING *sig); + +int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); +int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); +int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); +int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); + +int X509_pubkey_digest(const X509 *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_digest(const X509 *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +#endif + +X509 *d2i_X509_fp(FILE *fp, X509 **x509); +int i2d_X509_fp(FILE *fp,X509 *x509); +X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); +int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); +X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); +int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); +#ifndef OPENSSL_NO_RSA +RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); +int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); +RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); +int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); +RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); +int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); +#endif +#ifndef OPENSSL_NO_DSA +DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); +int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); +DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); +int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); +#endif +#ifndef OPENSSL_NO_EC +EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); +int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); +EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); +int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); +#endif +X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); +int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + PKCS8_PRIV_KEY_INFO **p8inf); +int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); +int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); +int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); +int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); + +#ifndef OPENSSL_NO_BIO +X509 *d2i_X509_bio(BIO *bp,X509 **x509); +int i2d_X509_bio(BIO *bp,X509 *x509); +X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); +int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); +X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); +int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); +#ifndef OPENSSL_NO_RSA +RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); +int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); +RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); +int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); +RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); +int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); +#endif +#ifndef OPENSSL_NO_DSA +DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); +int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); +DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); +int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); +#endif +#ifndef OPENSSL_NO_EC +EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); +int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey); +EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); +int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey); +#endif +X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); +int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, + PKCS8_PRIV_KEY_INFO **p8inf); +int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); +int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); +int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); +int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); +#endif + +X509 *X509_dup(X509 *x509); +X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); +X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); +X509_CRL *X509_CRL_dup(X509_CRL *crl); +X509_REQ *X509_REQ_dup(X509_REQ *req); +X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); +int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); +void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, + const X509_ALGOR *algor); +void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); + +X509_NAME *X509_NAME_dup(X509_NAME *xn); +int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen); +X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); + +int X509_cmp_time(const ASN1_TIME *s, time_t *t); +int X509_cmp_current_time(const ASN1_TIME *s); +ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t); +ASN1_TIME * X509_time_adj_ex(ASN1_TIME *s, + int offset_day, long offset_sec, time_t *t); +ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj); + +const char * X509_get_default_cert_area(void ); +const char * X509_get_default_cert_dir(void ); +const char * X509_get_default_cert_file(void ); +const char * X509_get_default_cert_dir_env(void ); +const char * X509_get_default_cert_file_env(void ); +const char * X509_get_default_private_dir(void ); + +X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); + +X509_ALGOR *X509_ALGOR_new(void); +void X509_ALGOR_free(X509_ALGOR *a); +X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len); +int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out); +extern const ASN1_ITEM X509_ALGOR_it; +X509_ALGORS *d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len); +int i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out); +extern const ASN1_ITEM X509_ALGORS_it; +X509_VAL *X509_VAL_new(void); +void X509_VAL_free(X509_VAL *a); +X509_VAL *d2i_X509_VAL(X509_VAL **a, const unsigned char **in, long len); +int i2d_X509_VAL(X509_VAL *a, unsigned char **out); +extern const ASN1_ITEM X509_VAL_it; + +X509_PUBKEY *X509_PUBKEY_new(void); +void X509_PUBKEY_free(X509_PUBKEY *a); +X509_PUBKEY *d2i_X509_PUBKEY(X509_PUBKEY **a, const unsigned char **in, long len); +int i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **out); +extern const ASN1_ITEM X509_PUBKEY_it; + +int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); +EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); +EVP_PKEY * X509_PUBKEY_get0(X509_PUBKEY *key); +int X509_get_pubkey_parameters(EVP_PKEY *pkey, + STACK_OF(X509) *chain); +int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); +EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp, + long length); +#ifndef OPENSSL_NO_RSA +int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); +RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp, + long length); +#endif +#ifndef OPENSSL_NO_DSA +int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); +DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp, + long length); +#endif +#ifndef OPENSSL_NO_EC +int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp); +EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, + long length); +#endif + +X509_SIG *X509_SIG_new(void); +void X509_SIG_free(X509_SIG *a); +X509_SIG *d2i_X509_SIG(X509_SIG **a, const unsigned char **in, long len); +int i2d_X509_SIG(X509_SIG *a, unsigned char **out); +extern const ASN1_ITEM X509_SIG_it; +void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, + const ASN1_OCTET_STRING **pdigest); +void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, + ASN1_OCTET_STRING **pdigest); + +X509_REQ_INFO *X509_REQ_INFO_new(void); +void X509_REQ_INFO_free(X509_REQ_INFO *a); +X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in, long len); +int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out); +extern const ASN1_ITEM X509_REQ_INFO_it; +X509_REQ *X509_REQ_new(void); +void X509_REQ_free(X509_REQ *a); +X509_REQ *d2i_X509_REQ(X509_REQ **a, const unsigned char **in, long len); +int i2d_X509_REQ(X509_REQ *a, unsigned char **out); +extern const ASN1_ITEM X509_REQ_it; + +X509_ATTRIBUTE *X509_ATTRIBUTE_new(void); +void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a); +X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, const unsigned char **in, long len); +int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **out); +extern const ASN1_ITEM X509_ATTRIBUTE_it; +X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); + +X509_EXTENSION *X509_EXTENSION_new(void); +void X509_EXTENSION_free(X509_EXTENSION *a); +X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a, const unsigned char **in, long len); +int i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **out); +extern const ASN1_ITEM X509_EXTENSION_it; +X509_EXTENSIONS *d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len); +int i2d_X509_EXTENSIONS(X509_EXTENSIONS *a, unsigned char **out); +extern const ASN1_ITEM X509_EXTENSIONS_it; + +X509_NAME_ENTRY *X509_NAME_ENTRY_new(void); +void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a); +X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, const unsigned char **in, long len); +int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out); +extern const ASN1_ITEM X509_NAME_ENTRY_it; + +X509_NAME *X509_NAME_new(void); +void X509_NAME_free(X509_NAME *a); +X509_NAME *d2i_X509_NAME(X509_NAME **a, const unsigned char **in, long len); +int i2d_X509_NAME(X509_NAME *a, unsigned char **out); +extern const ASN1_ITEM X509_NAME_it; + +int X509_NAME_set(X509_NAME **xn, X509_NAME *name); + +X509_CINF *X509_CINF_new(void); +void X509_CINF_free(X509_CINF *a); +X509_CINF *d2i_X509_CINF(X509_CINF **a, const unsigned char **in, long len); +int i2d_X509_CINF(X509_CINF *a, unsigned char **out); +extern const ASN1_ITEM X509_CINF_it; + +X509 *X509_new(void); +void X509_free(X509 *a); +X509 *d2i_X509(X509 **a, const unsigned char **in, long len); +int i2d_X509(X509 *a, unsigned char **out); +extern const ASN1_ITEM X509_it; +X509_CERT_AUX *X509_CERT_AUX_new(void); +void X509_CERT_AUX_free(X509_CERT_AUX *a); +X509_CERT_AUX *d2i_X509_CERT_AUX(X509_CERT_AUX **a, const unsigned char **in, long len); +int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out); +extern const ASN1_ITEM X509_CERT_AUX_it; + +int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int X509_set_ex_data(X509 *r, int idx, void *arg); +void *X509_get_ex_data(X509 *r, int idx); +int i2d_X509_AUX(X509 *a,unsigned char **pp); +X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); + +int i2d_re_X509_tbs(X509 *x, unsigned char **pp); + +void X509_get0_signature(const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg, const X509 *x); +int X509_get_signature_nid(const X509 *x); + +int X509_alias_set1(X509 *x, const unsigned char *name, int len); +int X509_keyid_set1(X509 *x, const unsigned char *id, int len); +unsigned char *X509_alias_get0(X509 *x, int *len); +unsigned char *X509_keyid_get0(X509 *x, int *len); +int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); +int X509_TRUST_set(int *t, int trust); +int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj); +int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj); +void X509_trust_clear(X509 *x); +void X509_reject_clear(X509 *x); + +X509_REVOKED *X509_REVOKED_new(void); +void X509_REVOKED_free(X509_REVOKED *a); +X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *a); +X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len); +int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out); +extern const ASN1_ITEM X509_REVOKED_it; + +X509_CRL_INFO *X509_CRL_INFO_new(void); +void X509_CRL_INFO_free(X509_CRL_INFO *a); +X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len); +int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out); +extern const ASN1_ITEM X509_CRL_INFO_it; + +X509_CRL *X509_CRL_new(void); +void X509_CRL_free(X509_CRL *a); +X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len); +int i2d_X509_CRL(X509_CRL *a, unsigned char **out); +extern const ASN1_ITEM X509_CRL_it; + +int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); +int X509_CRL_get0_by_serial(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial); +int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); + +X509_PKEY * X509_PKEY_new(void ); +void X509_PKEY_free(X509_PKEY *a); + +NETSCAPE_SPKI *NETSCAPE_SPKI_new(void); +void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a); +NETSCAPE_SPKI *d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, const unsigned char **in, long len); +int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **out); +extern const ASN1_ITEM NETSCAPE_SPKI_it; +NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void); +void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a); +NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a, const unsigned char **in, long len); +int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **out); +extern const ASN1_ITEM NETSCAPE_SPKAC_it; +NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void); +void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a); +NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, const unsigned char **in, long len); +int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **out); +extern const ASN1_ITEM NETSCAPE_CERT_SEQUENCE_it; + +#ifndef OPENSSL_NO_EVP +X509_INFO * X509_INFO_new(void); +void X509_INFO_free(X509_INFO *a); +char * X509_NAME_oneline(const X509_NAME *a, char *buf, int size); + +int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, + unsigned char *md,unsigned int *len); + +int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, + ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey); + +int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, + void *data, EVP_PKEY *pkey, const EVP_MD *type); +int ASN1_item_sign_ctx(const ASN1_ITEM *it, + X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx); +#endif + +const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); +int X509_set_version(X509 *x, long version); +long X509_get_version(const X509 *x); +int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); +ASN1_INTEGER * X509_get_serialNumber(X509 *x); +const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x); +int X509_set_issuer_name(X509 *x, X509_NAME *name); +X509_NAME * X509_get_issuer_name(const X509 *a); +int X509_set_subject_name(X509 *x, X509_NAME *name); +X509_NAME * X509_get_subject_name(const X509 *a); +int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); +int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm); +int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); +int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm); +const ASN1_TIME *X509_get0_notBefore(const X509 *x); +ASN1_TIME *X509_getm_notBefore(const X509 *x); +const ASN1_TIME *X509_get0_notAfter(const X509 *x); +ASN1_TIME *X509_getm_notAfter(const X509 *x); +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); +EVP_PKEY * X509_get_pubkey(X509 *x); +EVP_PKEY * X509_get0_pubkey(const X509 *x); +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); +int X509_certificate_type(const X509 *x, const EVP_PKEY *pubkey); +int X509_get_signature_type(const X509 *x); + +#define X509_get_notBefore X509_getm_notBefore +#define X509_get_notAfter X509_getm_notAfter + +int X509_REQ_set_version(X509_REQ *x,long version); +long X509_REQ_get_version(const X509_REQ *x); +int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); +X509_NAME *X509_REQ_get_subject_name(const X509_REQ *x); +int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); +EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); +int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); +EVP_PKEY * X509_REQ_get0_pubkey(X509_REQ *req); +int X509_REQ_extension_nid(int nid); +int * X509_REQ_get_extension_nids(void); +void X509_REQ_set_extension_nids(int *nids); +STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); +int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + int nid); +int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); +int X509_REQ_get_attr_count(const X509_REQ *req); +int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, + int lastpos); +int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); +X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int X509_REQ_add1_attr_by_NID(X509_REQ *req, + int nid, int type, + const unsigned char *bytes, int len); +int X509_REQ_add1_attr_by_txt(X509_REQ *req, + const char *attrname, int type, + const unsigned char *bytes, int len); + +int X509_CRL_set_version(X509_CRL *x, long version); +int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); +int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_sort(X509_CRL *crl); + +const STACK_OF(X509_EXTENSION) *X509_REVOKED_get0_extensions(const X509_REVOKED *x); +const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x); +const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x); +int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); +int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); + +int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); + +int X509_check_private_key(const X509 *x509, const EVP_PKEY *pkey); + +int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); +unsigned long X509_issuer_and_serial_hash(X509 *a); + +int X509_issuer_name_cmp(const X509 *a, const X509 *b); +unsigned long X509_issuer_name_hash(X509 *a); + +int X509_subject_name_cmp(const X509 *a, const X509 *b); +unsigned long X509_subject_name_hash(X509 *x); + +#ifndef OPENSSL_NO_MD5 +unsigned long X509_issuer_name_hash_old(X509 *a); +unsigned long X509_subject_name_hash_old(X509 *x); +#endif + +int X509_cmp(const X509 *a, const X509 *b); +int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); +unsigned long X509_NAME_hash(X509_NAME *x); +unsigned long X509_NAME_hash_old(X509_NAME *x); + +int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); +int X509_CRL_match(const X509_CRL *a, const X509_CRL *b); +int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag); +int X509_print_fp(FILE *bp,X509 *x); +int X509_CRL_print_fp(FILE *bp,X509_CRL *x); +int X509_REQ_print_fp(FILE *bp,X509_REQ *req); +int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, + unsigned long flags); + +#ifndef OPENSSL_NO_BIO +int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase); +int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, + unsigned long flags); +int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag); +int X509_print(BIO *bp,X509 *x); +int X509_ocspid_print(BIO *bp,X509 *x); +int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); +int X509_CRL_print(BIO *bp,X509_CRL *x); +int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag); +int X509_REQ_print(BIO *bp,X509_REQ *req); +#endif + +int X509_NAME_entry_count(const X509_NAME *name); +int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, + char *buf,int len); +int X509_NAME_get_text_by_OBJ(X509_NAME *name, + const ASN1_OBJECT *obj, char *buf,int len); + +/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. */ +int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, + int lastpos); +int X509_NAME_get_index_by_OBJ(const X509_NAME *name, + const ASN1_OBJECT *obj, int lastpos); +X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc); +X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); +int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, + int loc, int set); +int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + int type, const unsigned char *bytes, int len, int loc, int set); +int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + const unsigned char *bytes, int len, int loc, int set); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, + const char *field, int type, const unsigned char *bytes, int len); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type, const unsigned char *bytes, int len); +int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, + const unsigned char *bytes, int len, int loc, int set); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, + const ASN1_OBJECT *obj); +int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len); +ASN1_OBJECT * X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne); +ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne); +int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne); + +int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); +int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + int nid, int lastpos); +int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + const ASN1_OBJECT *obj, int lastpos); +int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + int crit, int lastpos); +X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); +X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); +STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + X509_EXTENSION *ex, int loc); + +int X509_get_ext_count(const X509 *x); +int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos); +int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, + int lastpos); +int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos); +X509_EXTENSION *X509_get_ext(const X509 *x, int loc); +X509_EXTENSION *X509_delete_ext(X509 *x, int loc); +int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); +void * X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); +int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, + unsigned long flags); + +int X509_CRL_get_ext_count(const X509_CRL *x); +int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, + int lastpos); +int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, + const ASN1_OBJECT *obj, int lastpos); +int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, + int lastpos); +X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc); +X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); +int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); +void * X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, + int *idx); +int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, + int crit, unsigned long flags); + +int X509_REVOKED_get_ext_count(const X509_REVOKED *x); +int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, + int lastpos); +int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, + const ASN1_OBJECT *obj, int lastpos); +int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, + int crit, int lastpos); +X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc); +X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, + int loc); +void * X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, + int *crit, int *idx); +int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, + int crit, unsigned long flags); + +X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, + int nid, int crit, ASN1_OCTET_STRING *data); +X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + const ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data); +int X509_EXTENSION_set_object(X509_EXTENSION *ex, + const ASN1_OBJECT *obj); +int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); +int X509_EXTENSION_set_data(X509_EXTENSION *ex, + ASN1_OCTET_STRING *data); +ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); +ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); +int X509_EXTENSION_get_critical(const X509_EXTENSION *ex); + +int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); +int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, + int lastpos); +int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + const ASN1_OBJECT *obj, int lastpos); +X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); +X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + X509_ATTRIBUTE *attr); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, + int nid, int type, + const unsigned char *bytes, int len); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, + const char *attrname, int type, + const unsigned char *bytes, int len); +void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + const ASN1_OBJECT *obj, int lastpos, int type); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, + int atrtype, const void *data, int len); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, + const ASN1_OBJECT *obj, int atrtype, const void *data, int len); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, + const char *atrname, int type, const unsigned char *bytes, int len); +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, + int atrtype, void *data); +int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr); +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); + +int EVP_PKEY_get_attr_count(const EVP_PKEY *key); +int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, + int lastpos); +int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); +X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); +int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr); +int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, + int nid, int type, + const unsigned char *bytes, int len); +int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, + const char *attrname, int type, + const unsigned char *bytes, int len); + +int X509_verify_cert(X509_STORE_CTX *ctx); + +/* lookup a cert from a X509 STACK */ +X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, + ASN1_INTEGER *serial); +X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); + +PBEPARAM *PBEPARAM_new(void); +void PBEPARAM_free(PBEPARAM *a); +PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, const unsigned char **in, long len); +int i2d_PBEPARAM(PBEPARAM *a, unsigned char **out); +extern const ASN1_ITEM PBEPARAM_it; +PBE2PARAM *PBE2PARAM_new(void); +void PBE2PARAM_free(PBE2PARAM *a); +PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, const unsigned char **in, long len); +int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out); +extern const ASN1_ITEM PBE2PARAM_it; +PBKDF2PARAM *PBKDF2PARAM_new(void); +void PBKDF2PARAM_free(PBKDF2PARAM *a); +PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, const unsigned char **in, long len); +int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **out); +extern const ASN1_ITEM PBKDF2PARAM_it; + +int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, + const unsigned char *salt, int saltlen); + +X509_ALGOR *PKCS5_pbe_set(int alg, int iter, + const unsigned char *salt, int saltlen); +X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, + unsigned char *salt, int saltlen); +X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, + unsigned char *salt, int saltlen, + unsigned char *aiv, int prf_nid); + +X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, + int prf_nid, int keylen); + +/* PKCS#8 utilities */ + +PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void); +void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsigned char **in, long len); +int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **out); +extern const ASN1_ITEM PKCS8_PRIV_KEY_INFO_it; + +EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8); +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); + +int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, + int ptype, void *pval, unsigned char *penc, int penclen); +int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk, + int *ppklen, const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8); + +const STACK_OF(X509_ATTRIBUTE) *PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); +int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, + const unsigned char *bytes, int len); + +int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, + int ptype, void *pval, + unsigned char *penc, int penclen); +int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + X509_ALGOR **pa, + X509_PUBKEY *pub); + +int X509_check_trust(X509 *x, int id, int flags); +int X509_TRUST_get_count(void); +X509_TRUST * X509_TRUST_get0(int idx); +int X509_TRUST_get_by_id(int id); +int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), + const char *name, int arg1, void *arg2); +void X509_TRUST_cleanup(void); +int X509_TRUST_get_flags(const X509_TRUST *xp); +char *X509_TRUST_get0_name(const X509_TRUST *xp); +int X509_TRUST_get_trust(const X509_TRUST *xp); + +int X509_up_ref(X509 *x); +STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_X509_strings(void); + +/* Error codes for the X509 functions. */ + +/* Function codes. */ +#define X509_F_ADD_CERT_DIR 100 +#define X509_F_BY_FILE_CTRL 101 +#define X509_F_CHECK_POLICY 145 +#define X509_F_DIR_CTRL 102 +#define X509_F_GET_CERT_BY_SUBJECT 103 +#define X509_F_NETSCAPE_SPKI_B64_DECODE 129 +#define X509_F_NETSCAPE_SPKI_B64_ENCODE 130 +#define X509_F_X509AT_ADD1_ATTR 135 +#define X509_F_X509V3_ADD_EXT 104 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140 +#define X509_F_X509_ATTRIBUTE_GET0_DATA 139 +#define X509_F_X509_ATTRIBUTE_SET1_DATA 138 +#define X509_F_X509_CHECK_PRIVATE_KEY 128 +#define X509_F_X509_CRL_PRINT_FP 147 +#define X509_F_X509_EXTENSION_CREATE_BY_NID 108 +#define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 +#define X509_F_X509_GET_PUBKEY_PARAMETERS 110 +#define X509_F_X509_LOAD_CERT_CRL_FILE 132 +#define X509_F_X509_LOAD_CERT_FILE 111 +#define X509_F_X509_LOAD_CRL_FILE 112 +#define X509_F_X509_NAME_ADD_ENTRY 113 +#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 +#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 +#define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 +#define X509_F_X509_NAME_ONELINE 116 +#define X509_F_X509_NAME_PRINT 117 +#define X509_F_X509_PRINT_EX_FP 118 +#define X509_F_X509_PUBKEY_GET 119 +#define X509_F_X509_PUBKEY_SET 120 +#define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144 +#define X509_F_X509_REQ_PRINT_EX 121 +#define X509_F_X509_REQ_PRINT_FP 122 +#define X509_F_X509_REQ_TO_X509 123 +#define X509_F_X509_STORE_ADD_CERT 124 +#define X509_F_X509_STORE_ADD_CRL 125 +#define X509_F_X509_STORE_CTX_GET1_ISSUER 146 +#define X509_F_X509_STORE_CTX_INIT 143 +#define X509_F_X509_STORE_CTX_NEW 142 +#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 +#define X509_F_X509_TO_X509_REQ 126 +#define X509_F_X509_TRUST_ADD 133 +#define X509_F_X509_TRUST_SET 141 +#define X509_F_X509_VERIFY_CERT 127 + +/* Reason codes. */ +#define X509_R_BAD_X509_FILETYPE 100 +#define X509_R_BASE64_DECODE_ERROR 118 +#define X509_R_CANT_CHECK_DH_KEY 114 +#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 +#define X509_R_ERR_ASN1_LIB 102 +#define X509_R_INVALID_DIRECTORY 113 +#define X509_R_INVALID_FIELD_NAME 119 +#define X509_R_INVALID_TRUST 123 +#define X509_R_KEY_TYPE_MISMATCH 115 +#define X509_R_KEY_VALUES_MISMATCH 116 +#define X509_R_LOADING_CERT_DIR 103 +#define X509_R_LOADING_DEFAULTS 104 +#define X509_R_METHOD_NOT_SUPPORTED 124 +#define X509_R_NO_CERTIFICATE_OR_CRL_FOUND 136 +#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 +#define X509_R_PUBLIC_KEY_DECODE_ERROR 125 +#define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 +#define X509_R_SHOULD_RETRY 106 +#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 +#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 +#define X509_R_UNKNOWN_KEY_TYPE 117 +#define X509_R_UNKNOWN_NID 109 +#define X509_R_UNKNOWN_PURPOSE_ID 121 +#define X509_R_UNKNOWN_TRUST_ID 120 +#define X509_R_UNSUPPORTED_ALGORITHM 111 +#define X509_R_WRONG_LOOKUP_TYPE 112 +#define X509_R_WRONG_TYPE 122 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/openssl/x509_verify.h b/code/contrib/libfido2/include/openssl/x509_verify.h new file mode 100644 index 0000000..d8d2cb0 --- /dev/null +++ b/code/contrib/libfido2/include/openssl/x509_verify.h @@ -0,0 +1,43 @@ +/* $OpenBSD: x509_verify.h,v 1.2 2021/11/04 23:52:34 beck Exp $ */ +/* + * Copyright (c) 2020 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#ifndef HEADER_X509_VERIFY_H +#define HEADER_X509_VERIFY_H + +#ifdef LIBRESSL_INTERNAL +struct x509_verify_ctx; +struct x509_verify_cert_info; +typedef struct x509_verify_ctx X509_VERIFY_CTX; + +X509_VERIFY_CTX *x509_verify_ctx_new(STACK_OF(X509) *roots); +void x509_verify_ctx_free(struct x509_verify_ctx *ctx); + +int x509_verify_ctx_set_max_depth(X509_VERIFY_CTX *ctx, size_t max); +int x509_verify_ctx_set_max_chains(X509_VERIFY_CTX *ctx, size_t max); +int x509_verify_ctx_set_max_signatures(X509_VERIFY_CTX *ctx, size_t max); +int x509_verify_ctx_set_purpose(X509_VERIFY_CTX *ctx, int purpose_id); +int x509_verify_ctx_set_intermediates(X509_VERIFY_CTX *ctx, + STACK_OF(X509) *intermediates); + +const char *x509_verify_ctx_error_string(X509_VERIFY_CTX *ctx); +size_t x509_verify_ctx_error_depth(X509_VERIFY_CTX *ctx); + +STACK_OF(X509) *x509_verify_ctx_chain(X509_VERIFY_CTX *ctx, size_t chain); + +size_t x509_verify(X509_VERIFY_CTX *ctx, X509 *leaf, char *name); +#endif + +#endif diff --git a/code/contrib/libfido2/include/openssl/x509_vfy.h b/code/contrib/libfido2/include/openssl/x509_vfy.h new file mode 100644 index 0000000..9a649cb --- /dev/null +++ b/code/contrib/libfido2/include/openssl/x509_vfy.h @@ -0,0 +1,487 @@ +/* $OpenBSD: x509_vfy.h,v 1.50 2022/01/14 07:53:45 tb Exp $ */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_X509_H +#include +/* openssl/x509.h ends up #include-ing this file at about the only + * appropriate moment. */ +#endif + +#ifndef HEADER_X509_VFY_H +#define HEADER_X509_VFY_H + +#include + +#ifndef OPENSSL_NO_LHASH +#include +#endif +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * SSL_CTX -> X509_STORE + * -> X509_LOOKUP + * ->X509_LOOKUP_METHOD + * -> X509_LOOKUP + * ->X509_LOOKUP_METHOD + * + * SSL -> X509_STORE_CTX + * ->X509_STORE + * + * The X509_STORE holds the tables etc for verification stuff. + * A X509_STORE_CTX is used while validating a single certificate. + * The X509_STORE has X509_LOOKUPs for looking up certs. + * The X509_STORE then calls a function to actually verify the + * certificate chain. + */ + +typedef enum { + X509_LU_NONE, + X509_LU_X509, + X509_LU_CRL, +} X509_LOOKUP_TYPE; + + +DECLARE_STACK_OF(X509_LOOKUP) +DECLARE_STACK_OF(X509_OBJECT) +DECLARE_STACK_OF(X509_VERIFY_PARAM) + +/* unused in OpenSSL */ +typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID; + + +int X509_STORE_set_depth(X509_STORE *store, int depth); + +void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); + +#define X509_STORE_CTX_set_app_data(ctx,data) \ + X509_STORE_CTX_set_ex_data(ctx,0,data) +#define X509_STORE_CTX_get_app_data(ctx) \ + X509_STORE_CTX_get_ex_data(ctx,0) + +#define X509_L_FILE_LOAD 1 +#define X509_L_ADD_DIR 2 +#define X509_L_MEM 3 + +#define X509_LOOKUP_load_file(x,name,type) \ + X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL) + +#define X509_LOOKUP_add_dir(x,name,type) \ + X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) + +#define X509_LOOKUP_add_mem(x,iov,type) \ + X509_LOOKUP_ctrl((x),X509_L_MEM,(const char *)(iov),\ + (long)(type),NULL) + +#define X509_V_OK 0 +#define X509_V_ERR_UNSPECIFIED 1 +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 +#define X509_V_ERR_UNABLE_TO_GET_CRL 3 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 +#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 +#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 +#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 +#define X509_V_ERR_CERT_NOT_YET_VALID 9 +#define X509_V_ERR_CERT_HAS_EXPIRED 10 +#define X509_V_ERR_CRL_NOT_YET_VALID 11 +#define X509_V_ERR_CRL_HAS_EXPIRED 12 +#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 +#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 +#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 +#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 +#define X509_V_ERR_OUT_OF_MEM 17 +#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 +#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 +#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 +#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 +#define X509_V_ERR_CERT_REVOKED 23 +#define X509_V_ERR_INVALID_CA 24 +#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 +#define X509_V_ERR_INVALID_PURPOSE 26 +#define X509_V_ERR_CERT_UNTRUSTED 27 +#define X509_V_ERR_CERT_REJECTED 28 +/* These are 'informational' when looking for issuer cert */ +#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 +#define X509_V_ERR_AKID_SKID_MISMATCH 30 +#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 +#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 + +#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 +#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 +#define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 +#define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 +#define X509_V_ERR_INVALID_NON_CA 37 +#define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 +#define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 +#define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 + +#define X509_V_ERR_INVALID_EXTENSION 41 +#define X509_V_ERR_INVALID_POLICY_EXTENSION 42 +#define X509_V_ERR_NO_EXPLICIT_POLICY 43 +#define X509_V_ERR_DIFFERENT_CRL_SCOPE 44 +#define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45 + +#define X509_V_ERR_UNNESTED_RESOURCE 46 + +#define X509_V_ERR_PERMITTED_VIOLATION 47 +#define X509_V_ERR_EXCLUDED_VIOLATION 48 +#define X509_V_ERR_SUBTREE_MINMAX 49 +#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 +#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 +#define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 +#define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54 + +/* The application is not happy */ +#define X509_V_ERR_APPLICATION_VERIFICATION 50 + +/* Host, email and IP check errors */ +#define X509_V_ERR_HOSTNAME_MISMATCH 62 +#define X509_V_ERR_EMAIL_MISMATCH 63 +#define X509_V_ERR_IP_ADDRESS_MISMATCH 64 + +/* Caller error */ +#define X509_V_ERR_INVALID_CALL 65 +/* Issuer lookup error */ +#define X509_V_ERR_STORE_LOOKUP 66 + +/* Certificate verify flags */ + +/* Send issuer+subject checks to verify_cb */ +#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 +/* Use check time instead of current time */ +#define X509_V_FLAG_USE_CHECK_TIME 0x2 +/* Lookup CRLs */ +#define X509_V_FLAG_CRL_CHECK 0x4 +/* Lookup CRLs for whole chain */ +#define X509_V_FLAG_CRL_CHECK_ALL 0x8 +/* Ignore unhandled critical extensions */ +#define X509_V_FLAG_IGNORE_CRITICAL 0x10 +/* Disable workarounds for broken certificates */ +#define X509_V_FLAG_X509_STRICT 0x20 +/* Enable proxy certificate validation */ +#define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 +/* Enable policy checking */ +#define X509_V_FLAG_POLICY_CHECK 0x80 +/* Policy variable require-explicit-policy */ +#define X509_V_FLAG_EXPLICIT_POLICY 0x100 +/* Policy variable inhibit-any-policy */ +#define X509_V_FLAG_INHIBIT_ANY 0x200 +/* Policy variable inhibit-policy-mapping */ +#define X509_V_FLAG_INHIBIT_MAP 0x400 +/* Notify callback that policy is OK */ +#define X509_V_FLAG_NOTIFY_POLICY 0x800 +/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ +#define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000 +/* Delta CRL support */ +#define X509_V_FLAG_USE_DELTAS 0x2000 +/* Check selfsigned CA signature */ +#define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000 +/* Use trusted store first */ +#define X509_V_FLAG_TRUSTED_FIRST 0x8000 +/* Allow partial chains if at least one certificate is in trusted store */ +#define X509_V_FLAG_PARTIAL_CHAIN 0x80000 + +/* If the initial chain is not trusted, do not attempt to build an alternative + * chain. Alternate chain checking was introduced in 1.0.2b. Setting this flag + * will force the behaviour to match that of previous versions. */ +#define X509_V_FLAG_NO_ALT_CHAINS 0x100000 + +/* Do not check certificate or CRL validity against current time. */ +#define X509_V_FLAG_NO_CHECK_TIME 0x200000 + +/* Force the use of the legacy certificate verifcation */ +#define X509_V_FLAG_LEGACY_VERIFY 0x400000 + +#define X509_VP_FLAG_DEFAULT 0x1 +#define X509_VP_FLAG_OVERWRITE 0x2 +#define X509_VP_FLAG_RESET_FLAGS 0x4 +#define X509_VP_FLAG_LOCKED 0x8 +#define X509_VP_FLAG_ONCE 0x10 + +/* Internal use: mask of policy related options */ +#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ + | X509_V_FLAG_EXPLICIT_POLICY \ + | X509_V_FLAG_INHIBIT_ANY \ + | X509_V_FLAG_INHIBIT_MAP) + +X509_OBJECT *X509_OBJECT_new(void); +void X509_OBJECT_free(X509_OBJECT *a); +int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, + X509_NAME *name); +X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + X509_LOOKUP_TYPE type, X509_NAME *name); +X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x); +int X509_OBJECT_up_ref_count(X509_OBJECT *a); +X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); +X509 *X509_OBJECT_get0_X509(const X509_OBJECT *xo); +X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *xo); + +X509_STORE *X509_STORE_new(void); +void X509_STORE_free(X509_STORE *v); +int X509_STORE_up_ref(X509_STORE *x); +STACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); +STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); +STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *xs); +void *X509_STORE_get_ex_data(X509_STORE *xs, int idx); +int X509_STORE_set_ex_data(X509_STORE *xs, int idx, void *data); + +#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, (l), (p), \ + (newf), (dupf), (freef)) + +int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); +int X509_STORE_set_purpose(X509_STORE *ctx, int purpose); +int X509_STORE_set_trust(X509_STORE *ctx, int trust); +int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm); +X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx); + +typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *); + +X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(X509_STORE *); + +void X509_STORE_set_verify_cb(X509_STORE *ctx, + int (*verify_cb)(int, X509_STORE_CTX *)); +#define X509_STORE_set_verify_cb_func(ctx, func) \ + X509_STORE_set_verify_cb((ctx), (func)) + +X509_STORE_CTX *X509_STORE_CTX_new(void); + +int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); + +void X509_STORE_CTX_free(X509_STORE_CTX *ctx); +int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, + X509 *x509, STACK_OF(X509) *chain); +X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *xs); +X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *xs); +STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); + +X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); + +X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); +X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +X509_LOOKUP_METHOD *X509_LOOKUP_mem(void); + +int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); +int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); + +int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, + X509_NAME *name, X509_OBJECT *ret); +#define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject +X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, + X509_LOOKUP_TYPE type, X509_NAME *name); + +int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); + +int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); + + +X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); +void X509_LOOKUP_free(X509_LOOKUP *ctx); +int X509_LOOKUP_init(X509_LOOKUP *ctx); +int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + X509_NAME *name, X509_OBJECT *ret); +int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + X509_NAME *name, ASN1_INTEGER *serial, X509_OBJECT *ret); +int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const unsigned char *bytes, int len, X509_OBJECT *ret); +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); + +int X509_STORE_load_locations(X509_STORE *ctx, + const char *file, const char *dir); +int X509_STORE_load_mem(X509_STORE *ctx, void *buf, int len); +int X509_STORE_set_default_paths(X509_STORE *ctx); + +int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,int idx,void *data); +void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx); +int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth); +X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x); +X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx); +X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx); +X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_cert(X509_STORE_CTX *c,X509 *x); +void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk); +void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk); +int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); +int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); +int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, + int purpose, int trust); +void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); +void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, + time_t t); +void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +int (*X509_STORE_CTX_get_verify(X509_STORE_CTX *ctx))(X509_STORE_CTX *); +void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, + int (*verify)(X509_STORE_CTX *)); +int (*X509_STORE_CTX_get_verify_cb(X509_STORE_CTX *ctx))(int, X509_STORE_CTX *); +void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, + int (*verify_cb)(int, X509_STORE_CTX *)); + +typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *); + +void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify); +X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx); +#define X509_STORE_set_verify_func(ctx, func) \ + X509_STORE_set_verify((ctx), (func)) + +X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); +int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); +int X509_STORE_CTX_get_num_untrusted(X509_STORE_CTX *ctx); + +X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); +int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); + +/* X509_VERIFY_PARAM functions */ + +X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); +void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); +int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags); +int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, + unsigned long flags); +unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); +int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); +void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); +void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); +int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, + ASN1_OBJECT *policy); +int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, + size_t namelen); +int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, + size_t namelen); +void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, + unsigned int flags); +char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, const char *email, + size_t emaillen); +int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, const unsigned char *ip, + size_t iplen); +int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc); +const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param); +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id); +int X509_VERIFY_PARAM_get_count(void); + +int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); +void X509_VERIFY_PARAM_table_cleanup(void); + +int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, + STACK_OF(X509) *certs, + STACK_OF(ASN1_OBJECT) *policy_oids, + unsigned int flags); + +void X509_policy_tree_free(X509_POLICY_TREE *tree); + +int X509_policy_tree_level_count(const X509_POLICY_TREE *tree); +X509_POLICY_LEVEL * + X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, int i); + +STACK_OF(X509_POLICY_NODE) * + X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree); + +STACK_OF(X509_POLICY_NODE) * + X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree); + +int X509_policy_level_node_count(X509_POLICY_LEVEL *level); + +X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i); + +const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); + +STACK_OF(POLICYQUALINFO) * + X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node); +const X509_POLICY_NODE * + X509_policy_node_get0_parent(const X509_POLICY_NODE *node); + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/code/contrib/libfido2/include/openssl/x509v3.h b/code/contrib/libfido2/include/openssl/x509v3.h new file mode 100644 index 0000000..c82ecae --- /dev/null +++ b/code/contrib/libfido2/include/openssl/x509v3.h @@ -0,0 +1,1187 @@ +/* $OpenBSD: x509v3.h,v 1.14 2022/01/14 09:01:36 tb Exp $ */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_X509V3_H +#define HEADER_X509V3_H + +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward reference */ +struct v3_ext_method; +struct v3_ext_ctx; + +/* Useful typedefs */ + +typedef void * (*X509V3_EXT_NEW)(void); +typedef void (*X509V3_EXT_FREE)(void *); +typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); +typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); +typedef STACK_OF(CONF_VALUE) * + (*X509V3_EXT_I2V)(const struct v3_ext_method *method, void *ext, + STACK_OF(CONF_VALUE) *extlist); +typedef void * (*X509V3_EXT_V2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, + STACK_OF(CONF_VALUE) *values); +typedef char * (*X509V3_EXT_I2S)(const struct v3_ext_method *method, void *ext); +typedef void * (*X509V3_EXT_S2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, const char *str); +typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext, + BIO *out, int indent); +typedef void * (*X509V3_EXT_R2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, const char *str); + +/* V3 extension structure */ + +struct v3_ext_method { +int ext_nid; +int ext_flags; +/* If this is set the following four fields are ignored */ +ASN1_ITEM_EXP *it; +/* Old style ASN1 calls */ +X509V3_EXT_NEW ext_new; +X509V3_EXT_FREE ext_free; +X509V3_EXT_D2I d2i; +X509V3_EXT_I2D i2d; + +/* The following pair is used for string extensions */ +X509V3_EXT_I2S i2s; +X509V3_EXT_S2I s2i; + +/* The following pair is used for multi-valued extensions */ +X509V3_EXT_I2V i2v; +X509V3_EXT_V2I v2i; + +/* The following are used for raw extensions */ +X509V3_EXT_I2R i2r; +X509V3_EXT_R2I r2i; + +void *usr_data; /* Any extension specific data */ +}; + +typedef struct X509V3_CONF_METHOD_st { +char *(*get_string)(void *db, const char *section, const char *value); +STACK_OF(CONF_VALUE) *(*get_section)(void *db, const char *section); +void (*free_string)(void *db, char *string); +void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); +} X509V3_CONF_METHOD; + +/* Context specific info */ +struct v3_ext_ctx { +#define CTX_TEST 0x1 +int flags; +X509 *issuer_cert; +X509 *subject_cert; +X509_REQ *subject_req; +X509_CRL *crl; +X509V3_CONF_METHOD *db_meth; +void *db; +/* Maybe more here */ +}; + +typedef struct v3_ext_method X509V3_EXT_METHOD; + +DECLARE_STACK_OF(X509V3_EXT_METHOD) + +/* ext_flags values */ +#define X509V3_EXT_DYNAMIC 0x1 +#define X509V3_EXT_CTX_DEP 0x2 +#define X509V3_EXT_MULTILINE 0x4 + +typedef BIT_STRING_BITNAME ENUMERATED_NAMES; + +typedef struct BASIC_CONSTRAINTS_st { +int ca; +ASN1_INTEGER *pathlen; +} BASIC_CONSTRAINTS; + + +typedef struct PKEY_USAGE_PERIOD_st { +ASN1_GENERALIZEDTIME *notBefore; +ASN1_GENERALIZEDTIME *notAfter; +} PKEY_USAGE_PERIOD; + +typedef struct otherName_st { +ASN1_OBJECT *type_id; +ASN1_TYPE *value; +} OTHERNAME; + +typedef struct EDIPartyName_st { + ASN1_STRING *nameAssigner; + ASN1_STRING *partyName; +} EDIPARTYNAME; + +typedef struct GENERAL_NAME_st { + +#define GEN_OTHERNAME 0 +#define GEN_EMAIL 1 +#define GEN_DNS 2 +#define GEN_X400 3 +#define GEN_DIRNAME 4 +#define GEN_EDIPARTY 5 +#define GEN_URI 6 +#define GEN_IPADD 7 +#define GEN_RID 8 + +int type; +union { + char *ptr; + OTHERNAME *otherName; /* otherName */ + ASN1_IA5STRING *rfc822Name; + ASN1_IA5STRING *dNSName; + ASN1_TYPE *x400Address; + X509_NAME *directoryName; + EDIPARTYNAME *ediPartyName; + ASN1_IA5STRING *uniformResourceIdentifier; + ASN1_OCTET_STRING *iPAddress; + ASN1_OBJECT *registeredID; + + /* Old names */ + ASN1_OCTET_STRING *ip; /* iPAddress */ + X509_NAME *dirn; /* dirn */ + ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */ + ASN1_OBJECT *rid; /* registeredID */ + ASN1_TYPE *other; /* x400Address */ +} d; +} GENERAL_NAME; + +typedef struct ACCESS_DESCRIPTION_st { + ASN1_OBJECT *method; + GENERAL_NAME *location; +} ACCESS_DESCRIPTION; + +typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; + +typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; + +DECLARE_STACK_OF(GENERAL_NAME) + +typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; +DECLARE_STACK_OF(GENERAL_NAMES) + +DECLARE_STACK_OF(ACCESS_DESCRIPTION) + +typedef struct DIST_POINT_NAME_st { +int type; +union { + GENERAL_NAMES *fullname; + STACK_OF(X509_NAME_ENTRY) *relativename; +} name; +/* If relativename then this contains the full distribution point name */ +X509_NAME *dpname; +} DIST_POINT_NAME; +/* All existing reasons */ +#define CRLDP_ALL_REASONS 0x807f + +#define CRL_REASON_NONE -1 +#define CRL_REASON_UNSPECIFIED 0 +#define CRL_REASON_KEY_COMPROMISE 1 +#define CRL_REASON_CA_COMPROMISE 2 +#define CRL_REASON_AFFILIATION_CHANGED 3 +#define CRL_REASON_SUPERSEDED 4 +#define CRL_REASON_CESSATION_OF_OPERATION 5 +#define CRL_REASON_CERTIFICATE_HOLD 6 +#define CRL_REASON_REMOVE_FROM_CRL 8 +#define CRL_REASON_PRIVILEGE_WITHDRAWN 9 +#define CRL_REASON_AA_COMPROMISE 10 + +struct DIST_POINT_st { +DIST_POINT_NAME *distpoint; +ASN1_BIT_STRING *reasons; +GENERAL_NAMES *CRLissuer; +int dp_reasons; +}; + +typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; + +DECLARE_STACK_OF(DIST_POINT) + +struct AUTHORITY_KEYID_st { +ASN1_OCTET_STRING *keyid; +GENERAL_NAMES *issuer; +ASN1_INTEGER *serial; +}; + +/* Strong extranet structures */ + +typedef struct SXNET_ID_st { + ASN1_INTEGER *zone; + ASN1_OCTET_STRING *user; +} SXNETID; + +DECLARE_STACK_OF(SXNETID) + +typedef struct SXNET_st { + ASN1_INTEGER *version; + STACK_OF(SXNETID) *ids; +} SXNET; + +typedef struct NOTICEREF_st { + ASN1_STRING *organization; + STACK_OF(ASN1_INTEGER) *noticenos; +} NOTICEREF; + +typedef struct USERNOTICE_st { + NOTICEREF *noticeref; + ASN1_STRING *exptext; +} USERNOTICE; + +typedef struct POLICYQUALINFO_st { + ASN1_OBJECT *pqualid; + union { + ASN1_IA5STRING *cpsuri; + USERNOTICE *usernotice; + ASN1_TYPE *other; + } d; +} POLICYQUALINFO; + +DECLARE_STACK_OF(POLICYQUALINFO) + +typedef struct POLICYINFO_st { + ASN1_OBJECT *policyid; + STACK_OF(POLICYQUALINFO) *qualifiers; +} POLICYINFO; + +typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; + +DECLARE_STACK_OF(POLICYINFO) + +typedef struct POLICY_MAPPING_st { + ASN1_OBJECT *issuerDomainPolicy; + ASN1_OBJECT *subjectDomainPolicy; +} POLICY_MAPPING; + +DECLARE_STACK_OF(POLICY_MAPPING) + +typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; + +typedef struct GENERAL_SUBTREE_st { + GENERAL_NAME *base; + ASN1_INTEGER *minimum; + ASN1_INTEGER *maximum; +} GENERAL_SUBTREE; + +DECLARE_STACK_OF(GENERAL_SUBTREE) + +struct NAME_CONSTRAINTS_st { + STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; + STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; +}; + +typedef struct POLICY_CONSTRAINTS_st { + ASN1_INTEGER *requireExplicitPolicy; + ASN1_INTEGER *inhibitPolicyMapping; +} POLICY_CONSTRAINTS; + +/* Proxy certificate structures, see RFC 3820 */ +typedef struct PROXY_POLICY_st + { + ASN1_OBJECT *policyLanguage; + ASN1_OCTET_STRING *policy; + } PROXY_POLICY; + +typedef struct PROXY_CERT_INFO_EXTENSION_st + { + ASN1_INTEGER *pcPathLengthConstraint; + PROXY_POLICY *proxyPolicy; + } PROXY_CERT_INFO_EXTENSION; + +PROXY_POLICY *PROXY_POLICY_new(void); +void PROXY_POLICY_free(PROXY_POLICY *a); +PROXY_POLICY *d2i_PROXY_POLICY(PROXY_POLICY **a, const unsigned char **in, long len); +int i2d_PROXY_POLICY(PROXY_POLICY *a, unsigned char **out); +extern const ASN1_ITEM PROXY_POLICY_it; +PROXY_CERT_INFO_EXTENSION *PROXY_CERT_INFO_EXTENSION_new(void); +void PROXY_CERT_INFO_EXTENSION_free(PROXY_CERT_INFO_EXTENSION *a); +PROXY_CERT_INFO_EXTENSION *d2i_PROXY_CERT_INFO_EXTENSION(PROXY_CERT_INFO_EXTENSION **a, const unsigned char **in, long len); +int i2d_PROXY_CERT_INFO_EXTENSION(PROXY_CERT_INFO_EXTENSION *a, unsigned char **out); +extern const ASN1_ITEM PROXY_CERT_INFO_EXTENSION_it; + +struct ISSUING_DIST_POINT_st + { + DIST_POINT_NAME *distpoint; + int onlyuser; + int onlyCA; + ASN1_BIT_STRING *onlysomereasons; + int indirectCRL; + int onlyattr; + }; + +/* Values in idp_flags field */ +/* IDP present */ +#define IDP_PRESENT 0x1 +/* IDP values inconsistent */ +#define IDP_INVALID 0x2 +/* onlyuser true */ +#define IDP_ONLYUSER 0x4 +/* onlyCA true */ +#define IDP_ONLYCA 0x8 +/* onlyattr true */ +#define IDP_ONLYATTR 0x10 +/* indirectCRL true */ +#define IDP_INDIRECT 0x20 +/* onlysomereasons present */ +#define IDP_REASONS 0x40 + +#define X509V3_conf_err(val) ERR_asprintf_error_data( \ + "section:%s,name:%s,value:%s", val->section, \ + val->name, val->value); + +#define X509V3_set_ctx_test(ctx) \ + X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) +#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; + +#define EXT_BITSTRING(nid, table) { nid, 0, &ASN1_BIT_STRING_it, \ + 0,0,0,0, \ + 0,0, \ + (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ + (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ + NULL, NULL, \ + table} + +#define EXT_IA5STRING(nid) { nid, 0, &ASN1_IA5STRING_it, \ + 0,0,0,0, \ + (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ + (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ + 0,0,0,0, \ + NULL} + +#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + + +/* X509_PURPOSE stuff */ + +#define EXFLAG_BCONS 0x0001 +#define EXFLAG_KUSAGE 0x0002 +#define EXFLAG_XKUSAGE 0x0004 +#define EXFLAG_NSCERT 0x0008 + +#define EXFLAG_CA 0x0010 +#define EXFLAG_SI 0x0020 /* Self issued. */ +#define EXFLAG_V1 0x0040 +#define EXFLAG_INVALID 0x0080 +#define EXFLAG_SET 0x0100 +#define EXFLAG_CRITICAL 0x0200 +#define EXFLAG_PROXY 0x0400 +#define EXFLAG_INVALID_POLICY 0x0800 +#define EXFLAG_FRESHEST 0x1000 +#define EXFLAG_SS 0x2000 /* Self signed. */ + +#define KU_DIGITAL_SIGNATURE 0x0080 +#define KU_NON_REPUDIATION 0x0040 +#define KU_KEY_ENCIPHERMENT 0x0020 +#define KU_DATA_ENCIPHERMENT 0x0010 +#define KU_KEY_AGREEMENT 0x0008 +#define KU_KEY_CERT_SIGN 0x0004 +#define KU_CRL_SIGN 0x0002 +#define KU_ENCIPHER_ONLY 0x0001 +#define KU_DECIPHER_ONLY 0x8000 + +#define NS_SSL_CLIENT 0x80 +#define NS_SSL_SERVER 0x40 +#define NS_SMIME 0x20 +#define NS_OBJSIGN 0x10 +#define NS_SSL_CA 0x04 +#define NS_SMIME_CA 0x02 +#define NS_OBJSIGN_CA 0x01 +#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA) + +#define XKU_SSL_SERVER 0x1 +#define XKU_SSL_CLIENT 0x2 +#define XKU_SMIME 0x4 +#define XKU_CODE_SIGN 0x8 +#define XKU_SGC 0x10 +#define XKU_OCSP_SIGN 0x20 +#define XKU_TIMESTAMP 0x40 +#define XKU_DVCS 0x80 +#define XKU_ANYEKU 0x100 + +#define X509_PURPOSE_DYNAMIC 0x1 +#define X509_PURPOSE_DYNAMIC_NAME 0x2 + +typedef struct x509_purpose_st { + int purpose; + int trust; /* Default trust ID */ + int flags; + int (*check_purpose)(const struct x509_purpose_st *, + const X509 *, int); + char *name; + char *sname; + void *usr_data; +} X509_PURPOSE; + +#define X509_PURPOSE_SSL_CLIENT 1 +#define X509_PURPOSE_SSL_SERVER 2 +#define X509_PURPOSE_NS_SSL_SERVER 3 +#define X509_PURPOSE_SMIME_SIGN 4 +#define X509_PURPOSE_SMIME_ENCRYPT 5 +#define X509_PURPOSE_CRL_SIGN 6 +#define X509_PURPOSE_ANY 7 +#define X509_PURPOSE_OCSP_HELPER 8 +#define X509_PURPOSE_TIMESTAMP_SIGN 9 + +#define X509_PURPOSE_MIN 1 +#define X509_PURPOSE_MAX 9 + +/* Flags for X509V3_EXT_print() */ + +#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) +/* Return error for unknown extensions */ +#define X509V3_EXT_DEFAULT 0 +/* Print error for unknown extensions */ +#define X509V3_EXT_ERROR_UNKNOWN (1L << 16) +/* ASN1 parse unknown extensions */ +#define X509V3_EXT_PARSE_UNKNOWN (2L << 16) +/* BIO_dump unknown extensions */ +#define X509V3_EXT_DUMP_UNKNOWN (3L << 16) + +/* Flags for X509V3_add1_i2d */ + +#define X509V3_ADD_OP_MASK 0xfL +#define X509V3_ADD_DEFAULT 0L +#define X509V3_ADD_APPEND 1L +#define X509V3_ADD_REPLACE 2L +#define X509V3_ADD_REPLACE_EXISTING 3L +#define X509V3_ADD_KEEP_EXISTING 4L +#define X509V3_ADD_DELETE 5L +#define X509V3_ADD_SILENT 0x10 + +DECLARE_STACK_OF(X509_PURPOSE) + +BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new(void); +void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a); +BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a, const unsigned char **in, long len); +int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **out); +extern const ASN1_ITEM BASIC_CONSTRAINTS_it; + +SXNET *SXNET_new(void); +void SXNET_free(SXNET *a); +SXNET *d2i_SXNET(SXNET **a, const unsigned char **in, long len); +int i2d_SXNET(SXNET *a, unsigned char **out); +extern const ASN1_ITEM SXNET_it; +SXNETID *SXNETID_new(void); +void SXNETID_free(SXNETID *a); +SXNETID *d2i_SXNETID(SXNETID **a, const unsigned char **in, long len); +int i2d_SXNETID(SXNETID *a, unsigned char **out); +extern const ASN1_ITEM SXNETID_it; + +int SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user, + int userlen); +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, const char *user, + int userlen); +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, const char *user, + int userlen); + +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, const char *zone); +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); + +AUTHORITY_KEYID *AUTHORITY_KEYID_new(void); +void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a); +AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, const unsigned char **in, long len); +int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **out); +extern const ASN1_ITEM AUTHORITY_KEYID_it; + +PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(void); +void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a); +PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a, const unsigned char **in, long len); +int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **out); +extern const ASN1_ITEM PKEY_USAGE_PERIOD_it; + +GENERAL_NAME *GENERAL_NAME_new(void); +void GENERAL_NAME_free(GENERAL_NAME *a); +GENERAL_NAME *d2i_GENERAL_NAME(GENERAL_NAME **a, const unsigned char **in, long len); +int i2d_GENERAL_NAME(GENERAL_NAME *a, unsigned char **out); +extern const ASN1_ITEM GENERAL_NAME_it; +GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a); +int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b); + + + +ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, + STACK_OF(CONF_VALUE) *extlist); + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret); +int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen); + +GENERAL_NAMES *GENERAL_NAMES_new(void); +void GENERAL_NAMES_free(GENERAL_NAMES *a); +GENERAL_NAMES *d2i_GENERAL_NAMES(GENERAL_NAMES **a, const unsigned char **in, long len); +int i2d_GENERAL_NAMES(GENERAL_NAMES *a, unsigned char **out); +extern const ASN1_ITEM GENERAL_NAMES_it; + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, + GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); + +OTHERNAME *OTHERNAME_new(void); +void OTHERNAME_free(OTHERNAME *a); +OTHERNAME *d2i_OTHERNAME(OTHERNAME **a, const unsigned char **in, long len); +int i2d_OTHERNAME(OTHERNAME *a, unsigned char **out); +extern const ASN1_ITEM OTHERNAME_it; +EDIPARTYNAME *EDIPARTYNAME_new(void); +void EDIPARTYNAME_free(EDIPARTYNAME *a); +EDIPARTYNAME *d2i_EDIPARTYNAME(EDIPARTYNAME **a, const unsigned char **in, long len); +int i2d_EDIPARTYNAME(EDIPARTYNAME *a, unsigned char **out); +extern const ASN1_ITEM EDIPARTYNAME_it; +int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b); +void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value); +void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype); +int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, + ASN1_OBJECT *oid, ASN1_TYPE *value); +int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, + ASN1_OBJECT **poid, ASN1_TYPE **pvalue); + +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + const ASN1_OCTET_STRING *ia5); +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); + +EXTENDED_KEY_USAGE *EXTENDED_KEY_USAGE_new(void); +void EXTENDED_KEY_USAGE_free(EXTENDED_KEY_USAGE *a); +EXTENDED_KEY_USAGE *d2i_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE **a, const unsigned char **in, long len); +int i2d_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE *a, unsigned char **out); +extern const ASN1_ITEM EXTENDED_KEY_USAGE_it; +int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION* a); + +CERTIFICATEPOLICIES *CERTIFICATEPOLICIES_new(void); +void CERTIFICATEPOLICIES_free(CERTIFICATEPOLICIES *a); +CERTIFICATEPOLICIES *d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **a, const unsigned char **in, long len); +int i2d_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES *a, unsigned char **out); +extern const ASN1_ITEM CERTIFICATEPOLICIES_it; +POLICYINFO *POLICYINFO_new(void); +void POLICYINFO_free(POLICYINFO *a); +POLICYINFO *d2i_POLICYINFO(POLICYINFO **a, const unsigned char **in, long len); +int i2d_POLICYINFO(POLICYINFO *a, unsigned char **out); +extern const ASN1_ITEM POLICYINFO_it; +POLICYQUALINFO *POLICYQUALINFO_new(void); +void POLICYQUALINFO_free(POLICYQUALINFO *a); +POLICYQUALINFO *d2i_POLICYQUALINFO(POLICYQUALINFO **a, const unsigned char **in, long len); +int i2d_POLICYQUALINFO(POLICYQUALINFO *a, unsigned char **out); +extern const ASN1_ITEM POLICYQUALINFO_it; +USERNOTICE *USERNOTICE_new(void); +void USERNOTICE_free(USERNOTICE *a); +USERNOTICE *d2i_USERNOTICE(USERNOTICE **a, const unsigned char **in, long len); +int i2d_USERNOTICE(USERNOTICE *a, unsigned char **out); +extern const ASN1_ITEM USERNOTICE_it; +NOTICEREF *NOTICEREF_new(void); +void NOTICEREF_free(NOTICEREF *a); +NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, const unsigned char **in, long len); +int i2d_NOTICEREF(NOTICEREF *a, unsigned char **out); +extern const ASN1_ITEM NOTICEREF_it; + +CRL_DIST_POINTS *CRL_DIST_POINTS_new(void); +void CRL_DIST_POINTS_free(CRL_DIST_POINTS *a); +CRL_DIST_POINTS *d2i_CRL_DIST_POINTS(CRL_DIST_POINTS **a, const unsigned char **in, long len); +int i2d_CRL_DIST_POINTS(CRL_DIST_POINTS *a, unsigned char **out); +extern const ASN1_ITEM CRL_DIST_POINTS_it; +DIST_POINT *DIST_POINT_new(void); +void DIST_POINT_free(DIST_POINT *a); +DIST_POINT *d2i_DIST_POINT(DIST_POINT **a, const unsigned char **in, long len); +int i2d_DIST_POINT(DIST_POINT *a, unsigned char **out); +extern const ASN1_ITEM DIST_POINT_it; +DIST_POINT_NAME *DIST_POINT_NAME_new(void); +void DIST_POINT_NAME_free(DIST_POINT_NAME *a); +DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, const unsigned char **in, long len); +int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **out); +extern const ASN1_ITEM DIST_POINT_NAME_it; +ISSUING_DIST_POINT *ISSUING_DIST_POINT_new(void); +void ISSUING_DIST_POINT_free(ISSUING_DIST_POINT *a); +ISSUING_DIST_POINT *d2i_ISSUING_DIST_POINT(ISSUING_DIST_POINT **a, const unsigned char **in, long len); +int i2d_ISSUING_DIST_POINT(ISSUING_DIST_POINT *a, unsigned char **out); +extern const ASN1_ITEM ISSUING_DIST_POINT_it; + +int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname); + +int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc); + +ACCESS_DESCRIPTION *ACCESS_DESCRIPTION_new(void); +void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a); +ACCESS_DESCRIPTION *d2i_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION **a, const unsigned char **in, long len); +int i2d_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION *a, unsigned char **out); +extern const ASN1_ITEM ACCESS_DESCRIPTION_it; +AUTHORITY_INFO_ACCESS *AUTHORITY_INFO_ACCESS_new(void); +void AUTHORITY_INFO_ACCESS_free(AUTHORITY_INFO_ACCESS *a); +AUTHORITY_INFO_ACCESS *d2i_AUTHORITY_INFO_ACCESS(AUTHORITY_INFO_ACCESS **a, const unsigned char **in, long len); +int i2d_AUTHORITY_INFO_ACCESS(AUTHORITY_INFO_ACCESS *a, unsigned char **out); +extern const ASN1_ITEM AUTHORITY_INFO_ACCESS_it; + +extern const ASN1_ITEM POLICY_MAPPING_it; +POLICY_MAPPING *POLICY_MAPPING_new(void); +void POLICY_MAPPING_free(POLICY_MAPPING *a); +extern const ASN1_ITEM POLICY_MAPPINGS_it; + +extern const ASN1_ITEM GENERAL_SUBTREE_it; +GENERAL_SUBTREE *GENERAL_SUBTREE_new(void); +void GENERAL_SUBTREE_free(GENERAL_SUBTREE *a); + +extern const ASN1_ITEM NAME_CONSTRAINTS_it; +NAME_CONSTRAINTS *NAME_CONSTRAINTS_new(void); +void NAME_CONSTRAINTS_free(NAME_CONSTRAINTS *a); + +POLICY_CONSTRAINTS *POLICY_CONSTRAINTS_new(void); +void POLICY_CONSTRAINTS_free(POLICY_CONSTRAINTS *a); +extern const ASN1_ITEM POLICY_CONSTRAINTS_it; + +GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + int gen_type, const char *value, int is_nc); + +#ifdef HEADER_CONF_H +GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + CONF_VALUE *cnf); +GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); +void X509V3_conf_free(CONF_VALUE *val); + +X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, + const char *value); +X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name, + const char *value); +int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section, + STACK_OF(X509_EXTENSION) **sk); +int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509 *cert); +int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509_REQ *req); +int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509_CRL *crl); + +X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + int ext_nid, const char *value); +X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *name, const char *value); +int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509 *cert); +int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509_REQ *req); +int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509_CRL *crl); + +int X509V3_add_value_bool_nf(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool); +int X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint); +void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); +void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash); +#endif + +char *X509V3_get_string(X509V3_CTX *ctx, const char *name, + const char *section); +STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, const char *section); +void X509V3_string_free(X509V3_CTX *ctx, char *str); +void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, + X509_REQ *req, X509_CRL *crl, int flags); + +int X509V3_add_value(const char *name, const char *value, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_uchar(const char *name, const unsigned char *value, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_bool(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_int(const char *name, const ASN1_INTEGER *aint, + STACK_OF(CONF_VALUE) **extlist); +char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const ASN1_INTEGER *aint); +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value); +char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, const ASN1_ENUMERATED *aint); +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, + const ASN1_ENUMERATED *aint); +int X509V3_EXT_add(X509V3_EXT_METHOD *ext); +int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); +int X509V3_EXT_add_alias(int nid_to, int nid_from); +void X509V3_EXT_cleanup(void); + +const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); +const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); +int X509V3_add_standard_extensions(void); +STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); +void *X509V3_EXT_d2i(X509_EXTENSION *ext); +void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, + int *idx); + + +X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); +int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); + +char *hex_to_string(const unsigned char *buffer, long len); +unsigned char *string_to_hex(const char *str, long *len); + +void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, + int ml); +int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); +int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); + +int X509V3_extensions_print(BIO *out, const char *title, + const STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent); + +int X509_check_ca(X509 *x); +int X509_check_purpose(X509 *x, int id, int ca); +int X509_supported_extension(X509_EXTENSION *ex); +int X509_PURPOSE_set(int *p, int purpose); +int X509_check_issued(X509 *issuer, X509 *subject); +int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); +int X509_PURPOSE_get_count(void); +X509_PURPOSE * X509_PURPOSE_get0(int idx); +int X509_PURPOSE_get_by_sname(const char *sname); +int X509_PURPOSE_get_by_id(int id); +int X509_PURPOSE_add(int id, int trust, int flags, + int (*ck)(const X509_PURPOSE *, const X509 *, int), + const char *name, const char *sname, void *arg); +char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); +char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); +int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); +void X509_PURPOSE_cleanup(void); +int X509_PURPOSE_get_id(const X509_PURPOSE *); +uint32_t X509_get_extension_flags(X509 *x); +uint32_t X509_get_key_usage(X509 *x); +uint32_t X509_get_extended_key_usage(X509 *x); + +STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); +STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); +void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); +STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); + +/* Flags for X509_check_* functions */ +/* Always check subject name for host match even if subject alt names present */ +#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1 +/* Disable wildcard matching for dnsName fields and common name. */ +#define X509_CHECK_FLAG_NO_WILDCARDS 0x2 +/* Wildcards must not match a partial label. */ +#define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4 +/* Allow (non-partial) wildcards to match multiple labels. */ +#define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8 +/* Constraint verifier subdomain patterns to match a single labels. */ +#define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10 +/* Disable checking the CN for a hostname, to support modern validation */ +#define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20 + +/* + * Match reference identifiers starting with "." to any sub-domain. + * This is a non-public flag, turned on implicitly when the subject + * reference identity is a DNS name. + */ +#define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000 + +int X509_check_host(X509 *x, const char *chk, size_t chklen, + unsigned int flags, char **peername); +int X509_check_email(X509 *x, const char *chk, size_t chklen, + unsigned int flags); +int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen, + unsigned int flags); +int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags); + +ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); +ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); +int a2i_ipadd(unsigned char *ipout, const char *ipasc); +int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk, + unsigned long chtype); + +void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); +DECLARE_STACK_OF(X509_POLICY_NODE) + +#ifndef OPENSSL_NO_RFC3779 +typedef struct ASRange_st { + ASN1_INTEGER *min; + ASN1_INTEGER *max; +} ASRange; + +#define ASIdOrRange_id 0 +#define ASIdOrRange_range 1 + +typedef struct ASIdOrRange_st { + int type; + union { + ASN1_INTEGER *id; + ASRange *range; + } u; +} ASIdOrRange; + +typedef STACK_OF(ASIdOrRange) ASIdOrRanges; +DECLARE_STACK_OF(ASIdOrRange) + +#define ASIdentifierChoice_inherit 0 +#define ASIdentifierChoice_asIdsOrRanges 1 + +typedef struct ASIdentifierChoice_st { + int type; + union { + ASN1_NULL *inherit; + ASIdOrRanges *asIdsOrRanges; + } u; +} ASIdentifierChoice; + +typedef struct ASIdentifiers_st { + ASIdentifierChoice *asnum; + ASIdentifierChoice *rdi; +} ASIdentifiers; + +ASRange *ASRange_new(void); +void ASRange_free(ASRange *a); +ASRange *d2i_ASRange(ASRange **a, const unsigned char **in, long len); +int i2d_ASRange(ASRange *a, unsigned char **out); +extern const ASN1_ITEM ASRange_it; + +ASIdOrRange *ASIdOrRange_new(void); +void ASIdOrRange_free(ASIdOrRange *a); +ASIdOrRange *d2i_ASIdOrRange(ASIdOrRange **a, const unsigned char **in, + long len); +int i2d_ASIdOrRange(ASIdOrRange *a, unsigned char **out); +extern const ASN1_ITEM ASIdOrRange_it; + +ASIdentifierChoice *ASIdentifierChoice_new(void); +void ASIdentifierChoice_free(ASIdentifierChoice *a); +ASIdentifierChoice *d2i_ASIdentifierChoice(ASIdentifierChoice **a, + const unsigned char **in, long len); +int i2d_ASIdentifierChoice(ASIdentifierChoice *a, unsigned char **out); +extern const ASN1_ITEM ASIdentifierChoice_it; + +ASIdentifiers *ASIdentifiers_new(void); +void ASIdentifiers_free(ASIdentifiers *a); +ASIdentifiers *d2i_ASIdentifiers(ASIdentifiers **a, const unsigned char **in, + long len); +int i2d_ASIdentifiers(ASIdentifiers *a, unsigned char **out); +extern const ASN1_ITEM ASIdentifiers_it; + +typedef struct IPAddressRange_st { + ASN1_BIT_STRING *min; + ASN1_BIT_STRING *max; +} IPAddressRange; + +#define IPAddressOrRange_addressPrefix 0 +#define IPAddressOrRange_addressRange 1 + +typedef struct IPAddressOrRange_st { + int type; + union { + ASN1_BIT_STRING *addressPrefix; + IPAddressRange *addressRange; + } u; +} IPAddressOrRange; + +typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; +DECLARE_STACK_OF(IPAddressOrRange) + +#define IPAddressChoice_inherit 0 +#define IPAddressChoice_addressesOrRanges 1 + +typedef struct IPAddressChoice_st { + int type; + union { + ASN1_NULL *inherit; + IPAddressOrRanges *addressesOrRanges; + } u; +} IPAddressChoice; + +typedef struct IPAddressFamily_st { + ASN1_OCTET_STRING *addressFamily; + IPAddressChoice *ipAddressChoice; +} IPAddressFamily; + +typedef STACK_OF(IPAddressFamily) IPAddrBlocks; +DECLARE_STACK_OF(IPAddressFamily) + +IPAddressRange *IPAddressRange_new(void); +void IPAddressRange_free(IPAddressRange *a); +IPAddressRange *d2i_IPAddressRange(IPAddressRange **a, + const unsigned char **in, long len); +int i2d_IPAddressRange(IPAddressRange *a, unsigned char **out); +extern const ASN1_ITEM IPAddressRange_it; + +IPAddressOrRange *IPAddressOrRange_new(void); +void IPAddressOrRange_free(IPAddressOrRange *a); +IPAddressOrRange *d2i_IPAddressOrRange(IPAddressOrRange **a, + const unsigned char **in, long len); +int i2d_IPAddressOrRange(IPAddressOrRange *a, unsigned char **out); +extern const ASN1_ITEM IPAddressOrRange_it; + +IPAddressChoice *IPAddressChoice_new(void); +void IPAddressChoice_free(IPAddressChoice *a); +IPAddressChoice *d2i_IPAddressChoice(IPAddressChoice **a, + const unsigned char **in, long len); +int i2d_IPAddressChoice(IPAddressChoice *a, unsigned char **out); +extern const ASN1_ITEM IPAddressChoice_it; + +IPAddressFamily *IPAddressFamily_new(void); +void IPAddressFamily_free(IPAddressFamily *a); +IPAddressFamily *d2i_IPAddressFamily(IPAddressFamily **a, + const unsigned char **in, long len); +int i2d_IPAddressFamily(IPAddressFamily *a, unsigned char **out); +extern const ASN1_ITEM IPAddressFamily_it; + +/* + * API tag for elements of the ASIdentifer SEQUENCE. + */ +#define V3_ASID_ASNUM 0 +#define V3_ASID_RDI 1 + +/* + * AFI values, assigned by IANA. It'd be nice to make the AFI + * handling code totally generic, but there are too many little things + * that would need to be defined for other address families for it to + * be worth the trouble. + */ +#define IANA_AFI_IPV4 1 +#define IANA_AFI_IPV6 2 + +/* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + */ +int X509v3_asid_add_inherit(ASIdentifiers *asid, int which); +int X509v3_asid_add_id_or_range(ASIdentifiers *asid, int which, + ASN1_INTEGER *min, ASN1_INTEGER *max); +int X509v3_addr_add_inherit(IPAddrBlocks *addr, const unsigned afi, + const unsigned *safi); +int X509v3_addr_add_prefix(IPAddrBlocks *addr, const unsigned afi, + const unsigned *safi, unsigned char *a, const int prefixlen); +int X509v3_addr_add_range(IPAddrBlocks *addr, const unsigned afi, + const unsigned *safi, unsigned char *min, unsigned char *max); +unsigned X509v3_addr_get_afi(const IPAddressFamily *f); +int X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, + unsigned char *min, unsigned char *max, const int length); + +/* + * Canonical forms. + */ +int X509v3_asid_is_canonical(ASIdentifiers *asid); +int X509v3_addr_is_canonical(IPAddrBlocks *addr); +int X509v3_asid_canonize(ASIdentifiers *asid); +int X509v3_addr_canonize(IPAddrBlocks *addr); + +/* + * Tests for inheritance and containment. + */ +int X509v3_asid_inherits(ASIdentifiers *asid); +int X509v3_addr_inherits(IPAddrBlocks *addr); +int X509v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b); +int X509v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b); + +/* + * Check whether RFC 3779 extensions nest properly in chains. + */ +int X509v3_asid_validate_path(X509_STORE_CTX *); +int X509v3_addr_validate_path(X509_STORE_CTX *); +int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain, ASIdentifiers *ext, + int allow_inheritance); +int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain, IPAddrBlocks *ext, + int allow_inheritance); + +#endif /* !OPENSSL_NO_RFC3779 */ + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_X509V3_strings(void); + +/* Error codes for the X509V3 functions. */ + +/* Function codes. */ +#define X509V3_F_A2I_GENERAL_NAME 164 +#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 +#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 +#define X509V3_F_COPY_EMAIL 122 +#define X509V3_F_COPY_ISSUER 123 +#define X509V3_F_DO_DIRNAME 144 +#define X509V3_F_DO_EXT_CONF 124 +#define X509V3_F_DO_EXT_I2D 135 +#define X509V3_F_DO_EXT_NCONF 151 +#define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148 +#define X509V3_F_GNAMES_FROM_SECTNAME 156 +#define X509V3_F_HEX_TO_STRING 111 +#define X509V3_F_I2S_ASN1_ENUMERATED 121 +#define X509V3_F_I2S_ASN1_IA5STRING 149 +#define X509V3_F_I2S_ASN1_INTEGER 120 +#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138 +#define X509V3_F_NOTICE_SECTION 132 +#define X509V3_F_NREF_NOS 133 +#define X509V3_F_POLICY_SECTION 131 +#define X509V3_F_PROCESS_PCI_VALUE 150 +#define X509V3_F_R2I_CERTPOL 130 +#define X509V3_F_R2I_PCI 155 +#define X509V3_F_S2I_ASN1_IA5STRING 100 +#define X509V3_F_S2I_ASN1_INTEGER 108 +#define X509V3_F_S2I_ASN1_OCTET_STRING 112 +#define X509V3_F_S2I_ASN1_SKEY_ID 114 +#define X509V3_F_S2I_SKEY_ID 115 +#define X509V3_F_SET_DIST_POINT_NAME 158 +#define X509V3_F_STRING_TO_HEX 113 +#define X509V3_F_SXNET_ADD_ID_ASC 125 +#define X509V3_F_SXNET_ADD_ID_INTEGER 126 +#define X509V3_F_SXNET_ADD_ID_ULONG 127 +#define X509V3_F_SXNET_GET_ID_ASC 128 +#define X509V3_F_SXNET_GET_ID_ULONG 129 +#define X509V3_F_V2I_ASIDENTIFIERS 163 +#define X509V3_F_V2I_ASN1_BIT_STRING 101 +#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139 +#define X509V3_F_V2I_AUTHORITY_KEYID 119 +#define X509V3_F_V2I_BASIC_CONSTRAINTS 102 +#define X509V3_F_V2I_CRLD 134 +#define X509V3_F_V2I_EXTENDED_KEY_USAGE 103 +#define X509V3_F_V2I_GENERAL_NAMES 118 +#define X509V3_F_V2I_GENERAL_NAME_EX 117 +#define X509V3_F_V2I_IDP 157 +#define X509V3_F_V2I_IPADDRBLOCKS 159 +#define X509V3_F_V2I_ISSUER_ALT 153 +#define X509V3_F_V2I_NAME_CONSTRAINTS 147 +#define X509V3_F_V2I_POLICY_CONSTRAINTS 146 +#define X509V3_F_V2I_POLICY_MAPPINGS 145 +#define X509V3_F_V2I_SUBJECT_ALT 154 +#define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160 +#define X509V3_F_V3_GENERIC_EXTENSION 116 +#define X509V3_F_X509V3_ADD1_I2D 140 +#define X509V3_F_X509V3_ADD_VALUE 105 +#define X509V3_F_X509V3_EXT_ADD 104 +#define X509V3_F_X509V3_EXT_ADD_ALIAS 106 +#define X509V3_F_X509V3_EXT_CONF 107 +#define X509V3_F_X509V3_EXT_I2D 136 +#define X509V3_F_X509V3_EXT_NCONF 152 +#define X509V3_F_X509V3_GET_SECTION 142 +#define X509V3_F_X509V3_GET_STRING 143 +#define X509V3_F_X509V3_GET_VALUE_BOOL 110 +#define X509V3_F_X509V3_PARSE_LIST 109 +#define X509V3_F_X509_PURPOSE_ADD 137 +#define X509V3_F_X509_PURPOSE_SET 141 + +/* Reason codes. */ +#define X509V3_R_BAD_IP_ADDRESS 118 +#define X509V3_R_BAD_OBJECT 119 +#define X509V3_R_BN_DEC2BN_ERROR 100 +#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 +#define X509V3_R_DIRNAME_ERROR 149 +#define X509V3_R_DISTPOINT_ALREADY_SET 160 +#define X509V3_R_DUPLICATE_ZONE_ID 133 +#define X509V3_R_ERROR_CONVERTING_ZONE 131 +#define X509V3_R_ERROR_CREATING_EXTENSION 144 +#define X509V3_R_ERROR_IN_EXTENSION 128 +#define X509V3_R_EXPECTED_A_SECTION_NAME 137 +#define X509V3_R_EXTENSION_EXISTS 145 +#define X509V3_R_EXTENSION_NAME_ERROR 115 +#define X509V3_R_EXTENSION_NOT_FOUND 102 +#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103 +#define X509V3_R_EXTENSION_VALUE_ERROR 116 +#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 +#define X509V3_R_ILLEGAL_HEX_DIGIT 113 +#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 +#define X509V3_R_INVALID_MULTIPLE_RDNS 161 +#define X509V3_R_INVALID_ASNUMBER 162 +#define X509V3_R_INVALID_ASRANGE 163 +#define X509V3_R_INVALID_BOOLEAN_STRING 104 +#define X509V3_R_INVALID_EXTENSION_STRING 105 +#define X509V3_R_INVALID_INHERITANCE 165 +#define X509V3_R_INVALID_IPADDRESS 166 +#define X509V3_R_INVALID_NAME 106 +#define X509V3_R_INVALID_NULL_ARGUMENT 107 +#define X509V3_R_INVALID_NULL_NAME 108 +#define X509V3_R_INVALID_NULL_VALUE 109 +#define X509V3_R_INVALID_NUMBER 140 +#define X509V3_R_INVALID_NUMBERS 141 +#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110 +#define X509V3_R_INVALID_OPTION 138 +#define X509V3_R_INVALID_POLICY_IDENTIFIER 134 +#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153 +#define X509V3_R_INVALID_PURPOSE 146 +#define X509V3_R_INVALID_SAFI 164 +#define X509V3_R_INVALID_SECTION 135 +#define X509V3_R_INVALID_SYNTAX 143 +#define X509V3_R_ISSUER_DECODE_ERROR 126 +#define X509V3_R_MISSING_VALUE 124 +#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142 +#define X509V3_R_NO_CONFIG_DATABASE 136 +#define X509V3_R_NO_ISSUER_CERTIFICATE 121 +#define X509V3_R_NO_ISSUER_DETAILS 127 +#define X509V3_R_NO_POLICY_IDENTIFIER 139 +#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154 +#define X509V3_R_NO_PUBLIC_KEY 114 +#define X509V3_R_NO_SUBJECT_DETAILS 125 +#define X509V3_R_ODD_NUMBER_OF_DIGITS 112 +#define X509V3_R_OPERATION_NOT_DEFINED 148 +#define X509V3_R_OTHERNAME_ERROR 147 +#define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155 +#define X509V3_R_POLICY_PATH_LENGTH 156 +#define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157 +#define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158 +#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 +#define X509V3_R_SECTION_NOT_FOUND 150 +#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122 +#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123 +#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111 +#define X509V3_R_UNKNOWN_EXTENSION 129 +#define X509V3_R_UNKNOWN_EXTENSION_NAME 130 +#define X509V3_R_UNKNOWN_OPTION 120 +#define X509V3_R_UNSUPPORTED_OPTION 117 +#define X509V3_R_UNSUPPORTED_TYPE 167 +#define X509V3_R_USER_TOO_LONG 132 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/code/contrib/libfido2/include/tls.h b/code/contrib/libfido2/include/tls.h new file mode 100644 index 0000000..0c9e497 --- /dev/null +++ b/code/contrib/libfido2/include/tls.h @@ -0,0 +1,226 @@ +/* $OpenBSD: tls.h,v 1.62 2022/03/24 15:56:34 tb Exp $ */ +/* + * Copyright (c) 2014 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_TLS_H +#define HEADER_TLS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _MSC_VER +#ifndef LIBRESSL_INTERNAL +#include +typedef SSIZE_T ssize_t; +#endif +#endif + +#include + +#include +#include + +#define TLS_API 20200120 + +#define TLS_PROTOCOL_TLSv1_0 (1 << 1) +#define TLS_PROTOCOL_TLSv1_1 (1 << 2) +#define TLS_PROTOCOL_TLSv1_2 (1 << 3) +#define TLS_PROTOCOL_TLSv1_3 (1 << 4) + +#define TLS_PROTOCOL_TLSv1 \ + (TLS_PROTOCOL_TLSv1_0|TLS_PROTOCOL_TLSv1_1|\ + TLS_PROTOCOL_TLSv1_2|TLS_PROTOCOL_TLSv1_3) + +#define TLS_PROTOCOLS_ALL TLS_PROTOCOL_TLSv1 +#define TLS_PROTOCOLS_DEFAULT (TLS_PROTOCOL_TLSv1_2|TLS_PROTOCOL_TLSv1_3) + +#define TLS_WANT_POLLIN -2 +#define TLS_WANT_POLLOUT -3 + +/* RFC 6960 Section 2.3 */ +#define TLS_OCSP_RESPONSE_SUCCESSFUL 0 +#define TLS_OCSP_RESPONSE_MALFORMED 1 +#define TLS_OCSP_RESPONSE_INTERNALERROR 2 +#define TLS_OCSP_RESPONSE_TRYLATER 3 +#define TLS_OCSP_RESPONSE_SIGREQUIRED 4 +#define TLS_OCSP_RESPONSE_UNAUTHORIZED 5 + +/* RFC 6960 Section 2.2 */ +#define TLS_OCSP_CERT_GOOD 0 +#define TLS_OCSP_CERT_REVOKED 1 +#define TLS_OCSP_CERT_UNKNOWN 2 + +/* RFC 5280 Section 5.3.1 */ +#define TLS_CRL_REASON_UNSPECIFIED 0 +#define TLS_CRL_REASON_KEY_COMPROMISE 1 +#define TLS_CRL_REASON_CA_COMPROMISE 2 +#define TLS_CRL_REASON_AFFILIATION_CHANGED 3 +#define TLS_CRL_REASON_SUPERSEDED 4 +#define TLS_CRL_REASON_CESSATION_OF_OPERATION 5 +#define TLS_CRL_REASON_CERTIFICATE_HOLD 6 +#define TLS_CRL_REASON_REMOVE_FROM_CRL 8 +#define TLS_CRL_REASON_PRIVILEGE_WITHDRAWN 9 +#define TLS_CRL_REASON_AA_COMPROMISE 10 + +#define TLS_MAX_SESSION_ID_LENGTH 32 +#define TLS_TICKET_KEY_SIZE 48 + +struct tls; +struct tls_config; + +typedef ssize_t (*tls_read_cb)(struct tls *_ctx, void *_buf, size_t _buflen, + void *_cb_arg); +typedef ssize_t (*tls_write_cb)(struct tls *_ctx, const void *_buf, + size_t _buflen, void *_cb_arg); + +int tls_init(void); + +const char *tls_config_error(struct tls_config *_config); +const char *tls_error(struct tls *_ctx); + +struct tls_config *tls_config_new(void); +void tls_config_free(struct tls_config *_config); + +const char *tls_default_ca_cert_file(void); + +int tls_config_add_keypair_file(struct tls_config *_config, + const char *_cert_file, const char *_key_file); +int tls_config_add_keypair_mem(struct tls_config *_config, const uint8_t *_cert, + size_t _cert_len, const uint8_t *_key, size_t _key_len); +int tls_config_add_keypair_ocsp_file(struct tls_config *_config, + const char *_cert_file, const char *_key_file, + const char *_ocsp_staple_file); +int tls_config_add_keypair_ocsp_mem(struct tls_config *_config, const uint8_t *_cert, + size_t _cert_len, const uint8_t *_key, size_t _key_len, + const uint8_t *_staple, size_t _staple_len); +int tls_config_set_alpn(struct tls_config *_config, const char *_alpn); +int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file); +int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path); +int tls_config_set_ca_mem(struct tls_config *_config, const uint8_t *_ca, + size_t _len); +int tls_config_set_cert_file(struct tls_config *_config, + const char *_cert_file); +int tls_config_set_cert_mem(struct tls_config *_config, const uint8_t *_cert, + size_t _len); +int tls_config_set_ciphers(struct tls_config *_config, const char *_ciphers); +int tls_config_set_crl_file(struct tls_config *_config, const char *_crl_file); +int tls_config_set_crl_mem(struct tls_config *_config, const uint8_t *_crl, + size_t _len); +int tls_config_set_dheparams(struct tls_config *_config, const char *_params); +int tls_config_set_ecdhecurve(struct tls_config *_config, const char *_curve); +int tls_config_set_ecdhecurves(struct tls_config *_config, const char *_curves); +int tls_config_set_key_file(struct tls_config *_config, const char *_key_file); +int tls_config_set_key_mem(struct tls_config *_config, const uint8_t *_key, + size_t _len); +int tls_config_set_keypair_file(struct tls_config *_config, + const char *_cert_file, const char *_key_file); +int tls_config_set_keypair_mem(struct tls_config *_config, const uint8_t *_cert, + size_t _cert_len, const uint8_t *_key, size_t _key_len); +int tls_config_set_keypair_ocsp_file(struct tls_config *_config, + const char *_cert_file, const char *_key_file, const char *_staple_file); +int tls_config_set_keypair_ocsp_mem(struct tls_config *_config, const uint8_t *_cert, + size_t _cert_len, const uint8_t *_key, size_t _key_len, + const uint8_t *_staple, size_t staple_len); +int tls_config_set_ocsp_staple_mem(struct tls_config *_config, + const uint8_t *_staple, size_t _len); +int tls_config_set_ocsp_staple_file(struct tls_config *_config, + const char *_staple_file); +int tls_config_set_protocols(struct tls_config *_config, uint32_t _protocols); +int tls_config_set_session_fd(struct tls_config *_config, int _session_fd); +int tls_config_set_verify_depth(struct tls_config *_config, int _verify_depth); + +void tls_config_prefer_ciphers_client(struct tls_config *_config); +void tls_config_prefer_ciphers_server(struct tls_config *_config); + +void tls_config_insecure_noverifycert(struct tls_config *_config); +void tls_config_insecure_noverifyname(struct tls_config *_config); +void tls_config_insecure_noverifytime(struct tls_config *_config); +void tls_config_verify(struct tls_config *_config); + +void tls_config_ocsp_require_stapling(struct tls_config *_config); +void tls_config_verify_client(struct tls_config *_config); +void tls_config_verify_client_optional(struct tls_config *_config); + +void tls_config_clear_keys(struct tls_config *_config); +int tls_config_parse_protocols(uint32_t *_protocols, const char *_protostr); + +int tls_config_set_session_id(struct tls_config *_config, + const unsigned char *_session_id, size_t _len); +int tls_config_set_session_lifetime(struct tls_config *_config, int _lifetime); +int tls_config_add_ticket_key(struct tls_config *_config, uint32_t _keyrev, + unsigned char *_key, size_t _keylen); + +struct tls *tls_client(void); +struct tls *tls_server(void); +int tls_configure(struct tls *_ctx, struct tls_config *_config); +void tls_reset(struct tls *_ctx); +void tls_free(struct tls *_ctx); + +int tls_accept_fds(struct tls *_ctx, struct tls **_cctx, int _fd_read, + int _fd_write); +int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket); +int tls_accept_cbs(struct tls *_ctx, struct tls **_cctx, + tls_read_cb _read_cb, tls_write_cb _write_cb, void *_cb_arg); +int tls_connect(struct tls *_ctx, const char *_host, const char *_port); +int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write, + const char *_servername); +int tls_connect_servername(struct tls *_ctx, const char *_host, + const char *_port, const char *_servername); +int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername); +int tls_connect_cbs(struct tls *_ctx, tls_read_cb _read_cb, + tls_write_cb _write_cb, void *_cb_arg, const char *_servername); +int tls_handshake(struct tls *_ctx); +ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen); +ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen); +int tls_close(struct tls *_ctx); + +int tls_peer_cert_provided(struct tls *_ctx); +int tls_peer_cert_contains_name(struct tls *_ctx, const char *_name); + +const char *tls_peer_cert_hash(struct tls *_ctx); +const char *tls_peer_cert_issuer(struct tls *_ctx); +const char *tls_peer_cert_subject(struct tls *_ctx); +time_t tls_peer_cert_notbefore(struct tls *_ctx); +time_t tls_peer_cert_notafter(struct tls *_ctx); +const uint8_t *tls_peer_cert_chain_pem(struct tls *_ctx, size_t *_len); + +const char *tls_conn_alpn_selected(struct tls *_ctx); +const char *tls_conn_cipher(struct tls *_ctx); +int tls_conn_cipher_strength(struct tls *_ctx); +const char *tls_conn_servername(struct tls *_ctx); +int tls_conn_session_resumed(struct tls *_ctx); +const char *tls_conn_version(struct tls *_ctx); + +uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); +void tls_unload_file(uint8_t *_buf, size_t len); + +int tls_ocsp_process_response(struct tls *_ctx, const unsigned char *_response, + size_t _size); +int tls_peer_ocsp_cert_status(struct tls *_ctx); +int tls_peer_ocsp_crl_reason(struct tls *_ctx); +time_t tls_peer_ocsp_next_update(struct tls *_ctx); +int tls_peer_ocsp_response_status(struct tls *_ctx); +const char *tls_peer_ocsp_result(struct tls *_ctx); +time_t tls_peer_ocsp_revocation_time(struct tls *_ctx); +time_t tls_peer_ocsp_this_update(struct tls *_ctx); +const char *tls_peer_ocsp_url(struct tls *_ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* HEADER_TLS_H */ diff --git a/code/contrib/libfido2/include/zconf.h b/code/contrib/libfido2/include/zconf.h new file mode 100644 index 0000000..352f552 --- /dev/null +++ b/code/contrib/libfido2/include/zconf.h @@ -0,0 +1,536 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H +/* #undef Z_PREFIX */ +/* #undef Z_HAVE_UNISTD_H */ + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols and init macros */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_bits z__tr_flush_bits +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# define adler32_z z_adler32_z +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define crc32_z z_crc32_z +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateGetDictionary z_deflateGetDictionary +# define deflateInit z_deflateInit +# define deflateInit2 z_deflateInit2 +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzfread z_gzfread +# define gzfwrite z_gzfwrite +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzvprintf z_gzvprintf +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit z_inflateBackInit +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCodesUsed z_inflateCodesUsed +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetDictionary z_inflateGetDictionary +# define inflateGetHeader z_inflateGetHeader +# define inflateInit z_inflateInit +# define inflateInit2 z_inflateInit2 +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateResetKeep z_inflateResetKeep +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateValidate z_inflateValidate +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# define uncompress2 z_uncompress2 +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +#ifdef Z_SOLO + typedef unsigned long z_size_t; +#else +# define z_longlong long long +# if defined(NO_SIZE_T) + typedef unsigned NO_SIZE_T z_size_t; +# elif defined(STDC) +# include + typedef size_t z_size_t; +# else + typedef unsigned long z_size_t; +# endif +# undef z_longlong +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus about 7 kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# elif (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# elif (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_UNISTD_H +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_STDARG_H +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +# include /* for va_list */ +# endif +#endif + +#ifdef _WIN32 +# ifndef Z_SOLO +# include /* for wchar_t */ +# endif +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) +# define Z_HAVE_UNISTD_H +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/code/contrib/libfido2/include/zlib.h b/code/contrib/libfido2/include/zlib.h new file mode 100644 index 0000000..4a98e38 --- /dev/null +++ b/code/contrib/libfido2/include/zlib.h @@ -0,0 +1,1935 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.12, March 11th, 2022 + + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.12" +#define ZLIB_VERNUM 0x12c0 +#define ZLIB_VER_MAJOR 1 +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 12 +#define ZLIB_VER_SUBREVISION 0 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed data. + This version of the library supports only one compression method (deflation) + but other algorithms will be added later and will have the same stream + interface. + + Compression can be done in a single step if the buffers are large enough, + or can be done by repeated calls of the compression function. In the latter + case, the application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip and raw deflate streams in + memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never crash + even in the case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte will go here */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has dropped + to zero. It must update next_out and avail_out when avail_out has dropped + to zero. The application must initialize zalloc, zfree and opaque before + calling the init function. All other fields are set by the compression + library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. In that case, zlib is thread-safe. When zalloc and zfree are + Z_NULL on entry to the initialization function, they are set to internal + routines that use the standard library functions malloc() and free(). + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this if + the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers + returned by zalloc for objects of exactly 65536 bytes *must* have their + offset normalized to zero. The default allocation function provided by this + library ensures this (see zutil.c). To reduce memory requirements and avoid + any allocation of 64K objects, at the expense of compression ratio, compile + the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or progress + reports. After compression, total_in holds the total size of the + uncompressed data and may be saved for use by the decompressor (particularly + if the decompressor wants to decompress everything in a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field for deflate() */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is not + compatible with the zlib.h header file used by the application. This check + is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. If + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at all + (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION + requests a default compromise between speed and compression (currently + equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if level is not a valid compression level, or + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). msg is set to null + if there is no error message. deflateInit does not perform any compression: + this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary. Some output may be provided even if + flush is zero. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating avail_in or avail_out accordingly; avail_out should + never be zero before the call. The application can consume the compressed + output when it wants, for example when the output buffer is full (avail_out + == 0), or after each call of deflate(). If deflate returns Z_OK and with + zero avail_out, it must be called again after making room in the output + buffer because there might be more output pending. See deflatePending(), + which can be used if desired to determine whether or not there is more ouput + in that case. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumulate before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In + particular avail_in is zero after the call if enough output space has been + provided before the call.) Flushing may degrade compression for some + compression algorithms and so it should be used only when necessary. This + completes the current deflate block and follows it with an empty stored block + that is three bits plus filler bits to the next byte, followed by four bytes + (00 00 ff ff). + + If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the + output buffer, but the output is not aligned to a byte boundary. All of the + input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. + This completes the current deflate block and follows it with an empty fixed + codes block that is 10 bits long. This assures that enough bytes are output + in order for the decompressor to finish the block before the empty fixed + codes block. + + If flush is set to Z_BLOCK, a deflate block is completed and emitted, as + for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to + seven bits of the current block are held to be written as the next byte after + the next deflate block is completed. In this case, the decompressor may not + be provided enough bits at this point in order to complete decompression of + the data provided so far to the compressor. It may need to wait for the next + block to be emitted. This is for advanced applications that need to control + the emission of deflate blocks. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there was + enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this + function must be called again with Z_FINISH and more output space (updated + avail_out) but no more input data, until it returns with Z_STREAM_END or an + error. After deflate has returned Z_STREAM_END, the only possible operations + on the stream are deflateReset or deflateEnd. + + Z_FINISH can be used in the first deflate call after deflateInit if all the + compression is to be done in a single step. In order to complete in one + call, avail_out must be at least the value returned by deflateBound (see + below). Then deflate is guaranteed to return Z_STREAM_END. If not enough + output space is provided, deflate will not return Z_STREAM_END, and it must + be called again as described above. + + deflate() sets strm->adler to the Adler-32 checksum of all input read + so far (that is, total_in bytes). If a gzip stream is being generated, then + strm->adler will be the CRC-32 checksum of the input read so far. (See + deflateInit2 below.) + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is + considered binary. This field is only for information purposes and does not + affect the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was Z_NULL or the state was inadvertently written over + by the application), or Z_BUF_ERROR if no progress is possible (for example + avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and + deflate() can be called again with more input and more output space to + continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, msg + may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. In the current version of inflate, the provided input is not + read or consumed. The allocation of a sliding window will be deferred to + the first call of inflate (if the decompression does not complete on the + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit does not perform any decompression. + Actual decompression will be done by inflate(). So next_in, and avail_in, + next_out, and avail_out are unused and unchanged. The current + implementation of inflateInit() does not process any header information -- + that is deferred until inflate() is called. +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), then next_in and avail_in are updated + accordingly, and processing will resume at this point for the next call of + inflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there is + no more input data or no more space in the output buffer (see below about + the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating the next_* and avail_* values accordingly. If the + caller of inflate() does not provide both available input and available + output space, it is possible that there will be no progress made. The + application can consume the uncompressed output when it wants, for example + when the output buffer is full (avail_out == 0), or after each call of + inflate(). If inflate returns Z_OK and with zero avail_out, it must be + called again after making room in the output buffer because there might be + more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, + Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() + stop if and when it gets to the next deflate block boundary. When decoding + the zlib or gzip format, this will cause inflate() to return immediately + after the header and before the first block. When doing a raw inflate, + inflate() will go ahead and process the first block, and will return when it + gets to the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + To assist in this, on return inflate() always sets strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 if + inflate() is currently decoding the last block in the deflate stream, plus + 128 if inflate() returned immediately after decoding an end-of-block code or + decoding the complete header up to just before the first byte of the deflate + stream. The end-of-block will not be indicated until all of the uncompressed + data from that block has been written to strm->next_out. The number of + unused bits may in general be greater than seven, except when bit 7 of + data_type is set, in which case the number of unused bits will be less than + eight. data_type is set as noted here every time inflate() returns for all + flush options, and so can be used to determine the amount of currently + consumed input in bits. + + The Z_TREES option behaves as Z_BLOCK does, but it also returns when the + end of each deflate block header is reached, before any actual data in that + block is decoded. This allows the caller to determine the length of the + deflate block header for later use in random access within a deflate block. + 256 is added to the value of strm->data_type when inflate() returns + immediately after reaching the end of the deflate block header. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step (a + single call of inflate), the parameter flush should be set to Z_FINISH. In + this case all pending input is processed and all pending output is flushed; + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the effects of the flush parameter in this implementation are + on the return value of inflate() as noted below, when inflate() returns early + when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of + memory for a sliding window when Z_FINISH is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the Adler-32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the Adler-32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed Adler-32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() can decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically, if requested when + initializing with inflateInit2(). Any information contained in the gzip + header is not retained unless inflateGetHeader() is used. When processing + gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output + produced so far. The CRC-32 is checked against the gzip trailer, as is the + uncompressed length, modulo 2^32. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value, in which case strm->msg points to a string with a more specific + error), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL, or the state was inadvertently written over + by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR + if no progress was possible or if there was not enough room in the output + buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may + then call inflateSync() to look for a good compression block if a partial + recovery of the data is to be attempted. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state + was inconsistent. +*/ + + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields zalloc, zfree and opaque must be initialized before by the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + For the current implementation of deflate(), a windowBits value of 8 (a + window size of 256 bytes) is not supported. As a result, a request for 8 + will result in 9 (a 512-byte window). In that case, providing 8 to + inflateInit2() will result in an error when the zlib header with 9 is + checked against the initialization of inflate(). The remedy is to not use 8 + with deflateInit2() with this initialization, or at least in that case use 9 + with inflateInit2(). + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute a check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), no + header crc, and the operating system will be set to the appropriate value, + if the operating system was determined at compile time. If a gzip stream is + being written, strm->adler is a CRC-32 instead of an Adler-32. + + For raw deflate or gzip encoding, a request for a 256-byte window is + rejected as invalid, since only the zlib header provides a means of + transmitting the window size to the decompressor. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but is + slow and reduces compression ratio; memLevel=9 uses maximum memory for + optimal speed. The default value is 8. See zconf.h for total memory usage + as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as + fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The + strategy parameter only affects the compression ratio but not the + correctness of the compressed output even if it is not set appropriately. + Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler + decoder for special applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid + method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is + incompatible with the version assumed by the caller (ZLIB_VERSION). msg is + set to null if there is no error message. deflateInit2 does not perform any + compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. When using the zlib format, this + function must be called immediately after deflateInit, deflateInit2 or + deflateReset, and before any call of deflate. When doing raw deflate, this + function must be called either before any call of deflate, or immediately + after the completion of a deflate block, i.e. after all input has been + consumed and all output has been delivered when using any of the flush + options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The + compressor and decompressor must use exactly the same dictionary (see + inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size + provided in deflateInit or deflateInit2. Thus the strings most likely to be + useful should be put at the end of the dictionary, not at the front. In + addition, the current implementation of deflate will use at most the window + size minus 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the Adler-32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler-32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + Adler-32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if not at a block boundary for raw deflate). deflateSetDictionary does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by deflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If deflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similary, if dictLength is Z_NULL, then it is not set. + + deflateGetDictionary() may return a length less than the window size, even + when more than the window size in input has been provided. It may return up + to 258 bytes less in that case, due to how zlib's implementation of deflate + manages the sliding window and lookahead for matches, where matches can be + up to 258 bytes long. If the application needs the last window-size bytes of + input, then that would need to be saved by the application outside of zlib. + + deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and can + consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, but + does not free and reallocate the internal compression state. The stream + will leave the compression level and any other attributes that may have been + set unchanged. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2(). This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression approach (which is a function of the level) or the + strategy is changed, and if there have been any deflate() calls since the + state was initialized or reset, then the input available so far is + compressed with the old level and strategy using deflate(strm, Z_BLOCK). + There are three approaches for the compression levels 0, 1..3, and 4..9 + respectively. The new level and strategy will take effect at the next call + of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not + take effect. In this case, deflateParams() can be called again with the + same parameters and more output space to try again. + + In order to assure a change in the parameters on the first try, the + deflate stream should be flushed using deflate() with Z_BLOCK or other flush + request until strm.avail_out is not zero, before calling deflateParams(). + Then no more input data should be provided before the deflateParams() call. + If this is done, the old level and strategy will be applied to the data + compressed before deflateParams(), and the new level and strategy will be + applied to the the data compressed after deflateParams(). + + deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream + state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if + there was not enough output space to complete the compression of the + available input data before a change in the strategy or approach. Note that + in the case of a Z_BUF_ERROR, the parameters are not changed. A return + value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be + retried with more output space. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() or + deflateInit2(), and after deflateSetHeader(), if used. This would be used + to allocate an output buffer for deflation in a single pass, and so would be + called before deflate(). If that first deflate() call is provided the + sourceLen input bytes, an output buffer allocated to the size returned by + deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed + to return Z_STREAM_END. Note that it is possible for the compressed size to + be larger than the value returned by deflateBound() if flush options other + than Z_FINISH or Z_NO_FLUSH are used. +*/ + +ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, + unsigned *pending, + int *bits)); +/* + deflatePending() returns the number of bytes and bits of output that have + been generated, but not yet provided in the available output. The bytes not + provided would be due to the available output space having being consumed. + The number of bits of output not provided are between 0 and 7, where they + await more bits to join them in order to fill out a full byte. If pending + or bits are Z_NULL, then those values are not set. + + deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the bits + leftover from a previous deflate stream when appending to it. As such, this + function can only be used for raw deflate, and must be used before the first + deflate() call after a deflateInit2() or deflateReset(). bits must be less + than or equal to 16, and that many of the least significant bits of value + will be inserted in the output. + + deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough + room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be zero to request that inflate use the window size in + the zlib header of the compressed stream. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an Adler-32 or a CRC-32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a + CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see + below), inflate() will *not* automatically decode concatenated gzip members. + inflate() will return Z_STREAM_END at the end of the gzip member. The state + would need to be reset to continue decoding a subsequent gzip member. This + *must* be done if there is more data after a gzip member, in order for the + decompression to be compliant with the gzip standard (RFC 1952). + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit2 does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit2() does not process any header information -- that is + deferred until inflate() is called. +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler-32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called at any + time to set the dictionary. If the provided dictionary is smaller than the + window and there is already data in the window, then the provided dictionary + will amend what's there. The application must insure that the dictionary + that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler-32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by inflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If inflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similary, if dictLength is Z_NULL, then it is not set. + + inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a possible full flush point (see above + for the description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync searches for a 00 00 FF FF pattern in the compressed data. + All full flush points have this pattern, but not all occurrences of this + pattern are full flush points. + + inflateSync returns Z_OK if a possible full flush point has been found, + Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point + has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. + In the success case, the application may save the current current value of + total_in which indicates where valid compressed data was found. In the + error case, the application may repeatedly call inflateSync, providing more + input each time, until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate the internal decompression state. The + stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, + int windowBits)); +/* + This function is the same as inflateReset, but it also permits changing + the wrap and window size requests. The windowBits parameter is interpreted + the same as it is for inflateInit2. If the window size is changed, then the + memory allocated for the window is freed, and the window will be reallocated + by inflate() if needed. + + inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL), or if + the windowBits parameter is invalid. +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + If bits is negative, then the input stream bit buffer is emptied. Then + inflatePrime() can be called again to put bits in the buffer. This is used + to clear out bits leftover after feeding inflate a block description prior + to feeding inflate codes. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +/* + This function returns two values, one in the lower 16 bits of the return + value, and the other in the remaining upper bits, obtained by shifting the + return value down 16 bits. If the upper value is -1 and the lower value is + zero, then inflate() is currently decoding information outside of a block. + If the upper value is -1 and the lower value is non-zero, then inflate is in + the middle of a stored block, with the lower value equaling the number of + bytes from the input remaining to copy. If the upper value is not -1, then + it is the number of bits back from the current bit position in the input of + the code (literal or length/distance pair) currently being processed. In + that case the lower value is the number of bytes already emitted for that + code. + + A code is being processed if inflate is waiting for more input to complete + decoding of the code, or if it has completed decoding but is waiting for + more output space to write the literal or match data. + + inflateMark() is used to mark locations in the input data for random + access, which may be at bit positions, and to note those cases where the + output of a code may span boundaries of random access blocks. The current + location in the input stream can be determined from avail_in and data_type + as noted in the description for the Z_BLOCK flush parameter for inflate. + + inflateMark returns the value noted above, or -65536 if the provided + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be + used to force inflate() to return immediately after header processing is + complete and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When any + of extra, name, or comment are not Z_NULL and the respective field is not + present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the parameters are invalid, Z_MEM_ERROR if the internal state could not be + allocated, or Z_VERSION_ERROR if the version of the library does not match + the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is potentially more efficient than + inflate() for file i/o applications, in that it avoids copying between the + output and the sliding window by simply making the window itself the output + buffer. inflate() can be faster on modern CPUs when used with large + buffers. inflateBack() trusts the application to not change the output + buffer passed by the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free the + allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects only + the raw deflate stream to decompress. This is different from the default + behavior of inflate(), which expects a zlib header and trailer around the + deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero -- buf is ignored in that + case -- and inflateBack() will return a buffer error. inflateBack() will + call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. + out() should return zero on success, or non-zero on failure. If out() + returns non-zero, inflateBack() will return with an error. Neither in() nor + out() are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format error + in the deflate stream (in which case strm->msg is set to indicate the nature + of the error), or Z_STREAM_ERROR if the stream was not properly initialized. + In the case of Z_BUF_ERROR, an input or output error can be distinguished + using strm->next_in which will be Z_NULL only if in() returned an error. If + strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning + non-zero. (in() will always be called before out(), so strm->next_in is + assured to be defined if out() returns non-zero.) Note that inflateBack() + cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: ZLIB_DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + +#ifndef Z_SOLO + + /* utility functions */ + +/* + The following utility functions are implemented on top of the basic + stream-oriented functions. To simplify the interface, some default options + are assumed (compression level and memory usage, standard memory allocation + functions). The source code of these utility functions can be modified if + you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. compress() is equivalent to compress2() with a level + parameter of Z_DEFAULT_COMPRESSION. + + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before a + compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, destLen + is the actual size of the uncompressed data. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In + the case where there is not enough room, uncompress() will fill the output + buffer with the uncompressed data up to that point. +*/ + +ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen)); +/* + Same as uncompress, except that sourceLen is a pointer, where the + length of the source is *sourceLen. On return, *sourceLen is the number of + source bytes consumed. +*/ + + /* gzip file access functions */ + +/* + This library supports reading and writing files in gzip (.gz) format with + an interface similar to that of stdio, using the functions that start with + "gz". The gzip format is different from the zlib format. gzip is a gzip + wrapper, documented in RFC 1952, wrapped around a deflate stream. +*/ + +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ + +/* +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); + + Open the gzip (.gz) file at path for reading and decompressing, or + compressing and writing. The mode parameter is as in fopen ("rb" or "wb") + but can also include a compression level ("wb9") or a strategy: 'f' for + filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", + 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression + as in "wb9F". (See the description of deflateInit2 for more information + about the strategy parameter.) 'T' will request transparent writing or + appending with no compression and not using the gzip format. + + "a" can be used instead of "w" to request that the gzip stream that will + be written be appended to the file. "+" will result in an error, since + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. + + These functions, as well as gzip, will read and decode a sequence of gzip + streams in a file. The append function of gzopen() can be used to create + such a file. (Also see gzflush() for another way to do this.) When + appending, gzopen does not test whether the file begins with a gzip stream, + nor does it look for the end of the gzip streams to begin appending. gzopen + will simply append a gzip stream to the existing file. + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. When + reading, this will be detected automatically by looking for the magic two- + byte gzip header. + + gzopen returns NULL if the file could not be opened, if there was + insufficient memory to allocate the gzFile state, or if an invalid mode was + specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). + errno can be checked to determine if the reason gzopen failed was that the + file could not be opened. +*/ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + Associate a gzFile with the file descriptor fd. File descriptors are + obtained from calls like open, dup, creat, pipe or fileno (if the file has + been previously opened with fopen). The mode parameter is as in gzopen. + + The next call of gzclose on the returned gzFile will also close the file + descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor + fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, + mode);. The duplicated descriptor should be saved to avoid a leak, since + gzdopen does not close fd if it fails. If you are using fileno() to get the + file descriptor from a FILE *, then you will have to use dup() to avoid + double-close()ing the file descriptor. Both gzclose() and fclose() will + close the associated file descriptor, so they need to have different file + descriptors. + + gzdopen returns NULL if there was insufficient memory to allocate the + gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not + provided, or '+' was provided), or if fd is -1. The file descriptor is not + used until the next gz* read, write, seek, or close operation, so gzdopen + will not detect if fd is invalid (unless fd is -1). +*/ + +ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +/* + Set the internal buffer size used by this library's functions for file to + size. The default buffer size is 8192 bytes. This function must be called + after gzopen() or gzdopen(), and before any other calls that read or write + the file. The buffer memory allocation is always deferred to the first read + or write. Three times that size in buffer space is allocated. A larger + buffer size of, for example, 64K or 128K bytes will noticeably increase the + speed of decompression (reading). + + The new buffer size also affects the maximum length for gzprintf(). + + gzbuffer() returns 0 on success, or -1 on failure, such as being called + too late. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level and strategy for file. See the + description of deflateInit2 for the meaning of these parameters. Previously + provided data is flushed before applying the parameter changes. + + gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not + opened for writing, Z_ERRNO if there is an error writing the flushed data, + or Z_MEM_ERROR if there is a memory allocation error. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Read and decompress up to len uncompressed bytes from file into buf. If + the input file is not in gzip format, gzread copies the given number of + bytes into the buffer directly from the file. + + After reaching the end of a gzip stream in the input, gzread will continue + to read, looking for another gzip stream. Any number of gzip streams may be + concatenated in the input file, and will all be decompressed by gzread(). + If something other than a gzip stream is encountered after a gzip stream, + that remaining trailing garbage is ignored (and no error is returned). + + gzread can be used to read a gzip file that is being concurrently written. + Upon reaching the end of the input, gzread will return with the available + data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then + gzclearerr can be used to clear the end of file indicator in order to permit + gzread to be tried again. Z_OK indicates that a gzip stream was completed + on the last gzread. Z_BUF_ERROR indicates that the input file ended in the + middle of a gzip stream. Note that gzread does not return -1 in the event + of an incomplete gzip stream. This error is deferred until gzclose(), which + will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip + stream. Alternatively, gzerror can be used before gzclose to detect this + case. + + gzread returns the number of uncompressed bytes actually read, less than + len for end of file, or -1 for error. If len is too large to fit in an int, + then nothing is read, -1 is returned, and the error state is set to + Z_STREAM_ERROR. +*/ + +ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, + gzFile file)); +/* + Read and decompress up to nitems items of size size from file into buf, + otherwise operating as gzread() does. This duplicates the interface of + stdio's fread(), with size_t request and return types. If the library + defines size_t, then z_size_t is identical to size_t. If not, then z_size_t + is an unsigned integer type that can contain a pointer. + + gzfread() returns the number of full items read of size size, or zero if + the end of the file was reached and a full item could not be read, or if + there was an error. gzerror() must be consulted if zero is returned in + order to determine if there was an error. If the multiplication of size and + nitems overflows, i.e. the product does not fit in a z_size_t, then nothing + is read, zero is returned, and the error state is set to Z_STREAM_ERROR. + + In the event that the end of file is reached and only a partial item is + available at the end, i.e. the remaining uncompressed data length is not a + multiple of size, then the final partial item is nevetheless read into buf + and the end-of-file flag is set. The length of the partial item read is not + provided, but could be inferred from the result of gztell(). This behavior + is the same as the behavior of fread() implementations in common libraries, + but it prevents the direct use of gzfread() to read a concurrently written + file, reseting and retrying on end-of-file, when size is not 1. +*/ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +/* + Compress and write the len uncompressed bytes at buf to file. gzwrite + returns the number of uncompressed bytes written or 0 in case of error. +*/ + +ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, + z_size_t nitems, gzFile file)); +/* + Compress and write nitems items of size size from buf to file, duplicating + the interface of stdio's fwrite(), with size_t request and return types. If + the library defines size_t, then z_size_t is identical to size_t. If not, + then z_size_t is an unsigned integer type that can contain a pointer. + + gzfwrite() returns the number of full items written of size size, or zero + if there was an error. If the multiplication of size and nitems overflows, + i.e. the product does not fit in a z_size_t, then nothing is written, zero + is returned, and the error state is set to Z_STREAM_ERROR. +*/ + +ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +/* + Convert, format, compress, and write the arguments (...) to file under + control of the string format, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written, or a negative zlib error code in case + of error. The number of uncompressed bytes written is limited to 8191, or + one less than the buffer size given to gzbuffer(). The caller should assure + that this limit is not exceeded. If it is exceeded, then gzprintf() will + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf(), + because the secure snprintf() or vsnprintf() functions were not available. + This can be determined using zlibCompileFlags(). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Compress and write the given null-terminated string s to file, excluding + the terminating null character. + + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Read and decompress bytes from file into buf, until len-1 characters are + read, or until a newline character is read and transferred to buf, or an + end-of-file condition is encountered. If any characters are read or if len + is one, the string is terminated with a null character. If no characters + are read due to an end-of-file or len is less than one, then the buffer is + left untouched. + + gzgets returns buf which is a null-terminated string, or it returns NULL + for end-of-file or in case of error. If there was an error, the contents at + buf are indeterminate. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Compress and write c, converted to an unsigned char, into file. gzputc + returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Read and decompress one byte from file. gzgetc returns this byte or -1 + in case of end of file or error. This is implemented as a macro for speed. + As such, it does not do all of the checking the other functions do. I.e. + it does not check to see if file is NULL, nor whether the structure file + points to has been clobbered or not. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push c back onto the stream for file to be read as the first character on + the next read. At least one character of push-back is always allowed. + gzungetc() returns the character pushed, or -1 on failure. gzungetc() will + fail if c is -1, and may fail if a character has been pushed but not read + yet. If gzungetc is used immediately after gzopen or gzdopen, at least the + output buffer size of pushed characters is allowed. (See gzbuffer above.) + The pushed character will be discarded if the stream is repositioned with + gzseek() or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flush all pending output to file. The parameter flush is as in the + deflate() function. The return value is the zlib error number (see function + gzerror below). gzflush is only permitted when writing. + + If the flush parameter is Z_FINISH, the remaining data is written and the + gzip stream is completed in the output. If gzwrite() is called again, a new + gzip stream will be started in the output. gzread() is able to read such + concatenated gzip streams. + + gzflush should be called only when strictly necessary because it will + degrade compression if called too often. +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); + + Set the starting position to offset relative to whence for the next gzread + or gzwrite on file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewind file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). +*/ + +/* +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); + + Return the starting position for the next gzread or gzwrite on file. + This position represents a number of bytes in the uncompressed data stream, + and is zero when starting, even if appending or reading a gzip stream from + the middle of a file using gzdopen(). + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); + + Return the current compressed (actual) read or write offset of file. This + offset includes the count of bytes that precede the gzip stream, for example + when appending or when using gzdopen() for reading. When reading, the + offset does not include as yet unused buffered input. This information can + be used for a progress indicator. On error, gzoffset() returns -1. +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Return true (1) if the end-of-file indicator for file has been set while + reading, false (0) otherwise. Note that the end-of-file indicator is set + only if the read tried to go past the end of the input, but came up short. + Therefore, just like feof(), gzeof() may return false even if there is no + more data to read, in the event that the last read request was for the exact + number of bytes remaining in the input file. This will happen if the input + file size is an exact multiple of the buffer size. + + If gzeof() returns true, then the read functions will return no more data, + unless the end-of-file indicator is reset by gzclearerr() and the input file + has grown since the previous end of file was detected. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Return true (1) if file is being copied directly while reading, or false + (0) if file is a gzip stream being decompressed. + + If the input file is empty, gzdirect() will return true, since the input + does not contain a gzip stream. + + If gzdirect() is used immediately after gzopen() or gzdopen() it will + cause buffers to be allocated to allow reading the file to determine if it + is a gzip file. Therefore if gzbuffer() is used, it should be called before + gzdirect(). + + When writing, gzdirect() returns true (1) if transparent writing was + requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: + gzdirect() is not needed when writing. Transparent writing must be + explicitly requested, so the application already knows the answer. When + linking statically, using gzdirect() will include all of the zlib code for + gzip file reading and decompression, which may not be desired.) +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flush all pending output for file, if necessary, close file and + deallocate the (de)compression state. Note that once file is closed, you + cannot call gzerror with file, since its structures have been deallocated. + gzclose must not be called more than once on the same file, just as free + must not be called more than once on the same allocation. + + gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a + file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the + last read ended in the middle of a gzip stream, or Z_OK on success. +*/ + +ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +/* + Same as gzclose(), but gzclose_r() is only for use when reading, and + gzclose_w() is only for use when writing or appending. The advantage to + using these instead of gzclose() is that they avoid linking in zlib + compression or decompression code that is not used when only reading or only + writing respectively. If gzclose() is used, then both compression and + decompression code will be included the application when linking to a static + zlib library. +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Return the error message for the last error which occurred on file. + errnum is set to zlib error number. If an error occurred in the file system + and not in the compression library, errnum is set to Z_ERRNO and the + application may consult errno to get the exact error code. + + The application must not modify the returned string. Future calls to + this function may invalidate the previously returned string. If file is + closed, then the string previously returned by gzerror will no longer be + available. + + gzerror() should be used to distinguish errors from end-of-file for those + functions above that do not distinguish those cases in their return values. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clear the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + +#endif /* !Z_SOLO */ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the compression + library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. An Adler-32 value is in the range of a 32-bit + unsigned integer. If buf is Z_NULL, this function returns the required + initial value for the checksum. + + An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed + much faster. + + Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as adler32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note + that the z_off_t type (like off_t) is a signed integer. If len2 is + negative, the result has no meaning or utility. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. + If buf is Z_NULL, this function returns the required initial value for the + crc. Pre- and post-conditioning (one's complement) is performed within this + function so it shouldn't be done by the application. + + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, + z_size_t len)); +/* + Same as crc32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); + + Return the operator corresponding to length len2, to be used with + crc32_combine_op(). +*/ + +ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +/* + Give the same result as crc32_combine(), using op in place of len2. op is + is generated from len2 by crc32_combine_gen(). This will be faster than + crc32_combine() if the generated op is used more than once. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#ifdef Z_PREFIX_SET +# define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#else +# define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#endif + +#ifndef Z_SOLO + +/* gzgetc() macro and its supporting function and exposed data structure. Note + * that the real internal state is much larger than the exposed structure. + * This abbreviated structure exposes just enough for the gzgetc() macro. The + * user should not mess with these exposed elements, since their names or + * behavior could change in the future, perhaps even capriciously. They can + * only be used by the gzgetc() macro. You have been warned. + */ +struct gzFile_s { + unsigned have; + unsigned char *next; + z_off64_t pos; +}; +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +# define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#else +# define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#endif + +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#ifdef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); +#endif + +#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) +# ifdef Z_PREFIX_SET +# define z_gzopen z_gzopen64 +# define z_gzseek z_gzseek64 +# define z_gztell z_gztell64 +# define z_gzoffset z_gzoffset64 +# define z_adler32_combine z_adler32_combine64 +# define z_crc32_combine z_crc32_combine64 +# define z_crc32_combine_gen z_crc32_combine_gen64 +# else +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# define crc32_combine_gen crc32_combine_gen64 +# endif +# ifndef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); +# endif +#else + ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); +#endif + +#else /* Z_SOLO */ + + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + +#endif /* !Z_SOLO */ + +/* undocumented functions */ +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); +ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +#if defined(_WIN32) && !defined(Z_SOLO) +ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, + const char *mode)); +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, + const char *format, + va_list va)); +# endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/code/contrib/libfido2/lib/x64/cbor.lib b/code/contrib/libfido2/lib/x64/cbor.lib new file mode 100644 index 0000000..f3924b3 Binary files /dev/null and b/code/contrib/libfido2/lib/x64/cbor.lib differ diff --git a/code/contrib/libfido2/lib/x64/crypto-49.lib b/code/contrib/libfido2/lib/x64/crypto-49.lib new file mode 100644 index 0000000..65aaecd Binary files /dev/null and b/code/contrib/libfido2/lib/x64/crypto-49.lib differ diff --git a/code/contrib/libfido2/lib/x64/fido2.lib b/code/contrib/libfido2/lib/x64/fido2.lib new file mode 100644 index 0000000..32efa27 Binary files /dev/null and b/code/contrib/libfido2/lib/x64/fido2.lib differ diff --git a/code/contrib/libfido2/lib/x64/zlib1.lib b/code/contrib/libfido2/lib/x64/zlib1.lib new file mode 100644 index 0000000..c8136d5 Binary files /dev/null and b/code/contrib/libfido2/lib/x64/zlib1.lib differ diff --git a/code/cert/pkcs/pkcs11.h b/code/contrib/pkcs/pkcs11.h similarity index 76% rename from code/cert/pkcs/pkcs11.h rename to code/contrib/pkcs/pkcs11.h index 0d78dd7..78cb445 100644 --- a/code/cert/pkcs/pkcs11.h +++ b/code/contrib/pkcs/pkcs11.h @@ -1,13 +1,9 @@ -/* Copyright (c) OASIS Open 2016. All Rights Reserved./ - * /Distributed under the terms of the OASIS IPR Policy, +/* Copyright (c) OASIS Open 2016-2019. All Rights Reserved. + * Distributed under the terms of the OASIS IPR Policy, * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. */ - -/* Latest version of the specification: - * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html - */ #ifndef _PKCS11_H_ #define _PKCS11_H_ 1 @@ -29,8 +25,7 @@ extern "C" { * convention on packing is that structures should be 1-byte * aligned. * - * If you're using Microsoft Developer Studio 5.0 to produce - * Win32 stuff, this might be done by using the following + * If you're using Windows this might be done by using the following * preprocessor directive before including pkcs11.h or pkcs11t.h: * * #pragma pack(push, cryptoki, 1) @@ -40,13 +35,6 @@ extern "C" { * * #pragma pack(pop, cryptoki) * - * If you're using an earlier version of Microsoft Developer - * Studio to produce Win16 stuff, this might be done by using - * the following preprocessor directive before including - * pkcs11.h or pkcs11t.h: - * - * #pragma pack(1) - * * In a UNIX environment, you're on your own for this. You might * not need to do (or be able to do!) anything. * @@ -59,16 +47,10 @@ extern "C" { * * typedef CK_BYTE CK_PTR CK_BYTE_PTR; * - * If you're using Microsoft Developer Studio 5.0 to produce - * Win32 stuff, it might be defined by: + * If you're using windows, it might be defined by: * * #define CK_PTR * * - * If you're using an earlier version of Microsoft Developer - * Studio to produce Win16 stuff, it might be defined by: - * - * #define CK_PTR far * - * * In a typical UNIX environment, it might be defined by: * * #define CK_PTR * @@ -83,19 +65,12 @@ extern "C" { * CK_VOID_PTR pReserved * ); * - * If you're using Microsoft Developer Studio 5.0 to declare a - * function in a Win32 Cryptoki .dll, it might be defined by: + * If you're using Windows to declare a function in a Win32 cryptoki .dll, + * it might be defined by: * * #define CK_DECLARE_FUNCTION(returnType, name) \ * returnType __declspec(dllimport) name * - * If you're using an earlier version of Microsoft Developer - * Studio to declare a function in a Win16 Cryptoki .dll, it - * might be defined by: - * - * #define CK_DECLARE_FUNCTION(returnType, name) \ - * returnType __export _far _pascal name - * * In a UNIX environment, it might be defined by: * * #define CK_DECLARE_FUNCTION(returnType, name) \ @@ -120,19 +95,12 @@ extern "C" { * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args); * funcPtrType funcPtr; * - * If you're using Microsoft Developer Studio 5.0 to access + * If you're using Windows to access * functions in a Win32 Cryptoki .dll, in might be defined by: * * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ * returnType __declspec(dllimport) (* name) * - * If you're using an earlier version of Microsoft Developer - * Studio to access functions in a Win16 Cryptoki .dll, it might - * be defined by: - * - * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ - * returnType __export _far _pascal (* name) - * * In a UNIX environment, it might be defined by: * * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ @@ -153,18 +121,11 @@ extern "C" { * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args); * myCallbackType myCallback; * - * If you're using Microsoft Developer Studio 5.0 to do Win32 - * Cryptoki development, it might be defined by: + * If you're using Windows, it might be defined by: * * #define CK_CALLBACK_FUNCTION(returnType, name) \ * returnType (* name) * - * If you're using an earlier version of Microsoft Developer - * Studio to do Win16 development, it might be defined by: - * - * #define CK_CALLBACK_FUNCTION(returnType, name) \ - * returnType _far _pascal (* name) - * * In a UNIX environment, it might be defined by: * * #define CK_CALLBACK_FUNCTION(returnType, name) \ @@ -240,6 +201,22 @@ extern "C" { #define CK_PKCS11_FUNCTION_INFO(name) \ __PASTE(CK_,name) name; +/* Create the 3.0 Function list */ +struct CK_FUNCTION_LIST_3_0 { + + CK_VERSION version; /* Cryptoki version */ + +/* Pile all the function pointers into the CK_FUNCTION_LIST. */ +/* pkcs11f.h has all the information about the Cryptoki + * function prototypes. + */ +#include "pkcs11f.h" + +}; + +#define CK_PKCS11_2_0_ONLY 1 + +/* Continue to define the old CK_FUNCTION_LIST */ struct CK_FUNCTION_LIST { CK_VERSION version; /* Cryptoki version */ @@ -253,6 +230,7 @@ struct CK_FUNCTION_LIST { }; #undef CK_PKCS11_FUNCTION_INFO +#undef CK_PKCS11_2_0_ONLY #undef __PASTE diff --git a/code/cert/pkcs/pkcs11f.h b/code/contrib/pkcs/pkcs11f.h similarity index 75% rename from code/cert/pkcs/pkcs11f.h rename to code/contrib/pkcs/pkcs11f.h index ed90aff..a475f6d 100644 --- a/code/cert/pkcs/pkcs11f.h +++ b/code/contrib/pkcs/pkcs11f.h @@ -1,10 +1,10 @@ -/* Copyright (c) OASIS Open 2016. All Rights Reserved./ +/* Copyright (c) OASIS Open 2016, 2019. All Rights Reserved./ * /Distributed under the terms of the OASIS IPR Policy, * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. */ - + /* Latest version of the specification: * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html */ @@ -937,3 +937,260 @@ CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) ); #endif +#ifndef CK_PKCS11_2_0_ONLY +/* C_GetInterfaceList returns all the interfaces supported by the module*/ +CK_PKCS11_FUNCTION_INFO(C_GetInterfaceList) +#ifdef CK_NEED_ARG_LIST +( + CK_INTERFACE_PTR pInterfacesList, /* returned interfaces */ + CK_ULONG_PTR pulCount /* number of interfaces returned */ +); +#endif + +/* C_GetInterface returns a specific interface from the module. */ +CK_PKCS11_FUNCTION_INFO(C_GetInterface) +#ifdef CK_NEED_ARG_LIST +( + CK_UTF8CHAR_PTR pInterfaceName, /* name of the interface */ + CK_VERSION_PTR pVersion, /* version of the interface */ + CK_INTERFACE_PTR_PTR ppInterface, /* returned interface */ + CK_FLAGS flags /* flags controlling the semantics + * of the interface */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_LoginUser) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_USER_TYPE userType, /* the user type */ + CK_UTF8CHAR_PTR pPin, /* the user's PIN */ + CK_ULONG ulPinLen, /* the length of the PIN */ + CK_UTF8CHAR_PTR pUsername, /* the user's name */ + CK_ULONG ulUsernameLen /*the length of the user's name */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SessionCancel) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_FLAGS flags /* flags control which sessions are cancelled */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageEncryptInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ + CK_OBJECT_HANDLE hKey /* handle of encryption key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_EncryptMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */ + CK_BYTE_PTR pPlaintext, /* plain text */ + CK_ULONG ulPlaintextLen, /* plain text length */ + CK_BYTE_PTR pCiphertext, /* gets cipher text */ + CK_ULONG_PTR pulCiphertextLen /* gets cipher text length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_EncryptMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_EncryptMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pPlaintextPart, /* plain text */ + CK_ULONG ulPlaintextPartLen, /* plain text length */ + CK_BYTE_PTR pCiphertextPart, /* gets cipher text */ + CK_ULONG_PTR pulCiphertextPartLen, /* gets cipher text length */ + CK_FLAGS flags /* multi mode flag */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageEncryptFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageDecryptInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ + CK_OBJECT_HANDLE hKey /* handle of decryption key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_DecryptMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */ + CK_BYTE_PTR pCiphertext, /* cipher text */ + CK_ULONG ulCiphertextLen, /* cipher text length */ + CK_BYTE_PTR pPlaintext, /* gets plain text */ + CK_ULONG_PTR pulPlaintextLen /* gets plain text length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_DecryptMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_DecryptMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pCiphertextPart, /* cipher text */ + CK_ULONG ulCiphertextPartLen, /* cipher text length */ + CK_BYTE_PTR pPlaintextPart, /* gets plain text */ + CK_ULONG_PTR pulPlaintextPartLen, /* gets plain text length */ + CK_FLAGS flags /* multi mode flag */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageDecryptFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageSignInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the signing mechanism */ + CK_OBJECT_HANDLE hKey /* handle of signing key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SignMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* gets signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SignMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen /* length of message specific parameter */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SignMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* gets signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageSignFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageVerifyInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the signing mechanism */ + CK_OBJECT_HANDLE hKey /* handle of signing key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_VerifyMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* signature */ + CK_ULONG ulSignatureLen /* signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_VerifyMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen /* length of message specific parameter */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_VerifyMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* signature */ + CK_ULONG ulSignatureLen /* signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageVerifyFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +#endif /* CK_PKCS11_2_0_ONLY */ diff --git a/code/cert/pkcs/pkcs11t.h b/code/contrib/pkcs/pkcs11t.h similarity index 80% rename from code/cert/pkcs/pkcs11t.h rename to code/contrib/pkcs/pkcs11t.h index c13e67c..a6a1e00 100644 --- a/code/cert/pkcs/pkcs11t.h +++ b/code/contrib/pkcs/pkcs11t.h @@ -1,4 +1,4 @@ -/* Copyright (c) OASIS Open 2016. All Rights Reserved./ +/* Copyright (c) OASIS Open 2016, 2019. All Rights Reserved./ * /Distributed under the terms of the OASIS IPR Policy, * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A @@ -17,8 +17,8 @@ #ifndef _PKCS11T_H_ #define _PKCS11T_H_ 1 -#define CRYPTOKI_VERSION_MAJOR 2 -#define CRYPTOKI_VERSION_MINOR 40 +#define CRYPTOKI_VERSION_MAJOR 3 +#define CRYPTOKI_VERSION_MINOR 0 #define CRYPTOKI_VERSION_AMENDMENT 0 #define CK_TRUE 1 @@ -317,11 +317,20 @@ typedef CK_ULONG CK_OBJECT_CLASS; #define CKO_DOMAIN_PARAMETERS 0x00000006UL #define CKO_MECHANISM 0x00000007UL #define CKO_OTP_KEY 0x00000008UL +#define CKO_PROFILE 0x00000009UL #define CKO_VENDOR_DEFINED 0x80000000UL typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; +/* Profile ID's */ +#define CKP_INVALID_ID 0x00000000UL +#define CKP_BASELINE_PROVIDER 0x00000001UL +#define CKP_EXTENDED_PROVIDER 0x00000002UL +#define CKP_AUTHENTICATION_TOKEN 0x00000003UL +#define CKP_PUBLIC_CERTIFICATES_TOKEN 0x00000004UL +#define CKP_VENDOR_DEFINED 0x80000000UL + /* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type * of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. */ @@ -369,6 +378,8 @@ typedef CK_ULONG CK_KEY_TYPE; #define CKK_CAMELLIA 0x00000025UL #define CKK_ARIA 0x00000026UL +/* the following definitions were added in the 2.30 header file, + * but never defined in the spec. */ #define CKK_MD5_HMAC 0x00000027UL #define CKK_SHA_1_HMAC 0x00000028UL #define CKK_RIPEMD128_HMAC 0x00000029UL @@ -382,8 +393,26 @@ typedef CK_ULONG CK_KEY_TYPE; #define CKK_GOSTR3410 0x00000030UL #define CKK_GOSTR3411 0x00000031UL #define CKK_GOST28147 0x00000032UL - - +#define CKK_CHACHA20 0x00000033UL +#define CKK_POLY1305 0x00000034UL +#define CKK_AES_XTS 0x00000035UL +#define CKK_SHA3_224_HMAC 0x00000036UL +#define CKK_SHA3_256_HMAC 0x00000037UL +#define CKK_SHA3_384_HMAC 0x00000038UL +#define CKK_SHA3_512_HMAC 0x00000039UL +#define CKK_BLAKE2B_160_HMAC 0x0000003aUL +#define CKK_BLAKE2B_256_HMAC 0x0000003bUL +#define CKK_BLAKE2B_384_HMAC 0x0000003cUL +#define CKK_BLAKE2B_512_HMAC 0x0000003dUL +#define CKK_SALSA20 0x0000003eUL +#define CKK_X2RATCHET 0x0000003fUL +#define CKK_EC_EDWARDS 0x00000040UL +#define CKK_EC_MONTGOMERY 0x00000041UL +#define CKK_HKDF 0x00000042UL + +#define CKK_SHA512_224_HMAC 0x00000043UL +#define CKK_SHA512_256_HMAC 0x00000044UL +#define CKK_SHA512_T_HMAC 0x00000045UL #define CKK_VENDOR_DEFINED 0x80000000UL @@ -439,6 +468,7 @@ typedef CK_ULONG CK_ATTRIBUTE_TYPE; #define CKA_TOKEN 0x00000001UL #define CKA_PRIVATE 0x00000002UL #define CKA_LABEL 0x00000003UL +#define CKA_UNIQUE_ID 0x00000004UL #define CKA_APPLICATION 0x00000010UL #define CKA_VALUE 0x00000011UL #define CKA_OBJECT_ID 0x00000012UL @@ -556,6 +586,25 @@ typedef CK_ULONG CK_ATTRIBUTE_TYPE; #define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL #define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL #define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600UL) +#define CKA_PROFILE_ID 0x00000601UL + +#define CKA_X2RATCHET_BAG 0x00000602UL +#define CKA_X2RATCHET_BAGSIZE 0x00000603UL +#define CKA_X2RATCHET_BOBS1STMSG 0x00000604UL +#define CKA_X2RATCHET_CKR 0x00000605UL +#define CKA_X2RATCHET_CKS 0x00000606UL +#define CKA_X2RATCHET_DHP 0x00000607UL +#define CKA_X2RATCHET_DHR 0x00000608UL +#define CKA_X2RATCHET_DHS 0x00000609UL +#define CKA_X2RATCHET_HKR 0x0000060aUL +#define CKA_X2RATCHET_HKS 0x0000060bUL +#define CKA_X2RATCHET_ISALICE 0x0000060cUL +#define CKA_X2RATCHET_NHKR 0x0000060dUL +#define CKA_X2RATCHET_NHKS 0x0000060eUL +#define CKA_X2RATCHET_NR 0x0000060fUL +#define CKA_X2RATCHET_NS 0x00000610UL +#define CKA_X2RATCHET_PNS 0x00000611UL +#define CKA_X2RATCHET_RK 0x00000612UL #define CKA_VENDOR_DEFINED 0x80000000UL @@ -610,6 +659,10 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_DSA_SHA256 0x00000014UL #define CKM_DSA_SHA384 0x00000015UL #define CKM_DSA_SHA512 0x00000016UL +#define CKM_DSA_SHA3_224 0x00000018UL +#define CKM_DSA_SHA3_256 0x00000019UL +#define CKM_DSA_SHA3_384 0x0000001AUL +#define CKM_DSA_SHA3_512 0x0000001BUL #define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL #define CKM_DH_PKCS_DERIVE 0x00000021UL @@ -643,6 +696,15 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL #define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL +#define CKM_SHA3_256_RSA_PKCS 0x00000060UL +#define CKM_SHA3_384_RSA_PKCS 0x00000061UL +#define CKM_SHA3_512_RSA_PKCS 0x00000062UL +#define CKM_SHA3_256_RSA_PKCS_PSS 0x00000063UL +#define CKM_SHA3_384_RSA_PKCS_PSS 0x00000064UL +#define CKM_SHA3_512_RSA_PKCS_PSS 0x00000065UL +#define CKM_SHA3_224_RSA_PKCS 0x00000066UL +#define CKM_SHA3_224_RSA_PKCS_PSS 0x00000067UL + #define CKM_RC2_KEY_GEN 0x00000100UL #define CKM_RC2_ECB 0x00000101UL #define CKM_RC2_CBC 0x00000102UL @@ -724,6 +786,24 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_ACTI 0x000002A0UL #define CKM_ACTI_KEY_GEN 0x000002A1UL +#define CKM_SHA3_256 0x000002B0UL +#define CKM_SHA3_256_HMAC 0x000002B1UL +#define CKM_SHA3_256_HMAC_GENERAL 0x000002B2UL +#define CKM_SHA3_256_KEY_GEN 0x000002B3UL +#define CKM_SHA3_224 0x000002B5UL +#define CKM_SHA3_224_HMAC 0x000002B6UL +#define CKM_SHA3_224_HMAC_GENERAL 0x000002B7UL +#define CKM_SHA3_224_KEY_GEN 0x000002B8UL +#define CKM_SHA3_384 0x000002C0UL +#define CKM_SHA3_384_HMAC 0x000002C1UL +#define CKM_SHA3_384_HMAC_GENERAL 0x000002C2UL +#define CKM_SHA3_384_KEY_GEN 0x000002C3UL +#define CKM_SHA3_512 0x000002D0UL +#define CKM_SHA3_512_HMAC 0x000002D1UL +#define CKM_SHA3_512_HMAC_GENERAL 0x000002D2UL +#define CKM_SHA3_512_KEY_GEN 0x000002D3UL + + #define CKM_CAST_KEY_GEN 0x00000300UL #define CKM_CAST_ECB 0x00000301UL #define CKM_CAST_CBC 0x00000302UL @@ -789,6 +869,18 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_SHA384_KEY_DERIVATION 0x00000394UL #define CKM_SHA512_KEY_DERIVATION 0x00000395UL #define CKM_SHA224_KEY_DERIVATION 0x00000396UL +#define CKM_SHA3_256_KEY_DERIVATION 0x00000397UL +#define CKM_SHA3_224_KEY_DERIVATION 0x00000398UL +#define CKM_SHA3_384_KEY_DERIVATION 0x00000399UL +#define CKM_SHA3_512_KEY_DERIVATION 0x0000039AUL +#define CKM_SHAKE_128_KEY_DERIVATION 0x0000039BUL +#define CKM_SHAKE_256_KEY_DERIVATION 0x0000039CUL +#define CKM_SHA3_256_KEY_DERIVE CKM_SHA3_256_KEY_DERIVATION +#define CKM_SHA3_224_KEY_DERIVE CKM_SHA3_224_KEY_DERIVATION +#define CKM_SHA3_384_KEY_DERIVE CKM_SHA3_384_KEY_DERIVATION +#define CKM_SHA3_512_KEY_DERIVE CKM_SHA3_512_KEY_DERIVATION +#define CKM_SHAKE_128_KEY_DERIVE CKM_SHAKE_128_KEY_DERIVATION +#define CKM_SHAKE_256_KEY_DERIVE CKM_SHAKE_256_KEY_DERIVATION #define CKM_PBE_MD2_DES_CBC 0x000003A0UL #define CKM_PBE_MD5_DES_CBC 0x000003A1UL @@ -816,8 +908,6 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL #define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL -#define CKM_TLS10_MAC_SERVER 0x000003D6UL -#define CKM_TLS10_MAC_CLIENT 0x000003D7UL #define CKM_TLS12_MAC 0x000003D8UL #define CKM_TLS12_KDF 0x000003D9UL #define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL @@ -895,6 +985,7 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_ECDSA_SHA256 0x00001044UL #define CKM_ECDSA_SHA384 0x00001045UL #define CKM_ECDSA_SHA512 0x00001046UL +#define CKM_EC_KEY_PAIR_GEN_W_EXTRA_BITS 0x0000140BUL #define CKM_ECDH1_DERIVE 0x00001050UL #define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL @@ -911,6 +1002,8 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_JUNIPER_WRAP 0x00001065UL #define CKM_FASTHASH 0x00001070UL +#define CKM_AES_XTS 0x00001071UL +#define CKM_AES_XTS_KEY_GEN 0x00001072UL #define CKM_AES_KEY_GEN 0x00001080UL #define CKM_AES_ECB 0x00001081UL #define CKM_AES_CBC 0x00001082UL @@ -954,12 +1047,17 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_GOST28147 0x00001222UL #define CKM_GOST28147_MAC 0x00001223UL #define CKM_GOST28147_KEY_WRAP 0x00001224UL - +#define CKM_CHACHA20_KEY_GEN 0x00001225UL +#define CKM_CHACHA20 0x00001226UL +#define CKM_POLY1305_KEY_GEN 0x00001227UL +#define CKM_POLY1305 0x00001228UL #define CKM_DSA_PARAMETER_GEN 0x00002000UL #define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL #define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL -#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN 0x00002003UL +#define CKM_DSA_PROBABILISTIC_PARAMETER_GEN 0x00002003UL +#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN CKM_DSA_PROBABILISTIC_PARAMETER_GEN #define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL +#define CKM_DSA_FIPS_G_GEN 0x00002005UL #define CKM_AES_OFB 0x00002104UL #define CKM_AES_CFB64 0x00002105UL @@ -969,10 +1067,66 @@ typedef CK_ULONG CK_MECHANISM_TYPE; #define CKM_AES_CFB1 0x00002108UL #define CKM_AES_KEY_WRAP 0x00002109UL /* WAS: 0x00001090 */ #define CKM_AES_KEY_WRAP_PAD 0x0000210AUL /* WAS: 0x00001091 */ +#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL #define CKM_RSA_PKCS_TPM_1_1 0x00004001UL #define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL +#define CKM_SHA_1_KEY_GEN 0x00004003UL +#define CKM_SHA224_KEY_GEN 0x00004004UL +#define CKM_SHA256_KEY_GEN 0x00004005UL +#define CKM_SHA384_KEY_GEN 0x00004006UL +#define CKM_SHA512_KEY_GEN 0x00004007UL +#define CKM_SHA512_224_KEY_GEN 0x00004008UL +#define CKM_SHA512_256_KEY_GEN 0x00004009UL +#define CKM_SHA512_T_KEY_GEN 0x0000400aUL +#define CKM_NULL 0x0000400bUL +#define CKM_BLAKE2B_160 0x0000400cUL +#define CKM_BLAKE2B_160_HMAC 0x0000400dUL +#define CKM_BLAKE2B_160_HMAC_GENERAL 0x0000400eUL +#define CKM_BLAKE2B_160_KEY_DERIVE 0x0000400fUL +#define CKM_BLAKE2B_160_KEY_GEN 0x00004010UL +#define CKM_BLAKE2B_256 0x00004011UL +#define CKM_BLAKE2B_256_HMAC 0x00004012UL +#define CKM_BLAKE2B_256_HMAC_GENERAL 0x00004013UL +#define CKM_BLAKE2B_256_KEY_DERIVE 0x00004014UL +#define CKM_BLAKE2B_256_KEY_GEN 0x00004015UL +#define CKM_BLAKE2B_384 0x00004016UL +#define CKM_BLAKE2B_384_HMAC 0x00004017UL +#define CKM_BLAKE2B_384_HMAC_GENERAL 0x00004018UL +#define CKM_BLAKE2B_384_KEY_DERIVE 0x00004019UL +#define CKM_BLAKE2B_384_KEY_GEN 0x0000401aUL +#define CKM_BLAKE2B_512 0x0000401bUL +#define CKM_BLAKE2B_512_HMAC 0x0000401cUL +#define CKM_BLAKE2B_512_HMAC_GENERAL 0x0000401dUL +#define CKM_BLAKE2B_512_KEY_DERIVE 0x0000401eUL +#define CKM_BLAKE2B_512_KEY_GEN 0x0000401fUL +#define CKM_SALSA20 0x00004020UL +#define CKM_CHACHA20_POLY1305 0x00004021UL +#define CKM_SALSA20_POLY1305 0x00004022UL +#define CKM_X3DH_INITIALIZE 0x00004023UL +#define CKM_X3DH_RESPOND 0x00004024UL +#define CKM_X2RATCHET_INITIALIZE 0x00004025UL +#define CKM_X2RATCHET_RESPOND 0x00004026UL +#define CKM_X2RATCHET_ENCRYPT 0x00004027UL +#define CKM_X2RATCHET_DECRYPT 0x00004028UL +#define CKM_XEDDSA 0x00004029UL +#define CKM_HKDF_DERIVE 0x0000402aUL +#define CKM_HKDF_DATA 0x0000402bUL +#define CKM_HKDF_KEY_GEN 0x0000402cUL +#define CKM_SALSA20_KEY_GEN 0x0000402dUL + +#define CKM_ECDSA_SHA3_224 0x00001047UL +#define CKM_ECDSA_SHA3_256 0x00001048UL +#define CKM_ECDSA_SHA3_384 0x00001049UL +#define CKM_ECDSA_SHA3_512 0x0000104aUL +#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL +#define CKM_EC_MONTGOMERY_KEY_PAIR_GEN 0x00001056UL +#define CKM_EDDSA 0x00001057UL +#define CKM_SP800_108_COUNTER_KDF 0x000003acUL +#define CKM_SP800_108_FEEDBACK_KDF 0x000003adUL +#define CKM_SP800_108_DOUBLE_PIPELINE_KDF 0x000003aeUL + #define CKM_VENDOR_DEFINED 0x80000000UL typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; @@ -1004,6 +1158,14 @@ typedef struct CK_MECHANISM_INFO { #define CKF_HW 0x00000001UL /* performed by HW */ /* Specify whether or not a mechanism can be used for a particular task */ +#define CKF_MESSAGE_ENCRYPT 0x00000002UL +#define CKF_MESSAGE_DECRYPT 0x00000004UL +#define CKF_MESSAGE_SIGN 0x00000008UL +#define CKF_MESSAGE_VERIFY 0x00000010UL +#define CKF_MULTI_MESSAGE 0x00000020UL +#define CKF_MULTI_MESSGE CKF_MULTI_MESSAGE +#define CKF_FIND_OBJECTS 0x00000040UL + #define CKF_ENCRYPT 0x00000100UL #define CKF_DECRYPT 0x00000200UL #define CKF_DIGEST 0x00000400UL @@ -1023,9 +1185,11 @@ typedef struct CK_MECHANISM_INFO { #define CKF_EC_F_P 0x00100000UL #define CKF_EC_F_2M 0x00200000UL #define CKF_EC_ECPARAMETERS 0x00400000UL -#define CKF_EC_NAMEDCURVE 0x00800000UL +#define CKF_EC_OID 0x00800000UL +#define CKF_EC_NAMEDCURVE CKF_EC_OID /* deprecated since PKCS#11 3.00 */ #define CKF_EC_UNCOMPRESS 0x01000000UL #define CKF_EC_COMPRESS 0x02000000UL +#define CKF_EC_CURVENAME 0x04000000UL #define CKF_EXTENSION 0x80000000UL @@ -1063,6 +1227,7 @@ typedef CK_ULONG CK_RV; #define CKR_DEVICE_REMOVED 0x00000032UL #define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL #define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL +#define CKR_AEAD_DECRYPT_FAILED 0x00000042UL #define CKR_FUNCTION_CANCELED 0x00000050UL #define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL @@ -1155,6 +1320,8 @@ typedef CK_ULONG CK_RV; #define CKR_PUBLIC_KEY_INVALID 0x000001B9UL #define CKR_FUNCTION_REJECTED 0x00000200UL +#define CKR_TOKEN_RESOURCE_EXCEEDED 0x00000201UL +#define CKR_OPERATION_CANCEL_FAILED 0x00000202UL #define CKR_VENDOR_DEFINED 0x80000000UL @@ -1172,10 +1339,24 @@ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)( * Cryptoki functions */ typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; +typedef struct CK_FUNCTION_LIST_3_0 CK_FUNCTION_LIST_3_0; typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; +typedef CK_FUNCTION_LIST_3_0 CK_PTR CK_FUNCTION_LIST_3_0_PTR; typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; +typedef CK_FUNCTION_LIST_3_0_PTR CK_PTR CK_FUNCTION_LIST_3_0_PTR_PTR; + +typedef struct CK_INTERFACE { + CK_CHAR *pInterfaceName; + CK_VOID_PTR pFunctionList; + CK_FLAGS flags; +} CK_INTERFACE; + +typedef CK_INTERFACE CK_PTR CK_INTERFACE_PTR; +typedef CK_INTERFACE_PTR CK_PTR CK_INTERFACE_PTR_PTR; + +#define CKF_END_OF_MESSAGE 0x00000001UL /* CK_CREATEMUTEX is an application callback for creating a @@ -1207,6 +1388,8 @@ typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)( CK_VOID_PTR pMutex /* pointer to mutex */ ); +/* Get functionlist flags */ +#define CKF_INTERFACE_FORK_SAFE 0x00000001UL /* CK_C_INITIALIZE_ARGS provides the optional arguments to * C_Initialize @@ -1229,6 +1412,7 @@ typedef struct CK_C_INITIALIZE_ARGS { typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; + /* additional flags for parameters to functions */ /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ @@ -1249,6 +1433,11 @@ typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR; #define CKG_MGF1_SHA384 0x00000003UL #define CKG_MGF1_SHA512 0x00000004UL #define CKG_MGF1_SHA224 0x00000005UL +#define CKG_MGF1_SHA3_224 0x00000006UL +#define CKG_MGF1_SHA3_256 0x00000007UL +#define CKG_MGF1_SHA3_384 0x00000008UL +#define CKG_MGF1_SHA3_512 0x00000009UL + /* CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source * of the encoding parameter when formatting a message block @@ -1286,6 +1475,7 @@ typedef struct CK_RSA_PKCS_PSS_PARAMS { typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR; typedef CK_ULONG CK_EC_KDF_TYPE; +typedef CK_EC_KDF_TYPE CK_PTR CK_EC_KDF_TYPE_PTR; /* The following EC Key Derivation Functions are defined */ #define CKD_NULL 0x00000001UL @@ -1299,7 +1489,23 @@ typedef CK_ULONG CK_EC_KDF_TYPE; #define CKD_SHA384_KDF 0x00000007UL #define CKD_SHA512_KDF 0x00000008UL #define CKD_CPDIVERSIFY_KDF 0x00000009UL - +#define CKD_SHA3_224_KDF 0x0000000AUL +#define CKD_SHA3_256_KDF 0x0000000BUL +#define CKD_SHA3_384_KDF 0x0000000CUL +#define CKD_SHA3_512_KDF 0x0000000DUL +#define CKD_SHA1_KDF_SP800 0x0000000EUL +#define CKD_SHA224_KDF_SP800 0x0000000FUL +#define CKD_SHA256_KDF_SP800 0x00000010UL +#define CKD_SHA384_KDF_SP800 0x00000011UL +#define CKD_SHA512_KDF_SP800 0x00000012UL +#define CKD_SHA3_224_KDF_SP800 0x00000013UL +#define CKD_SHA3_256_KDF_SP800 0x00000014UL +#define CKD_SHA3_384_KDF_SP800 0x00000015UL +#define CKD_SHA3_512_KDF_SP800 0x00000016UL +#define CKD_BLAKE2B_160_KDF 0x00000017UL +#define CKD_BLAKE2B_256_KDF 0x00000018UL +#define CKD_BLAKE2B_384_KDF 0x00000019UL +#define CKD_BLAKE2B_512_KDF 0x0000001aUL /* CK_ECDH1_DERIVE_PARAMS provides the parameters to the * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms, @@ -1841,6 +2047,23 @@ typedef struct CK_GCM_PARAMS { typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; +typedef CK_ULONG CK_GENERATOR_FUNCTION; +#define CKG_NO_GENERATE 0x00000000UL +#define CKG_GENERATE 0x00000001UL +#define CKG_GENERATE_COUNTER 0x00000002UL +#define CKG_GENERATE_RANDOM 0x00000003UL + +typedef struct CK_GCM_MESSAGE_PARAMS { + CK_BYTE_PTR pIv; + CK_ULONG ulIvLen; + CK_ULONG ulIvFixedBits; + CK_GENERATOR_FUNCTION ivGenerator; + CK_BYTE_PTR pTag; + CK_ULONG ulTagBits; +} CK_GCM_MESSAGE_PARAMS; + +typedef CK_GCM_MESSAGE_PARAMS CK_GCM_MESSAGE_PARAMS_PTR; + typedef struct CK_CCM_PARAMS { CK_ULONG ulDataLen; CK_BYTE_PTR pNonce; @@ -1852,6 +2075,18 @@ typedef struct CK_CCM_PARAMS { typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; +typedef struct CK_CCM_MESSAGE_PARAMS { + CK_ULONG ulDataLen; /*plaintext or ciphertext*/ + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_ULONG ulNonceFixedBits; + CK_GENERATOR_FUNCTION nonceGenerator; + CK_BYTE_PTR pMAC; + CK_ULONG ulMACLen; +} CK_CCM_MESSAGE_PARAMS; + +typedef CK_CCM_MESSAGE_PARAMS CK_CCM_MESSAGE_PARAMS_PTR; + /* Deprecated. Use CK_GCM_PARAMS */ typedef struct CK_AES_GCM_PARAMS { CK_BYTE_PTR pIv; @@ -1999,5 +2234,211 @@ typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR; +/* + * New PKCS 11 v3.0 data structures. + */ + +typedef CK_ULONG CK_PROFILE_ID; +typedef CK_PROFILE_ID CK_PTR CK_PROFILE_ID_PTR; + +/* Typedefs for Flexible KDF */ +typedef CK_ULONG CK_PRF_DATA_TYPE; +typedef CK_MECHANISM_TYPE CK_SP800_108_PRF_TYPE; +#define CK_SP800_108_ITERATION_VARIABLE 0x00000001UL +#define CK_SP800_108_OPTIONAL_COUNTER 0x00000002UL +#define CK_SP800_108_DKM_LENGTH 0x00000003UL +#define CK_SP800_108_BYTE_ARRAY 0x00000004UL +#define CK_SP800_108_COUNTER CK_SP800_108_OPTIONAL_COUNTER + +typedef struct CK_PRF_DATA_PARAM +{ + CK_PRF_DATA_TYPE type; + CK_VOID_PTR pValue; + CK_ULONG ulValueLen; +} CK_PRF_DATA_PARAM; + +typedef CK_PRF_DATA_PARAM CK_PTR CK_PRF_DATA_PARAM_PTR; + + +typedef struct CK_SP800_108_COUNTER_FORMAT +{ + CK_BBOOL bLittleEndian; + CK_ULONG ulWidthInBits; +} CK_SP800_108_COUNTER_FORMAT; + +typedef CK_SP800_108_COUNTER_FORMAT CK_PTR CK_SP800_108_COUNTER_FORMAT_PTR; + +typedef CK_ULONG CK_SP800_108_DKM_LENGTH_METHOD; +#define CK_SP800_108_DKM_LENGTH_SUM_OF_KEYS 0x00000001UL +#define CK_SP800_108_DKM_LENGTH_SUM_OF_SEGMENTS 0x00000002UL + +typedef struct CK_SP800_108_DKM_LENGTH_FORMAT +{ + CK_SP800_108_DKM_LENGTH_METHOD dkmLengthMethod; + CK_BBOOL bLittleEndian; + CK_ULONG ulWidthInBits; +} CK_SP800_108_DKM_LENGTH_FORMAT; + +typedef CK_SP800_108_DKM_LENGTH_FORMAT \ + CK_PTR CK_SP800_108_DKM_LENGTH_FORMAT_PTR; + +typedef struct CK_DERIVED_KEY +{ + CK_ATTRIBUTE_PTR pTemplate; + CK_ULONG ulAttributeCount; + CK_OBJECT_HANDLE_PTR phKey; +} CK_DERIVED_KEY; + +typedef CK_DERIVED_KEY CK_PTR CK_DERIVED_KEY_PTR; + +typedef struct CK_SP800_108_KDF_PARAMS +{ + CK_SP800_108_PRF_TYPE prfType; + CK_ULONG ulNumberOfDataParams; + CK_PRF_DATA_PARAM_PTR pDataParams; + CK_ULONG ulAdditionalDerivedKeys; + CK_DERIVED_KEY_PTR pAdditionalDerivedKeys; +} CK_SP800_108_KDF_PARAMS; + +typedef CK_SP800_108_KDF_PARAMS CK_PTR CK_SP800_108_KDF_PARAMS_PTR; + +typedef struct CK_SP800_108_FEEDBACK_KDF_PARAMS +{ + CK_SP800_108_PRF_TYPE prfType; + CK_ULONG ulNumberOfDataParams; + CK_PRF_DATA_PARAM_PTR pDataParams; + CK_ULONG ulIVLen; + CK_BYTE_PTR pIV; + CK_ULONG ulAdditionalDerivedKeys; + CK_DERIVED_KEY_PTR pAdditionalDerivedKeys; +} CK_SP800_108_FEEDBACK_KDF_PARAMS; + +typedef CK_SP800_108_FEEDBACK_KDF_PARAMS \ + CK_PTR CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR; + +/* EDDSA */ +typedef struct CK_EDDSA_PARAMS { + CK_BBOOL phFlag; + CK_ULONG ulContextDataLen; + CK_BYTE_PTR pContextData; +} CK_EDDSA_PARAMS; + +typedef CK_EDDSA_PARAMS CK_PTR CK_EDDSA_PARAMS_PTR; + +/* Extended ChaCha20/Salsa20 support*/ +typedef struct CK_CHACHA20_PARAMS { + CK_BYTE_PTR pBlockCounter; + CK_ULONG blockCounterBits; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceBits; +} CK_CHACHA20_PARAMS; + +typedef CK_CHACHA20_PARAMS CK_PTR CK_CHACHA20_PARAMS_PTR; + +typedef struct CK_SALSA20_PARAMS { + CK_BYTE_PTR pBlockCounter; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceBits; +} CK_SALSA20_PARAMS; +typedef CK_SALSA20_PARAMS CK_PTR CK_SALSA20_PARAMS_PTR; + +typedef struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; +} CK_SALSA20_CHACHA20_POLY1305_PARAMS; + +typedef CK_SALSA20_CHACHA20_POLY1305_PARAMS \ + CK_PTR CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR; + +typedef struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pTag; +} CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; + +typedef CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS \ + CK_PTR CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR; + +typedef CK_ULONG CK_X3DH_KDF_TYPE; +typedef CK_X3DH_KDF_TYPE CK_PTR CK_X3DH_KDF_TYPE_PTR; + +/* X3dh, ratchet */ +typedef struct CK_X3DH_INITIATE_PARAMS { + CK_X3DH_KDF_TYPE kdf; + CK_OBJECT_HANDLE pPeer_identity; + CK_OBJECT_HANDLE pPeer_prekey; + CK_BYTE_PTR pPrekey_signature; + CK_BYTE_PTR pOnetime_key; + CK_OBJECT_HANDLE pOwn_identity; + CK_OBJECT_HANDLE pOwn_ephemeral; +} CK_X3DH_INITIATE_PARAMS; + +typedef struct CK_X3DH_RESPOND_PARAMS { + CK_X3DH_KDF_TYPE kdf; + CK_BYTE_PTR pIdentity_id; + CK_BYTE_PTR pPrekey_id; + CK_BYTE_PTR pOnetime_id; + CK_OBJECT_HANDLE pInitiator_identity; + CK_BYTE_PTR pInitiator_ephemeral; +} CK_X3DH_RESPOND_PARAMS; + +typedef CK_ULONG CK_X2RATCHET_KDF_TYPE; +typedef CK_X2RATCHET_KDF_TYPE CK_PTR CK_X2RATCHET_KDF_TYPE_PTR; + +typedef struct CK_X2RATCHET_INITIALIZE_PARAMS { + CK_BYTE_PTR sk; + CK_OBJECT_HANDLE peer_public_prekey; + CK_OBJECT_HANDLE peer_public_identity; + CK_OBJECT_HANDLE own_public_identity; + CK_BBOOL bEncryptedHeader; + CK_ULONG eCurve; + CK_MECHANISM_TYPE aeadMechanism; + CK_X2RATCHET_KDF_TYPE kdfMechanism; +} CK_X2RATCHET_INITIALIZE_PARAMS; + +typedef CK_X2RATCHET_INITIALIZE_PARAMS \ + CK_PTR CK_X2RATCHET_INITIALIZE_PARAMS_PTR; + +typedef struct CK_X2RATCHET_RESPOND_PARAMS { + CK_BYTE_PTR sk; + CK_OBJECT_HANDLE own_prekey; + CK_OBJECT_HANDLE initiator_identity; + CK_OBJECT_HANDLE own_public_identity; + CK_BBOOL bEncryptedHeader; + CK_ULONG eCurve; + CK_MECHANISM_TYPE aeadMechanism; + CK_X2RATCHET_KDF_TYPE kdfMechanism; +} CK_X2RATCHET_RESPOND_PARAMS; +typedef CK_X2RATCHET_RESPOND_PARAMS \ + CK_PTR CK_X2RATCHET_RESPOND_PARAMS_PTR; + +typedef CK_ULONG CK_XEDDSA_HASH_TYPE; +typedef CK_XEDDSA_HASH_TYPE CK_PTR CK_XEDDSA_HASH_TYPE_PTR; + +/* XEDDSA */ +typedef struct CK_XEDDSA_PARAMS { + CK_XEDDSA_HASH_TYPE hash; +} CK_XEDDSA_PARAMS; +typedef CK_XEDDSA_PARAMS CK_PTR CK_XEDDSA_PARAMS_PTR; + +typedef struct CK_HKDF_PARAMS { + CK_BBOOL bExtract; + CK_BBOOL bExpand; + CK_MECHANISM_TYPE prfHashMechanism; + CK_ULONG ulSaltType; + CK_BYTE_PTR pSalt; + CK_ULONG ulSaltLen; + CK_OBJECT_HANDLE hSaltKey; + CK_BYTE_PTR pInfo; + CK_ULONG ulInfoLen; +} CK_HKDF_PARAMS; +typedef CK_HKDF_PARAMS CK_PTR CK_HKDF_PARAMS_PTR; + +#define CKF_HKDF_SALT_NULL 0x00000001UL +#define CKF_HKDF_SALT_DATA 0x00000002UL +#define CKF_HKDF_SALT_KEY 0x00000004UL + #endif /* _PKCS11T_H_ */ diff --git a/code/contrib/proveprime.py b/code/contrib/proveprime.py new file mode 100644 index 0000000..655e68e --- /dev/null +++ b/code/contrib/proveprime.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 + +import argparse +import functools +import math +import os +import re +import subprocess +import sys +import itertools + +def gen_names(): + for i in itertools.count(): + name = "p{:d}".format(i) + if name not in nameset: + yield name +nameset=set() +names = gen_names() + +class YafuError(Exception): + pass + +verbose = False +def diag(*args): + if verbose: + print(*args, file=sys.stderr) + +factorcache = set() +factorcachefile = None +def cache_factor(f): + if f not in factorcache: + factorcache.add(f) + if factorcachefile is not None: + factorcachefile.write("{:d}\n".format(f)) + factorcachefile.flush() + +yafu = None +yafu_pattern = re.compile(rb"^P\d+ = (\d+)$") +def call_yafu(n): + n_orig = n + diag("starting yafu", n_orig) + p = subprocess.Popen([yafu, "-v", "-v"], stdin=subprocess.PIPE, + stdout=subprocess.PIPE) + p.stdin.write("{:d}\n".format(n).encode("ASCII")) + p.stdin.close() + factors = [] + for line in iter(p.stdout.readline, b''): + line = line.rstrip(b"\r\n") + diag("yafu output:", line.decode()) + m = yafu_pattern.match(line) + if m is not None: + f = int(m.group(1)) + if n % f != 0: + raise YafuError("bad yafu factor {:d}".format(f)) + factors.append(f) + if f >> 64: + cache_factor(f) + n //= f + p.wait() + diag("done yafu", n_orig) + return factors, n + +def factorise(n): + allfactors = [] + for f in factorcache: + if n % f == 0: + n //= f + allfactors.append(f) + while n > 1: + factors, n = call_yafu(n) + allfactors.extend(factors) + return sorted(allfactors) + +def product(ns): + return functools.reduce(lambda a,b: a*b, ns, 1) + +smallprimes = set() +commands = {} + +def proveprime(p, name=None): + if p >> 32 == 0: + smallprimes.add(p) + return "{:d}".format(p) + + if name is None: + name = next(names) + print("{} = {:d}".format(name, p)) + + fs = factorise(p-1) + fs.reverse() + prod = product(fs) + qs = [] + for q in fs: + newprod = prod // q + if newprod * newprod * newprod > p: + prod = newprod + else: + qs.append(q) + assert prod == product(qs) + assert prod * prod * prod > p + qset = set(qs) + qnamedict = {q: proveprime(q) for q in qset} + qnames = [qnamedict[q] for q in qs] + for w in itertools.count(2): + assert pow(w, p-1, p) == 1, "{}={:d} is not prime!".format(name, p) + diag("trying witness", w, "for", p) + for q in qset: + wpower = pow(w, (p-1) // q, p) - 1 + if math.gcd(wpower, p) != 1: + break + else: + diag("found witness", w, "for", p) + break + commands[p]= (name, w, qnames) + return name + +def main(): + parser = argparse.ArgumentParser(description='') + parser.add_argument("prime", nargs="+", + help="Number to prove prime. Can be prefixed by a " + "variable name and '=', e.g. 'x=9999999967'.") + parser.add_argument("--cryptsuite", action="store_true", + help="Generate abbreviated Pockle calls suitable " + "for the tests in cryptsuite.py.") + parser.add_argument("--yafu", default="yafu", + help="yafu binary to help with factoring.") + parser.add_argument("-v", "--verbose", action="store_true", + help="Write diagnostics to standard error.") + parser.add_argument("--cache", help="Cache of useful factors of things.") + args = parser.parse_args() + + global verbose, yafu + verbose = args.verbose + yafu = args.yafu + + if args.cache is not None: + with open(args.cache, "r") as fh: + for line in iter(fh.readline, ""): + factorcache.add(int(line.rstrip("\r\n"))) + global factorcachefile + factorcachefile = open(args.cache, "a") + + for ps in args.prime: + name, value = (ps.split("=", 1) if "=" in ps + else (None, ps)) + proveprime(int(value, 0), name) + + print("po = pockle_new()") + if len(smallprimes) > 0: + if args.cryptsuite: + print("add_small(po, {})".format( + ", ".join("{:d}".format(q) for q in sorted(smallprimes)))) + else: + for q in sorted(smallprimes): + print("pockle_add_small_prime(po, {:d})".format(q)) + for p, (name, w, qnames) in sorted(commands.items()): + print("{cmd}(po, {name}, [{qs}], {w:d})".format( + cmd = "add" if args.cryptsuite else "pockle_add_prime", + name=name, w=w, qs=", ".join(qnames))) + +if __name__ == '__main__': + main() diff --git a/code/cproxy.c b/code/cproxy.c deleted file mode 100644 index e1d788b..0000000 --- a/code/cproxy.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Routines to do cryptographic interaction with proxies in PuTTY. - * This is in a separate module from proxy.c, so that it can be - * conveniently removed in PuTTYtel by replacing this module with - * the stub version nocproxy.c. - */ - -#include -#include -#include - -#include "putty.h" -#include "ssh.h" /* For MD5 support */ -#include "network.h" -#include "proxy.h" -#include "marshal.h" - -static void hmacmd5_chap(const unsigned char *challenge, int challen, - const char *passwd, unsigned char *response) -{ - mac_simple(&ssh_hmac_md5, ptrlen_from_asciz(passwd), - make_ptrlen(challenge, challen), response); -} - -void proxy_socks5_offerencryptedauth(BinarySink *bs) -{ - put_byte(bs, 0x03); /* CHAP */ -} - -int proxy_socks5_handlechap (ProxySocket *p) -{ - - /* CHAP authentication reply format: - * version number (1 bytes) = 1 - * number of commands (1 byte) - * - * For each command: - * command identifier (1 byte) - * data length (1 byte) - */ - unsigned char data[260]; - unsigned char outbuf[20]; - - while(p->chap_num_attributes == 0 || - p->chap_num_attributes_processed < p->chap_num_attributes) { - if (p->chap_num_attributes == 0 || - p->chap_current_attribute == -1) { - /* CHAP normally reads in two bytes, either at the - * beginning or for each attribute/value pair. But if - * we're waiting for the value's data, we might not want - * to read 2 bytes. - */ - - if (bufchain_size(&p->pending_input_data) < 2) - return 1; /* not got anything yet */ - - /* get the response */ - bufchain_fetch(&p->pending_input_data, data, 2); - bufchain_consume(&p->pending_input_data, 2); - } - - if (p->chap_num_attributes == 0) { - /* If there are no attributes, this is our first msg - * with the server, where we negotiate version and - * number of attributes - */ - if (data[0] != 0x01) { - plug_closing(p->plug, "Proxy error: SOCKS proxy wants" - " a different CHAP version", - PROXY_ERROR_GENERAL, 0); - return 1; - } - if (data[1] == 0x00) { - plug_closing(p->plug, "Proxy error: SOCKS proxy won't" - " negotiate CHAP with us", - PROXY_ERROR_GENERAL, 0); - return 1; - } - p->chap_num_attributes = data[1]; - } else { - if (p->chap_current_attribute == -1) { - /* We have to read in each attribute/value pair - - * those we don't understand can be ignored, but - * there are a few we'll need to handle. - */ - p->chap_current_attribute = data[0]; - p->chap_current_datalen = data[1]; - } - if (bufchain_size(&p->pending_input_data) < - p->chap_current_datalen) - return 1; /* not got everything yet */ - - /* get the response */ - bufchain_fetch(&p->pending_input_data, data, - p->chap_current_datalen); - - bufchain_consume(&p->pending_input_data, - p->chap_current_datalen); - - switch (p->chap_current_attribute) { - case 0x00: - /* Successful authentication */ - if (data[0] == 0x00) - p->state = 2; - else { - plug_closing(p->plug, "Proxy error: SOCKS proxy" - " refused CHAP authentication", - PROXY_ERROR_GENERAL, 0); - return 1; - } - break; - case 0x03: - outbuf[0] = 0x01; /* Version */ - outbuf[1] = 0x01; /* One attribute */ - outbuf[2] = 0x04; /* Response */ - outbuf[3] = 0x10; /* Length */ - hmacmd5_chap(data, p->chap_current_datalen, - conf_get_str(p->conf, CONF_proxy_password), - &outbuf[4]); - sk_write(p->sub_socket, outbuf, 20); - break; - case 0x11: - /* Chose a protocol */ - if (data[0] != 0x85) { - plug_closing(p->plug, "Proxy error: Server chose " - "CHAP of other than HMAC-MD5 but we " - "didn't offer it!", - PROXY_ERROR_GENERAL, 0); - return 1; - } - break; - } - p->chap_current_attribute = -1; - p->chap_num_attributes_processed++; - } - if (p->state == 8 && - p->chap_num_attributes_processed >= p->chap_num_attributes) { - p->chap_num_attributes = 0; - p->chap_num_attributes_processed = 0; - p->chap_current_datalen = 0; - } - } - return 0; -} - -int proxy_socks5_selectchap(ProxySocket *p) -{ - char *username = conf_get_str(p->conf, CONF_proxy_username); - char *password = conf_get_str(p->conf, CONF_proxy_password); - if (username[0] || password[0]) { - char chapbuf[514]; - int ulen; - chapbuf[0] = '\x01'; /* Version */ - chapbuf[1] = '\x02'; /* Number of attributes sent */ - chapbuf[2] = '\x11'; /* First attribute - algorithms list */ - chapbuf[3] = '\x01'; /* Only one CHAP algorithm */ - chapbuf[4] = '\x85'; /* ...and it's HMAC-MD5, the core one */ - chapbuf[5] = '\x02'; /* Second attribute - username */ - - ulen = strlen(username); - if (ulen > 255) ulen = 255; - if (ulen < 1) ulen = 1; - - chapbuf[6] = ulen; - memcpy(chapbuf+7, username, ulen); - - sk_write(p->sub_socket, chapbuf, ulen + 7); - p->chap_num_attributes = 0; - p->chap_num_attributes_processed = 0; - p->chap_current_attribute = -1; - p->chap_current_datalen = 0; - - p->state = 8; - } else - plug_closing(p->plug, "Proxy error: Server chose " - "CHAP authentication but we didn't offer it!", - PROXY_ERROR_GENERAL, 0); - return 1; -} diff --git a/code/crypto/CMakeLists.txt b/code/crypto/CMakeLists.txt new file mode 100644 index 0000000..c642036 --- /dev/null +++ b/code/crypto/CMakeLists.txt @@ -0,0 +1,207 @@ +add_sources_from_current_dir(crypto + aes-common.c + aes-select.c + aes-sw.c + arcfour.c + argon2.c + bcrypt.c + blake2.c + blowfish.c + chacha20-poly1305.c + crc32.c + des.c + diffie-hellman.c + dsa.c + ecc-arithmetic.c + ecc-ssh.c + hash_simple.c + hmac.c + mac.c + mac_simple.c + md5.c + mpint.c + prng.c + pubkey-pem.c + pubkey-ppk.c + pubkey-ssh1.c + rsa.c + sha256-common.c + sha256-select.c + sha256-sw.c + sha512-common.c + sha512-select.c + sha512-sw.c + sha3.c + sha1-common.c + sha1-select.c + sha1-sw.c + xdmauth.c) + +include(CheckCSourceCompiles) + +function(test_compile_with_flags outvar) + cmake_parse_arguments(OPT "" "" + "GNU_FLAGS;MSVC_FLAGS;ADD_SOURCES_IF_SUCCESSFUL;TEST_SOURCE" "${ARGN}") + + # Figure out what flags are applicable to this compiler. + set(flags) + if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR + CMAKE_C_COMPILER_ID MATCHES "Clang") + set(flags ${OPT_GNU_FLAGS}) + endif() + if(CMAKE_C_COMPILER_ID MATCHES "MSVC") + set(flags ${OPT_MSVC_FLAGS}) + endif() + + # See if we can compile the provided test program. + foreach(i ${flags}) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${i}") + endforeach() + check_c_source_compiles("${OPT_TEST_SOURCE}" "${outvar}") + + if(${outvar} AND OPT_ADD_SOURCES_IF_SUCCESSFUL) + # Make an object library that compiles the implementation with the + # necessary flags, and add the resulting objects to the crypto + # library. + set(libname object_lib_${outvar}) + add_library(${libname} OBJECT ${OPT_ADD_SOURCES_IF_SUCCESSFUL}) + target_compile_options(${libname} PRIVATE ${flags}) + target_sources(crypto PRIVATE $) + endif() + + # Export the output to the caller's scope, so that further tests can + # be based on it. + set(${outvar} ${${outvar}} PARENT_SCOPE) +endfunction() + +# ---------------------------------------------------------------------- +# Try to enable x86 intrinsics-based crypto implementations. + +test_compile_with_flags(HAVE_WMMINTRIN_H + GNU_FLAGS -msse4.1 + TEST_SOURCE " + #include + #include + volatile __m128i r, a, b; + int main(void) { r = _mm_xor_si128(a, b); }") +if(HAVE_WMMINTRIN_H) + test_compile_with_flags(HAVE_AES_NI + GNU_FLAGS -msse4.1 -maes + TEST_SOURCE " + #include + #include + volatile __m128i r, a, b; + int main(void) { r = _mm_aesenc_si128(a, b); }" + ADD_SOURCES_IF_SUCCESSFUL aes-ni aes-ni.c) + + # shaintrin.h doesn't exist on all compilers; sometimes it's folded + # into the other headers + test_compile_with_flags(HAVE_SHAINTRIN_H + GNU_FLAGS -msse4.1 -msha + TEST_SOURCE " + #include + #include + #include + #include + volatile __m128i r, a, b; + int main(void) { r = _mm_xor_si128(a, b); }") + if(HAVE_SHAINTRIN_H) + set(include_shaintrin "#include ") + else() + set(include_shaintrin "") + endif() + + test_compile_with_flags(HAVE_SHA_NI + GNU_FLAGS -msse4.1 -msha + TEST_SOURCE " + #include + #include + #include + ${include_shaintrin} + volatile __m128i r, a, b, c; + int main(void) { r = _mm_sha256rnds2_epu32(a, b, c); }" + ADD_SOURCES_IF_SUCCESSFUL sha256-ni.c sha1-ni.c) +endif() + +# ---------------------------------------------------------------------- +# Try to enable Arm Neon intrinsics-based crypto implementations. + +# Start by checking which header file we need. ACLE specifies that it +# ought to be , on both 32- and 64-bit Arm, but Visual +# Studio for some reason renamed the header to in +# 64-bit, and gives an error if you use the standard name. (However, +# clang-cl does let you use the standard name.) +test_compile_with_flags(HAVE_ARM_NEON_H + MSVC_FLAGS -D_ARM_USE_NEW_NEON_INTRINSICS + TEST_SOURCE " + #include + volatile uint8x16_t r, a, b; + int main(void) { r = veorq_u8(a, b); }") +if(HAVE_ARM_NEON_H) + set(neon ON) + set(neon_header "arm_neon.h") +else() + test_compile_with_flags(HAVE_ARM64_NEON_H TEST_SOURCE " + #include + volatile uint8x16_t r, a, b; + int main(void) { r = veorq_u8(a, b); }") + if(HAVE_ARM64_NEON_H) + set(neon ON) + set(neon_header "arm64_neon.h") + set(USE_ARM64_NEON_H ON) + endif() +endif() + +if(neon) + # If we have _some_ NEON header, look for the individual things we + # can enable with it. + + # The 'crypto' architecture extension includes support for AES, + # SHA-1, and SHA-256. + test_compile_with_flags(HAVE_NEON_CRYPTO + GNU_FLAGS -march=armv8-a+crypto + MSVC_FLAGS -D_ARM_USE_NEW_NEON_INTRINSICS + TEST_SOURCE " + #include <${neon_header}> + volatile uint8x16_t r, a, b; + volatile uint32x4_t s, x, y, z; + int main(void) { r = vaeseq_u8(a, b); s = vsha256hq_u32(x, y, z); }" + ADD_SOURCES_IF_SUCCESSFUL aes-neon.c sha256-neon.c sha1-neon.c) + + # The 'sha3' architecture extension, despite the name, includes + # support for SHA-512 (from the SHA-2 standard) as well as SHA-3 + # proper. + # + # Versions of clang up to and including clang 12 support this + # extension in assembly language, but not the ACLE intrinsics for + # it. So we check both. + test_compile_with_flags(HAVE_NEON_SHA512_INTRINSICS + GNU_FLAGS -march=armv8.2-a+crypto+sha3 + TEST_SOURCE " + #include <${neon_header}> + volatile uint64x2_t r, a, b; + int main(void) { r = vsha512su0q_u64(a, b); }" + ADD_SOURCES_IF_SUCCESSFUL sha512-neon.c) + if(HAVE_NEON_SHA512_INTRINSICS) + set(HAVE_NEON_SHA512 ON) + else() + test_compile_with_flags(HAVE_NEON_SHA512_ASM + GNU_FLAGS -march=armv8.2-a+crypto+sha3 + TEST_SOURCE " + #include <${neon_header}> + volatile uint64x2_t r, a; + int main(void) { __asm__(\"sha512su0 %0.2D,%1.2D\" : \"+w\" (r) : \"w\" (a)); }" + ADD_SOURCES_IF_SUCCESSFUL sha512-neon.c) + if(HAVE_NEON_SHA512_ASM) + set(HAVE_NEON_SHA512 ON) + endif() + endif() +endif() + +set(HAVE_AES_NI ${HAVE_AES_NI} PARENT_SCOPE) +set(HAVE_SHA_NI ${HAVE_SHA_NI} PARENT_SCOPE) +set(HAVE_SHAINTRIN_H ${HAVE_SHAINTRIN_H} PARENT_SCOPE) +set(HAVE_NEON_CRYPTO ${HAVE_NEON_CRYPTO} PARENT_SCOPE) +set(HAVE_NEON_SHA512 ${HAVE_NEON_SHA512} PARENT_SCOPE) +set(HAVE_NEON_SHA512_INTRINSICS ${HAVE_NEON_SHA512_INTRINSICS} PARENT_SCOPE) +set(USE_ARM64_NEON_H ${USE_ARM64_NEON_H} PARENT_SCOPE) diff --git a/code/crypto/aes-common.c b/code/crypto/aes-common.c new file mode 100644 index 0000000..e1c41dd --- /dev/null +++ b/code/crypto/aes-common.c @@ -0,0 +1,14 @@ +/* + * Common variable definitions across all the AES implementations. + */ + +#include "ssh.h" +#include "aes.h" + +const uint8_t aes_key_setup_round_constants[10] = { + /* The first few powers of X in GF(2^8), used during key setup. + * This can safely be a lookup table without side channel risks, + * because key setup iterates through it once in a standard way + * regardless of the key. */ + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, +}; diff --git a/code/crypto/aes-neon.c b/code/crypto/aes-neon.c new file mode 100644 index 0000000..d47d2fd --- /dev/null +++ b/code/crypto/aes-neon.c @@ -0,0 +1,294 @@ +/* ---------------------------------------------------------------------- + * Hardware-accelerated implementation of AES using Arm NEON. + */ + +#include "ssh.h" +#include "aes.h" + +#if USE_ARM64_NEON_H +#include +#else +#include +#endif + +static bool aes_neon_available(void) +{ + /* + * For Arm, we delegate to a per-platform AES detection function, + * because it has to be implemented by asking the operating system + * rather than directly querying the CPU. + * + * That's because Arm systems commonly have multiple cores that + * are not all alike, so any method of querying whether NEON + * crypto instructions work on the _current_ CPU - even one as + * crude as just trying one and catching the SIGILL - wouldn't + * give an answer that you could still rely on the first time the + * OS migrated your process to another CPU. + */ + return platform_aes_neon_available(); +} + +/* + * Core NEON encrypt/decrypt functions, one per length and direction. + */ + +#define NEON_CIPHER(len, repmacro) \ + static inline uint8x16_t aes_neon_##len##_e( \ + uint8x16_t v, const uint8x16_t *keysched) \ + { \ + repmacro(v = vaesmcq_u8(vaeseq_u8(v, *keysched++));); \ + v = vaeseq_u8(v, *keysched++); \ + return veorq_u8(v, *keysched); \ + } \ + static inline uint8x16_t aes_neon_##len##_d( \ + uint8x16_t v, const uint8x16_t *keysched) \ + { \ + repmacro(v = vaesimcq_u8(vaesdq_u8(v, *keysched++));); \ + v = vaesdq_u8(v, *keysched++); \ + return veorq_u8(v, *keysched); \ + } + +NEON_CIPHER(128, REP9) +NEON_CIPHER(192, REP11) +NEON_CIPHER(256, REP13) + +/* + * The main key expansion. + */ +static void aes_neon_key_expand( + const unsigned char *key, size_t key_words, + uint8x16_t *keysched_e, uint8x16_t *keysched_d) +{ + size_t rounds = key_words + 6; + size_t sched_words = (rounds + 1) * 4; + + /* + * Store the key schedule as 32-bit integers during expansion, so + * that it's easy to refer back to individual previous words. We + * collect them into the final uint8x16_t form at the end. + */ + uint32_t sched[MAXROUNDKEYS * 4]; + + unsigned rconpos = 0; + + for (size_t i = 0; i < sched_words; i++) { + if (i < key_words) { + sched[i] = GET_32BIT_LSB_FIRST(key + 4 * i); + } else { + uint32_t temp = sched[i - 1]; + + bool rotate_and_round_constant = (i % key_words == 0); + bool sub = rotate_and_round_constant || + (key_words == 8 && i % 8 == 4); + + if (rotate_and_round_constant) + temp = (temp << 24) | (temp >> 8); + + if (sub) { + uint32x4_t v32 = vdupq_n_u32(temp); + uint8x16_t v8 = vreinterpretq_u8_u32(v32); + v8 = vaeseq_u8(v8, vdupq_n_u8(0)); + v32 = vreinterpretq_u32_u8(v8); + temp = vget_lane_u32(vget_low_u32(v32), 0); + } + + if (rotate_and_round_constant) { + assert(rconpos < lenof(aes_key_setup_round_constants)); + temp ^= aes_key_setup_round_constants[rconpos++]; + } + + sched[i] = sched[i - key_words] ^ temp; + } + } + + /* + * Combine the key schedule words into uint8x16_t vectors and + * store them in the output context. + */ + for (size_t round = 0; round <= rounds; round++) + keysched_e[round] = vreinterpretq_u8_u32(vld1q_u32(sched + 4*round)); + + smemclr(sched, sizeof(sched)); + + /* + * Now prepare the modified keys for the inverse cipher. + */ + for (size_t eround = 0; eround <= rounds; eround++) { + size_t dround = rounds - eround; + uint8x16_t rkey = keysched_e[eround]; + if (eround && dround) /* neither first nor last */ + rkey = vaesimcq_u8(rkey); + keysched_d[dround] = rkey; + } +} + +/* + * Auxiliary routine to reverse the byte order of a vector, so that + * the SDCTR IV can be made big-endian for feeding to the cipher. + * + * In fact we don't need to reverse the vector _all_ the way; we leave + * the two lanes in MSW,LSW order, because that makes no difference to + * the efficiency of the increment. That way we only have to reverse + * bytes within each lane in this function. + */ +static inline uint8x16_t aes_neon_sdctr_reverse(uint8x16_t v) +{ + return vrev64q_u8(v); +} + +/* + * Auxiliary routine to increment the 128-bit counter used in SDCTR + * mode. There's no instruction to treat a 128-bit vector as a single + * long integer, so instead we have to increment the bottom half + * unconditionally, and the top half if the bottom half started off as + * all 1s (in which case there was about to be a carry). + */ +static inline uint8x16_t aes_neon_sdctr_increment(uint8x16_t in) +{ +#ifdef __aarch64__ + /* There will be a carry if the low 64 bits are all 1s. */ + uint64x1_t all1 = vcreate_u64(0xFFFFFFFFFFFFFFFF); + uint64x1_t carry = vceq_u64(vget_high_u64(vreinterpretq_u64_u8(in)), all1); + + /* Make a word whose bottom half is unconditionally all 1s, and + * the top half is 'carry', i.e. all 0s most of the time but all + * 1s if we need to increment the top half. Then that word is what + * we need to _subtract_ from the input counter. */ + uint64x2_t subtrahend = vcombine_u64(carry, all1); +#else + /* AArch32 doesn't have comparisons that operate on a 64-bit lane, + * so we start by comparing each 32-bit half of the low 64 bits + * _separately_ to all-1s. */ + uint32x2_t all1 = vdup_n_u32(0xFFFFFFFF); + uint32x2_t carry = vceq_u32( + vget_high_u32(vreinterpretq_u32_u8(in)), all1); + + /* Swap the 32-bit words of the compare output, and AND with the + * unswapped version. Now carry is all 1s iff the bottom half of + * the input counter was all 1s, and all 0s otherwise. */ + carry = vand_u32(carry, vrev64_u32(carry)); + + /* Now make the vector to subtract in the same way as above. */ + uint64x2_t subtrahend = vreinterpretq_u64_u32(vcombine_u32(carry, all1)); +#endif + + return vreinterpretq_u8_u64( + vsubq_u64(vreinterpretq_u64_u8(in), subtrahend)); +} + +/* + * The SSH interface and the cipher modes. + */ + +typedef struct aes_neon_context aes_neon_context; +struct aes_neon_context { + uint8x16_t keysched_e[MAXROUNDKEYS], keysched_d[MAXROUNDKEYS], iv; + + ssh_cipher ciph; +}; + +static ssh_cipher *aes_neon_new(const ssh_cipheralg *alg) +{ + const struct aes_extra *extra = (const struct aes_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + aes_neon_context *ctx = snew(aes_neon_context); + ctx->ciph.vt = alg; + return &ctx->ciph; +} + +static void aes_neon_free(ssh_cipher *ciph) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + smemclr(ctx, sizeof(*ctx)); + sfree(ctx); +} + +static void aes_neon_setkey(ssh_cipher *ciph, const void *vkey) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + const unsigned char *key = (const unsigned char *)vkey; + + aes_neon_key_expand(key, ctx->ciph.vt->real_keybits / 32, + ctx->keysched_e, ctx->keysched_d); +} + +static void aes_neon_setiv_cbc(ssh_cipher *ciph, const void *iv) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + ctx->iv = vld1q_u8(iv); +} + +static void aes_neon_setiv_sdctr(ssh_cipher *ciph, const void *iv) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + uint8x16_t counter = vld1q_u8(iv); + ctx->iv = aes_neon_sdctr_reverse(counter); +} + +typedef uint8x16_t (*aes_neon_fn)(uint8x16_t v, const uint8x16_t *keysched); + +static inline void aes_cbc_neon_encrypt( + ssh_cipher *ciph, void *vblk, int blklen, aes_neon_fn encrypt) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + + for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; + blk < finish; blk += 16) { + uint8x16_t plaintext = vld1q_u8(blk); + uint8x16_t cipher_input = veorq_u8(plaintext, ctx->iv); + uint8x16_t ciphertext = encrypt(cipher_input, ctx->keysched_e); + vst1q_u8(blk, ciphertext); + ctx->iv = ciphertext; + } +} + +static inline void aes_cbc_neon_decrypt( + ssh_cipher *ciph, void *vblk, int blklen, aes_neon_fn decrypt) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + + for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; + blk < finish; blk += 16) { + uint8x16_t ciphertext = vld1q_u8(blk); + uint8x16_t decrypted = decrypt(ciphertext, ctx->keysched_d); + uint8x16_t plaintext = veorq_u8(decrypted, ctx->iv); + vst1q_u8(blk, plaintext); + ctx->iv = ciphertext; + } +} + +static inline void aes_sdctr_neon( + ssh_cipher *ciph, void *vblk, int blklen, aes_neon_fn encrypt) +{ + aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); + + for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; + blk < finish; blk += 16) { + uint8x16_t counter = aes_neon_sdctr_reverse(ctx->iv); + uint8x16_t keystream = encrypt(counter, ctx->keysched_e); + uint8x16_t input = vld1q_u8(blk); + uint8x16_t output = veorq_u8(input, keystream); + vst1q_u8(blk, output); + ctx->iv = aes_neon_sdctr_increment(ctx->iv); + } +} + +#define NEON_ENC_DEC(len) \ + static void aes##len##_neon_cbc_encrypt( \ + ssh_cipher *ciph, void *vblk, int blklen) \ + { aes_cbc_neon_encrypt(ciph, vblk, blklen, aes_neon_##len##_e); } \ + static void aes##len##_neon_cbc_decrypt( \ + ssh_cipher *ciph, void *vblk, int blklen) \ + { aes_cbc_neon_decrypt(ciph, vblk, blklen, aes_neon_##len##_d); } \ + static void aes##len##_neon_sdctr( \ + ssh_cipher *ciph, void *vblk, int blklen) \ + { aes_sdctr_neon(ciph, vblk, blklen, aes_neon_##len##_e); } \ + +NEON_ENC_DEC(128) +NEON_ENC_DEC(192) +NEON_ENC_DEC(256) + +AES_EXTRA(_neon); +AES_ALL_VTABLES(_neon, "NEON accelerated"); diff --git a/code/crypto/aes-ni.c b/code/crypto/aes-ni.c new file mode 100644 index 0000000..22348de --- /dev/null +++ b/code/crypto/aes-ni.c @@ -0,0 +1,281 @@ +/* + * Hardware-accelerated implementation of AES using x86 AES-NI. + */ + +#include "ssh.h" +#include "aes.h" + +#include +#include + +#if defined(__clang__) || defined(__GNUC__) +#include +#define GET_CPU_ID(out) __cpuid(1, (out)[0], (out)[1], (out)[2], (out)[3]) +#else +#define GET_CPU_ID(out) __cpuid(out, 1) +#endif + +static bool aes_ni_available(void) +{ + /* + * Determine if AES is available on this CPU, by checking that + * both AES itself and SSE4.1 are supported. + */ + unsigned int CPUInfo[4]; + GET_CPU_ID(CPUInfo); + return (CPUInfo[2] & (1 << 25)) && (CPUInfo[2] & (1 << 19)); +} + +/* + * Core AES-NI encrypt/decrypt functions, one per length and direction. + */ + +#define NI_CIPHER(len, dir, dirlong, repmacro) \ + static inline __m128i aes_ni_##len##_##dir( \ + __m128i v, const __m128i *keysched) \ + { \ + v = _mm_xor_si128(v, *keysched++); \ + repmacro(v = _mm_aes##dirlong##_si128(v, *keysched++);); \ + return _mm_aes##dirlong##last_si128(v, *keysched); \ + } + +NI_CIPHER(128, e, enc, REP9) +NI_CIPHER(128, d, dec, REP9) +NI_CIPHER(192, e, enc, REP11) +NI_CIPHER(192, d, dec, REP11) +NI_CIPHER(256, e, enc, REP13) +NI_CIPHER(256, d, dec, REP13) + +/* + * The main key expansion. + */ +static void aes_ni_key_expand( + const unsigned char *key, size_t key_words, + __m128i *keysched_e, __m128i *keysched_d) +{ + size_t rounds = key_words + 6; + size_t sched_words = (rounds + 1) * 4; + + /* + * Store the key schedule as 32-bit integers during expansion, so + * that it's easy to refer back to individual previous words. We + * collect them into the final __m128i form at the end. + */ + uint32_t sched[MAXROUNDKEYS * 4]; + + unsigned rconpos = 0; + + for (size_t i = 0; i < sched_words; i++) { + if (i < key_words) { + sched[i] = GET_32BIT_LSB_FIRST(key + 4 * i); + } else { + uint32_t temp = sched[i - 1]; + + bool rotate_and_round_constant = (i % key_words == 0); + bool only_sub = (key_words == 8 && i % 8 == 4); + + if (rotate_and_round_constant) { + __m128i v = _mm_setr_epi32(0,temp,0,0); + v = _mm_aeskeygenassist_si128(v, 0); + temp = _mm_extract_epi32(v, 1); + + assert(rconpos < lenof(aes_key_setup_round_constants)); + temp ^= aes_key_setup_round_constants[rconpos++]; + } else if (only_sub) { + __m128i v = _mm_setr_epi32(0,temp,0,0); + v = _mm_aeskeygenassist_si128(v, 0); + temp = _mm_extract_epi32(v, 0); + } + + sched[i] = sched[i - key_words] ^ temp; + } + } + + /* + * Combine the key schedule words into __m128i vectors and store + * them in the output context. + */ + for (size_t round = 0; round <= rounds; round++) + keysched_e[round] = _mm_setr_epi32( + sched[4*round ], sched[4*round+1], + sched[4*round+2], sched[4*round+3]); + + smemclr(sched, sizeof(sched)); + + /* + * Now prepare the modified keys for the inverse cipher. + */ + for (size_t eround = 0; eround <= rounds; eround++) { + size_t dround = rounds - eround; + __m128i rkey = keysched_e[eround]; + if (eround && dround) /* neither first nor last */ + rkey = _mm_aesimc_si128(rkey); + keysched_d[dround] = rkey; + } +} + +/* + * Auxiliary routine to increment the 128-bit counter used in SDCTR + * mode. + */ +static inline __m128i aes_ni_sdctr_increment(__m128i v) +{ + const __m128i ONE = _mm_setr_epi32(1,0,0,0); + const __m128i ZERO = _mm_setzero_si128(); + + /* Increment the low-order 64 bits of v */ + v = _mm_add_epi64(v, ONE); + /* Check if they've become zero */ + __m128i cmp = _mm_cmpeq_epi64(v, ZERO); + /* If so, the low half of cmp is all 1s. Pack that into the high + * half of addend with zero in the low half. */ + __m128i addend = _mm_unpacklo_epi64(ZERO, cmp); + /* And subtract that from v, which increments the high 64 bits iff + * the low 64 wrapped round. */ + v = _mm_sub_epi64(v, addend); + + return v; +} + +/* + * Auxiliary routine to reverse the byte order of a vector, so that + * the SDCTR IV can be made big-endian for feeding to the cipher. + */ +static inline __m128i aes_ni_sdctr_reverse(__m128i v) +{ + v = _mm_shuffle_epi8( + v, _mm_setr_epi8(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)); + return v; +} + +/* + * The SSH interface and the cipher modes. + */ + +typedef struct aes_ni_context aes_ni_context; +struct aes_ni_context { + __m128i keysched_e[MAXROUNDKEYS], keysched_d[MAXROUNDKEYS], iv; + + void *pointer_to_free; + ssh_cipher ciph; +}; + +static ssh_cipher *aes_ni_new(const ssh_cipheralg *alg) +{ + const struct aes_extra *extra = (const struct aes_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + /* + * The __m128i variables in the context structure need to be + * 16-byte aligned, but not all malloc implementations that this + * code has to work with will guarantee to return a 16-byte + * aligned pointer. So we over-allocate, manually realign the + * pointer ourselves, and store the original one inside the + * context so we know how to free it later. + */ + void *allocation = smalloc(sizeof(aes_ni_context) + 15); + uintptr_t alloc_address = (uintptr_t)allocation; + uintptr_t aligned_address = (alloc_address + 15) & ~15; + aes_ni_context *ctx = (aes_ni_context *)aligned_address; + + ctx->ciph.vt = alg; + ctx->pointer_to_free = allocation; + return &ctx->ciph; +} + +static void aes_ni_free(ssh_cipher *ciph) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + void *allocation = ctx->pointer_to_free; + smemclr(ctx, sizeof(*ctx)); + sfree(allocation); +} + +static void aes_ni_setkey(ssh_cipher *ciph, const void *vkey) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + const unsigned char *key = (const unsigned char *)vkey; + + aes_ni_key_expand(key, ctx->ciph.vt->real_keybits / 32, + ctx->keysched_e, ctx->keysched_d); +} + +static void aes_ni_setiv_cbc(ssh_cipher *ciph, const void *iv) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + ctx->iv = _mm_loadu_si128(iv); +} + +static void aes_ni_setiv_sdctr(ssh_cipher *ciph, const void *iv) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + __m128i counter = _mm_loadu_si128(iv); + ctx->iv = aes_ni_sdctr_reverse(counter); +} + +typedef __m128i (*aes_ni_fn)(__m128i v, const __m128i *keysched); + +static inline void aes_cbc_ni_encrypt( + ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn encrypt) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + + for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; + blk < finish; blk += 16) { + __m128i plaintext = _mm_loadu_si128((const __m128i *)blk); + __m128i cipher_input = _mm_xor_si128(plaintext, ctx->iv); + __m128i ciphertext = encrypt(cipher_input, ctx->keysched_e); + _mm_storeu_si128((__m128i *)blk, ciphertext); + ctx->iv = ciphertext; + } +} + +static inline void aes_cbc_ni_decrypt( + ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn decrypt) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + + for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; + blk < finish; blk += 16) { + __m128i ciphertext = _mm_loadu_si128((const __m128i *)blk); + __m128i decrypted = decrypt(ciphertext, ctx->keysched_d); + __m128i plaintext = _mm_xor_si128(decrypted, ctx->iv); + _mm_storeu_si128((__m128i *)blk, plaintext); + ctx->iv = ciphertext; + } +} + +static inline void aes_sdctr_ni( + ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn encrypt) +{ + aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); + + for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; + blk < finish; blk += 16) { + __m128i counter = aes_ni_sdctr_reverse(ctx->iv); + __m128i keystream = encrypt(counter, ctx->keysched_e); + __m128i input = _mm_loadu_si128((const __m128i *)blk); + __m128i output = _mm_xor_si128(input, keystream); + _mm_storeu_si128((__m128i *)blk, output); + ctx->iv = aes_ni_sdctr_increment(ctx->iv); + } +} + +#define NI_ENC_DEC(len) \ + static void aes##len##_ni_cbc_encrypt( \ + ssh_cipher *ciph, void *vblk, int blklen) \ + { aes_cbc_ni_encrypt(ciph, vblk, blklen, aes_ni_##len##_e); } \ + static void aes##len##_ni_cbc_decrypt( \ + ssh_cipher *ciph, void *vblk, int blklen) \ + { aes_cbc_ni_decrypt(ciph, vblk, blklen, aes_ni_##len##_d); } \ + static void aes##len##_ni_sdctr( \ + ssh_cipher *ciph, void *vblk, int blklen) \ + { aes_sdctr_ni(ciph, vblk, blklen, aes_ni_##len##_e); } \ + +NI_ENC_DEC(128) +NI_ENC_DEC(192) +NI_ENC_DEC(256) + +AES_EXTRA(_ni); +AES_ALL_VTABLES(_ni, "AES-NI accelerated"); diff --git a/code/crypto/aes-select.c b/code/crypto/aes-select.c new file mode 100644 index 0000000..f0c5031 --- /dev/null +++ b/code/crypto/aes-select.c @@ -0,0 +1,89 @@ +/* + * Top-level vtables to select an AES implementation. + */ + +#include +#include + +#include "putty.h" +#include "ssh.h" +#include "aes.h" + +static ssh_cipher *aes_select(const ssh_cipheralg *alg) +{ + const ssh_cipheralg *const *real_algs = (const ssh_cipheralg **)alg->extra; + + for (size_t i = 0; real_algs[i]; i++) { + const ssh_cipheralg *alg = real_algs[i]; + const struct aes_extra *alg_extra = + (const struct aes_extra *)alg->extra; + if (check_availability(alg_extra)) + return ssh_cipher_new(alg); + } + + /* We should never reach the NULL at the end of the list, because + * the last non-NULL entry should be software-only AES, which is + * always available. */ + unreachable("aes_select ran off the end of its list"); +} + +#if HAVE_AES_NI +#define IF_NI(...) __VA_ARGS__ +#else +#define IF_NI(...) +#endif + +#if HAVE_NEON_CRYPTO +#define IF_NEON(...) __VA_ARGS__ +#else +#define IF_NEON(...) +#endif + +#define AES_SELECTOR_VTABLE(mode_c, mode_protocol, mode_display, bits) \ + static const ssh_cipheralg * \ + ssh_aes ## bits ## _ ## mode_c ## _impls[] = { \ + IF_NI(&ssh_aes ## bits ## _ ## mode_c ## _ni,) \ + IF_NEON(&ssh_aes ## bits ## _ ## mode_c ## _neon,) \ + &ssh_aes ## bits ## _ ## mode_c ## _sw, \ + NULL, \ + }; \ + const ssh_cipheralg ssh_aes ## bits ## _ ## mode_c = { \ + .new = aes_select, \ + .ssh2_id = "aes" #bits "-" mode_protocol, \ + .blksize = 16, \ + .real_keybits = bits, \ + .padded_keybytes = bits/8, \ + .text_name = "AES-" #bits " " mode_display \ + " (dummy selector vtable)", \ + .extra = ssh_aes ## bits ## _ ## mode_c ## _impls, \ + } + +AES_SELECTOR_VTABLE(cbc, "cbc", "CBC", 128); +AES_SELECTOR_VTABLE(cbc, "cbc", "CBC", 192); +AES_SELECTOR_VTABLE(cbc, "cbc", "CBC", 256); +AES_SELECTOR_VTABLE(sdctr, "ctr", "SDCTR", 128); +AES_SELECTOR_VTABLE(sdctr, "ctr", "SDCTR", 192); +AES_SELECTOR_VTABLE(sdctr, "ctr", "SDCTR", 256); + +static const ssh_cipheralg ssh_rijndael_lysator = { + /* Same as aes256_cbc, but with a different protocol ID */ + .new = aes_select, + .ssh2_id = "rijndael-cbc@lysator.liu.se", + .blksize = 16, + .real_keybits = 256, + .padded_keybytes = 256/8, + .text_name = "AES-256 CBC (dummy selector vtable)", + .extra = ssh_aes256_cbc_impls, +}; + +static const ssh_cipheralg *const aes_list[] = { + &ssh_aes256_sdctr, + &ssh_aes256_cbc, + &ssh_rijndael_lysator, + &ssh_aes192_sdctr, + &ssh_aes192_cbc, + &ssh_aes128_sdctr, + &ssh_aes128_cbc, +}; + +const ssh2_ciphers ssh2_aes = { lenof(aes_list), aes_list }; diff --git a/code/sshaes.c b/code/crypto/aes-sw.c similarity index 59% rename from code/sshaes.c rename to code/crypto/aes-sw.c index 6671879..f851238 100644 --- a/code/sshaes.c +++ b/code/crypto/aes-sw.c @@ -1,247 +1,4 @@ /* - * sshaes.c - implementation of AES - */ - -#include -#include - -#include "ssh.h" -#include "mpint_i.h" /* we reuse the BignumInt system */ - -/* - * Start by deciding whether we can support hardware AES at all. - */ -#define HW_AES_NONE 0 -#define HW_AES_NI 1 -#define HW_AES_NEON 2 - -#ifdef _FORCE_AES_NI -# define HW_AES HW_AES_NI -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__x86_64__) || defined(__i386)) -# define HW_AES HW_AES_NI -# endif -#elif defined(__GNUC__) -# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && \ - (defined(__x86_64__) || defined(__i386)) -# define HW_AES HW_AES_NI -# endif -#elif defined (_MSC_VER) -# if (defined(_M_X64) || defined(_M_IX86)) && _MSC_FULL_VER >= 150030729 -# define HW_AES HW_AES_NI -# endif -#endif - -#ifdef _FORCE_AES_NEON -# define HW_AES HW_AES_NEON -#elif defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - /* Arm can potentially support both endiannesses, but this code - * hasn't been tested on anything but little. If anyone wants to - * run big-endian, they'll need to fix it first. */ -#elif defined __ARM_FEATURE_CRYPTO - /* If the Arm crypto extension is available already, we can - * support NEON AES without having to enable anything by hand */ -# define HW_AES HW_AES_NEON -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__aarch64__)) - /* clang can enable the crypto extension in AArch64 using - * __attribute__((target)) */ -# define HW_AES HW_AES_NEON -# define USE_CLANG_ATTR_TARGET_AARCH64 -# endif -#elif defined _MSC_VER -# if defined _M_ARM64 -# define HW_AES HW_AES_NEON - /* 64-bit Visual Studio uses the header in place - * of the standard */ -# define USE_ARM64_NEON_H -# elif defined _M_ARM -# define HW_AES HW_AES_NEON - /* 32-bit Visual Studio uses the right header name, but requires - * this #define to enable a set of intrinsic definitions that - * do not omit one of the parameters for vaes[ed]q_u8 */ -# define _ARM_USE_NEW_NEON_INTRINSICS -# endif -#endif - -#if defined _FORCE_SOFTWARE_AES || !defined HW_AES -# undef HW_AES -# define HW_AES HW_AES_NONE -#endif - -#if HW_AES == HW_AES_NI -#define HW_NAME_SUFFIX " (AES-NI accelerated)" -#elif HW_AES == HW_AES_NEON -#define HW_NAME_SUFFIX " (NEON accelerated)" -#else -#define HW_NAME_SUFFIX " (!NONEXISTENT ACCELERATED VERSION!)" -#endif - -/* - * Vtable collection for AES. For each SSH-level cipher id (i.e. - * combination of key length and cipher mode), we provide three - * vtables: one for the pure software implementation, one using - * hardware acceleration (if available), and a top-level one which is - * never actually instantiated, and only contains a new() method whose - * job is to decide which of the other two to return an actual - * instance of. - */ - -static ssh_cipher *aes_select(const ssh_cipheralg *alg); -static ssh_cipher *aes_sw_new(const ssh_cipheralg *alg); -static void aes_sw_free(ssh_cipher *); -static void aes_sw_setiv_cbc(ssh_cipher *, const void *iv); -static void aes_sw_setiv_sdctr(ssh_cipher *, const void *iv); -static void aes_sw_setkey(ssh_cipher *, const void *key); -static ssh_cipher *aes_hw_new(const ssh_cipheralg *alg); -static void aes_hw_free(ssh_cipher *); -static void aes_hw_setiv_cbc(ssh_cipher *, const void *iv); -static void aes_hw_setiv_sdctr(ssh_cipher *, const void *iv); -static void aes_hw_setkey(ssh_cipher *, const void *key); - -struct aes_extra { - const ssh_cipheralg *sw, *hw; -}; - -#define VTABLES_INNER(cid, pid, bits, name, encsuffix, \ - decsuffix, setivsuffix, flagsval) \ - static void cid##_sw##encsuffix(ssh_cipher *, void *blk, int len); \ - static void cid##_sw##decsuffix(ssh_cipher *, void *blk, int len); \ - const ssh_cipheralg ssh_##cid##_sw = { \ - .new = aes_sw_new, \ - .free = aes_sw_free, \ - .setiv = aes_sw_##setivsuffix, \ - .setkey = aes_sw_setkey, \ - .encrypt = cid##_sw##encsuffix, \ - .decrypt = cid##_sw##decsuffix, \ - .ssh2_id = pid, \ - .blksize = 16, \ - .real_keybits = bits, \ - .padded_keybytes = bits/8, \ - .flags = flagsval, \ - .text_name = name " (unaccelerated)", \ - }; \ - \ - static void cid##_hw##encsuffix(ssh_cipher *, void *blk, int len); \ - static void cid##_hw##decsuffix(ssh_cipher *, void *blk, int len); \ - const ssh_cipheralg ssh_##cid##_hw = { \ - .new = aes_hw_new, \ - .free = aes_hw_free, \ - .setiv = aes_hw_##setivsuffix, \ - .setkey = aes_hw_setkey, \ - .encrypt = cid##_hw##encsuffix, \ - .decrypt = cid##_hw##decsuffix, \ - .ssh2_id = pid, \ - .blksize = 16, \ - .real_keybits = bits, \ - .padded_keybytes = bits/8, \ - .flags = flagsval, \ - .text_name = name HW_NAME_SUFFIX, \ - }; \ - \ - static const struct aes_extra extra_##cid = { \ - &ssh_##cid##_sw, &ssh_##cid##_hw }; \ - \ - const ssh_cipheralg ssh_##cid = { \ - .new = aes_select, \ - .ssh2_id = pid, \ - .blksize = 16, \ - .real_keybits = bits, \ - .padded_keybytes = bits/8, \ - .flags = flagsval, \ - .text_name = name " (dummy selector vtable)", \ - .extra = &extra_##cid \ - }; \ - -#define VTABLES(keylen) \ - VTABLES_INNER(aes ## keylen ## _cbc, "aes" #keylen "-cbc", \ - keylen, "AES-" #keylen " CBC", _encrypt, _decrypt, \ - setiv_cbc, SSH_CIPHER_IS_CBC) \ - VTABLES_INNER(aes ## keylen ## _sdctr, "aes" #keylen "-ctr", \ - keylen, "AES-" #keylen " SDCTR",,, setiv_sdctr, 0) - -VTABLES(128) -VTABLES(192) -VTABLES(256) - -static const ssh_cipheralg ssh_rijndael_lysator = { - /* Same as aes256_cbc, but with a different protocol ID */ - .new = aes_select, - .ssh2_id = "rijndael-cbc@lysator.liu.se", - .blksize = 16, - .real_keybits = 256, - .padded_keybytes = 256/8, - .flags = 0, - .text_name = "AES-256 CBC (dummy selector vtable)", - .extra = &extra_aes256_cbc, -}; - -static const ssh_cipheralg *const aes_list[] = { - &ssh_aes256_sdctr, - &ssh_aes256_cbc, - &ssh_rijndael_lysator, - &ssh_aes192_sdctr, - &ssh_aes192_cbc, - &ssh_aes128_sdctr, - &ssh_aes128_cbc, -}; - -const ssh2_ciphers ssh2_aes = { lenof(aes_list), aes_list }; - -/* - * The actual query function that asks if hardware acceleration is - * available. - */ -static bool aes_hw_available(void); - -/* - * The top-level selection function, caching the results of - * aes_hw_available() so it only has to run once. - */ -static bool aes_hw_available_cached(void) -{ - static bool initialised = false; - static bool hw_available; - if (!initialised) { - hw_available = aes_hw_available(); - initialised = true; - } - return hw_available; -} - -static ssh_cipher *aes_select(const ssh_cipheralg *alg) -{ - const struct aes_extra *extra = (const struct aes_extra *)alg->extra; - const ssh_cipheralg *real_alg = - aes_hw_available_cached() ? extra->hw : extra->sw; - - return ssh_cipher_new(real_alg); -} - -/* ---------------------------------------------------------------------- - * Definitions likely to be helpful to multiple implementations. - */ - -#define REP2(x) x x -#define REP4(x) REP2(REP2(x)) -#define REP8(x) REP2(REP4(x)) -#define REP9(x) REP8(x) x -#define REP11(x) REP8(x) REP2(x) x -#define REP13(x) REP8(x) REP4(x) x - -static const uint8_t key_setup_round_constants[] = { - /* The first few powers of X in GF(2^8), used during key setup. - * This can safely be a lookup table without side channel risks, - * because key setup iterates through it once in a standard way - * regardless of the key. */ - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, -}; - -#define MAXROUNDKEYS 15 - -/* ---------------------------------------------------------------------- * Software implementation of AES. * * This implementation uses a bit-sliced representation. Instead of @@ -257,6 +14,16 @@ static const uint8_t key_setup_round_constants[] = { * ops you get 64 S-box lookups, not just one. */ +#include "ssh.h" +#include "aes.h" +#include "mpint_i.h" /* we reuse the BignumInt system */ + +static bool aes_sw_available(void) +{ + /* Software AES is always available */ + return true; +} + #define SLICE_PARALLELISM (BIGNUM_INT_BYTES / 2) #ifdef BITSLICED_DEBUG @@ -922,8 +689,8 @@ static void aes_sliced_key_setup( } if (rotate_and_round_constant) { - assert(rconpos < lenof(key_setup_round_constants)); - uint8_t rcon = key_setup_round_constants[rconpos++]; + assert(rconpos < lenof(aes_key_setup_round_constants)); + uint8_t rcon = aes_key_setup_round_constants[rconpos++]; for (size_t i = 0; i < 8; i++) slices[i] ^= 1 & (rcon >> i); } @@ -1255,13 +1022,13 @@ static inline void aes_sdctr_sw( } #define SW_ENC_DEC(len) \ - static void aes##len##_cbc_sw_encrypt( \ + static void aes##len##_sw_cbc_encrypt( \ ssh_cipher *ciph, void *vblk, int blklen) \ { aes_cbc_sw_encrypt(ciph, vblk, blklen); } \ - static void aes##len##_cbc_sw_decrypt( \ + static void aes##len##_sw_cbc_decrypt( \ ssh_cipher *ciph, void *vblk, int blklen) \ { aes_cbc_sw_decrypt(ciph, vblk, blklen); } \ - static void aes##len##_sdctr_sw( \ + static void aes##len##_sw_sdctr( \ ssh_cipher *ciph, void *vblk, int blklen) \ { aes_sdctr_sw(ciph, vblk, blklen); } @@ -1269,645 +1036,5 @@ SW_ENC_DEC(128) SW_ENC_DEC(192) SW_ENC_DEC(256) -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of AES using x86 AES-NI. - */ - -#if HW_AES == HW_AES_NI - -/* - * Set target architecture for Clang and GCC - */ -#if !defined(__clang__) && defined(__GNUC__) -# pragma GCC target("aes") -# pragma GCC target("sse4.1") -#endif - -#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) -# define FUNC_ISA __attribute__ ((target("sse4.1,aes"))) -#else -# define FUNC_ISA -#endif - -#include -#include - -#if defined(__clang__) || defined(__GNUC__) -#include -#define GET_CPU_ID(out) __cpuid(1, (out)[0], (out)[1], (out)[2], (out)[3]) -#else -#define GET_CPU_ID(out) __cpuid(out, 1) -#endif - -bool aes_hw_available(void) -{ - /* - * Determine if AES is available on this CPU, by checking that - * both AES itself and SSE4.1 are supported. - */ - unsigned int CPUInfo[4]; - GET_CPU_ID(CPUInfo); - return (CPUInfo[2] & (1 << 25)) && (CPUInfo[2] & (1 << 19)); -} - -/* - * Core AES-NI encrypt/decrypt functions, one per length and direction. - */ - -#define NI_CIPHER(len, dir, dirlong, repmacro) \ - static FUNC_ISA inline __m128i aes_ni_##len##_##dir( \ - __m128i v, const __m128i *keysched) \ - { \ - v = _mm_xor_si128(v, *keysched++); \ - repmacro(v = _mm_aes##dirlong##_si128(v, *keysched++);); \ - return _mm_aes##dirlong##last_si128(v, *keysched); \ - } - -NI_CIPHER(128, e, enc, REP9) -NI_CIPHER(128, d, dec, REP9) -NI_CIPHER(192, e, enc, REP11) -NI_CIPHER(192, d, dec, REP11) -NI_CIPHER(256, e, enc, REP13) -NI_CIPHER(256, d, dec, REP13) - -/* - * The main key expansion. - */ -static FUNC_ISA void aes_ni_key_expand( - const unsigned char *key, size_t key_words, - __m128i *keysched_e, __m128i *keysched_d) -{ - size_t rounds = key_words + 6; - size_t sched_words = (rounds + 1) * 4; - - /* - * Store the key schedule as 32-bit integers during expansion, so - * that it's easy to refer back to individual previous words. We - * collect them into the final __m128i form at the end. - */ - uint32_t sched[MAXROUNDKEYS * 4]; - - unsigned rconpos = 0; - - for (size_t i = 0; i < sched_words; i++) { - if (i < key_words) { - sched[i] = GET_32BIT_LSB_FIRST(key + 4 * i); - } else { - uint32_t temp = sched[i - 1]; - - bool rotate_and_round_constant = (i % key_words == 0); - bool only_sub = (key_words == 8 && i % 8 == 4); - - if (rotate_and_round_constant) { - __m128i v = _mm_setr_epi32(0,temp,0,0); - v = _mm_aeskeygenassist_si128(v, 0); - temp = _mm_extract_epi32(v, 1); - - assert(rconpos < lenof(key_setup_round_constants)); - temp ^= key_setup_round_constants[rconpos++]; - } else if (only_sub) { - __m128i v = _mm_setr_epi32(0,temp,0,0); - v = _mm_aeskeygenassist_si128(v, 0); - temp = _mm_extract_epi32(v, 0); - } - - sched[i] = sched[i - key_words] ^ temp; - } - } - - /* - * Combine the key schedule words into __m128i vectors and store - * them in the output context. - */ - for (size_t round = 0; round <= rounds; round++) - keysched_e[round] = _mm_setr_epi32( - sched[4*round ], sched[4*round+1], - sched[4*round+2], sched[4*round+3]); - - smemclr(sched, sizeof(sched)); - - /* - * Now prepare the modified keys for the inverse cipher. - */ - for (size_t eround = 0; eround <= rounds; eround++) { - size_t dround = rounds - eround; - __m128i rkey = keysched_e[eround]; - if (eround && dround) /* neither first nor last */ - rkey = _mm_aesimc_si128(rkey); - keysched_d[dround] = rkey; - } -} - -/* - * Auxiliary routine to increment the 128-bit counter used in SDCTR - * mode. - */ -static FUNC_ISA inline __m128i aes_ni_sdctr_increment(__m128i v) -{ - const __m128i ONE = _mm_setr_epi32(1,0,0,0); - const __m128i ZERO = _mm_setzero_si128(); - - /* Increment the low-order 64 bits of v */ - v = _mm_add_epi64(v, ONE); - /* Check if they've become zero */ - __m128i cmp = _mm_cmpeq_epi64(v, ZERO); - /* If so, the low half of cmp is all 1s. Pack that into the high - * half of addend with zero in the low half. */ - __m128i addend = _mm_unpacklo_epi64(ZERO, cmp); - /* And subtract that from v, which increments the high 64 bits iff - * the low 64 wrapped round. */ - v = _mm_sub_epi64(v, addend); - - return v; -} - -/* - * Auxiliary routine to reverse the byte order of a vector, so that - * the SDCTR IV can be made big-endian for feeding to the cipher. - */ -static FUNC_ISA inline __m128i aes_ni_sdctr_reverse(__m128i v) -{ - v = _mm_shuffle_epi8( - v, _mm_setr_epi8(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)); - return v; -} - -/* - * The SSH interface and the cipher modes. - */ - -typedef struct aes_ni_context aes_ni_context; -struct aes_ni_context { - __m128i keysched_e[MAXROUNDKEYS], keysched_d[MAXROUNDKEYS], iv; - - void *pointer_to_free; - ssh_cipher ciph; -}; - -static ssh_cipher *aes_hw_new(const ssh_cipheralg *alg) -{ - if (!aes_hw_available_cached()) - return NULL; - - /* - * The __m128i variables in the context structure need to be - * 16-byte aligned, but not all malloc implementations that this - * code has to work with will guarantee to return a 16-byte - * aligned pointer. So we over-allocate, manually realign the - * pointer ourselves, and store the original one inside the - * context so we know how to free it later. - */ - void *allocation = smalloc(sizeof(aes_ni_context) + 15); - uintptr_t alloc_address = (uintptr_t)allocation; - uintptr_t aligned_address = (alloc_address + 15) & ~15; - aes_ni_context *ctx = (aes_ni_context *)aligned_address; - - ctx->ciph.vt = alg; - ctx->pointer_to_free = allocation; - return &ctx->ciph; -} - -static void aes_hw_free(ssh_cipher *ciph) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - void *allocation = ctx->pointer_to_free; - smemclr(ctx, sizeof(*ctx)); - sfree(allocation); -} - -static void aes_hw_setkey(ssh_cipher *ciph, const void *vkey) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - const unsigned char *key = (const unsigned char *)vkey; - - aes_ni_key_expand(key, ctx->ciph.vt->real_keybits / 32, - ctx->keysched_e, ctx->keysched_d); -} - -static FUNC_ISA void aes_hw_setiv_cbc(ssh_cipher *ciph, const void *iv) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - ctx->iv = _mm_loadu_si128(iv); -} - -static FUNC_ISA void aes_hw_setiv_sdctr(ssh_cipher *ciph, const void *iv) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - __m128i counter = _mm_loadu_si128(iv); - ctx->iv = aes_ni_sdctr_reverse(counter); -} - -typedef __m128i (*aes_ni_fn)(__m128i v, const __m128i *keysched); - -static FUNC_ISA inline void aes_cbc_ni_encrypt( - ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn encrypt) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - - for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; - blk < finish; blk += 16) { - __m128i plaintext = _mm_loadu_si128((const __m128i *)blk); - __m128i cipher_input = _mm_xor_si128(plaintext, ctx->iv); - __m128i ciphertext = encrypt(cipher_input, ctx->keysched_e); - _mm_storeu_si128((__m128i *)blk, ciphertext); - ctx->iv = ciphertext; - } -} - -static FUNC_ISA inline void aes_cbc_ni_decrypt( - ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn decrypt) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - - for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; - blk < finish; blk += 16) { - __m128i ciphertext = _mm_loadu_si128((const __m128i *)blk); - __m128i decrypted = decrypt(ciphertext, ctx->keysched_d); - __m128i plaintext = _mm_xor_si128(decrypted, ctx->iv); - _mm_storeu_si128((__m128i *)blk, plaintext); - ctx->iv = ciphertext; - } -} - -static FUNC_ISA inline void aes_sdctr_ni( - ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn encrypt) -{ - aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph); - - for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; - blk < finish; blk += 16) { - __m128i counter = aes_ni_sdctr_reverse(ctx->iv); - __m128i keystream = encrypt(counter, ctx->keysched_e); - __m128i input = _mm_loadu_si128((const __m128i *)blk); - __m128i output = _mm_xor_si128(input, keystream); - _mm_storeu_si128((__m128i *)blk, output); - ctx->iv = aes_ni_sdctr_increment(ctx->iv); - } -} - -#define NI_ENC_DEC(len) \ - static FUNC_ISA void aes##len##_cbc_hw_encrypt( \ - ssh_cipher *ciph, void *vblk, int blklen) \ - { aes_cbc_ni_encrypt(ciph, vblk, blklen, aes_ni_##len##_e); } \ - static FUNC_ISA void aes##len##_cbc_hw_decrypt( \ - ssh_cipher *ciph, void *vblk, int blklen) \ - { aes_cbc_ni_decrypt(ciph, vblk, blklen, aes_ni_##len##_d); } \ - static FUNC_ISA void aes##len##_sdctr_hw( \ - ssh_cipher *ciph, void *vblk, int blklen) \ - { aes_sdctr_ni(ciph, vblk, blklen, aes_ni_##len##_e); } \ - -NI_ENC_DEC(128) -NI_ENC_DEC(192) -NI_ENC_DEC(256) - -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of AES using Arm NEON. - */ - -#elif HW_AES == HW_AES_NEON - -/* - * Manually set the target architecture, if we decided above that we - * need to. - */ -#ifdef USE_CLANG_ATTR_TARGET_AARCH64 -/* - * A spot of cheating: redefine some ACLE feature macros before - * including arm_neon.h. Otherwise we won't get the AES intrinsics - * defined by that header, because it will be looking at the settings - * for the whole translation unit rather than the ones we're going to - * put on some particular functions using __attribute__((target)). - */ -#define __ARM_NEON 1 -#define __ARM_FEATURE_CRYPTO 1 -#define __ARM_FEATURE_AES 1 -#define FUNC_ISA __attribute__ ((target("neon,crypto"))) -#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */ - -#ifndef FUNC_ISA -#define FUNC_ISA -#endif - -#ifdef USE_ARM64_NEON_H -#include -#else -#include -#endif - -static bool aes_hw_available(void) -{ - /* - * For Arm, we delegate to a per-platform AES detection function, - * because it has to be implemented by asking the operating system - * rather than directly querying the CPU. - * - * That's because Arm systems commonly have multiple cores that - * are not all alike, so any method of querying whether NEON - * crypto instructions work on the _current_ CPU - even one as - * crude as just trying one and catching the SIGILL - wouldn't - * give an answer that you could still rely on the first time the - * OS migrated your process to another CPU. - */ - return platform_aes_hw_available(); -} - -/* - * Core NEON encrypt/decrypt functions, one per length and direction. - */ - -#define NEON_CIPHER(len, repmacro) \ - static FUNC_ISA inline uint8x16_t aes_neon_##len##_e( \ - uint8x16_t v, const uint8x16_t *keysched) \ - { \ - repmacro(v = vaesmcq_u8(vaeseq_u8(v, *keysched++));); \ - v = vaeseq_u8(v, *keysched++); \ - return veorq_u8(v, *keysched); \ - } \ - static FUNC_ISA inline uint8x16_t aes_neon_##len##_d( \ - uint8x16_t v, const uint8x16_t *keysched) \ - { \ - repmacro(v = vaesimcq_u8(vaesdq_u8(v, *keysched++));); \ - v = vaesdq_u8(v, *keysched++); \ - return veorq_u8(v, *keysched); \ - } - -NEON_CIPHER(128, REP9) -NEON_CIPHER(192, REP11) -NEON_CIPHER(256, REP13) - -/* - * The main key expansion. - */ -static FUNC_ISA void aes_neon_key_expand( - const unsigned char *key, size_t key_words, - uint8x16_t *keysched_e, uint8x16_t *keysched_d) -{ - size_t rounds = key_words + 6; - size_t sched_words = (rounds + 1) * 4; - - /* - * Store the key schedule as 32-bit integers during expansion, so - * that it's easy to refer back to individual previous words. We - * collect them into the final uint8x16_t form at the end. - */ - uint32_t sched[MAXROUNDKEYS * 4]; - - unsigned rconpos = 0; - - for (size_t i = 0; i < sched_words; i++) { - if (i < key_words) { - sched[i] = GET_32BIT_LSB_FIRST(key + 4 * i); - } else { - uint32_t temp = sched[i - 1]; - - bool rotate_and_round_constant = (i % key_words == 0); - bool sub = rotate_and_round_constant || - (key_words == 8 && i % 8 == 4); - - if (rotate_and_round_constant) - temp = (temp << 24) | (temp >> 8); - - if (sub) { - uint32x4_t v32 = vdupq_n_u32(temp); - uint8x16_t v8 = vreinterpretq_u8_u32(v32); - v8 = vaeseq_u8(v8, vdupq_n_u8(0)); - v32 = vreinterpretq_u32_u8(v8); - temp = vget_lane_u32(vget_low_u32(v32), 0); - } - - if (rotate_and_round_constant) { - assert(rconpos < lenof(key_setup_round_constants)); - temp ^= key_setup_round_constants[rconpos++]; - } - - sched[i] = sched[i - key_words] ^ temp; - } - } - - /* - * Combine the key schedule words into uint8x16_t vectors and - * store them in the output context. - */ - for (size_t round = 0; round <= rounds; round++) - keysched_e[round] = vreinterpretq_u8_u32(vld1q_u32(sched + 4*round)); - - smemclr(sched, sizeof(sched)); - - /* - * Now prepare the modified keys for the inverse cipher. - */ - for (size_t eround = 0; eround <= rounds; eround++) { - size_t dround = rounds - eround; - uint8x16_t rkey = keysched_e[eround]; - if (eround && dround) /* neither first nor last */ - rkey = vaesimcq_u8(rkey); - keysched_d[dround] = rkey; - } -} - -/* - * Auxiliary routine to reverse the byte order of a vector, so that - * the SDCTR IV can be made big-endian for feeding to the cipher. - * - * In fact we don't need to reverse the vector _all_ the way; we leave - * the two lanes in MSW,LSW order, because that makes no difference to - * the efficiency of the increment. That way we only have to reverse - * bytes within each lane in this function. - */ -static FUNC_ISA inline uint8x16_t aes_neon_sdctr_reverse(uint8x16_t v) -{ - return vrev64q_u8(v); -} - -/* - * Auxiliary routine to increment the 128-bit counter used in SDCTR - * mode. There's no instruction to treat a 128-bit vector as a single - * long integer, so instead we have to increment the bottom half - * unconditionally, and the top half if the bottom half started off as - * all 1s (in which case there was about to be a carry). - */ -static FUNC_ISA inline uint8x16_t aes_neon_sdctr_increment(uint8x16_t in) -{ -#ifdef __aarch64__ - /* There will be a carry if the low 64 bits are all 1s. */ - uint64x1_t all1 = vcreate_u64(0xFFFFFFFFFFFFFFFF); - uint64x1_t carry = vceq_u64(vget_high_u64(vreinterpretq_u64_u8(in)), all1); - - /* Make a word whose bottom half is unconditionally all 1s, and - * the top half is 'carry', i.e. all 0s most of the time but all - * 1s if we need to increment the top half. Then that word is what - * we need to _subtract_ from the input counter. */ - uint64x2_t subtrahend = vcombine_u64(carry, all1); -#else - /* AArch32 doesn't have comparisons that operate on a 64-bit lane, - * so we start by comparing each 32-bit half of the low 64 bits - * _separately_ to all-1s. */ - uint32x2_t all1 = vdup_n_u32(0xFFFFFFFF); - uint32x2_t carry = vceq_u32( - vget_high_u32(vreinterpretq_u32_u8(in)), all1); - - /* Swap the 32-bit words of the compare output, and AND with the - * unswapped version. Now carry is all 1s iff the bottom half of - * the input counter was all 1s, and all 0s otherwise. */ - carry = vand_u32(carry, vrev64_u32(carry)); - - /* Now make the vector to subtract in the same way as above. */ - uint64x2_t subtrahend = vreinterpretq_u64_u32(vcombine_u32(carry, all1)); -#endif - - return vreinterpretq_u8_u64( - vsubq_u64(vreinterpretq_u64_u8(in), subtrahend)); -} - -/* - * The SSH interface and the cipher modes. - */ - -typedef struct aes_neon_context aes_neon_context; -struct aes_neon_context { - uint8x16_t keysched_e[MAXROUNDKEYS], keysched_d[MAXROUNDKEYS], iv; - - ssh_cipher ciph; -}; - -static ssh_cipher *aes_hw_new(const ssh_cipheralg *alg) -{ - if (!aes_hw_available_cached()) - return NULL; - - aes_neon_context *ctx = snew(aes_neon_context); - ctx->ciph.vt = alg; - return &ctx->ciph; -} - -static void aes_hw_free(ssh_cipher *ciph) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - smemclr(ctx, sizeof(*ctx)); - sfree(ctx); -} - -static void aes_hw_setkey(ssh_cipher *ciph, const void *vkey) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - const unsigned char *key = (const unsigned char *)vkey; - - aes_neon_key_expand(key, ctx->ciph.vt->real_keybits / 32, - ctx->keysched_e, ctx->keysched_d); -} - -static FUNC_ISA void aes_hw_setiv_cbc(ssh_cipher *ciph, const void *iv) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - ctx->iv = vld1q_u8(iv); -} - -static FUNC_ISA void aes_hw_setiv_sdctr(ssh_cipher *ciph, const void *iv) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - uint8x16_t counter = vld1q_u8(iv); - ctx->iv = aes_neon_sdctr_reverse(counter); -} - -typedef uint8x16_t (*aes_neon_fn)(uint8x16_t v, const uint8x16_t *keysched); - -static FUNC_ISA inline void aes_cbc_neon_encrypt( - ssh_cipher *ciph, void *vblk, int blklen, aes_neon_fn encrypt) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - - for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; - blk < finish; blk += 16) { - uint8x16_t plaintext = vld1q_u8(blk); - uint8x16_t cipher_input = veorq_u8(plaintext, ctx->iv); - uint8x16_t ciphertext = encrypt(cipher_input, ctx->keysched_e); - vst1q_u8(blk, ciphertext); - ctx->iv = ciphertext; - } -} - -static FUNC_ISA inline void aes_cbc_neon_decrypt( - ssh_cipher *ciph, void *vblk, int blklen, aes_neon_fn decrypt) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - - for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; - blk < finish; blk += 16) { - uint8x16_t ciphertext = vld1q_u8(blk); - uint8x16_t decrypted = decrypt(ciphertext, ctx->keysched_d); - uint8x16_t plaintext = veorq_u8(decrypted, ctx->iv); - vst1q_u8(blk, plaintext); - ctx->iv = ciphertext; - } -} - -static FUNC_ISA inline void aes_sdctr_neon( - ssh_cipher *ciph, void *vblk, int blklen, aes_neon_fn encrypt) -{ - aes_neon_context *ctx = container_of(ciph, aes_neon_context, ciph); - - for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen; - blk < finish; blk += 16) { - uint8x16_t counter = aes_neon_sdctr_reverse(ctx->iv); - uint8x16_t keystream = encrypt(counter, ctx->keysched_e); - uint8x16_t input = vld1q_u8(blk); - uint8x16_t output = veorq_u8(input, keystream); - vst1q_u8(blk, output); - ctx->iv = aes_neon_sdctr_increment(ctx->iv); - } -} - -#define NEON_ENC_DEC(len) \ - static FUNC_ISA void aes##len##_cbc_hw_encrypt( \ - ssh_cipher *ciph, void *vblk, int blklen) \ - { aes_cbc_neon_encrypt(ciph, vblk, blklen, aes_neon_##len##_e); } \ - static FUNC_ISA void aes##len##_cbc_hw_decrypt( \ - ssh_cipher *ciph, void *vblk, int blklen) \ - { aes_cbc_neon_decrypt(ciph, vblk, blklen, aes_neon_##len##_d); } \ - static FUNC_ISA void aes##len##_sdctr_hw( \ - ssh_cipher *ciph, void *vblk, int blklen) \ - { aes_sdctr_neon(ciph, vblk, blklen, aes_neon_##len##_e); } \ - -NEON_ENC_DEC(128) -NEON_ENC_DEC(192) -NEON_ENC_DEC(256) - -/* ---------------------------------------------------------------------- - * Stub functions if we have no hardware-accelerated AES. In this - * case, aes_hw_new returns NULL (though it should also never be - * selected by aes_select, so the only thing that should even be - * _able_ to call it is testcrypt). As a result, the remaining vtable - * functions should never be called at all. - */ - -#elif HW_AES == HW_AES_NONE - -bool aes_hw_available(void) -{ - return false; -} - -static ssh_cipher *aes_hw_new(const ssh_cipheralg *alg) -{ - return NULL; -} - -#define STUB_BODY { unreachable("Should never be called"); } - -static void aes_hw_free(ssh_cipher *ciph) STUB_BODY -static void aes_hw_setkey(ssh_cipher *ciph, const void *key) STUB_BODY -static void aes_hw_setiv_cbc(ssh_cipher *ciph, const void *iv) STUB_BODY -static void aes_hw_setiv_sdctr(ssh_cipher *ciph, const void *iv) STUB_BODY -#define STUB_ENC_DEC(len) \ - static void aes##len##_cbc_hw_encrypt( \ - ssh_cipher *ciph, void *vblk, int blklen) STUB_BODY \ - static void aes##len##_cbc_hw_decrypt( \ - ssh_cipher *ciph, void *vblk, int blklen) STUB_BODY \ - static void aes##len##_sdctr_hw( \ - ssh_cipher *ciph, void *vblk, int blklen) STUB_BODY - -STUB_ENC_DEC(128) -STUB_ENC_DEC(192) -STUB_ENC_DEC(256) - -#endif /* HW_AES */ +AES_EXTRA(_sw); +AES_ALL_VTABLES(_sw, "unaccelerated"); diff --git a/code/crypto/aes.h b/code/crypto/aes.h new file mode 100644 index 0000000..1960713 --- /dev/null +++ b/code/crypto/aes.h @@ -0,0 +1,109 @@ +/* + * Definitions likely to be helpful to multiple AES implementations. + */ + +/* + * The 'extra' structure used by AES implementations is used to + * include information about how to check if a given implementation is + * available at run time, and whether we've already checked. + */ +struct aes_extra_mutable; +struct aes_extra { + /* Function to check availability. Might be expensive, so we don't + * want to call it more than once. */ + bool (*check_available)(void); + + /* Point to a writable substructure. */ + struct aes_extra_mutable *mut; +}; +struct aes_extra_mutable { + bool checked_availability; + bool is_available; +}; +static inline bool check_availability(const struct aes_extra *extra) +{ + if (!extra->mut->checked_availability) { + extra->mut->is_available = extra->check_available(); + extra->mut->checked_availability = true; + } + + return extra->mut->is_available; +} + +/* + * Macros to define vtables for AES variants. There are a lot of + * these, because of the cross product between cipher modes, key + * sizes, and assorted HW/SW implementations, so it's worth spending + * some effort here to reduce the boilerplate in the sub-files. + */ + +#define AES_EXTRA(impl_c) \ + static struct aes_extra_mutable aes ## impl_c ## _extra_mut; \ + static const struct aes_extra aes ## impl_c ## _extra = { \ + .check_available = aes ## impl_c ## _available, \ + .mut = &aes ## impl_c ## _extra_mut, \ + } + +#define AES_CBC_VTABLE(impl_c, impl_display, bits) \ + const ssh_cipheralg ssh_aes ## bits ## _cbc ## impl_c = { \ + .new = aes ## impl_c ## _new, \ + .free = aes ## impl_c ## _free, \ + .setiv = aes ## impl_c ## _setiv_cbc, \ + .setkey = aes ## impl_c ## _setkey, \ + .encrypt = aes ## bits ## impl_c ## _cbc_encrypt, \ + .decrypt = aes ## bits ## impl_c ## _cbc_decrypt, \ + .ssh2_id = "aes" #bits "-cbc", \ + .blksize = 16, \ + .real_keybits = bits, \ + .padded_keybytes = bits/8, \ + .flags = SSH_CIPHER_IS_CBC, \ + .text_name = "AES-" #bits " CBC (" impl_display ")", \ + .extra = &aes ## impl_c ## _extra, \ + } + +#define AES_SDCTR_VTABLE(impl_c, impl_display, bits) \ + const ssh_cipheralg ssh_aes ## bits ## _sdctr ## impl_c = { \ + .new = aes ## impl_c ## _new, \ + .free = aes ## impl_c ## _free, \ + .setiv = aes ## impl_c ## _setiv_sdctr, \ + .setkey = aes ## impl_c ## _setkey, \ + .encrypt = aes ## bits ## impl_c ## _sdctr, \ + .decrypt = aes ## bits ## impl_c ## _sdctr, \ + .ssh2_id = "aes" #bits "-ctr", \ + .blksize = 16, \ + .real_keybits = bits, \ + .padded_keybytes = bits/8, \ + .flags = 0, \ + .text_name = "AES-" #bits " SDCTR (" impl_display ")", \ + .extra = &aes ## impl_c ## _extra, \ + } + +#define AES_ALL_VTABLES(impl_c, impl_display) \ + AES_CBC_VTABLE(impl_c, impl_display, 128); \ + AES_CBC_VTABLE(impl_c, impl_display, 192); \ + AES_CBC_VTABLE(impl_c, impl_display, 256); \ + AES_SDCTR_VTABLE(impl_c, impl_display, 128); \ + AES_SDCTR_VTABLE(impl_c, impl_display, 192); \ + AES_SDCTR_VTABLE(impl_c, impl_display, 256) + +/* + * Macros to repeat a piece of code particular numbers of times that + * correspond to 1 fewer than the number of AES rounds. (Because the + * last round is different.) + */ +#define REP2(x) x x +#define REP4(x) REP2(REP2(x)) +#define REP8(x) REP2(REP4(x)) +#define REP9(x) REP8(x) x +#define REP11(x) REP8(x) REP2(x) x +#define REP13(x) REP8(x) REP4(x) x + +/* + * The round constants used in key schedule expansion. + */ +extern const uint8_t aes_key_setup_round_constants[10]; + +/* + * The largest number of round keys ever needed. + */ +#define MAXROUNDKEYS 15 diff --git a/code/ssharcf.c b/code/crypto/arcfour.c similarity index 100% rename from code/ssharcf.c rename to code/crypto/arcfour.c diff --git a/code/sshargon2.c b/code/crypto/argon2.c similarity index 99% rename from code/sshargon2.c rename to code/crypto/argon2.c index 25385d7..99bcfa1 100644 --- a/code/sshargon2.c +++ b/code/crypto/argon2.c @@ -266,7 +266,7 @@ static void argon2_internal(uint32_t p, uint32_t T, uint32_t m, uint32_t t, * that in the initial slice on the first pass, we've already written * values into the first two columns during the initial setup above. So * 'jstart' indicates the starting index in each segment we process; it - * starts off as 2 so that we don't overwrite the inital setup, and then + * starts off as 2 so that we don't overwrite the initial setup, and then * after the first slice is done, we set it to 0, and it stays there. * * d_mode indicates whether we're being data-dependent (true) or diff --git a/code/sshbcrypt.c b/code/crypto/bcrypt.c similarity index 93% rename from code/sshbcrypt.c rename to code/crypto/bcrypt.c index 7cdd44e..a4eb384 100644 --- a/code/sshbcrypt.c +++ b/code/crypto/bcrypt.c @@ -9,7 +9,7 @@ #include #include #include "ssh.h" -#include "sshblowf.h" +#include "blowfish.h" BlowfishContext *bcrypt_setup(const unsigned char *key, int keybytes, const unsigned char *salt, int saltbytes) @@ -69,8 +69,7 @@ void bcrypt_genblock(int counter, smemclr(&hashed_salt, sizeof(hashed_salt)); } -void openssh_bcrypt(const char *passphrase, - const unsigned char *salt, int saltbytes, +void openssh_bcrypt(ptrlen passphrase, ptrlen salt, int rounds, unsigned char *out, int outbytes) { unsigned char hashed_passphrase[64]; @@ -80,7 +79,7 @@ void openssh_bcrypt(const char *passphrase, int modulus, residue, i, j, round; /* Hash the passphrase to get the bcrypt key material */ - hash_simple(&ssh_sha512, ptrlen_from_asciz(passphrase), hashed_passphrase); + hash_simple(&ssh_sha512, passphrase, hashed_passphrase); /* We output key bytes in a scattered fashion to meld all output * key blocks into all parts of the output. To do this, we pick a @@ -97,8 +96,8 @@ void openssh_bcrypt(const char *passphrase, * by bcrypt in the following loop */ memset(outblock, 0, sizeof(outblock)); - thissalt = salt; - thissaltbytes = saltbytes; + thissalt = salt.ptr; + thissaltbytes = salt.len; for (round = 0; round < rounds; round++) { bcrypt_genblock(round == 0 ? residue+1 : 0, hashed_passphrase, diff --git a/code/sshblake2.c b/code/crypto/blake2.c similarity index 100% rename from code/sshblake2.c rename to code/crypto/blake2.c diff --git a/code/sshblowf.c b/code/crypto/blowfish.c similarity index 99% rename from code/sshblowf.c rename to code/crypto/blowfish.c index c74f06c..e888689 100644 --- a/code/sshblowf.c +++ b/code/crypto/blowfish.c @@ -7,7 +7,7 @@ #include #include #include "ssh.h" -#include "sshblowf.h" +#include "blowfish.h" struct BlowfishContext { uint32_t S0[256], S1[256], S2[256], S3[256], P[18]; diff --git a/code/sshblowf.h b/code/crypto/blowfish.h similarity index 87% rename from code/sshblowf.h rename to code/crypto/blowfish.h index a9efe3d..5415892 100644 --- a/code/sshblowf.h +++ b/code/crypto/blowfish.h @@ -1,5 +1,5 @@ /* - * Header file shared between sshblowf.c and sshbcrypt.c. Exposes the + * Header file shared between blowfish.c and bcrypt.c. Exposes the * internal Blowfish routines needed by bcrypt. */ diff --git a/code/sshccp.c b/code/crypto/chacha20-poly1305.c similarity index 100% rename from code/sshccp.c rename to code/crypto/chacha20-poly1305.c diff --git a/code/sshcrc.c b/code/crypto/crc32.c similarity index 94% rename from code/sshcrc.c rename to code/crypto/crc32.c index b1dc833..bd87443 100644 --- a/code/sshcrc.c +++ b/code/crypto/crc32.c @@ -1,6 +1,11 @@ /* * CRC32 implementation, as used in SSH-1. * + * (This is not, of course, a cryptographic function! It lives in the + * 'crypto' directory because SSH-1 uses it _as if_ it was crypto: it + * handles sensitive data, and we implement it with care for side + * channels.) + * * This particular form of the CRC uses the polynomial * P(x) = x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+1 * and represents polynomials in bit-reversed form, so that the x^0 diff --git a/code/sshdes.c b/code/crypto/des.c similarity index 99% rename from code/sshdes.c rename to code/crypto/des.c index d2ba982..e8a26f0 100644 --- a/code/sshdes.c +++ b/code/crypto/des.c @@ -1,5 +1,5 @@ /* - * sshdes.c: implementation of DES. + * Implementation of DES. */ /* diff --git a/code/sshdh.c b/code/crypto/diffie-hellman.c similarity index 87% rename from code/sshdh.c rename to code/crypto/diffie-hellman.c index b375612..914167b 100644 --- a/code/sshdh.c +++ b/code/crypto/diffie-hellman.c @@ -19,12 +19,18 @@ struct dh_extra { static void dh_group1_construct(dh_ctx *ctx) { + /* Command to recompute, from the expression in RFC 2412 section E.2: +spigot -B16 '2^1024 - 2^960 - 1 + 2^64 * ( floor(2^894 pi) + 129093 )' + */ ctx->p = MP_LITERAL(0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF); ctx->g = mp_from_integer(2); } static void dh_group14_construct(dh_ctx *ctx) { + /* Command to recompute, from the expression in RFC 3526 section 3: +spigot -B16 '2^2048 - 2^1984 - 1 + 2^64 * ( floor(2^1918 pi) + 124476 )' + */ ctx->p = MP_LITERAL(0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF); ctx->g = mp_from_integer(2); } @@ -33,7 +39,7 @@ static const struct dh_extra extra_group1 = { false, dh_group1_construct, }; -static const ssh_kex ssh_diffiehellman_group1_sha1 = { +const ssh_kex ssh_diffiehellman_group1_sha1 = { "diffie-hellman-group1-sha1", "group1", KEXTYPE_DH, &ssh_sha1, &extra_group1, }; @@ -48,12 +54,12 @@ static const struct dh_extra extra_group14 = { false, dh_group14_construct, }; -static const ssh_kex ssh_diffiehellman_group14_sha256 = { +const ssh_kex ssh_diffiehellman_group14_sha256 = { "diffie-hellman-group14-sha256", "group14", KEXTYPE_DH, &ssh_sha256, &extra_group14, }; -static const ssh_kex ssh_diffiehellman_group14_sha1 = { +const ssh_kex ssh_diffiehellman_group14_sha1 = { "diffie-hellman-group14-sha1", "group14", KEXTYPE_DH, &ssh_sha1, &extra_group14, }; @@ -96,7 +102,7 @@ const ssh_kexes ssh_diffiehellman_gex = { lenof(gex_list), gex_list }; * Kerberos v5. * * (The same encoded OID, minus the two-byte DER header, is defined in - * pgssapi.c as GSS_MECH_KRB5.) + * ssh/pgssapi.c as GSS_MECH_KRB5.) */ #define GSS_KRB5_OID_HASH "toWM5Slw5Ew8Mqkay+al2g==" @@ -194,19 +200,8 @@ void dh_cleanup(dh_ctx *ctx) /* * DH stage 1: invent a number x between 1 and q, and compute e = * g^x mod p. Return e. - * - * If `nbits' is greater than zero, it is used as an upper limit - * for the number of bits in x. This is safe provided that (a) you - * use twice as many bits in x as the number of bits you expect to - * use in your session key, and (b) the DH group is a safe prime - * (which SSH demands that it must be). - * - * P. C. van Oorschot, M. J. Wiener - * "On Diffie-Hellman Key Agreement with Short Exponents". - * Advances in Cryptology: Proceedings of Eurocrypt '96 - * Springer-Verlag, May 1996. */ -mp_int *dh_create_e(dh_ctx *ctx, int nbits) +mp_int *dh_create_e(dh_ctx *ctx) { /* * Lower limit is just 2. @@ -218,12 +213,6 @@ mp_int *dh_create_e(dh_ctx *ctx, int nbits) */ mp_int *hi = mp_copy(ctx->q); mp_sub_integer_into(hi, hi, 1); - if (nbits) { - mp_int *pow2 = mp_power_2(nbits+1); - mp_min_into(pow2, pow2, hi); - mp_free(hi); - hi = pow2; - } /* * Make a random number in that range. diff --git a/code/sshdss.c b/code/crypto/dsa.c similarity index 64% rename from code/sshdss.c rename to code/crypto/dsa.c index 3e0c761..43b51c8 100644 --- a/code/sshdss.c +++ b/code/crypto/dsa.c @@ -1,5 +1,5 @@ /* - * Digital Signature Standard implementation for PuTTY. + * Digital Signature Algorithm implementation for PuTTY. */ #include @@ -10,49 +10,49 @@ #include "mpint.h" #include "misc.h" -static void dss_freekey(ssh_key *key); /* forward reference */ +static void dsa_freekey(ssh_key *key); /* forward reference */ -static ssh_key *dss_new_pub(const ssh_keyalg *self, ptrlen data) +static ssh_key *dsa_new_pub(const ssh_keyalg *self, ptrlen data) { BinarySource src[1]; - struct dss_key *dss; + struct dsa_key *dsa; BinarySource_BARE_INIT_PL(src, data); if (!ptrlen_eq_string(get_string(src), "ssh-dss")) return NULL; - dss = snew(struct dss_key); - dss->sshk.vt = &ssh_dss; - dss->p = get_mp_ssh2(src); - dss->q = get_mp_ssh2(src); - dss->g = get_mp_ssh2(src); - dss->y = get_mp_ssh2(src); - dss->x = NULL; + dsa = snew(struct dsa_key); + dsa->sshk.vt = &ssh_dsa; + dsa->p = get_mp_ssh2(src); + dsa->q = get_mp_ssh2(src); + dsa->g = get_mp_ssh2(src); + dsa->y = get_mp_ssh2(src); + dsa->x = NULL; if (get_err(src) || - mp_eq_integer(dss->p, 0) || mp_eq_integer(dss->q, 0)) { + mp_eq_integer(dsa->p, 0) || mp_eq_integer(dsa->q, 0)) { /* Invalid key. */ - dss_freekey(&dss->sshk); + dsa_freekey(&dsa->sshk); return NULL; } - return &dss->sshk; + return &dsa->sshk; } -static void dss_freekey(ssh_key *key) +static void dsa_freekey(ssh_key *key) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); - if (dss->p) - mp_free(dss->p); - if (dss->q) - mp_free(dss->q); - if (dss->g) - mp_free(dss->g); - if (dss->y) - mp_free(dss->y); - if (dss->x) - mp_free(dss->x); - sfree(dss); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); + if (dsa->p) + mp_free(dsa->p); + if (dsa->q) + mp_free(dsa->q); + if (dsa->g) + mp_free(dsa->g); + if (dsa->y) + mp_free(dsa->y); + if (dsa->x) + mp_free(dsa->x); + sfree(dsa); } static void append_hex_to_strbuf(strbuf *sb, mp_int *x) @@ -67,55 +67,55 @@ static void append_hex_to_strbuf(strbuf *sb, mp_int *x) sfree(hex); } -static char *dss_cache_str(ssh_key *key) +static char *dsa_cache_str(ssh_key *key) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); strbuf *sb = strbuf_new(); - if (!dss->p) { + if (!dsa->p) { strbuf_free(sb); return NULL; } - append_hex_to_strbuf(sb, dss->p); - append_hex_to_strbuf(sb, dss->q); - append_hex_to_strbuf(sb, dss->g); - append_hex_to_strbuf(sb, dss->y); + append_hex_to_strbuf(sb, dsa->p); + append_hex_to_strbuf(sb, dsa->q); + append_hex_to_strbuf(sb, dsa->g); + append_hex_to_strbuf(sb, dsa->y); return strbuf_to_str(sb); } -static key_components *dss_components(ssh_key *key) +static key_components *dsa_components(ssh_key *key) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); key_components *kc = key_components_new(); key_components_add_text(kc, "key_type", "DSA"); - assert(dss->p); - key_components_add_mp(kc, "p", dss->p); - key_components_add_mp(kc, "q", dss->q); - key_components_add_mp(kc, "g", dss->g); - key_components_add_mp(kc, "public_y", dss->y); - if (dss->x) - key_components_add_mp(kc, "private_x", dss->x); + assert(dsa->p); + key_components_add_mp(kc, "p", dsa->p); + key_components_add_mp(kc, "q", dsa->q); + key_components_add_mp(kc, "g", dsa->g); + key_components_add_mp(kc, "public_y", dsa->y); + if (dsa->x) + key_components_add_mp(kc, "private_x", dsa->x); return kc; } -static char *dss_invalid(ssh_key *key, unsigned flags) +static char *dsa_invalid(ssh_key *key, unsigned flags) { /* No validity criterion will stop us from using a DSA key at all */ return NULL; } -static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data) +static bool dsa_verify(ssh_key *key, ptrlen sig, ptrlen data) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); BinarySource src[1]; unsigned char hash[20]; bool toret; - if (!dss->p) + if (!dsa->p) return false; BinarySource_BARE_INIT_PL(src, sig); @@ -155,8 +155,8 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data) unsigned invalid = 0; invalid |= mp_eq_integer(r, 0); invalid |= mp_eq_integer(s, 0); - invalid |= mp_cmp_hs(r, dss->q); - invalid |= mp_cmp_hs(s, dss->q); + invalid |= mp_cmp_hs(r, dsa->q); + invalid |= mp_cmp_hs(s, dsa->q); if (invalid) { mp_free(r); mp_free(s); @@ -166,7 +166,7 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data) /* * Step 1. w <- s^-1 mod q. */ - mp_int *w = mp_invert(s, dss->q); + mp_int *w = mp_invert(s, dsa->q); if (!w) { mp_free(r); mp_free(s); @@ -178,20 +178,20 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data) */ hash_simple(&ssh_sha1, data, hash); mp_int *sha = mp_from_bytes_be(make_ptrlen(hash, 20)); - mp_int *u1 = mp_modmul(sha, w, dss->q); + mp_int *u1 = mp_modmul(sha, w, dsa->q); /* * Step 3. u2 <- r * w mod q. */ - mp_int *u2 = mp_modmul(r, w, dss->q); + mp_int *u2 = mp_modmul(r, w, dsa->q); /* * Step 4. v <- (g^u1 * y^u2 mod p) mod q. */ - mp_int *gu1p = mp_modpow(dss->g, u1, dss->p); - mp_int *yu2p = mp_modpow(dss->y, u2, dss->p); - mp_int *gu1yu2p = mp_modmul(gu1p, yu2p, dss->p); - mp_int *v = mp_mod(gu1yu2p, dss->q); + mp_int *gu1p = mp_modpow(dsa->g, u1, dsa->p); + mp_int *yu2p = mp_modpow(dsa->y, u2, dsa->p); + mp_int *gu1yu2p = mp_modmul(gu1p, yu2p, dsa->p); + mp_int *v = mp_mod(gu1yu2p, dsa->q); /* * Step 5. v should now be equal to r. @@ -213,57 +213,57 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data) return toret; } -static void dss_public_blob(ssh_key *key, BinarySink *bs) +static void dsa_public_blob(ssh_key *key, BinarySink *bs) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); put_stringz(bs, "ssh-dss"); - put_mp_ssh2(bs, dss->p); - put_mp_ssh2(bs, dss->q); - put_mp_ssh2(bs, dss->g); - put_mp_ssh2(bs, dss->y); + put_mp_ssh2(bs, dsa->p); + put_mp_ssh2(bs, dsa->q); + put_mp_ssh2(bs, dsa->g); + put_mp_ssh2(bs, dsa->y); } -static void dss_private_blob(ssh_key *key, BinarySink *bs) +static void dsa_private_blob(ssh_key *key, BinarySink *bs) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); - put_mp_ssh2(bs, dss->x); + put_mp_ssh2(bs, dsa->x); } -static ssh_key *dss_new_priv(const ssh_keyalg *self, ptrlen pub, ptrlen priv) +static ssh_key *dsa_new_priv(const ssh_keyalg *self, ptrlen pub, ptrlen priv) { BinarySource src[1]; ssh_key *sshk; - struct dss_key *dss; + struct dsa_key *dsa; ptrlen hash; unsigned char digest[20]; mp_int *ytest; - sshk = dss_new_pub(self, pub); + sshk = dsa_new_pub(self, pub); if (!sshk) return NULL; - dss = container_of(sshk, struct dss_key, sshk); + dsa = container_of(sshk, struct dsa_key, sshk); BinarySource_BARE_INIT_PL(src, priv); - dss->x = get_mp_ssh2(src); + dsa->x = get_mp_ssh2(src); if (get_err(src)) { - dss_freekey(&dss->sshk); + dsa_freekey(&dsa->sshk); return NULL; } /* - * Check the obsolete hash in the old DSS key format. + * Check the obsolete hash in the old DSA key format. */ hash = get_string(src); if (hash.len == 20) { ssh_hash *h = ssh_hash_new(&ssh_sha1); - put_mp_ssh2(h, dss->p); - put_mp_ssh2(h, dss->q); - put_mp_ssh2(h, dss->g); + put_mp_ssh2(h, dsa->p); + put_mp_ssh2(h, dsa->q); + put_mp_ssh2(h, dsa->g); ssh_hash_final(h, digest); if (!smemeq(hash.ptr, digest, 20)) { - dss_freekey(&dss->sshk); + dsa_freekey(&dsa->sshk); return NULL; } } @@ -271,75 +271,75 @@ static ssh_key *dss_new_priv(const ssh_keyalg *self, ptrlen pub, ptrlen priv) /* * Now ensure g^x mod p really is y. */ - ytest = mp_modpow(dss->g, dss->x, dss->p); - if (!mp_cmp_eq(ytest, dss->y)) { + ytest = mp_modpow(dsa->g, dsa->x, dsa->p); + if (!mp_cmp_eq(ytest, dsa->y)) { mp_free(ytest); - dss_freekey(&dss->sshk); + dsa_freekey(&dsa->sshk); return NULL; } mp_free(ytest); - return &dss->sshk; + return &dsa->sshk; } -static ssh_key *dss_new_priv_openssh(const ssh_keyalg *self, +static ssh_key *dsa_new_priv_openssh(const ssh_keyalg *self, BinarySource *src) { - struct dss_key *dss; + struct dsa_key *dsa; - dss = snew(struct dss_key); - dss->sshk.vt = &ssh_dss; + dsa = snew(struct dsa_key); + dsa->sshk.vt = &ssh_dsa; - dss->p = get_mp_ssh2(src); - dss->q = get_mp_ssh2(src); - dss->g = get_mp_ssh2(src); - dss->y = get_mp_ssh2(src); - dss->x = get_mp_ssh2(src); + dsa->p = get_mp_ssh2(src); + dsa->q = get_mp_ssh2(src); + dsa->g = get_mp_ssh2(src); + dsa->y = get_mp_ssh2(src); + dsa->x = get_mp_ssh2(src); if (get_err(src) || - mp_eq_integer(dss->q, 0) || mp_eq_integer(dss->p, 0)) { + mp_eq_integer(dsa->q, 0) || mp_eq_integer(dsa->p, 0)) { /* Invalid key. */ - dss_freekey(&dss->sshk); + dsa_freekey(&dsa->sshk); return NULL; } - return &dss->sshk; + return &dsa->sshk; } -static void dss_openssh_blob(ssh_key *key, BinarySink *bs) +static void dsa_openssh_blob(ssh_key *key, BinarySink *bs) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); - put_mp_ssh2(bs, dss->p); - put_mp_ssh2(bs, dss->q); - put_mp_ssh2(bs, dss->g); - put_mp_ssh2(bs, dss->y); - put_mp_ssh2(bs, dss->x); + put_mp_ssh2(bs, dsa->p); + put_mp_ssh2(bs, dsa->q); + put_mp_ssh2(bs, dsa->g); + put_mp_ssh2(bs, dsa->y); + put_mp_ssh2(bs, dsa->x); } -static int dss_pubkey_bits(const ssh_keyalg *self, ptrlen pub) +static int dsa_pubkey_bits(const ssh_keyalg *self, ptrlen pub) { ssh_key *sshk; - struct dss_key *dss; + struct dsa_key *dsa; int ret; - sshk = dss_new_pub(self, pub); + sshk = dsa_new_pub(self, pub); if (!sshk) return -1; - dss = container_of(sshk, struct dss_key, sshk); - ret = mp_get_nbits(dss->p); - dss_freekey(&dss->sshk); + dsa = container_of(sshk, struct dsa_key, sshk); + ret = mp_get_nbits(dsa->p); + dsa_freekey(&dsa->sshk); return ret; } -mp_int *dss_gen_k(const char *id_string, mp_int *modulus, +mp_int *dsa_gen_k(const char *id_string, mp_int *modulus, mp_int *private_key, unsigned char *digest, int digest_len) { /* - * The basic DSS signing algorithm is: + * The basic DSA signing algorithm is: * * - invent a random k between 1 and q-1 (exclusive). * - Compute r = (g^k mod p) mod q. @@ -445,29 +445,29 @@ mp_int *dss_gen_k(const char *id_string, mp_int *modulus, return k; } -static void dss_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs) +static void dsa_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs) { - struct dss_key *dss = container_of(key, struct dss_key, sshk); + struct dsa_key *dsa = container_of(key, struct dsa_key, sshk); unsigned char digest[20]; int i; hash_simple(&ssh_sha1, data, digest); - mp_int *k = dss_gen_k("DSA deterministic k generator", dss->q, dss->x, + mp_int *k = dsa_gen_k("DSA deterministic k generator", dsa->q, dsa->x, digest, sizeof(digest)); - mp_int *kinv = mp_invert(k, dss->q); /* k^-1 mod q */ + mp_int *kinv = mp_invert(k, dsa->q); /* k^-1 mod q */ /* * Now we have k, so just go ahead and compute the signature. */ - mp_int *gkp = mp_modpow(dss->g, k, dss->p); /* g^k mod p */ - mp_int *r = mp_mod(gkp, dss->q); /* r = (g^k mod p) mod q */ + mp_int *gkp = mp_modpow(dsa->g, k, dsa->p); /* g^k mod p */ + mp_int *r = mp_mod(gkp, dsa->q); /* r = (g^k mod p) mod q */ mp_free(gkp); mp_int *hash = mp_from_bytes_be(make_ptrlen(digest, 20)); - mp_int *xr = mp_mul(dss->x, r); + mp_int *xr = mp_mul(dsa->x, r); mp_int *hxr = mp_add(xr, hash); /* hash + x*r */ - mp_int *s = mp_modmul(kinv, hxr, dss->q); /* s = k^-1 * (hash+x*r) mod q */ + mp_int *s = mp_modmul(kinv, hxr, dsa->q); /* s = k^-1 * (hash+x*r) mod q */ mp_free(hxr); mp_free(xr); mp_free(kinv); @@ -484,20 +484,20 @@ static void dss_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs) mp_free(s); } -const ssh_keyalg ssh_dss = { - .new_pub = dss_new_pub, - .new_priv = dss_new_priv, - .new_priv_openssh = dss_new_priv_openssh, - .freekey = dss_freekey, - .invalid = dss_invalid, - .sign = dss_sign, - .verify = dss_verify, - .public_blob = dss_public_blob, - .private_blob = dss_private_blob, - .openssh_blob = dss_openssh_blob, - .cache_str = dss_cache_str, - .components = dss_components, - .pubkey_bits = dss_pubkey_bits, +const ssh_keyalg ssh_dsa = { + .new_pub = dsa_new_pub, + .new_priv = dsa_new_priv, + .new_priv_openssh = dsa_new_priv_openssh, + .freekey = dsa_freekey, + .invalid = dsa_invalid, + .sign = dsa_sign, + .verify = dsa_verify, + .public_blob = dsa_public_blob, + .private_blob = dsa_private_blob, + .openssh_blob = dsa_openssh_blob, + .cache_str = dsa_cache_str, + .components = dsa_components, + .pubkey_bits = dsa_pubkey_bits, .ssh_id = "ssh-dss", .cache_id = "dss", }; diff --git a/code/ecc.c b/code/crypto/ecc-arithmetic.c similarity index 99% rename from code/ecc.c rename to code/crypto/ecc-arithmetic.c index 72f9bfe..6a896f9 100644 --- a/code/ecc.c +++ b/code/crypto/ecc-arithmetic.c @@ -1,3 +1,7 @@ +/* + * Basic arithmetic for elliptic curves, implementing ecc.h. + */ + #include #include "ssh.h" diff --git a/code/sshecc.c b/code/crypto/ecc-ssh.c similarity index 93% rename from code/sshecc.c rename to code/crypto/ecc-ssh.c index ba580db..4029d3d 100644 --- a/code/sshecc.c +++ b/code/crypto/ecc-ssh.c @@ -1,13 +1,5 @@ /* - * Elliptic-curve crypto module for PuTTY - * Implements the three required curves, no optional curves - * - * NOTE: Only curves on prime field are handled by the maths functions - * in Weierstrass form using Jacobian co-ordinates. - * - * Montgomery form curves are supported for DH. (Curve25519) - * - * Edwards form curves are supported for DSA. (Ed25519, Ed448) + * Elliptic-curve signing and key exchange for PuTTY's SSH layer. */ /* @@ -556,8 +548,8 @@ static EdwardsPoint *eddsa_decode(ptrlen encoded, const struct ec_curve *curve) mp_free(y); /* A point constructed in this way will always satisfy the curve - * equation, unless ecc.c wasn't able to construct one at all, in - * which case P is now NULL. Either way, return it. */ + * equation, unless ecc-arithmetic.c wasn't able to construct one + * at all, in which case P is now NULL. Either way, return it. */ return P; } @@ -692,11 +684,11 @@ static char *ecc_cache_str_shared( strbuf *sb = strbuf_new(); if (curve_name) - strbuf_catf(sb, "%s,", curve_name); + put_fmt(sb, "%s,", curve_name); char *hx = mp_get_hex(x); char *hy = mp_get_hex(y); - strbuf_catf(sb, "0x%s,0x%s", hx, hy); + put_fmt(sb, "0x%s,0x%s", hx, hy); sfree(hx); sfree(hy); @@ -1125,7 +1117,7 @@ static void ecdsa_sign(ssh_key *key, ptrlen data, { unsigned char digest[20]; hash_simple(&ssh_sha1, data, digest); - k = dss_gen_k( + k = dsa_gen_k( "ECDSA deterministic k generator", ek->curve->w.G_order, ek->privateKey, digest, sizeof(digest)); } @@ -1374,6 +1366,120 @@ const ssh_keyalg ssh_ecdsa_nistp521 = { .extra = &sign_extra_nistp521, }; +#ifdef PUTTY_CAC +static void ecdsa_freekey_sk(ssh_key* key) +{ + struct ecdsa_key* ek = container_of(key, struct ecdsa_key, sshk); + + // free app id and then call standard function to free rest + if (ek->appid) sfree(ek->appid); + ecdsa_freekey(key); +} + +static void ecdsa_public_blob_sk(ssh_key* key, BinarySink* bs) +{ + struct ecdsa_key* ek = container_of(key, struct ecdsa_key, sshk); + + // call standard function but add on appid + ecdsa_public_blob(key, bs); + put_stringz(bs, ek->appid); +} + +const ssh_keyalg ssh_ecdsa_nistp256_sk = { + .new_pub = ecdsa_new_pub, + .new_priv = ecdsa_new_priv, + .new_priv_openssh = ecdsa_new_priv_openssh, + .freekey = ecdsa_freekey_sk, + .invalid = ec_signkey_invalid, + .sign = ecdsa_sign, + .verify = ecdsa_verify, + .public_blob = ecdsa_public_blob_sk, + .private_blob = ecdsa_private_blob, + .openssh_blob = ecdsa_openssh_blob, + .cache_str = ecdsa_cache_str, + .components = ecdsa_components, + .pubkey_bits = ec_shared_pubkey_bits, + .ssh_id = "sk-ecdsa-sha2-nistp256@openssh.com", + .cache_id = "sk-ecdsa-sha2-nistp256@openssh.com", + .extra = &sign_extra_nistp256, +}; + +const ssh_keyalg ssh_ecdsa_nistp384_sk = { + .new_pub = ecdsa_new_pub, + .new_priv = ecdsa_new_priv, + .new_priv_openssh = ecdsa_new_priv_openssh, + .freekey = ecdsa_freekey_sk, + .invalid = ec_signkey_invalid, + .sign = ecdsa_sign, + .verify = ecdsa_verify, + .public_blob = ecdsa_public_blob_sk, + .private_blob = ecdsa_private_blob, + .openssh_blob = ecdsa_openssh_blob, + .cache_str = ecdsa_cache_str, + .components = ecdsa_components, + .pubkey_bits = ec_shared_pubkey_bits, + .ssh_id = "sk-ecdsa-sha2-nistp384@openssh.com", + .cache_id = "sk-ecdsa-sha2-nistp384@openssh.com", + .extra = &sign_extra_nistp384, +}; + +const ssh_keyalg ssh_ecdsa_nistp521_sk = { + .new_pub = ecdsa_new_pub, + .new_priv = ecdsa_new_priv, + .new_priv_openssh = ecdsa_new_priv_openssh, + .freekey = ecdsa_freekey_sk, + .invalid = ec_signkey_invalid, + .sign = ecdsa_sign, + .verify = ecdsa_verify, + .public_blob = ecdsa_public_blob_sk, + .private_blob = ecdsa_private_blob, + .openssh_blob = ecdsa_openssh_blob, + .cache_str = ecdsa_cache_str, + .components = ecdsa_components, + .pubkey_bits = ec_shared_pubkey_bits, + .ssh_id = "sk-ecdsa-sha2-nistp521@openssh.com", + .cache_id = "sk-ecdsa-sha2-nistp521@openssh.com", + .extra = &sign_extra_nistp521, +}; + +static void eddsa_freekey_sk(ssh_key* key) +{ + struct eddsa_key* ek = container_of(key, struct eddsa_key, sshk); + + // free app id and then call standard function to free rest + if (ek->appid) sfree(ek->appid); + eddsa_freekey(key); +} + +static void eddsa_public_blob_sk(ssh_key* key, BinarySink* bs) +{ + struct eddsa_key* ek = container_of(key, struct eddsa_key, sshk); + + put_stringz(bs, ek->sshk.vt->ssh_id); + put_epoint(bs, ek->publicKey, ek->curve, false); + put_stringz(bs, ek->appid); +} + +const ssh_keyalg ssh_ecdsa_ed25519_sk = { + .new_pub = eddsa_new_pub, + .new_priv = eddsa_new_priv, + .new_priv_openssh = eddsa_new_priv_openssh, + .freekey = eddsa_freekey_sk, + .invalid = ec_signkey_invalid, + .sign = eddsa_sign, + .verify = eddsa_verify, + .public_blob = eddsa_public_blob_sk, + .private_blob = eddsa_private_blob, + .openssh_blob = eddsa_openssh_blob, + .cache_str = eddsa_cache_str, + .components = eddsa_components, + .pubkey_bits = ec_shared_pubkey_bits, + .ssh_id = "sk-ssh-ed25519@openssh.com", + .cache_id = "sk-ssh-ed25519@openssh.com", + .extra = &sign_extra_ed25519, +}; +#endif // PUTTY_CAC + /* ---------------------------------------------------------------------- * Exposed ECDH interface */ diff --git a/code/ecc.h b/code/crypto/ecc.h similarity index 98% rename from code/ecc.h rename to code/crypto/ecc.h index 96eebdf..a611532 100644 --- a/code/ecc.h +++ b/code/crypto/ecc.h @@ -63,7 +63,7 @@ WeierstrassPoint *ecc_weierstrass_point_new_from_x( /* Memory management: copy and free points. */ void ecc_weierstrass_point_copy_into( WeierstrassPoint *dest, WeierstrassPoint *src); -WeierstrassPoint *ecc_weierstrass_point_copy(WeierstrassPoint *wc); +WeierstrassPoint *ecc_weierstrass_point_copy(WeierstrassPoint *orig); void ecc_weierstrass_point_free(WeierstrassPoint *point); /* Check whether a point is actually on the curve. */ @@ -223,7 +223,7 @@ EdwardsPoint *ecc_edwards_point_new_from_y( /* Copy and free points. */ void ecc_edwards_point_copy_into(EdwardsPoint *dest, EdwardsPoint *src); -EdwardsPoint *ecc_edwards_point_copy(EdwardsPoint *ec); +EdwardsPoint *ecc_edwards_point_copy(EdwardsPoint *orig); void ecc_edwards_point_free(EdwardsPoint *point); /* diff --git a/code/crypto/hash_simple.c b/code/crypto/hash_simple.c new file mode 100644 index 0000000..0115b92 --- /dev/null +++ b/code/crypto/hash_simple.c @@ -0,0 +1,13 @@ +/* + * Convenience function to hash a single piece of data, wrapping up + * the faff of making and freeing an ssh_hash. + */ + +#include "ssh.h" + +void hash_simple(const ssh_hashalg *alg, ptrlen data, void *output) +{ + ssh_hash *hash = ssh_hash_new(alg); + put_datapl(hash, data); + ssh_hash_final(hash, output); +} diff --git a/code/sshhmac.c b/code/crypto/hmac.c similarity index 95% rename from code/sshhmac.c rename to code/crypto/hmac.c index 8f18eb2..f04d74b 100644 --- a/code/sshhmac.c +++ b/code/crypto/hmac.c @@ -42,20 +42,20 @@ static ssh2_mac *hmac_new(const ssh2_macalg *alg, ssh_cipher *cipher) ctx->digest = snewn(ctx->hashalg->hlen, uint8_t); ctx->text_name = strbuf_new(); - strbuf_catf(ctx->text_name, "HMAC-%s%s", - ctx->hashalg->text_basename, extra->suffix); + put_fmt(ctx->text_name, "HMAC-%s%s", + ctx->hashalg->text_basename, extra->suffix); if (extra->annotation || ctx->hashalg->annotation) { - strbuf_catf(ctx->text_name, " ("); + put_fmt(ctx->text_name, " ("); const char *sep = ""; if (extra->annotation) { - strbuf_catf(ctx->text_name, "%s%s", sep, extra->annotation); + put_fmt(ctx->text_name, "%s%s", sep, extra->annotation); sep = ", "; } if (ctx->hashalg->annotation) { - strbuf_catf(ctx->text_name, "%s%s", sep, ctx->hashalg->annotation); + put_fmt(ctx->text_name, "%s%s", sep, ctx->hashalg->annotation); sep = ", "; } - strbuf_catf(ctx->text_name, ")"); + put_fmt(ctx->text_name, ")"); } ctx->mac.vt = alg; diff --git a/code/sshmac.c b/code/crypto/mac.c similarity index 100% rename from code/sshmac.c rename to code/crypto/mac.c diff --git a/code/crypto/mac_simple.c b/code/crypto/mac_simple.c new file mode 100644 index 0000000..c705fd8 --- /dev/null +++ b/code/crypto/mac_simple.c @@ -0,0 +1,16 @@ +/* + * Convenience function to MAC a single piece of data, wrapping up + * the faff of making and freeing an ssh_mac. + */ + +#include "ssh.h" + +void mac_simple(const ssh2_macalg *alg, ptrlen key, ptrlen data, void *output) +{ + ssh2_mac *mac = ssh2_mac_new(alg, NULL); + ssh2_mac_setkey(mac, key); + ssh2_mac_start(mac); + put_datapl(mac, data); + ssh2_mac_genresult(mac, output); + ssh2_mac_free(mac); +} diff --git a/code/sshmd5.c b/code/crypto/md5.c similarity index 100% rename from code/sshmd5.c rename to code/crypto/md5.c diff --git a/code/mpint.c b/code/crypto/mpint.c similarity index 92% rename from code/mpint.c rename to code/crypto/mpint.c index 39f5506..544a18b 100644 --- a/code/mpint.c +++ b/code/crypto/mpint.c @@ -1,3 +1,7 @@ +/* + * Multiprecision integer arithmetic, implementing mpint.h. + */ + #include #include #include @@ -1535,41 +1539,112 @@ mp_int *monty_export(MontyContext *mc, mp_int *x) return toret; } -static void monty_reduce(MontyContext *mc, mp_int *x) -{ - mp_int reduced = monty_reduce_internal(mc, x, *mc->scratch); - mp_copy_into(x, &reduced); - mp_clear(mc->scratch); -} - +#define MODPOW_LOG2_WINDOW_SIZE 5 +#define MODPOW_WINDOW_SIZE (1 << MODPOW_LOG2_WINDOW_SIZE) mp_int *monty_pow(MontyContext *mc, mp_int *base, mp_int *exponent) { - /* square builds up powers of the form base^{2^i}. */ - mp_int *square = mp_copy(base); - size_t i = 0; + /* + * Modular exponentiation is done from the top down, using a + * fixed-window technique. + * + * We have a table storing every power of the base from base^0 up + * to base^{w-1}, where w is a small power of 2, say 2^k. (k is + * defined above as MODPOW_LOG2_WINDOW_SIZE, and w = 2^k is + * defined as MODPOW_WINDOW_SIZE.) + * + * We break the exponent up into k-bit chunks, from the bottom up, + * that is + * + * exponent = c_0 + 2^k c_1 + 2^{2k} c_2 + ... + 2^{nk} c_n + * + * and we compute base^exponent by computing in turn + * + * base^{c_n} + * base^{2^k c_n + c_{n-1}} + * base^{2^{2k} c_n + 2^k c_{n-1} + c_{n-2}} + * ... + * + * where each line is obtained by raising the previous line to the + * power 2^k (i.e. squaring it k times) and then multiplying in + * a value base^{c_i}, which we can look up in our table. + * + * Side-channel considerations: the exponent is secret, so + * actually doing a single table lookup by using a chunk of + * exponent bits as an array index would be an obvious leak of + * secret information into the cache. So instead, in each + * iteration, we read _all_ the table entries, and do a sequence + * of mp_select operations to leave just the one we wanted in the + * variable that will go into the multiplication. In other + * contexts (like software AES) that technique is so prohibitively + * slow that it makes you choose a strategy that doesn't use table + * lookups at all (we do bitslicing in preference); but here, this + * iteration through 2^k table elements is replacing k-1 bignum + * _multiplications_ that you'd have to use instead if you did + * simple square-and-multiply, and that makes it still a win. + */ + + /* Table that holds base^0, ..., base^{w-1} */ + mp_int *table[MODPOW_WINDOW_SIZE]; + table[0] = mp_copy(monty_identity(mc)); + for (size_t i = 1; i < MODPOW_WINDOW_SIZE; i++) + table[i] = monty_mul(mc, table[i-1], base); + + /* out accumulates the output value */ + mp_int *out = mp_make_sized(mc->rw); + mp_copy_into(out, monty_identity(mc)); + + /* table_entry will hold each value we get out of the table */ + mp_int *table_entry = mp_make_sized(mc->rw); - /* out accumulates the output value. Starts at 1 (in Montgomery - * representation) and we multiply in each base^{2^i}. */ - mp_int *out = mp_copy(mc->powers_of_r_mod_m[0]); + /* Bit index of the chunk of bits we're working on. Start with the + * highest multiple of k strictly less than the size of our + * bignum, i.e. the highest-index chunk of bits that might + * conceivably contain any nonzero bit. */ + size_t i = (exponent->nw * BIGNUM_INT_BITS) - 1; + i -= i % MODPOW_LOG2_WINDOW_SIZE; - /* tmp holds each product we compute and reduce. */ - mp_int *tmp = mp_make_sized(mc->rw * 2); + bool first_iteration = true; while (true) { - mp_mul_into(tmp, out, square); - monty_reduce(mc, tmp); - mp_select_into(out, out, tmp, mp_get_bit(exponent, i)); + /* Construct the table index */ + unsigned table_index = 0; + for (size_t j = 0; j < MODPOW_LOG2_WINDOW_SIZE; j++) + table_index |= mp_get_bit(exponent, i+j) << j; + + /* Iterate through the table to do a side-channel-safe lookup, + * ending up with table_entry = table[table_index] */ + mp_copy_into(table_entry, table[0]); + for (size_t j = 1; j < MODPOW_WINDOW_SIZE; j++) { + unsigned not_this_one = + ((table_index ^ j) + MODPOW_WINDOW_SIZE - 1) + >> MODPOW_LOG2_WINDOW_SIZE; + mp_select_into(table_entry, table[j], table_entry, not_this_one); + } + + if (!first_iteration) { + /* Multiply into the output */ + monty_mul_into(mc, out, out, table_entry); + } else { + /* On the first iteration, we can save one multiplication + * by just copying */ + mp_copy_into(out, table_entry); + first_iteration = false; + } - if (++i >= exponent->nw * BIGNUM_INT_BITS) + /* If that was the bottommost chunk of bits, we're done */ + if (i == 0) break; - mp_mul_into(tmp, square, square); - monty_reduce(mc, tmp); - mp_copy_into(square, tmp); + /* Otherwise, square k times and go round again. */ + for (size_t j = 0; j < MODPOW_LOG2_WINDOW_SIZE; j++) + monty_mul_into(mc, out, out, out); + + i-= MODPOW_LOG2_WINDOW_SIZE; } - mp_free(square); - mp_free(tmp); + for (size_t i = 0; i < MODPOW_WINDOW_SIZE; i++) + mp_free(table[i]); + mp_free(table_entry); mp_clear(mc->scratch); return out; } @@ -2145,9 +2220,9 @@ void mp_divmod_into(mp_int *n, mp_int *d, mp_int *q_out, mp_int *r_out) * Make the constant 2*R, which we'll need in the iteration. */ mp_int *two_R = mp_make_sized(rw); + BignumInt top_word = (BignumInt)1 << ((log2_R+1) % BIGNUM_INT_BITS); mp_add_integer_into_shifted_by_words( - two_R, two_R, (BignumInt)1 << ((log2_R+1) % BIGNUM_INT_BITS), - (log2_R+1) / BIGNUM_INT_BITS); + two_R, two_R, top_word, (log2_R+1) / BIGNUM_INT_BITS); /* * Scratch space. @@ -2259,6 +2334,87 @@ mp_int *mp_mod(mp_int *n, mp_int *d) return r; } +uint32_t mp_mod_known_integer(mp_int *x, uint32_t m) +{ + uint64_t reciprocal = ((uint64_t)1 << 48) / m; + uint64_t accumulator = 0; + for (size_t i = mp_max_bytes(x); i-- > 0 ;) { + accumulator = 0x100 * accumulator + mp_get_byte(x, i); + /* + * Let A be the value in 'accumulator' at this point, and let + * R be the value it will have after we subtract quot*m below. + * + * Lemma 1: if A < 2^48, then R < 2m. + * + * Proof: + * + * By construction, we have 2^48/m - 1 < reciprocal <= 2^48/m. + * Multiplying that by the accumulator gives + * + * A/m * 2^48 - A < unshifted_quot <= A/m * 2^48 + * i.e. 0 <= (A/m * 2^48) - unshifted_quot < A + * i.e. 0 <= A/m - unshifted_quot/2^48 < A/2^48 + * + * So when we shift this quotient right by 48 bits, i.e. take + * the floor of (unshifted_quot/2^48), the value we take the + * floor of is at most A/2^48 less than the true rational + * value A/m that we _wanted_ to take the floor of. + * + * Provided A < 2^48, this is less than 1. So the quotient + * 'quot' that we've just produced is either the true quotient + * floor(A/m), or one less than it. Hence, the output value R + * is less than 2m. [] + * + * Lemma 2: if A < 2^16 m, then the multiplication of + * accumulator*reciprocal does not overflow. + * + * Proof: as above, we have reciprocal <= 2^48/m. Multiplying + * by A gives unshifted_quot <= 2^48 * A / m < 2^48 * 2^16 = + * 2^64. [] + */ + uint64_t unshifted_quot = accumulator * reciprocal; + uint64_t quot = unshifted_quot >> 48; + accumulator -= quot * m; + } + + /* + * Theorem 1: accumulator < 2m at the end of every iteration of + * this loop. + * + * Proof: induction on the above loop. + * + * Base case: at the start of the first loop iteration, the + * accumulator is 0, which is certainly < 2m. + * + * Inductive step: in each loop iteration, we take a value at most + * 2m-1, multiply it by 2^8, and add another byte less than 2^8 to + * generate the input value A to the reduction process above. So + * we have A < 2m * 2^8 - 1. We know m < 2^32 (because it was + * passed in as a uint32_t), so A < 2^41, which is enough to allow + * us to apply Lemma 1, showing that the value of 'accumulator' at + * the end of the loop is still < 2m. [] + * + * Corollary: we need at most one final subtraction of m to + * produce the canonical residue of x mod m, i.e. in the range + * [0,m). + * + * Theorem 2: no multiplication in the inner loop overflows. + * + * Proof: in Theorem 1 we established A < 2m * 2^8 - 1 in every + * iteration. That is less than m * 2^16, so Lemma 2 applies. + * + * The other multiplication, of quot * m, cannot overflow because + * quot is at most A/m, so quot*m <= A < 2^64. [] + */ + + uint32_t result = accumulator; + uint32_t reduced = result - m; + uint32_t select = -(reduced >> 31); + result = reduced ^ ((result ^ reduced) & select); + assert(result < m); + return result; +} + mp_int *mp_nthroot(mp_int *y, unsigned n, mp_int *remainder_out) { /* diff --git a/code/mpint_i.h b/code/crypto/mpint_i.h similarity index 99% rename from code/mpint_i.h rename to code/crypto/mpint_i.h index d37e75f..fb2b367 100644 --- a/code/mpint_i.h +++ b/code/crypto/mpint_i.h @@ -266,7 +266,7 @@ #endif /* DEFINE_BIGNUMDBLINT */ /* ---------------------------------------------------------------------- - * Data structures used inside bignum.c. + * Data structures used inside mpint.c. */ struct mp_int { diff --git a/code/sshprng.c b/code/crypto/prng.c similarity index 99% rename from code/sshprng.c rename to code/crypto/prng.c index 58df994..247d1dc 100644 --- a/code/sshprng.c +++ b/code/crypto/prng.c @@ -1,5 +1,5 @@ /* - * sshprng.c: PuTTY's cryptographic pseudorandom number generator. + * PuTTY's cryptographic pseudorandom number generator. * * This module just defines the PRNG object type and its methods. The * usual global instance of it is managed by sshrand.c. diff --git a/code/crypto/pubkey-pem.c b/code/crypto/pubkey-pem.c new file mode 100644 index 0000000..3eaa16a --- /dev/null +++ b/code/crypto/pubkey-pem.c @@ -0,0 +1,32 @@ +/* + * Convenience functions to encrypt and decrypt OpenSSH PEM format for + * SSH-2 private key files. This uses triple-DES in SSH-2 style (one + * CBC layer), with three distinct keys, and an IV also generated from + * the passphrase. + */ + +#include "ssh.h" + +static ssh_cipher *des3_pubkey_ossh_cipher(const void *vkey, const void *viv) +{ + ssh_cipher *c = ssh_cipher_new(&ssh_3des_ssh2); + ssh_cipher_setkey(c, vkey); + ssh_cipher_setiv(c, viv); + return c; +} + +void des3_decrypt_pubkey_ossh(const void *vkey, const void *viv, + void *vblk, int len) +{ + ssh_cipher *c = des3_pubkey_ossh_cipher(vkey, viv); + ssh_cipher_decrypt(c, vblk, len); + ssh_cipher_free(c); +} + +void des3_encrypt_pubkey_ossh(const void *vkey, const void *viv, + void *vblk, int len) +{ + ssh_cipher *c = des3_pubkey_ossh_cipher(vkey, viv); + ssh_cipher_encrypt(c, vblk, len); + ssh_cipher_free(c); +} diff --git a/code/crypto/pubkey-ppk.c b/code/crypto/pubkey-ppk.c new file mode 100644 index 0000000..7ffb570 --- /dev/null +++ b/code/crypto/pubkey-ppk.c @@ -0,0 +1,29 @@ +/* + * Convenience functions to encrypt and decrypt PuTTY's own .PPK + * format for SSH-2 private key files, which uses 256-bit AES in CBC + * mode. + */ + +#include "ssh.h" + +static ssh_cipher *aes256_pubkey_cipher(const void *key, const void *iv) +{ + ssh_cipher *cipher = ssh_cipher_new(&ssh_aes256_cbc); + ssh_cipher_setkey(cipher, key); + ssh_cipher_setiv(cipher, iv); + return cipher; +} + +void aes256_encrypt_pubkey(const void *key, const void *iv, void *blk, int len) +{ + ssh_cipher *c = aes256_pubkey_cipher(key, iv); + ssh_cipher_encrypt(c, blk, len); + ssh_cipher_free(c); +} + +void aes256_decrypt_pubkey(const void *key, const void *iv, void *blk, int len) +{ + ssh_cipher *c = aes256_pubkey_cipher(key, iv); + ssh_cipher_decrypt(c, blk, len); + ssh_cipher_free(c); +} diff --git a/code/crypto/pubkey-ssh1.c b/code/crypto/pubkey-ssh1.c new file mode 100644 index 0000000..b3129e2 --- /dev/null +++ b/code/crypto/pubkey-ssh1.c @@ -0,0 +1,38 @@ +/* + * Convenience functions to encrypt and decrypt the standard format + * for SSH-1 private key files. This uses triple-DES in SSH-1 style + * (three separate CBC layers), but the same key is used for the first + * and third layers.CBC mode. + */ + +#include "ssh.h" + +static ssh_cipher *des3_pubkey_cipher(const void *vkey) +{ + ssh_cipher *c = ssh_cipher_new(&ssh_3des_ssh1); + uint8_t keys3[24], iv[8]; + + memcpy(keys3, vkey, 16); + memcpy(keys3 + 16, vkey, 8); + ssh_cipher_setkey(c, keys3); + smemclr(keys3, sizeof(keys3)); + + memset(iv, 0, 8); + ssh_cipher_setiv(c, iv); + + return c; +} + +void des3_decrypt_pubkey(const void *vkey, void *vblk, int len) +{ + ssh_cipher *c = des3_pubkey_cipher(vkey); + ssh_cipher_decrypt(c, vblk, len); + ssh_cipher_free(c); +} + +void des3_encrypt_pubkey(const void *vkey, void *vblk, int len) +{ + ssh_cipher *c = des3_pubkey_cipher(vkey); + ssh_cipher_encrypt(c, vblk, len); + ssh_cipher_free(c); +} diff --git a/code/sshrsa.c b/code/crypto/rsa.c similarity index 99% rename from code/sshrsa.c rename to code/crypto/rsa.c index e3dcbdd..ef83286 100644 --- a/code/sshrsa.c +++ b/code/crypto/rsa.c @@ -311,11 +311,11 @@ char *rsa_ssh1_fingerprint(RSAKey *key) ssh_hash_final(hash, digest); out = strbuf_new(); - strbuf_catf(out, "%"SIZEu" ", mp_get_nbits(key->modulus)); + put_fmt(out, "%"SIZEu" ", mp_get_nbits(key->modulus)); for (i = 0; i < 16; i++) - strbuf_catf(out, "%s%02x", i ? ":" : "", digest[i]); + put_fmt(out, "%s%02x", i ? ":" : "", digest[i]); if (key->comment) - strbuf_catf(out, " %s", key->comment); + put_fmt(out, " %s", key->comment); return strbuf_to_str(out); } diff --git a/code/crypto/sha1-common.c b/code/crypto/sha1-common.c new file mode 100644 index 0000000..bf1db67 --- /dev/null +++ b/code/crypto/sha1-common.c @@ -0,0 +1,10 @@ +/* + * Common variable definitions across all the SHA-1 implementations. + */ + +#include "ssh.h" +#include "sha1.h" + +const uint32_t sha1_initial_state[5] = { + 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, +}; diff --git a/code/crypto/sha1-neon.c b/code/crypto/sha1-neon.c new file mode 100644 index 0000000..9904571 --- /dev/null +++ b/code/crypto/sha1-neon.c @@ -0,0 +1,190 @@ +/* + * Hardware-accelerated implementation of SHA-1 using Arm NEON. + */ + +#include "ssh.h" +#include "sha1.h" + +#if USE_ARM64_NEON_H +#include +#else +#include +#endif + +static bool sha1_neon_available(void) +{ + /* + * For Arm, we delegate to a per-platform detection function (see + * explanation in aes-neon.c). + */ + return platform_sha1_neon_available(); +} + +typedef struct sha1_neon_core sha1_neon_core; +struct sha1_neon_core { + uint32x4_t abcd; + uint32_t e; +}; + +static inline uint32x4_t sha1_neon_load_input(const uint8_t *p) +{ + return vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(p))); +} + +static inline uint32x4_t sha1_neon_schedule_update( + uint32x4_t m4, uint32x4_t m3, uint32x4_t m2, uint32x4_t m1) +{ + return vsha1su1q_u32(vsha1su0q_u32(m4, m3, m2), m1); +} + +/* + * SHA-1 has three different kinds of round, differing in whether they + * use the Ch, Maj or Par functions defined above. Each one uses a + * separate NEON instruction, so we define three inline functions for + * the different round types using this macro. + * + * The two batches of Par-type rounds also use a different constant, + * but that's passed in as an operand, so we don't need a fourth + * inline function just for that. + */ +#define SHA1_NEON_ROUND_FN(type) \ + static inline sha1_neon_core sha1_neon_round4_##type( \ + sha1_neon_core old, uint32x4_t sched, uint32x4_t constant) \ + { \ + sha1_neon_core new; \ + uint32x4_t round_input = vaddq_u32(sched, constant); \ + new.abcd = vsha1##type##q_u32(old.abcd, old.e, round_input); \ + new.e = vsha1h_u32(vget_lane_u32(vget_low_u32(old.abcd), 0)); \ + return new; \ + } +SHA1_NEON_ROUND_FN(c) +SHA1_NEON_ROUND_FN(p) +SHA1_NEON_ROUND_FN(m) + +static inline void sha1_neon_block(sha1_neon_core *core, const uint8_t *p) +{ + uint32x4_t constant, s0, s1, s2, s3; + sha1_neon_core cr = *core; + + constant = vdupq_n_u32(SHA1_STAGE0_CONSTANT); + s0 = sha1_neon_load_input(p); + cr = sha1_neon_round4_c(cr, s0, constant); + s1 = sha1_neon_load_input(p + 16); + cr = sha1_neon_round4_c(cr, s1, constant); + s2 = sha1_neon_load_input(p + 32); + cr = sha1_neon_round4_c(cr, s2, constant); + s3 = sha1_neon_load_input(p + 48); + cr = sha1_neon_round4_c(cr, s3, constant); + s0 = sha1_neon_schedule_update(s0, s1, s2, s3); + cr = sha1_neon_round4_c(cr, s0, constant); + + constant = vdupq_n_u32(SHA1_STAGE1_CONSTANT); + s1 = sha1_neon_schedule_update(s1, s2, s3, s0); + cr = sha1_neon_round4_p(cr, s1, constant); + s2 = sha1_neon_schedule_update(s2, s3, s0, s1); + cr = sha1_neon_round4_p(cr, s2, constant); + s3 = sha1_neon_schedule_update(s3, s0, s1, s2); + cr = sha1_neon_round4_p(cr, s3, constant); + s0 = sha1_neon_schedule_update(s0, s1, s2, s3); + cr = sha1_neon_round4_p(cr, s0, constant); + s1 = sha1_neon_schedule_update(s1, s2, s3, s0); + cr = sha1_neon_round4_p(cr, s1, constant); + + constant = vdupq_n_u32(SHA1_STAGE2_CONSTANT); + s2 = sha1_neon_schedule_update(s2, s3, s0, s1); + cr = sha1_neon_round4_m(cr, s2, constant); + s3 = sha1_neon_schedule_update(s3, s0, s1, s2); + cr = sha1_neon_round4_m(cr, s3, constant); + s0 = sha1_neon_schedule_update(s0, s1, s2, s3); + cr = sha1_neon_round4_m(cr, s0, constant); + s1 = sha1_neon_schedule_update(s1, s2, s3, s0); + cr = sha1_neon_round4_m(cr, s1, constant); + s2 = sha1_neon_schedule_update(s2, s3, s0, s1); + cr = sha1_neon_round4_m(cr, s2, constant); + + constant = vdupq_n_u32(SHA1_STAGE3_CONSTANT); + s3 = sha1_neon_schedule_update(s3, s0, s1, s2); + cr = sha1_neon_round4_p(cr, s3, constant); + s0 = sha1_neon_schedule_update(s0, s1, s2, s3); + cr = sha1_neon_round4_p(cr, s0, constant); + s1 = sha1_neon_schedule_update(s1, s2, s3, s0); + cr = sha1_neon_round4_p(cr, s1, constant); + s2 = sha1_neon_schedule_update(s2, s3, s0, s1); + cr = sha1_neon_round4_p(cr, s2, constant); + s3 = sha1_neon_schedule_update(s3, s0, s1, s2); + cr = sha1_neon_round4_p(cr, s3, constant); + + core->abcd = vaddq_u32(core->abcd, cr.abcd); + core->e += cr.e; +} + +typedef struct sha1_neon { + sha1_neon_core core; + sha1_block blk; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha1_neon; + +static void sha1_neon_write(BinarySink *bs, const void *vp, size_t len); + +static ssh_hash *sha1_neon_new(const ssh_hashalg *alg) +{ + const struct sha1_extra *extra = (const struct sha1_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + sha1_neon *s = snew(sha1_neon); + + s->hash.vt = alg; + BinarySink_INIT(s, sha1_neon_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha1_neon_reset(ssh_hash *hash) +{ + sha1_neon *s = container_of(hash, sha1_neon, hash); + + s->core.abcd = vld1q_u32(sha1_initial_state); + s->core.e = sha1_initial_state[4]; + + sha1_block_setup(&s->blk); +} + +static void sha1_neon_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha1_neon *copy = container_of(hcopy, sha1_neon, hash); + sha1_neon *orig = container_of(horig, sha1_neon, hash); + + *copy = *orig; /* structure copy */ + + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha1_neon_free(ssh_hash *hash) +{ + sha1_neon *s = container_of(hash, sha1_neon, hash); + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void sha1_neon_write(BinarySink *bs, const void *vp, size_t len) +{ + sha1_neon *s = BinarySink_DOWNCAST(bs, sha1_neon); + + while (len > 0) + if (sha1_block_write(&s->blk, &vp, &len)) + sha1_neon_block(&s->core, s->blk.block); +} + +static void sha1_neon_digest(ssh_hash *hash, uint8_t *digest) +{ + sha1_neon *s = container_of(hash, sha1_neon, hash); + + sha1_block_pad(&s->blk, BinarySink_UPCAST(s)); + vst1q_u8(digest, vrev32q_u8(vreinterpretq_u8_u32(s->core.abcd))); + PUT_32BIT_MSB_FIRST(digest + 16, s->core.e); +} + +SHA1_VTABLE(neon, "NEON accelerated"); diff --git a/code/crypto/sha1-ni.c b/code/crypto/sha1-ni.c new file mode 100644 index 0000000..04e6386 --- /dev/null +++ b/code/crypto/sha1-ni.c @@ -0,0 +1,325 @@ +/* + * Hardware-accelerated implementation of SHA-1 using x86 SHA-NI. + */ + +#include "ssh.h" +#include "sha1.h" + +#include +#include +#include +#if HAVE_SHAINTRIN_H +#include +#endif + +#if defined(__clang__) || defined(__GNUC__) +#include +#define GET_CPU_ID_0(out) \ + __cpuid(0, (out)[0], (out)[1], (out)[2], (out)[3]) +#define GET_CPU_ID_7(out) \ + __cpuid_count(7, 0, (out)[0], (out)[1], (out)[2], (out)[3]) +#else +#define GET_CPU_ID_0(out) __cpuid(out, 0) +#define GET_CPU_ID_7(out) __cpuidex(out, 7, 0) +#endif + +static bool sha1_ni_available(void) +{ + unsigned int CPUInfo[4]; + GET_CPU_ID_0(CPUInfo); + if (CPUInfo[0] < 7) + return false; + + GET_CPU_ID_7(CPUInfo); + return CPUInfo[1] & (1 << 29); /* Check SHA */ +} + +/* SHA1 implementation using new instructions + The code is based on Jeffrey Walton's SHA1 implementation: + https://github.com/noloader/SHA-Intrinsics +*/ +static inline void sha1_ni_block(__m128i *core, const uint8_t *p) +{ + __m128i ABCD, E0, E1, MSG0, MSG1, MSG2, MSG3; + const __m128i MASK = _mm_set_epi64x( + 0x0001020304050607ULL, 0x08090a0b0c0d0e0fULL); + + const __m128i *block = (const __m128i *)p; + + /* Load initial values */ + ABCD = core[0]; + E0 = core[1]; + + /* Rounds 0-3 */ + MSG0 = _mm_loadu_si128(block); + MSG0 = _mm_shuffle_epi8(MSG0, MASK); + E0 = _mm_add_epi32(E0, MSG0); + E1 = ABCD; + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0); + + /* Rounds 4-7 */ + MSG1 = _mm_loadu_si128(block + 1); + MSG1 = _mm_shuffle_epi8(MSG1, MASK); + E1 = _mm_sha1nexte_epu32(E1, MSG1); + E0 = ABCD; + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 0); + MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); + + /* Rounds 8-11 */ + MSG2 = _mm_loadu_si128(block + 2); + MSG2 = _mm_shuffle_epi8(MSG2, MASK); + E0 = _mm_sha1nexte_epu32(E0, MSG2); + E1 = ABCD; + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0); + MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); + MSG0 = _mm_xor_si128(MSG0, MSG2); + + /* Rounds 12-15 */ + MSG3 = _mm_loadu_si128(block + 3); + MSG3 = _mm_shuffle_epi8(MSG3, MASK); + E1 = _mm_sha1nexte_epu32(E1, MSG3); + E0 = ABCD; + MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 0); + MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); + MSG1 = _mm_xor_si128(MSG1, MSG3); + + /* Rounds 16-19 */ + E0 = _mm_sha1nexte_epu32(E0, MSG0); + E1 = ABCD; + MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0); + MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); + MSG2 = _mm_xor_si128(MSG2, MSG0); + + /* Rounds 20-23 */ + E1 = _mm_sha1nexte_epu32(E1, MSG1); + E0 = ABCD; + MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1); + MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); + MSG3 = _mm_xor_si128(MSG3, MSG1); + + /* Rounds 24-27 */ + E0 = _mm_sha1nexte_epu32(E0, MSG2); + E1 = ABCD; + MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 1); + MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); + MSG0 = _mm_xor_si128(MSG0, MSG2); + + /* Rounds 28-31 */ + E1 = _mm_sha1nexte_epu32(E1, MSG3); + E0 = ABCD; + MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1); + MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); + MSG1 = _mm_xor_si128(MSG1, MSG3); + + /* Rounds 32-35 */ + E0 = _mm_sha1nexte_epu32(E0, MSG0); + E1 = ABCD; + MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 1); + MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); + MSG2 = _mm_xor_si128(MSG2, MSG0); + + /* Rounds 36-39 */ + E1 = _mm_sha1nexte_epu32(E1, MSG1); + E0 = ABCD; + MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1); + MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); + MSG3 = _mm_xor_si128(MSG3, MSG1); + + /* Rounds 40-43 */ + E0 = _mm_sha1nexte_epu32(E0, MSG2); + E1 = ABCD; + MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2); + MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); + MSG0 = _mm_xor_si128(MSG0, MSG2); + + /* Rounds 44-47 */ + E1 = _mm_sha1nexte_epu32(E1, MSG3); + E0 = ABCD; + MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 2); + MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); + MSG1 = _mm_xor_si128(MSG1, MSG3); + + /* Rounds 48-51 */ + E0 = _mm_sha1nexte_epu32(E0, MSG0); + E1 = ABCD; + MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2); + MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); + MSG2 = _mm_xor_si128(MSG2, MSG0); + + /* Rounds 52-55 */ + E1 = _mm_sha1nexte_epu32(E1, MSG1); + E0 = ABCD; + MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 2); + MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); + MSG3 = _mm_xor_si128(MSG3, MSG1); + + /* Rounds 56-59 */ + E0 = _mm_sha1nexte_epu32(E0, MSG2); + E1 = ABCD; + MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2); + MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); + MSG0 = _mm_xor_si128(MSG0, MSG2); + + /* Rounds 60-63 */ + E1 = _mm_sha1nexte_epu32(E1, MSG3); + E0 = ABCD; + MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3); + MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); + MSG1 = _mm_xor_si128(MSG1, MSG3); + + /* Rounds 64-67 */ + E0 = _mm_sha1nexte_epu32(E0, MSG0); + E1 = ABCD; + MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 3); + MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); + MSG2 = _mm_xor_si128(MSG2, MSG0); + + /* Rounds 68-71 */ + E1 = _mm_sha1nexte_epu32(E1, MSG1); + E0 = ABCD; + MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3); + MSG3 = _mm_xor_si128(MSG3, MSG1); + + /* Rounds 72-75 */ + E0 = _mm_sha1nexte_epu32(E0, MSG2); + E1 = ABCD; + MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); + ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 3); + + /* Rounds 76-79 */ + E1 = _mm_sha1nexte_epu32(E1, MSG3); + E0 = ABCD; + ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3); + + /* Combine state */ + core[0] = _mm_add_epi32(ABCD, core[0]); + core[1] = _mm_sha1nexte_epu32(E0, core[1]); +} + +typedef struct sha1_ni { + /* + * core[0] stores the first four words of the SHA-1 state. core[1] + * stores just the fifth word, in the vector lane at the highest + * address. + */ + __m128i core[2]; + sha1_block blk; + void *pointer_to_free; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha1_ni; + +static void sha1_ni_write(BinarySink *bs, const void *vp, size_t len); + +static sha1_ni *sha1_ni_alloc(void) +{ + /* + * The __m128i variables in the context structure need to be + * 16-byte aligned, but not all malloc implementations that this + * code has to work with will guarantee to return a 16-byte + * aligned pointer. So we over-allocate, manually realign the + * pointer ourselves, and store the original one inside the + * context so we know how to free it later. + */ + void *allocation = smalloc(sizeof(sha1_ni) + 15); + uintptr_t alloc_address = (uintptr_t)allocation; + uintptr_t aligned_address = (alloc_address + 15) & ~15; + sha1_ni *s = (sha1_ni *)aligned_address; + s->pointer_to_free = allocation; + return s; +} + +static ssh_hash *sha1_ni_new(const ssh_hashalg *alg) +{ + const struct sha1_extra *extra = (const struct sha1_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + sha1_ni *s = sha1_ni_alloc(); + + s->hash.vt = alg; + BinarySink_INIT(s, sha1_ni_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha1_ni_reset(ssh_hash *hash) +{ + sha1_ni *s = container_of(hash, sha1_ni, hash); + + /* Initialise the core vectors in their storage order */ + s->core[0] = _mm_set_epi64x( + 0x67452301efcdab89ULL, 0x98badcfe10325476ULL); + s->core[1] = _mm_set_epi32(0xc3d2e1f0, 0, 0, 0); + + sha1_block_setup(&s->blk); +} + +static void sha1_ni_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha1_ni *copy = container_of(hcopy, sha1_ni, hash); + sha1_ni *orig = container_of(horig, sha1_ni, hash); + + void *ptf_save = copy->pointer_to_free; + *copy = *orig; /* structure copy */ + copy->pointer_to_free = ptf_save; + + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha1_ni_free(ssh_hash *hash) +{ + sha1_ni *s = container_of(hash, sha1_ni, hash); + + void *ptf = s->pointer_to_free; + smemclr(s, sizeof(*s)); + sfree(ptf); +} + +static void sha1_ni_write(BinarySink *bs, const void *vp, size_t len) +{ + sha1_ni *s = BinarySink_DOWNCAST(bs, sha1_ni); + + while (len > 0) + if (sha1_block_write(&s->blk, &vp, &len)) + sha1_ni_block(s->core, s->blk.block); +} + +static void sha1_ni_digest(ssh_hash *hash, uint8_t *digest) +{ + sha1_ni *s = container_of(hash, sha1_ni, hash); + + sha1_block_pad(&s->blk, BinarySink_UPCAST(s)); + + /* Rearrange the first vector into its output order */ + __m128i abcd = _mm_shuffle_epi32(s->core[0], 0x1B); + + /* Byte-swap it into the output endianness */ + const __m128i mask = _mm_setr_epi8(3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12); + abcd = _mm_shuffle_epi8(abcd, mask); + + /* And store it */ + _mm_storeu_si128((__m128i *)digest, abcd); + + /* Finally, store the leftover word */ + uint32_t e = _mm_extract_epi32(s->core[1], 3); + PUT_32BIT_MSB_FIRST(digest + 16, e); +} + +SHA1_VTABLE(ni, "SHA-NI accelerated"); diff --git a/code/crypto/sha1-select.c b/code/crypto/sha1-select.c new file mode 100644 index 0000000..1e8a6ce --- /dev/null +++ b/code/crypto/sha1-select.c @@ -0,0 +1,44 @@ +/* + * Top-level vtables to select a SHA-1 implementation. + */ + +#include +#include + +#include "putty.h" +#include "ssh.h" +#include "sha1.h" + +static ssh_hash *sha1_select(const ssh_hashalg *alg) +{ + static const ssh_hashalg *const real_algs[] = { +#if HAVE_SHA_NI + &ssh_sha1_ni, +#endif +#if HAVE_NEON_CRYPTO + &ssh_sha1_neon, +#endif + &ssh_sha1_sw, + NULL, + }; + + for (size_t i = 0; real_algs[i]; i++) { + const ssh_hashalg *alg = real_algs[i]; + const struct sha1_extra *alg_extra = + (const struct sha1_extra *)alg->extra; + if (check_availability(alg_extra)) + return ssh_hash_new(alg); + } + + /* We should never reach the NULL at the end of the list, because + * the last non-NULL entry should be software-only SHA-1, which + * is always available. */ + unreachable("sha1_select ran off the end of its list"); +} + +const ssh_hashalg ssh_sha1 = { + .new = sha1_select, + .hlen = 20, + .blocklen = 64, + HASHALG_NAMES_ANNOTATED("SHA-1", "dummy selector vtable"), +}; diff --git a/code/crypto/sha1-sw.c b/code/crypto/sha1-sw.c new file mode 100644 index 0000000..905d97f --- /dev/null +++ b/code/crypto/sha1-sw.c @@ -0,0 +1,155 @@ +/* + * Software implementation of SHA-1. + */ + +#include "ssh.h" +#include "sha1.h" + +static bool sha1_sw_available(void) +{ + /* Software SHA-1 is always available */ + return true; +} + +static inline uint32_t rol(uint32_t x, unsigned y) +{ + return (x << (31 & y)) | (x >> (31 & -y)); +} + +static inline uint32_t Ch(uint32_t ctrl, uint32_t if1, uint32_t if0) +{ + return if0 ^ (ctrl & (if1 ^ if0)); +} + +static inline uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) +{ + return (x & y) | (z & (x | y)); +} + +static inline uint32_t Par(uint32_t x, uint32_t y, uint32_t z) +{ + return (x ^ y ^ z); +} + +static inline void sha1_sw_round( + unsigned round_index, const uint32_t *schedule, + uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, + uint32_t f, uint32_t constant) +{ + *e = rol(*a, 5) + f + *e + schedule[round_index] + constant; + *b = rol(*b, 30); +} + +static void sha1_sw_block(uint32_t *core, const uint8_t *block) +{ + uint32_t w[SHA1_ROUNDS]; + uint32_t a,b,c,d,e; + + for (size_t t = 0; t < 16; t++) + w[t] = GET_32BIT_MSB_FIRST(block + 4*t); + + for (size_t t = 16; t < SHA1_ROUNDS; t++) + w[t] = rol(w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16], 1); + + a = core[0]; b = core[1]; c = core[2]; d = core[3]; + e = core[4]; + + size_t t = 0; + for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { + sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Ch(b,c,d), SHA1_STAGE0_CONSTANT); + sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Ch(a,b,c), SHA1_STAGE0_CONSTANT); + sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Ch(e,a,b), SHA1_STAGE0_CONSTANT); + sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Ch(d,e,a), SHA1_STAGE0_CONSTANT); + sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Ch(c,d,e), SHA1_STAGE0_CONSTANT); + } + for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { + sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Par(b,c,d), SHA1_STAGE1_CONSTANT); + sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Par(a,b,c), SHA1_STAGE1_CONSTANT); + sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Par(e,a,b), SHA1_STAGE1_CONSTANT); + sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Par(d,e,a), SHA1_STAGE1_CONSTANT); + sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Par(c,d,e), SHA1_STAGE1_CONSTANT); + } + for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { + sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Maj(b,c,d), SHA1_STAGE2_CONSTANT); + sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Maj(a,b,c), SHA1_STAGE2_CONSTANT); + sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Maj(e,a,b), SHA1_STAGE2_CONSTANT); + sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Maj(d,e,a), SHA1_STAGE2_CONSTANT); + sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Maj(c,d,e), SHA1_STAGE2_CONSTANT); + } + for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { + sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Par(b,c,d), SHA1_STAGE3_CONSTANT); + sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Par(a,b,c), SHA1_STAGE3_CONSTANT); + sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Par(e,a,b), SHA1_STAGE3_CONSTANT); + sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Par(d,e,a), SHA1_STAGE3_CONSTANT); + sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Par(c,d,e), SHA1_STAGE3_CONSTANT); + } + + core[0] += a; core[1] += b; core[2] += c; core[3] += d; core[4] += e; + + smemclr(w, sizeof(w)); +} + +typedef struct sha1_sw { + uint32_t core[5]; + sha1_block blk; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha1_sw; + +static void sha1_sw_write(BinarySink *bs, const void *vp, size_t len); + +static ssh_hash *sha1_sw_new(const ssh_hashalg *alg) +{ + sha1_sw *s = snew(sha1_sw); + + s->hash.vt = alg; + BinarySink_INIT(s, sha1_sw_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha1_sw_reset(ssh_hash *hash) +{ + sha1_sw *s = container_of(hash, sha1_sw, hash); + + memcpy(s->core, sha1_initial_state, sizeof(s->core)); + sha1_block_setup(&s->blk); +} + +static void sha1_sw_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha1_sw *copy = container_of(hcopy, sha1_sw, hash); + sha1_sw *orig = container_of(horig, sha1_sw, hash); + + memcpy(copy, orig, sizeof(*copy)); + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha1_sw_free(ssh_hash *hash) +{ + sha1_sw *s = container_of(hash, sha1_sw, hash); + + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void sha1_sw_write(BinarySink *bs, const void *vp, size_t len) +{ + sha1_sw *s = BinarySink_DOWNCAST(bs, sha1_sw); + + while (len > 0) + if (sha1_block_write(&s->blk, &vp, &len)) + sha1_sw_block(s->core, s->blk.block); +} + +static void sha1_sw_digest(ssh_hash *hash, uint8_t *digest) +{ + sha1_sw *s = container_of(hash, sha1_sw, hash); + + sha1_block_pad(&s->blk, BinarySink_UPCAST(s)); + for (size_t i = 0; i < 5; i++) + PUT_32BIT_MSB_FIRST(digest + 4*i, s->core[i]); +} + +SHA1_VTABLE(sw, "unaccelerated"); diff --git a/code/crypto/sha1.h b/code/crypto/sha1.h new file mode 100644 index 0000000..2cdba0d --- /dev/null +++ b/code/crypto/sha1.h @@ -0,0 +1,109 @@ +/* + * Definitions likely to be helpful to multiple SHA-1 implementations. + */ + +/* + * The 'extra' structure used by SHA-1 implementations is used to + * include information about how to check if a given implementation is + * available at run time, and whether we've already checked. + */ +struct sha1_extra_mutable; +struct sha1_extra { + /* Function to check availability. Might be expensive, so we don't + * want to call it more than once. */ + bool (*check_available)(void); + + /* Point to a writable substructure. */ + struct sha1_extra_mutable *mut; +}; +struct sha1_extra_mutable { + bool checked_availability; + bool is_available; +}; +static inline bool check_availability(const struct sha1_extra *extra) +{ + if (!extra->mut->checked_availability) { + extra->mut->is_available = extra->check_available(); + extra->mut->checked_availability = true; + } + + return extra->mut->is_available; +} + +/* + * Macro to define a SHA-1 vtable together with its 'extra' + * structure. + */ +#define SHA1_VTABLE(impl_c, impl_display) \ + static struct sha1_extra_mutable sha1_ ## impl_c ## _extra_mut; \ + static const struct sha1_extra sha1_ ## impl_c ## _extra = { \ + .check_available = sha1_ ## impl_c ## _available, \ + .mut = &sha1_ ## impl_c ## _extra_mut, \ + }; \ + const ssh_hashalg ssh_sha1_ ## impl_c = { \ + .new = sha1_ ## impl_c ## _new, \ + .reset = sha1_ ## impl_c ## _reset, \ + .copyfrom = sha1_ ## impl_c ## _copyfrom, \ + .digest = sha1_ ## impl_c ## _digest, \ + .free = sha1_ ## impl_c ## _free, \ + .hlen = 20, \ + .blocklen = 64, \ + HASHALG_NAMES_ANNOTATED("SHA-1", impl_display), \ + .extra = &sha1_ ## impl_c ## _extra, \ + } + +extern const uint32_t sha1_initial_state[5]; + +#define SHA1_ROUNDS_PER_STAGE 20 +#define SHA1_STAGE0_CONSTANT 0x5a827999 +#define SHA1_STAGE1_CONSTANT 0x6ed9eba1 +#define SHA1_STAGE2_CONSTANT 0x8f1bbcdc +#define SHA1_STAGE3_CONSTANT 0xca62c1d6 +#define SHA1_ROUNDS (4 * SHA1_ROUNDS_PER_STAGE) + +typedef struct sha1_block sha1_block; +struct sha1_block { + uint8_t block[64]; + size_t used; + uint64_t len; +}; + +static inline void sha1_block_setup(sha1_block *blk) +{ + blk->used = 0; + blk->len = 0; +} + +static inline bool sha1_block_write( + sha1_block *blk, const void **vdata, size_t *len) +{ + size_t blkleft = sizeof(blk->block) - blk->used; + size_t chunk = *len < blkleft ? *len : blkleft; + + const uint8_t *p = *vdata; + memcpy(blk->block + blk->used, p, chunk); + *vdata = p + chunk; + *len -= chunk; + blk->used += chunk; + blk->len += chunk; + + if (blk->used == sizeof(blk->block)) { + blk->used = 0; + return true; + } + + return false; +} + +static inline void sha1_block_pad(sha1_block *blk, BinarySink *bs) +{ + uint64_t final_len = blk->len << 3; + size_t pad = 1 + (63 & (55 - blk->used)); + + put_byte(bs, 0x80); + for (size_t i = 1; i < pad; i++) + put_byte(bs, 0); + put_uint64(bs, final_len); + + assert(blk->used == 0 && "Should have exactly hit a block boundary"); +} diff --git a/code/crypto/sha256-common.c b/code/crypto/sha256-common.c new file mode 100644 index 0000000..52904c0 --- /dev/null +++ b/code/crypto/sha256-common.c @@ -0,0 +1,30 @@ +/* + * Common variable definitions across all the SHA-256 implementations. + */ + +#include "ssh.h" +#include "sha256.h" + +const uint32_t sha256_initial_state[8] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, +}; + +const uint32_t sha256_round_constants[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, +}; diff --git a/code/crypto/sha256-neon.c b/code/crypto/sha256-neon.c new file mode 100644 index 0000000..87d24d0 --- /dev/null +++ b/code/crypto/sha256-neon.c @@ -0,0 +1,162 @@ +/* + * Hardware-accelerated implementation of SHA-256 using Arm NEON. + */ + +#include "ssh.h" +#include "sha256.h" + +#if USE_ARM64_NEON_H +#include +#else +#include +#endif + +static bool sha256_neon_available(void) +{ + /* + * For Arm, we delegate to a per-platform detection function (see + * explanation in aes-neon.c). + */ + return platform_sha256_neon_available(); +} + +typedef struct sha256_neon_core sha256_neon_core; +struct sha256_neon_core { + uint32x4_t abcd, efgh; +}; + +static inline uint32x4_t sha256_neon_load_input(const uint8_t *p) +{ + return vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(p))); +} + +static inline uint32x4_t sha256_neon_schedule_update( + uint32x4_t m4, uint32x4_t m3, uint32x4_t m2, uint32x4_t m1) +{ + return vsha256su1q_u32(vsha256su0q_u32(m4, m3), m2, m1); +} + +static inline sha256_neon_core sha256_neon_round4( + sha256_neon_core old, uint32x4_t sched, unsigned round) +{ + sha256_neon_core new; + + uint32x4_t round_input = vaddq_u32( + sched, vld1q_u32(sha256_round_constants + round)); + new.abcd = vsha256hq_u32 (old.abcd, old.efgh, round_input); + new.efgh = vsha256h2q_u32(old.efgh, old.abcd, round_input); + return new; +} + +static inline void sha256_neon_block(sha256_neon_core *core, const uint8_t *p) +{ + uint32x4_t s0, s1, s2, s3; + sha256_neon_core cr = *core; + + s0 = sha256_neon_load_input(p); + cr = sha256_neon_round4(cr, s0, 0); + s1 = sha256_neon_load_input(p+16); + cr = sha256_neon_round4(cr, s1, 4); + s2 = sha256_neon_load_input(p+32); + cr = sha256_neon_round4(cr, s2, 8); + s3 = sha256_neon_load_input(p+48); + cr = sha256_neon_round4(cr, s3, 12); + s0 = sha256_neon_schedule_update(s0, s1, s2, s3); + cr = sha256_neon_round4(cr, s0, 16); + s1 = sha256_neon_schedule_update(s1, s2, s3, s0); + cr = sha256_neon_round4(cr, s1, 20); + s2 = sha256_neon_schedule_update(s2, s3, s0, s1); + cr = sha256_neon_round4(cr, s2, 24); + s3 = sha256_neon_schedule_update(s3, s0, s1, s2); + cr = sha256_neon_round4(cr, s3, 28); + s0 = sha256_neon_schedule_update(s0, s1, s2, s3); + cr = sha256_neon_round4(cr, s0, 32); + s1 = sha256_neon_schedule_update(s1, s2, s3, s0); + cr = sha256_neon_round4(cr, s1, 36); + s2 = sha256_neon_schedule_update(s2, s3, s0, s1); + cr = sha256_neon_round4(cr, s2, 40); + s3 = sha256_neon_schedule_update(s3, s0, s1, s2); + cr = sha256_neon_round4(cr, s3, 44); + s0 = sha256_neon_schedule_update(s0, s1, s2, s3); + cr = sha256_neon_round4(cr, s0, 48); + s1 = sha256_neon_schedule_update(s1, s2, s3, s0); + cr = sha256_neon_round4(cr, s1, 52); + s2 = sha256_neon_schedule_update(s2, s3, s0, s1); + cr = sha256_neon_round4(cr, s2, 56); + s3 = sha256_neon_schedule_update(s3, s0, s1, s2); + cr = sha256_neon_round4(cr, s3, 60); + + core->abcd = vaddq_u32(core->abcd, cr.abcd); + core->efgh = vaddq_u32(core->efgh, cr.efgh); +} + +typedef struct sha256_neon { + sha256_neon_core core; + sha256_block blk; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha256_neon; + +static void sha256_neon_write(BinarySink *bs, const void *vp, size_t len); + +static ssh_hash *sha256_neon_new(const ssh_hashalg *alg) +{ + const struct sha256_extra *extra = (const struct sha256_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + sha256_neon *s = snew(sha256_neon); + + s->hash.vt = alg; + BinarySink_INIT(s, sha256_neon_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha256_neon_reset(ssh_hash *hash) +{ + sha256_neon *s = container_of(hash, sha256_neon, hash); + + s->core.abcd = vld1q_u32(sha256_initial_state); + s->core.efgh = vld1q_u32(sha256_initial_state + 4); + + sha256_block_setup(&s->blk); +} + +static void sha256_neon_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha256_neon *copy = container_of(hcopy, sha256_neon, hash); + sha256_neon *orig = container_of(horig, sha256_neon, hash); + + *copy = *orig; /* structure copy */ + + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha256_neon_free(ssh_hash *hash) +{ + sha256_neon *s = container_of(hash, sha256_neon, hash); + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void sha256_neon_write(BinarySink *bs, const void *vp, size_t len) +{ + sha256_neon *s = BinarySink_DOWNCAST(bs, sha256_neon); + + while (len > 0) + if (sha256_block_write(&s->blk, &vp, &len)) + sha256_neon_block(&s->core, s->blk.block); +} + +static void sha256_neon_digest(ssh_hash *hash, uint8_t *digest) +{ + sha256_neon *s = container_of(hash, sha256_neon, hash); + + sha256_block_pad(&s->blk, BinarySink_UPCAST(s)); + vst1q_u8(digest, vrev32q_u8(vreinterpretq_u8_u32(s->core.abcd))); + vst1q_u8(digest + 16, vrev32q_u8(vreinterpretq_u8_u32(s->core.efgh))); +} + +SHA256_VTABLE(neon, "NEON accelerated"); diff --git a/code/crypto/sha256-ni.c b/code/crypto/sha256-ni.c new file mode 100644 index 0000000..530fa43 --- /dev/null +++ b/code/crypto/sha256-ni.c @@ -0,0 +1,342 @@ +/* + * Hardware-accelerated implementation of SHA-256 using x86 SHA-NI. + */ + +#include "ssh.h" +#include "sha256.h" + +#include +#include +#include +#if HAVE_SHAINTRIN_H +#include +#endif + +#if defined(__clang__) || defined(__GNUC__) +#include +#define GET_CPU_ID_0(out) \ + __cpuid(0, (out)[0], (out)[1], (out)[2], (out)[3]) +#define GET_CPU_ID_7(out) \ + __cpuid_count(7, 0, (out)[0], (out)[1], (out)[2], (out)[3]) +#else +#define GET_CPU_ID_0(out) __cpuid(out, 0) +#define GET_CPU_ID_7(out) __cpuidex(out, 7, 0) +#endif + +static bool sha256_ni_available(void) +{ + unsigned int CPUInfo[4]; + GET_CPU_ID_0(CPUInfo); + if (CPUInfo[0] < 7) + return false; + + GET_CPU_ID_7(CPUInfo); + return CPUInfo[1] & (1 << 29); /* Check SHA */ +} + +/* SHA256 implementation using new instructions + The code is based on Jeffrey Walton's SHA256 implementation: + https://github.com/noloader/SHA-Intrinsics +*/ +static inline void sha256_ni_block(__m128i *core, const uint8_t *p) +{ + __m128i STATE0, STATE1; + __m128i MSG, TMP; + __m128i MSG0, MSG1, MSG2, MSG3; + const __m128i *block = (const __m128i *)p; + const __m128i MASK = _mm_set_epi64x( + 0x0c0d0e0f08090a0bULL, 0x0405060700010203ULL); + + /* Load initial values */ + STATE0 = core[0]; + STATE1 = core[1]; + + /* Rounds 0-3 */ + MSG = _mm_loadu_si128(block); + MSG0 = _mm_shuffle_epi8(MSG, MASK); + MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( + 0xE9B5DBA5B5C0FBCFULL, 0x71374491428A2F98ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + + /* Rounds 4-7 */ + MSG1 = _mm_loadu_si128(block + 1); + MSG1 = _mm_shuffle_epi8(MSG1, MASK); + MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( + 0xAB1C5ED5923F82A4ULL, 0x59F111F13956C25BULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG0 = _mm_sha256msg1_epu32(MSG0, MSG1); + + /* Rounds 8-11 */ + MSG2 = _mm_loadu_si128(block + 2); + MSG2 = _mm_shuffle_epi8(MSG2, MASK); + MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( + 0x550C7DC3243185BEULL, 0x12835B01D807AA98ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG1 = _mm_sha256msg1_epu32(MSG1, MSG2); + + /* Rounds 12-15 */ + MSG3 = _mm_loadu_si128(block + 3); + MSG3 = _mm_shuffle_epi8(MSG3, MASK); + MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( + 0xC19BF1749BDC06A7ULL, 0x80DEB1FE72BE5D74ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG3, MSG2, 4); + MSG0 = _mm_add_epi32(MSG0, TMP); + MSG0 = _mm_sha256msg2_epu32(MSG0, MSG3); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG2 = _mm_sha256msg1_epu32(MSG2, MSG3); + + /* Rounds 16-19 */ + MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( + 0x240CA1CC0FC19DC6ULL, 0xEFBE4786E49B69C1ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG0, MSG3, 4); + MSG1 = _mm_add_epi32(MSG1, TMP); + MSG1 = _mm_sha256msg2_epu32(MSG1, MSG0); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG3 = _mm_sha256msg1_epu32(MSG3, MSG0); + + /* Rounds 20-23 */ + MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( + 0x76F988DA5CB0A9DCULL, 0x4A7484AA2DE92C6FULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG1, MSG0, 4); + MSG2 = _mm_add_epi32(MSG2, TMP); + MSG2 = _mm_sha256msg2_epu32(MSG2, MSG1); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG0 = _mm_sha256msg1_epu32(MSG0, MSG1); + + /* Rounds 24-27 */ + MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( + 0xBF597FC7B00327C8ULL, 0xA831C66D983E5152ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG2, MSG1, 4); + MSG3 = _mm_add_epi32(MSG3, TMP); + MSG3 = _mm_sha256msg2_epu32(MSG3, MSG2); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG1 = _mm_sha256msg1_epu32(MSG1, MSG2); + + /* Rounds 28-31 */ + MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( + 0x1429296706CA6351ULL, 0xD5A79147C6E00BF3ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG3, MSG2, 4); + MSG0 = _mm_add_epi32(MSG0, TMP); + MSG0 = _mm_sha256msg2_epu32(MSG0, MSG3); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG2 = _mm_sha256msg1_epu32(MSG2, MSG3); + + /* Rounds 32-35 */ + MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( + 0x53380D134D2C6DFCULL, 0x2E1B213827B70A85ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG0, MSG3, 4); + MSG1 = _mm_add_epi32(MSG1, TMP); + MSG1 = _mm_sha256msg2_epu32(MSG1, MSG0); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG3 = _mm_sha256msg1_epu32(MSG3, MSG0); + + /* Rounds 36-39 */ + MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( + 0x92722C8581C2C92EULL, 0x766A0ABB650A7354ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG1, MSG0, 4); + MSG2 = _mm_add_epi32(MSG2, TMP); + MSG2 = _mm_sha256msg2_epu32(MSG2, MSG1); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG0 = _mm_sha256msg1_epu32(MSG0, MSG1); + + /* Rounds 40-43 */ + MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( + 0xC76C51A3C24B8B70ULL, 0xA81A664BA2BFE8A1ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG2, MSG1, 4); + MSG3 = _mm_add_epi32(MSG3, TMP); + MSG3 = _mm_sha256msg2_epu32(MSG3, MSG2); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG1 = _mm_sha256msg1_epu32(MSG1, MSG2); + + /* Rounds 44-47 */ + MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( + 0x106AA070F40E3585ULL, 0xD6990624D192E819ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG3, MSG2, 4); + MSG0 = _mm_add_epi32(MSG0, TMP); + MSG0 = _mm_sha256msg2_epu32(MSG0, MSG3); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG2 = _mm_sha256msg1_epu32(MSG2, MSG3); + + /* Rounds 48-51 */ + MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( + 0x34B0BCB52748774CULL, 0x1E376C0819A4C116ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG0, MSG3, 4); + MSG1 = _mm_add_epi32(MSG1, TMP); + MSG1 = _mm_sha256msg2_epu32(MSG1, MSG0); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + MSG3 = _mm_sha256msg1_epu32(MSG3, MSG0); + + /* Rounds 52-55 */ + MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( + 0x682E6FF35B9CCA4FULL, 0x4ED8AA4A391C0CB3ULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG1, MSG0, 4); + MSG2 = _mm_add_epi32(MSG2, TMP); + MSG2 = _mm_sha256msg2_epu32(MSG2, MSG1); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + + /* Rounds 56-59 */ + MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( + 0x8CC7020884C87814ULL, 0x78A5636F748F82EEULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + TMP = _mm_alignr_epi8(MSG2, MSG1, 4); + MSG3 = _mm_add_epi32(MSG3, TMP); + MSG3 = _mm_sha256msg2_epu32(MSG3, MSG2); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + + /* Rounds 60-63 */ + MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( + 0xC67178F2BEF9A3F7ULL, 0xA4506CEB90BEFFFAULL)); + STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); + MSG = _mm_shuffle_epi32(MSG, 0x0E); + STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); + + /* Combine state */ + core[0] = _mm_add_epi32(STATE0, core[0]); + core[1] = _mm_add_epi32(STATE1, core[1]); +} + +typedef struct sha256_ni { + /* + * These two vectors store the 8 words of the SHA-256 state, but + * not in the same order they appear in the spec: the first word + * holds A,B,E,F and the second word C,D,G,H. + */ + __m128i core[2]; + sha256_block blk; + void *pointer_to_free; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha256_ni; + +static void sha256_ni_write(BinarySink *bs, const void *vp, size_t len); + +static sha256_ni *sha256_ni_alloc(void) +{ + /* + * The __m128i variables in the context structure need to be + * 16-byte aligned, but not all malloc implementations that this + * code has to work with will guarantee to return a 16-byte + * aligned pointer. So we over-allocate, manually realign the + * pointer ourselves, and store the original one inside the + * context so we know how to free it later. + */ + void *allocation = smalloc(sizeof(sha256_ni) + 15); + uintptr_t alloc_address = (uintptr_t)allocation; + uintptr_t aligned_address = (alloc_address + 15) & ~15; + sha256_ni *s = (sha256_ni *)aligned_address; + s->pointer_to_free = allocation; + return s; +} + +static ssh_hash *sha256_ni_new(const ssh_hashalg *alg) +{ + const struct sha256_extra *extra = (const struct sha256_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + sha256_ni *s = sha256_ni_alloc(); + + s->hash.vt = alg; + BinarySink_INIT(s, sha256_ni_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + + return &s->hash; +} + +static void sha256_ni_reset(ssh_hash *hash) +{ + sha256_ni *s = container_of(hash, sha256_ni, hash); + + /* Initialise the core vectors in their storage order */ + s->core[0] = _mm_set_epi64x( + 0x6a09e667bb67ae85ULL, 0x510e527f9b05688cULL); + s->core[1] = _mm_set_epi64x( + 0x3c6ef372a54ff53aULL, 0x1f83d9ab5be0cd19ULL); + + sha256_block_setup(&s->blk); +} + +static void sha256_ni_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha256_ni *copy = container_of(hcopy, sha256_ni, hash); + sha256_ni *orig = container_of(horig, sha256_ni, hash); + + void *ptf_save = copy->pointer_to_free; + *copy = *orig; /* structure copy */ + copy->pointer_to_free = ptf_save; + + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha256_ni_free(ssh_hash *hash) +{ + sha256_ni *s = container_of(hash, sha256_ni, hash); + + void *ptf = s->pointer_to_free; + smemclr(s, sizeof(*s)); + sfree(ptf); +} + +static void sha256_ni_write(BinarySink *bs, const void *vp, size_t len) +{ + sha256_ni *s = BinarySink_DOWNCAST(bs, sha256_ni); + + while (len > 0) + if (sha256_block_write(&s->blk, &vp, &len)) + sha256_ni_block(s->core, s->blk.block); +} + +static void sha256_ni_digest(ssh_hash *hash, uint8_t *digest) +{ + sha256_ni *s = container_of(hash, sha256_ni, hash); + + sha256_block_pad(&s->blk, BinarySink_UPCAST(s)); + + /* Rearrange the words into the output order */ + __m128i feba = _mm_shuffle_epi32(s->core[0], 0x1B); + __m128i dchg = _mm_shuffle_epi32(s->core[1], 0xB1); + __m128i dcba = _mm_blend_epi16(feba, dchg, 0xF0); + __m128i hgfe = _mm_alignr_epi8(dchg, feba, 8); + + /* Byte-swap them into the output endianness */ + const __m128i mask = _mm_setr_epi8(3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12); + dcba = _mm_shuffle_epi8(dcba, mask); + hgfe = _mm_shuffle_epi8(hgfe, mask); + + /* And store them */ + __m128i *output = (__m128i *)digest; + _mm_storeu_si128(output, dcba); + _mm_storeu_si128(output+1, hgfe); +} + +SHA256_VTABLE(ni, "SHA-NI accelerated"); diff --git a/code/crypto/sha256-select.c b/code/crypto/sha256-select.c new file mode 100644 index 0000000..78e5b7e --- /dev/null +++ b/code/crypto/sha256-select.c @@ -0,0 +1,44 @@ +/* + * Top-level vtables to select a SHA-256 implementation. + */ + +#include +#include + +#include "putty.h" +#include "ssh.h" +#include "sha256.h" + +static ssh_hash *sha256_select(const ssh_hashalg *alg) +{ + static const ssh_hashalg *const real_algs[] = { +#if HAVE_SHA_NI + &ssh_sha256_ni, +#endif +#if HAVE_NEON_CRYPTO + &ssh_sha256_neon, +#endif + &ssh_sha256_sw, + NULL, + }; + + for (size_t i = 0; real_algs[i]; i++) { + const ssh_hashalg *alg = real_algs[i]; + const struct sha256_extra *alg_extra = + (const struct sha256_extra *)alg->extra; + if (check_availability(alg_extra)) + return ssh_hash_new(alg); + } + + /* We should never reach the NULL at the end of the list, because + * the last non-NULL entry should be software-only SHA-256, which + * is always available. */ + unreachable("sha256_select ran off the end of its list"); +} + +const ssh_hashalg ssh_sha256 = { + .new = sha256_select, + .hlen = 32, + .blocklen = 64, + HASHALG_NAMES_ANNOTATED("SHA-256", "dummy selector vtable"), +}; diff --git a/code/crypto/sha256-sw.c b/code/crypto/sha256-sw.c new file mode 100644 index 0000000..82a116c --- /dev/null +++ b/code/crypto/sha256-sw.c @@ -0,0 +1,157 @@ +/* + * Software implementation of SHA-256. + */ + +#include "ssh.h" +#include "sha256.h" + +static bool sha256_sw_available(void) +{ + /* Software SHA-256 is always available */ + return true; +} + +static inline uint32_t ror(uint32_t x, unsigned y) +{ + return (x << (31 & -y)) | (x >> (31 & y)); +} + +static inline uint32_t Ch(uint32_t ctrl, uint32_t if1, uint32_t if0) +{ + return if0 ^ (ctrl & (if1 ^ if0)); +} + +static inline uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) +{ + return (x & y) | (z & (x | y)); +} + +static inline uint32_t Sigma_0(uint32_t x) +{ + return ror(x,2) ^ ror(x,13) ^ ror(x,22); +} + +static inline uint32_t Sigma_1(uint32_t x) +{ + return ror(x,6) ^ ror(x,11) ^ ror(x,25); +} + +static inline uint32_t sigma_0(uint32_t x) +{ + return ror(x,7) ^ ror(x,18) ^ (x >> 3); +} + +static inline uint32_t sigma_1(uint32_t x) +{ + return ror(x,17) ^ ror(x,19) ^ (x >> 10); +} + +static inline void sha256_sw_round( + unsigned round_index, const uint32_t *schedule, + uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, + uint32_t *e, uint32_t *f, uint32_t *g, uint32_t *h) +{ + uint32_t t1 = *h + Sigma_1(*e) + Ch(*e,*f,*g) + + sha256_round_constants[round_index] + schedule[round_index]; + + uint32_t t2 = Sigma_0(*a) + Maj(*a,*b,*c); + + *d += t1; + *h = t1 + t2; +} + +static void sha256_sw_block(uint32_t *core, const uint8_t *block) +{ + uint32_t w[SHA256_ROUNDS]; + uint32_t a,b,c,d,e,f,g,h; + + for (size_t t = 0; t < 16; t++) + w[t] = GET_32BIT_MSB_FIRST(block + 4*t); + + for (size_t t = 16; t < SHA256_ROUNDS; t++) + w[t] = sigma_1(w[t-2]) + w[t-7] + sigma_0(w[t-15]) + w[t-16]; + + a = core[0]; b = core[1]; c = core[2]; d = core[3]; + e = core[4]; f = core[5]; g = core[6]; h = core[7]; + + for (size_t t = 0; t < SHA256_ROUNDS; t += 8) { + sha256_sw_round(t+0, w, &a,&b,&c,&d,&e,&f,&g,&h); + sha256_sw_round(t+1, w, &h,&a,&b,&c,&d,&e,&f,&g); + sha256_sw_round(t+2, w, &g,&h,&a,&b,&c,&d,&e,&f); + sha256_sw_round(t+3, w, &f,&g,&h,&a,&b,&c,&d,&e); + sha256_sw_round(t+4, w, &e,&f,&g,&h,&a,&b,&c,&d); + sha256_sw_round(t+5, w, &d,&e,&f,&g,&h,&a,&b,&c); + sha256_sw_round(t+6, w, &c,&d,&e,&f,&g,&h,&a,&b); + sha256_sw_round(t+7, w, &b,&c,&d,&e,&f,&g,&h,&a); + } + + core[0] += a; core[1] += b; core[2] += c; core[3] += d; + core[4] += e; core[5] += f; core[6] += g; core[7] += h; + + smemclr(w, sizeof(w)); +} + +typedef struct sha256_sw { + uint32_t core[8]; + sha256_block blk; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha256_sw; + +static void sha256_sw_write(BinarySink *bs, const void *vp, size_t len); + +static ssh_hash *sha256_sw_new(const ssh_hashalg *alg) +{ + sha256_sw *s = snew(sha256_sw); + + s->hash.vt = alg; + BinarySink_INIT(s, sha256_sw_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha256_sw_reset(ssh_hash *hash) +{ + sha256_sw *s = container_of(hash, sha256_sw, hash); + + memcpy(s->core, sha256_initial_state, sizeof(s->core)); + sha256_block_setup(&s->blk); +} + +static void sha256_sw_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha256_sw *copy = container_of(hcopy, sha256_sw, hash); + sha256_sw *orig = container_of(horig, sha256_sw, hash); + + memcpy(copy, orig, sizeof(*copy)); + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha256_sw_free(ssh_hash *hash) +{ + sha256_sw *s = container_of(hash, sha256_sw, hash); + + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void sha256_sw_write(BinarySink *bs, const void *vp, size_t len) +{ + sha256_sw *s = BinarySink_DOWNCAST(bs, sha256_sw); + + while (len > 0) + if (sha256_block_write(&s->blk, &vp, &len)) + sha256_sw_block(s->core, s->blk.block); +} + +static void sha256_sw_digest(ssh_hash *hash, uint8_t *digest) +{ + sha256_sw *s = container_of(hash, sha256_sw, hash); + + sha256_block_pad(&s->blk, BinarySink_UPCAST(s)); + for (size_t i = 0; i < 8; i++) + PUT_32BIT_MSB_FIRST(digest + 4*i, s->core[i]); +} + +SHA256_VTABLE(sw, "unaccelerated"); diff --git a/code/crypto/sha256.h b/code/crypto/sha256.h new file mode 100644 index 0000000..e6ca756 --- /dev/null +++ b/code/crypto/sha256.h @@ -0,0 +1,105 @@ +/* + * Definitions likely to be helpful to multiple SHA-256 implementations. + */ + +/* + * The 'extra' structure used by SHA-256 implementations is used to + * include information about how to check if a given implementation is + * available at run time, and whether we've already checked. + */ +struct sha256_extra_mutable; +struct sha256_extra { + /* Function to check availability. Might be expensive, so we don't + * want to call it more than once. */ + bool (*check_available)(void); + + /* Point to a writable substructure. */ + struct sha256_extra_mutable *mut; +}; +struct sha256_extra_mutable { + bool checked_availability; + bool is_available; +}; +static inline bool check_availability(const struct sha256_extra *extra) +{ + if (!extra->mut->checked_availability) { + extra->mut->is_available = extra->check_available(); + extra->mut->checked_availability = true; + } + + return extra->mut->is_available; +} + +/* + * Macro to define a SHA-256 vtable together with its 'extra' + * structure. + */ +#define SHA256_VTABLE(impl_c, impl_display) \ + static struct sha256_extra_mutable sha256_ ## impl_c ## _extra_mut; \ + static const struct sha256_extra sha256_ ## impl_c ## _extra = { \ + .check_available = sha256_ ## impl_c ## _available, \ + .mut = &sha256_ ## impl_c ## _extra_mut, \ + }; \ + const ssh_hashalg ssh_sha256_ ## impl_c = { \ + .new = sha256_ ## impl_c ## _new, \ + .reset = sha256_ ## impl_c ## _reset, \ + .copyfrom = sha256_ ## impl_c ## _copyfrom, \ + .digest = sha256_ ## impl_c ## _digest, \ + .free = sha256_ ## impl_c ## _free, \ + .hlen = 32, \ + .blocklen = 64, \ + HASHALG_NAMES_ANNOTATED("SHA-256", impl_display), \ + .extra = &sha256_ ## impl_c ## _extra, \ + } + +extern const uint32_t sha256_initial_state[8]; +extern const uint32_t sha256_round_constants[64]; + +#define SHA256_ROUNDS 64 + +typedef struct sha256_block sha256_block; +struct sha256_block { + uint8_t block[64]; + size_t used; + uint64_t len; +}; + +static inline void sha256_block_setup(sha256_block *blk) +{ + blk->used = 0; + blk->len = 0; +} + +static inline bool sha256_block_write( + sha256_block *blk, const void **vdata, size_t *len) +{ + size_t blkleft = sizeof(blk->block) - blk->used; + size_t chunk = *len < blkleft ? *len : blkleft; + + const uint8_t *p = *vdata; + memcpy(blk->block + blk->used, p, chunk); + *vdata = p + chunk; + *len -= chunk; + blk->used += chunk; + blk->len += chunk; + + if (blk->used == sizeof(blk->block)) { + blk->used = 0; + return true; + } + + return false; +} + +static inline void sha256_block_pad(sha256_block *blk, BinarySink *bs) +{ + uint64_t final_len = blk->len << 3; + size_t pad = 1 + (63 & (55 - blk->used)); + + put_byte(bs, 0x80); + for (size_t i = 1; i < pad; i++) + put_byte(bs, 0); + put_uint64(bs, final_len); + + assert(blk->used == 0 && "Should have exactly hit a block boundary"); +} diff --git a/code/sshsha3.c b/code/crypto/sha3.c similarity index 100% rename from code/sshsha3.c rename to code/crypto/sha3.c diff --git a/code/crypto/sha512-common.c b/code/crypto/sha512-common.c new file mode 100644 index 0000000..89ac136 --- /dev/null +++ b/code/crypto/sha512-common.c @@ -0,0 +1,71 @@ +/* + * Common variable definitions across all the SHA-512 implementations. + */ + +#include "ssh.h" +#include "sha512.h" + +const uint64_t sha512_initial_state[8] = { + 0x6a09e667f3bcc908ULL, + 0xbb67ae8584caa73bULL, + 0x3c6ef372fe94f82bULL, + 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, + 0x9b05688c2b3e6c1fULL, + 0x1f83d9abfb41bd6bULL, + 0x5be0cd19137e2179ULL, +}; + +const uint64_t sha384_initial_state[8] = { + 0xcbbb9d5dc1059ed8ULL, + 0x629a292a367cd507ULL, + 0x9159015a3070dd17ULL, + 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, + 0x8eb44a8768581511ULL, + 0xdb0c2e0d64f98fa7ULL, + 0x47b5481dbefa4fa4ULL, +}; + +const uint64_t sha512_round_constants[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL, +}; diff --git a/code/crypto/sha512-neon.c b/code/crypto/sha512-neon.c new file mode 100644 index 0000000..849a79d --- /dev/null +++ b/code/crypto/sha512-neon.c @@ -0,0 +1,329 @@ +/* + * Hardware-accelerated implementation of SHA-512 using Arm NEON. + */ + +#include "ssh.h" +#include "sha512.h" + +#if USE_ARM64_NEON_H +#include +#else +#include +#endif + +static bool sha512_neon_available(void) +{ + /* + * For Arm, we delegate to a per-platform detection function (see + * explanation in aes-neon.c). + */ + return platform_sha512_neon_available(); +} + +#if !HAVE_NEON_SHA512_INTRINSICS +/* + * clang 12 and before do not provide the SHA-512 NEON intrinsics, but + * do provide assembler support for the underlying instructions. So I + * define the intrinsic functions myself, using inline assembler. + */ +static inline uint64x2_t vsha512su0q_u64(uint64x2_t x, uint64x2_t y) +{ + __asm__("sha512su0 %0.2D,%1.2D" : "+w" (x) : "w" (y)); + return x; +} +static inline uint64x2_t vsha512su1q_u64(uint64x2_t x, uint64x2_t y, + uint64x2_t z) +{ + __asm__("sha512su1 %0.2D,%1.2D,%2.2D" : "+w" (x) : "w" (y), "w" (z)); + return x; +} +static inline uint64x2_t vsha512hq_u64(uint64x2_t x, uint64x2_t y, + uint64x2_t z) +{ + __asm__("sha512h %0,%1,%2.2D" : "+w" (x) : "w" (y), "w" (z)); + return x; +} +static inline uint64x2_t vsha512h2q_u64(uint64x2_t x, uint64x2_t y, + uint64x2_t z) +{ + __asm__("sha512h2 %0,%1,%2.2D" : "+w" (x) : "w" (y), "w" (z)); + return x; +} +#endif /* HAVE_NEON_SHA512_INTRINSICS */ + +typedef struct sha512_neon_core sha512_neon_core; +struct sha512_neon_core { + uint64x2_t ab, cd, ef, gh; +}; + +static inline uint64x2_t sha512_neon_load_input(const uint8_t *p) +{ + return vreinterpretq_u64_u8(vrev64q_u8(vld1q_u8(p))); +} + +static inline uint64x2_t sha512_neon_schedule_update( + uint64x2_t m8, uint64x2_t m7, uint64x2_t m4, uint64x2_t m3, uint64x2_t m1) +{ + /* + * vsha512su0q_u64() takes words from a long way back in the + * schedule and performs the sigma_0 half of the computation of + * the next two 64-bit message-schedule words. + * + * vsha512su1q_u64() combines the result of that with the sigma_1 + * steps, to output the finished version of those two words. The + * total amount of input data it requires fits nicely into three + * 128-bit vector registers, but one of those registers is + * misaligned compared to the 128-bit chunks that the message + * schedule is stored in. So we use vextq_u64 to make one of its + * input words out of the second half of m4 and the first half of + * m3. + */ + return vsha512su1q_u64(vsha512su0q_u64(m8, m7), m1, vextq_u64(m4, m3, 1)); +} + +static inline void sha512_neon_round2( + unsigned round_index, uint64x2_t schedule_words, + uint64x2_t *ab, uint64x2_t *cd, uint64x2_t *ef, uint64x2_t *gh) +{ + /* + * vsha512hq_u64 performs the Sigma_1 and Ch half of the + * computation of two rounds of SHA-512 (including feeding back + * one of the outputs from the first of those half-rounds into the + * second one). + * + * vsha512h2q_u64 combines the result of that with the Sigma_0 and + * Maj steps, and outputs one 128-bit vector that replaces the gh + * piece of the input hash state, and a second that updates cd by + * addition. + * + * Similarly to vsha512su1q_u64 above, some of the input registers + * expected by these instructions are misaligned by 64 bits + * relative to the chunks we've divided the hash state into, so we + * have to start by making 'de' and 'fg' words out of our input + * cd,ef,gh, using vextq_u64. + * + * Also, one of the inputs to vsha512hq_u64 is expected to contain + * the results of summing gh + two round constants + two words of + * message schedule, but the two words of the message schedule + * have to be the opposite way round in the vector register from + * the way that vsha512su1q_u64 output them. Hence, there's + * another vextq_u64 in here that swaps the two halves of the + * initial_sum vector register. + * + * (This also means that I don't have to prepare a specially + * reordered version of the sha512_round_constants[] array: as + * long as I'm unavoidably doing a swap at run time _anyway_, I + * can load from the normally ordered version of that array, and + * just take care to fold in that data _before_ the swap rather + * than after.) + */ + + /* Load two round constants, with the first one in the low half */ + uint64x2_t round_constants = vld1q_u64( + sha512_round_constants + round_index); + + /* Add schedule words to round constants */ + uint64x2_t initial_sum = vaddq_u64(schedule_words, round_constants); + + /* Swap that sum around so the word used in the first of the two + * rounds is in the _high_ half of the vector, matching where h + * lives in the gh vector */ + uint64x2_t swapped_initial_sum = vextq_u64(initial_sum, initial_sum, 1); + + /* Add gh to that, now that they're matching ways round */ + uint64x2_t sum = vaddq_u64(swapped_initial_sum, *gh); + + /* Make the misaligned de and fg words */ + uint64x2_t de = vextq_u64(*cd, *ef, 1); + uint64x2_t fg = vextq_u64(*ef, *gh, 1); + + /* Now we're ready to put all the pieces together. The output from + * vsha512h2q_u64 can be used directly as the new gh, and the + * output from vsha512hq_u64 is simultaneously the intermediate + * value passed to h2 and the thing you have to add on to cd. */ + uint64x2_t intermed = vsha512hq_u64(sum, fg, de); + *gh = vsha512h2q_u64(intermed, *cd, *ab); + *cd = vaddq_u64(*cd, intermed); +} + +static inline void sha512_neon_block(sha512_neon_core *core, const uint8_t *p) +{ + uint64x2_t s0, s1, s2, s3, s4, s5, s6, s7; + + uint64x2_t ab = core->ab, cd = core->cd, ef = core->ef, gh = core->gh; + + s0 = sha512_neon_load_input(p + 16*0); + sha512_neon_round2(0, s0, &ab, &cd, &ef, &gh); + s1 = sha512_neon_load_input(p + 16*1); + sha512_neon_round2(2, s1, &gh, &ab, &cd, &ef); + s2 = sha512_neon_load_input(p + 16*2); + sha512_neon_round2(4, s2, &ef, &gh, &ab, &cd); + s3 = sha512_neon_load_input(p + 16*3); + sha512_neon_round2(6, s3, &cd, &ef, &gh, &ab); + s4 = sha512_neon_load_input(p + 16*4); + sha512_neon_round2(8, s4, &ab, &cd, &ef, &gh); + s5 = sha512_neon_load_input(p + 16*5); + sha512_neon_round2(10, s5, &gh, &ab, &cd, &ef); + s6 = sha512_neon_load_input(p + 16*6); + sha512_neon_round2(12, s6, &ef, &gh, &ab, &cd); + s7 = sha512_neon_load_input(p + 16*7); + sha512_neon_round2(14, s7, &cd, &ef, &gh, &ab); + s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); + sha512_neon_round2(16, s0, &ab, &cd, &ef, &gh); + s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); + sha512_neon_round2(18, s1, &gh, &ab, &cd, &ef); + s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); + sha512_neon_round2(20, s2, &ef, &gh, &ab, &cd); + s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); + sha512_neon_round2(22, s3, &cd, &ef, &gh, &ab); + s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); + sha512_neon_round2(24, s4, &ab, &cd, &ef, &gh); + s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); + sha512_neon_round2(26, s5, &gh, &ab, &cd, &ef); + s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); + sha512_neon_round2(28, s6, &ef, &gh, &ab, &cd); + s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); + sha512_neon_round2(30, s7, &cd, &ef, &gh, &ab); + s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); + sha512_neon_round2(32, s0, &ab, &cd, &ef, &gh); + s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); + sha512_neon_round2(34, s1, &gh, &ab, &cd, &ef); + s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); + sha512_neon_round2(36, s2, &ef, &gh, &ab, &cd); + s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); + sha512_neon_round2(38, s3, &cd, &ef, &gh, &ab); + s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); + sha512_neon_round2(40, s4, &ab, &cd, &ef, &gh); + s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); + sha512_neon_round2(42, s5, &gh, &ab, &cd, &ef); + s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); + sha512_neon_round2(44, s6, &ef, &gh, &ab, &cd); + s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); + sha512_neon_round2(46, s7, &cd, &ef, &gh, &ab); + s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); + sha512_neon_round2(48, s0, &ab, &cd, &ef, &gh); + s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); + sha512_neon_round2(50, s1, &gh, &ab, &cd, &ef); + s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); + sha512_neon_round2(52, s2, &ef, &gh, &ab, &cd); + s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); + sha512_neon_round2(54, s3, &cd, &ef, &gh, &ab); + s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); + sha512_neon_round2(56, s4, &ab, &cd, &ef, &gh); + s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); + sha512_neon_round2(58, s5, &gh, &ab, &cd, &ef); + s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); + sha512_neon_round2(60, s6, &ef, &gh, &ab, &cd); + s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); + sha512_neon_round2(62, s7, &cd, &ef, &gh, &ab); + s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); + sha512_neon_round2(64, s0, &ab, &cd, &ef, &gh); + s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); + sha512_neon_round2(66, s1, &gh, &ab, &cd, &ef); + s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); + sha512_neon_round2(68, s2, &ef, &gh, &ab, &cd); + s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); + sha512_neon_round2(70, s3, &cd, &ef, &gh, &ab); + s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); + sha512_neon_round2(72, s4, &ab, &cd, &ef, &gh); + s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); + sha512_neon_round2(74, s5, &gh, &ab, &cd, &ef); + s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); + sha512_neon_round2(76, s6, &ef, &gh, &ab, &cd); + s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); + sha512_neon_round2(78, s7, &cd, &ef, &gh, &ab); + + core->ab = vaddq_u64(core->ab, ab); + core->cd = vaddq_u64(core->cd, cd); + core->ef = vaddq_u64(core->ef, ef); + core->gh = vaddq_u64(core->gh, gh); +} + +typedef struct sha512_neon { + sha512_neon_core core; + sha512_block blk; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha512_neon; + +static void sha512_neon_write(BinarySink *bs, const void *vp, size_t len); + +static ssh_hash *sha512_neon_new(const ssh_hashalg *alg) +{ + const struct sha512_extra *extra = (const struct sha512_extra *)alg->extra; + if (!check_availability(extra)) + return NULL; + + sha512_neon *s = snew(sha512_neon); + + s->hash.vt = alg; + BinarySink_INIT(s, sha512_neon_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha512_neon_reset(ssh_hash *hash) +{ + sha512_neon *s = container_of(hash, sha512_neon, hash); + const struct sha512_extra *extra = + (const struct sha512_extra *)hash->vt->extra; + + s->core.ab = vld1q_u64(extra->initial_state); + s->core.cd = vld1q_u64(extra->initial_state+2); + s->core.ef = vld1q_u64(extra->initial_state+4); + s->core.gh = vld1q_u64(extra->initial_state+6); + + sha512_block_setup(&s->blk); +} + +static void sha512_neon_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha512_neon *copy = container_of(hcopy, sha512_neon, hash); + sha512_neon *orig = container_of(horig, sha512_neon, hash); + + *copy = *orig; /* structure copy */ + + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha512_neon_free(ssh_hash *hash) +{ + sha512_neon *s = container_of(hash, sha512_neon, hash); + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void sha512_neon_write(BinarySink *bs, const void *vp, size_t len) +{ + sha512_neon *s = BinarySink_DOWNCAST(bs, sha512_neon); + + while (len > 0) + if (sha512_block_write(&s->blk, &vp, &len)) + sha512_neon_block(&s->core, s->blk.block); +} + +static void sha512_neon_digest(ssh_hash *hash, uint8_t *digest) +{ + sha512_neon *s = container_of(hash, sha512_neon, hash); + + sha512_block_pad(&s->blk, BinarySink_UPCAST(s)); + + vst1q_u8(digest, vrev64q_u8(vreinterpretq_u8_u64(s->core.ab))); + vst1q_u8(digest+16, vrev64q_u8(vreinterpretq_u8_u64(s->core.cd))); + vst1q_u8(digest+32, vrev64q_u8(vreinterpretq_u8_u64(s->core.ef))); + vst1q_u8(digest+48, vrev64q_u8(vreinterpretq_u8_u64(s->core.gh))); +} + +static void sha384_neon_digest(ssh_hash *hash, uint8_t *digest) +{ + sha512_neon *s = container_of(hash, sha512_neon, hash); + + sha512_block_pad(&s->blk, BinarySink_UPCAST(s)); + + vst1q_u8(digest, vrev64q_u8(vreinterpretq_u8_u64(s->core.ab))); + vst1q_u8(digest+16, vrev64q_u8(vreinterpretq_u8_u64(s->core.cd))); + vst1q_u8(digest+32, vrev64q_u8(vreinterpretq_u8_u64(s->core.ef))); +} + +SHA512_VTABLES(neon, "NEON accelerated"); diff --git a/code/crypto/sha512-select.c b/code/crypto/sha512-select.c new file mode 100644 index 0000000..ecd567b --- /dev/null +++ b/code/crypto/sha512-select.c @@ -0,0 +1,61 @@ +/* + * Top-level vtables to select a SHA-512 implementation. + */ + +#include +#include + +#include "putty.h" +#include "ssh.h" +#include "sha512.h" + +static const ssh_hashalg *const real_sha512_algs[] = { +#if HAVE_NEON_SHA512 + &ssh_sha512_neon, +#endif + &ssh_sha512_sw, + NULL, +}; + +static const ssh_hashalg *const real_sha384_algs[] = { +#if HAVE_NEON_SHA512 + &ssh_sha384_neon, +#endif + &ssh_sha384_sw, + NULL, +}; + +static ssh_hash *sha512_select(const ssh_hashalg *alg) +{ + const ssh_hashalg *const *real_algs = + (const ssh_hashalg *const *)alg->extra; + + for (size_t i = 0; real_algs[i]; i++) { + const ssh_hashalg *alg = real_algs[i]; + const struct sha512_extra *alg_extra = + (const struct sha512_extra *)alg->extra; + if (check_availability(alg_extra)) + return ssh_hash_new(alg); + } + + /* We should never reach the NULL at the end of the list, because + * the last non-NULL entry should be software-only SHA-512, which + * is always available. */ + unreachable("sha512_select ran off the end of its list"); +} + +const ssh_hashalg ssh_sha512 = { + .new = sha512_select, + .hlen = 64, + .blocklen = 128, + HASHALG_NAMES_ANNOTATED("SHA-512", "dummy selector vtable"), + .extra = real_sha512_algs, +}; + +const ssh_hashalg ssh_sha384 = { + .new = sha512_select, + .hlen = 48, + .blocklen = 128, + HASHALG_NAMES_ANNOTATED("SHA-384", "dummy selector vtable"), + .extra = real_sha384_algs, +}; diff --git a/code/crypto/sha512-sw.c b/code/crypto/sha512-sw.c new file mode 100644 index 0000000..9e47bbb --- /dev/null +++ b/code/crypto/sha512-sw.c @@ -0,0 +1,168 @@ +/* + * Software implementation of SHA-512. + */ + +#include "ssh.h" +#include "sha512.h" + +static bool sha512_sw_available(void) +{ + /* Software SHA-512 is always available */ + return true; +} + +static inline uint64_t ror(uint64_t x, unsigned y) +{ + return (x << (63 & -y)) | (x >> (63 & y)); +} + +static inline uint64_t Ch(uint64_t ctrl, uint64_t if1, uint64_t if0) +{ + return if0 ^ (ctrl & (if1 ^ if0)); +} + +static inline uint64_t Maj(uint64_t x, uint64_t y, uint64_t z) +{ + return (x & y) | (z & (x | y)); +} + +static inline uint64_t Sigma_0(uint64_t x) +{ + return ror(x,28) ^ ror(x,34) ^ ror(x,39); +} + +static inline uint64_t Sigma_1(uint64_t x) +{ + return ror(x,14) ^ ror(x,18) ^ ror(x,41); +} + +static inline uint64_t sigma_0(uint64_t x) +{ + return ror(x,1) ^ ror(x,8) ^ (x >> 7); +} + +static inline uint64_t sigma_1(uint64_t x) +{ + return ror(x,19) ^ ror(x,61) ^ (x >> 6); +} + +static inline void sha512_sw_round( + unsigned round_index, const uint64_t *schedule, + uint64_t *a, uint64_t *b, uint64_t *c, uint64_t *d, + uint64_t *e, uint64_t *f, uint64_t *g, uint64_t *h) +{ + uint64_t t1 = *h + Sigma_1(*e) + Ch(*e,*f,*g) + + sha512_round_constants[round_index] + schedule[round_index]; + + uint64_t t2 = Sigma_0(*a) + Maj(*a,*b,*c); + + *d += t1; + *h = t1 + t2; +} + +static void sha512_sw_block(uint64_t *core, const uint8_t *block) +{ + uint64_t w[SHA512_ROUNDS]; + uint64_t a,b,c,d,e,f,g,h; + + int t; + + for (t = 0; t < 16; t++) + w[t] = GET_64BIT_MSB_FIRST(block + 8*t); + + for (t = 16; t < SHA512_ROUNDS; t++) + w[t] = w[t-16] + w[t-7] + sigma_0(w[t-15]) + sigma_1(w[t-2]); + + a = core[0]; b = core[1]; c = core[2]; d = core[3]; + e = core[4]; f = core[5]; g = core[6]; h = core[7]; + + for (t = 0; t < SHA512_ROUNDS; t+=8) { + sha512_sw_round(t+0, w, &a,&b,&c,&d,&e,&f,&g,&h); + sha512_sw_round(t+1, w, &h,&a,&b,&c,&d,&e,&f,&g); + sha512_sw_round(t+2, w, &g,&h,&a,&b,&c,&d,&e,&f); + sha512_sw_round(t+3, w, &f,&g,&h,&a,&b,&c,&d,&e); + sha512_sw_round(t+4, w, &e,&f,&g,&h,&a,&b,&c,&d); + sha512_sw_round(t+5, w, &d,&e,&f,&g,&h,&a,&b,&c); + sha512_sw_round(t+6, w, &c,&d,&e,&f,&g,&h,&a,&b); + sha512_sw_round(t+7, w, &b,&c,&d,&e,&f,&g,&h,&a); + } + + core[0] += a; core[1] += b; core[2] += c; core[3] += d; + core[4] += e; core[5] += f; core[6] += g; core[7] += h; + + smemclr(w, sizeof(w)); +} + +typedef struct sha512_sw { + uint64_t core[8]; + sha512_block blk; + BinarySink_IMPLEMENTATION; + ssh_hash hash; +} sha512_sw; + +static void sha512_sw_write(BinarySink *bs, const void *vp, size_t len); + +static ssh_hash *sha512_sw_new(const ssh_hashalg *alg) +{ + sha512_sw *s = snew(sha512_sw); + + s->hash.vt = alg; + BinarySink_INIT(s, sha512_sw_write); + BinarySink_DELEGATE_INIT(&s->hash, s); + return &s->hash; +} + +static void sha512_sw_reset(ssh_hash *hash) +{ + sha512_sw *s = container_of(hash, sha512_sw, hash); + const struct sha512_extra *extra = + (const struct sha512_extra *)hash->vt->extra; + + memcpy(s->core, extra->initial_state, sizeof(s->core)); + sha512_block_setup(&s->blk); +} + +static void sha512_sw_copyfrom(ssh_hash *hcopy, ssh_hash *horig) +{ + sha512_sw *copy = container_of(hcopy, sha512_sw, hash); + sha512_sw *orig = container_of(horig, sha512_sw, hash); + + memcpy(copy, orig, sizeof(*copy)); + BinarySink_COPIED(copy); + BinarySink_DELEGATE_INIT(©->hash, copy); +} + +static void sha512_sw_free(ssh_hash *hash) +{ + sha512_sw *s = container_of(hash, sha512_sw, hash); + + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void sha512_sw_write(BinarySink *bs, const void *vp, size_t len) +{ + sha512_sw *s = BinarySink_DOWNCAST(bs, sha512_sw); + + while (len > 0) + if (sha512_block_write(&s->blk, &vp, &len)) + sha512_sw_block(s->core, s->blk.block); +} + +static void sha512_sw_digest(ssh_hash *hash, uint8_t *digest) +{ + sha512_sw *s = container_of(hash, sha512_sw, hash); + + sha512_block_pad(&s->blk, BinarySink_UPCAST(s)); + for (size_t i = 0; i < hash->vt->hlen / 8; i++) + PUT_64BIT_MSB_FIRST(digest + 8*i, s->core[i]); +} + +/* + * This implementation doesn't need separate digest methods for + * SHA-384 and SHA-512, because the above implementation reads the + * hash length out of the vtable. + */ +#define sha384_sw_digest sha512_sw_digest + +SHA512_VTABLES(sw, "unaccelerated"); diff --git a/code/crypto/sha512.h b/code/crypto/sha512.h new file mode 100644 index 0000000..9814555 --- /dev/null +++ b/code/crypto/sha512.h @@ -0,0 +1,131 @@ +/* + * Definitions likely to be helpful to multiple SHA-512 implementations. + */ + +/* + * The 'extra' structure used by SHA-512 implementations is used to + * include information about how to check if a given implementation is + * available at run time, and whether we've already checked. + */ +struct sha512_extra_mutable; +struct sha512_extra { + /* Pointer to the initial state (distinguishes SHA-384 from -512) */ + const uint64_t *initial_state; + + /* Function to check availability. Might be expensive, so we don't + * want to call it more than once. */ + bool (*check_available)(void); + + /* Point to a writable substructure. */ + struct sha512_extra_mutable *mut; +}; +struct sha512_extra_mutable { + bool checked_availability; + bool is_available; +}; +static inline bool check_availability(const struct sha512_extra *extra) +{ + if (!extra->mut->checked_availability) { + extra->mut->is_available = extra->check_available(); + extra->mut->checked_availability = true; + } + + return extra->mut->is_available; +} + +/* + * Macro to define a pair of SHA-{384,512} vtables together with their + * 'extra' structure. + */ +#define SHA512_VTABLES(impl_c, impl_display) \ + static struct sha512_extra_mutable sha512_ ## impl_c ## _extra_mut; \ + static const struct sha512_extra sha384_ ## impl_c ## _extra = { \ + .initial_state = sha384_initial_state, \ + .check_available = sha512_ ## impl_c ## _available, \ + .mut = &sha512_ ## impl_c ## _extra_mut, \ + }; \ + static const struct sha512_extra sha512_ ## impl_c ## _extra = { \ + .initial_state = sha512_initial_state, \ + .check_available = sha512_ ## impl_c ## _available, \ + .mut = &sha512_ ## impl_c ## _extra_mut, \ + }; \ + const ssh_hashalg ssh_sha384_ ## impl_c = { \ + .new = sha512_ ## impl_c ## _new, \ + .reset = sha512_ ## impl_c ## _reset, \ + .copyfrom = sha512_ ## impl_c ## _copyfrom, \ + .digest = sha384_ ## impl_c ## _digest, \ + .free = sha512_ ## impl_c ## _free, \ + .hlen = 48, \ + .blocklen = 128, \ + HASHALG_NAMES_ANNOTATED("SHA-384", impl_display), \ + .extra = &sha384_ ## impl_c ## _extra, \ + }; \ + const ssh_hashalg ssh_sha512_ ## impl_c = { \ + .new = sha512_ ## impl_c ## _new, \ + .reset = sha512_ ## impl_c ## _reset, \ + .copyfrom = sha512_ ## impl_c ## _copyfrom, \ + .digest = sha512_ ## impl_c ## _digest, \ + .free = sha512_ ## impl_c ## _free, \ + .hlen = 64, \ + .blocklen = 128, \ + HASHALG_NAMES_ANNOTATED("SHA-512", impl_display), \ + .extra = &sha512_ ## impl_c ## _extra, \ + } + +extern const uint64_t sha512_initial_state[8]; +extern const uint64_t sha384_initial_state[8]; +extern const uint64_t sha512_round_constants[80]; + +#define SHA512_ROUNDS 80 + +typedef struct sha512_block sha512_block; +struct sha512_block { + uint8_t block[128]; + size_t used; + uint64_t lenhi, lenlo; +}; + +static inline void sha512_block_setup(sha512_block *blk) +{ + blk->used = 0; + blk->lenhi = blk->lenlo = 0; +} + +static inline bool sha512_block_write( + sha512_block *blk, const void **vdata, size_t *len) +{ + size_t blkleft = sizeof(blk->block) - blk->used; + size_t chunk = *len < blkleft ? *len : blkleft; + + const uint8_t *p = *vdata; + memcpy(blk->block + blk->used, p, chunk); + *vdata = p + chunk; + *len -= chunk; + blk->used += chunk; + + size_t chunkbits = chunk << 3; + + blk->lenlo += chunkbits; + blk->lenhi += (blk->lenlo < chunkbits); + + if (blk->used == sizeof(blk->block)) { + blk->used = 0; + return true; + } + + return false; +} + +static inline void sha512_block_pad(sha512_block *blk, BinarySink *bs) +{ + uint64_t final_lenhi = blk->lenhi; + uint64_t final_lenlo = blk->lenlo; + size_t pad = 127 & (111 - blk->used); + + put_byte(bs, 0x80); + put_padding(bs, pad, 0); + put_uint64(bs, final_lenhi); + put_uint64(bs, final_lenlo); + + assert(blk->used == 0 && "Should have exactly hit a block boundary"); +} diff --git a/code/crypto/xdmauth.c b/code/crypto/xdmauth.c new file mode 100644 index 0000000..86339b8 --- /dev/null +++ b/code/crypto/xdmauth.c @@ -0,0 +1,53 @@ +/* + * Convenience functions to encrypt and decrypt the cookies used in + * XDM-AUTHORIZATION-1. + */ + +#include "ssh.h" + +static ssh_cipher *des_xdmauth_cipher(const void *vkeydata) +{ + /* + * XDM-AUTHORIZATION-1 uses single-DES, but packs the key into 7 + * bytes, so here we have to repack it manually into the canonical + * form where it occupies 8 bytes each with the low bit unused. + */ + const unsigned char *keydata = (const unsigned char *)vkeydata; + unsigned char key[8]; + int i, nbits, j; + unsigned int bits; + + bits = 0; + nbits = 0; + j = 0; + for (i = 0; i < 8; i++) { + if (nbits < 7) { + bits = (bits << 8) | keydata[j]; + nbits += 8; + j++; + } + key[i] = (bits >> (nbits - 7)) << 1; + bits &= ~(0x7F << (nbits - 7)); + nbits -= 7; + } + + ssh_cipher *c = ssh_cipher_new(&ssh_des); + ssh_cipher_setkey(c, key); + smemclr(key, sizeof(key)); + ssh_cipher_setiv(c, key); + return c; +} + +void des_encrypt_xdmauth(const void *keydata, void *blk, int len) +{ + ssh_cipher *c = des_xdmauth_cipher(keydata); + ssh_cipher_encrypt(c, blk, len); + ssh_cipher_free(c); +} + +void des_decrypt_xdmauth(const void *keydata, void *blk, int len) +{ + ssh_cipher *c = des_xdmauth_cipher(keydata); + ssh_cipher_decrypt(c, blk, len); + ssh_cipher_free(c); +} diff --git a/code/defs.h b/code/defs.h index 3ba43c4..f1bbf51 100644 --- a/code/defs.h +++ b/code/defs.h @@ -11,6 +11,21 @@ #ifndef PUTTY_DEFS_H #define PUTTY_DEFS_H +#ifdef NDEBUG +/* + * PuTTY is a security project, so assertions are important - if an + * assumption is violated, proceeding anyway may have far worse + * consequences than simple program termination. This check and #error + * should arrange that we don't ever accidentally compile assertions + * out. + */ +#error Do not compile this code base with NDEBUG defined! +#endif + +#if HAVE_CMAKE_H +#include "cmake.h" +#endif + #include #include #include /* for __MINGW_PRINTF_FORMAT */ @@ -27,6 +42,8 @@ #define SIZEx "Ix" #define SIZEu "Iu" uintmax_t strtoumax(const char *nptr, char **endptr, int base); +/* Also, define a LEGACY_WINDOWS flag to enable other workarounds */ +#define LEGACY_WINDOWS #else #include /* Because we still support older MSVC libraries which don't recognise the @@ -83,9 +100,14 @@ typedef struct SockAddr SockAddr; typedef struct Socket Socket; typedef struct Plug Plug; typedef struct SocketPeerInfo SocketPeerInfo; +typedef struct DeferredSocketOpener DeferredSocketOpener; +typedef struct DeferredSocketOpenerVtable DeferredSocketOpenerVtable; typedef struct Backend Backend; typedef struct BackendVtable BackendVtable; +typedef struct Interactor Interactor; +typedef struct InteractorVtable InteractorVtable; +typedef struct InteractionReadySeat InteractionReadySeat; typedef struct Ldisc_tag Ldisc; typedef struct LogContext LogContext; @@ -94,6 +116,9 @@ typedef struct LogPolicyVtable LogPolicyVtable; typedef struct Seat Seat; typedef struct SeatVtable SeatVtable; +typedef struct SeatPromptResult SeatPromptResult; + +typedef struct cmdline_get_passwd_input_state cmdline_get_passwd_input_state; typedef struct TermWin TermWin; typedef struct TermWinVtable TermWinVtable; @@ -155,6 +180,8 @@ typedef struct SessionSpecial SessionSpecial; typedef struct StripCtrlChars StripCtrlChars; +typedef struct BidiContext BidiContext; + /* * A small structure wrapping up a (pointer, length) pair so that it * can be conveniently passed to or from a function. @@ -169,6 +196,8 @@ typedef struct logblank_t logblank_t; typedef struct BinaryPacketProtocol BinaryPacketProtocol; typedef struct PacketProtocolLayer PacketProtocolLayer; +struct unicode_data; + /* Do a compile-time type-check of 'to_check' (without evaluating it), * as a side effect of returning the value 'to_return'. Note that * although this macro double-*expands* to_return, it always @@ -190,32 +219,28 @@ typedef struct PacketProtocolLayer PacketProtocolLayer; #define NORETURN #endif -/* ---------------------------------------------------------------------- - * Platform-specific definitions. +/* + * Standard macro definitions. STR() behaves like the preprocessor + * stringification # operator, and CAT() behaves like the token paste + * ## operator, except that each one macro-expands its argument(s) + * first, unlike the raw version. E.g. + * + * #__LINE__ -> "__LINE__" + * STR(__LINE__) -> "1234" (or whatever) + * + * and similarly, * - * Most of these live in the per-platform header files, of which - * puttyps.h selects the appropriate one. But some of the sources - * (particularly standalone test applications) would prefer not to - * have to include a per-platform header at all, because that makes it - * more portable to platforms not supported by the code base as a - * whole (for example, compiling purely computational parts of the - * code for specialist platforms for test and analysis purposes). So - * any definition that has to affect even _those_ modules will have to - * go here, with the key constraint being that this code has to come - * to _some_ decision even if the compilation platform is not a - * recognised one at all. + * foo ## __LINE__ -> foo__LINE__ + * CAT(foo, __LINE__) -> foo1234 (or whatever) + * + * The expansion is achieved by having each macro pass its arguments + * to a secondary inner macro, because parameter lists of a macro call + * get expanded before the called macro is invoked. So STR(__LINE__) + * -> STR_INNER(1234) -> #1234 -> "1234", and similarly for CAT. */ - -/* Purely computational code uses smemclr(), so we have to make the - * decision here about whether that's provided by utils.c or by a - * platform implementation. We define PLATFORM_HAS_SMEMCLR to suppress - * utils.c's definition. */ -#ifdef _WINDOWS -/* Windows provides the API function 'SecureZeroMemory', which we use - * unless the user has told us not to by defining NO_SECUREZEROMEMORY. */ -#ifndef NO_SECUREZEROMEMORY -#define PLATFORM_HAS_SMEMCLR -#endif -#endif +#define STR_INNER(x) #x +#define STR(x) STR_INNER(x) +#define CAT_INNER(x,y) x ## y +#define CAT(x,y) CAT_INNER(x,y) #endif /* PUTTY_DEFS_H */ diff --git a/code/depcomp b/code/depcomp deleted file mode 100644 index 65cbf70..0000000 --- a/code/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. - -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/code/doc/Makefile b/code/doc/Makefile deleted file mode 100644 index 5ff25d5..0000000 --- a/code/doc/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -all: man index.html - -# Decide on the versionid policy. -# -# If the user has passed in $(VERSION) on the command line (`make -# VERSION="Release 0.56"'), we use that as an explicit version string. -# Otherwise, we use `svnversion' to examine the checked-out -# documentation source, and if that returns a single revision number -# then we invent a version string reflecting just that number. Failing -# _that_, we resort to versionids.but which gives 'version -# unavailable'. -# -# So here, we define VERSION using svnversion if it isn't already -# defined ... -ifndef VERSION -SVNVERSION=$(shell test -d .svn && svnversion .) -BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION)) -ifeq ($(BADCHARS),) -ifneq ($(SVNVERSION),) -ifneq ($(SVNVERSION),exported) -VERSION=Built from revision $(patsubst M,,$(SVNVERSION)) -endif -endif -endif -endif -# ... and now, we condition our build behaviour on whether or not -# VERSION _is_ defined. -ifdef VERSION -VERSIONIDS=vstr -vstr.but: FORCE - printf '\\versionid $(VERSION)\n' > vstr.but -FORCE:; -else -VERSIONIDS=vids -endif - -CHAPTERS := $(SITE) copy blurb intro gs using config pscp psftp plink -CHAPTERS += pubkey pageant errors faq feedback pubkeyfmt licence udp -CHAPTERS += pgpkeys sshnames -CHAPTERS += index $(VERSIONIDS) - -INPUTS = $(patsubst %,%.but,$(CHAPTERS)) - -# This is temporary. Hack it locally or something. -HALIBUT = halibut - -index.html: $(INPUTS) - $(HALIBUT) --text --html --chm $(INPUTS) - -# During formal builds it's useful to be able to build this one alone. -putty.chm: $(INPUTS) - $(HALIBUT) --chm $(INPUTS) - -# We don't ship this any more. -putty.hlp: $(INPUTS) - $(HALIBUT) --winhelp $(INPUTS) - -putty.info: $(INPUTS) - $(HALIBUT) --info $(INPUTS) - -MKMAN = $(HALIBUT) --man=$@ mancfg.but $< -MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1 \ - pageant.1 psocks.1 psusan.1 -man: $(MANPAGES) - -putty.1: man-putty.but mancfg.but; $(MKMAN) -puttygen.1: man-puttygen.but mancfg.but; $(MKMAN) -plink.1: man-plink.but mancfg.but; $(MKMAN) -pscp.1: man-pscp.but mancfg.but; $(MKMAN) -psftp.1: man-psftp.but mancfg.but; $(MKMAN) -puttytel.1: man-puttytel.but mancfg.but; $(MKMAN) -pterm.1: man-pterm.but mancfg.but; $(MKMAN) -pageant.1: man-pageant.but mancfg.but; $(MKMAN) -psocks.1: man-psocks.but mancfg.but; $(MKMAN) -psusan.1: man-psusan.but mancfg.but; $(MKMAN) - -mostlyclean: - rm -f *.html *.txt *.hlp *.cnt *.1 *.info vstr.but *.hh[pck] -clean: mostlyclean - rm -f *.chm diff --git a/code/doc/blurb.but b/code/doc/blurb.but index f980e9f..c68a626 100644 --- a/code/doc/blurb.but +++ b/code/doc/blurb.but @@ -17,7 +17,6 @@ page.

} \cfg{chm-contents-filename}{index.html} \cfg{chm-template-filename}{%k.html} \cfg{chm-head-end}{} -\cfg{chm-extra-file}{chm.css} \cfg{xhtml-contents-filename}{index.html} \cfg{text-filename}{puttydoc.txt} diff --git a/code/doc/chmextra.but b/code/doc/chmextra.but new file mode 100644 index 0000000..8b8780c --- /dev/null +++ b/code/doc/chmextra.but @@ -0,0 +1,6 @@ +\# If you want to do a Halibut build of the CHM file by hand, without +\# the help of the CMake edifice, then include this file which will +\# refer to chm.css. The CMake edifice builds its own with a different +\# pathname in it, for the sake of out-of-tree builds. + +\cfg{chm-extra-file}{chm.css} diff --git a/code/doc/config.but b/code/doc/config.but index 7731328..ed3839d 100644 --- a/code/doc/config.but +++ b/code/doc/config.but @@ -596,6 +596,33 @@ through to \c{ESC [j}. With control they generate \c{ESC [k} through to \c{ESC [v}, and with shift and control together they generate \c{ESC [w} through to \c{ESC [\{}. +\b In \I{xterm}Xterm 216 mode, the unshifted function keys behave the +same as Xterm R6 mode. But pressing a function key together with Shift +or Alt or Ctrl generates a different sequence containing an extra +numeric parameter of the form (1 for Shift) + (2 for Alt) + (4 for +Ctrl) + 1. For F1-F4, the basic sequences like \c{ESC OP} become +\cw{ESC [1;}\e{bitmap}\cw{P} and similar; for F5 and above, +\cw{ESC[}\e{index}\cw{~} becomes +\cw{ESC[}\e{index}\cw{;}\e{bitmap}\cw{~}. + +If you don't know what any of this means, you probably don't need to +fiddle with it. + +\S{config-sharrow} Changing the action of the \i{shifted arrow keys} + +This option affects the arrow keys, if you press one with any of the +modifier keys Shift, Ctrl or Alt held down. + +\b In the default mode, labelled \c{Ctrl toggles app mode}, the Ctrl +key toggles between the default arrow-key sequences like \c{ESC [A} and +\c{ESC [B}, and the sequences Digital's terminals generate in +\q{application cursor keys} mode, i.e. \c{ESC O A} and so on. Shift +and Alt have no effect. + +\b In the \q{xterm-style bitmap} mode, Shift, Ctrl and Alt all +generate different sequences, with a number indicating which set of +modifiers is active. + If you don't know what any of this means, you probably don't need to fiddle with it. @@ -1342,7 +1369,7 @@ which one of the options is \q{Paste}). (This context menu is always available by holding down Ctrl and right-clicking, regardless of the setting of this option.) -(When PuTTY iself is running on Unix, it follows the X Window System +(When PuTTY itself is running on Unix, it follows the X Window System convention.) \S{config-mouseshift} \q{Shift overrides application's use of mouse} @@ -1929,10 +1956,24 @@ in \W{http://www.ietf.org/rfc/rfc2817.txt}{RFC 2817}. connections through a \i{SOCKS server}. \b Many firewalls implement a less formal type of proxy in which a -user can make a Telnet connection directly to the firewall machine +user can make a Telnet or TCP connection directly to the firewall machine and enter a command such as \c{connect myhost.com 22} to connect through to an external host. Selecting \I{Telnet proxy}\q{Telnet} -allows you to tell PuTTY to use this type of proxy. +allows you to tell PuTTY to use this type of proxy, with the precise +command specified as described in \k{config-proxy-command}. + +\b Selecting \q{SSH} causes PuTTY to make a secondary SSH connection +to the proxy host (sometimes called a \q{\i{jump host}} in this +context), and then open a port-forwarding channel to the +final destination host. + +\lcont{ +The \q{Proxy hostname} field will be interpreted as the name of a +PuTTY saved session if one exists, or a hostname if not. This +allows multi-hop jump paths, if the referenced saved session is +itself configured to use an SSH proxy; and it allows combining SSH +and non-SSH proxying. +} \b Selecting \I{Local proxy}\q{Local} allows you to specify an arbitrary command on the local machine to act as a proxy. When the session is @@ -1945,11 +1986,6 @@ This could be used, for instance, to talk to some kind of network proxy that PuTTY does not natively support; or you could tunnel a connection over something other than TCP/IP entirely. -If you want your local proxy command to make a secondary SSH -connection to a proxy host and then tunnel the primary connection -over that, you might well want the \c{-nc} command-line option in -Plink. See \k{using-cmdline-ncmode} for more information. - You can also enable this mode on the command line; see \k{using-cmdline-proxycmd}. } @@ -2007,9 +2043,9 @@ set it to \q{Yes}, PuTTY will always pass host names straight to the proxy without trying to look them up first. If you set this option to \q{Auto} (the default), PuTTY will do -something it considers appropriate for each type of proxy. Telnet, -HTTP, and SOCKS5 proxies will have host names passed straight to -them; SOCKS4 proxies will not. +something it considers appropriate for each type of proxy. Most +types of proxy (HTTP, SOCK5, SSH, Telnet, and local) will have host +names passed straight to them; SOCKS4 proxies will not. Note that if you are doing DNS at the proxy, you should make sure that your proxy exclusion settings (see \k{config-proxy-exclude}) do @@ -2022,15 +2058,30 @@ is a protocol extension (SOCKS 4A) which does support it, but not all SOCKS 4 servers provide this extension. If you enable proxy DNS and your SOCKS 4 server cannot deal with it, this might be why. +If you want to avoid PuTTY making \e{any} DNS query related to your +destination host name (for example, because your local DNS resolver is +very slow to return a negative response in that situation), then as +well as setting this control to \q{Yes}, you may also need to turn off +GSSAPI authentication and GSSAPI key exchange in SSH (see +\k{config-ssh-auth-gssapi} and \k{config-ssh-gssapi-kex} +respectively). This is because GSSAPI setup also involves a DNS query +for the destination host name, and that query is performed by the +separate GSSAPI library, so PuTTY can't override or reconfigure it. + \S{config-proxy-auth} \I{proxy username}Username and \I{proxy password}password -If your proxy requires \I{proxy authentication}authentication, you can -enter a username and a password in the \q{Username} and \q{Password} boxes. +You can enter a username and a password in the \q{Username} and +\q{Password} boxes, which will be used if your proxy requires +\I{proxy authentication}authentication. \I{security hazard}Note that if you save your session, the proxy password will be saved in plain text, so anyone who can access your PuTTY configuration data will be able to discover it. +If PuTTY discovers that it needs a proxy username or password and you +have not specified one here, PuTTY will prompt for it interactively in +the terminal window. + Authentication is not fully supported for all forms of proxy: \b Username and password authentication is supported for HTTP @@ -2042,17 +2093,28 @@ proxies and SOCKS 5 proxies. supports it (this is not supported in \i{PuTTYtel}); otherwise the password is sent to the proxy in \I{plaintext password}plain text. -\b With HTTP proxying, the only currently supported authentication -method is \I{HTTP basic}\q{basic}, where the password is sent to the proxy -in \I{plaintext password}plain text. +\b With HTTP proxying, authentication is via \q{\i{HTTP Digest}} if +possible (again, not supported in PuTTYtel), or \q{\i{HTTP Basic}}. In +the latter case, the password is sent to the proxy in \I{plaintext +password}plain text. } \b SOCKS 4 can use the \q{Username} field, but does not support passwords. +\b SSH proxying can use all the same forms of SSH authentication +supported by PuTTY for its main connection. If the SSH server requests +password authentication, any configured proxy password will be used, +but other authentication methods such as public keys and GSSAPI will +be tried first, just as for a primary SSH connection, and if they +require credentials such as a key passphrase, PuTTY will interactively +prompt for these. + \b You can specify a way to include a username and password in the -Telnet/Local proxy command (see \k{config-proxy-command}). +Telnet/Local proxy command (see \k{config-proxy-command}). If you do +so, and don't also specify the actual username and/or password in the +configuration, PuTTY will interactively prompt for them. \S{config-proxy-command} Specifying the Telnet or Local proxy command @@ -2073,7 +2135,8 @@ itself. Also, the special strings \c{%host} and \c{%port} will be replaced by the host name and port number you want to connect to. The strings \c{%user} and \c{%pass} will be replaced by the proxy username and -password you specify. The strings \c{%proxyhost} and \c{%proxyport} +password (which, if not specified in the configuration, will be +prompted for). The strings \c{%proxyhost} and \c{%proxyport} will be replaced by the host details specified on the \e{Proxy} panel, if any (this is most likely to be useful for the Local proxy type). To get a literal \c{%} sign, enter \c{%%}. @@ -2086,8 +2149,8 @@ before commands can be sent, you can use a command such as: This will send your username and password as the first two lines to the proxy, followed by a command to connect to the desired host and port. Note that if you do not include the \c{%user} or \c{%pass} -tokens in the Telnet command, then the \q{Username} and \q{Password} -configuration fields will be ignored. +tokens in the Telnet command, then anything specified in \q{Username} +and \q{Password} configuration fields will be ignored. \S{config-proxy-logging} Controlling \i{proxy logging} @@ -2403,7 +2466,7 @@ protection than SSH-2 without rekeys. \H{config-ssh-hostkey} The Host Keys panel -The Host Keys panel allows you to configure options related to SSH-2 +The Host Keys panel allows you to configure options related to \i{host key management}. Host keys are used to prove the server's identity, and assure you that @@ -2411,8 +2474,8 @@ the server is not being spoofed (either by a man-in-the-middle attack or by completely replacing it on the network). See \k{gs-hostkey} for a basic introduction to host keys. -This entire panel is only relevant to SSH protocol version 2; none of -these settings affect SSH-1 at all. +Much of this panel is only relevant to SSH protocol version 2; SSH-1 +only supports one type of host key. \S{config-ssh-hostkey-order} \ii{Host key type} selection @@ -2452,7 +2515,7 @@ to that for cipher selection (see \k{config-ssh-encryption}). \S{config-ssh-prefer-known-hostkeys} Preferring known host keys -By default, PuTTY will adjust the preference order for host key +By default, PuTTY will adjust the preference order for SSH-2 host key algorithms so that any host keys it already knows are moved to the top of the list. @@ -3206,7 +3269,10 @@ three states: \b \q{On}: PuTTY will assume the server \e{does} have the bug. \b \q{Auto}: PuTTY will use the server's version number announcement -to try to guess whether or not the server has the bug. +to try to guess whether or not the server has the bug. (This option is +not available for bugs that \e{cannot} be detected from the server +version, e.g. because they must be acted on before the server version +is known.) \S{config-ssh-bug-ignore2} \q{Chokes on SSH-2 \i{ignore message}s} @@ -3299,6 +3365,29 @@ send an over-sized packet. If this bug is enabled when talking to a correct server, the session will work correctly, but download performance will be less than it could be. +\S{config-ssh-bug-dropstart} \q{Discards data sent before its greeting} + +Just occasionally, an SSH connection can be established over some +channel that will accidentally discard outgoing data very early in the +connection. + +This is not typically seen as a bug in an actual SSH server, but it +can sometimes occur in situations involving a complicated proxy +process. An example is +\W{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991958}{Debian +bug #991958}, in which a connection going over the console of a User +Mode Linux kernel can lose outgoing data before the kernel has fully +booted. + +You can work around this problem by manually enabling this bug flag, +which will cause PuTTY to wait to send its initial SSH greeting until +after it sees the greeting from the server. + +Note that this bug flag can never be automatically detected, since +auto-detection relies on the version string in the server's greeting, +and PuTTY has to decide whether to expect this bug \e{before} it sees +the server's greeting. So this is a manual workaround only. + \S{config-ssh-bug-sig} \q{Requires padding on SSH-2 \i{RSA} \i{signatures}} Versions below 3.3 of \i{OpenSSH} require SSH-2 RSA signatures to be diff --git a/code/doc/copy.but b/code/doc/copy.but deleted file mode 100644 index c86dceb..0000000 --- a/code/doc/copy.but +++ /dev/null @@ -1,5 +0,0 @@ -\# Generated by licence.pl from LICENCE. -\# You should edit those files rather than editing this one. - -\define{shortcopyrightdetails} 1997-2021 Simon Tatham - diff --git a/code/doc/errors.but b/code/doc/errors.but index 36a42d9..27e2ae3 100644 --- a/code/doc/errors.but +++ b/code/doc/errors.but @@ -10,8 +10,8 @@ self-explanatory. If you get an error message which is not listed in this chapter and which you don't understand, report it to us as a bug (see \k{feedback}) and we will add documentation for it. -\H{errors-hostkey-absent} \q{The server's host key is not cached in -the registry} +\H{errors-hostkey-absent} \q{The host key is not cached for this +server} This error message occurs when PuTTY connects to a new SSH server. Every server identifies itself by means of a host key; once PuTTY @@ -35,7 +35,7 @@ See \k{gs-hostkey} for more information on host keys. \H{errors-hostkey-wrong} \q{WARNING - POTENTIAL SECURITY BREACH!} This message, followed by \q{The server's host key does not match -the one PuTTY has cached in the registry}, means that PuTTY has +the one PuTTY has cached for this server}, means that PuTTY has connected to the SSH server before, knows what its host key \e{should} be, but has found a different one. diff --git a/code/doc/faq.but b/code/doc/faq.but index 474b984..e9dddb6 100644 --- a/code/doc/faq.but +++ b/code/doc/faq.but @@ -325,7 +325,8 @@ unfinished. If any OS X and/or GTK programming experts are keen to have a finished version of this, we urge them to help out with some of the remaining -problems! See the TODO list in \c{unix/gtkapp.c} in the source code. +problems! See the TODO list in \c{unix/main-gtk-application.c} in the +source code. \S{faq-epoc}{Question} Will there be a port to EPOC? diff --git a/code/doc/gs.but b/code/doc/gs.but index e6a8492..4eff896 100644 --- a/code/doc/gs.but +++ b/code/doc/gs.but @@ -50,8 +50,9 @@ section. If you are using SSH to connect to a server for the first time, you will probably see a message looking something like this: -\c The server's host key is not cached in the registry. You have no -\c guarantee that the server is the computer you think it is. +\c The host key is not cached for this server: +\c ssh.example.com (port 22) +\c You have no guarantee that the server is the computer you think it is. \c The server's ssh-ed25519 key fingerprint is: \c ssh-ed25519 255 SHA256:TddlQk20DVs4LRcAsIfDN9pInKpY06D+h4kSHwWAj4w \c If you trust this host, press "Accept" to add the key to PuTTY's diff --git a/code/doc/AppendixA.html b/code/doc/html/AppendixA.html similarity index 99% rename from code/doc/AppendixA.html rename to code/doc/html/AppendixA.html index 094d119..5df1bd2 100644 --- a/code/doc/AppendixA.html +++ b/code/doc/html/AppendixA.html @@ -332,7 +332,7 @@

A.3.6 Will there be a port t In 2015, after porting the GTK front end to work with GTK 3, we began another attempt based on making small changes to the GTK code and building it against the OS X Quartz version of GTK 3. This doesn't seem to have the window redrawing problem any more, so it's already got further than the last effort, but it is still substantially unfinished.

-If any OS X and/or GTK programming experts are keen to have a finished version of this, we urge them to help out with some of the remaining problems! See the TODO list in unix/gtkapp.c in the source code. +If any OS X and/or GTK programming experts are keen to have a finished version of this, we urge them to help out with some of the remaining problems! See the TODO list in unix/main-gtk-application.c in the source code.

A.3.7 Will there be a port to EPOC?

@@ -1003,6 +1003,5 @@

A.10.4 How do I pronounce Exactly like the English word ‘putty’, which we pronounce /ˈpʌti/.

-

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

-[PuTTY release 0.76]
+

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

diff --git a/code/doc/AppendixB.html b/code/doc/html/AppendixB.html similarity index 99% rename from code/doc/AppendixB.html rename to code/doc/html/AppendixB.html index 1590839..d2d7fcb 100644 --- a/code/doc/AppendixB.html +++ b/code/doc/html/AppendixB.html @@ -268,6 +268,5 @@

B.11 E-mail address

The actual address to mail is <putty@projects.tartarus.org>.

-

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

-[PuTTY release 0.76]
+

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

diff --git a/code/doc/AppendixC.html b/code/doc/html/AppendixC.html similarity index 99% rename from code/doc/AppendixC.html rename to code/doc/html/AppendixC.html index aed2e40..4c2eb2e 100644 --- a/code/doc/AppendixC.html +++ b/code/doc/html/AppendixC.html @@ -349,6 +349,5 @@

C.5.2 Version 1

In an unencrypted version 1 key file, the MAC is replaced by a plain SHA-1 hash of the private key data. This is indicated by the ‘Private-MAC:’ header being replaced with ‘Private-Hash:’ instead.

-

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

-[PuTTY release 0.76]
+

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

diff --git a/code/doc/AppendixD.html b/code/doc/html/AppendixD.html similarity index 95% rename from code/doc/AppendixD.html rename to code/doc/html/AppendixD.html index a742dd0..531f10f 100644 --- a/code/doc/AppendixD.html +++ b/code/doc/html/AppendixD.html @@ -14,7 +14,7 @@

Previous | Contents | Index | Next

Appendix D: PuTTY Licence

-PuTTY is copyright 1997-2021 Simon Tatham. +PuTTY is copyright 1997-2022 Simon Tatham.

Portions copyright Robert de Bath, Joris van Rantwijk, Delian Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn, Colin Watson, Christopher Staite, Lorenz Diener, Christian Brabandt, Jeff Smith, Pavel Kryukov, Maxim Kuznetsov, Svyatoslav Kuzmich, Nico Williams, Viktor Dukhovni, Josh Dersch, Lars Brinkhoff, and CORE SDI S.A. @@ -29,6 +29,5 @@

Appendix D: PuTTY Li THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

-[PuTTY release 0.76]
+

If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

diff --git a/code/doc/AppendixE.html b/code/doc/html/AppendixE.html similarity index 85% rename from code/doc/AppendixE.html rename to code/doc/html/AppendixE.html index 593f441..fadbe29 100644 --- a/code/doc/AppendixE.html +++ b/code/doc/html/AppendixE.html @@ -26,11 +26,9 @@
  • E.8 Single-threaded code
  • E.9 Keystrokes sent to the server wherever possible
  • E.10 640×480 friendliness in configuration panels
  • -
  • E.11 Automatically generated Makefiles
  • -
  • E.12 Coroutines in the SSH code
  • -
  • E.13 Explicit vtable structures to implement traits
  • -
  • E.14 Single compilation of each source file
  • -
  • E.15 Do as we say, not as we do
  • +
  • E.11 Coroutines in protocol code
  • +
  • E.12 Explicit vtable structures to implement traits
  • +
  • E.13 Do as we say, not as we do
  • Appendix E: PuTTY hacking guide

    @@ -48,7 +46,7 @@

    E.1 Cross-OS portabilityunix subdirectory; the Windows-specific modules are in the windows subdirectory.

    -All the modules in the main source directory - notably all of the code for the various back ends - are platform-generic. We want to keep them that way. +All the modules in the main source directory and other subdirectories - notably all of the code for the various back ends - are platform-generic. We want to keep them that way.

    This also means you should stick to the C semantics guaranteed by the C standard: try not to make assumptions about the precise size of basic types such as int and long int; don't use pointer casts to do endianness-dependent operations, and so on. @@ -123,7 +121,7 @@

    E.4 C, not C++

    We have made some effort to make it easy to compile our code using a C++ compiler: notably, our snew, snewn and sresize macros explicitly cast the return values of malloc and realloc to the target type. (This has type checking advantages even in C: it means you never accidentally allocate the wrong size piece of memory for the pointer type you're assigning it to. C++ friendliness is really a side benefit.)

    -We want PuTTY to continue being pure C, at least in the platform-independent parts and the currently existing ports. Patches which switch the Makefiles to compile it as C++ and start using classes will not be accepted. Also, in particular, we disapprove of // comments, at least for the moment. (Perhaps once C99 becomes genuinely widespread we might be more lenient.) +We want PuTTY to continue being pure C, at least in the platform-independent parts and the currently existing ports. Patches which switch the Makefiles to compile it as C++ and start using classes will not be accepted.

    The one exception: a port to a new platform may use languages other than C if they are necessary to code on that platform. If your favourite PDA has a GUI with a C++ API, then there's no way you can do a port of PuTTY without using C++, so go ahead and use it. But keep the C++ restricted to that platform's subdirectory; if your changes force the Unix or Windows ports to be compiled as C++, they will be unacceptable to us. @@ -175,7 +173,7 @@

    E.8 Single-threaded cod That said, most of Windows PuTTY's network handling is triggered off Windows messages requested by WSAAsyncSelect(), so if you call MessageBox() deep within some network event handling code you should be aware that you might be re-entered if a network event comes in and is passed on to our window procedure by the MessageBox() message loop.

    -Also, the front ends (in particular Windows Plink) can use multiple threads if they like. However, Windows Plink keeps very tight control of its auxiliary threads, and uses them pretty much exclusively as a form of select(). Pretty much all the code outside windows/winplink.c is only ever called from the one primary thread; the others just loop round blocking on file handles and send messages to the main thread when some real work needs doing. This is not considered a portability hazard because that bit of windows/winplink.c will need rewriting on other platforms in any case. +Also, the front ends can use multiple threads if they like. For example, the Windows front-end code spawns subthreads to deal with bidirectional blocking I/O on non-network streams such as Windows pipes. However, it keeps tight control of its auxiliary threads, and uses them only for that one purpose, as a form of select(). Pretty much all the code outside windows/handle-io.c is only ever called from the one primary thread; the others just loop round blocking on file handles, and signal the main thread (via Windows event objects) when some real work needs doing. This is not considered a portability hazard because that code is already Windows-specific and needs rewriting on other platforms.

    One important consequence of this: PuTTY has only one thread in which to do everything. That ‘everything’ may include managing more than one login session (section E.3), managing multiple data channels within an SSH session, responding to GUI events even when nothing is happening on the network, and responding to network requests from the server (such as repeat key exchange) even when the program is dealing with complex user interaction such as the re-configuration dialog box. This means that almost none of the PuTTY code can safely block. @@ -194,34 +192,15 @@

    E.10 640×480 friendliness

    Accordingly, the PuTTY configuration box, and the PuTTYgen control window, are deliberately kept just small enough to fit comfortably on a 640×480 display. If you're adding controls to either of these boxes and you find yourself wanting to increase the size of the whole box, don't. Split it into more panels instead.

    -

    E.11 Automatically generated Makefiles

    +

    E.11 Coroutines in protocol code

    -PuTTY is intended to compile on multiple platforms, and with multiple compilers. It would be horrifying to try to maintain a single Makefile which handled all possible situations, and just as painful to try to directly maintain a set of matching Makefiles for each different compilation environment. -

    -

    -Therefore, we have moved the problem up by one level. In the PuTTY source archive is a file called Recipe, which lists which source files combine to produce which binaries; and there is also a script called mkfiles.pl, which reads Recipe and writes out the real Makefiles. (The script also reads all the source files and analyses their dependencies on header files, so we get an extra benefit from doing it this way, which is that we can supply correct dependency information even in environments where it's difficult to set up an automated make depend phase.) -

    -

    -You should never edit any of the PuTTY Makefiles directly. They are not stored in our source repository at all. They are automatically generated by mkfiles.pl from the file Recipe. -

    -

    -If you need to add a new object file to a particular binary, the right thing to do is to edit Recipe and re-run mkfiles.pl. This will cause the new object file to be added in every tool that requires it, on every platform where it matters, in every Makefile to which it is relevant, and to get all the dependency data right. -

    -

    -If you send us a patch that modifies one of the Makefiles, you just waste our time, because we will have to convert it into a change to Recipe. If you send us a patch that modifies all of the Makefiles, you will have wasted a lot of your time as well! -

    -

    -(There is a comment at the top of every Makefile in the PuTTY source archive saying this, but many people don't seem to read it, so it's worth repeating here.) -

    -

    E.12 Coroutines in the SSH code

    -

    -Large parts of the code in the various SSH modules (in fact most of the protocol layers) are structured using a set of macros that implement (something close to) Donald Knuth's ‘coroutines’ concept in C. +Large parts of the code in modules implementing wire protocols (mainly SSH) are structured using a set of macros that implement (something close to) Donald Knuth's ‘coroutines’ concept in C.

    Essentially, the purpose of these macros are to arrange that a function can call crReturn() to return to its caller, and the next time it is called control will resume from just after that crReturn statement.

    -This means that any local (automatic) variables declared in such a function will be corrupted every time you call crReturn. If you need a variable to persist for longer than that, you must make it a field in some appropriate structure containing the persistent state of the coroutine – typically the main state structure for an SSH protocol layer. +This means that any local (automatic) variables declared in such a function will be corrupted every time you call crReturn. If you need a variable to persist for longer than that, you must make it a field in some appropriate structure containing the persistent state of the coroutine – typically the main state structure for a protocol layer.

    See https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html for a more in-depth discussion of what these macros are for and how they work. @@ -232,7 +211,7 @@

    E.12 Coroutines in the

    For example, if an SSH packet protocol layer has to have a field that sometimes points to a piece of allocated memory, then you should ensure that when you free that memory you reset the pointer field to NULL. Then, no matter when the protocol layer's cleanup function is called, it can reliably free the memory if there is any, and not crash if there isn't.

    -

    E.13 Explicit vtable structures to implement traits

    +

    E.12 Explicit vtable structures to implement traits

    A lot of PuTTY's code is written in a style that looks structurally rather like an object-oriented language, in spite of PuTTY being a pure C program.

    @@ -328,13 +307,13 @@

    E.13 Explicit vtable structures

    But in fact, we don't do that, because it looks pretty ugly at all the call sites. Instead, what we generally do in this code base is to write a set of static inline wrapper functions in the same header file that defined the MyAbstraction structure types, like this:

    -
    static MyAbstraction *myabs_new(const MyAbstractionVtable *vt)
    +
    static inline MyAbstraction *myabs_new(const MyAbstractionVtable *vt)
     { return vt->new(vt); }
    -static void myabs_free(MyAbstraction *myabs)
    +static inline void myabs_free(MyAbstraction *myabs)
     { myabs->vt->free(myabs); }
    -static void myimpl_modify(MyAbstraction *myabs, unsigned param)
    +static inline void myimpl_modify(MyAbstraction *myabs, unsigned param)
     { myabs->vt->modify(myabs, param); }
    -static unsigned myimpl_query(MyAbstraction *myabs, unsigned param)
    +static inline unsigned myimpl_query(MyAbstraction *myabs, unsigned param)
     { return myabs->vt->query(myabs, param); }
     

    @@ -361,7 +340,7 @@

    E.13 Explicit vtable structures

    -This system is flexible enough to permit ‘multiple inheritance’, or rather, multiple implementation: having one object type implement more than one trait. For example, the Proxy type implements both the Socket trait and the Plug trait that connects to it, because it has to act as an adapter between another instance of each of those types. +This system is flexible enough to permit ‘multiple inheritance’, or rather, multiple implementation: having one object type implement more than one trait. For example, the ProxySocket type implements both the Socket trait and the Plug trait that connects to it, because it has to act as an adapter between another instance of each of those types.

    It's also perfectly possible to have the same object implement the same trait in two different ways. At the time of writing this I can't think of any case where we actually do this, but a theoretical example might be if you needed to support a trait like Comparable in two ways that sorted by different criteria. There would be no difficulty doing this in the PuTTY system: simply have your implementation struct contain two (or more) fields of the same abstraction type. The fields will have different names, which makes it easy to explicitly specify which one you're returning a pointer to during up-casting, or which one you're down-casting from using container_of. And then both sets of implementation methods can recover a pointer to the same containing structure. @@ -429,27 +408,7 @@

    E.13 Explicit vtable structures -

    E.14 Single compilation of each source file

    -

    -The PuTTY build system for any given platform works on the following very simple model: -

    -
    • -Each source file is compiled precisely once, to produce a single object file. -
    • -
    • -Each binary is created by linking together some combination of those object files. -
    • -
    -

    -Therefore, if you need to introduce functionality to a particular module which is only available in some of the tool binaries (for example, a cryptographic proxy authentication mechanism which needs to be left out of PuTTYtel to maintain its usability in crypto-hostile jurisdictions), the wrong way to do it is by adding #ifdefs in (say) proxy.c. This would require separate compilation of proxy.c for PuTTY and PuTTYtel, which means that the entire Makefile-generation architecture (see section E.11) would have to be significantly redesigned. Unless you are prepared to do that redesign yourself, and guarantee that it will still port to any future platforms we might decide to run on, you should not attempt this! -

    -

    -The right way to introduce a feature like this is to put the new code in a separate source file, and (if necessary) introduce a second new source file defining the same set of functions, but defining them as stubs which don't provide the feature. Then the module whose behaviour needs to vary (proxy.c in this example) can call the functions defined in these two modules, and it will either provide the new feature or not provide it according to which of your new modules it is linked with. -

    -

    -Of course, object files are never shared between platforms; so it is allowable to use #ifdef to select between platforms. This happens in puttyps.h (choosing which of the platform-specific include files to use), and also in misc.c (the Windows-specific ‘Minefield’ memory diagnostic system). It should be used sparingly, though, if at all. -

    -

    E.15 Do as we say, not as we do

    +

    E.13 Do as we say, not as we do

    The current PuTTY code probably does not conform strictly to all of the principles listed above. There may be the occasional SSH-specific piece of code in what should be a backend-independent module, or the occasional dependence on a non-standard X library function under Unix.

    @@ -457,6 +416,5 @@

    E.15 Do as we say, not as w This should not be taken as a licence to go ahead and violate the rules. Where we violate them ourselves, we're not happy about it, and we would welcome patches that fix any existing problems. Please try to help us make our code better, not worse!

    -

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    -[PuTTY release 0.76]
    +

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    diff --git a/code/doc/AppendixF.html b/code/doc/html/AppendixF.html similarity index 90% rename from code/doc/AppendixF.html rename to code/doc/html/AppendixF.html index 1374e4c..ee7f93f 100644 --- a/code/doc/AppendixF.html +++ b/code/doc/html/AppendixF.html @@ -76,28 +76,28 @@

    F.1 Public keys

    The current issue of those keys are available for download from the PuTTY website, and are also available on PGP keyservers using the key IDs listed below.

    -Master Key (2018) +Master Key (2021)
    -RSA, 4096-bit. Key ID: 76BC7FE4EBFD2D9E. Fingerprint: 24E1 B1C5 75EA 3C9F F752  A922 76BC 7FE4 EBFD 2D9E +RSA, 3072-bit. Key ID: DD4355EAAC1119DE. Fingerprint: A872 D42F 1660 890F 0E05 223E DD43 55EA AC11 19DE
    -Release Key (2018) +Release Key (2021)
    -RSA, 3072-bit. Key ID: 6289A25F4AE8DA82. Fingerprint: E273 94AC A3F9 D904 9522  E054 6289 A25F 4AE8 DA82 +RSA, 3072-bit. Key ID: E4F83EA2AA4915EC. Fingerprint: 2CF6 134B D3F7 7A65 88EB D668 E4F8 3EA2 AA49 15EC
    -Snapshot Key (2018) +Snapshot Key (2021)
    -RSA, 3072-bit. Key ID: 38BA7229B7588FD1. Fingerprint: C92B 52E9 9AB6 1DDA 33DB  2B7A 38BA 7229 B758 8FD1 +RSA, 3072-bit. Key ID: B43979F89F446CFD. Fingerprint: 1FD3 BCAC E532 FBE0 6A8C 09E2 B439 79F8 9F44 6CFD
    -Secure Contact Key (2018) +Secure Contact Key (2021)
    -RSA, 3072-bit. Key ID: 657D487977F95C98. Fingerprint: A680 0082 2998 6E46 22CA  0E43 657D 4879 77F9 5C98 +RSA, 3072-bit. Key ID: 012C59D4211BD62A. Fingerprint: E30F 1354 2A04 BE0E 56F0 5801 012C 59D4 211B D62A

    F.2 Security details

    @@ -178,6 +178,34 @@

    F.3 Key rollover

    The details of all previous keys are given here.

    +Keys generated in the 2018 rollover +

    +
    +Master Key (2018) +
    +
    +RSA, 4096-bit. Key ID: 76BC7FE4EBFD2D9E. Fingerprint: 24E1 B1C5 75EA 3C9F F752  A922 76BC 7FE4 EBFD 2D9E +
    +
    +Release Key (2018) +
    +
    +RSA, 3072-bit. Key ID: 6289A25F4AE8DA82. Fingerprint: E273 94AC A3F9 D904 9522  E054 6289 A25F 4AE8 DA82 +
    +
    +Snapshot Key (2018) +
    +
    +RSA, 3072-bit. Key ID: 38BA7229B7588FD1. Fingerprint: C92B 52E9 9AB6 1DDA 33DB  2B7A 38BA 7229 B758 8FD1 +
    +
    +Secure Contact Key (2018) +
    +
    +RSA, 3072-bit. Key ID: 657D487977F95C98. Fingerprint: A680 0082 2998 6E46 22CA  0E43 657D 4879 77F9 5C98 +
    +
    +

    Key generated in 2016 (when we first introduced the Secure Contact Key)

    @@ -250,6 +278,5 @@

    F.3 Key rollover

    -

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    -[PuTTY release 0.76]
    +

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    diff --git a/code/doc/html/AppendixG.html b/code/doc/html/AppendixG.html new file mode 100644 index 0000000..35eb79d --- /dev/null +++ b/code/doc/html/AppendixG.html @@ -0,0 +1,155 @@ + + + + +SSH-2 names specified for PuTTY + + + + + + + +

    Previous | Contents | Index | Next

    + + +

    Appendix G: SSH-2 names specified for PuTTY

    +

    +There are various parts of the SSH-2 protocol where things are specified using a textual name. Names ending in @putty.projects.tartarus.org are reserved for allocation by the PuTTY team. Allocated names are documented here. +

    +

    G.1 Connection protocol channel request names

    +

    +These names can be sent in a SSH_MSG_CHANNEL_REQUEST message. +

    +
    +simple@putty.projects.tartarus.org +
    +
    +This is sent by a client to announce that it will not have more than one channel open at a time in the current connection (that one being the one the request is sent on). The intention is that the server, knowing this, can set the window on that one channel to something very large, and leave flow control to TCP. There is no message-specific data. +
    +
    +winadj@putty.projects.tartarus.org +
    +
    +PuTTY sends this request along with some SSH_MSG_CHANNEL_WINDOW_ADJUST messages as part of its window-size tuning. It can be sent on any type of channel. There is no message-specific data. Servers MUST treat it as an unrecognised request and respond with SSH_MSG_CHANNEL_FAILURE. +

    +(Some SSH servers get confused by this message, so there is a bug-compatibility mode for disabling it. See section 4.26.3.) +

    + +
    +
    +

    G.2 Key exchange method names

    +
    +rsa-sha1-draft-00@putty.projects.tartarus.org +
    +
    +rsa-sha256-draft-00@putty.projects.tartarus.org +
    +
    +rsa1024-sha1-draft-01@putty.projects.tartarus.org +
    +
    +rsa1024-sha256-draft-01@putty.projects.tartarus.org +
    +
    +rsa2048-sha256-draft-01@putty.projects.tartarus.org +
    +
    +rsa1024-sha1-draft-02@putty.projects.tartarus.org +
    +
    +rsa2048-sha512-draft-02@putty.projects.tartarus.org +
    +
    +rsa1024-sha1-draft-03@putty.projects.tartarus.org +
    +
    +rsa2048-sha256-draft-03@putty.projects.tartarus.org +
    +
    +rsa1024-sha1-draft-04@putty.projects.tartarus.org +
    +
    +rsa2048-sha256-draft-04@putty.projects.tartarus.org +
    +
    +These appeared in various drafts of what eventually became RFC 4432. They have been superseded by rsa1024-sha1 and rsa2048-sha256. +
    +
    +

    G.3 Encryption algorithm names

    +
    +arcfour128-draft-00@putty.projects.tartarus.org +
    +
    +arcfour256-draft-00@putty.projects.tartarus.org +
    +
    +These were used in drafts of what eventually became RFC 4345. They have been superseded by arcfour128 and arcfour256. +
    +
    +

    G.4 Agent extension request names

    +

    +The SSH agent protocol, which is only specified in an Internet-Draft at the time of writing (draft-miller-ssh-agent), defines an extension mechanism. These names can be sent in an SSH_AGENTC_EXTENSION message. +

    +
    +add-ppk@putty.projects.tartarus.org +
    +
    +The payload is a single SSH-2 string containing a keypair in the PPK format defined in appendix C. Compared to the standard SSH_AGENTC_ADD_IDENTITY, this extension allows adding keys in encrypted form, with the agent requesting a decryption passphrase from the user on demand, and able to revert the key to encrypted form. +
    +
    +reencrypt@putty.projects.tartarus.org +
    +
    +The payload is a single SSH-2 string specifying a public key blob, as in SSH_AGENTC_REMOVE_IDENTITY. Requests that the agent forget any cleartext form of a specific key. +

    +Returns SSH_AGENT_SUCCESS if the agent ended up holding the key only in encrypted form (even if it was already encrypted); returns SSH_AGENT_EXTENSION_FAILURE if not (if it wasn't held by the agent at all, or only in cleartext form). +

    + +
    +
    +reencrypt-all@putty.projects.tartarus.org +
    +
    +No payload. Requests that the agent forget the cleartext form of any keys for which it holds an encrypted form. +

    +If the agent holds any keys with an encrypted form (or no keys at all), returns SSH_AGENT_SUCCESS to indicate that no such keys are now held in cleartext form, followed by a uint32 specifying how many keys remain in cleartext form (because the agent didn't hold an encrypted form for them). If the agent holds nothing but keys in cleartext form, returns SSH_AGENT_EXTENSION_FAILURE. +

    + +
    +
    +list-extended@putty.projects.tartarus.org +
    +
    +No payload. Returns SSH_AGENT_SUCCESS followed by a list of identities similar to SSH_AGENT_IDENTITIES_ANSWER, except that each key has an extra SSH-2 string at the end. Currently that string contains a single uint32 flags word, with the following bits defined: +
    +Bit 0 +
    +
    +If set, key is held with an encrypted form (so that the reencrypt extension can do something useful with it). +
    +
    +Bit 1 +
    +
    +If set, key's cleartext form is not currently held (so the user will have to supply a passphrase before the key can be used). +
    +
    + +
    +
    +

    + ersionid PuTTY release 0.77 +

    + +

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    + diff --git a/code/doc/Chapter1.html b/code/doc/html/Chapter1.html similarity index 99% rename from code/doc/Chapter1.html rename to code/doc/html/Chapter1.html index 601feb1..9c1e3e2 100644 --- a/code/doc/Chapter1.html +++ b/code/doc/html/Chapter1.html @@ -84,6 +84,5 @@

    1.2 How do SSH, Telnet, Rlogin, a If your client and server are both behind the same (good) firewall, it is more likely to be safe to use Telnet, Rlogin, or SUPDUP, but we still recommend you use SSH.

    -

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    -[PuTTY release 0.76]
    +

    If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

    diff --git a/code/doc/Chapter10.html b/code/doc/html/Chapter10.html similarity index 97% rename from code/doc/Chapter10.html rename to code/doc/html/Chapter10.html index 917f775..10e57de 100644 --- a/code/doc/Chapter10.html +++ b/code/doc/html/Chapter10.html @@ -16,7 +16,7 @@
    • Chapter 10: Common error messages
        -
      • 10.1 ‘The server's host key is not cached in the registry’
      • +
      • 10.1 ‘The host key is not cached for this server’
      • 10.2 ‘WARNING - POTENTIAL SECURITY BREACH!’
      • 10.3 ‘SSH protocol version 2 required by our configuration but remote only provides (old, insecure) SSH-1’
      • 10.4 ‘The first cipher supported by the server is ... below the configured warning threshold’
      • @@ -44,7 +44,7 @@

        Chapter 10: Common e

        We do not attempt to list all error messages here: there are many which should never occur, and some which should be self-explanatory. If you get an error message which is not listed in this chapter and which you don't understand, report it to us as a bug (see appendix B) and we will add documentation for it.

        -

        10.1 ‘The server's host key is not cached in the registry’

        +

        10.1 ‘The host key is not cached for this server’

        This error message occurs when PuTTY connects to a new SSH server. Every server identifies itself by means of a host key; once PuTTY knows the host key for a server, it will be able to detect if a malicious attacker redirects your connection to another machine.

        @@ -59,7 +59,7 @@

        10.1 ‘The serv

        10.2 ‘WARNING - POTENTIAL SECURITY BREACH!’

        -This message, followed by ‘The server's host key does not match the one PuTTY has cached in the registry’, means that PuTTY has connected to the SSH server before, knows what its host key should be, but has found a different one. +This message, followed by ‘The server's host key does not match the one PuTTY has cached for this server’, means that PuTTY has connected to the SSH server before, knows what its host key should be, but has found a different one.

        This may mean that a malicious attacker has replaced your server with a different one, or has redirected your network connection to their own machine. On the other hand, it may simply mean that the administrator of your server has accidentally changed the key while upgrading the SSH software; this shouldn't happen but it is unfortunately possible. @@ -157,7 +157,7 @@

        10.10 ‘Access It may be worth checking the Event Log for diagnostic messages from the server giving more detail.

        -This error can be caused by buggy SSH-1 servers that fail to cope with the various strategies we use for camouflaging passwords in transit. Upgrade your server, or use the workarounds described in section 4.26.11 and possibly section 4.26.12. +This error can be caused by buggy SSH-1 servers that fail to cope with the various strategies we use for camouflaging passwords in transit. Upgrade your server, or use the workarounds described in section 4.26.12 and possibly section 4.26.13.

        10.11 ‘No supported authentication methods available’

        @@ -171,7 +171,7 @@

        10.12 ‘Incorrect

        -Occasionally this has been caused by server bugs. An example is the bug described at section 4.26.8, although you're very unlikely to encounter that one these days. +Occasionally this has been caused by server bugs. An example is the bug described at section 4.26.9, although you're very unlikely to encounter that one these days.

        In this context MAC stands for Message Authentication Code. It's a cryptographic term, and it has nothing at all to do with Ethernet MAC (Media Access Control) addresses, or with the Apple computer. @@ -181,7 +181,7 @@

        10.13 ‘Incoming pack This error occurs when PuTTY decrypts an SSH packet and the decrypted data makes no sense. This probably means something has gone wrong in the encryption or decryption process. It's difficult to tell from this error message whether the problem is in the client, in the server, or in between.

        -If you get this error, one thing you could try would be to fiddle with the setting of ‘Miscomputes SSH-2 encryption keys’ (see section 4.26.10) or ‘Ignores SSH-2 maximum packet size’ (see section 4.26.5) on the Bugs panel. +If you get this error, one thing you could try would be to fiddle with the setting of ‘Miscomputes SSH-2 encryption keys’ (see section 4.26.11) or ‘Ignores SSH-2 maximum packet size’ (see section 4.26.5) on the Bugs panel.

        10.14 ‘PuTTY X11 proxy: various errors

        @@ -244,6 +244,5 @@

        10.19 ‘N A common way to provoke this error is to accidentally try to connect to port 0, which is not a valid port number.

        -

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        -[PuTTY release 0.76]
        +

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        diff --git a/code/doc/Chapter2.html b/code/doc/html/Chapter2.html similarity index 98% rename from code/doc/Chapter2.html rename to code/doc/html/Chapter2.html index 6f33796..7e3d4c8 100644 --- a/code/doc/Chapter2.html +++ b/code/doc/html/Chapter2.html @@ -53,8 +53,9 @@

        2.2 Verifying

        If you are using SSH to connect to a server for the first time, you will probably see a message looking something like this:

        -
        The server's host key is not cached in the registry. You have no
        -guarantee that the server is the computer you think it is.
        +
        The host key is not cached for this server:
        + ssh.example.com (port 22)
        +You have no guarantee that the server is the computer you think it is.
         The server's ssh-ed25519 key fingerprint is:
          ssh-ed25519 255 SHA256:TddlQk20DVs4LRcAsIfDN9pInKpY06D+h4kSHwWAj4w
         If you trust this host, press "Accept" to add the key to PuTTY's
        @@ -118,6 +119,5 @@ 

        2.5 Logging out You can close a PuTTY session using the Close button in the window border, but this might confuse the server - a bit like hanging up a telephone unexpectedly in the middle of a conversation. We recommend you do not do this unless the server has stopped responding to you and you cannot close the window any other way.

        -

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        -[PuTTY release 0.76]
        +

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        diff --git a/code/doc/Chapter3.html b/code/doc/html/Chapter3.html similarity index 92% rename from code/doc/Chapter3.html rename to code/doc/html/Chapter3.html index 615fe0f..d7811b0 100644 --- a/code/doc/Chapter3.html +++ b/code/doc/html/Chapter3.html @@ -583,29 +583,35 @@

        3.11.3.7 section 4.1.1).

        -

        3.11.3.8 -pw: specify a password

        +

        3.11.3.8 -pwfile and -pw: specify a password

        -A simple way to automate a remote login is to supply your password on the command line. This is not recommended for reasons of security. If you possibly can, we recommend you set up public-key authentication instead. See chapter 8 for details. +A simple way to automate a remote login is to supply your password on the command line.

        -Note that the -pw option only works when you are using the SSH protocol. Due to fundamental limitations of Telnet, Rlogin, and SUPDUP, these protocols do not support automated password authentication. +The -pwfile option takes a file name as an argument. The first line of text in that file will be used as your password.

        -

        3.11.3.9 -agent and -noagent: control use of Pageant for authentication

        +

        +The -pw option takes the password itself as an argument. This is NOT SECURE if anybody else uses the same computer, because the whole command line (including the password) is likely to show up if another user lists the running processes. -pw is retained for backwards compatibility only; you should use -pwfile instead. +

        +

        +Note that these options only work when you are using the SSH protocol. Due to fundamental limitations of Telnet, Rlogin, and SUPDUP, these protocols do not support automated password authentication. +

        +

        3.11.3.9 -agent and -noagent: control use of Pageant for authentication

        The -agent option turns on SSH authentication using Pageant, and -noagent turns it off. These options are only meaningful if you are using SSH.

        -See chapter 9 for general information on Pageant. +See chapter 9 for general information on Pageant.

        These options are equivalent to the agent authentication checkbox in the Auth panel of the PuTTY configuration box (see section 4.21.4).

        -

        3.11.3.10 -A and -a: control agent forwarding

        +

        3.11.3.10 -A and -a: control agent forwarding

        The -A option turns on SSH agent forwarding, and -a turns it off. These options are only meaningful if you are using SSH.

        -See chapter 9 for general information on Pageant, and section 9.4 for information on agent forwarding. Note that there is a security risk involved with enabling this option; see section 9.6 for details. +See chapter 9 for general information on Pageant, and section 9.4 for information on agent forwarding. Note that there is a security risk involved with enabling this option; see section 9.6 for details.

        These options are equivalent to the agent forwarding checkbox in the Auth panel of the PuTTY configuration box (see section 4.21.7). @@ -613,7 +619,7 @@

        3.11.3.10 These options are not available in the file transfer tools PSCP and PSFTP.

        -

        3.11.3.11 -X and -x: control X11 forwarding

        +

        3.11.3.11 -X and -x: control X11 forwarding

        The -X option turns on X11 forwarding in SSH, and -x turns it off. These options are only meaningful if you are using SSH.

        @@ -626,7 +632,7 @@

        3.11.3.11 3.11.3.12 -t and -T: control pseudo-terminal allocation

        +

        3.11.3.12 -t and -T: control pseudo-terminal allocation

        The -t option ensures PuTTY attempts to allocate a pseudo-terminal at the server, and -T stops it from allocating one. These options are only meaningful if you are using SSH.

        @@ -636,7 +642,7 @@

        3.11.3.12 3.11.3.13 -N: suppress starting a shell or command

        +

        3.11.3.13 -N: suppress starting a shell or command

        The -N option prevents PuTTY from attempting to start a shell or command on the remote server. You might want to use this option if you are only using the SSH connection for port forwarding, and your user account on the server does not have the ability to run a shell.

        @@ -649,7 +655,7 @@

        3.11.3.13 This option is not available in the file transfer tools PSCP and PSFTP.

        -

        3.11.3.14 -nc: make a remote network connection in place of a remote shell or command

        +

        3.11.3.14 -nc: make a remote network connection in place of a remote shell or command

        The -nc option prevents Plink (or PuTTY) from attempting to start a shell or command on the remote server. Instead, it will instruct the remote server to open a network connection to a host name and port number specified by you, and treat that network connection as if it were the main session.

        @@ -659,7 +665,10 @@

        3.11.3.14 plink host1.example.com -nc host2.example.com:1234

        -You might want to use this feature if you needed to make an SSH connection to a target host which you can only reach by going through a proxy host, and rather than using port forwarding you prefer to use the local proxy feature (see section 4.16.1 for more about local proxies). In this situation you might select ‘Local’ proxy type, set your local proxy command to be ‘plink %proxyhost -nc %host:%port’, enter the target host name on the Session panel, and enter the directly reachable proxy host name on the Proxy panel. +This can be useful if you're trying to make a connection to a target host which you can only reach by SSH forwarding through a proxy host. One way to do this would be to have an existing SSH connection to the proxy host, with a port forwarding, but if you prefer to have the connection started on demand as needed, then this approach can also work. +

        +

        +However, this does depend on the program using the proxy being able to run a subprocess in place of making a network connection. PuTTY itself can do this using the ‘Local’ proxy type, but there's a built-in more flexible way using the ‘SSH’ proxy type. (See section 4.16.1 for a description of both.) So this feature is probably most useful with another client program as the end user.

        This feature is only available in SSH protocol version 2 (since the version 1 protocol assumes you will always want to run a shell). It is not available in the file transfer tools PSCP and PSFTP. It is available in PuTTY itself, although it is unlikely to be very useful in any tool other than Plink. Also, -nc uses the same server functionality as port forwarding, so it will not work if your server administrator has disabled port forwarding. @@ -667,63 +676,63 @@

        3.11.3.14 (The option is named -nc after the Unix program nc, short for ‘netcat’. The command ‘plink host1 -nc host2:port’ is very similar in functionality to ‘plink host1 nc host2 port’, which invokes nc on the server and tells it to connect to the specified destination. However, Plink's built-in -nc option does not depend on the nc program being installed on the server.)

        -

        3.11.3.15 -C: enable compression

        +

        3.11.3.15 -C: enable compression

        The -C option enables compression of the data sent across the network. This option is only meaningful if you are using SSH.

        This option is equivalent to the ‘Enable compression’ checkbox in the SSH panel of the PuTTY configuration box (see section 4.17.3).

        -

        3.11.3.16 -1 and -2: specify an SSH protocol version

        +

        3.11.3.16 -1 and -2: specify an SSH protocol version

        -The -1 and -2 options force PuTTY to use version 1 or version 2 of the SSH protocol. These options are only meaningful if you are using SSH. +The -1 and -2 options force PuTTY to use version 1 or version 2 of the SSH protocol. These options are only meaningful if you are using SSH.

        These options are equivalent to selecting the SSH protocol version in the SSH panel of the PuTTY configuration box (see section 4.17.4).

        -

        3.11.3.17 -4 and -6: specify an Internet protocol version

        +

        3.11.3.17 -4 and -6: specify an Internet protocol version

        -The -4 and -6 options force PuTTY to use the older Internet protocol IPv4 or the newer IPv6 for most outgoing connections. +The -4 and -6 options force PuTTY to use the older Internet protocol IPv4 or the newer IPv6 for most outgoing connections.

        These options are equivalent to selecting your preferred Internet protocol version as ‘IPv4’ or ‘IPv6’ in the Connection panel of the PuTTY configuration box (see section 4.14.4).

        -

        3.11.3.18 -i: specify an SSH private key

        +

        3.11.3.18 -i: specify an SSH private key

        -The -i option allows you to specify the name of a private key file in *.PPK format which PuTTY will use to authenticate with the server. This option is only meaningful if you are using SSH. +The -i option allows you to specify the name of a private key file in *.PPK format which PuTTY will use to authenticate with the server. This option is only meaningful if you are using SSH.

        If you are using Pageant, you can also specify a public key file (in RFC 4716 or OpenSSH format) to identify a specific key file to use. (This won't work if you're not running Pageant, of course.)

        -For general information on public-key authentication, see chapter 8. +For general information on public-key authentication, see chapter 8.

        This option is equivalent to the ‘Private key file for authentication’ box in the Auth panel of the PuTTY configuration box (see section 4.21.9).

        -

        3.11.3.19 -no-trivial-auth: disconnect if SSH authentication succeeds trivially

        +

        3.11.3.19 -no-trivial-auth: disconnect if SSH authentication succeeds trivially

        This option causes PuTTY to abandon an SSH session if the server accepts authentication without ever having asked for any kind of password or signature or token.

        See section 4.21.3 for why you might want this.

        -

        3.11.3.20 -loghost: specify a logical host name

        +

        3.11.3.20 -loghost: specify a logical host name

        -This option overrides PuTTY's normal SSH host key caching policy by telling it the name of the host you expect your connection to end up at (in cases where this differs from the location PuTTY thinks it's connecting to). It can be a plain host name, or a host name followed by a colon and a port number. See section 4.14.5 for more detail on this. +This option overrides PuTTY's normal SSH host key caching policy by telling it the name of the host you expect your connection to end up at (in cases where this differs from the location PuTTY thinks it's connecting to). It can be a plain host name, or a host name followed by a colon and a port number. See section 4.14.5 for more detail on this.

        -

        3.11.3.21 -hostkey: manually specify an expected host key

        +

        3.11.3.21 -hostkey: manually specify an expected host key

        -This option overrides PuTTY's normal SSH host key caching policy by telling it exactly what host key to expect, which can be useful if the normal automatic host key store in the Registry is unavailable. The argument to this option should be either a host key fingerprint, or an SSH-2 public key blob. See section 4.19.3 for more information. +This option overrides PuTTY's normal SSH host key caching policy by telling it exactly what host key to expect, which can be useful if the normal automatic host key store in the Registry is unavailable. The argument to this option should be either a host key fingerprint, or an SSH-2 public key blob. See section 4.19.3 for more information.

        You can specify this option more than once if you want to configure more than one key to be accepted.

        -

        3.11.3.22 -pgpfp: display PGP key fingerprints

        +

        3.11.3.22 -pgpfp: display PGP key fingerprints

        -This option causes the PuTTY tools not to run as normal, but instead to display the fingerprints of the PuTTY PGP Master Keys, in order to aid with verifying new versions. See appendix F for more information. +This option causes the PuTTY tools not to run as normal, but instead to display the fingerprints of the PuTTY PGP Master Keys, in order to aid with verifying new versions. See appendix F for more information.

        -

        3.11.3.23 -sercfg: specify serial port configuration

        +

        3.11.3.23 -sercfg: specify serial port configuration

        This option specifies the configuration parameters for the serial port (baud rate, stop bits etc). Its argument is interpreted as a comma-separated list of configuration options, which can be as follows:

        @@ -746,9 +755,9 @@

        3.11.3.23 For example, ‘-sercfg 19200,8,n,1,N’ denotes a baud rate of 19200, 8 data bits, no parity, 1 stop bit and no flow control.

        -

        3.11.3.24 -sessionlog, -sshlog, -sshrawlog: enable session logging

        +

        3.11.3.24 -sessionlog, -sshlog, -sshrawlog: enable session logging

        -These options cause the PuTTY network tools to write out a log file. Each of them expects a file name as an argument, e.g. ‘-sshlog putty.log’ causes an SSH packet log to be written to a file called ‘putty.log’. The three different options select different logging modes, all available from the GUI too: +These options cause the PuTTY network tools to write out a log file. Each of them expects a file name as an argument, e.g. ‘-sshlog putty.log’ causes an SSH packet log to be written to a file called ‘putty.log’. The three different options select different logging modes, all available from the GUI too:

        • -sessionlog selects ‘All session output’ logging mode. @@ -763,18 +772,18 @@

          3.11.3.24 For more information on logging configuration, see section 4.2.

          -

          3.11.3.25 -logoverwrite, -logappend: control behaviour with existing log file

          +

          3.11.3.25 -logoverwrite, -logappend: control behaviour with existing log file

          If logging has been enabled (in the saved configuration, or by another command-line option), and the specified log file already exists, these options tell the PuTTY network tools what to do so that they don't have to ask the user. See section 4.2.2 for details.

          -

          3.11.3.26 -proxycmd: specify a local proxy command

          +

          3.11.3.26 -proxycmd: specify a local proxy command

          -This option enables PuTTY's mode for running a command on the local machine and using it as a proxy for the network connection. It expects a shell command string as an argument. +This option enables PuTTY's mode for running a command on the local machine and using it as a proxy for the network connection. It expects a shell command string as an argument.

          See section 4.16.1 for more information on this, and on other proxy settings. In particular, note that since the special sequences described there are understood in the argument string, literal backslashes must be doubled (if you want \ in your command, you must put \\ on the command line).

          -

          3.11.3.27 -restrict-acl: restrict the Windows process ACL

          +

          3.11.3.27 -restrict-acl: restrict the Windows process ACL

          This option (on Windows only) causes PuTTY (or another PuTTY tool) to try to lock down the operating system's access control on its own process. If this succeeds, it should present an extra obstacle to malware that has managed to run under the same user id as the PuTTY process, by preventing it from attaching to PuTTY using the same interfaces debuggers use and either reading sensitive information out of its memory or hijacking its network session.

          @@ -785,9 +794,8 @@

          3.11.3.27 A PuTTY process started with -restrict-acl will pass that on to any processes started with Duplicate Session, New Session etc. (However, if you're invoking PuTTY tools explicitly, for instance as a proxy command, you'll need to arrange to pass them the -restrict-acl option yourself, if that's what you want.)

          -If Pageant is started with the -restrict-acl option, and you use it to launch a PuTTY session from its System Tray submenu, then Pageant will not default to starting the PuTTY subprocess with a restricted ACL. This is because PuTTY is more likely to suffer reduced functionality as a result of restricted ACLs (e.g. screen reader software will have a greater need to interact with it), whereas Pageant stores the more critical information (hence benefits more from the extra protection), so it's reasonable to want to run Pageant but not PuTTY with the ACL restrictions. You can force Pageant to start subsidiary PuTTY processes with a restricted ACL if you also pass the -restrict-putty-acl option. +If Pageant is started with the -restrict-acl option, and you use it to launch a PuTTY session from its System Tray submenu, then Pageant will not default to starting the PuTTY subprocess with a restricted ACL. This is because PuTTY is more likely to suffer reduced functionality as a result of restricted ACLs (e.g. screen reader software will have a greater need to interact with it), whereas Pageant stores the more critical information (hence benefits more from the extra protection), so it's reasonable to want to run Pageant but not PuTTY with the ACL restrictions. You can force Pageant to start subsidiary PuTTY processes with a restricted ACL if you also pass the -restrict-putty-acl option.

          -

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          -[PuTTY release 0.76]
          +

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          diff --git a/code/doc/Chapter4.html b/code/doc/html/Chapter4.html similarity index 85% rename from code/doc/Chapter4.html rename to code/doc/html/Chapter4.html index 00f46d7..faaf54b 100644 --- a/code/doc/Chapter4.html +++ b/code/doc/html/Chapter4.html @@ -48,11 +48,12 @@
        • 4.4.1 Changing the action of the Backspace key
        • 4.4.2 Changing the action of the Home and End keys
        • 4.4.3 Changing the action of the function keys and keypad
        • -
        • 4.4.4 Controlling Application Cursor Keys mode
        • -
        • 4.4.5 Controlling Application Keypad mode
        • -
        • 4.4.6 Using NetHack keypad mode
        • -
        • 4.4.7 Enabling a DEC-like Compose key
        • -
        • 4.4.8 ‘Control-Alt is different from AltGr’
        • +
        • 4.4.4 Changing the action of the shifted arrow keys
        • +
        • 4.4.5 Controlling Application Cursor Keys mode
        • +
        • 4.4.6 Controlling Application Keypad mode
        • +
        • 4.4.7 Using NetHack keypad mode
        • +
        • 4.4.8 Enabling a DEC-like Compose key
        • +
        • 4.4.9 ‘Control-Alt is different from AltGr’
      • 4.5 The Bell panel
      • 4.27 The ‘Bare ssh-connection’ protocol
      • 4.28 The Serial panel @@ -634,11 +636,28 @@

        4.4.3 Changing the action
      • In SCO mode, the function keys F1 to F12 generate ESC [M through to ESC [X. Together with shift, they generate ESC [Y through to ESC [j. With control they generate ESC [k through to ESC [v, and with shift and control together they generate ESC [w through to ESC [{.
      • +
      • +In Xterm 216 mode, the unshifted function keys behave the same as Xterm R6 mode. But pressing a function key together with Shift or Alt or Ctrl generates a different sequence containing an extra numeric parameter of the form (1 for Shift) + (2 for Alt) + (4 for Ctrl) + 1. For F1-F4, the basic sequences like ESC OP become ESC [1;bitmapP and similar; for F5 and above, ESC[index~ becomes ESC[index;bitmap~. +
      • +

      +

      +If you don't know what any of this means, you probably don't need to fiddle with it. +

      +

      4.4.4 Changing the action of the shifted arrow keys

      +

      +This option affects the arrow keys, if you press one with any of the modifier keys Shift, Ctrl or Alt held down. +

      +
      • +In the default mode, labelled Ctrl toggles app mode, the Ctrl key toggles between the default arrow-key sequences like ESC [A and ESC [B, and the sequences Digital's terminals generate in ‘application cursor keys’ mode, i.e. ESC O A and so on. Shift and Alt have no effect. +
      • +
      • +In the ‘xterm-style bitmap’ mode, Shift, Ctrl and Alt all generate different sequences, with a number indicating which set of modifiers is active. +

      If you don't know what any of this means, you probably don't need to fiddle with it.

      -

      4.4.4 Controlling Application Cursor Keys mode

      +

      4.4.5 Controlling Application Cursor Keys mode

      Application Cursor Keys mode is a way for the server to change the control sequences sent by the arrow keys. In normal mode, the arrow keys send ESC [A through to ESC [D. In application mode, they send ESC OA through to ESC OD.

      @@ -648,12 +667,12 @@

      4.4.4 Controlling You can also disable application cursor keys mode completely, using the ‘Features’ configuration panel; see section 4.6.1.

      -

      4.4.5 Controlling Application Keypad mode

      +

      4.4.6 Controlling Application Keypad mode

      Application Keypad mode is a way for the server to change the behaviour of the numeric keypad.

      -In normal mode, the keypad behaves like a normal Windows keypad: with NumLock on, the number keys generate numbers, and with NumLock off they act like the arrow keys and Home, End etc. +In normal mode, the keypad behaves like a normal Windows keypad: with NumLock on, the number keys generate numbers, and with NumLock off they act like the arrow keys and Home, End etc.

      In application mode, all the keypad keys send special control sequences, including Num Lock. Num Lock stops behaving like Num Lock and becomes another function key. @@ -667,7 +686,7 @@

      4.4.5 Controlling You can also disable application keypad mode completely, using the ‘Features’ configuration panel; see section 4.6.1.

      -

      4.4.6 Using NetHack keypad mode

      +

      4.4.7 Using NetHack keypad mode

      PuTTY has a special mode for playing NetHack. You can enable it by selecting ‘NetHack’ in the ‘Initial state of numeric keypad’ control.

      @@ -678,16 +697,16 @@

      4.4.6 Using In addition, pressing Shift or Ctrl with the keypad keys generate the Shift- or Ctrl-keys you would expect (e.g. keypad-7 generates ‘y’, so Shift-keypad-7 generates ‘Y’ and Ctrl-keypad-7 generates Ctrl-Y); these commands tell NetHack to keep moving you in the same direction until you encounter something interesting.

      -For some reason, this feature only works properly when Num Lock is on. We don't know why. +For some reason, this feature only works properly when Num Lock is on. We don't know why.

      -

      4.4.7 Enabling a DEC-like Compose key

      +

      4.4.8 Enabling a DEC-like Compose key

      -DEC terminals have a Compose key, which provides an easy-to-remember way of typing accented characters. You press Compose and then type two more characters. The two characters are ‘combined’ to produce an accented character. The choices of character are designed to be easy to remember; for example, composing ‘e’ and ‘`’ produces the ‘è’ character. +DEC terminals have a Compose key, which provides an easy-to-remember way of typing accented characters. You press Compose and then type two more characters. The two characters are ‘combined’ to produce an accented character. The choices of character are designed to be easy to remember; for example, composing ‘e’ and ‘`’ produces the ‘è’ character.

      -If your keyboard has a Windows Application key, it acts as a Compose key in PuTTY. Alternatively, if you enable the ‘AltGr acts as Compose key’ option, the AltGr key will become a Compose key. +If your keyboard has a Windows Application key, it acts as a Compose key in PuTTY. Alternatively, if you enable the ‘AltGr acts as Compose key’ option, the AltGr key will become a Compose key.

      -

      4.4.8 ‘Control-Alt is different from AltGr’

      +

      4.4.9 ‘Control-Alt is different from AltGr’

      Some old keyboards do not have an AltGr key, which can make it difficult to type some characters. PuTTY can be configured to treat the key combination Ctrl + Left Alt the same way as the AltGr key.

      @@ -698,36 +717,36 @@

      4.4.8 ‘Control-Alt i If you uncheck this box, Ctrl-Alt will become a synonym for AltGr, so you can use it to type extra graphic characters if your keyboard has any.

      -(However, Ctrl-Alt will never act as a Compose key, regardless of the setting of ‘AltGr acts as Compose key’ described in section 4.4.7.) +(However, Ctrl-Alt will never act as a Compose key, regardless of the setting of ‘AltGr acts as Compose key’ described in section 4.4.8.)

      4.5 The Bell panel

      -The Bell panel controls the terminal bell feature: the server's ability to cause PuTTY to beep at you. +The Bell panel controls the terminal bell feature: the server's ability to cause PuTTY to beep at you.

      -In the default configuration, when the server sends the character with ASCII code 7 (Control-G), PuTTY will play the Windows Default Beep sound. This is not always what you want the terminal bell feature to do; the Bell panel allows you to configure alternative actions. +In the default configuration, when the server sends the character with ASCII code 7 (Control-G), PuTTY will play the Windows Default Beep sound. This is not always what you want the terminal bell feature to do; the Bell panel allows you to configure alternative actions.

      4.5.1 ‘Set the style of bell’

      This control allows you to select various different actions to occur on a terminal bell:

      • -Selecting ‘None’ disables the bell completely. In this mode, the server can send as many Control-G characters as it likes and nothing at all will happen. +Selecting ‘None’ disables the bell completely. In this mode, the server can send as many Control-G characters as it likes and nothing at all will happen.
      • ‘Make default system alert sound’ is the default setting. It causes the Windows ‘Default Beep’ sound to be played. To change what this sound is, or to test it if nothing seems to be happening, use the Sound configurer in the Windows Control Panel.
      • -‘Visual bell’ is a silent alternative to a beeping computer. In this mode, when the server sends a Control-G, the whole PuTTY window will flash white for a fraction of a second. +‘Visual bell’ is a silent alternative to a beeping computer. In this mode, when the server sends a Control-G, the whole PuTTY window will flash white for a fraction of a second.
      • -‘Beep using the PC speaker’ is self-explanatory. +‘Beep using the PC speaker’ is self-explanatory.
      • -‘Play a custom sound file’ allows you to specify a particular sound file to be used by PuTTY alone, or even by a particular individual PuTTY session. This allows you to distinguish your PuTTY beeps from any other beeps on the system. If you select this option, you will also need to enter the name of your sound file in the edit control ‘Custom sound file to play as a bell’. +‘Play a custom sound file’ allows you to specify a particular sound file to be used by PuTTY alone, or even by a particular individual PuTTY session. This allows you to distinguish your PuTTY beeps from any other beeps on the system. If you select this option, you will also need to enter the name of your sound file in the edit control ‘Custom sound file to play as a bell’.
      -

      4.5.2 ‘Taskbar/caption indication on bell’

      +

      4.5.2 ‘Taskbar/caption indication on bell’

      This feature controls what happens to the PuTTY window's entry in the Windows Taskbar if a bell occurs while the window does not have the input focus.

      @@ -740,12 +759,12 @@

      4.5.2 ‘4.5.3 ‘Control the bell overload behaviour’

      +

      4.5.3 ‘Control the bell overload behaviour’

      A common user error in a terminal session is to accidentally run the Unix command cat (or equivalent) on an inappropriate file type, such as an executable, image file, or ZIP file. This produces a huge stream of non-text characters sent to the terminal, which typically includes a lot of bell characters. As a result of this the terminal often doesn't stop beeping for ten minutes, and everybody else in the office gets annoyed.

      -To try to avoid this behaviour, or any other cause of excessive beeping, PuTTY includes a bell overload management feature. In the default configuration, receiving more than five bell characters in a two-second period will cause the overload feature to activate. Once the overload feature is active, further bells will have no effect at all, so the rest of your binary file will be sent to the screen in silence. After a period of five seconds during which no further bells are received, the overload feature will turn itself off again and bells will be re-enabled. +To try to avoid this behaviour, or any other cause of excessive beeping, PuTTY includes a bell overload management feature. In the default configuration, receiving more than five bell characters in a two-second period will cause the overload feature to activate. Once the overload feature is active, further bells will have no effect at all, so the rest of your binary file will be sent to the screen in silence. After a period of five seconds during which no further bells are received, the overload feature will turn itself off again and bells will be re-enabled.

      If you want this feature completely disabled, you can turn it off using the checkbox ‘Bell is temporarily disabled when over-used’. @@ -758,18 +777,18 @@

      4.5.3 ‘Control the <

      4.6 The Features panel

      -PuTTY's terminal emulation is very highly featured, and can do a lot of things under remote server control. Some of these features can cause problems due to buggy or strangely configured server applications. +PuTTY's terminal emulation is very highly featured, and can do a lot of things under remote server control. Some of these features can cause problems due to buggy or strangely configured server applications.

      The Features configuration panel allows you to disable some of PuTTY's more advanced terminal features, in case they cause trouble.

      4.6.1 Disabling application keypad and cursor keys

      -Application keypad mode (see section 4.4.5) and application cursor keys mode (see section 4.4.4) alter the behaviour of the keypad and cursor keys. Some applications enable these modes but then do not deal correctly with the modified keys. You can force these modes to be permanently disabled no matter what the server tries to do. +Application keypad mode (see section 4.4.6) and application cursor keys mode (see section 4.4.5) alter the behaviour of the keypad and cursor keys. Some applications enable these modes but then do not deal correctly with the modified keys. You can force these modes to be permanently disabled no matter what the server tries to do.

      -

      4.6.2 Disabling xterm-style mouse reporting

      +

      4.6.2 Disabling xterm-style mouse reporting

      -PuTTY allows the server to send control codes that let it take over the mouse and use it for purposes other than copy and paste. Applications which use this feature include the text-mode web browser links, the Usenet newsreader trn version 4, and the file manager mc (Midnight Commander). +PuTTY allows the server to send control codes that let it take over the mouse and use it for purposes other than copy and paste. Applications which use this feature include the text-mode web browser links, the Usenet newsreader trn version 4, and the file manager mc (Midnight Commander).

      If you find this feature inconvenient, you can disable it using the ‘Disable xterm-style mouse reporting’ control. With this box ticked, the mouse will always do copy and paste in the normal way. @@ -777,27 +796,27 @@

      4.6.2 Disabling Note that even if the application takes over the mouse, you can still manage PuTTY's copy and paste by holding down the Shift key while you select and paste, unless you have deliberately turned this feature off (see section 4.11.2).

      -

      4.6.3 Disabling remote terminal resizing

      +

      4.6.3 Disabling remote terminal resizing

      PuTTY has the ability to change the terminal's size and position in response to commands from the server. If you find PuTTY is doing this unexpectedly or inconveniently, you can tell PuTTY not to respond to those server commands.

      -

      4.6.4 Disabling switching to the alternate screen

      +

      4.6.4 Disabling switching to the alternate screen

      Many terminals, including PuTTY, support an ‘alternate screen’. This is the same size as the ordinary terminal screen, but separate. Typically a screen-based program such as a text editor might switch the terminal to the alternate screen before starting up. Then at the end of the run, it switches back to the primary screen, and you see the screen contents just as they were before starting the editor.

      Some people prefer this not to happen. If you want your editor to run in the same screen as the rest of your terminal activity, you can disable the alternate screen feature completely.

      -

      4.6.5 Disabling remote window title changing

      +

      4.6.5 Disabling remote window title changing

      PuTTY has the ability to change the window title in response to commands from the server. If you find PuTTY is doing this unexpectedly or inconveniently, you can tell PuTTY not to respond to those server commands.

      -

      4.6.6 Response to remote window title querying

      +

      4.6.6 Response to remote window title querying

      PuTTY can optionally provide the xterm service of allowing server applications to find out the local window title. This feature is disabled by default, but you can turn it on if you really want it.

      -NOTE that this feature is a potential security hazard. If a malicious application can write data to your terminal (for example, if you merely cat a file owned by someone else on the server machine), it can change your window title (unless you have disabled this as mentioned in section 4.6.5) and then use this service to have the new window title sent back to the server as if typed at the keyboard. This allows an attacker to fake keypresses and potentially cause your server-side applications to do things you didn't want. Therefore this feature is disabled by default, and we recommend you do not set it to ‘Window title’ unless you really know what you are doing. +NOTE that this feature is a potential security hazard. If a malicious application can write data to your terminal (for example, if you merely cat a file owned by someone else on the server machine), it can change your window title (unless you have disabled this as mentioned in section 4.6.5) and then use this service to have the new window title sent back to the server as if typed at the keyboard. This allows an attacker to fake keypresses and potentially cause your server-side applications to do things you didn't want. Therefore this feature is disabled by default, and we recommend you do not set it to ‘Window title’ unless you really know what you are doing.

      There are three settings for this option: @@ -821,52 +840,52 @@

      4.6.6 Response to PuTTY responds with the actual window title. This is dangerous for the reasons described above. -

      4.6.7 Disabling remote scrollback clearing

      +

      4.6.7 Disabling remote scrollback clearing

      PuTTY has the ability to clear the terminal's scrollback buffer in response to a command from the server. If you find PuTTY is doing this unexpectedly or inconveniently, you can tell PuTTY not to respond to that server command.

      -

      4.6.8 Disabling destructive backspace

      +

      4.6.8 Disabling destructive backspace

      Normally, when PuTTY receives character 127 (^?) from the server, it will perform a ‘destructive backspace’: move the cursor one space left and delete the character under it. This can apparently cause problems in some applications, so PuTTY provides the ability to configure character 127 to perform a normal backspace (without deleting a character) instead.

      -

      4.6.9 Disabling remote character set configuration

      +

      4.6.9 Disabling remote character set configuration

      -PuTTY has the ability to change its character set configuration in response to commands from the server. Some programs send these commands unexpectedly or inconveniently. In particular, BitchX (an IRC client) seems to have a habit of reconfiguring the character set to something other than the user intended. +PuTTY has the ability to change its character set configuration in response to commands from the server. Some programs send these commands unexpectedly or inconveniently. In particular, BitchX (an IRC client) seems to have a habit of reconfiguring the character set to something other than the user intended.

      If you find that accented characters are not showing up the way you expect them to, particularly if you're running BitchX, you could try disabling the remote character set configuration commands.

      -

      4.6.10 Disabling Arabic text shaping

      +

      4.6.10 Disabling Arabic text shaping

      -PuTTY supports shaping of Arabic text, which means that if your server sends text written in the basic Unicode Arabic alphabet then it will convert it to the correct display forms before printing it on the screen. +PuTTY supports shaping of Arabic text, which means that if your server sends text written in the basic Unicode Arabic alphabet then it will convert it to the correct display forms before printing it on the screen.

      -If you are using full-screen software which was not expecting this to happen (especially if you are not an Arabic speaker and you unexpectedly find yourself dealing with Arabic text files in applications which are not Arabic-aware), you might find that the display becomes corrupted. By ticking this box, you can disable Arabic text shaping so that PuTTY displays precisely the characters it is told to display. +If you are using full-screen software which was not expecting this to happen (especially if you are not an Arabic speaker and you unexpectedly find yourself dealing with Arabic text files in applications which are not Arabic-aware), you might find that the display becomes corrupted. By ticking this box, you can disable Arabic text shaping so that PuTTY displays precisely the characters it is told to display.

      You may also find you need to disable bidirectional text display; see section 4.6.11.

      -

      4.6.11 Disabling bidirectional text display

      +

      4.6.11 Disabling bidirectional text display

      -PuTTY supports bidirectional text display, which means that if your server sends text written in a language which is usually displayed from right to left (such as Arabic or Hebrew) then PuTTY will automatically flip it round so that it is displayed in the right direction on the screen. +PuTTY supports bidirectional text display, which means that if your server sends text written in a language which is usually displayed from right to left (such as Arabic or Hebrew) then PuTTY will automatically flip it round so that it is displayed in the right direction on the screen.

      -If you are using full-screen software which was not expecting this to happen (especially if you are not an Arabic speaker and you unexpectedly find yourself dealing with Arabic text files in applications which are not Arabic-aware), you might find that the display becomes corrupted. By ticking this box, you can disable bidirectional text display, so that PuTTY displays text from left to right in all situations. +If you are using full-screen software which was not expecting this to happen (especially if you are not an Arabic speaker and you unexpectedly find yourself dealing with Arabic text files in applications which are not Arabic-aware), you might find that the display becomes corrupted. By ticking this box, you can disable bidirectional text display, so that PuTTY displays text from left to right in all situations.

      You may also find you need to disable Arabic text shaping; see section 4.6.10.

      4.7 The Window panel

      -The Window configuration panel allows you to control aspects of the PuTTY window. +The Window configuration panel allows you to control aspects of the PuTTY window.

      -

      4.7.1 Setting the size of the PuTTY window

      +

      4.7.1 Setting the size of the PuTTY window

      -The ‘Columns’ and ‘Rows’ boxes let you set the PuTTY window to a precise size. Of course you can also drag the window to a new size while a session is running. +The ‘Columns’ and ‘Rows’ boxes let you set the PuTTY window to a precise size. Of course you can also drag the window to a new size while a session is running.

      4.7.2 What to do when the window is resized

      -These options allow you to control what happens when the user tries to resize the PuTTY window using its window furniture. +These options allow you to control what happens when the user tries to resize the PuTTY window using its window furniture.

      There are four options here: @@ -875,21 +894,21 @@

      4.7.2 What to do when ‘Change the number of rows and columns’: the font size will not change. (This is the default.)

    • -‘Change the size of the font’: the number of rows and columns in the terminal will stay the same, and the font size will change. +‘Change the size of the font’: the number of rows and columns in the terminal will stay the same, and the font size will change.
    • -‘Change font size when maximised’: when the window is resized, the number of rows and columns will change, except when the window is maximised (or restored), when the font size will change. (In this mode, holding down the Alt key while resizing will also cause the font size to change.) +‘Change font size when maximised’: when the window is resized, the number of rows and columns will change, except when the window is maximised (or restored), when the font size will change. (In this mode, holding down the Alt key while resizing will also cause the font size to change.)
    • ‘Forbid resizing completely’: the terminal will refuse to be resized at all.
    -

    4.7.3 Controlling scrollback

    +

    4.7.3 Controlling scrollback

    These options let you configure the way PuTTY keeps text after it scrolls off the top of the screen (see section 3.1.2).

    -The ‘Lines of scrollback’ box lets you configure how many lines of text PuTTY keeps. The ‘Display scrollbar’ options allow you to hide the scrollbar (although you can still view the scrollback using the keyboard as described in section 3.1.2). You can separately configure whether the scrollbar is shown in full-screen mode and in normal modes. +The ‘Lines of scrollback’ box lets you configure how many lines of text PuTTY keeps. The ‘Display scrollbar’ options allow you to hide the scrollbar (although you can still view the scrollback using the keyboard as described in section 3.1.2). You can separately configure whether the scrollbar is shown in full-screen mode and in normal modes.

    If you are viewing part of the scrollback when the server sends more text to PuTTY, the screen will revert to showing the current terminal contents. You can disable this behaviour by turning off ‘Reset scrollback on display activity’. You can also make the screen revert when you press a key, by turning on ‘Reset scrollback on keypress’. @@ -899,37 +918,37 @@

    4.7.4 ‘Pus When this option is enabled, the contents of the terminal screen will be pushed into the scrollback when a server-side application clears the screen, so that your scrollback will contain a better record of what was on your screen in the past.

    -If the application switches to the alternate screen (see section 4.6.4 for more about this), then the contents of the primary screen will be visible in the scrollback until the application switches back again. +If the application switches to the alternate screen (see section 4.6.4 for more about this), then the contents of the primary screen will be visible in the scrollback until the application switches back again.

    This option is enabled by default.

    4.8 The Appearance panel

    -The Appearance configuration panel allows you to control aspects of the appearance of PuTTY's window. +The Appearance configuration panel allows you to control aspects of the appearance of PuTTY's window.

    -

    4.8.1 Controlling the appearance of the cursor

    +

    4.8.1 Controlling the appearance of the cursor

    The ‘Cursor appearance’ option lets you configure the cursor to be a block, an underline, or a vertical line. A block cursor becomes an empty box when the window loses focus; an underline or a vertical line becomes dotted.

    -The ‘Cursor blinks’ option makes the cursor blink on and off. This works in any of the cursor modes. +The ‘Cursor blinks’ option makes the cursor blink on and off. This works in any of the cursor modes.

    -

    4.8.2 Controlling the font used in the terminal window

    +

    4.8.2 Controlling the font used in the terminal window

    -This option allows you to choose what font, in what size, the PuTTY terminal window uses to display the text in the session. +This option allows you to choose what font, in what size, the PuTTY terminal window uses to display the text in the session.

    By default, you will be offered a choice from all the fixed-width fonts installed on the system, since VT100-style terminal handling expects a fixed-width font. If you tick the box marked ‘Allow selection of variable-pitch fonts’, however, PuTTY will offer variable-width fonts as well: if you select one of these, the font will be coerced into fixed-size character cells, which will probably not look very good (but can work OK with some fonts).

    -

    4.8.3 ‘Hide mouse pointer when typing in window’

    +

    4.8.3 ‘Hide mouse pointer when typing in window’

    If you enable this option, the mouse pointer will disappear if the PuTTY window is selected and you press a key. This way, it will not obscure any of the text in the window while you work in your session. As soon as you move the mouse, the pointer will reappear.

    This option is disabled by default, so the mouse pointer remains visible at all times.

    -

    4.8.4 Controlling the window border

    +

    4.8.4 Controlling the window border

    PuTTY allows you to configure the appearance of the window border to some extent.

    @@ -941,57 +960,57 @@

    4.8.4 Controlling the

    4.9 The Behaviour panel

    -The Behaviour configuration panel allows you to control aspects of the behaviour of PuTTY's window. +The Behaviour configuration panel allows you to control aspects of the behaviour of PuTTY's window.

    -

    4.9.1 Controlling the window title

    +

    4.9.1 Controlling the window title

    -The ‘Window title’ edit box allows you to set the title of the PuTTY window. By default the window title will contain the host name followed by ‘PuTTY’, for example server1.example.com - PuTTY. If you want a different window title, this is where to set it. +The ‘Window title’ edit box allows you to set the title of the PuTTY window. By default the window title will contain the host name followed by ‘PuTTY’, for example server1.example.com - PuTTY. If you want a different window title, this is where to set it.

    -PuTTY allows the server to send xterm control sequences which modify the title of the window in mid-session (unless this is disabled - see section 4.6.5); the title string set here is therefore only the initial window title. +PuTTY allows the server to send xterm control sequences which modify the title of the window in mid-session (unless this is disabled - see section 4.6.5); the title string set here is therefore only the initial window title.

    -As well as the window title, there is also an xterm sequence to modify the title of the window's icon. This makes sense in a windowing system where the window becomes an icon when minimised, such as Windows 3.1 or most X Window System setups; but in the Windows 95-like user interface it isn't as applicable. +As well as the window title, there is also an xterm sequence to modify the title of the window's icon. This makes sense in a windowing system where the window becomes an icon when minimised, such as Windows 3.1 or most X Window System setups; but in the Windows 95-like user interface it isn't as applicable.

    -By default, PuTTY only uses the server-supplied window title, and ignores the icon title entirely. If for some reason you want to see both titles, check the box marked ‘Separate window and icon titles’. If you do this, PuTTY's window title and Taskbar caption will change into the server-supplied icon title if you minimise the PuTTY window, and change back to the server-supplied window title if you restore it. (If the server has not bothered to supply a window or icon title, none of this will happen.) +By default, PuTTY only uses the server-supplied window title, and ignores the icon title entirely. If for some reason you want to see both titles, check the box marked ‘Separate window and icon titles’. If you do this, PuTTY's window title and Taskbar caption will change into the server-supplied icon title if you minimise the PuTTY window, and change back to the server-supplied window title if you restore it. (If the server has not bothered to supply a window or icon title, none of this will happen.)

    -

    4.9.2 ‘Warn before closing window’

    +

    4.9.2 ‘Warn before closing window’

    -If you press the Close button in a PuTTY window that contains a running session, PuTTY will put up a warning window asking if you really meant to close the window. A window whose session has already terminated can always be closed without a warning. +If you press the Close button in a PuTTY window that contains a running session, PuTTY will put up a warning window asking if you really meant to close the window. A window whose session has already terminated can always be closed without a warning.

    If you want to be able to close a window quickly, you can disable the ‘Warn before closing window’ option.

    -

    4.9.3 ‘Window closes on ALT-F4’

    +

    4.9.3 ‘Window closes on ALT-F4’

    -By default, pressing ALT-F4 causes the window to close (or a warning box to appear; see section 4.9.2). If you disable the ‘Window closes on ALT-F4’ option, then pressing ALT-F4 will simply send a key sequence to the server. +By default, pressing ALT-F4 causes the window to close (or a warning box to appear; see section 4.9.2). If you disable the ‘Window closes on ALT-F4’ option, then pressing ALT-F4 will simply send a key sequence to the server.

    -

    4.9.4 ‘System menu appears on ALT-Space’

    +

    4.9.4 ‘System menu appears on ALT-Space’

    If this option is enabled, then pressing ALT-Space will bring up the PuTTY window's menu, like clicking on the top left corner. If it is disabled, then pressing ALT-Space will just send ESC SPACE to the server.

    -Some accessibility programs for Windows may need this option enabling to be able to control PuTTY's window successfully. For instance, Dragon NaturallySpeaking requires it both to open the system menu via voice, and to close, minimise, maximise and restore the window. +Some accessibility programs for Windows may need this option enabling to be able to control PuTTY's window successfully. For instance, Dragon NaturallySpeaking requires it both to open the system menu via voice, and to close, minimise, maximise and restore the window.

    -

    4.9.5 ‘System menu appears on Alt alone’

    +

    4.9.5 ‘System menu appears on Alt alone’

    If this option is enabled, then pressing and releasing ALT will bring up the PuTTY window's menu, like clicking on the top left corner. If it is disabled, then pressing and releasing ALT will have no effect.

    -

    4.9.6 ‘Ensure window is always on top’

    +

    4.9.6 ‘Ensure window is always on top’

    If this option is enabled, the PuTTY window will stay on top of all other windows.

    -

    4.9.7 ‘Full screen on Alt-Enter’

    +

    4.9.7 ‘Full screen on Alt-Enter’

    If this option is enabled, then pressing Alt-Enter will cause the PuTTY window to become full-screen. Pressing Alt-Enter again will restore the previous window size.

    -The full-screen feature is also available from the System menu, even when it is configured not to be available on the Alt-Enter key. See section 3.1.3.7. +The full-screen feature is also available from the System menu, even when it is configured not to be available on the Alt-Enter key. See section 3.1.3.7.

    4.10 The Translation panel

    -The Translation configuration panel allows you to control the translation between the character set understood by the server and the character set understood by PuTTY. +The Translation configuration panel allows you to control the translation between the character set understood by the server and the character set understood by PuTTY.

    4.10.1 Controlling character set translation

    @@ -1001,47 +1020,47 @@

    4.10.1 Controlling charac There are a lot of character sets to choose from. The ‘Remote character set’ option lets you select one.

    -By default PuTTY will use the UTF-8 encoding of Unicode, which can represent pretty much any character; data coming from the server is interpreted as UTF-8, and keystrokes are sent UTF-8 encoded. This is what most modern distributions of Linux will expect by default. However, if this is wrong for your server, you can select a different character set using this control. +By default PuTTY will use the UTF-8 encoding of Unicode, which can represent pretty much any character; data coming from the server is interpreted as UTF-8, and keystrokes are sent UTF-8 encoded. This is what most modern distributions of Linux will expect by default. However, if this is wrong for your server, you can select a different character set using this control.

    A few other notable character sets are:

    • -The ISO-8859 series are all standard character sets that include various accented characters appropriate for different sets of languages. +The ISO-8859 series are all standard character sets that include various accented characters appropriate for different sets of languages.
    • -The Win125x series are defined by Microsoft, for similar purposes. In particular Win1252 is almost equivalent to ISO-8859-1, but contains a few extra characters such as matched quotes and the Euro symbol. +The Win125x series are defined by Microsoft, for similar purposes. In particular Win1252 is almost equivalent to ISO-8859-1, but contains a few extra characters such as matched quotes and the Euro symbol.
    • -If you want the old IBM PC character set with block graphics and line-drawing characters, you can select ‘CP437’. +If you want the old IBM PC character set with block graphics and line-drawing characters, you can select ‘CP437’.

    -If you need support for a numeric code page which is not listed in the drop-down list, such as code page 866, then you can try entering its name manually (CP866 for example) in the list box. If the underlying version of Windows has the appropriate translation table installed, PuTTY will use it. +If you need support for a numeric code page which is not listed in the drop-down list, such as code page 866, then you can try entering its name manually (CP866 for example) in the list box. If the underlying version of Windows has the appropriate translation table installed, PuTTY will use it.

    -

    4.10.2 ‘Treat CJK ambiguous characters as wide’

    +

    4.10.2 ‘Treat CJK ambiguous characters as wide’

    -There are some Unicode characters whose width is not well-defined. In most contexts, such characters should be treated as single-width for the purposes of wrapping and so on; however, in some CJK contexts, they are better treated as double-width for historical reasons, and some server-side applications may expect them to be displayed as such. Setting this option will cause PuTTY to take the double-width interpretation. +There are some Unicode characters whose width is not well-defined. In most contexts, such characters should be treated as single-width for the purposes of wrapping and so on; however, in some CJK contexts, they are better treated as double-width for historical reasons, and some server-side applications may expect them to be displayed as such. Setting this option will cause PuTTY to take the double-width interpretation.

    If you use legacy CJK applications, and you find your lines are wrapping in the wrong places, or you are having other display problems, you might want to play with this setting.

    -This option only has any effect in UTF-8 mode (see section 4.10.1). +This option only has any effect in UTF-8 mode (see section 4.10.1).

    -

    4.10.3 ‘Caps Lock acts as Cyrillic switch’

    +

    4.10.3 ‘Caps Lock acts as Cyrillic switch’

    -This feature allows you to switch between a US/UK keyboard layout and a Cyrillic keyboard layout by using the Caps Lock key, if you need to type (for example) Russian and English side by side in the same document. +This feature allows you to switch between a US/UK keyboard layout and a Cyrillic keyboard layout by using the Caps Lock key, if you need to type (for example) Russian and English side by side in the same document.

    Currently this feature is not expected to work properly if your native keyboard layout is not US or UK.

    -

    4.10.4 Controlling display of line-drawing characters

    +

    4.10.4 Controlling display of line-drawing characters

    -VT100-series terminals allow the server to send control sequences that shift temporarily into a separate character set for drawing simple lines and boxes. However, there are a variety of ways in which PuTTY can attempt to find appropriate characters, and the right one to use depends on the locally configured font. In general you should probably try lots of options until you find one that your particular font supports. +VT100-series terminals allow the server to send control sequences that shift temporarily into a separate character set for drawing simple lines and boxes. However, there are a variety of ways in which PuTTY can attempt to find appropriate characters, and the right one to use depends on the locally configured font. In general you should probably try lots of options until you find one that your particular font supports.

    • -‘Use Unicode line drawing code points’ tries to use the box characters that are present in Unicode. For good Unicode-supporting fonts this is probably the most reliable and functional option. +‘Use Unicode line drawing code points’ tries to use the box characters that are present in Unicode. For good Unicode-supporting fonts this is probably the most reliable and functional option.
    • ‘Poor man's line drawing’ assumes that the font cannot generate the line and box characters at all, so it will use the +, - and | characters to draw approximations to boxes. You should use this option if none of the other options works. @@ -1056,9 +1075,9 @@

      4.10.4 Controlling displ ‘Use font in OEM mode only’ is more reliable than that, but can miss out other characters from the main character set.

    -

    4.10.5 Controlling copy and paste of line drawing characters

    +

    4.10.5 Controlling copy and paste of line drawing characters

    -By default, when you copy and paste a piece of the PuTTY screen that contains VT100 line and box drawing characters, PuTTY will paste them in the form they appear on the screen: either Unicode line drawing code points, or the ‘poor man's’ line-drawing characters +, - and |. The checkbox ‘Copy and paste VT100 line drawing chars as lqqqk’ disables this feature, so line-drawing characters will be pasted as the ASCII characters that were printed to produce them. This will typically mean they come out mostly as q and x, with a scattering of jklmntuvw at the corners. This might be useful if you were trying to recreate the same box layout in another program, for example. +By default, when you copy and paste a piece of the PuTTY screen that contains VT100 line and box drawing characters, PuTTY will paste them in the form they appear on the screen: either Unicode line drawing code points, or the ‘poor man's’ line-drawing characters +, - and |. The checkbox ‘Copy and paste VT100 line drawing chars as lqqqk’ disables this feature, so line-drawing characters will be pasted as the ASCII characters that were printed to produce them. This will typically mean they come out mostly as q and x, with a scattering of jklmntuvw at the corners. This might be useful if you were trying to recreate the same box layout in another program, for example.

    Note that this option only applies to line-drawing characters which were printed by using the VT100 mechanism. Line-drawing characters that were received as Unicode code points will paste as Unicode always. @@ -1078,27 +1097,27 @@

    4.10.6 Combining VT1

    4.11 The Selection panel

    -The Selection panel allows you to control the way copy and paste work in the PuTTY window. +The Selection panel allows you to control the way copy and paste work in the PuTTY window.

    4.11.1 Changing the actions of the mouse buttons

    -PuTTY's copy and paste mechanism is by default modelled on the Unix xterm application. The X Window System uses a three-button mouse, and the convention in that system is that the left button selects, the right button extends an existing selection, and the middle button pastes. +PuTTY's copy and paste mechanism is by default modelled on the Unix xterm application. The X Window System uses a three-button mouse, and the convention in that system is that the left button selects, the right button extends an existing selection, and the middle button pastes.

    -Windows often only has two mouse buttons, so when run on Windows, PuTTY is configurable. In PuTTY's default configuration (‘Compromise’), the right button pastes, and the middle button (if you have one) extends a selection. +Windows often only has two mouse buttons, so when run on Windows, PuTTY is configurable. In PuTTY's default configuration (‘Compromise’), the right button pastes, and the middle button (if you have one) extends a selection.

    -If you have a three-button mouse and you are already used to the xterm arrangement, you can select it using the ‘Action of mouse buttons’ control. +If you have a three-button mouse and you are already used to the xterm arrangement, you can select it using the ‘Action of mouse buttons’ control.

    -Alternatively, with the ‘Windows’ option selected, the middle button extends, and the right button brings up a context menu (on which one of the options is ‘Paste’). (This context menu is always available by holding down Ctrl and right-clicking, regardless of the setting of this option.) +Alternatively, with the ‘Windows’ option selected, the middle button extends, and the right button brings up a context menu (on which one of the options is ‘Paste’). (This context menu is always available by holding down Ctrl and right-clicking, regardless of the setting of this option.)

    -(When PuTTY iself is running on Unix, it follows the X Window System convention.) +(When PuTTY itself is running on Unix, it follows the X Window System convention.)

    4.11.2 ‘Shift overrides application's use of mouse’

    -PuTTY allows the server to send control codes that let it take over the mouse and use it for purposes other than copy and paste. Applications which use this feature include the text-mode web browser links, the Usenet newsreader trn version 4, and the file manager mc (Midnight Commander). +PuTTY allows the server to send control codes that let it take over the mouse and use it for purposes other than copy and paste. Applications which use this feature include the text-mode web browser links, the Usenet newsreader trn version 4, and the file manager mc (Midnight Commander).

    When running one of these applications, pressing the mouse buttons no longer performs copy and paste. If you do need to copy and paste, you can still do so if you hold down Shift while you do your mouse clicks. @@ -1114,7 +1133,7 @@

    4.11.3 Default selecti As described in section 3.1.1, PuTTY has two modes of selecting text to be copied to the clipboard. In the default mode (‘Normal’), dragging the mouse from point A to point B selects to the end of the line containing A, all the lines in between, and from the very beginning of the line containing B. In the other mode (‘Rectangular block’), dragging the mouse between two points defines a rectangle, and everything within that rectangle is copied.

    -Normally, you have to hold down Alt while dragging the mouse to select a rectangular block. Using the ‘Default selection mode’ control, you can set rectangular selection as the default, and then you have to hold down Alt to get the normal behaviour. +Normally, you have to hold down Alt while dragging the mouse to select a rectangular block. Using the ‘Default selection mode’ control, you can set rectangular selection as the default, and then you have to hold down Alt to get the normal behaviour.

    4.11.4 Assigning copy and paste actions to clipboards

    @@ -1124,10 +1143,10 @@

    4.11.4 Assigning copy Most platforms, including Windows, have a single system clipboard. On these platforms, PuTTY provides a second clipboard-like facility by permitting you to paste the text you last selected in this window, whether or not it is currently also in the system clipboard. This is not enabled by default.

    -The X Window System (which underlies most Unix graphical interfaces) provides multiple clipboards (or ‘selections’), and many applications support more than one of them by a different user interface mechanism. When PuTTY itself is running on Unix, it has more configurability relating to these selections. +The X Window System (which underlies most Unix graphical interfaces) provides multiple clipboards (or ‘selections’), and many applications support more than one of them by a different user interface mechanism. When PuTTY itself is running on Unix, it has more configurability relating to these selections.

    -The two most commonly used selections are called ‘PRIMARY’ and ‘CLIPBOARD’; in applications supporting both, the usual behaviour is that PRIMARY is used by mouse-only actions (selecting text automatically copies it to PRIMARY, and middle-clicking pastes from PRIMARY), whereas CLIPBOARD is used by explicit Copy and Paste menu items or keypresses such as Ctrl-C and Ctrl-V. +The two most commonly used selections are called ‘PRIMARY’ and ‘CLIPBOARD’; in applications supporting both, the usual behaviour is that PRIMARY is used by mouse-only actions (selecting text automatically copies it to PRIMARY, and middle-clicking pastes from PRIMARY), whereas CLIPBOARD is used by explicit Copy and Paste menu items or keypresses such as Ctrl-C and Ctrl-V.

    4.11.4.1 ‘Auto-copy selected text’

    @@ -1138,19 +1157,19 @@

    4.11.4.1 

    4.11.4.2 Choosing a clipboard for UI actions

    -PuTTY has three user-interface actions which can be configured to paste into the terminal (not counting menu items). You can click whichever mouse button (if any) is configured to paste (see section 4.11.1); you can press Shift-Ins; or you can press Ctrl-Shift-V, although that action is not enabled by default. +PuTTY has three user-interface actions which can be configured to paste into the terminal (not counting menu items). You can click whichever mouse button (if any) is configured to paste (see section 4.11.1); you can press Shift-Ins; or you can press Ctrl-Shift-V, although that action is not enabled by default.

    -You can configure which of the available clipboards each of these actions pastes from (including turning the paste action off completely). On platforms with a single system clipboard (such as Windows), the available options are to paste from that clipboard or to paste from PuTTY's internal memory of the last selected text within that window. On X, the standard options are CLIPBOARD or PRIMARY. +You can configure which of the available clipboards each of these actions pastes from (including turning the paste action off completely). On platforms with a single system clipboard (such as Windows), the available options are to paste from that clipboard or to paste from PuTTY's internal memory of the last selected text within that window. On X, the standard options are CLIPBOARD or PRIMARY.

    (PRIMARY is conceptually similar in that it also refers to the last selected text – just across all applications instead of just this window.)

    -The two keyboard options each come with a corresponding key to copy to the same clipboard. Whatever you configure Shift-Ins to paste from, Ctrl-Ins will copy to the same location; similarly, Ctrl-Shift-C will copy to whatever Ctrl-Shift-V pastes from. +The two keyboard options each come with a corresponding key to copy to the same clipboard. Whatever you configure Shift-Ins to paste from, Ctrl-Ins will copy to the same location; similarly, Ctrl-Shift-C will copy to whatever Ctrl-Shift-V pastes from.

    -On X, you can also enter a selection name of your choice. For example, there is a rarely-used standard selection called ‘SECONDARY’, which Emacs (for example) can work with if you hold down the Meta key while dragging to select or clicking to paste; if you configure a PuTTY keyboard action to access this clipboard, then you can interoperate with other applications' use of it. Another thing you could do would be to invent a clipboard name yourself, to create a special clipboard shared only between instances of PuTTY, or between just instances configured in that particular way. +On X, you can also enter a selection name of your choice. For example, there is a rarely-used standard selection called ‘SECONDARY’, which Emacs (for example) can work with if you hold down the Meta key while dragging to select or clicking to paste; if you configure a PuTTY keyboard action to access this clipboard, then you can interoperate with other applications' use of it. Another thing you could do would be to invent a clipboard name yourself, to create a special clipboard shared only between instances of PuTTY, or between just instances configured in that particular way.

    4.11.5 ‘Permit control characters in pasted text’

    @@ -1168,19 +1187,19 @@

    4.12 The Copy panel<

    4.12.1 Character classes

    -PuTTY will select a word at a time in the terminal window if you double-click to begin the drag. This section allows you to control precisely what is considered to be a word. +PuTTY will select a word at a time in the terminal window if you double-click to begin the drag. This section allows you to control precisely what is considered to be a word.

    Each character is given a class, which is a small number (typically 0, 1 or 2). PuTTY considers a single word to be any number of adjacent characters in the same class. So by modifying the assignment of characters to classes, you can modify the word-by-word selection behaviour.

    -In the default configuration, the character classes are: +In the default configuration, the character classes are:

    • -Class 0 contains white space and control characters. +Class 0 contains white space and control characters.
    • -Class 1 contains most punctuation. +Class 1 contains most punctuation.
    • Class 2 contains letters, numbers and a few pieces of punctuation (the double quote, minus sign, period, forward slash and underscore). @@ -1196,32 +1215,32 @@

      4.12.1 Character clas This mechanism currently only covers ASCII characters, because it isn't feasible to expand the list to cover the whole of Unicode.

      -Character class definitions can be modified by control sequences sent by the server. This configuration option controls the default state, which will be restored when you reset the terminal (see section 3.1.3.6). However, if you modify this option in mid-session using ‘Change Settings’, it will take effect immediately. +Character class definitions can be modified by control sequences sent by the server. This configuration option controls the default state, which will be restored when you reset the terminal (see section 3.1.3.6). However, if you modify this option in mid-session using ‘Change Settings’, it will take effect immediately.

      -

      4.12.2 Copying in Rich Text Format

      +

      4.12.2 Copying in Rich Text Format

      -If you enable ‘Copy to clipboard in RTF as well as plain text’, PuTTY will write formatting information to the clipboard as well as the actual text you copy. The effect of this is that if you paste into (say) a word processor, the text will appear in the word processor in the same font, colour, and style (e.g. bold, underline) PuTTY was using to display it. +If you enable ‘Copy to clipboard in RTF as well as plain text’, PuTTY will write formatting information to the clipboard as well as the actual text you copy. The effect of this is that if you paste into (say) a word processor, the text will appear in the word processor in the same font, colour, and style (e.g. bold, underline) PuTTY was using to display it.

      This option can easily be inconvenient, so by default it is disabled.

      4.13 The Colours panel

      -The Colours panel allows you to control PuTTY's use of colour. +The Colours panel allows you to control PuTTY's use of colour.

      -

      4.13.1 ‘Allow terminal to specify ANSI colours’

      +

      4.13.1 ‘Allow terminal to specify ANSI colours’

      -This option is enabled by default. If it is disabled, PuTTY will ignore any control sequences sent by the server to request coloured text. +This option is enabled by default. If it is disabled, PuTTY will ignore any control sequences sent by the server to request coloured text.

      If you have a particularly garish application, you might want to turn this option off and make PuTTY only use the default foreground and background colours.

      -

      4.13.2 ‘Allow terminal to use xterm 256-colour mode’

      +

      4.13.2 ‘Allow terminal to use xterm 256-colour mode’

      This option is enabled by default. If it is disabled, PuTTY will ignore any control sequences sent by the server which use the extended 256-colour mode supported by recent versions of xterm.

      -If you have an application which is supposed to use 256-colour mode and it isn't working, you may find you need to tell your server that your terminal supports 256 colours. On Unix, you do this by ensuring that the setting of TERM describes a 256-colour-capable terminal. You can check this using a command such as infocmp: +If you have an application which is supposed to use 256-colour mode and it isn't working, you may find you need to tell your server that your terminal supports 256 colours. On Unix, you do this by ensuring that the setting of TERM describes a 256-colour-capable terminal. You can check this using a command such as infocmp:

      $ infocmp | grep colors
               colors#256, cols#80, it#8, lines#24, pairs#256,
      @@ -1235,51 +1254,51 @@ 

      4.13.3 ‘Allow te

      4.13.4 ‘Indicate bolded text by changing...’

      -When the server sends a control sequence indicating that some text should be displayed in bold, PuTTY can handle this in several ways. It can either change the font for a bold version, or use the same font in a brighter colour, or it can do both (brighten the colour and embolden the font). This control lets you choose which. +When the server sends a control sequence indicating that some text should be displayed in bold, PuTTY can handle this in several ways. It can either change the font for a bold version, or use the same font in a brighter colour, or it can do both (brighten the colour and embolden the font). This control lets you choose which.

      By default bold is indicated by colour, so non-bold text is displayed in light grey and bold text is displayed in bright white (and similarly in other colours). If you change the setting to ‘The font’ box, bold and non-bold text will be displayed in the same colour, and instead the font will change to indicate the difference. If you select ‘Both’, the font and the colour will both change.

      -Some applications rely on ‘bold black’ being distinguishable from a black background; if you choose ‘The font’, their text may become invisible. +Some applications rely on ‘bold black’ being distinguishable from a black background; if you choose ‘The font’, their text may become invisible.

      -

      4.13.5 ‘Attempt to use logical palettes’

      +

      4.13.5 ‘Attempt to use logical palettes’

      -Logical palettes are a mechanism by which a Windows application running on an 8-bit colour display can select precisely the colours it wants instead of going with the Windows standard defaults. +Logical palettes are a mechanism by which a Windows application running on an 8-bit colour display can select precisely the colours it wants instead of going with the Windows standard defaults.

      If you are not getting the colours you ask for on an 8-bit display, you can try enabling this option. However, be warned that it's never worked very well.

      -

      4.13.6 ‘Use system colours’

      +

      4.13.6 ‘Use system colours’

      -Enabling this option will cause PuTTY to ignore the configured colours for ‘Default Background/Foreground’ and ‘Cursor Colour/Text’ (see section 4.13.7), instead going with the system-wide defaults. +Enabling this option will cause PuTTY to ignore the configured colours for ‘Default Background/Foreground’ and ‘Cursor Colour/Text’ (see section 4.13.7), instead going with the system-wide defaults.

      -Note that non-bold and bold text will be the same colour if this option is enabled. You might want to change to indicating bold text by font changes (see section 4.13.4). +Note that non-bold and bold text will be the same colour if this option is enabled. You might want to change to indicating bold text by font changes (see section 4.13.4).

      -

      4.13.7 Adjusting the colours in the terminal window

      +

      4.13.7 Adjusting the colours in the terminal window

      -The main colour control allows you to specify exactly what colours things should be displayed in. To modify one of the PuTTY colours, use the list box to select which colour you want to modify. The RGB values for that colour will appear on the right-hand side of the list box. Now, if you press the ‘Modify’ button, you will be presented with a colour selector, in which you can choose a new colour to go in place of the old one. (You may also edit the RGB values directly in the edit boxes, if you wish; each value is an integer from 0 to 255.) +The main colour control allows you to specify exactly what colours things should be displayed in. To modify one of the PuTTY colours, use the list box to select which colour you want to modify. The RGB values for that colour will appear on the right-hand side of the list box. Now, if you press the ‘Modify’ button, you will be presented with a colour selector, in which you can choose a new colour to go in place of the old one. (You may also edit the RGB values directly in the edit boxes, if you wish; each value is an integer from 0 to 255.)

      -PuTTY allows you to set the cursor colour, the default foreground and background, and the precise shades of all the ANSI configurable colours (black, red, green, yellow, blue, magenta, cyan, and white). You can also modify the precise shades used for the bold versions of these colours; these are used to display bold text if you have chosen to indicate that by colour (see section 4.13.4), and can also be used if the server asks specifically to use them. (Note that ‘Default Bold Background’ is not the background colour used for bold text; it is only used if the server specifically asks for a bold background.) +PuTTY allows you to set the cursor colour, the default foreground and background, and the precise shades of all the ANSI configurable colours (black, red, green, yellow, blue, magenta, cyan, and white). You can also modify the precise shades used for the bold versions of these colours; these are used to display bold text if you have chosen to indicate that by colour (see section 4.13.4), and can also be used if the server asks specifically to use them. (Note that ‘Default Bold Background’ is not the background colour used for bold text; it is only used if the server specifically asks for a bold background.)

      4.14 The Connection panel

      -The Connection panel allows you to configure options that apply to more than one type of connection. +The Connection panel allows you to configure options that apply to more than one type of connection.

      -

      4.14.1 Using keepalives to prevent disconnection

      +

      4.14.1 Using keepalives to prevent disconnection

      If you find your sessions are closing unexpectedly (most often with ‘Connection reset by peer’) after they have been idle for a while, you might want to try using this option.

      -Some network routers and firewalls need to keep track of all connections through them. Usually, these firewalls will assume a connection is dead if no data is transferred in either direction after a certain time interval. This can cause PuTTY sessions to be unexpectedly closed by the firewall if no traffic is seen in the session for some time. +Some network routers and firewalls need to keep track of all connections through them. Usually, these firewalls will assume a connection is dead if no data is transferred in either direction after a certain time interval. This can cause PuTTY sessions to be unexpectedly closed by the firewall if no traffic is seen in the session for some time.

      -The keepalive option (‘Seconds between keepalives’) allows you to configure PuTTY to send data through the session at regular intervals, in a way that does not disrupt the actual terminal session. If you find your firewall is cutting idle connections off, you can try entering a non-zero value in this field. The value is measured in seconds; so, for example, if your firewall cuts connections off after ten minutes then you might want to enter 300 seconds (5 minutes) in the box. +The keepalive option (‘Seconds between keepalives’) allows you to configure PuTTY to send data through the session at regular intervals, in a way that does not disrupt the actual terminal session. If you find your firewall is cutting idle connections off, you can try entering a non-zero value in this field. The value is measured in seconds; so, for example, if your firewall cuts connections off after ten minutes then you might want to enter 300 seconds (5 minutes) in the box.

      -Note that keepalives are not always helpful. They help if you have a firewall which drops your connection after an idle period; but if the network between you and the server suffers from breaks in connectivity then keepalives can actually make things worse. If a session is idle, and connectivity is temporarily lost between the endpoints, but the connectivity is restored before either side tries to send anything, then there will be no problem - neither endpoint will notice that anything was wrong. However, if one side does send something during the break, it will repeatedly try to re-send, and eventually give up and abandon the connection. Then when connectivity is restored, the other side will find that the first side doesn't believe there is an open connection any more. Keepalives can make this sort of problem worse, because they increase the probability that PuTTY will attempt to send data during a break in connectivity. (Other types of periodic network activity can cause this behaviour; in particular, SSH-2 re-keys can have this effect. See section 4.18.2.) +Note that keepalives are not always helpful. They help if you have a firewall which drops your connection after an idle period; but if the network between you and the server suffers from breaks in connectivity then keepalives can actually make things worse. If a session is idle, and connectivity is temporarily lost between the endpoints, but the connectivity is restored before either side tries to send anything, then there will be no problem - neither endpoint will notice that anything was wrong. However, if one side does send something during the break, it will repeatedly try to re-send, and eventually give up and abandon the connection. Then when connectivity is restored, the other side will find that the first side doesn't believe there is an open connection any more. Keepalives can make this sort of problem worse, because they increase the probability that PuTTY will attempt to send data during a break in connectivity. (Other types of periodic network activity can cause this behaviour; in particular, SSH-2 re-keys can have this effect. See section 4.18.2.)

      Therefore, you might find that keepalives help connection loss, or you might find they make it worse, depending on what kind of network problems you have between you and the server. @@ -1288,16 +1307,16 @@

      4.14.1 Using section 4.14.3.)

      -Note that if you are using SSH-1 and the server has a bug that makes it unable to deal with SSH-1 ignore messages (see section 4.26.11), enabling keepalives will have no effect. +Note that if you are using SSH-1 and the server has a bug that makes it unable to deal with SSH-1 ignore messages (see section 4.26.12), enabling keepalives will have no effect.

      -

      4.14.2 ‘Disable Nagle's algorithm’

      +

      4.14.2 ‘Disable Nagle's algorithm’

      -Nagle's algorithm is a detail of TCP/IP implementations that tries to minimise the number of small data packets sent down a network connection. With Nagle's algorithm enabled, PuTTY's bandwidth usage will be slightly more efficient; with it disabled, you may find you get a faster response to your keystrokes when connecting to some types of server. +Nagle's algorithm is a detail of TCP/IP implementations that tries to minimise the number of small data packets sent down a network connection. With Nagle's algorithm enabled, PuTTY's bandwidth usage will be slightly more efficient; with it disabled, you may find you get a faster response to your keystrokes when connecting to some types of server.

      -The Nagle algorithm is disabled by default for interactive connections. +The Nagle algorithm is disabled by default for interactive connections.

      -

      4.14.3 ‘Enable TCP keepalives’

      +

      4.14.3 ‘Enable TCP keepalives’

      NOTE: TCP keepalives should not be confused with the application-level keepalives described in section 4.14.1. If in doubt, you probably want application-level keepalives; TCP keepalives are provided for completeness.

      @@ -1315,22 +1334,22 @@

      4.14.3 ‘Enab

    -TCP keepalives may be more useful for ensuring that half-open connections are terminated than for keeping a connection alive. +TCP keepalives may be more useful for ensuring that half-open connections are terminated than for keeping a connection alive.

    TCP keepalives are disabled by default.

    -

    4.14.4 ‘Internet protocol version’

    +

    4.14.4 ‘Internet protocol version’

    -This option allows the user to select between the old and new Internet protocols and addressing schemes (IPv4 and IPv6). The selected protocol will be used for most outgoing network connections (including connections to proxies); however, tunnels have their own configuration, for which see section 4.25.2. +This option allows the user to select between the old and new Internet protocols and addressing schemes (IPv4 and IPv6). The selected protocol will be used for most outgoing network connections (including connections to proxies); however, tunnels have their own configuration, for which see section 4.25.2.

    -The default setting is ‘Auto’, which means PuTTY will do something sensible and try to guess which protocol you wanted. (If you specify a literal Internet address, it will use whichever protocol that address implies. If you provide a hostname, it will see what kinds of address exist for that hostname; it will use IPv6 if there is an IPv6 address available, and fall back to IPv4 if not.) +The default setting is ‘Auto’, which means PuTTY will do something sensible and try to guess which protocol you wanted. (If you specify a literal Internet address, it will use whichever protocol that address implies. If you provide a hostname, it will see what kinds of address exist for that hostname; it will use IPv6 if there is an IPv6 address available, and fall back to IPv4 if not.)

    If you need to force PuTTY to use a particular protocol, you can explicitly set this to ‘IPv4’ or ‘IPv6’.

    -

    4.14.5 ‘Logical name of remote host’

    +

    4.14.5 ‘Logical name of remote host’

    This allows you to tell PuTTY that the host it will really end up connecting to is different from where it thinks it is making a network connection.

    @@ -1338,7 +1357,7 @@

    4.14.5 localhost port 10022) were forwarded to a second machine's SSH port (say, foovax port 22), and then started a second PuTTY connecting to the forwarded port.

    -In normal usage, the second PuTTY will access the host key cache under the host name and port it actually connected to (i.e. localhost port 10022 in this example). Using the logical host name option, however, you can configure the second PuTTY to cache the host key under the name of the host you know that it's really going to end up talking to (here foovax). +In normal usage, the second PuTTY will access the host key cache under the host name and port it actually connected to (i.e. localhost port 10022 in this example). Using the logical host name option, however, you can configure the second PuTTY to cache the host key under the name of the host you know that it's really going to end up talking to (here foovax).

    This can be useful if you expect to connect to the same actual server through many different channels (perhaps because your port forwarding arrangements keep changing): by consistently setting the logical host name, you can arrange that PuTTY will not keep asking you to reconfirm its host key. Conversely, if you expect to use the same local port number for port forwardings to lots of different servers, you probably didn't want any particular server's host key cached under that local port number. (For this latter case, you could instead explicitly configure host keys in the relevant sessions; see section 4.19.3.) @@ -1356,7 +1375,7 @@

    4.15 The Data panel

    Each option on this panel applies to more than one protocol. Options which apply to only one protocol appear on that protocol's configuration panels.

    -

    4.15.1 ‘Auto-login username’

    +

    4.15.1 ‘Auto-login username’

    All three of the SSH, Telnet, and Rlogin protocols allow you to specify what user name you want to log in as, without having to type it explicitly every time. (Some Telnet servers don't support this.)

    @@ -1368,27 +1387,27 @@

    4.15.2 Use of s When the previous box (section 4.15.1) is left blank, by default, PuTTY will prompt for a username at the time you make a connection.

    -In some environments, such as the networks of large organisations implementing single sign-on, a more sensible default may be to use the name of the user logged in to the local operating system (if any); this is particularly likely to be useful with GSSAPI key exchange and user authentication (see section 4.22 and section 4.18.1.1). This control allows you to change the default behaviour. +In some environments, such as the networks of large organisations implementing single sign-on, a more sensible default may be to use the name of the user logged in to the local operating system (if any); this is particularly likely to be useful with GSSAPI key exchange and user authentication (see section 4.22 and section 4.18.1.1). This control allows you to change the default behaviour.

    The current system username is displayed in the dialog as a convenience. It is not saved in the configuration; if a saved session is later used by a different user, that user's name will be used.

    -

    4.15.3 ‘Terminal-type string’

    +

    4.15.3 ‘Terminal-type string’

    -Most servers you might connect to with PuTTY are designed to be connected to from lots of different types of terminal. In order to send the right control sequences to each one, the server will need to know what type of terminal it is dealing with. Therefore, each of the SSH, Telnet, and Rlogin protocols allow a text string to be sent down the connection describing the terminal. On a Unix server, this selects an entry from the termcap or terminfo database that tells applications what control sequences to send to the terminal, and what character sequences to expect the keyboard to generate. +Most servers you might connect to with PuTTY are designed to be connected to from lots of different types of terminal. In order to send the right control sequences to each one, the server will need to know what type of terminal it is dealing with. Therefore, each of the SSH, Telnet, and Rlogin protocols allow a text string to be sent down the connection describing the terminal. On a Unix server, this selects an entry from the termcap or terminfo database that tells applications what control sequences to send to the terminal, and what character sequences to expect the keyboard to generate.

    -PuTTY attempts to emulate the Unix xterm program, and by default it reflects this by sending xterm as a terminal-type string. If you find this is not doing what you want - perhaps the remote system reports ‘Unknown terminal type’ - you could try setting this to something different, such as vt220. +PuTTY attempts to emulate the Unix xterm program, and by default it reflects this by sending xterm as a terminal-type string. If you find this is not doing what you want - perhaps the remote system reports ‘Unknown terminal type’ - you could try setting this to something different, such as vt220.

    If you're not sure whether a problem is due to the terminal type setting or not, you probably need to consult the manual for your application or your server.

    -

    4.15.4 ‘Terminal speeds’

    +

    4.15.4 ‘Terminal speeds’

    The Telnet, Rlogin, and SSH protocols allow the client to specify terminal speeds to the server.

    -This parameter does not affect the actual speed of the connection, which is always ‘as fast as possible’; it is just a hint that is sometimes used by server software to modify its behaviour. For instance, if a slow speed is indicated, the server may switch to a less bandwidth-hungry display mode. +This parameter does not affect the actual speed of the connection, which is always ‘as fast as possible’; it is just a hint that is sometimes used by server software to modify its behaviour. For instance, if a slow speed is indicated, the server may switch to a less bandwidth-hungry display mode.

    The value is usually meaningless in a network environment, but PuTTY lets you configure it, in case you find the server is reacting badly to the default value. @@ -1399,12 +1418,12 @@

    4.15.4 ‘4.15.5 Setting environment variables on the server

    +

    4.15.5 Setting environment variables on the server

    The Telnet protocol provides a means for the client to pass environment variables to the server. Many Telnet servers have stopped supporting this feature due to security flaws, but PuTTY still supports it for the benefit of any servers which have found other ways around the security problems than just disabling the whole mechanism.

    -Version 2 of the SSH protocol also provides a similar mechanism, which is easier to implement without security flaws. Newer SSH-2 servers are more likely to support it than older ones. +Version 2 of the SSH protocol also provides a similar mechanism, which is easier to implement without security flaws. Newer SSH-2 servers are more likely to support it than older ones.

    This configuration data is not used in the SSH-1, rlogin or raw protocols. @@ -1414,7 +1433,7 @@

    4.15.5 Setting 4.16 The Proxy panel

    -The Proxy panel allows you to configure PuTTY to use various types of proxy in order to make its network connections. The settings in this panel affect the primary network connection forming your PuTTY session, and also any extra connections made as a result of SSH port forwarding (see section 3.5). +The Proxy panel allows you to configure PuTTY to use various types of proxy in order to make its network connections. The settings in this panel affect the primary network connection forming your PuTTY session, and also any extra connections made as a result of SSH port forwarding (see section 3.5).

    Note that unlike some software (such as web browsers), PuTTY does not attempt to automatically determine whether to use a proxy and (if so) which one to use for a given destination. If you need to use a proxy, it must always be explicitly configured. @@ -1424,21 +1443,25 @@

    4.16.1 Setting the pro The ‘Proxy type’ radio buttons allow you to configure what type of proxy you want PuTTY to use for its network connections. The default setting is ‘None’; in this mode no proxy is used for any connection.

    • -Selecting ‘HTTP’ allows you to proxy your connections through a web server supporting the HTTP CONNECT command, as documented in RFC 2817. +Selecting ‘HTTP’ allows you to proxy your connections through a web server supporting the HTTP CONNECT command, as documented in RFC 2817.
    • -Selecting ‘SOCKS 4’ or ‘SOCKS 5’ allows you to proxy your connections through a SOCKS server. +Selecting ‘SOCKS 4’ or ‘SOCKS 5’ allows you to proxy your connections through a SOCKS server.
    • -Many firewalls implement a less formal type of proxy in which a user can make a Telnet connection directly to the firewall machine and enter a command such as connect myhost.com 22 to connect through to an external host. Selecting ‘Telnet’ allows you to tell PuTTY to use this type of proxy. +Many firewalls implement a less formal type of proxy in which a user can make a Telnet or TCP connection directly to the firewall machine and enter a command such as connect myhost.com 22 to connect through to an external host. Selecting ‘Telnet’ allows you to tell PuTTY to use this type of proxy, with the precise command specified as described in section 4.16.5.
    • -Selecting ‘Local’ allows you to specify an arbitrary command on the local machine to act as a proxy. When the session is started, instead of creating a TCP connection, PuTTY runs the command (specified in section 4.16.5), and uses its standard input and output streams. +Selecting ‘SSH’ causes PuTTY to make a secondary SSH connection to the proxy host (sometimes called a ‘jump host’ in this context), and then open a port-forwarding channel to the final destination host.

      -This could be used, for instance, to talk to some kind of network proxy that PuTTY does not natively support; or you could tunnel a connection over something other than TCP/IP entirely. +The ‘Proxy hostname’ field will be interpreted as the name of a PuTTY saved session if one exists, or a hostname if not. This allows multi-hop jump paths, if the referenced saved session is itself configured to use an SSH proxy; and it allows combining SSH and non-SSH proxying.

      + +
    • +
    • +Selecting ‘Local’ allows you to specify an arbitrary command on the local machine to act as a proxy. When the session is started, instead of creating a TCP connection, PuTTY runs the command (specified in section 4.16.5), and uses its standard input and output streams.

      -If you want your local proxy command to make a secondary SSH connection to a proxy host and then tunnel the primary connection over that, you might well want the -nc command-line option in Plink. See section 3.11.3.14 for more information. +This could be used, for instance, to talk to some kind of network proxy that PuTTY does not natively support; or you could tunnel a connection over something other than TCP/IP entirely.

      You can also enable this mode on the command line; see section 3.11.3.26. @@ -1469,20 +1492,20 @@

      4.16.2 Excluding pa This excludes both of the above ranges at once.

      -Connections to the local host (the host name localhost, and any loopback IP address) are never proxied, even if the proxy exclude list does not explicitly contain them. It is very unlikely that this behaviour would ever cause problems, but if it does you can change it by enabling ‘Consider proxying local host connections’. +Connections to the local host (the host name localhost, and any loopback IP address) are never proxied, even if the proxy exclude list does not explicitly contain them. It is very unlikely that this behaviour would ever cause problems, but if it does you can change it by enabling ‘Consider proxying local host connections’.

      -Note that if you are doing DNS at the proxy (see section 4.16.3), you should make sure that your proxy exclusion settings do not depend on knowing the IP address of a host. If the name is passed on to the proxy without PuTTY looking it up, it will never know the IP address and cannot check it against your list. +Note that if you are doing DNS at the proxy (see section 4.16.3), you should make sure that your proxy exclusion settings do not depend on knowing the IP address of a host. If the name is passed on to the proxy without PuTTY looking it up, it will never know the IP address and cannot check it against your list.

      -

      4.16.3 Name resolution when using a proxy

      +

      4.16.3 Name resolution when using a proxy

      -If you are using a proxy to access a private network, it can make a difference whether DNS name resolution is performed by PuTTY itself (on the client machine) or performed by the proxy. +If you are using a proxy to access a private network, it can make a difference whether DNS name resolution is performed by PuTTY itself (on the client machine) or performed by the proxy.

      The ‘Do DNS name lookup at proxy end’ configuration option allows you to control this. If you set it to ‘No’, PuTTY will always do its own DNS, and will always pass an IP address to the proxy. If you set it to ‘Yes’, PuTTY will always pass host names straight to the proxy without trying to look them up first.

      -If you set this option to ‘Auto’ (the default), PuTTY will do something it considers appropriate for each type of proxy. Telnet, HTTP, and SOCKS5 proxies will have host names passed straight to them; SOCKS4 proxies will not. +If you set this option to ‘Auto’ (the default), PuTTY will do something it considers appropriate for each type of proxy. Most types of proxy (HTTP, SOCK5, SSH, Telnet, and local) will have host names passed straight to them; SOCKS4 proxies will not.

      Note that if you are doing DNS at the proxy, you should make sure that your proxy exclusion settings (see section 4.16.2) do not depend on knowing the IP address of a host. If the name is passed on to the proxy without PuTTY looking it up, it will never know the IP address and cannot check it against your list. @@ -1490,12 +1513,18 @@

      4.16.3 <

      The original SOCKS 4 protocol does not support proxy-side DNS. There is a protocol extension (SOCKS 4A) which does support it, but not all SOCKS 4 servers provide this extension. If you enable proxy DNS and your SOCKS 4 server cannot deal with it, this might be why.

      -

      4.16.4 Username and password

      -If your proxy requires authentication, you can enter a username and a password in the ‘Username’ and ‘Password’ boxes. +If you want to avoid PuTTY making any DNS query related to your destination host name (for example, because your local DNS resolver is very slow to return a negative response in that situation), then as well as setting this control to ‘Yes’, you may also need to turn off GSSAPI authentication and GSSAPI key exchange in SSH (see section 4.22 and section 4.18.1.1 respectively). This is because GSSAPI setup also involves a DNS query for the destination host name, and that query is performed by the separate GSSAPI library, so PuTTY can't override or reconfigure it. +

      +

      4.16.4 Username and password

      +

      +You can enter a username and a password in the ‘Username’ and ‘Password’ boxes, which will be used if your proxy requires authentication. +

      +

      +Note that if you save your session, the proxy password will be saved in plain text, so anyone who can access your PuTTY configuration data will be able to discover it.

      -Note that if you save your session, the proxy password will be saved in plain text, so anyone who can access your PuTTY configuration data will be able to discover it. +If PuTTY discovers that it needs a proxy username or password and you have not specified one here, PuTTY will prompt for it interactively in the terminal window.

      Authentication is not fully supported for all forms of proxy: @@ -1503,10 +1532,10 @@

      4.16.4
      • Username and password authentication is supported for HTTP proxies and SOCKS 5 proxies.
        • -With SOCKS 5, authentication is via CHAP if the proxy supports it (this is not supported in PuTTYtel); otherwise the password is sent to the proxy in plain text. +With SOCKS 5, authentication is via CHAP if the proxy supports it (this is not supported in PuTTYtel); otherwise the password is sent to the proxy in plain text.
        • -With HTTP proxying, the only currently supported authentication method is ‘basic’, where the password is sent to the proxy in plain text. +With HTTP proxying, authentication is via ‘HTTP Digest’ if possible (again, not supported in PuTTYtel), or ‘HTTP Basic’. In the latter case, the password is sent to the proxy in plain text.
        @@ -1515,21 +1544,24 @@

        4.16.4 SOCKS 4 can use the ‘Username’ field, but does not support passwords.

      • -You can specify a way to include a username and password in the Telnet/Local proxy command (see section 4.16.5). +SSH proxying can use all the same forms of SSH authentication supported by PuTTY for its main connection. If the SSH server requests password authentication, any configured proxy password will be used, but other authentication methods such as public keys and GSSAPI will be tried first, just as for a primary SSH connection, and if they require credentials such as a key passphrase, PuTTY will interactively prompt for these. +
      • +
      • +You can specify a way to include a username and password in the Telnet/Local proxy command (see section 4.16.5). If you do so, and don't also specify the actual username and/or password in the configuration, PuTTY will interactively prompt for them.

      4.16.5 Specifying the Telnet or Local proxy command

      -If you are using the Telnet proxy type, the usual command required by the firewall's Telnet server is connect, followed by a host name and a port number. If your proxy needs a different command, you can enter an alternative here. +If you are using the Telnet proxy type, the usual command required by the firewall's Telnet server is connect, followed by a host name and a port number. If your proxy needs a different command, you can enter an alternative here.

      -If you are using the Local proxy type, the local command to run is specified here. +If you are using the Local proxy type, the local command to run is specified here.

      In this string, you can use \n to represent a new-line, \r to represent a carriage return, \t to represent a tab character, and \x followed by two hex digits to represent any other character. \\ is used to encode the \ character itself.

      -Also, the special strings %host and %port will be replaced by the host name and port number you want to connect to. The strings %user and %pass will be replaced by the proxy username and password you specify. The strings %proxyhost and %proxyport will be replaced by the host details specified on the Proxy panel, if any (this is most likely to be useful for the Local proxy type). To get a literal % sign, enter %%. +Also, the special strings %host and %port will be replaced by the host name and port number you want to connect to. The strings %user and %pass will be replaced by the proxy username and password (which, if not specified in the configuration, will be prompted for). The strings %proxyhost and %proxyport will be replaced by the host details specified on the Proxy panel, if any (this is most likely to be useful for the Local proxy type). To get a literal % sign, enter %%.

      If a Telnet proxy server prompts for a username and password before commands can be sent, you can use a command such as: @@ -1537,9 +1569,9 @@

      4.16.5 Specifying t
      %user\n%pass\nconnect %host %port\n
       

      -This will send your username and password as the first two lines to the proxy, followed by a command to connect to the desired host and port. Note that if you do not include the %user or %pass tokens in the Telnet command, then the ‘Username’ and ‘Password’ configuration fields will be ignored. +This will send your username and password as the first two lines to the proxy, followed by a command to connect to the desired host and port. Note that if you do not include the %user or %pass tokens in the Telnet command, then anything specified in ‘Username’ and ‘Password’ configuration fields will be ignored.

      -

      4.16.6 Controlling proxy logging

      +

      4.16.6 Controlling proxy logging

      Often the proxy interaction has its own diagnostic output; this is particularly the case for local proxy commands.

      @@ -1551,21 +1583,21 @@

      4.16.6 Controlling

      4.17 The SSH panel

      -The SSH panel allows you to configure options that only apply to SSH sessions. +The SSH panel allows you to configure options that only apply to SSH sessions.

      4.17.1 Executing a specific command on the server

      -In SSH, you don't have to run a general shell session on the server. Instead, you can choose to run a single specific command (such as a mail user agent, for example). If you want to do this, enter the command in the ‘Remote command’ box. +In SSH, you don't have to run a general shell session on the server. Instead, you can choose to run a single specific command (such as a mail user agent, for example). If you want to do this, enter the command in the ‘Remote command’ box.

      Note that most servers will close the session after executing the command.

      -

      4.17.2 ‘Don't start a shell or command at all’

      +

      4.17.2 ‘Don't start a shell or command at all’

      -If you tick this box, PuTTY will not attempt to run a shell or command after connecting to the remote server. You might want to use this option if you are only using the SSH connection for port forwarding, and your user account on the server does not have the ability to run a shell. +If you tick this box, PuTTY will not attempt to run a shell or command after connecting to the remote server. You might want to use this option if you are only using the SSH connection for port forwarding, and your user account on the server does not have the ability to run a shell.

      -This feature is only available in SSH protocol version 2 (since the version 1 protocol assumes you will always want to run a shell). +This feature is only available in SSH protocol version 2 (since the version 1 protocol assumes you will always want to run a shell).

      This feature can also be enabled using the -N command-line option; see section 3.11.3.13. @@ -1573,13 +1605,13 @@

      4.17.2 ‘Don't s

      If you use this feature in Plink, you will not be able to terminate the Plink process by any graceful means; the only way to kill it will be by pressing Control-C or sending a kill signal from another program.

      -

      4.17.3 ‘Enable compression’

      +

      4.17.3 ‘Enable compression’

      -This enables data compression in the SSH connection: data sent by the server is compressed before sending, and decompressed at the client end. Likewise, data sent by PuTTY to the server is compressed first and the server decompresses it at the other end. This can help make the most of a low-bandwidth connection. +This enables data compression in the SSH connection: data sent by the server is compressed before sending, and decompressed at the client end. Likewise, data sent by PuTTY to the server is compressed first and the server decompresses it at the other end. This can help make the most of a low-bandwidth connection.

      -

      4.17.4 ‘SSH protocol version’

      +

      4.17.4 ‘SSH protocol version’

      -This allows you to select whether to use SSH protocol version 2 or the older version 1. +This allows you to select whether to use SSH protocol version 2 or the older version 1.

      You should normally leave this at the default of ‘2’. As well as having fewer features, the older SSH-1 protocol is no longer developed, has many known cryptographic weaknesses, and is generally not considered to be secure. PuTTY's protocol 1 implementation is provided mainly for compatibility, and is no longer being enhanced. @@ -1623,10 +1655,10 @@

      4.17.5 Sharing an SSH

      4.18 The Kex panel

      -The Kex panel (short for ‘key exchange’) allows you to configure options related to SSH-2 key exchange. +The Kex panel (short for ‘key exchange’) allows you to configure options related to SSH-2 key exchange.

      -Key exchange occurs at the start of an SSH connection (and occasionally thereafter); it establishes a shared secret that is used as the basis for all of SSH's security features. It is therefore very important for the security of the connection that the key exchange is secure. +Key exchange occurs at the start of an SSH connection (and occasionally thereafter); it establishes a shared secret that is used as the basis for all of SSH's security features. It is therefore very important for the security of the connection that the key exchange is secure.

      Key exchange is a cryptographically intensive process; if either the client or the server is a relatively slow machine, the slower methods may take several tens of seconds to complete. @@ -1640,7 +1672,7 @@

      4.18 The Kex panel

      This entire panel is only relevant to SSH protocol version 2; none of these settings affect SSH-1 at all.

      -

      4.18.1 Key exchange algorithm selection

      +

      4.18.1 Key exchange algorithm selection

      PuTTY supports a variety of SSH-2 key exchange methods, and allows you to choose which one you prefer to use; configuration is similar to cipher selection (see section 4.20).

      @@ -1648,7 +1680,7 @@

      4.18.1 elliptic curve Diffie-Hellman key exchange. +‘ECDH’: elliptic curve Diffie-Hellman key exchange.

    • ‘Group 14’: Diffie-Hellman key exchange with a well-known 2048-bit group. @@ -1657,10 +1689,10 @@

      4.18.1 Group exchange’: with this method, instead of using a fixed group, PuTTY requests that the server suggest a group to use for key exchange; the server can avoid groups known to be weak, and possibly invent new ones over time, without any changes required to PuTTY's configuration. We recommend use of this method instead of the well-known groups, if possible. +‘Group exchange’: with this method, instead of using a fixed group, PuTTY requests that the server suggest a group to use for key exchange; the server can avoid groups known to be weak, and possibly invent new ones over time, without any changes required to PuTTY's configuration. We recommend use of this method instead of the well-known groups, if possible.

    • -‘RSA key exchange’: this requires much less computational effort on the part of the client, and somewhat less on the part of the server, than Diffie-Hellman key exchange. +‘RSA key exchange’: this requires much less computational effort on the part of the client, and somewhat less on the part of the server, than Diffie-Hellman key exchange.
    • ‘GSSAPI key exchange’: see section 4.18.1.1. @@ -1677,7 +1709,7 @@

      4.18.1.1 GSSAPI- PuTTY can only perform the GSSAPI-authenticated key exchange methods when using Kerberos V5, and not other GSSAPI mechanisms. If the user running PuTTY has current Kerberos V5 credentials, then PuTTY will select the GSSAPI key exchange methods in preference to any of the ordinary SSH key exchange methods configured in the preference list.

      -The advantage of doing GSSAPI authentication as part of the SSH key exchange is apparent when you are using credential delegation (see section 4.22.1). The SSH key exchange can be repeated later in the session, and this allows your Kerberos V5 credentials (which are typically short-lived) to be automatically re-delegated to the server when they are refreshed on the client. (This feature is commonly referred to as ‘cascading credentials’.) +The advantage of doing GSSAPI authentication as part of the SSH key exchange is apparent when you are using credential delegation (see section 4.22.1). The SSH key exchange can be repeated later in the session, and this allows your Kerberos V5 credentials (which are typically short-lived) to be automatically re-delegated to the server when they are refreshed on the client. (This feature is commonly referred to as ‘cascading credentials’.)

      If your server doesn't support GSSAPI key exchange, it may still support GSSAPI in the SSH user authentication phase. This will still let you log in using your Kerberos credentials, but will only allow you to delegate the credentials that are active at the beginning of the session; they can't be refreshed automatically later, in a long-running session. @@ -1685,7 +1717,7 @@

      4.18.1.1 GSSAPI-

      Another effect of GSSAPI key exchange is that it replaces the usual SSH mechanism of permanent host keys described in section 2.2. So if you use this method, then you won't be asked any interactive questions about whether to accept the server's host key. Instead, the Kerberos exchange will verify the identity of the host you connect to, at the same time as verifying your identity to it.

      -

      4.18.2 Repeat key exchange

      +

      4.18.2 Repeat key exchange

      If the session key negotiated at connection startup is used too much or for too long, it may become feasible to mount attacks against the SSH connection. Therefore, the SSH-2 protocol specifies that a new key exchange should take place every so often; this can be initiated by either the client or the server.

      @@ -1700,7 +1732,7 @@

      4.18.2 keepalives aren't always helpful. If you anticipate suffering a network dropout of several hours in the middle of an SSH connection, but were not actually planning to send data down that connection during those hours, then an attempted rekey in the middle of the dropout will probably cause the connection to be abandoned, whereas if rekeys are disabled then the connection should in principle survive (in the absence of interfering firewalls). See section 4.14.1 for more discussion of these issues; for these purposes, rekeys have much the same properties as keepalives. (Except that rekeys have cryptographic value in themselves, so you should bear that in mind when deciding whether to turn them off.) Note, however, the the SSH server can still initiate rekeys. +You might have a need to disable time-based rekeys completely for the same reasons that keepalives aren't always helpful. If you anticipate suffering a network dropout of several hours in the middle of an SSH connection, but were not actually planning to send data down that connection during those hours, then an attempted rekey in the middle of the dropout will probably cause the connection to be abandoned, whereas if rekeys are disabled then the connection should in principle survive (in the absence of interfering firewalls). See section 4.14.1 for more discussion of these issues; for these purposes, rekeys have much the same properties as keepalives. (Except that rekeys have cryptographic value in themselves, so you should bear that in mind when deciding whether to turn them off.) Note, however, the the SSH server can still initiate rekeys.

      • ‘Minutes between GSSAPI checks’, if you're using GSSAPI key exchange, specifies how often the GSSAPI credential cache is checked to see whether new tickets are available for delegation, or current ones are near expiration. If forwarding of GSSAPI credentials is enabled, PuTTY will try to rekey as necessary to keep the delegated credentials from expiring. Frequent checks are recommended; rekeying only happens when needed. @@ -1724,19 +1756,19 @@

        4.18.2 integrity, and to a lesser extent, confidentiality of the SSH-2 protocol depend in part on rekeys occurring before a 32-bit packet sequence number wraps around. Unlike time-based rekeys, data-based rekeys won't occur when the SSH connection is idle, so they shouldn't cause the same problems. The SSH-1 protocol, incidentally, has even weaker integrity protection than SSH-2 without rekeys. +Disabling data-based rekeys entirely is a bad idea. The integrity, and to a lesser extent, confidentiality of the SSH-2 protocol depend in part on rekeys occurring before a 32-bit packet sequence number wraps around. Unlike time-based rekeys, data-based rekeys won't occur when the SSH connection is idle, so they shouldn't cause the same problems. The SSH-1 protocol, incidentally, has even weaker integrity protection than SSH-2 without rekeys.

        4.19 The Host Keys panel

        -The Host Keys panel allows you to configure options related to SSH-2 host key management. +The Host Keys panel allows you to configure options related to host key management.

        Host keys are used to prove the server's identity, and assure you that the server is not being spoofed (either by a man-in-the-middle attack or by completely replacing it on the network). See section 2.2 for a basic introduction to host keys.

        -This entire panel is only relevant to SSH protocol version 2; none of these settings affect SSH-1 at all. +Much of this panel is only relevant to SSH protocol version 2; SSH-1 only supports one type of host key.

        -

        4.19.1 Host key type selection

        +

        4.19.1 Host key type selection

        PuTTY supports a variety of SSH-2 host key types, and allows you to choose which one you prefer to use to identify the server. Configuration is similar to cipher selection (see section 4.20).

        @@ -1744,19 +1776,19 @@

        4.19.1
        • -‘Ed25519’: Edwards-curve DSA using a twisted Edwards curve with modulus 2^255-19. +‘Ed25519’: Edwards-curve DSA using a twisted Edwards curve with modulus 2^255-19.
        • -‘Ed448’: another Edwards-curve DSA type, using a larger elliptic curve with a 448-bit instead of 255-bit modulus (so it has a higher security level than Ed25519). +‘Ed448’: another Edwards-curve DSA type, using a larger elliptic curve with a 448-bit instead of 255-bit modulus (so it has a higher security level than Ed25519).
        • -‘ECDSA’: elliptic curve DSA using one of the NIST-standardised elliptic curves. +‘ECDSA’: elliptic curve DSA using one of the NIST-standardised elliptic curves.
        • -‘DSA’: straightforward DSA using modular exponentiation. +‘DSA’: straightforward DSA using modular exponentiation.
        • -‘RSA’: the ordinary RSA algorithm. +‘RSA’: the ordinary RSA algorithm.

        @@ -1770,7 +1802,7 @@

        4.19.1

        4.19.2 Preferring known host keys

        -By default, PuTTY will adjust the preference order for host key algorithms so that any host keys it already knows are moved to the top of the list. +By default, PuTTY will adjust the preference order for SSH-2 host key algorithms so that any host keys it already knows are moved to the top of the list.

        This prevents you from having to check and confirm a new host key for a server you already had one for (e.g. because the server has generated an alternative key of a type higher in PuTTY's preference order, or because you changed the preference order itself). @@ -1781,7 +1813,7 @@

        4.19.2

        For this reason, this policy is configurable. By turning this checkbox off, you can reset PuTTY to always use the exact order of host key algorithms configured in the preference list described in section 4.19.1, so that a listener will find out nothing about what keys you had stored.

        -

        4.19.3 Manually configuring host keys

        +

        4.19.3 Manually configuring host keys

        In some situations, if PuTTY's automated host key management is not doing what you need, you might need to manually configure PuTTY to accept a specific host key, or one of a specific set of host keys.

        @@ -1801,45 +1833,45 @@

        4.19.3
        • -An SHA-256-based host key fingerprint of the form displayed in PuTTY's Event Log and host key dialog boxes, i.e. ‘SHA256:’ followed by 43 case-sensitive characters. +An SHA-256-based host key fingerprint of the form displayed in PuTTY's Event Log and host key dialog boxes, i.e. ‘SHA256:’ followed by 43 case-sensitive characters.
        • -An MD5-based host key fingerprint, i.e. sixteen 2-digit hex numbers separated by colons, optionally preceded by the prefix ‘MD5:’. (The case of the characters does not matter.) +An MD5-based host key fingerprint, i.e. sixteen 2-digit hex numbers separated by colons, optionally preceded by the prefix ‘MD5:’. (The case of the characters does not matter.)
        • A base64-encoded blob describing an SSH-2 public key in OpenSSH's one-line public key format. How you acquire a public key in this format is server-dependent; on an OpenSSH server it can typically be found in a location like /etc/ssh/ssh_host_rsa_key.pub.

        -If this box contains at least one host key or fingerprint when PuTTY makes an SSH connection, then PuTTY's automated host key management is completely bypassed: the connection will be permitted if and only if the host key presented by the server is one of the keys listed in this box, and the host key store in the Registry will be neither read nor written, unless you explicitly do so. +If this box contains at least one host key or fingerprint when PuTTY makes an SSH connection, then PuTTY's automated host key management is completely bypassed: the connection will be permitted if and only if the host key presented by the server is one of the keys listed in this box, and the host key store in the Registry will be neither read nor written, unless you explicitly do so.

        If the box is empty (as it usually is), then PuTTY's automated host key management will work as normal.

        4.20 The Cipher panel

        -PuTTY supports a variety of different encryption algorithms, and allows you to choose which one you prefer to use. You can do this by dragging the algorithms up and down in the list box (or moving them using the Up and Down buttons) to specify a preference order. When you make an SSH connection, PuTTY will search down the list from the top until it finds an algorithm supported by the server, and then use that. +PuTTY supports a variety of different encryption algorithms, and allows you to choose which one you prefer to use. You can do this by dragging the algorithms up and down in the list box (or moving them using the Up and Down buttons) to specify a preference order. When you make an SSH connection, PuTTY will search down the list from the top until it finds an algorithm supported by the server, and then use that.

        PuTTY currently supports the following algorithms:

        • -ChaCha20-Poly1305, a combined cipher and MAC (SSH-2 only) +ChaCha20-Poly1305, a combined cipher and MAC (SSH-2 only)
        • -AES (Rijndael) - 256, 192, or 128-bit SDCTR or CBC (SSH-2 only) +AES (Rijndael) - 256, 192, or 128-bit SDCTR or CBC (SSH-2 only)
        • -Arcfour (RC4) - 256 or 128-bit stream cipher (SSH-2 only) +Arcfour (RC4) - 256 or 128-bit stream cipher (SSH-2 only)
        • -Blowfish - 256-bit SDCTR (SSH-2 only) or 128-bit CBC +Blowfish - 256-bit SDCTR (SSH-2 only) or 128-bit CBC
        • -Triple-DES - 168-bit SDCTR (SSH-2 only) or CBC +Triple-DES - 168-bit SDCTR (SSH-2 only) or CBC
        • -Single-DES - 56-bit CBC (see below for SSH-2) +Single-DES - 56-bit CBC (see below for SSH-2)

        @@ -1861,11 +1893,11 @@

        4.20 The Cipher pane

        4.21 The Auth panel

        -The Auth panel allows you to configure authentication options for SSH sessions. +The Auth panel allows you to configure authentication options for SSH sessions.

        4.21.1 ‘Display pre-authentication banner’

        -SSH-2 servers can provide a message for clients to display to the prospective user before the user logs in; this is sometimes known as a pre-authentication ‘banner’. Typically this is used to provide information about the server and legal notices. +SSH-2 servers can provide a message for clients to display to the prospective user before the user logs in; this is sometimes known as a pre-authentication ‘banner’. Typically this is used to provide information about the server and legal notices.

        By default, PuTTY displays this message before prompting for a password or similar credentials (although, unfortunately, not before prompting for a login name, due to the nature of the protocol design). By unchecking this option, display of the banner can be suppressed entirely. @@ -1915,53 +1947,53 @@

        4.21.4 ‘Attemp

        See chapter 9 for more information about Pageant in general.

        -

        4.21.5 ‘Attempt TIS or CryptoCard authentication’

        +

        4.21.5 ‘Attempt TIS or CryptoCard authentication’

        -TIS and CryptoCard authentication are (despite their names) generic forms of simple challenge/response authentication available in SSH protocol version 1 only. You might use them if you were using S/Key one-time passwords, for example, or if you had a physical security token that generated responses to authentication challenges. They can even be used to prompt for simple passwords. +TIS and CryptoCard authentication are (despite their names) generic forms of simple challenge/response authentication available in SSH protocol version 1 only. You might use them if you were using S/Key one-time passwords, for example, or if you had a physical security token that generated responses to authentication challenges. They can even be used to prompt for simple passwords.

        With this switch enabled, PuTTY will attempt these forms of authentication if the server is willing to try them. You will be presented with a challenge string (which may be different every time) and must supply the correct response in order to log in. If your server supports this, you should talk to your system administrator about precisely what form these challenges and responses take.

        -

        4.21.6 ‘Attempt keyboard-interactive authentication’

        +

        4.21.6 ‘Attempt keyboard-interactive authentication’

        -The SSH-2 equivalent of TIS authentication is called ‘keyboard-interactive’. It is a flexible authentication method using an arbitrary sequence of requests and responses; so it is not only useful for challenge/response mechanisms such as S/Key, but it can also be used for (for example) asking the user for a new password when the old one has expired. +The SSH-2 equivalent of TIS authentication is called ‘keyboard-interactive’. It is a flexible authentication method using an arbitrary sequence of requests and responses; so it is not only useful for challenge/response mechanisms such as S/Key, but it can also be used for (for example) asking the user for a new password when the old one has expired.

        PuTTY leaves this option enabled by default, but supplies a switch to turn it off in case you should have trouble with it.

        -

        4.21.7 ‘Allow agent forwarding’

        +

        4.21.7 ‘Allow agent forwarding’

        -This option allows the SSH server to open forwarded connections back to your local copy of Pageant. If you are not running Pageant, this option will do nothing. +This option allows the SSH server to open forwarded connections back to your local copy of Pageant. If you are not running Pageant, this option will do nothing.

        See chapter 9 for general information on Pageant, and section 9.4 for information on agent forwarding. Note that there is a security risk involved with enabling this option; see section 9.6 for details.

        -

        4.21.8 ‘Allow attempted changes of username in SSH-2’

        +

        4.21.8 ‘Allow attempted changes of username in SSH-2’

        In the SSH-1 protocol, it is impossible to change username after failing to authenticate. So if you mis-type your username at the PuTTY ‘login as:’ prompt, you will not be able to change it except by restarting PuTTY.

        -The SSH-2 protocol does allow changes of username, in principle, but does not make it mandatory for SSH-2 servers to accept them. In particular, OpenSSH does not accept a change of username; once you have sent one username, it will reject attempts to try to authenticate as another user. (Depending on the version of OpenSSH, it may quietly return failure for all login attempts, or it may send an error message.) +The SSH-2 protocol does allow changes of username, in principle, but does not make it mandatory for SSH-2 servers to accept them. In particular, OpenSSH does not accept a change of username; once you have sent one username, it will reject attempts to try to authenticate as another user. (Depending on the version of OpenSSH, it may quietly return failure for all login attempts, or it may send an error message.)

        For this reason, PuTTY will by default not prompt you for your username more than once, in case the server complains. If you know your server can cope with it, you can enable the ‘Allow attempted changes of username’ option to modify PuTTY's behaviour.

        -

        4.21.9 ‘Private key file for authentication’

        +

        4.21.9 ‘Private key file for authentication’

        -This box is where you enter the name of your private key file if you are using public key authentication. See chapter 8 for information about public key authentication in SSH. +This box is where you enter the name of your private key file if you are using public key authentication. See chapter 8 for information about public key authentication in SSH.

        -This key must be in PuTTY's native format (*.PPK). If you have a private key in another format that you want to use with PuTTY, see section 8.2.14. +This key must be in PuTTY's native format (*.PPK). If you have a private key in another format that you want to use with PuTTY, see section 8.2.14.

        -You can use the authentication agent Pageant so that you do not need to explicitly configure a key here; see chapter 9. +You can use the authentication agent Pageant so that you do not need to explicitly configure a key here; see chapter 9.

        If a private key file is specified here with Pageant running, PuTTY will first try asking Pageant to authenticate with that key, and ignore any other keys Pageant may have. If that fails, PuTTY will ask for a passphrase as normal. You can also specify a public key file in this case (in RFC 4716 or OpenSSH format), as that's sufficient to identify the key to Pageant, but of course if Pageant isn't present PuTTY can't fall back to using this file itself.

        -

        4.22 The GSSAPI panel

        +

        4.22 The GSSAPI panel

        -The ‘GSSAPI’ subpanel of the ‘Auth’ panel controls the use of GSSAPI authentication. This is a mechanism which delegates the authentication exchange to a library elsewhere on the client machine, which in principle can authenticate in many different ways but in practice is usually used with the Kerberos single sign-on protocol to implement passwordless login. +The ‘GSSAPI’ subpanel of the ‘Auth’ panel controls the use of GSSAPI authentication. This is a mechanism which delegates the authentication exchange to a library elsewhere on the client machine, which in principle can authenticate in many different ways but in practice is usually used with the Kerberos single sign-on protocol to implement passwordless login.

        GSSAPI authentication is only available in the SSH-2 protocol. @@ -1980,7 +2012,7 @@

        4.22 The 4.22.1 ‘Allow GSSAPI credential delegation’

        -GSSAPI credential delegation is a mechanism for passing on your Kerberos (or other) identity to the session on the SSH server. If you enable this option, then not only will PuTTY be able to log in automatically to a server that accepts your Kerberos credentials, but also you will be able to connect out from that server to other Kerberos-supporting services and use the same credentials just as automatically. +GSSAPI credential delegation is a mechanism for passing on your Kerberos (or other) identity to the session on the SSH server. If you enable this option, then not only will PuTTY be able to log in automatically to a server that accepts your Kerberos credentials, but also you will be able to connect out from that server to other Kerberos-supporting services and use the same credentials just as automatically.

        (This option is the Kerberos analogue of SSH agent forwarding; see section 9.4 for some information on that.) @@ -1996,26 +2028,26 @@

        4.22.2 GSSAPI is a mechanism which allows more than one authentication method to be accessed through the same interface. Therefore, more than one authentication library may exist on your system which can be accessed using GSSAPI.

        -PuTTY contains native support for a few well-known such libraries (including Windows' SSPI), and will look for all of them on your system and use whichever it finds. If more than one exists on your system and you need to use a specific one, you can adjust the order in which it will search using this preference list control. +PuTTY contains native support for a few well-known such libraries (including Windows' SSPI), and will look for all of them on your system and use whichever it finds. If more than one exists on your system and you need to use a specific one, you can adjust the order in which it will search using this preference list control.

        One of the options in the preference list is to use a user-specified GSSAPI library. If the library you want to use is not mentioned by name in PuTTY's list of options, you can enter its full pathname in the ‘User-supplied GSSAPI library path’ field, and move the ‘User-supplied GSSAPI library’ option in the preference list to make sure it is selected before anything else.

        -On Windows, such libraries are files with a .dll extension, and must have been built in the same way as the PuTTY executable you're running; if you have a 32-bit DLL, you must run a 32-bit version of PuTTY, and the same with 64-bit (see question A.6.10). On Unix, shared libraries generally have a .so extension. +On Windows, such libraries are files with a .dll extension, and must have been built in the same way as the PuTTY executable you're running; if you have a 32-bit DLL, you must run a 32-bit version of PuTTY, and the same with 64-bit (see question A.6.10). On Unix, shared libraries generally have a .so extension.

        4.23 The TTY panel

        The TTY panel lets you configure the remote pseudo-terminal.

        -

        4.23.1 ‘Don't allocate a pseudo-terminal’

        +

        4.23.1 ‘Don't allocate a pseudo-terminal’

        -When connecting to a Unix system, most interactive shell sessions are run in a pseudo-terminal, which allows the Unix system to pretend it's talking to a real physical terminal device but allows the SSH server to catch all the data coming from that fake device and send it back to the client. +When connecting to a Unix system, most interactive shell sessions are run in a pseudo-terminal, which allows the Unix system to pretend it's talking to a real physical terminal device but allows the SSH server to catch all the data coming from that fake device and send it back to the client.

        Occasionally you might find you have a need to run a session not in a pseudo-terminal. In PuTTY, this is generally only useful for very specialist purposes; although in Plink (see chapter 7) it is the usual way of working.

        -

        4.23.2 Sending terminal modes

        +

        4.23.2 Sending terminal modes

        The SSH protocol allows the client to send ‘terminal modes’ for the remote pseudo-terminal. These usually control the server's expectation of the local terminal's behaviour.

        @@ -2046,26 +2078,26 @@

        4.23.2 Sending POSIX and other Unix systems, and they are most likely to have a useful effect on such systems. (These are the same settings that can usually be changed using the stty command once logged in to such servers.) +The precise effect of each setting, if any, is up to the server. Their names come from POSIX and other Unix systems, and they are most likely to have a useful effect on such systems. (These are the same settings that can usually be changed using the stty command once logged in to such servers.)

        Some notable modes are described below; for fuller explanations, see your server documentation.

        • -ERASE is the character that when typed by the user will delete one space to the left. When set to ‘Auto’ (the default setting), this follows the setting of the local Backspace key in PuTTY (see section 4.4.1). +ERASE is the character that when typed by the user will delete one space to the left. When set to ‘Auto’ (the default setting), this follows the setting of the local Backspace key in PuTTY (see section 4.4.1).

          -This and other special characters are specified using ^C notation for Ctrl-C, and so on. Use ^<27> or ^<0x1B> to specify a character numerically, and ^~ to get a literal ^. Other non-control characters are denoted by themselves. Leaving the box entirely blank indicates that no character should be assigned to the specified function, although this may not be supported by all servers. +This and other special characters are specified using ^C notation for Ctrl-C, and so on. Use ^<27> or ^<0x1B> to specify a character numerically, and ^~ to get a literal ^. Other non-control characters are denoted by themselves. Leaving the box entirely blank indicates that no character should be assigned to the specified function, although this may not be supported by all servers.

        • -QUIT is a special character that usually forcefully ends the current process on the server (SIGQUIT). On many servers its default setting is Ctrl-backslash (^\), which is easy to accidentally invoke on many keyboards. If this is getting in your way, you may want to change it to another character or turn it off entirely. +QUIT is a special character that usually forcefully ends the current process on the server (SIGQUIT). On many servers its default setting is Ctrl-backslash (^\), which is easy to accidentally invoke on many keyboards. If this is getting in your way, you may want to change it to another character or turn it off entirely.
        • Boolean modes such as ECHO and ICANON can be specified in PuTTY in a variety of ways, such as true/false, yes/no, and 0/1. (Explicitly specifying a value of no is different from not sending the mode at all.)
        • -The boolean mode IUTF8 signals to the server whether the terminal character set is UTF-8 or not, for purposes such as basic line editing; if this is set incorrectly, the backspace key may erase the wrong amount of text, for instance. However, simply setting this is not usually sufficient for the server to use UTF-8; POSIX servers will generally also require the locale to be set (by some server-dependent means), although many newer installations default to UTF-8. Also, since this mode was added to the SSH protocol much later than the others, many servers (particularly older servers) do not honour this mode sent over SSH; indeed, a few poorly-written servers object to its mere presence, so you may find you need to set it to not be sent at all. When set to ‘Auto’, this follows the local configured character set (see section 4.10.1). +The boolean mode IUTF8 signals to the server whether the terminal character set is UTF-8 or not, for purposes such as basic line editing; if this is set incorrectly, the backspace key may erase the wrong amount of text, for instance. However, simply setting this is not usually sufficient for the server to use UTF-8; POSIX servers will generally also require the locale to be set (by some server-dependent means), although many newer installations default to UTF-8. Also, since this mode was added to the SSH protocol much later than the others, many servers (particularly older servers) do not honour this mode sent over SSH; indeed, a few poorly-written servers object to its mere presence, so you may find you need to set it to not be sent at all. When set to ‘Auto’, this follows the local configured character set (see section 4.10.1).
        • Terminal speeds are configured elsewhere; see section 4.15.4. @@ -2073,10 +2105,10 @@

          4.23.2 Sending 4.24 The X11 panel

          -The X11 panel allows you to configure forwarding of X11 over an SSH connection. +The X11 panel allows you to configure forwarding of X11 over an SSH connection.

          -If your server lets you run X Window System graphical applications, X11 forwarding allows you to securely give those applications access to a local X display on your PC. +If your server lets you run X Window System graphical applications, X11 forwarding allows you to securely give those applications access to a local X display on your PC.

          To enable X11 forwarding, check the ‘Enable X11 forwarding’ box. If your X display is somewhere unusual, you will need to enter its location in the ‘X display location’ box; if this is left blank, PuTTY will try to find a sensible default in the environment, or use the primary local display (:0) if that fails. @@ -2084,15 +2116,15 @@

          4.24 The X11 panel

          See section 3.4 for more information about X11 forwarding.

          -

          4.24.1 Remote X11 authentication

          +

          4.24.1 Remote X11 authentication

          If you are using X11 forwarding, the virtual X server created on the SSH server machine will be protected by authorisation data. This data is invented, and checked, by PuTTY.

          -The usual authorisation method used for this is called MIT-MAGIC-COOKIE-1. This is a simple password-style protocol: the X client sends some cookie data to the server, and the server checks that it matches the real cookie. The cookie data is sent over an unencrypted X11 connection; so if you allow a client on a third machine to access the virtual X server, then the cookie will be sent in the clear. +The usual authorisation method used for this is called MIT-MAGIC-COOKIE-1. This is a simple password-style protocol: the X client sends some cookie data to the server, and the server checks that it matches the real cookie. The cookie data is sent over an unencrypted X11 connection; so if you allow a client on a third machine to access the virtual X server, then the cookie will be sent in the clear.

          -PuTTY offers the alternative protocol XDM-AUTHORIZATION-1. This is a cryptographically authenticated protocol: the data sent by the X client is different every time, and it depends on the IP address and port of the client's end of the connection and is also stamped with the current time. So an eavesdropper who captures an XDM-AUTHORIZATION-1 string cannot immediately re-use it for their own X connection. +PuTTY offers the alternative protocol XDM-AUTHORIZATION-1. This is a cryptographically authenticated protocol: the data sent by the X client is different every time, and it depends on the IP address and port of the client's end of the connection and is also stamped with the current time. So an eavesdropper who captures an XDM-AUTHORIZATION-1 string cannot immediately re-use it for their own X connection.

          PuTTY's support for XDM-AUTHORIZATION-1 is a somewhat experimental feature, and may encounter several problems: @@ -2120,12 +2152,12 @@

          4.24.2 X authority

          One way in which this data might be made available is for the X server to store it somewhere in a file which has the same format as the Unix .Xauthority file. If this is how your Windows X server works, then you can tell PuTTY where to find this file by configuring this option. By default, PuTTY will not attempt to find any authorisation for your local display.

          -

          4.25 The Tunnels panel

          +

          4.25 The Tunnels panel

          The Tunnels panel allows you to configure tunnelling of arbitrary connection types through an SSH connection.

          -Port forwarding allows you to tunnel other types of network connection down an SSH session. See section 3.5 for a general discussion of port forwarding and how it works. +Port forwarding allows you to tunnel other types of network connection down an SSH session. See section 3.5 for a general discussion of port forwarding and how it works.

          The port forwarding section in the Tunnels panel shows a list of all the port forwardings that PuTTY will try to set up when it connects to the server. By default no port forwardings are set up, so this list is empty. @@ -2134,13 +2166,13 @@

          4.25
          • -Set one of the ‘Local’ or ‘Remote’ radio buttons, depending on whether you want to forward a local port to a remote destination (‘Local’) or forward a remote port to a local destination (‘Remote’). Alternatively, select ‘Dynamic’ if you want PuTTY to provide a local SOCKS 4/4A/5 proxy on a local port (note that this proxy only supports TCP connections; the SSH protocol does not support forwarding UDP). +Set one of the ‘Local’ or ‘Remote’ radio buttons, depending on whether you want to forward a local port to a remote destination (‘Local’) or forward a remote port to a local destination (‘Remote’). Alternatively, select ‘Dynamic’ if you want PuTTY to provide a local SOCKS 4/4A/5 proxy on a local port (note that this proxy only supports TCP connections; the SSH protocol does not support forwarding UDP).
          • -Enter a source port number into the ‘Source port’ box. For local forwardings, PuTTY will listen on this port of your PC. For remote forwardings, your SSH server will listen on this port of the remote machine. Note that most servers will not allow you to listen on port numbers less than 1024. +Enter a source port number into the ‘Source port’ box. For local forwardings, PuTTY will listen on this port of your PC. For remote forwardings, your SSH server will listen on this port of the remote machine. Note that most servers will not allow you to listen on port numbers less than 1024.
          • -If you have selected ‘Local’ or ‘Remote’ (this step is not needed with ‘Dynamic’), enter a hostname and port number separated by a colon, in the ‘Destination’ box. Connections received on the source port will be directed to this destination. For example, to connect to a POP-3 server, you might enter popserver.example.com:110. (If you need to enter a literal IPv6 address, enclose it in square brackets, for instance ‘[::1]:2200’.) +If you have selected ‘Local’ or ‘Remote’ (this step is not needed with ‘Dynamic’), enter a hostname and port number separated by a colon, in the ‘Destination’ box. Connections received on the source port will be directed to this destination. For example, to connect to a POP-3 server, you might enter popserver.example.com:110. (If you need to enter a literal IPv6 address, enclose it in square brackets, for instance ‘[::1]:2200’.)
          • Click the ‘Add’ button. Your forwarding details should appear in the list box. @@ -2150,19 +2182,19 @@

            4.25

            -In the ‘Source port’ box, you can also optionally enter an IP address to listen on, by specifying (for instance) 127.0.0.5:79. See section 3.5 for more information on how this works and its restrictions. +In the ‘Source port’ box, you can also optionally enter an IP address to listen on, by specifying (for instance) 127.0.0.5:79. See section 3.5 for more information on how this works and its restrictions.

            -In place of port numbers, you can enter service names, if they are known to the local system. For instance, in the ‘Destination’ box, you could enter popserver.example.com:pop3. +In place of port numbers, you can enter service names, if they are known to the local system. For instance, in the ‘Destination’ box, you could enter popserver.example.com:pop3.

            -You can modify the currently active set of port forwardings in mid-session using ‘Change Settings’ (see section 3.1.3.4). If you delete a local or dynamic port forwarding in mid-session, PuTTY will stop listening for connections on that port, so it can be re-used by another program. If you delete a remote port forwarding, note that: +You can modify the currently active set of port forwardings in mid-session using ‘Change Settings’ (see section 3.1.3.4). If you delete a local or dynamic port forwarding in mid-session, PuTTY will stop listening for connections on that port, so it can be re-used by another program. If you delete a remote port forwarding, note that:

            • The SSH-1 protocol contains no mechanism for asking the server to stop listening on a remote port.
            • -The SSH-2 protocol does contain such a mechanism, but not all SSH servers support it. (In particular, OpenSSH does not support it in any version earlier than 3.9.) +The SSH-2 protocol does contain such a mechanism, but not all SSH servers support it. (In particular, OpenSSH does not support it in any version earlier than 3.9.)

            @@ -2176,18 +2208,18 @@

            4.25

            4.25.1 Controlling the visibility of forwarded ports

            -The source port for a forwarded connection usually does not accept connections from any machine except the SSH client or server machine itself (for local and remote forwardings respectively). There are controls in the Tunnels panel to change this: +The source port for a forwarded connection usually does not accept connections from any machine except the SSH client or server machine itself (for local and remote forwardings respectively). There are controls in the Tunnels panel to change this:

            • The ‘Local ports accept connections from other hosts’ option allows you to set up local-to-remote port forwardings in such a way that machines other than your client PC can connect to the forwarded port. (This also applies to dynamic SOCKS forwarding.)
            • -The ‘Remote ports do the same’ option does the same thing for remote-to-local port forwardings (so that machines other than the SSH server machine can connect to the forwarded port.) Note that this feature is only available in the SSH-2 protocol, and not all SSH-2 servers support it (OpenSSH 3.0 does not, for example). +The ‘Remote ports do the same’ option does the same thing for remote-to-local port forwardings (so that machines other than the SSH server machine can connect to the forwarded port.) Note that this feature is only available in the SSH-2 protocol, and not all SSH-2 servers support it (OpenSSH 3.0 does not, for example).
            -

            4.25.2 Selecting Internet protocol version for forwarded ports

            +

            4.25.2 Selecting Internet protocol version for forwarded ports

            -This switch allows you to select a specific Internet protocol (IPv4 or IPv6) for the local end of a forwarded port. By default, it is set on ‘Auto’, which means that: +This switch allows you to select a specific Internet protocol (IPv4 or IPv6) for the local end of a forwarded port. By default, it is set on ‘Auto’, which means that:

            • for a local-to-remote port forwarding, PuTTY will listen for incoming connections in both IPv4 and (if available) IPv6 @@ -2200,9 +2232,9 @@

              4.25.2 This overrides the general Internet protocol version preference on the Connection panel (see section 4.14.4).

              -Note that some operating systems may listen for incoming connections in IPv4 even if you specifically asked for IPv6, because their IPv4 and IPv6 protocol stacks are linked together. Apparently Linux does this, and Windows does not. So if you're running PuTTY on Windows and you tick ‘IPv6’ for a local or dynamic port forwarding, it will only be usable by connecting to it using IPv6; whereas if you do the same on Linux, you can also use it with IPv4. However, ticking ‘Auto’ should always give you a port which you can connect to using either protocol. +Note that some operating systems may listen for incoming connections in IPv4 even if you specifically asked for IPv6, because their IPv4 and IPv6 protocol stacks are linked together. Apparently Linux does this, and Windows does not. So if you're running PuTTY on Windows and you tick ‘IPv6’ for a local or dynamic port forwarding, it will only be usable by connecting to it using IPv6; whereas if you do the same on Linux, you can also use it with IPv4. However, ticking ‘Auto’ should always give you a port which you can connect to using either protocol.

              -

              4.26 The Bugs and More Bugs panels

              +

              4.26 The Bugs and More Bugs panels

              Not all SSH servers work properly. Various existing servers have bugs in them, which can make it impossible for a client to talk to them unless it knows about the bug and works around it.

              @@ -2219,19 +2251,19 @@

              4.26 Th ‘On’: PuTTY will assume the server does have the bug.

            • -‘Auto’: PuTTY will use the server's version number announcement to try to guess whether or not the server has the bug. +‘Auto’: PuTTY will use the server's version number announcement to try to guess whether or not the server has the bug. (This option is not available for bugs that cannot be detected from the server version, e.g. because they must be acted on before the server version is known.)
            -

            4.26.1 ‘Chokes on SSH-2 ignore messages’

            +

            4.26.1 ‘Chokes on SSH-2 ignore messages’

            -An ignore message (SSH_MSG_IGNORE) is a message in the SSH protocol which can be sent from the client to the server, or from the server to the client, at any time. Either side is required to ignore the message whenever it receives it. PuTTY uses ignore messages in SSH-2 to confuse the encrypted data stream and make it harder to cryptanalyse. It also uses ignore messages for connection keepalives (see section 4.14.1). +An ignore message (SSH_MSG_IGNORE) is a message in the SSH protocol which can be sent from the client to the server, or from the server to the client, at any time. Either side is required to ignore the message whenever it receives it. PuTTY uses ignore messages in SSH-2 to confuse the encrypted data stream and make it harder to cryptanalyse. It also uses ignore messages for connection keepalives (see section 4.14.1).

            If it believes the server to have this bug, PuTTY will stop using ignore messages. If this bug is enabled when talking to a correct server, the session will succeed, but keepalives will not work and the session might be less cryptographically secure than it could be.

            4.26.2 ‘Handles SSH-2 key re-exchange badly’

            -Some SSH servers cannot cope with repeat key exchange at all, and will ignore attempts by the client to start one. Since PuTTY pauses the session while performing a repeat key exchange, the effect of this would be to cause the session to hang after an hour (unless you have your rekey timeout set differently; see section 4.18.2 for more about rekeys). Other, very old, SSH servers handle repeat key exchange even more badly, and disconnect upon receiving a repeat key exchange request. +Some SSH servers cannot cope with repeat key exchange at all, and will ignore attempts by the client to start one. Since PuTTY pauses the session while performing a repeat key exchange, the effect of this would be to cause the session to hang after an hour (unless you have your rekey timeout set differently; see section 4.18.2 for more about rekeys). Other, very old, SSH servers handle repeat key exchange even more badly, and disconnect upon receiving a repeat key exchange request.

            If this bug is detected, PuTTY will never initiate a repeat key exchange. If this bug is enabled when talking to a correct server, the session should still function, but may be less secure than you would expect. @@ -2256,16 +2288,29 @@

            4.26.4 ‘Rep

            Because PuTTY sends channel requests with the ‘want reply’ flag throughout channels' lifetime (see section 4.26.3), it's possible that when connecting to such a server it might receive a reply to a request after it thinks the channel has entirely closed, and terminate with an error along the lines of ‘Received SSH2_MSG_CHANNEL_FAILURE for nonexistent channel 256’.

            -

            4.26.5 ‘Ignores SSH-2 maximum packet size’

            +

            4.26.5 ‘Ignores SSH-2 maximum packet size’

            When an SSH-2 channel is set up, each end announces the maximum size of data packet that it is willing to receive for that channel. Some servers ignore PuTTY's announcement and send packets larger than PuTTY is willing to accept, causing it to report ‘Incoming packet was garbled on decryption’.

            -If this bug is detected, PuTTY never allows the channel's flow-control window to grow large enough to allow the server to send an over-sized packet. If this bug is enabled when talking to a correct server, the session will work correctly, but download performance will be less than it could be. +If this bug is detected, PuTTY never allows the channel's flow-control window to grow large enough to allow the server to send an over-sized packet. If this bug is enabled when talking to a correct server, the session will work correctly, but download performance will be less than it could be. +

            +

            4.26.6 ‘Discards data sent before its greeting’

            +

            +Just occasionally, an SSH connection can be established over some channel that will accidentally discard outgoing data very early in the connection. +

            +

            +This is not typically seen as a bug in an actual SSH server, but it can sometimes occur in situations involving a complicated proxy process. An example is Debian bug #991958, in which a connection going over the console of a User Mode Linux kernel can lose outgoing data before the kernel has fully booted. +

            +

            +You can work around this problem by manually enabling this bug flag, which will cause PuTTY to wait to send its initial SSH greeting until after it sees the greeting from the server. +

            +

            +Note that this bug flag can never be automatically detected, since auto-detection relies on the version string in the server's greeting, and PuTTY has to decide whether to expect this bug before it sees the server's greeting. So this is a manual workaround only.

            -

            4.26.6 ‘Requires padding on SSH-2 RSA signatures’

            +

            4.26.7 ‘Requires padding on SSH-2 RSA signatures’

            -Versions below 3.3 of OpenSSH require SSH-2 RSA signatures to be padded with zero bytes to the same length as the RSA key modulus. The SSH-2 specification says that an unpadded signature MUST be accepted, so this is a bug. A typical symptom of this problem is that PuTTY mysteriously fails RSA authentication once in every few hundred attempts, and falls back to passwords. +Versions below 3.3 of OpenSSH require SSH-2 RSA signatures to be padded with zero bytes to the same length as the RSA key modulus. The SSH-2 specification says that an unpadded signature MUST be accepted, so this is a bug. A typical symptom of this problem is that PuTTY mysteriously fails RSA authentication once in every few hundred attempts, and falls back to passwords.

            If this bug is detected, PuTTY will pad its signatures in the way OpenSSH expects. If this bug is enabled when talking to a correct server, it is likely that no damage will be done, since correct servers usually still accept padded signatures because they're used to talking to OpenSSH. @@ -2273,7 +2318,7 @@

            4.26.6 ‘Require

            This is an SSH-2-specific bug.

            -

            4.26.7 ‘Only supports pre-RFC4419 SSH-2 DH GEX’

            +

            4.26.8 ‘Only supports pre-RFC4419 SSH-2 DH GEX’

            The SSH key exchange method that uses Diffie-Hellman group exchange was redesigned after its original release, to use a slightly more sophisticated setup message. Almost all SSH implementations switched over to the new version. (PuTTY was one of the last.) A few old servers still only support the old one.

            @@ -2283,9 +2328,9 @@

            4.26.7 ‘Onl

            This is an SSH-2-specific bug.

            -

            4.26.8 ‘Miscomputes SSH-2 HMAC keys’

            +

            4.26.9 ‘Miscomputes SSH-2 HMAC keys’

            -Versions 2.3.0 and below of the SSH server software from ssh.com compute the keys for their HMAC message authentication codes incorrectly. A typical symptom of this problem is that PuTTY dies unexpectedly at the beginning of the session, saying ‘Incorrect MAC received on packet’. +Versions 2.3.0 and below of the SSH server software from ssh.com compute the keys for their HMAC message authentication codes incorrectly. A typical symptom of this problem is that PuTTY dies unexpectedly at the beginning of the session, saying ‘Incorrect MAC received on packet’.

            If this bug is detected, PuTTY will compute its HMAC keys in the same way as the buggy server, so that communication will still be possible. If this bug is enabled when talking to a correct server, communication will fail. @@ -2293,9 +2338,9 @@

            4.26.8 ‘Misco

            This is an SSH-2-specific bug.

            -

            4.26.9 ‘Misuses the session ID in SSH-2 PK auth’

            +

            4.26.10 ‘Misuses the session ID in SSH-2 PK auth’

            -Versions below 2.3 of OpenSSH require SSH-2 public-key authentication to be done slightly differently: the data to be signed by the client contains the session ID formatted in a different way. If public-key authentication mysteriously does not work but the Event Log (see section 3.1.3.1) thinks it has successfully sent a signature, it might be worth enabling the workaround for this bug to see if it helps. +Versions below 2.3 of OpenSSH require SSH-2 public-key authentication to be done slightly differently: the data to be signed by the client contains the session ID formatted in a different way. If public-key authentication mysteriously does not work but the Event Log (see section 3.1.3.1) thinks it has successfully sent a signature, it might be worth enabling the workaround for this bug to see if it helps.

            If this bug is detected, PuTTY will sign data in the way OpenSSH expects. If this bug is enabled when talking to a correct server, SSH-2 public-key authentication will fail. @@ -2303,9 +2348,9 @@

            4.26.9 ‘M

            This is an SSH-2-specific bug.

            -

            4.26.10 ‘Miscomputes SSH-2 encryption keys’

            +

            4.26.11 ‘Miscomputes SSH-2 encryption keys’

            -Versions below 2.0.11 of the SSH server software from ssh.com compute the keys for the session encryption incorrectly. This problem can cause various error messages, such as ‘Incoming packet was garbled on decryption’, or possibly even ‘Out of memory’. +Versions below 2.0.11 of the SSH server software from ssh.com compute the keys for the session encryption incorrectly. This problem can cause various error messages, such as ‘Incoming packet was garbled on decryption’, or possibly even ‘Out of memory’.

            If this bug is detected, PuTTY will compute its encryption keys in the same way as the buggy server, so that communication will still be possible. If this bug is enabled when talking to a correct server, communication will fail. @@ -2313,16 +2358,16 @@

            4.26.10 ̵

            This is an SSH-2-specific bug.

            -

            4.26.11 ‘Chokes on SSH-1 ignore messages’

            +

            4.26.12 ‘Chokes on SSH-1 ignore messages’

            -An ignore message (SSH_MSG_IGNORE) is a message in the SSH protocol which can be sent from the client to the server, or from the server to the client, at any time. Either side is required to ignore the message whenever it receives it. PuTTY uses ignore messages to hide the password packet in SSH-1, so that a listener cannot tell the length of the user's password; it also uses ignore messages for connection keepalives (see section 4.14.1). +An ignore message (SSH_MSG_IGNORE) is a message in the SSH protocol which can be sent from the client to the server, or from the server to the client, at any time. Either side is required to ignore the message whenever it receives it. PuTTY uses ignore messages to hide the password packet in SSH-1, so that a listener cannot tell the length of the user's password; it also uses ignore messages for connection keepalives (see section 4.14.1).

            -If this bug is detected, PuTTY will stop using ignore messages. This means that keepalives will stop working, and PuTTY will have to fall back to a secondary defence against SSH-1 password-length eavesdropping. See section 4.26.12. If this bug is enabled when talking to a correct server, the session will succeed, but keepalives will not work and the session might be more vulnerable to eavesdroppers than it could be. +If this bug is detected, PuTTY will stop using ignore messages. This means that keepalives will stop working, and PuTTY will have to fall back to a secondary defence against SSH-1 password-length eavesdropping. See section 4.26.13. If this bug is enabled when talking to a correct server, the session will succeed, but keepalives will not work and the session might be more vulnerable to eavesdroppers than it could be.

            -

            4.26.12 ‘Refuses all SSH-1 password camouflage’

            +

            4.26.13 ‘Refuses all SSH-1 password camouflage’

            -When talking to an SSH-1 server which cannot deal with ignore messages (see section 4.26.11), PuTTY will attempt to disguise the length of the user's password by sending additional padding within the password packet. This is technically a violation of the SSH-1 specification, and so PuTTY will only do it when it cannot use standards-compliant ignore messages as camouflage. In this sense, for a server to refuse to accept a padded password packet is not really a bug, but it does make life inconvenient if the server can also not handle ignore messages. +When talking to an SSH-1 server which cannot deal with ignore messages (see section 4.26.12), PuTTY will attempt to disguise the length of the user's password by sending additional padding within the password packet. This is technically a violation of the SSH-1 specification, and so PuTTY will only do it when it cannot use standards-compliant ignore messages as camouflage. In this sense, for a server to refuse to accept a padded password packet is not really a bug, but it does make life inconvenient if the server can also not handle ignore messages.

            If this ‘bug’ is detected, PuTTY will assume that neither ignore messages nor padding are acceptable, and that it thus has no choice but to send the user's password with no form of camouflage, so that an eavesdropping user will be easily able to find out the exact length of the password. If this bug is enabled when talking to a correct server, the session will succeed, but will be more vulnerable to eavesdroppers than it could be. @@ -2330,9 +2375,9 @@

            4.26.12 ‘

            This is an SSH-1-specific bug. SSH-2 is secure against this type of attack.

            -

            4.26.13 ‘Chokes on SSH-1 RSA authentication’

            +

            4.26.14 ‘Chokes on SSH-1 RSA authentication’

            -Some SSH-1 servers cannot deal with RSA authentication messages at all. If Pageant is running and contains any SSH-1 keys, PuTTY will normally automatically try RSA authentication before falling back to passwords, so these servers will crash when they see the RSA attempt. +Some SSH-1 servers cannot deal with RSA authentication messages at all. If Pageant is running and contains any SSH-1 keys, PuTTY will normally automatically try RSA authentication before falling back to passwords, so these servers will crash when they see the RSA attempt.

            If this bug is detected, PuTTY will go straight to password authentication. If this bug is enabled when talking to a correct server, the session will succeed, but of course RSA authentication will be impossible. @@ -2340,7 +2385,7 @@

            4.26.13 ‘Chok

            This is an SSH-1-specific bug.

            -

            4.27 The ‘Bare ssh-connection’ protocol

            +

            4.27 The ‘Bare ssh-connection’ protocol

            In addition to SSH itself, PuTTY also supports a second protocol that is derived from SSH. It's listed in the PuTTY GUI under the name ‘Bare ssh-connection’.

            @@ -2354,7 +2399,7 @@

            4.27 The ‘Bare same computer. In these contexts, the operating system will already have guaranteed that each of the two communicating processes is owned by the expected user (so that no authentication is necessary), and that the communications channel cannot be tapped by a hostile user on the same machine (so that no cryptography is necessary either). Examples of possible uses involve communicating with a strongly separated context such as the inside of a container, or a VM, or a different network namespace.

            -Explicit support for this protocol is new in PuTTY 0.75. As of 2021-04, the only known server for the bare ssh-connection protocol is the Unix program ‘psusan’ that is also part of the PuTTY tool suite. +Explicit support for this protocol is new in PuTTY 0.75. As of 2021-04, the only known server for the bare ssh-connection protocol is the Unix program ‘psusan’ that is also part of the PuTTY tool suite.

            (However, this protocol is also the same one used between instances of PuTTY to implement connection sharing: see section 4.17.5. In fact, in the Unix version of PuTTY, when a sharing upstream records ‘Sharing this connection at [pathname]’ in the Event Log, it's possible to connect another instance of PuTTY directly to that Unix socket, by entering its pathname in the host name box and selecting ‘Bare ssh-connection’ as the protocol!) @@ -2367,14 +2412,14 @@

            4.27 The ‘Bare

            4.28 The Serial panel

            -The Serial panel allows you to configure options that only apply when PuTTY is connecting to a local serial line. +The Serial panel allows you to configure options that only apply when PuTTY is connecting to a local serial line.

            4.28.1 Selecting a serial line to connect to

            The ‘Serial line to connect to’ box allows you to choose which serial line you want PuTTY to talk to, if your computer has more than one serial port.

            -On Windows, the first serial line is called COM1, and if there is a second it is called COM2, and so on. +On Windows, the first serial line is called COM1, and if there is a second it is called COM2, and so on.

            This configuration setting is also visible on the Session panel, where it replaces the ‘Host Name’ box (see section 4.1.1) if the connection type is set to ‘Serial’. @@ -2431,21 +2476,21 @@

            4.28.6 Selecting the ‘DSR/DTR’: flow control is done using the DSR and DTR wires on the serial line.

          -

          4.29 The Telnet panel

          +

          4.29 The Telnet panel

          The Telnet panel allows you to configure options that only apply to Telnet sessions.

          4.29.1 ‘Handling of OLD_ENVIRON ambiguity’

          -The original Telnet mechanism for passing environment variables was badly specified. At the time the standard (RFC 1408) was written, BSD telnet implementations were already supporting the feature, and the intention of the standard was to describe the behaviour the BSD implementations were already using. +The original Telnet mechanism for passing environment variables was badly specified. At the time the standard (RFC 1408) was written, BSD telnet implementations were already supporting the feature, and the intention of the standard was to describe the behaviour the BSD implementations were already using.

          -Sadly there was a typing error in the standard when it was issued, and two vital function codes were specified the wrong way round. BSD implementations did not change, and the standard was not corrected. Therefore, it's possible you might find either BSD or RFC-compliant implementations out there. This switch allows you to choose which one PuTTY claims to be. +Sadly there was a typing error in the standard when it was issued, and two vital function codes were specified the wrong way round. BSD implementations did not change, and the standard was not corrected. Therefore, it's possible you might find either BSD or RFC-compliant implementations out there. This switch allows you to choose which one PuTTY claims to be.

          -The problem was solved by issuing a second standard, defining a new Telnet mechanism called NEW_ENVIRON, which behaved exactly like the original OLD_ENVIRON but was not encumbered by existing implementations. Most Telnet servers now support this, and it's unambiguous. This feature should only be needed if you have trouble passing environment variables to quite an old server. +The problem was solved by issuing a second standard, defining a new Telnet mechanism called NEW_ENVIRON, which behaved exactly like the original OLD_ENVIRON but was not encumbered by existing implementations. Most Telnet servers now support this, and it's unambiguous. This feature should only be needed if you have trouble passing environment variables to quite an old server.

          -

          4.29.2 Passive and active Telnet negotiation modes

          +

          4.29.2 Passive and active Telnet negotiation modes

          In a Telnet connection, there are two types of data passed between the client and the server: actual text, and negotiations about which Telnet extra features to use.

          @@ -2453,60 +2498,60 @@

          4.29.2 Passive and active PuTTY can use two different strategies for negotiation:

          • -In active mode, PuTTY starts to send negotiations as soon as the connection is opened. +In active mode, PuTTY starts to send negotiations as soon as the connection is opened.
          • -In passive mode, PuTTY will wait to negotiate until it sees a negotiation from the server. +In passive mode, PuTTY will wait to negotiate until it sees a negotiation from the server.

          The obvious disadvantage of passive mode is that if the server is also operating in a passive mode, then negotiation will never begin at all. For this reason PuTTY defaults to active mode.

          -However, sometimes passive mode is required in order to successfully get through certain types of firewall and Telnet proxy server. If you have confusing trouble with a firewall, you could try enabling passive mode to see if it helps. +However, sometimes passive mode is required in order to successfully get through certain types of firewall and Telnet proxy server. If you have confusing trouble with a firewall, you could try enabling passive mode to see if it helps.

          -

          4.29.3 ‘Keyboard sends Telnet special commands’

          +

          4.29.3 ‘Keyboard sends Telnet special commands’

          If this box is checked, several key sequences will have their normal actions modified:

          • -the Backspace key on the keyboard will send the Telnet special backspace code; +the Backspace key on the keyboard will send the Telnet special backspace code;
          • -Control-C will send the Telnet special Interrupt Process code; +Control-C will send the Telnet special Interrupt Process code;
          • -Control-Z will send the Telnet special Suspend Process code. +Control-Z will send the Telnet special Suspend Process code.

          You probably shouldn't enable this unless you know what you're doing.

          -

          4.29.4 ‘Return key sends Telnet New Line instead of ^M’

          +

          4.29.4 ‘Return key sends Telnet New Line instead of ^M’

          -Unlike most other remote login protocols, the Telnet protocol has a special ‘new line’ code that is not the same as the usual line endings of Control-M or Control-J. By default, PuTTY sends the Telnet New Line code when you press Return, instead of sending Control-M as it does in most other protocols. +Unlike most other remote login protocols, the Telnet protocol has a special ‘new line’ code that is not the same as the usual line endings of Control-M or Control-J. By default, PuTTY sends the Telnet New Line code when you press Return, instead of sending Control-M as it does in most other protocols.

          Most Unix-style Telnet servers don't mind whether they receive Telnet New Line or Control-M; some servers do expect New Line, and some servers prefer to see ^M. If you are seeing surprising behaviour when you press Return in a Telnet session, you might try turning this option off to see if it helps.

          4.30 The Rlogin panel

          -The Rlogin panel allows you to configure options that only apply to Rlogin sessions. +The Rlogin panel allows you to configure options that only apply to Rlogin sessions.

          -

          4.30.1 ‘Local username’

          +

          4.30.1 ‘Local username’

          -Rlogin allows an automated (password-free) form of login by means of a file called .rhosts on the server. You put a line in your .rhosts file saying something like jbloggs@pc1.example.com, and then when you make an Rlogin connection the client transmits the username of the user running the Rlogin client. The server checks the username and hostname against .rhosts, and if they match it does not ask for a password. +Rlogin allows an automated (password-free) form of login by means of a file called .rhosts on the server. You put a line in your .rhosts file saying something like jbloggs@pc1.example.com, and then when you make an Rlogin connection the client transmits the username of the user running the Rlogin client. The server checks the username and hostname against .rhosts, and if they match it does not ask for a password.

          -This only works because Unix systems contain a safeguard to stop a user from pretending to be another user in an Rlogin connection. Rlogin connections have to come from port numbers below 1024, and Unix systems prohibit this to unprivileged processes; so when the server sees a connection from a low-numbered port, it assumes the client end of the connection is held by a privileged (and therefore trusted) process, so it believes the claim of who the user is. +This only works because Unix systems contain a safeguard to stop a user from pretending to be another user in an Rlogin connection. Rlogin connections have to come from port numbers below 1024, and Unix systems prohibit this to unprivileged processes; so when the server sees a connection from a low-numbered port, it assumes the client end of the connection is held by a privileged (and therefore trusted) process, so it believes the claim of who the user is.

          -Windows does not have this restriction: any user can initiate an outgoing connection from a low-numbered port. Hence, the Rlogin .rhosts mechanism is completely useless for securely distinguishing several different users on a Windows machine. If you have a .rhosts entry pointing at a Windows PC, you should assume that anyone using that PC can spoof your username in an Rlogin connection and access your account on the server. +Windows does not have this restriction: any user can initiate an outgoing connection from a low-numbered port. Hence, the Rlogin .rhosts mechanism is completely useless for securely distinguishing several different users on a Windows machine. If you have a .rhosts entry pointing at a Windows PC, you should assume that anyone using that PC can spoof your username in an Rlogin connection and access your account on the server.

          -The ‘Local username’ control allows you to specify what user name PuTTY should claim you have, in case it doesn't match your Windows user name (or in case you didn't bother to set up a Windows user name). +The ‘Local username’ control allows you to specify what user name PuTTY should claim you have, in case it doesn't match your Windows user name (or in case you didn't bother to set up a Windows user name).

          -

          4.31 The SUPDUP panel

          +

          4.31 The SUPDUP panel

          The SUPDUP panel allows you to configure options that only apply to SUPDUP sessions. See section 3.10 for more about the SUPDUP protocol.

          @@ -2529,9 +2574,9 @@

          4.31.4 ‘Terminal scr

          This controls whether the terminal will perform scrolling then the cursor goes below the last line, or if the cursor will return to the first line.

          -

          4.32 Storing configuration in a file

          +

          4.32 Storing configuration in a file

          -PuTTY does not currently support storing its configuration in a file instead of the Registry. However, you can work around this with a couple of batch files. +PuTTY does not currently support storing its configuration in a file instead of the Registry. However, you can work around this with a couple of batch files.

          You will need a file called (say) PUTTY.BAT which imports the contents of a file into the Registry, then runs PuTTY, exports the contents of the Registry back into the file, and deletes the Registry entries. This can all be done using the Regedit command line options, so it's all automatic. Here is what you need in PUTTY.BAT: @@ -2567,6 +2612,5 @@

          4.32 Storin You should replace a:\putty.rnd with the location where you want to store your random number data. If the aim is to carry around PuTTY and its settings on one USB stick, you probably want to store it on the USB stick.

          -

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          -[PuTTY release 0.76]
          +

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          diff --git a/code/doc/Chapter5.html b/code/doc/html/Chapter5.html similarity index 99% rename from code/doc/Chapter5.html rename to code/doc/html/Chapter5.html index 1696e77..6098609 100644 --- a/code/doc/Chapter5.html +++ b/code/doc/html/Chapter5.html @@ -51,7 +51,7 @@

          5.2 PSCP Usage

          C:\>pscp
           PuTTY Secure Copy client
          -Release 0.76
          +Release 0.77
           Usage: pscp [options] [user@]host:source target
                  pscp [options] source [source...] [user@]host:target
                  pscp [options] -ls [user@]host:filespec
          @@ -65,7 +65,7 @@ 

          5.2 PSCP Usage

          -load sessname Load settings from saved session -P port connect to specified port -l user connect with specified username - -pw passw login with specified password + -pwfile file login with password read from specified file -1 -2 force use of particular SSH protocol version -ssh -ssh-connection force use of particular SSH protocol variant @@ -270,6 +270,5 @@

          5.2.4 Using chapter 8.

          -

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          -[PuTTY release 0.76]
          +

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          diff --git a/code/doc/Chapter6.html b/code/doc/html/Chapter6.html similarity index 99% rename from code/doc/Chapter6.html rename to code/doc/html/Chapter6.html index 397b1a0..6598842 100644 --- a/code/doc/Chapter6.html +++ b/code/doc/html/Chapter6.html @@ -534,6 +534,5 @@

          6.3 Using pu For more general information on public-key authentication, see chapter 8.

          -

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          -[PuTTY release 0.76]
          +

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          diff --git a/code/doc/Chapter7.html b/code/doc/html/Chapter7.html similarity index 99% rename from code/doc/Chapter7.html rename to code/doc/html/Chapter7.html index d8fad1c..001227a 100644 --- a/code/doc/Chapter7.html +++ b/code/doc/html/Chapter7.html @@ -56,7 +56,7 @@

          7.2 Using Plink

          C:\>plink
           Plink: command-line connection utility
          -Release 0.76
          +Release 0.77
           Usage: plink [options] [user@]host [command]
                  ("host" can also be a PuTTY saved session name)
           Options:
          @@ -76,7 +76,7 @@ 

          7.2 Using Plink

          -sercfg configuration-string (e.g. 19200,8,n,1,X) Specify the serial configuration (serial only) The following options only apply to SSH connections: - -pw passw login with specified password + -pwfile file login with password read from specified file -D [listen-IP:]listen-port Dynamic SOCKS-based port forwarding -L [listen-IP:]listen-port:host:port @@ -381,6 +381,5 @@

          7.5 Using Plink with Feedback page.

          -[PuTTY release 0.76]
          +

          If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

          diff --git a/code/doc/Chapter8.html b/code/doc/html/Chapter8.html similarity index 82% rename from code/doc/Chapter8.html rename to code/doc/html/Chapter8.html index d38c7a1..6a9dd42 100644 --- a/code/doc/Chapter8.html +++ b/code/doc/html/Chapter8.html @@ -33,6 +33,7 @@
        • 8.2.12 Parameters for saving key files
        • 8.2.13 Reloading a private key
        • 8.2.14 Dealing with private keys in other formats
        • +
        • 8.2.15 PuTTYgen command-line configuration

      • 8.3 Getting ready for public key authentication

    • @@ -58,11 +59,11 @@

      8.1 Public ke This can make public-key authentication less convenient than password authentication: every time you log in to the server, instead of typing a short password, you have to type a longer passphrase. One solution to this is to use an authentication agent, a separate program which holds decrypted private keys and generates signatures on request. PuTTY's authentication agent is called Pageant. When you begin a Windows session, you start Pageant and load your private key into it (typing your passphrase once). For the rest of your session, you can start PuTTY any number of times and Pageant will automatically generate signatures without you having to do anything. When you close your Windows session, Pageant shuts down, without ever having stored your decrypted private key on disk. Many people feel this is a good compromise between security and convenience. See chapter 9 for further details.

      -There is more than one public-key algorithm available. The most common are RSA and ECDSA, but others exist, notably DSA (otherwise known as DSS), the USA's federal Digital Signature Standard. The key types supported by PuTTY are described in section 8.2.2. +There is more than one public-key algorithm available. The most common are RSA and ECDSA, but others exist, notably DSA (otherwise known as DSS), the USA's federal Digital Signature Standard. The key types supported by PuTTY are described in section 8.2.2.

      -

      8.2 Using PuTTYgen, the PuTTY key generator

      +

      8.2 Using PuTTYgen, the PuTTY key generator

      -PuTTYgen is a key generator. It generates pairs of public and private keys to be used with PuTTY, PSCP, and Plink, as well as the PuTTY authentication agent, Pageant (see chapter 9). PuTTYgen generates RSA, DSA, ECDSA, and EdDSA keys. +PuTTYgen is a key generator. It generates pairs of public and private keys to be used with PuTTY, PSCP, and Plink, as well as the PuTTY authentication agent, Pageant (see chapter 9). PuTTYgen generates RSA, DSA, ECDSA, and EdDSA keys.

      When you run PuTTYgen you will see a window where you have two main choices: ‘Generate’, to generate a new public/private key pair, or ‘Load’ to load in an existing private key. @@ -98,16 +99,16 @@

      8.2.2 Selecting the type The current version of the SSH protocol, SSH-2, supports several different key types, although specific servers may not support all of them. PuTTYgen can generate:

      • -An RSA key for use with the SSH-2 protocol. +An RSA key for use with the SSH-2 protocol.
      • -A DSA key for use with the SSH-2 protocol. +A DSA key for use with the SSH-2 protocol.
      • -An ECDSA (elliptic curve DSA) key for use with the SSH-2 protocol. +An ECDSA (elliptic curve DSA) key for use with the SSH-2 protocol.
      • -An EdDSA key (Edwards-curve DSA, another elliptic curve algorithm) for use with the SSH-2 protocol. +An EdDSA key (Edwards-curve DSA, another elliptic curve algorithm) for use with the SSH-2 protocol.

      @@ -124,10 +125,10 @@

      8.2.3 Selecting the siz For ECDSA, only 256, 384, and 521 bits are supported. (ECDSA offers equivalent security to RSA with smaller key sizes.)
    • -For EdDSA, the only valid sizes are 255 bits (these keys are also known as ‘Ed25519’ and are commonly used) and 448 bits (‘Ed448’, which is much less common at the time of writing). (256 is also accepted for backward compatibility, but the effect is the same as 255.) +For EdDSA, the only valid sizes are 255 bits (these keys are also known as ‘Ed25519’ and are commonly used) and 448 bits (‘Ed448’, which is much less common at the time of writing). (256 is also accepted for backward compatibility, but the effect is the same as 255.)
    -

    8.2.4 Selecting the prime generation method

    +

    8.2.4 Selecting the prime generation method

    On the ‘Key’ menu, you can also optionally change the method for generating the prime numbers used in the generated key. This is used for RSA and DSA keys only. (The other key types don't require generating prime numbers at all.)

    @@ -141,10 +142,10 @@

    8.2.4 Selecting the
    • -Use probable primes (fast) +Use probable primes (fast)
    • -Use proven primes (slower) +Use proven primes (slower)
    • Use proven primes with even distribution (slowest) @@ -157,10 +158,13 @@

      8.2.4 Selecting the sure are prime, because it generates the output number together with a proof of its primality. This takes more effort, but it eliminates that theoretical risk in the probabilistic method.

      +There in one way in which PuTTYgen's ‘proven primes’ method is not strictly better than its ‘probable primes’ method. If you use PuTTYgen to generate an RSA key on a computer that is potentially susceptible to timing- or cache-based side-channel attacks, such as a shared computer, the ‘probable primes’ method is designed to resist such attacks, whereas the ‘proven primes’ methods are not. (This is only a concern for RSA keys; for other key types, primes are either not secret or not involved.) +

      +

      You might choose to switch from probable to proven primes if you have a local security standard that demands it, or if you don't trust the probabilistic argument for the safety of the usual method.

      -For RSA keys, there's also an option on the ‘Key’ menu to use ‘strong’ primes as the prime factors of the public key. A ‘strong’ prime is a prime number chosen to have a particular structure that makes certain factoring algorithms more difficult to apply, so some security standards recommend their use. However, the most modern factoring algorithms are unaffected, so this option is probably not worth turning on unless you have a local standard that recommends it. +For RSA keys, there's also an option on the ‘Key’ menu to use ‘strong’ primes as the prime factors of the public key. A ‘strong’ prime is a prime number chosen to have a particular structure that makes certain factoring algorithms more difficult to apply, so some security standards recommend their use. However, the most modern factoring algorithms are unaffected, so this option is probably not worth turning on unless you have a local standard that recommends it.

      8.2.5 The ‘Generate’ button

      @@ -175,7 +179,7 @@

      8.2.5 The ‘Genera

      When the key generation is complete, a new set of controls will appear in the window to indicate this.

      -

      8.2.6 The ‘Key fingerprint’ box

      +

      8.2.6 The ‘Key fingerprint’ box

      The ‘Key fingerprint’ box shows you a fingerprint value for the generated key. This is derived cryptographically from the public key value, so it doesn't need to be kept secret; it is supposed to be more manageable for human beings than the public key itself.

      @@ -195,21 +199,21 @@

      8.2.7 Setting a comment

      To alter the key comment, just type your comment text into the ‘Key comment’ box before saving the private key. If you want to change the comment later, you can load the private key back into PuTTYgen, change the comment, and save it again.

      -

      8.2.8 Setting a passphrase for your key

      +

      8.2.8 Setting a passphrase for your key

      -The ‘Key passphrase’ and ‘Confirm passphrase’ boxes allow you to choose a passphrase for your key. The passphrase will be used to encrypt the key on disk, so you will not be able to use the key without first entering the passphrase. +The ‘Key passphrase’ and ‘Confirm passphrase’ boxes allow you to choose a passphrase for your key. The passphrase will be used to encrypt the key on disk, so you will not be able to use the key without first entering the passphrase.

      When you save the key, PuTTYgen will check that the ‘Key passphrase’ and ‘Confirm passphrase’ boxes both contain exactly the same passphrase, and will refuse to save the key otherwise.

      -If you leave the passphrase fields blank, the key will be saved unencrypted. You should not do this without good reason; if you do, your private key file on disk will be all an attacker needs to gain access to any machine configured to accept that key. If you want to be able to log in without having to type a passphrase every time, you should consider using Pageant (chapter 9) so that your decrypted key is only held in memory rather than on disk. +If you leave the passphrase fields blank, the key will be saved unencrypted. You should not do this without good reason; if you do, your private key file on disk will be all an attacker needs to gain access to any machine configured to accept that key. If you want to be able to log in without having to type a passphrase every time, you should consider using Pageant (chapter 9) so that your decrypted key is only held in memory rather than on disk.

      Under special circumstances you may genuinely need to use a key with no passphrase; for example, if you need to run an automated batch script that needs to make an SSH connection, you can't be there to type the passphrase. In this case we recommend you generate a special key for each specific batch script (or whatever) that needs one, and on the server side you should arrange that each key is restricted so that it can only be used for that specific purpose. The documentation for your SSH server should explain how to do this (it will probably vary between servers).

      -Choosing a good passphrase is difficult. Just as you shouldn't use a dictionary word as a password because it's easy for an attacker to run through a whole dictionary, you should not use a song lyric, quotation or other well-known sentence as a passphrase. DiceWare (www.diceware.com) recommends using at least five words each generated randomly by rolling five dice, which gives over 2^64 possible passphrases and is probably not a bad scheme. If you want your passphrase to make grammatical sense, this cuts down the possibilities a lot and you should use a longer one as a result. +Choosing a good passphrase is difficult. Just as you shouldn't use a dictionary word as a password because it's easy for an attacker to run through a whole dictionary, you should not use a song lyric, quotation or other well-known sentence as a passphrase. DiceWare (www.diceware.com) recommends using at least five words each generated randomly by rolling five dice, which gives over 2^64 possible passphrases and is probably not a bad scheme. If you want your passphrase to make grammatical sense, this cuts down the possibilities a lot and you should use a longer one as a result.

      Do not forget your passphrase. There is no way to recover it. @@ -222,14 +226,14 @@

      8.2.9 Saving your priva Press the ‘Save private key’ button. PuTTYgen will put up a dialog box asking you where to save the file. Select a directory, type in a file name, and press ‘Save’.

      -This file is in PuTTY's native format (*.PPK); it is the one you will need to tell PuTTY to use for authentication (see section 4.21.9) or tell Pageant to load (see section 9.2.2). +This file is in PuTTY's native format (*.PPK); it is the one you will need to tell PuTTY to use for authentication (see section 4.21.9) or tell Pageant to load (see section 9.2.2).

      (You can optionally change some details of the PPK format for your saved key files; see section 8.2.12. But The defaults should be fine for most purposes.)

      8.2.10 Saving your public key to a disk file

      -RFC 4716 specifies a standard format for storing SSH-2 public keys on disk. Some SSH servers (such as ssh.com's) require a public key in this format in order to accept authentication with the corresponding private key. (Others, such as OpenSSH, use a different format; see section 8.2.11.) +RFC 4716 specifies a standard format for storing SSH-2 public keys on disk. Some SSH servers (such as ssh.com's) require a public key in this format in order to accept authentication with the corresponding private key. (Others, such as OpenSSH, use a different format; see section 8.2.11.)

      To save your public key in the SSH-2 standard format, press the ‘Save public key’ button in PuTTYgen. PuTTYgen will put up a dialog box asking you where to save the file. Select a directory, type in a file name, and press ‘Save’. @@ -240,9 +244,9 @@

      8.2.10 Saving your publ

      If you use this option with an SSH-1 key, the file PuTTYgen saves will contain exactly the same text that appears in the ‘Public key for pasting’ box. This is the only existing standard for SSH-1 public keys.

      -

      8.2.11 ‘Public key for pasting into OpenSSH authorized_keys file’

      +

      8.2.11 ‘Public key for pasting into OpenSSH authorized_keys file’

      -The OpenSSH server, among others, requires your public key to be given to it in a one-line format before it will accept authentication with your private key. (SSH-1 servers also used this method.) +The OpenSSH server, among others, requires your public key to be given to it in a one-line format before it will accept authentication with your private key. (SSH-1 servers also used this method.)

      The ‘Public key for pasting into OpenSSH authorized_keys file’ gives the public-key data in the correct one-line format. Typically you will want to select the entire contents of the box using the mouse, press Ctrl+C to copy it to the clipboard, and then paste the data into a PuTTY session which is already connected to the server. @@ -267,7 +271,7 @@

      8.2.12.1 PPK

      The version 2 format is less resistant to brute-force decryption, and doesn't support any of the following options to control that.

      -

      8.2.12.2 Options affecting passphrase hashing

      +

      8.2.12.2 Options affecting passphrase hashing

      All of the following options only affect keys saved with passphrases. They control how much work is required to decrypt the key (which happens every time you type its passphrase). This allows you to trade off the cost of legitimate use of the key against the resistance of the encrypted key to password-guessing attacks.

      @@ -278,7 +282,7 @@

      8.2.1 Key derivation function
      -The variant of the Argon2 key derivation function to use. You might change this if you consider your exposure to side-channel attacks to be different to the norm. +The variant of the Argon2 key derivation function to use. You might change this if you consider your exposure to side-channel attacks to be different to the norm.
      Memory to use for passphrase hash @@ -311,13 +315,13 @@

      8.2.13 Reloading a private

      8.2.14 Dealing with private keys in other formats

      -SSH-2 private keys have no standard format. OpenSSH and ssh.com have different formats, and PuTTY's is different again. So a key generated with one client cannot immediately be used with another. +SSH-2 private keys have no standard format. OpenSSH and ssh.com have different formats, and PuTTY's is different again. So a key generated with one client cannot immediately be used with another.

      -Using the ‘Import’ command from the ‘Conversions’ menu, PuTTYgen can load SSH-2 private keys in OpenSSH's format and ssh.com's format. Once you have loaded one of these key types, you can then save it back out as a PuTTY-format key (*.PPK) so that you can use it with the PuTTY suite. The passphrase will be unchanged by this process (unless you deliberately change it). You may want to change the key comment before you save the key, since some OpenSSH key formats contained no space for a comment, and ssh.com's default comment format is long and verbose. +Using the ‘Import’ command from the ‘Conversions’ menu, PuTTYgen can load SSH-2 private keys in OpenSSH's format and ssh.com's format. Once you have loaded one of these key types, you can then save it back out as a PuTTY-format key (*.PPK) so that you can use it with the PuTTY suite. The passphrase will be unchanged by this process (unless you deliberately change it). You may want to change the key comment before you save the key, since some OpenSSH key formats contained no space for a comment, and ssh.com's default comment format is long and verbose.

      -PuTTYgen can also export private keys in OpenSSH format and in ssh.com format. To do so, select one of the ‘Export’ options from the ‘Conversions’ menu. Exporting a key works exactly like saving it (see section 8.2.9) - you need to have typed your passphrase in beforehand, and you will be warned if you are about to save a key without a passphrase. +PuTTYgen can also export private keys in OpenSSH format and in ssh.com format. To do so, select one of the ‘Export’ options from the ‘Conversions’ menu. Exporting a key works exactly like saving it (see section 8.2.9) - you need to have typed your passphrase in beforehand, and you will be warned if you are about to save a key without a passphrase.

      For OpenSSH there are two options. Modern OpenSSH actually has two formats it uses for storing private keys. ‘Export OpenSSH key’ will automatically choose the oldest format supported for the key type, for maximum backward compatibility with older versions of OpenSSH; for newer key types like Ed25519, it will use the newer format as that is the only legal option. If you have some specific reason for wanting to use OpenSSH's newer format even for RSA, DSA, or ECDSA keys, you can choose ‘Export OpenSSH key (force new file format)’. @@ -325,19 +329,104 @@

      8.2.14 Dealing with

      Most clients for the older SSH-1 protocol use a standard format for storing private keys on disk. PuTTY uses this format as well; so if you have generated an SSH-1 private key using OpenSSH or ssh.com's client, you can use it with PuTTY, and vice versa. Hence, the export options are not available if you have generated an SSH-1 key.

      +

      8.2.15 PuTTYgen command-line configuration

      +

      +PuTTYgen supports a set of command-line options to configure many of the same settings you can select in the GUI. This allows you to start it up with your own preferences ready-selected, which might be useful if you generate a lot of keys. (For example, you could make a Windows shortcut that runs PuTTYgen with some command line options, or a batch file or Powershell script that you could distribute to a whole organisation containing your local standards.) +

      +

      +The options supported on the command line are: +

      +
      +-t keytype +
      +
      +Type of key to generate. You can select rsa, dsa, ecdsa, eddsa or rsa1. See section 8.2.2. +
      +
      +-b bits +
      +
      +Size of the key to generate, in bits. See section 8.2.3. +
      +
      +--primes method +
      +
      +Method for generating prime numbers. You can select probable, proven, and proven-even. See section 8.2.4. +
      +
      +--strong-rsa +
      +
      +When generating an RSA key, make sure the prime factors of the key modulus are ‘strong primes’. See section 8.2.4. +
      +
      +--ppk-param key=value,... +
      +
      +Allows setting all the same details of the PPK save file format described in section 8.2.12. +

      +Aspects to change are specified as a series of key=value pairs separated by commas. The keys are: +

      +
      +version +
      +
      +The PPK format version: either 3 or 2. +
      +
      +kdf +
      +
      +The variant of Argon2 to use: argon2id, argon2i, and argon2d. +
      +
      +memory +
      +
      +The amount of memory needed to decrypt the key, in Kbyte. +
      +
      +time +
      +
      +Specifies how much time is required to attempt decrypting the key, in milliseconds. +
      +
      +passes +
      +
      +Alternative to time: specifies the number of hash passes required to attempt decrypting the key. +
      +
      +parallelism +
      +
      +Number of parallelisable threads that can be used to decrypt the key. +
      +
      + +
      +
      +-E fptype +
      +
      +Algorithm to use when displaying key fingerprints. You can select sha256 or md5. See section 8.2.6. +
      +

      8.3 Getting ready for public key authentication

      Connect to your SSH server using PuTTY with the SSH protocol. When the connection succeeds you will be prompted for your user name and password to login. Once logged in, you must configure the server to accept your public key for authentication:

      • -If your server is OpenSSH, you should change into the .ssh directory under your home directory, and open the file authorized_keys with your favourite editor. (You may have to create this file, if this is the first key you have put in it.) Then switch to the PuTTYgen window, select all of the text in the ‘Public key for pasting into OpenSSH authorized_keys file’ box (see section 8.2.11), and copy it to the clipboard (Ctrl+C). Then, switch back to the PuTTY window and insert the data into the open file, making sure it ends up all on one line. Save the file. +If your server is OpenSSH, you should change into the .ssh directory under your home directory, and open the file authorized_keys with your favourite editor. (You may have to create this file, if this is the first key you have put in it.) Then switch to the PuTTYgen window, select all of the text in the ‘Public key for pasting into OpenSSH authorized_keys file’ box (see section 8.2.11), and copy it to the clipboard (Ctrl+C). Then, switch back to the PuTTY window and insert the data into the open file, making sure it ends up all on one line. Save the file.

        (In very old versions of OpenSSH, SSH-2 keys had to be put in a separate file called authorized_keys2. In all current versions, the same authorized_keys file is used for both SSH-1 and SSH-2 keys.)

      • -If your server is ssh.com's product and is using SSH-2, you need to save a public key file from PuTTYgen (see section 8.2.10), and copy that into the .ssh2 directory on the server. Then you should go into that .ssh2 directory, and edit (or create) a file called authorization. In this file you should put a line like Key mykey.pub, with mykey.pub replaced by the name of your key file. +If your server is ssh.com's product and is using SSH-2, you need to save a public key file from PuTTYgen (see section 8.2.10), and copy that into the .ssh2 directory on the server. Then you should go into that .ssh2 directory, and edit (or create) a file called authorization. In this file you should put a line like Key mykey.pub, with mykey.pub replaced by the name of your key file.
      • For other SSH server software, you should refer to the manual for that server. @@ -362,6 +451,5 @@

        8.3 Getting ready for p

      -

      If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

      -[PuTTY release 0.76]
      +

      If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

      diff --git a/code/doc/Chapter9.html b/code/doc/html/Chapter9.html similarity index 84% rename from code/doc/Chapter9.html rename to code/doc/html/Chapter9.html index f02309c..02c91e6 100644 --- a/code/doc/Chapter9.html +++ b/code/doc/html/Chapter9.html @@ -27,8 +27,9 @@

    • 9.4 Using agent forwarding
    • 9.5 Loading keys without decrypting them
    • @@ -155,23 +156,52 @@

      9.3.2 Making Page

      C:\PuTTY\pageant.exe d:\main.ppk -c C:\PuTTY\putty.exe
       
      -

      9.3.3 Starting with the key list visible

      +

      9.3.3 Integrating with Windows OpenSSH

      -Start Pageant with the --keylist option to show the main window as soon as it starts up. +Windows's own port of OpenSSH uses the same mechanism as Pageant to talk to its SSH agent (Windows named pipes). This means that Windows OpenSSH can talk directly to Pageant, if it knows where to find Pageant's named pipe.

      -

      9.3.4 Restricting the Windows process ACL

      -Pageant supports the same -restrict-acl option as the other PuTTY utilities to lock down the Pageant process's access control; see section 3.11.3.27 for why you might want to do this. +When Pageant starts up, it can optionally write out a file containing an OpenSSH configuration directive that tells the Windows ssh.exe where to find Pageant. If you include this file from your Windows SSH configuration, then ssh.exe should automatically use Pageant as its agent, so that you can keep your keys in one place and have both SSH clients able to use them. +

      +

      +The option is --openssh-config, and you follow it with a filename. +

      +

      +To refer to this file from your main OpenSSH configuration, you can use the ‘Include’ directive. For example, you might run Pageant like this (with your own username substituted, of course): +

      +
      pageant --openssh-config C:\Users\Simon\.ssh\pageant.conf
      +
      +

      +and then add a directive like this to your main ‘.ssh\config’ file (assuming that lives in the same directory that you just put pageant.conf): +

      +
      Include pageant.conf
      +
      +

      +Note: this technique only works with Windows's port of OpenSSH, which lives at C:\Windows\System32\OpenSSH\ssh.exe if you have it installed. (If not, it can be installed as a Windows optional feature, e.g., via Settings > Apps & features > Optional features > Add a feature > OpenSSH Client.) +

      +

      +There are other versions of OpenSSH for Windows, notably the one that comes with Windows git. Those will likely not work with the same configuration, because they tend to depend on Unix emulation layers like MinGW or MSys, so they won't speak Windows native pathname syntax or understand named pipes. The above instructions will only work with Windows's own version of OpenSSH. +

      +

      +So, if you want to use Windows git with an SSH key held in Pageant, you'll have to set the environment variable GIT_SSH, to point at a different program. You could point it at c:\Windows\System32\OpenSSH\ssh.exe once you've done this setup – but it's just as easy to point it at Plink! +

      +

      9.3.4 Starting with the key list visible

      +

      +Start Pageant with the --keylist option to show the main window as soon as it starts up. +

      +

      9.3.5 Restricting the Windows process ACL

      +

      +Pageant supports the same -restrict-acl option as the other PuTTY utilities to lock down the Pageant process's access control; see section 3.11.3.27 for why you might want to do this.

      By default, if Pageant is started with -restrict-acl, it won't pass this to any PuTTY sessions started from its System Tray submenu. Use -restrict-putty-acl to change this. (Again, see section 3.11.3.27 for details.)

      -

      9.4 Using agent forwarding

      +

      9.4 Using agent forwarding

      Agent forwarding is a mechanism that allows applications on your SSH server machine to talk to the agent on your client machine.

      -Note that at present, whether agent forwarding in SSH-2 is available depends on your server. Pageant's protocol is compatible with the OpenSSH server, but the ssh.com server uses a different agent protocol, which PuTTY does not yet support. +Note that at present, whether agent forwarding in SSH-2 is available depends on your server. Pageant's protocol is compatible with the OpenSSH server, but the ssh.com server uses a different agent protocol, which PuTTY does not yet support.

      To enable agent forwarding, first start Pageant. Then set up a PuTTY SSH session in which ‘Allow agent forwarding’ is enabled (see section 4.21.7). Open the session as normal. (Alternatively, you can use the -A command line option; see section 3.11.3.10 for details.) @@ -200,7 +230,7 @@

      9.4 Using that SSH connection as well (see the manual for your server-side SSH client to find out how to do this), your authentication keys will still be available on the next machine you connect to - two SSH connections away from where they're actually stored.

      -In addition, if you have a private key on one of the SSH servers, you can send it all the way back to Pageant using the local ssh-add command: +In addition, if you have a private key on one of the SSH servers, you can send it all the way back to Pageant using the local ssh-add command:

      unixbox:~$ ssh-add ~/.ssh/id_rsa
       Need passphrase for /home/fred/.ssh/id_rsa
      @@ -227,7 +257,7 @@ 

      9.5 Loading key
      C:\PuTTY\pageant.exe --encrypted d:\main.ppk
       

      -After a key has been decrypted for the first use, it remains decrypted, so that it can be used again. The main window will list the key with ‘(re-encryptable)’ after it. You can revert it to the previous state, where a passphrase is required, using the ‘Re-encrypt’ button in the Pageant main window. +After a key has been decrypted for the first use, it remains decrypted, so that it can be used again. The main window will list the key with ‘(re-encryptable)’ after it. You can revert it to the previous state, where a passphrase is required, using the ‘Re-encrypt’ button in the Pageant main window.

      You can also ‘re-encrypt’ all keys that were added encrypted by choosing ‘Re-encrypt All Keys’ from the System tray menu. (Note that this does not discard cleartext keys that were not previously added encrypted!) @@ -237,13 +267,13 @@

      9.5 Loading key

      9.6 Security considerations

      -Using Pageant for public-key authentication gives you the convenience of being able to open multiple SSH sessions without having to type a passphrase every time, but also gives you the security benefit of never storing a decrypted private key on disk. Many people feel this is a good compromise between security and convenience. +Using Pageant for public-key authentication gives you the convenience of being able to open multiple SSH sessions without having to type a passphrase every time, but also gives you the security benefit of never storing a decrypted private key on disk. Many people feel this is a good compromise between security and convenience.

      It is a compromise, however. Holding your decrypted private keys in Pageant is better than storing them in easy-to-find disk files, but still less secure than not storing them anywhere at all. This is for two reasons:

      • -Windows unfortunately provides no way to protect pieces of memory from being written to the system swap file. So if Pageant is holding your private keys for a long period of time, it's possible that decrypted private key data may be written to the system swap file, and an attacker who gained access to your hard disk later on might be able to recover that data. (However, if you stored an unencrypted key in a disk file they would certainly be able to recover it.) +Windows unfortunately provides no way to protect pieces of memory from being written to the system swap file. So if Pageant is holding your private keys for a long period of time, it's possible that decrypted private key data may be written to the system swap file, and an attacker who gained access to your hard disk later on might be able to recover that data. (However, if you stored an unencrypted key in a disk file they would certainly be able to recover it.)
      • Although, like most modern operating systems, Windows prevents programs from accidentally accessing one another's memory space, it does allow programs to access one another's memory space deliberately, for special purposes such as debugging. This means that if you allow a virus, trojan, or other malicious program on to your Windows system while Pageant is running, it could access the memory of the Pageant process, extract your decrypted authentication keys, and send them back to its master. @@ -259,6 +289,5 @@

        9.6 Security consideration Therefore, if you don't trust the sysadmin of a server machine, you should never use agent forwarding to that machine. (Of course you also shouldn't store private keys on that machine, type passphrases into it, or log into other machines from it in any way at all; Pageant is hardly unique in this respect.)

        -

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        -[PuTTY release 0.76]
        +

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        diff --git a/code/doc/IndexPage.html b/code/doc/html/IndexPage.html similarity index 51% rename from code/doc/IndexPage.html rename to code/doc/html/IndexPage.html index 9806257..ddb2a27 100644 --- a/code/doc/IndexPage.html +++ b/code/doc/html/IndexPage.html @@ -11,299 +11,302 @@

        Previous | Contents | Index | Next

        Index

        --4: Section 3.11.3.17
        --6: Section 3.11.3.17
        +-4: Section 3.11.3.17
        +-6: Section 3.11.3.17
        Abort Output, Telnet special command: Section 3.1.3.2
        Abort Process, Telnet special command: Section 3.1.3.2
        -accented characters: Section 3.3, Section 4.4.7
        -accessibility: Section 4.9.4
        +accented characters: Section 3.3, Section 4.4.8
        +accessibility: Section 4.9.4
        access to files, changing: Section 6.2.14
        account name: Section 2.3, Section 3.11.3.4, Section 5.2.1.1
        -account name, for auto-login: Section 4.15.1
        -account name, for proxy: Section 4.16.4
        -account name, local, in Rlogin: Section 4.30.1
        -account name, local, in Windows: Section 4.30.1
        -account names, different: Section 2.3, Section 4.21.8
        -ACL, process (Windows): Section 3.11.3.27, Section 9.3.4
        --A command-line option: Section 3.11.3.10
        --a command-line option: Section 3.11.3.10
        -active Telnet negotiation: Section 4.29.2
        -address, IP: Section 3.5, Section 4.1.1, Section 4.14.4
        -ad-hoc proxy: Section 4.16.1, Section 4.16.5, Section 4.29.2
        -adjusting a selection: Section 3.1.1, Section 4.11.1
        -Advanced Encryption Standard: Section 4.20
        -AES: Section 4.20
        --agent: Section 3.11.3.9
        +account name, for auto-login: Section 4.15.1
        +account name, for proxy: Section 4.16.4
        +account name, local, in Rlogin: Section 4.30.1
        +account name, local, in Windows: Section 4.30.1
        +account names, different: Section 2.3, Section 4.21.8
        +ACL, process (Windows): Section 3.11.3.27, Section 9.3.5
        +-A command-line option: Section 3.11.3.10
        +-a command-line option: Section 3.11.3.10
        +active Telnet negotiation: Section 4.29.2
        +address, IP: Section 3.5, Section 4.1.1, Section 4.14.4
        +ad-hoc proxy: Section 4.16.1, Section 4.16.5, Section 4.29.2
        +adjusting a selection: Section 3.1.1, Section 4.11.1
        +Advanced Encryption Standard: Section 4.20
        +AES: Section 4.20
        +-agent: Section 3.11.3.9
        agent, authentication: Section 8.1, Chapter 9
        -agent forwarding: Section 3.11.3.10, Section 4.21.7, Section 9.4
        -algorithm, encryption: Section 4.20
        -algorithm, key exchange: Section 4.18.1
        +agent forwarding: Section 3.11.3.10, Section 4.21.7, Section 9.4
        +algorithm, encryption: Section 4.20
        +algorithm, key exchange: Section 4.18.1
        algorithm, public-key: Section 8.1
        -allocation, of pseudo-terminal: Section 3.11.3.12, Section 4.23.1
        -alternate screen: Section 4.6.4, Section 4.7.4, Question A.7.16
        -ALT-F4: Section 4.9.3
        -‘AltGr’ key: Section 4.4.7, Section 4.4.8
        -‘Alt’ key: Section 4.9.5
        -ALT-Space: Section 4.9.4
        -always on top: Section 4.9.6
        -ANSI colours: Section 4.13.1, Section 4.13.7
        -ANSI graphics: Section 3.3, Section 4.10.4
        +allocation, of pseudo-terminal: Section 3.11.3.12, Section 4.23.1
        +alternate screen: Section 4.6.4, Section 4.7.4, Question A.7.16
        +ALT-F4: Section 4.9.3
        +‘AltGr’ key: Section 4.4.8, Section 4.4.9
        +‘Alt’ key: Section 4.9.5
        +ALT-Space: Section 4.9.4
        +always on top: Section 4.9.6
        +ANSI colours: Section 4.13.1, Section 4.13.7
        +ANSI graphics: Section 3.3, Section 4.10.4
        ANSI printing: Section 4.3.10
        answerback string: Section 4.3.7
        -Application Cursor Keys: Section 4.4.4, Section 4.6.1
        -Application key: Section 4.4.7
        -Application Keypad: Section 4.4.5, Section 4.6.1
        -Arabic: Section 4.6.11
        -Arabic text shaping: Section 4.6.10
        -Arcfour: Section 4.20, Section 10.4
        +Application Cursor Keys: Section 4.4.5, Section 4.6.1
        +Application key: Section 4.4.8
        +Application Keypad: Section 4.4.6, Section 4.6.1
        +Arabic: Section 4.6.11
        +Arabic text shaping: Section 4.6.10
        +Arcfour: Section 4.20, Section 10.4
        Are You There, Telnet special command: Section 3.1.3.2
        -Argon2 passphrase hashing function: Section 8.2.12.2
        +Argon2 passphrase hashing function: Section 8.2.12.2
        arguments, command-line: Section 3.11, Section 9.3
        -ASCII: Section 4.10.5, Question A.2.11
        +arrow keys, shifted: Section 4.4.4
        +ASCII: Section 4.10.5, Question A.2.11
        assertion failed: Section 10.7
        asymmetric key algorithm: Section 8.1
        -authentication: Section 4.21
        +authentication: Section 4.21
        authentication agent: Section 8.1, Chapter 9
        -authentication agent forwarding: Section 3.11.3.10, Section 4.21.7, Section 9.4
        -authentication, challenge/response: Section 4.21.5, Section 4.21.6
        -authentication, keyboard-interactive: Section 4.21.6
        -authentication, public key: Section 3.11.3.18, Section 4.21.9, Section 4.26.9, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        -authentication, to proxy: Section 4.16.4
        -authentication, X11: Section 4.24.1
        +authentication agent forwarding: Section 3.11.3.10, Section 4.21.7, Section 9.4
        +authentication, challenge/response: Section 4.21.5, Section 4.21.6
        +authentication, keyboard-interactive: Section 4.21.6
        +authentication, public key: Section 3.11.3.18, Section 4.21.9, Section 4.26.10, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        +authentication, to proxy: Section 4.16.4
        +authentication, X11: Section 4.24.1
        Authenticode: Appendix F
        -authorized_keys file: Section 8.2.11, Section 8.3
        +authorized_keys file: Section 8.2.11, Section 8.3
        AUTOEXEC.BAT: Section 5.1, Section 7.1
        automated operations: Chapter 7
        auto wrap mode: Section 4.3.1, Question A.7.7
        background colour: Section 4.3.5, Question A.7.6
        background colour, bright: Section 4.3.6
        -background colour, default: Section 4.13.6, Section 4.13.7
        -backspace, destructive: Section 4.6.8
        +background colour, default: Section 4.13.6, Section 4.13.7
        +backspace, destructive: Section 4.6.8
        backspace key: Section 4.4.1
        -bandwidth: Section 4.14.2, Section 4.15.4, Section 4.17.3
        -banner: Section 4.21.1
        -bare ssh-connection protocol: Section 4.27
        -‘basic’ authentication (HTTP): Section 4.16.4
        -batch files: Section 4.32, Section 5.2.3, Section 7.3
        +bandwidth: Section 4.14.2, Section 4.15.4, Section 4.17.3
        +banner: Section 4.21.1
        +bare ssh-connection protocol: Section 4.27
        +‘basic’ authentication (HTTP): Section 4.16.4
        +batch files: Section 4.32, Section 5.2.3, Section 7.3
        -batch Plink command-line option: Section 7.2.3.1
        -batch PSCP command-line option: Section 5.2.2.5
        -batch PSFTP command-line option: Section 6.1.4
        batch scripts in PSFTP: Section 6.1.1
        -baud rate, of terminal: Section 4.15.4
        +baud rate, of terminal: Section 4.15.4
        -bc PSFTP command-line option: Section 6.1.2
        -beep, terminal: Section 4.5
        -beep, with PC speaker: Section 4.5.1
        -bell, disabling: Section 4.5.1, Section 4.5.3
        -bell overload mode: Section 4.5.3
        -bell, terminal: Section 4.5
        -bell, visual: Section 4.5.1
        +beep, terminal: Section 4.5
        +beep, with PC speaker: Section 4.5.1
        +bell, disabling: Section 4.5.1, Section 4.5.3
        +bell overload mode: Section 4.5.3
        +bell, terminal: Section 4.5
        +bell, visual: Section 4.5.1
        -be PSFTP command-line option: Section 6.1.3
        -bidirectional text: Section 4.6.11
        -bind address: Section 3.5, Section 3.11.3.5, Section 4.25
        -BitchX: Section 4.6.9
        -8-bit colour: Section 4.13.5
        +bidirectional text: Section 4.6.11
        +bind address: Section 3.5, Section 3.11.3.5, Section 4.25
        +BitchX: Section 4.6.9
        +8-bit colour: Section 4.13.5
        32-bit Windows: Question A.6.10
        64-bit Windows: Question A.6.10, Question A.7.22
        -black, bold: Section 4.13.4
        -blinking cursor: Section 4.8.1
        +black, bold: Section 4.13.4
        +blinking cursor: Section 4.8.1
        blinking text: Section 4.3.6
        -Blowfish: Section 4.20, Section 10.4
        -bold black: Section 4.13.4
        -bold text: Section 4.13.4, Section 4.13.6, Section 4.13.7
        -box-drawing characters: Section 3.3, Section 4.10.4
        +Blowfish: Section 4.20, Section 10.4
        +bold black: Section 4.13.4
        +bold text: Section 4.13.4, Section 4.13.6, Section 4.13.7
        +box-drawing characters: Section 3.3, Section 4.10.4
        -b PSFTP command-line option: Section 6.1.1
        Break, serial special command: Section 3.1.3.2
        Break, SSH special command: Section 3.1.3.2
        Break, Telnet special command: Section 3.1.3.2
        -bright black: Section 4.13.4
        -BSD: Section 4.29.1
        +bright black: Section 4.13.4
        +BSD: Section 4.29.1
        bug reporting: Appendix B
        -bugs, in SSH servers: Section 4.26
        +bugs, in SSH servers: Section 4.26
        bulletin board system: Section 1.1
        -cache, of SSH host keys: Section 2.2, Section 3.1.3.2, Section 3.11.3.20, Section 3.11.3.21, Section 4.14.5, Section 4.19, Section 4.19.3
        -Caps Lock: Section 4.10.3
        +cache, of SSH host keys: Section 2.2, Section 3.1.3.2, Section 3.11.3.20, Section 3.11.3.21, Section 4.14.5, Section 4.19, Section 4.19.3
        +Caps Lock: Section 4.10.3
        Carriage Return: Section 4.3.3, Section 4.3.4
        -cascading credentials: Section 4.18.1.1
        +cascading credentials: Section 4.18.1.1
        cat: Question A.7.13
        --C command-line option: Section 3.11.3.15
        -ChaCha20-Poly1305: Section 4.20
        -challenge/response authentication: Section 4.21.5, Section 4.21.6
        +-C command-line option: Section 3.11.3.15
        +ChaCha20-Poly1305: Section 4.20
        +challenge/response authentication: Section 4.21.5, Section 4.21.6
        ‘Change Settings’: Section 3.1.3.4
        changing permissions on files: Section 6.2.14
        -changing user names: Section 2.3, Section 4.21.8
        -CHAP: Section 4.16.4
        -character classes: Section 4.12.1
        -characters, accented: Section 3.3, Section 4.4.7
        -character set: Section 3.3, Section 4.6.9, Section 4.10
        -characters, line-drawing: Section 3.3, Section 4.10.4
        -character width: Section 4.10.2
        -Chinese: Section 4.10.2
        +changing user names: Section 2.3, Section 4.21.8
        +CHAP: Section 4.16.4
        +character classes: Section 4.12.1
        +characters, accented: Section 3.3, Section 4.4.8
        +character set: Section 3.3, Section 4.6.9, Section 4.10
        +characters, line-drawing: Section 3.3, Section 4.10.4
        +character width: Section 4.10.2
        +Chinese: Section 4.10.2
        choosing a protocol: Section 1.2, Section 3.11.3.2
        -cipher algorithm: Section 4.20
        +cipher algorithm: Section 4.20
        Cisco: Section 3.11.3.6
        -CJK: Section 4.10.2
        -CJK ambiguous characters: Section 4.10.2
        +CJK: Section 4.10.2
        +CJK ambiguous characters: Section 4.10.2
        clean up after PuTTY: Question A.8.2
        -cleanup command-line option: Section 3.11.2
        clear screen: Section 4.3.5
        ‘Clear Scrollback’: Section 3.1.3.6
        client: Section 1.1
        clipboard: Section 3.1.1, Section 3.1.3.1, Section 3.1.3.5
        -CLIPBOARD selection: Section 4.11.4
        -clipboards, multiple: Section 4.11.4
        -Close button: Section 2.5, Section 4.9.2
        -closing window: Section 4.1.3, Section 4.9.2, Section 4.9.3
        -code page: Section 4.10.1
        -colour: Section 4.12.2, Section 4.13, Question A.7.2
        -colour, background, default: Section 4.13.6, Section 4.13.7
        -colour, 8-bit: Section 4.13.5
        -colour, foreground, default: Section 4.13.6, Section 4.13.7
        -256-colour mode: Section 4.13.2
        -colour, of cursor: Section 4.13.6, Section 4.13.7
        -colours, ANSI: Section 4.13.1, Section 4.13.7
        -colours, system: Section 4.13.6
        -columns, in terminal window: Section 4.7.1
        -COM1: Section 4.28.1
        +CLIPBOARD selection: Section 4.11.4
        +clipboards, multiple: Section 4.11.4
        +Close button: Section 2.5, Section 4.9.2
        +closing window: Section 4.1.3, Section 4.9.2, Section 4.9.3
        +code page: Section 4.10.1
        +colour: Section 4.12.2, Section 4.13, Question A.7.2
        +colour, background, default: Section 4.13.6, Section 4.13.7
        +colour, 8-bit: Section 4.13.5
        +colour, foreground, default: Section 4.13.6, Section 4.13.7
        +256-colour mode: Section 4.13.2
        +colour, of cursor: Section 4.13.6, Section 4.13.7
        +colours, ANSI: Section 4.13.1, Section 4.13.7
        +colours, system: Section 4.13.6
        +columns, in terminal window: Section 4.7.1
        +COM1: Section 4.28.1
        command-line arguments: Section 3.11, Section 9.3
        command-line interface: Section 1.1
        command line, loading saved sessions from: Section 3.11.3.1
        --1 command-line option: Section 3.11.3.16
        --2 command-line option: Section 3.11.3.16
        +-1 command-line option: Section 3.11.3.16
        +-2 command-line option: Section 3.11.3.16
        Command Prompt: Section 1.1, Section 1.1, Section 3.11, Section 5.1, Section 7.1
        -command, proxy: Section 3.11.3.26, Section 4.16.1, Section 4.16.5
        -commands on the server: Section 2.4, Section 3.11.3.6, Section 4.17.1, Section 4.17.2, Question A.6.2
        +command, proxy: Section 3.11.3.26, Section 4.16.1, Section 4.16.5
        +commands on the server: Section 2.4, Section 3.11.3.6, Section 4.17.1, Section 4.17.2, Question A.6.2
        commands, reading from a file: Section 3.11.3.6
        comment: Section 6.2
        -Compose key: Section 4.4.7
        -compression: Section 3.11.3.15, Section 4.17.3
        -confidentiality: Section 4.18.2
        -configuration: Section 3.11.3.23
        +Compose key: Section 4.4.8
        +compression: Section 3.11.3.15, Section 4.17.3
        +confidentiality: Section 4.18.2
        +configuration: Section 3.11.3.23
        configuration options: Chapter 4
        -connection, network: Section 3.5, Section 4.14, Section 4.25
        -connections, half-open: Section 4.14.3
        -connections, idle: Section 4.14.1, Question A.7.8
        -connections, interactive: Section 4.14.2, Section 4.23.1, Chapter 7
        -connectivity, breaks in: Section 4.14.1, Question A.7.9
        -CONNECT proxy (HTTP): Section 4.16.1
        +connection, network: Section 3.5, Section 4.14, Section 4.25
        +connections, half-open: Section 4.14.3
        +connections, idle: Section 4.14.1, Question A.7.8
        +connections, interactive: Section 4.14.2, Section 4.23.1, Chapter 7
        +connectivity, breaks in: Section 4.14.1, Question A.7.9
        +CONNECT proxy (HTTP): Section 4.16.1
        console window: Section 1.1, Section 1.1, Section 3.11, Section 5.1, Section 7.1
        -context menu: Section 3.1.1, Section 3.1.3, Section 4.11.1
        +context menu: Section 3.1.1, Section 3.1.3, Section 4.11.1
        Control-?: Section 4.4.1
        Control-H: Section 4.4.1
        -control sequences: Section 3.2, Section 4.3.1, Section 4.3.2, Section 4.3.5, Section 4.3.6, Section 4.6.2, Section 4.9.1, Section 4.10.4, Section 4.11.2, Section 4.12.1, Section 4.13.1, Section 4.13.4, Section 4.15.3, Section 4.15.3, Section 7.2.1, Question A.5.1
        -cookie, magic: Section 4.24.1
        +control sequences: Section 3.2, Section 4.3.1, Section 4.3.2, Section 4.3.5, Section 4.3.6, Section 4.6.2, Section 4.9.1, Section 4.10.4, Section 4.11.2, Section 4.12.1, Section 4.13.1, Section 4.13.4, Section 4.15.3, Section 4.15.3, Section 7.2.1, Question A.5.1
        +cookie, magic: Section 4.24.1
        coordinates, cursor: Section 4.3.2
        Copy All to Clipboard: Section 3.1.3.5
        -copy and paste: Section 3.1.1, Section 4.6.2, Section 4.10.5, Section 4.11, Section 4.11.2, Question A.6.6
        +copy and paste: Section 3.1.1, Section 4.6.2, Section 4.10.5, Section 4.11, Section 4.11.2, Question A.6.6
        copyright: Appendix D
        -corruption, of display: Section 4.6.10, Section 4.6.11
        -CP437: Section 4.10.1
        -CP866: Section 4.10.1
        +corruption, of display: Section 4.6.10, Section 4.6.11
        +CP437: Section 4.10.1
        +CP866: Section 4.10.1
        -c Pageant command-line option: Section 9.3.2
        CRC: Section 10.12
        CR (Carriage Return): Section 4.3.3, Section 4.3.4
        creating directories: Section 6.2.16
        -creating key pairs: Section 8.2
        -credential delegation, GSSAPI: Section 4.22.1
        -credentials, cascading: Section 4.18.1.1
        -CryptoCard authentication: Section 4.21.5
        +creating key pairs: Section 8.2
        +credential delegation, GSSAPI: Section 4.22.1
        +credentials, cascading: Section 4.18.1.1
        +CryptoCard authentication: Section 4.21.5
        Ctrl-?: Section 4.4.1
        Ctrl-Break: Section 3.1.3.2
        -Ctrl-C: Section 3.1.1, Section 3.1.1, Section 4.11.4
        +Ctrl-C: Section 3.1.1, Section 3.1.1, Section 4.11.4
        Ctrl-H: Section 4.4.1
        -Ctrl-Ins: Section 3.1.1, Section 4.11.4.2
        +Ctrl-Ins: Section 3.1.1, Section 4.11.4.2
        Ctrl-PgDn: Section 3.1.2
        Ctrl-PgUp: Section 3.1.2
        -Ctrl-Shift-C: Section 4.11.4.2
        +Ctrl-Shift-C: Section 4.11.4.2
        Ctrl-Shift-PgDn: Section 3.1.2
        Ctrl-Shift-PgUp: Section 3.1.2
        -Ctrl-Shift-V: Section 4.11.4.2
        -Ctrl-V: Section 4.11.4
        +Ctrl-Shift-V: Section 4.11.4.2
        +Ctrl-V: Section 4.11.4
        Ctrl, with right mouse button: Section 3.1.1
        current working directory: Section 6.2.7, Section 6.2.8
        -cursor: Section 4.8.1
        -cursor, blinking: Section 4.8.1
        -cursor colour: Section 4.13.6, Section 4.13.7
        +cursor: Section 4.8.1
        +cursor, blinking: Section 4.8.1
        +cursor colour: Section 4.13.6, Section 4.13.7
        cursor coordinates: Section 4.3.2
        -cursor keys, ‘Application’ mode: Section 4.4.4, Section 4.6.1
        -cut and paste: Section 3.1.1, Section 4.6.2, Section 4.10.5, Section 4.11, Section 4.11.2, Question A.6.6
        +cursor keys, ‘Application’ mode: Section 4.4.5, Section 4.6.1
        +cut and paste: Section 3.1.1, Section 4.6.2, Section 4.10.5, Section 4.11, Section 4.11.2, Question A.6.6
        CVS: Section 7.4
        CVS_RSH environment variable: Section 7.4
        -Cyrillic: Section 4.10.3
        +Cyrillic: Section 4.10.3
        -D command-line option: Section 3.11.3.5
        debugging Internet protocols: Section 3.7
        -DEC Compose key: Section 4.4.7
        +DEC Compose key: Section 4.4.8
        DEC Origin Mode: Section 4.3.2
        DECterm: Question A.5.1
        -Default Beep sound, Windows: Section 4.5
        +Default Beep sound, Windows: Section 4.5
        Default Settings: Section 3.11.1, Section 4.1.2
        delays, in SSH-2 sessions: Question A.7.20
        -delegation, of GSSAPI credentials: Section 4.22.1
        +delegation, of GSSAPI credentials: Section 4.22.1
        deleting directories: Section 6.2.17
        deleting files: Section 6.2.15
        -DES: Section 4.20, Section 10.4
        -destructive backspace: Section 4.6.8
        +DES: Section 4.20, Section 10.4
        +destructive backspace: Section 4.6.8
        development snapshots: Section B.2
        -diagnostic, proxy: Section 4.16.6
        +diagnostic, proxy: Section 4.16.6
        dialog box: Section 2.1
        -DiceWare: Section 8.2.8
        +DiceWare: Section 8.2.8
        differences between SSH, Telnet, Rlogin, and SUPDUP: Section 1.2
        -different user names: Section 2.3, Section 4.21.8
        -Diffie-Hellman group exchange: Section 4.18.1
        -Diffie-Hellman key exchange: Section 4.18.1
        -digital signature: Section 4.26.6, Section 8.1
        -Digital Signature Standard: Section 4.19.1, Section 4.19.1, Section 8.1, Section 8.2.2, Question A.8.3
        +different user names: Section 2.3, Section 4.21.8
        +Diffie-Hellman group exchange: Section 4.18.1
        +Diffie-Hellman key exchange: Section 4.18.1
        +‘digest’ authentication (HTTP): Section 4.16.4
        +digital signature: Section 4.26.7, Section 8.1
        +Digital Signature Standard: Section 4.19.1, Section 4.19.1, Section 8.1, Section 8.2.2, Question A.8.3
        directories, creating: Section 6.2.16
        directories, removing: Section 6.2.17
        -display corruption: Section 4.6.10, Section 4.6.11
        +display corruption: Section 4.6.10, Section 4.6.11
        DISPLAY environment variable: Section 3.4
        -DLL: Section 4.22.2, Question A.6.10
        -DNS: Section 4.16.3
        -DNS name: Section 2.1, Section 4.1.1, Section 4.9.1, Section 4.14.4, Section 5.2.1.2
        -DNS resolution: Section 4.16.3
        -DNS, with proxy: Section 4.16.2, Section 4.16.3
        -Domain Name System: Section 4.16.3
        -double-click: Section 3.1.1, Section 4.12.1
        -double-width character: Section 4.10.2
        +DLL: Section 4.22.2, Question A.6.10
        +DNS: Section 4.16.3
        +DNS name: Section 2.1, Section 4.1.1, Section 4.9.1, Section 4.14.4, Section 5.2.1.2
        +DNS resolution: Section 4.16.3
        +DNS, with proxy: Section 4.16.2, Section 4.16.3
        +Domain Name System: Section 4.16.3
        +double-click: Section 3.1.1, Section 4.12.1
        +double-width character: Section 4.10.2
        downloading files: Section 5.2.1, Section 6.2.9
        -Dragon NaturallySpeaking: Section 4.9.4
        -DSA: Section 4.19.1, Section 4.19.1, Section 8.1, Section 8.2.2, Question A.8.3
        -DSA authentication: Section 3.11.3.18, Section 4.21.9, Section 4.26.9, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        +Dragon NaturallySpeaking: Section 4.9.4
        +DSA: Section 4.19.1, Section 4.19.1, Section 8.1, Section 8.2.2, Question A.8.3
        +DSA authentication: Section 3.11.3.18, Section 4.21.9, Section 4.26.10, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        +DSS: Section 8.1
        ‘Duplicate Session’: Section 3.1.3.3, Question A.7.22
        -dynamic port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        -East Asian Ambiguous characters: Section 4.10.2
        -ECDSA: Section 8.1, Section 8.2.2
        +dynamic port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        +East Asian Ambiguous characters: Section 4.10.2
        +ECDSA: Section 8.1, Section 8.2.2
        echo, local: Section 4.3.8, Section 4.3.9, Question A.2.4
        echo, remote: Section 4.3.8
        -Ed25519: Section 4.19.1, Section 8.2.3
        -Ed448: Section 4.19.1, Section 8.2.3
        -EdDSA: Section 4.19.1, Section 4.19.1, Section 8.2.2
        -Edwards-curve DSA: Section 4.19.1, Section 4.19.1, Section 8.2.2
        -elliptic curve: Section 4.18.1, Section 4.19.1, Section 8.2.2
        -emulation, terminal: Section 3.1.3.6, Section 4.3, Section 4.3.7, Section 4.4, Section 4.6, Section 4.15.3
        -encryption: Section 4.26.10, Section 8.1, Section 8.2.8
        -encryption algorithm: Section 4.20
        +Ed25519: Section 4.19.1, Section 8.2.3
        +Ed448: Section 4.19.1, Section 8.2.3
        +EdDSA: Section 4.19.1, Section 4.19.1, Section 8.2.2
        +Edwards-curve DSA: Section 4.19.1, Section 4.19.1, Section 8.2.2
        +elliptic curve: Section 4.18.1, Section 4.19.1, Section 8.2.2
        +emulation, terminal: Section 3.1.3.6, Section 4.3, Section 4.3.7, Section 4.4, Section 4.6, Section 4.15.3
        +encryption: Section 4.26.11, Section 8.1, Section 8.2.8
        +encryption algorithm: Section 4.20
        End key: Section 4.4.2
        End Of File, Telnet special command: Section 3.1.3.2
        End Of Record, Telnet special command: Section 3.1.3.2
        enquiry character: Section 4.3.7
        -environment variables: Section 4.15.5, Section 4.29.1
        -Erase Character, Telnet special command: Section 3.1.3.2, Section 4.29.3
        +environment variables: Section 4.15.5, Section 4.29.1
        +Erase Character, Telnet special command: Section 3.1.3.2, Section 4.29.3
        Erase Line, Telnet special command: Section 3.1.3.2
        erase screen: Section 4.3.5
        -ERASE, special character: Section 4.23.2
        +ERASE, special character: Section 4.23.2
        ERRORLEVEL: Section 5.2.3
        error messages: Chapter 10
        -escape sequences: Section 3.2, Section 4.3.1, Section 4.3.2, Section 4.3.6, Section 4.6.2, Section 4.9.1, Section 4.10.4, Section 4.11.2, Section 4.12.1, Section 4.13.1, Section 4.13.4, Section 4.15.3, Section 7.2.1
        +escape sequences: Section 3.2, Section 4.3.1, Section 4.3.2, Section 4.3.6, Section 4.6.2, Section 4.9.1, Section 4.10.4, Section 4.11.2, Section 4.12.1, Section 4.13.1, Section 4.13.4, Section 4.15.3, Section 7.2.1
        Event Log: Section 3.1.3.1, Section 4.2
        execute permission: Section 6.2.14
        exit value: Section 5.2.3
        -expiry, of passwords: Section 4.21.6
        -exporting private keys: Section 8.2.14
        -extending a selection: Section 3.1.1, Section 4.11.1
        +expiry, of passwords: Section 4.21.6
        +exporting private keys: Section 8.2.14
        +extending a selection: Section 3.1.1, Section 4.11.1
        FAQ: Appendix A
        features, supported: Section A.2
        feedback: Appendix B
        -feep: Section 4.5
        +feep: Section 4.5
        filenames containing spaces: Section 6.2.1, Question A.6.9
        files, changing permissions on: Section 6.2.14
        files, deleting: Section 6.2.15
        @@ -314,429 +317,434 @@

        Index

        files, sending: Section 5.2.1, Section 6.2.10
        files, transferring: Chapter 5, Chapter 6
        finger: Section 3.5
        -fingerprint, MD5, of SSH host key: Section 2.2, Section 4.19.3
        -fingerprint, of PGP key: Section 3.11.3.22
        -fingerprint, of SSH authentication key: Section 8.2.6, Section 9.2.1
        +fingerprint, MD5, of SSH host key: Section 2.2, Section 4.19.3
        +fingerprint, of PGP key: Section 3.11.3.22
        +fingerprint, of SSH authentication key: Section 8.2.6, Section 9.2.1
        fingerprint, of SSH host key: Section 2.2
        -fingerprint, SHA-256, of SSH host key: Section 2.2, Section 4.19.3
        -firewalls: Section 4.14.1, Section 4.18.2, Section 4.29.2, Section 10.16, Question A.7.8
        -flashing cursor: Section 4.8.1
        +fingerprint, SHA-256, of SSH host key: Section 2.2, Section 4.19.3
        +firewalls: Section 4.14.1, Section 4.18.2, Section 4.29.2, Section 10.16, Question A.7.8
        +flashing cursor: Section 4.8.1
        flashing text: Section 4.3.6
        -flow-control window: Section 4.26.5
        -font: Section 4.8.2, Section 4.10.4, Section 4.12.2, Section 4.13.4
        -font size: Section 4.7.2, Section 4.8.2
        -foreground colour, default: Section 4.13.6, Section 4.13.7
        -forwarding, of X11: Section 3.4, Section 3.11.3.11, Section 4.24
        -forwarding ports in SSH: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        -forwarding ports in SSH, changing mid-session: Section 4.25
        -forwarding, SSH agent: Section 3.11.3.10, Section 4.21.7, Section 9.4
        +flow-control window: Section 4.26.5
        +font: Section 4.8.2, Section 4.10.4, Section 4.12.2, Section 4.13.4
        +font size: Section 4.7.2, Section 4.8.2
        +foreground colour, default: Section 4.13.6, Section 4.13.7
        +forwarding, of X11: Section 3.4, Section 3.11.3.11, Section 4.24
        +forwarding ports in SSH: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        +forwarding ports in SSH, changing mid-session: Section 4.25
        +forwarding, SSH agent: Section 3.11.3.10, Section 4.21.7, Section 9.4
        Frequently Asked Questions: Appendix A
        ftp: Chapter 6
        -full-screen mode: Section 3.1.3.7, Section 4.7.3, Section 4.9.7
        +full-screen mode: Section 3.1.3.7, Section 4.7.3, Section 4.9.7
        function keys: Section 4.4.3, Question A.7.13
        -generating key pairs: Section 8.2
        +generating key pairs: Section 8.2
        glob (wildcard): Section 5.2.1, Section 5.2.1.3, Section 5.2.2.6, Section 6.2.2, Section 6.2.11
        Go Ahead, Telnet special command: Section 3.1.3.2
        GPG signatures, of PuTTY binaries: Appendix F
        -graphical applications: Section 3.4, Section 4.24
        -group exchange, Diffie-Hellman: Section 4.18.1
        -GSSAPI: Section 4.15.2, Section 4.22
        -GSSAPI credential delegation: Section 4.22.1
        +graphical applications: Section 3.4, Section 4.24
        +group exchange, Diffie-Hellman: Section 4.18.1
        +GSSAPI: Section 4.15.2, Section 4.22
        +GSSAPI credential delegation: Section 4.22.1
        Gtk: Question A.3.2
        -half-open connections: Section 4.14.3
        -Hebrew: Section 4.6.11
        +half-open connections: Section 4.14.3
        +Hebrew: Section 4.6.11
        history: Section 3.1.2
        -HMAC: Section 4.26.8
        +HMAC: Section 4.26.9
        home directory: Section 5.2.1.3
        Home key: Section 4.4.2
        --hostkey: Section 3.11.3.21
        +-hostkey: Section 3.11.3.21
        host key fingerprint (SSH): Section 2.2
        -host key management: Section 2.2, Section 3.1.3.2, Section 3.11.3.20, Section 3.11.3.21, Section 4.14.5, Section 4.19, Section 4.19.3
        -host keys, manually configuring: Section 3.11.3.21, Section 4.19.3
        +host key management: Section 2.2, Section 3.1.3.2, Section 3.11.3.20, Section 3.11.3.21, Section 4.14.5, Section 4.19, Section 4.19.3
        +host keys, manually configuring: Section 3.11.3.21, Section 4.19.3
        host keys, trusting: Section 2.2
        host keys, upgrading: Section 3.1.3.2
        -host key type: Section 4.19.1
        +host key type: Section 4.19.1
        host key, verifying: Section 2.2, Question A.2.9
        -host name: Section 2.1, Section 4.1.1, Section 4.9.1, Section 4.14.4, Section 5.2.1.2
        -host name, logical: Section 3.11.3.20, Section 4.14.5
        -host name resolution: Section 4.16.3
        -host name resolution, with proxy: Section 4.16.2, Section 4.16.3
        +host name: Section 2.1, Section 4.1.1, Section 4.9.1, Section 4.14.4, Section 5.2.1.2
        +host name, logical: Section 3.11.3.20, Section 4.14.5
        +host name resolution: Section 4.16.3
        +host name resolution, with proxy: Section 4.16.2, Section 4.16.3
        HTTP: Section 3.7
        -HTTP ‘basic’ authentication: Section 4.16.4
        -HTTP proxy: Section 4.16.1
        --i command-line option: Section 3.11.3.18
        +HTTP Basic authentication: Section 4.16.4
        +HTTP Digest authentication: Section 4.16.4
        +HTTP proxy: Section 4.16.1
        +-i command-line option: Section 3.11.3.18
        icon, PuTTY's: Section 2.3, Section A.5.3
        -icon title: Section 4.9.1
        -idle connections: Section 4.14.1, Question A.7.8
        -‘ignore’ messages, in SSH: Section 3.1.3.2, Section 4.26.1, Section 4.26.11
        +icon title: Section 4.9.1
        +idle connections: Section 4.14.1, Question A.7.8
        +‘ignore’ messages, in SSH: Section 3.1.3.2, Section 4.26.1, Section 4.26.12
        IGNORE message, SSH special command: Section 3.1.3.2
        -importing private keys: Section 8.2.14
        +importing private keys: Section 8.2.14
        inactive window: Section 4.1.3
        indenting: Section 3.1.1
        -integrity: Section 4.18.2
        -interactive connections: Section 4.14.2, Section 4.23.1, Chapter 7
        -intermittent connectivity: Section 4.14.1, Question A.7.9
        +integrity: Section 4.18.2
        +interactive connections: Section 4.14.2, Section 4.23.1, Chapter 7
        +intermittent connectivity: Section 4.14.1, Question A.7.9
        internal error: Section 10.7
        internal fault: Section 10.7
        Internet protocols, debugging: Section 3.7
        -Internet Protocol version: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        -Interrupt Process, Telnet special command: Section 3.1.3.2, Section 4.29.3
        -IP address: Section 3.5, Section 4.1.1, Section 4.14.4
        -IP address, loopback: Section 3.5, Section 4.16.2
        +Internet Protocol version: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        +Interrupt Process, Telnet special command: Section 3.1.3.2, Section 4.29.3
        +IP address: Section 3.5, Section 4.1.1, Section 4.14.4
        +IP address, loopback: Section 3.5, Section 4.16.2
        IP masquerading: Section 10.16, Question A.7.8
        -IPv4: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        -IPv6: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        -IPv6 address: Section 4.25
        -ISO-8859: Section 4.10.1
        -ISO-10646 (Unicode): Section 4.6.10, Section 4.10.1, Section 4.10.4, Section 4.10.5
        -IUTF8 terminal mode: Section 4.23.2
        -Japanese: Section 4.10.2
        -keepalives, application: Section 4.14.1, Section 4.18.2, Section 4.26.1, Section 4.26.11
        -keepalives, TCP: Section 4.14.3
        -Kerberos: Section 4.22
        -kex: Section 4.18
        -keyboard: Section 4.4, Section 4.15.3, Question A.7.12, Question A.7.13
        -keyboard-interactive authentication: Section 4.21.6
        -key exchange: Section 4.18
        -key exchange algorithm: Section 4.18.1
        -key exchange, Diffie-Hellman: Section 4.18.1
        +IPv4: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        +IPv6: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        +IPv6 address: Section 4.25
        +ISO-8859: Section 4.10.1
        +ISO-10646 (Unicode): Section 4.6.10, Section 4.10.1, Section 4.10.4, Section 4.10.5
        +IUTF8 terminal mode: Section 4.23.2
        +Japanese: Section 4.10.2
        +jump host: Section 4.16.1
        +keepalives, application: Section 4.14.1, Section 4.18.2, Section 4.26.1, Section 4.26.12
        +keepalives, TCP: Section 4.14.3
        +Kerberos: Section 4.22
        +kex: Section 4.18
        +keyboard: Section 4.4, Section 4.15.3, Question A.7.12, Question A.7.13
        +keyboard-interactive authentication: Section 4.21.6
        +key exchange: Section 4.18
        +key exchange algorithm: Section 4.18.1
        +key exchange, Diffie-Hellman: Section 4.18.1
        key exchange, forcing repeat: Section 3.1.3.2
        -key exchange, repeat: Section 3.1.3.2, Section 4.18.2, Section 4.26.2, Question A.7.20
        ---keylist: Section 9.3.3
        -keypad, ‘Application’ mode: Section 4.4.5, Section 4.6.1
        -keypad, NetHack mode: Section 4.4.6
        +key exchange, repeat: Section 3.1.3.2, Section 4.18.2, Section 4.26.2, Question A.7.20
        +--keylist Pageant command-line option: Section 9.3.4
        +keypad, ‘Application’ mode: Section 4.4.6, Section 4.6.1
        +keypad, NetHack mode: Section 4.4.7
        keypad, numeric: Section 4.4.3
        key pair: Section 8.1
        -key pairs, generating: Section 8.2
        +key pairs, generating: Section 8.2
        known_hosts: Question A.2.9
        -Korean: Section 4.10.2
        -last selected text: Section 4.11.4.2
        +Korean: Section 4.10.2
        +last selected text: Section 4.11.4.2
        -L command-line option: Section 3.11.3.5
        -l command-line option: Section 3.11.3.4
        -left mouse button: Section 3.1.1, Section 4.11.1
        +left mouse button: Section 3.1.1, Section 4.11.1
        LF (Line Feed): Section 4.3.3, Section 4.3.4
        licence: Appendix D
        -line-drawing characters: Section 3.3, Section 4.10.4
        +line-drawing characters: Section 3.3, Section 4.10.4
        line editing, local: Section 4.3.9
        Line Feed: Section 4.3.3, Section 4.3.4
        lines, selecting: Section 3.1.1
        line wrapping, automatic: Section 4.3.1, Question A.7.7
        -links (web browser): Section 4.6.2
        -Linux: Section 4.4, Section 4.4.1, Section 4.15.3, Section 4.23.1, Section 4.25.2, Section 6.2.14, Section 10.18, Question A.7.13
        +links (web browser): Section 4.6.2
        +Linux: Section 4.4, Section 4.4.1, Section 4.15.3, Section 4.23.1, Section 4.25.2, Section 6.2.14, Section 10.18, Question A.7.13
        Linux, Red Hat: Question A.7.15
        Linux version of PuTTY tools: PuTTY User Manual, Question A.3.2
        Linux virtual console: Section 4.4.3
        -listen address: Section 3.5, Section 3.11.3.5, Section 4.25
        +listen address: Section 3.5, Section 3.11.3.5, Section 4.25
        listing files: Section 5.2.2.1, Section 6.2.13
        -load command-line option: Section 3.11.3.1
        -loading private keys: Section 8.2.14
        +loading private keys: Section 8.2.14
        loading saved sessions from command line: Section 3.11.3.1
        loading settings: Section 4.1.2
        -loading settings from a file: Section 4.32
        +loading settings from a file: Section 4.32
        local echo: Section 4.3.8, Section 4.3.9, Question A.2.4
        -localhost: Section 3.5, Section 4.16.2, Section 4.25.1, Question A.7.17
        +localhost: Section 3.5, Section 4.16.2, Section 4.25.1, Question A.7.17
        local line editing: Section 4.3.9
        -local proxy: Section 3.11.3.26, Section 4.16.1, Section 4.16.5
        -local-to-remote port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        -local user name, in Rlogin: Section 4.30.1
        -local user name, in Windows: Section 4.30.1
        +local proxy: Section 3.11.3.26, Section 4.16.1, Section 4.16.5
        +local-to-remote port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        +local user name, in Rlogin: Section 4.30.1
        +local user name, in Windows: Section 4.30.1
        local Windows command: Section 6.2.19
        locking up, SSH-2 sessions: Question A.7.20
        --logappend: Section 3.11.3.25
        +-logappend: Section 3.11.3.25
        Log, Event: Section 3.1.3.1, Section 4.2
        -log file: Section 3.2, Section 3.11.3.24, Section 4.2
        +log file: Section 3.2, Section 3.11.3.24, Section 4.2
        log file, flushing: Section 4.2.3
        log file, header: Section 4.2.4
        logging in: Section 2.3
        logging out: Section 2.5
        -logging, proxy: Section 4.16.6
        --loghost: Section 3.11.3.20
        -logical host name: Section 3.11.3.20, Section 4.14.5
        -logical palettes: Section 4.13.5
        +logging, proxy: Section 4.16.6
        +-loghost: Section 3.11.3.20
        +logical host name: Section 3.11.3.20, Section 4.14.5
        +logical palettes: Section 4.13.5
        login name: Section 2.3, Section 3.11.3.4, Section 5.2.1.1
        -login name, for auto-login: Section 4.15.1
        -login name, for proxy: Section 4.16.4
        -login name, local, in Rlogin: Section 4.30.1
        -login name, local, in Windows: Section 4.30.1
        -login names, different: Section 2.3, Section 4.21.8
        -login, passwordless: Section 1.2, Section 4.22, Section 4.30.1, Section 8.2.8, Chapter 9
        +login name, for auto-login: Section 4.15.1
        +login name, for proxy: Section 4.16.4
        +login name, local, in Rlogin: Section 4.30.1
        +login name, local, in Windows: Section 4.30.1
        +login names, different: Section 2.3, Section 4.21.8
        +login, passwordless: Section 1.2, Section 4.22, Section 4.30.1, Section 8.2.8, Chapter 9
        login scripts: Section 10.6, Question A.7.1, Question A.7.4
        logo, PuTTY's: Section 2.3, Section A.5.3
        --logoverwrite: Section 3.11.3.25
        -loopback IP address: Section 3.5, Section 4.16.2
        -low-numbered port: Section 3.5, Section 4.25, Section 4.30.1
        +-logoverwrite: Section 3.11.3.25
        +loopback IP address: Section 3.5, Section 4.16.2
        +low-numbered port: Section 3.5, Section 4.25, Section 4.30.1
        -ls PSCP command-line option: Section 5.2.2.1
        -MAC (message authentication code): Section 4.20, Section 4.26.8, Section 10.12, Section 10.12
        +MAC (message authentication code): Section 4.20, Section 4.26.9, Section 10.12, Section 10.12
        Mac OS: Question A.3.6
        -magic cookie: Section 4.24.1
        +magic cookie: Section 4.24.1
        mailing list: Section B.1
        man pages for PuTTY tools: PuTTY User Manual
        -manually configuring host keys: Section 3.11.3.21, Section 4.19.3
        -maximise window: Section 4.7.2, Question A.6.3
        -maximum packet size: Section 4.26.5
        -mc: Section 4.6.2
        +manually configuring host keys: Section 3.11.3.21, Section 4.19.3
        +maximise window: Section 4.7.2, Question A.6.3
        +maximum packet size: Section 4.26.5
        +mc: Section 4.6.2
        -m command-line option: Section 3.11.3.6, Section 3.11.3.6
        -MD5 fingerprint, of SSH host key: Section 2.2, Section 4.19.3
        -menu, context: Section 3.1.1, Section 3.1.3, Section 4.11.1
        -menu, system: Section 3.1.3, Section 3.1.3.7, Section 4.9.4, Section 4.9.5, Section 4.9.7
        -message authentication code (MAC): Section 4.20, Section 4.26.8, Section 10.12, Section 10.12
        -middle mouse button: Section 3.1.1, Section 4.11.1, Section 4.11.4
        -Midnight Commander: Section 4.6.2
        -minimise window: Section 4.9.1
        +MD5 fingerprint, of SSH host key: Section 2.2, Section 4.19.3
        +menu, context: Section 3.1.1, Section 3.1.3, Section 4.11.1
        +menu, system: Section 3.1.3, Section 3.1.3.7, Section 4.9.4, Section 4.9.5, Section 4.9.7
        +message authentication code (MAC): Section 4.20, Section 4.26.9, Section 10.12, Section 10.12
        +middle mouse button: Section 3.1.1, Section 4.11.1, Section 4.11.4
        +Midnight Commander: Section 4.6.2
        +minimise window: Section 4.9.1
        mistyping a password: Section 2.3
        -MIT-MAGIC-COOKIE-1: Section 4.24.1
        +MIT-MAGIC-COOKIE-1: Section 4.24.1
        modes of files, changing: Section 6.2.14
        mouse: Section 3.1.1
        -mouse pointer: Section 3.1.1, Section 4.8.3
        -mouse reporting: Section 3.1.1, Section 4.6.2, Section 4.11.2
        -mouse, three-button: Section 3.1.1, Section 4.11.1
        +mouse pointer: Section 3.1.1, Section 4.8.3
        +mouse reporting: Section 3.1.1, Section 4.6.2, Section 4.11.2
        +mouse, three-button: Section 3.1.1, Section 4.11.1
        moving files: Section 6.2.18
        MS-DOS Prompt: Section 1.1, Section 1.1, Section 3.11, Section 5.1, Section 7.1
        MUDs: Section 1.1, Section 2.1, Section 4.3.9
        multi-user systems: Section 3.11.2, Question A.8.2
        -Nagle's algorithm: Section 4.14.2
        -name resolution: Section 4.16.3
        -name resolution, with proxy: Section 4.16.2, Section 4.16.3
        +Nagle's algorithm: Section 4.14.2
        +name resolution: Section 4.16.3
        +name resolution, with proxy: Section 4.16.2, Section 4.16.3
        NAT routers: Section 10.16, Question A.7.8
        -NaturallySpeaking: Section 4.9.4
        --nc: Section 3.11.3.14
        --N command-line option: Section 3.11.3.13
        -negotiation, of Telnet options: Section 4.29.2
        -NetHack keypad mode: Section 4.4.6
        +NaturallySpeaking: Section 4.9.4
        +-nc: Section 3.11.3.14
        +-N command-line option: Section 3.11.3.13
        +negotiation, of Telnet options: Section 4.29.2
        +NetHack keypad mode: Section 4.4.7
        Network Address Translation: Section 10.16, Question A.7.8
        -network connection: Section 3.5, Section 4.14, Section 4.25
        +network connection: Section 3.5, Section 4.14, Section 4.25
        network protocols: Section 1.1
        -NEW_ENVIRON: Section 4.29.1
        -new line: Section 4.3.3, Section 4.3.4, Section 4.29.4
        -new line, in Telnet: Section 4.29.4
        +NEW_ENVIRON: Section 4.29.1
        +new line: Section 4.3.3, Section 4.3.4, Section 4.29.4
        +new line, in Telnet: Section 4.29.4
        ‘New Session’: Section 3.1.3.3, Question A.7.22
        -new version, verifying: Section 3.11.3.22, Appendix F
        +new version, verifying: Section 3.11.3.22, Appendix F
        NNTP: Section 3.7
        --noagent: Section 3.11.3.9
        +-noagent: Section 3.11.3.9
        -no-antispoof: Section 7.2.3.6
        -non-destructive backspace: Section 4.6.8
        +non-destructive backspace: Section 4.6.8
        No Operation, Telnet special command: Section 3.1.3.2
        No-op, in SSH: Section 3.1.3.2
        -no-sanitise-stderr: Section 5.2.2.7, Section 6.1.4.1, Section 7.2.3.5
        -no-sanitise-stdout: Section 7.2.3.5
        -notification area, Windows (aka system tray): Section 3.11.3.27, Section 9.1
        --no-trivial-auth: Section 3.11.3.19
        +notification area, Windows (aka system tray): Section 3.11.3.27, Section 9.1
        +-no-trivial-auth: Section 3.11.3.19
        numeric keypad: Section 4.4.3
        -numeric keypad, ‘Application’ mode: Section 4.4.5, Section 4.6.1
        -Num Lock: Section 4.4.5, Section 4.4.6
        -OLD_ENVIRON: Section 4.29.1
        -one-time passwords: Section 4.21.5
        -OpenSSH: Section 3.5, Section 4.21.8, Section 4.25, Section 4.25.1, Section 4.26.6, Section 4.26.9, Section 8.2.11, Section 8.3, Section 9.4, Section 10.5, Question A.7.18, Question A.10.1
        -OpenSSH private key file format: Section 8.2.14
        -option negotiation, Telnet: Section 4.29.2
        +numeric keypad, ‘Application’ mode: Section 4.4.6, Section 4.6.1
        +Num Lock: Section 4.4.6, Section 4.4.7
        +OLD_ENVIRON: Section 4.29.1
        +one-time passwords: Section 4.21.5
        +OpenSSH: Section 3.5, Section 4.21.8, Section 4.25, Section 4.25.1, Section 4.26.7, Section 4.26.10, Section 8.2.11, Section 8.3, Section 9.4, Section 10.5, Question A.7.18, Question A.10.1
        +--openssh-config Pageant command-line option: Section 9.3.3
        +OpenSSH, on Windows: Section 9.3.3
        +OpenSSH private key file format: Section 8.2.14
        +option negotiation, Telnet: Section 4.29.2
        options, command-line: Section 3.11, Section 9.3
        out of memory: Section 10.6, Question A.7.3, Question A.7.4
        -overriding host keys: Section 3.11.3.21, Section 4.19.3
        +overriding host keys: Section 3.11.3.21, Section 4.19.3
        packet log, SSH: Section 4.2, Section 4.2.5
        -Pageant: Section 3.11.3.9, Section 3.11.3.10, Section 4.21.7, Section 4.21.9, Section 4.26.13, Section 8.1, Chapter 9
        -palettes, logical: Section 4.13.5
        -passive Telnet negotiation: Section 4.29.2
        -passphrase: Section 8.1, Section 8.2.8, Chapter 9
        -passphrase hashing, for private key files: Section 8.2.12.2
        +Pageant: Section 3.11.3.9, Section 3.11.3.10, Section 4.21.7, Section 4.21.9, Section 4.26.14, Section 8.1, Chapter 9
        +palettes, logical: Section 4.13.5
        +passive Telnet negotiation: Section 4.29.2
        +passphrase: Section 8.1, Section 8.2.8, Chapter 9
        +passphrase hashing, for private key files: Section 8.2.12.2
        passthrough printing: Section 4.3.10
        -password: Section 2.3, Section 3.11.3.8
        -password camouflage: Section 4.26.11, Section 4.26.12
        -password expiry: Section 4.21.6
        -password, for proxy: Section 4.16.4
        -password hashing, for private key files: Section 8.2.12.2
        -passwordless login: Section 1.2, Section 4.22, Section 4.30.1, Section 8.2.8, Chapter 9
        +password: Section 2.3, Section 3.11.3.8
        +password camouflage: Section 4.26.12, Section 4.26.13
        +password expiry: Section 4.21.6
        +password, for proxy: Section 4.16.4
        +password hashing, for private key files: Section 8.2.12.2
        +passwordless login: Section 1.2, Section 4.22, Section 4.30.1, Section 8.2.8, Chapter 9
        password, mistyping: Section 2.3
        -password, one-time: Section 4.21.5
        -password, plain text: Section 4.16.4, Section 4.16.4
        +password, one-time: Section 4.21.5
        +password, plain text: Section 4.16.4, Section 4.16.4
        password prompt: Question A.7.12
        password, storing: Question A.2.8
        -paste, copy and: Section 3.1.1, Section 4.6.2, Section 4.10.5, Section 4.11, Section 4.11.2, Question A.6.6
        +paste, copy and: Section 3.1.1, Section 4.6.2, Section 4.10.5, Section 4.11, Section 4.11.2, Question A.6.6
        patch: Section B.2
        PATH environment variable: Section 5.1, Section 6.1, Section 7.1
        -P command-line option: Section 3.11.3.7
        -PC speaker: Section 4.5.1
        +PC speaker: Section 4.5.1
        Pentium 4: Question A.3.1
        permissions on files, changing: Section 6.2.14
        --pgpfp command-line option: Section 3.11.3.22, Appendix F
        -PGP key fingerprint: Section 3.11.3.22
        +-pgpfp command-line option: Section 3.11.3.22, Appendix F
        +PGP key fingerprint: Section 3.11.3.22
        PGP signatures, of PuTTY binaries: Appendix F
        -plain text password: Section 4.16.4, Section 4.16.4
        +plain text password: Section 4.16.4, Section 4.16.4
        Plink: Chapter 7, Chapter 7
        PLINK_PROTOCOL environment variable: Section 7.2.2
        POP-3: Section 3.5
        -port forwarding in SSH: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        -port forwarding in SSH, changing mid-session: Section 4.25
        -port number: Section 3.5, Section 3.11.3.7, Section 4.1.1, Section 4.25
        -port, privileged: Section 3.5, Section 4.25, Section 4.30.1
        -POSIX: Section 4.23.2, Section 6.2.2
        -PPK file: Section 3.11.3.18, Section 4.21.9, Section 8.2.9, Section 8.2.14, Section 9.1
        +port forwarding in SSH: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        +port forwarding in SSH, changing mid-session: Section 4.25
        +port number: Section 3.5, Section 3.11.3.7, Section 4.1.1, Section 4.25
        +port, privileged: Section 3.5, Section 4.25, Section 4.30.1
        +POSIX: Section 4.23.2, Section 6.2.2
        +PPK file: Section 3.11.3.18, Section 4.21.9, Section 8.2.9, Section 8.2.14, Section 9.1
        -p PSCP command-line option: Section 5.2.2.2
        preserve file attributes: Section 5.2.2.2
        -PRIMARY selection: Section 4.11.4
        -prime generation method: Section 8.2.4
        -primes, probable: Section 8.2.4
        -primes, proven: Section 8.2.4
        +PRIMARY selection: Section 4.11.4
        +prime generation method: Section 8.2.4
        +primes, probable: Section 8.2.4
        +primes, proven: Section 8.2.4
        printing, remote-controlled: Section 4.3.10
        -private key: Section 3.11.3.18, Section 4.21.9, Section 8.1, Chapter 9
        -private key file, OpenSSH: Section 8.2.14
        -private key file, PuTTY: Section 3.11.3.18, Section 4.21.9, Section 8.2.9, Section 8.2.14, Section 9.1
        -private key file, ssh.com: Section 8.2.14
        -private keys, generating: Section 8.2
        -privileged port: Section 3.5, Section 4.25, Section 4.30.1
        -probable primes: Section 8.2.4
        -process ACL (Windows): Section 3.11.3.27, Section 9.3.4
        +private key: Section 3.11.3.18, Section 4.21.9, Section 8.1, Chapter 9
        +private key file, OpenSSH: Section 8.2.14
        +private key file, PuTTY: Section 3.11.3.18, Section 4.21.9, Section 8.2.9, Section 8.2.14, Section 9.1
        +private key file, ssh.com: Section 8.2.14
        +private keys, generating: Section 8.2
        +privileged port: Section 3.5, Section 4.25, Section 4.30.1
        +probable primes: Section 8.2.4
        +process ACL (Windows): Section 3.11.3.27, Section 9.3.5
        prompt: Section 2.4
        protocol: Section 2.1
        protocols, debugging: Section 3.7
        protocols, differences between: Section 1.2
        protocol selection: Section 3.11.3.2
        -protocol version, SSH: Section 3.11.3.16, Section 4.17.4
        -proven primes: Section 8.2.4
        -proxy authentication: Section 4.16.4
        --proxycmd: Section 3.11.3.26
        -proxy command: Section 3.11.3.26, Section 4.16.1, Section 4.16.5
        -proxy DNS: Section 4.16.2, Section 4.16.3
        -proxy, HTTP: Section 4.16.1
        -proxy logging: Section 4.16.6
        -proxy password: Section 4.16.4
        -proxy server: Section 4.14.4, Section 4.16
        -proxy, SOCKS: Section 4.16.1
        -proxy, Telnet: Section 4.16.1, Section 4.16.5, Section 4.29.2
        -proxy user name: Section 4.16.4
        +protocol version, SSH: Section 3.11.3.16, Section 4.17.4
        +proven primes: Section 8.2.4
        +proxy authentication: Section 4.16.4
        +-proxycmd: Section 3.11.3.26
        +proxy command: Section 3.11.3.26, Section 4.16.1, Section 4.16.5
        +proxy DNS: Section 4.16.2, Section 4.16.3
        +proxy, HTTP: Section 4.16.1
        +proxy logging: Section 4.16.6
        +proxy password: Section 4.16.4
        +proxy server: Section 4.14.4, Section 4.16
        +proxy, SOCKS: Section 4.16.1
        +proxy, Telnet: Section 4.16.1, Section 4.16.5, Section 4.29.2
        +proxy user name: Section 4.16.4
        PSCP: Chapter 5, Chapter 5
        -pseudo-terminal allocation: Section 3.11.3.12, Section 4.23.1
        +pseudo-terminal allocation: Section 3.11.3.12, Section 4.23.1
        PSFTP: Chapter 6, Chapter 6
        -‘psusan’ program: Section 4.27
        +‘psusan’ program: Section 4.27
        pterm: PuTTY User Manual, Question A.3.2
        -pty allocation: Section 3.11.3.12, Section 4.23.1
        +pty allocation: Section 3.11.3.12, Section 4.23.1
        public key: Section 8.1
        public-key algorithm: Section 8.1
        -public key authentication: Section 3.11.3.18, Section 4.21.9, Section 4.26.9, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        -public key file, SSH-2: Section 8.2.10
        -public key fingerprint (SSH): Section 8.2.6, Section 9.2.1
        -public keys, generating: Section 8.2
        -punctuation: Section 4.12.1
        +public key authentication: Section 3.11.3.18, Section 4.21.9, Section 4.26.10, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        +public key file, SSH-2: Section 8.2.10
        +public key fingerprint (SSH): Section 8.2.6, Section 9.2.1
        +public keys, generating: Section 8.2
        +punctuation: Section 4.12.1
        PuTTY Event Log: Section 3.1.3.1, Section 4.2
        -PuTTYgen: Section 8.2
        +PuTTYgen: Section 8.2
        PuTTY icon: Section 2.3, Section A.5.3
        putty.rnd (random seed file): Section 3.11.2, Question A.5.2
        putty @sessionname: Section 3.11.3.1
        -PuTTYtel: Section 4.16.4
        -PuTTY terminal window: Section 2.3, Section 3.1.1, Section 3.1.3, Section 4.1.3, Section 4.7, Section 4.8, Section 4.9, Section 4.13.7
        --pw command-line option: Section 3.11.3.8
        +PuTTYtel: Section 4.16.4
        +PuTTY terminal window: Section 2.3, Section 3.1.1, Section 3.1.3, Section 4.1.3, Section 4.7, Section 4.8, Section 4.9, Section 4.13.7
        +-pw command-line option: Section 3.11.3.8
        +-pwfile command-line option: Section 3.11.3.8
        -q PSCP command-line option: Section 5.2.2.3
        -QUIT, special character: Section 4.23.2
        +QUIT, special character: Section 4.23.2
        quoting, in PSFTP: Section 6.2.1
        random seed file: Section 3.11.2
        -raw command-line option: Section 3.11.1, Section 3.11.3.2
        raw protocol: Section 2.1
        ‘Raw’ protocol: Section 3.7
        raw TCP connections: Section 3.7
        -RC4: Section 4.20, Section 10.4
        +RC4: Section 4.20, Section 10.4
        -R command-line option: Section 3.11.3.5
        reading commands from a file: Section 3.11.3.6
        read permission: Section 6.2.14
        receiving files: Section 5.2.1, Section 6.2.9
        -rectangular selection: Section 3.1.1, Section 4.11.3
        +rectangular selection: Section 3.1.1, Section 4.11.3
        recursive: Section 5.2.2.4, Section 6.2.9, Section 6.2.10
        Red Hat Linux: Question A.7.15
        -Re-encrypt: Section 9.5
        -re-encryptable: Section 9.5
        +Re-encrypt: Section 9.5
        +re-encryptable: Section 9.5
        registry entries, removing: Section 3.11.2
        -Registry (Windows): Section 2.2, Section 4.1.2, Section 4.32, Question A.5.2
        -remote commands: Section 2.4, Section 3.11.3.6, Section 4.17.1, Section 4.17.2, Question A.6.2
        +Registry (Windows): Section 2.2, Section 4.1.2, Section 4.32, Question A.5.2
        +remote commands: Section 2.4, Section 3.11.3.6, Section 4.17.1, Section 4.17.2, Question A.6.2
        remote-controlled printing: Section 4.3.10
        remote echo: Section 4.3.8
        -remote network connection: Section 3.11.3.14
        -remote shell: Section 4.17.2
        -remote shell, suppressing: Section 3.11.3.13
        -remote-to-local port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        +remote network connection: Section 3.11.3.14
        +remote shell: Section 4.17.2
        +remote shell, suppressing: Section 3.11.3.13
        +remote-to-local port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        removing directories: Section 6.2.17
        removing files: Section 6.2.15
        removing registry entries: Section 3.11.2
        renaming files: Section 6.2.18
        -repeat key exchange: Section 3.1.3.2, Section 4.18.2, Section 4.26.2, Question A.7.20
        +repeat key exchange: Section 3.1.3.2, Section 4.18.2, Section 4.26.2, Question A.7.20
        Repeat key exchange, SSH special command: Section 3.1.3.2
        ‘Reset Terminal’: Section 3.1.3.6
        -resizing, terminal: Section 4.6.3, Section 4.7.1, Section 4.7.2
        +resizing, terminal: Section 4.6.3, Section 4.7.1, Section 4.7.2
        ‘Restart Session’: Section 3.1.3.3
        --restrict-acl: Section 3.11.3.27, Section 9.3.4
        --restrict-putty-acl: Section 3.11.3.27
        +-restrict-acl: Section 3.11.3.27, Section 9.3.5
        +-restrict-putty-acl: Section 3.11.3.27
        resuming file transfers: Section 6.2.12
        return value: Section 5.2.3
        -RFC: Section 4.29.1
        -RGB values: Section 4.13.7
        -.rhosts file: Section 4.30.1
        -‘rhosts’ file: Section 4.30.1
        -Rich Text Format: Section 4.12.2
        -right mouse button: Section 3.1.1, Section 4.11.1
        -right mouse button menu: Section 3.1.1, Section 3.1.3, Section 4.11.1
        +RFC: Section 4.29.1
        +RGB values: Section 4.13.7
        +.rhosts file: Section 4.30.1
        +‘rhosts’ file: Section 4.30.1
        +Rich Text Format: Section 4.12.2
        +right mouse button: Section 3.1.1, Section 4.11.1
        +right mouse button menu: Section 3.1.1, Section 3.1.3, Section 4.11.1
        right mouse button, with Ctrl: Section 3.1.1
        -right-to-left text: Section 4.6.11
        -Rijndael: Section 4.20
        -Rlogin: Section 2.1, Section 3.9, Section 4.30
        +right-to-left text: Section 4.6.11
        +Rijndael: Section 4.20
        +Rlogin: Section 2.1, Section 3.9, Section 4.30
        -rlogin command-line option: Section 3.11.1, Section 3.11.3.2
        Rlogin, differences from other protocols: Section 1.2
        -routers: Section 4.14.1
        +routers: Section 4.14.1
        routers, NAT: Section 10.16, Question A.7.8
        -rows, in terminal window: Section 4.7.1
        +rows, in terminal window: Section 4.7.1
        -r PSCP command-line option: Section 5.2.2.4
        -RSA: Section 4.19.1, Section 4.26.6, Section 4.26.13, Section 8.1, Section 8.2.2
        -RSA authentication: Section 3.11.3.18, Section 4.21.9, Section 4.26.9, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        -RSA key exchange: Section 4.18.1
        -RTF: Section 4.12.2
        -Russian: Section 4.10.3
        +RSA: Section 4.19.1, Section 4.26.7, Section 4.26.14, Section 8.1, Section 8.2.2
        +RSA authentication: Section 3.11.3.18, Section 4.21.9, Section 4.26.10, Section 5.2.4, Section 6.3, Section 7.2.2, Section 8.1
        +RSA key exchange: Section 4.18.1
        +RTF: Section 4.12.2
        +Russian: Section 4.10.3
        rxvt: Section 4.4.2
        -sanitise-stderr: Section 5.2.2.7, Section 6.1.4.1, Section 7.2.3.5
        -sanitise-stdout: Section 7.2.3.5
        saved sessions, loading from command line: Section 3.11.3.1
        ‘Saved Sessions’ submenu: Section 3.1.3.3
        -saving private keys: Section 8.2.14
        +saving private keys: Section 8.2.14
        saving settings: Section 4.1.2
        -saving settings in a file: Section 4.32
        +saving settings in a file: Section 4.32
        SCO: Section 4.4.3
        SCP protocol: Section 5.2.1, Section 5.2.2.6
        -scp PSCP command-line option: Section 5.2.2.6
        screen, clearing: Section 4.3.5
        scripts: Section 7.3
        -scrollback: Section 3.1.2, Section 4.7.3
        -scrollback clearing: Section 4.6.7
        +scrollback: Section 3.1.2, Section 4.7.3
        +scrollback clearing: Section 4.6.7
        scrollback, clearing: Section 3.1.3.6
        -scrollbar: Section 3.1.2, Section 4.7.3
        +scrollbar: Section 3.1.2, Section 4.7.3
        scrolling region: Section 4.3.2
        -SECONDARY selection: Section 4.11.4.2
        -secret, shared: Section 4.18
        +SECONDARY selection: Section 4.11.4.2
        +secret, shared: Section 4.18
        secure shell: Section 1.2
        -security hazard: Section 4.6.6, Section 4.16.4, Section 5.2.1, Section 9.6
        -security token: Section 4.21.5
        +security hazard: Section 4.6.6, Section 4.16.4, Section 5.2.1, Section 9.6
        +security token: Section 4.21.5
        selecting a protocol: Section 1.2, Section 3.11.3.2
        -selecting text: Section 3.1.1, Section 4.11.1
        +selecting text: Section 3.1.1, Section 4.11.1
        selecting whole lines: Section 3.1.1
        -selecting whole words: Section 3.1.1, Section 4.12.1
        -selection, adjusting: Section 3.1.1, Section 4.11.1
        -selection, CLIPBOARD: Section 4.11.4
        -selection, PRIMARY: Section 4.11.4
        -selection, rectangular: Section 3.1.1, Section 4.11.3
        -selection, SECONDARY: Section 4.11.4.2
        -selections, multiple: Section 4.11.4
        +selecting whole words: Section 3.1.1, Section 4.12.1
        +selection, adjusting: Section 3.1.1, Section 4.11.1
        +selection, CLIPBOARD: Section 4.11.4
        +selection, PRIMARY: Section 4.11.4
        +selection, rectangular: Section 3.1.1, Section 4.11.3
        +selection, SECONDARY: Section 4.11.4.2
        +selections, multiple: Section 4.11.4
        sending files: Section 5.2.1, Section 6.2.10
        --sercfg command-line option: Section 3.11.3.23
        -Serial: Section 4.28
        +-sercfg command-line option: Section 3.11.3.23
        +Serial: Section 4.28
        -serial command-line option: Section 3.11.1, Section 3.11.3.2
        -serial line: Section 4.1.1, Section 4.28
        -serial port: Section 4.28
        +serial line: Section 4.1.1, Section 4.28
        +serial port: Section 4.28
        server: Section 1.1
        -server, commands on: Section 2.4, Section 3.11.3.6, Section 4.17.1, Section 4.17.2, Question A.6.2
        -server, HTTP: Section 4.16.1
        -server name: Section 2.1, Section 4.1.1, Section 4.9.1, Section 4.14.4, Section 5.2.1.2
        -server name resolution: Section 4.16.3
        -server name resolution, with proxy: Section 4.16.2, Section 4.16.3
        -server, proxy: Section 4.14.4, Section 4.16
        -server, SOCKS: Section 4.16.1
        -service names: Section 4.25
        -session ID: Section 4.26.9
        +server, commands on: Section 2.4, Section 3.11.3.6, Section 4.17.1, Section 4.17.2, Question A.6.2
        +server, HTTP: Section 4.16.1
        +server name: Section 2.1, Section 4.1.1, Section 4.9.1, Section 4.14.4, Section 5.2.1.2
        +server name resolution: Section 4.16.3
        +server name resolution, with proxy: Section 4.16.2, Section 4.16.3
        +server, proxy: Section 4.14.4, Section 4.16
        +server, SOCKS: Section 4.16.1
        +service names: Section 4.25
        +session ID: Section 4.26.10
        session log: Section 3.2
        --sessionlog: Section 3.11.3.24
        +-sessionlog: Section 3.11.3.24
        @sessionname command-line argument: Section 3.11.3.1
        sessions, loading and storing: Section 4.1.2
        session, starting: Section 2.1
        @@ -747,77 +755,79 @@

        Index

        set-user-ID bit: Section 6.2.14
        SFTP: Section 5.2.1, Section 5.2.2.6, Chapter 6
        -sftp PSCP command-line option: Section 5.2.2.6
        -SHA-256 fingerprint, of SSH host key: Section 2.2, Section 4.19.3
        -shaping, of Arabic text: Section 4.6.10
        -shared secret: Section 4.18
        +SHA-256 fingerprint, of SSH host key: Section 2.2, Section 4.19.3
        +shaping, of Arabic text: Section 4.6.10
        +shared secret: Section 4.18
        -shareexists Plink command-line option: Section 7.2.3.4
        -share-plink: Section 7.2.3.3
        shell account: Section 1.1
        -shell, remote: Section 4.17.2
        -shell, remote, suppressing: Section 3.11.3.13
        +shell, remote: Section 4.17.2
        +shell, remote, suppressing: Section 3.11.3.13
        Shift-Backspace: Section 4.4.1
        -Shift-Ins: Section 3.1.1, Section 4.11.4.2
        +shifted arrow keys: Section 4.4.4
        +Shift-Ins: Section 3.1.1, Section 4.11.4.2
        Shift-PgDn: Section 3.1.2
        Shift-PgUp: Section 3.1.2
        shortcut, Windows: Section 3.11, Section 3.11.3.1, Section 9.3, Question A.6.4
        +side-channel attacks: Section 8.2.4, Section 8.2.12.2
        Signal, SSH special command: Section 3.1.3.2
        -signature: Section 4.26.6, Section 8.1
        +signature: Section 4.26.7, Section 8.1
        signatures, of PuTTY binaries: Appendix F
        -single-DES: Section 4.20, Section 10.4
        -single sign-on: Section 4.15.2, Section 4.22
        -single-width character: Section 4.10.2
        -size, of font: Section 4.7.2, Section 4.8.2
        -size, of window: Section 4.7.1
        -S/Key: Section 4.21.5, Section 4.21.6
        +single-DES: Section 4.20, Section 10.4
        +single sign-on: Section 4.15.2, Section 4.22
        +single-width character: Section 4.10.2
        +size, of font: Section 4.7.2, Section 4.8.2
        +size, of window: Section 4.7.1
        +S/Key: Section 4.21.5, Section 4.21.6
        SMB: Question A.7.17
        SMTP: Section 3.7
        -SOCKS port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        -SOCKS proxy: Section 4.16.1
        -SO_KEEPALIVE: Section 4.14.3
        -sound file: Section 4.5.1
        +SOCKS port forwarding: Section 3.5, Section 3.11.3.5, Section 4.25
        +SOCKS proxy: Section 4.16.1
        +SO_KEEPALIVE: Section 4.14.3
        +sound file: Section 4.5.1
        spaces in filenames: Section 6.2.1, Question A.6.9
        -special character: Section 4.23.2
        +special character: Section 4.23.2
        special commands: Section 3.1.3.2
        special commands, in SSH: Section 3.1.3.2
        -special commands, in Telnet: Section 3.1.3.2, Section 4.29.3
        -speed, terminal: Section 4.15.4
        +special commands, in Telnet: Section 3.1.3.2, Section 4.29.3
        +speed, terminal: Section 4.15.4
        -s Plink command-line option: Section 7.2.3.2
        -spoofing: Section 2.2, Section 4.30.1, Section 8.1
        -SSH: Section 2.1, Section 2.2, Section 4.1.1, Section 4.17
        -SSH-1: Section 3.11.3.16, Section 4.17.4
        -SSH-2: Section 3.11.3.16, Section 4.15.5, Section 4.17.2, Section 4.17.4, Section 10.1, Section 10.3
        -ssh-add: Section 9.4
        -SSH agent forwarding: Section 3.11.3.10, Section 4.21.7, Section 9.4
        -ssh.com: Section 4.26.10, Section 8.2.10, Section 8.3, Section 9.4
        +spoofing: Section 2.2, Section 4.30.1, Section 8.1
        +SSH: Section 2.1, Section 2.2, Section 4.1.1, Section 4.17
        +SSH-1: Section 3.11.3.16, Section 4.17.4
        +SSH-2: Section 3.11.3.16, Section 4.15.5, Section 4.17.2, Section 4.17.4, Section 10.1, Section 10.3
        +ssh-add: Section 9.4
        +SSH agent forwarding: Section 3.11.3.10, Section 4.21.7, Section 9.4
        +ssh.com: Section 4.26.11, Section 8.2.10, Section 8.3, Section 9.4
        -ssh command-line option: Section 3.11.1, Section 3.11.3.2
        -ssh.com private key file format: Section 8.2.14
        +ssh.com private key file format: Section 8.2.14
        -ssh-connection command-line option: Section 3.11.1, Section 3.11.3.2
        -ssh-connection protocol, bare: Section 4.27
        +ssh-connection protocol, bare: Section 4.27
        SSH, differences from other protocols: Section 1.2
        -.ssh directory: Section 8.3
        -.ssh2 directory: Section 8.3
        +.ssh directory: Section 8.3
        +.ssh2 directory: Section 8.3
        SSH file transfer protocol: Section 5.2.1, Section 5.2.2.6, Chapter 6
        SSH host key fingerprint: Section 2.2
        -SSH ‘ignore’ messages: Section 3.1.3.2, Section 4.26.1, Section 4.26.11
        +SSH ‘ignore’ messages: Section 3.1.3.2, Section 4.26.1, Section 4.26.12
        SSH key exchange, forcing repeat: Section 3.1.3.2
        ssh-keygen: Section 9.2.1
        --sshlog: Section 3.11.3.24
        +-sshlog: Section 3.11.3.24
        SSH packet log: Section 4.2, Section 4.2.5
        -SSH port forwarding: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        -SSH port forwarding, changing mid-session: Section 4.25
        -SSH protocol version: Section 3.11.3.16, Section 4.17.4
        -SSH-2 public key file format: Section 8.2.10
        -SSH public key fingerprint: Section 8.2.6, Section 9.2.1
        --sshrawlog: Section 3.11.3.24
        -SSH server bugs: Section 4.26
        +SSH port forwarding: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        +SSH port forwarding, changing mid-session: Section 4.25
        +SSH protocol version: Section 3.11.3.16, Section 4.17.4
        +SSH-2 public key file format: Section 8.2.10
        +SSH public key fingerprint: Section 8.2.6, Section 9.2.1
        +-sshrawlog: Section 3.11.3.24
        +SSH server bugs: Section 4.26
        SSH special commands: Section 3.1.3.2
        SSH subsystem: Section 7.2.3.2
        -SSH tunnelling: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        -SSH tunnelling, changing mid-session: Section 4.25
        -SSH X11 forwarding: Section 3.4, Section 3.11.3.11, Section 4.24
        -SSPI: Section 4.22.2
        +SSH tunnelling: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        +SSH tunnelling, changing mid-session: Section 4.25
        +SSH X11 forwarding: Section 3.4, Section 3.11.3.11, Section 4.24
        +SSPI: Section 4.22.2
        stair-stepping: Section 4.3.3
        -standard error, proxy: Section 4.16.6
        +standard error, proxy: Section 4.16.6
        starting a session: Section 2.1
        Start Menu: Section 5.1
        startup scripts: Section 10.6, Question A.7.1, Question A.7.4
        @@ -825,149 +835,149 @@

        Index

        sticky bit: Section 6.2.14
        storing passwords: Question A.2.8
        storing settings: Section 4.1.2
        -storing settings in a file: Section 4.32
        -‘strong’ primes: Section 8.2.4
        -stty: Section 4.4.1, Section 4.23.2
        +storing settings in a file: Section 4.32
        +‘strong’ primes: Section 8.2.4
        +stty: Section 4.4.1, Section 4.23.2
        subsystem, SSH: Section 7.2.3.2
        Sun SSH: Section 10.5
        -SUPDUP: Section 2.1, Section 3.10, Section 4.31
        +SUPDUP: Section 2.1, Section 3.10, Section 4.31
        -supdup command-line option: Section 3.11.1, Section 3.11.3.2
        SUPDUP, differences from other protocols: Section 1.2
        supported features: Section A.2
        support requests: Section B.6
        -Suspend Process, Telnet special command: Section 3.1.3.2, Section 4.29.3
        -swap file: Section 9.6
        +Suspend Process, Telnet special command: Section 3.1.3.2, Section 4.29.3
        +swap file: Section 9.6
        switches, command-line: Section 3.11, Section 9.3
        -symmetric-key algorithm: Section 4.20
        +symmetric-key algorithm: Section 4.20
        Synch, Telnet special command: Section 3.1.3.2
        -system colours: Section 4.13.6
        +system colours: Section 4.13.6
        SYSTEM32 directory, on Windows: Question A.7.22
        -system menu: Section 3.1.3, Section 3.1.3.7, Section 4.9.4, Section 4.9.5, Section 4.9.7
        -system tray, Windows: Section 3.11.3.27, Section 9.1
        +system menu: Section 3.1.3, Section 3.1.3.7, Section 4.9.4, Section 4.9.5, Section 4.9.7
        +system tray, Windows: Section 3.11.3.27, Section 9.1
        talker systems: Section 1.1, Section 4.3.9
        -taskbar: Section 4.5.2
        -taskbar notification area, Windows (aka system tray): Section 3.11.3.27, Section 9.1
        --T command-line option: Section 3.11.3.12
        --t command-line option: Section 3.11.3.12
        +taskbar: Section 4.5.2
        +taskbar notification area, Windows (aka system tray): Section 3.11.3.27, Section 9.1
        +-T command-line option: Section 3.11.3.12
        +-t command-line option: Section 3.11.3.12
        TCP connections, raw: Section 3.7
        -TCP keepalives: Section 4.14.3
        -TCP_NODELAY: Section 4.14.2
        -TCP proxy: Section 4.16.1, Section 4.16.5, Section 4.29.2
        -Telnet: Section 2.1, Section 3.8, Section 4.29
        +TCP keepalives: Section 4.14.3
        +TCP_NODELAY: Section 4.14.2
        +TCP proxy: Section 4.16.1, Section 4.16.5, Section 4.29.2
        +Telnet: Section 2.1, Section 3.8, Section 4.29
        -telnet command-line option: Section 3.11.1, Section 3.11.3.2
        Telnet, differences from other protocols: Section 1.2
        -Telnet New Line: Section 4.29.4
        -Telnet option negotiation: Section 4.29.2
        -Telnet proxy: Section 4.16.1, Section 4.16.5, Section 4.29.2
        -Telnet special commands: Section 3.1.3.2, Section 4.29.3
        +Telnet New Line: Section 4.29.4
        +Telnet option negotiation: Section 4.29.2
        +Telnet proxy: Section 4.16.1, Section 4.16.5, Section 4.29.2
        +Telnet special commands: Section 3.1.3.2, Section 4.29.3
        Telnet URLs: Section 3.11.1
        -termcap: Section 4.4, Section 4.15.3
        -TERM environment variable: Section 4.13.2
        -terminal bell: Section 4.5
        -terminal bell, disabling: Section 4.5.1, Section 4.5.3
        -terminal bell overload mode: Section 4.5.3
        -terminal control sequences: Section 3.2, Section 4.3.1, Section 4.3.2, Section 4.3.6, Section 4.6.2, Section 4.9.1, Section 4.10.4, Section 4.11.2, Section 4.12.1, Section 4.13.1, Section 4.13.4, Section 4.15.3, Section 7.2.1
        -terminal emulation: Section 3.1.3.6, Section 4.3, Section 4.3.7, Section 4.4, Section 4.6, Section 4.15.3
        -terminal modes: Section 4.23.2
        +termcap: Section 4.4, Section 4.15.3
        +TERM environment variable: Section 4.13.2
        +terminal bell: Section 4.5
        +terminal bell, disabling: Section 4.5.1, Section 4.5.3
        +terminal bell overload mode: Section 4.5.3
        +terminal control sequences: Section 3.2, Section 4.3.1, Section 4.3.2, Section 4.3.6, Section 4.6.2, Section 4.9.1, Section 4.10.4, Section 4.11.2, Section 4.12.1, Section 4.13.1, Section 4.13.4, Section 4.15.3, Section 7.2.1
        +terminal emulation: Section 3.1.3.6, Section 4.3, Section 4.3.7, Section 4.4, Section 4.6, Section 4.15.3
        +terminal modes: Section 4.23.2
        terminal, resetting: Section 3.1.3.6
        -terminal resizing: Section 4.6.3, Section 4.7.1, Section 4.7.2
        -terminal speed: Section 4.15.4
        +terminal resizing: Section 4.6.3, Section 4.7.1, Section 4.7.2
        +terminal speed: Section 4.15.4
        terminal type: Question A.5.1
        -terminal window: Section 2.3, Section 3.1.1, Section 3.1.3, Section 4.1.3, Section 4.7, Section 4.8, Section 4.9, Section 4.13.7
        +terminal window: Section 2.3, Section 3.1.1, Section 3.1.3, Section 4.1.3, Section 4.7, Section 4.8, Section 4.9, Section 4.13.7
        terminal window, inactive: Section 4.1.3
        -terminfo: Section 4.4, Section 4.15.3
        -three-button mouse: Section 3.1.1, Section 4.11.1
        -timeout, of connections: Section 4.14.1, Question A.7.8
        +terminfo: Section 4.4, Section 4.15.3
        +three-button mouse: Section 3.1.1, Section 4.11.1
        +timeout, of connections: Section 4.14.1, Question A.7.8
        timestamp: Section 5.2.2.2
        -TIS authentication: Section 4.21.5
        -token, security: Section 4.21.5
        +TIS authentication: Section 4.21.5
        +token, security: Section 4.21.5
        transferring files: Chapter 5, Chapter 6
        triple-click: Section 3.1.1
        -triple-DES: Section 4.20
        -trn: Section 4.6.2
        +triple-DES: Section 4.20
        +trn: Section 4.6.2
        trusting host keys: Section 2.2
        -tunnelling using SSH: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        -tunnelling using SSH, changing mid-session: Section 4.25
        -typeface: Section 4.8.2, Section 4.10.4, Section 4.12.2, Section 4.13.4
        -UDP: Section 4.25
        -Unicode: Section 4.6.10, Section 4.10.1, Section 4.10.4, Section 4.10.5
        +tunnelling using SSH: Section 3.5, Section 3.11.3.5, Section 4.16, Section 4.17.2, Section 4.25
        +tunnelling using SSH, changing mid-session: Section 4.25
        +typeface: Section 4.8.2, Section 4.10.4, Section 4.12.2, Section 4.13.4
        +UDP: Section 4.25
        +Unicode: Section 4.6.10, Section 4.10.1, Section 4.10.4, Section 4.10.5
        uninstalling: Question A.8.2
        -Unix: Section 4.4, Section 4.4.1, Section 4.15.3, Section 4.23.1, Section 6.2.14, Section 10.18, Question A.7.13
        +Unix: Section 4.4, Section 4.4.1, Section 4.15.3, Section 4.23.1, Section 6.2.14, Section 10.18, Question A.7.13
        Unix version of PuTTY tools: PuTTY User Manual, Question A.3.2
        -unsafe PSCP command-line option: Section 5.2.1
        -upgraded version, verifying: Section 3.11.3.22, Appendix F
        +upgraded version, verifying: Section 3.11.3.22, Appendix F
        uploading files: Section 5.2.1, Section 6.2.10
        Uppity: Question A.2.10
        URLs, Telnet: Section 3.11.1
        -US-ASCII: Section 4.10.5, Question A.2.11
        +US-ASCII: Section 4.10.5, Question A.2.11
        user name: Section 2.3, Section 3.11.3.4, Section 5.2.1.1
        -user name, for auto-login: Section 4.15.1
        -user name, for proxy: Section 4.16.4
        -user name, local, in Rlogin: Section 4.30.1
        -user name, local, in Windows: Section 4.30.1
        -user names, different: Section 2.3, Section 4.21.8
        -UTF-8: Section 4.10.1, Section 4.10.2, Section 4.23.2, Question A.7.15
        -variables, environment: Section 4.15.5, Section 4.29.1
        +user name, for auto-login: Section 4.15.1
        +user name, for proxy: Section 4.16.4
        +user name, local, in Rlogin: Section 4.30.1
        +user name, local, in Windows: Section 4.30.1
        +user names, different: Section 2.3, Section 4.21.8
        +UTF-8: Section 4.10.1, Section 4.10.2, Section 4.23.2, Question A.7.15
        +variables, environment: Section 4.15.5, Section 4.29.1
        -v command-line option: Section 3.11.3.3
        -VERASE, special character: Section 4.23.2
        +VERASE, special character: Section 4.23.2
        verbose mode: Section 3.11.3.3
        -verifying new versions of PuTTY: Section 3.11.3.22, Appendix F
        +verifying new versions of PuTTY: Section 3.11.3.22, Appendix F
        verifying the host key: Section 2.2, Question A.2.9
        -version, of Internet Protocol: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        +version, of Internet Protocol: Section 3.11.3.17, Section 4.14.4, Section 4.25.2
        version, of PuTTY: Section B.2
        -version, of SSH protocol: Section 3.11.3.16, Section 4.17.4
        -visual bell: Section 4.5.1
        -VQUIT, special character: Section 4.23.2
        +version, of SSH protocol: Section 3.11.3.16, Section 4.17.4
        +visual bell: Section 4.5.1
        +VQUIT, special character: Section 4.23.2
        VT100+: Section 4.4.3
        VT400: Section 4.4.3
        -vt220: Section 4.15.3
        -WAV file: Section 4.5.1
        +vt220: Section 4.15.3
        +WAV file: Section 4.5.1
        web browser: Section 3.5, Section 3.11.1
        web server: Section 1.1
        web site: Section B.7
        -white space: Section 4.12.1
        +white space: Section 4.12.1
        wildcards: Section 5.2.1, Section 5.2.1.3, Section 5.2.2.6, Section 6.2.2, Section 6.2.11
        WinCVS: Section 7.5
        -window border: Section 4.8.4
        -window caption: Section 4.5.2, Section 4.9.1
        -window, closing: Section 4.1.3, Section 4.9.2, Section 4.9.3
        +window border: Section 4.8.4
        +window caption: Section 4.5.2, Section 4.9.1
        +window, closing: Section 4.1.3, Section 4.9.2, Section 4.9.3
        window, inactive: Section 4.1.3
        -window, maximising: Section 4.7.2, Question A.6.3
        -window menu: Section 3.1.3, Section 3.1.3.7, Section 4.9.4, Section 4.9.5, Section 4.9.7
        -window, minimising: Section 4.9.1
        -window resizing: Section 4.6.3, Section 4.7.1, Section 4.7.2
        +window, maximising: Section 4.7.2, Question A.6.3
        +window menu: Section 3.1.3, Section 3.1.3.7, Section 4.9.4, Section 4.9.5, Section 4.9.7
        +window, minimising: Section 4.9.1
        +window resizing: Section 4.6.3, Section 4.7.1, Section 4.7.2
        Windows 3.1: Question A.3.5
        Windows, 32-bit: Question A.6.10
        Windows, 64-bit: Question A.6.10, Question A.7.22
        Windows clipboard: Section 3.1.1
        Windows command: Section 6.2.19
        -Windows Default Beep sound: Section 4.5
        +Windows Default Beep sound: Section 4.5
        Windows file sharing: Question A.7.17
        -window size: Section 4.7.1
        -Windows process ACL: Section 3.11.3.27, Section 9.3.4
        -Windows Registry: Section 2.2, Section 4.1.2, Section 4.32, Question A.5.2
        +window size: Section 4.7.1
        +Windows OpenSSH: Section 9.3.3
        +Windows process ACL: Section 3.11.3.27, Section 9.3.5
        +Windows Registry: Section 2.2, Section 4.1.2, Section 4.32, Question A.5.2
        Windows shortcut: Section 3.11, Section 3.11.3.1, Section 9.3, Question A.6.4
        Windows Terminal Services: Question A.7.17
        Windows XP: Question A.7.17, Question A.7.21
        -window, terminal: Section 2.3, Section 3.1.1, Section 3.1.3, Section 4.1.3, Section 4.7, Section 4.8, Section 4.9, Section 4.13.7
        -window title: Section 4.6.5, Section 4.6.6, Section 4.9.1, Question A.7.11
        +window, terminal: Section 2.3, Section 3.1.1, Section 3.1.3, Section 4.1.3, Section 4.7, Section 4.8, Section 4.9, Section 4.13.7
        +window title: Section 4.6.5, Section 4.6.6, Section 4.9.1, Question A.7.11
        Win32s: Question A.3.5
        -Win125x: Section 4.10.1
        -words, selecting: Section 3.1.1, Section 4.12.1
        +Win125x: Section 4.10.1
        +words, selecting: Section 3.1.1, Section 4.12.1
        working directory: Section 6.2.7, Section 6.2.8
        wrapping, automatic: Section 4.3.1, Question A.7.7
        -wrapping, terminal: Section 4.10.2
        +wrapping, terminal: Section 4.10.2
        write permission: Section 6.2.14
        -X11 authentication: Section 4.24.1
        +X11 authentication: Section 4.24.1
        x86 (32-bit processor architecture): Question A.6.10
        --X command-line option: Section 3.11.3.11
        --x command-line option: Section 3.11.3.11
        +-X command-line option: Section 3.11.3.11
        +-x command-line option: Section 3.11.3.11
        ‘X display location’: Section 3.4
        -XDM-AUTHORIZATION-1: Section 4.24.1
        -X11 forwarding: Section 3.4, Section 3.11.3.11, Section 4.24
        +XDM-AUTHORIZATION-1: Section 4.24.1
        +X11 forwarding: Section 3.4, Section 3.11.3.11, Section 4.24
        X server: Section 3.4
        -xterm: Section 3.1.1, Section 4.4.2, Section 4.4.3, Section 4.11.1, Section 4.15.3
        -xterm mouse reporting: Section 3.1.1, Section 4.6.2, Section 4.11.2

        -

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        -[PuTTY release 0.76]
        +xterm: Section 3.1.1, Section 4.4.2, Section 4.4.3, Section 4.4.3, Section 4.11.1, Section 4.15.3
        +xterm mouse reporting: Section 3.1.1, Section 4.6.2, Section 4.11.2

        +

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        diff --git a/code/doc/index.html b/code/doc/html/index.html similarity index 96% rename from code/doc/index.html rename to code/doc/html/index.html index 4906782..edd3475 100644 --- a/code/doc/index.html +++ b/code/doc/html/index.html @@ -17,7 +17,7 @@

        PuTTY User Manual

        Note to Unix users: this manual currently primarily documents the Windows versions of the PuTTY utilities. Some options are therefore mentioned that are absent from the Unix version; the Unix version has features not described here; and the pterm and command-line puttygen and pageant utilities are not described at all. The only Unix-specific documentation that currently exists is the man pages.

        -This manual is copyright 1997-2021 Simon Tatham. All rights reserved. You may distribute this documentation under the MIT licence. See appendix D for the licence text in full. +This manual is copyright 1997-2022 Simon Tatham. All rights reserved. You may distribute this documentation under the MIT licence. See appendix D for the licence text in full.

          @@ -119,7 +119,7 @@

          PuTTY User Manual

      • Chapter 10: Common error messages
      • Appendix F: PuTTY download keys and signatures
          @@ -209,6 +207,5 @@

          PuTTY User Manual

        • Index
        -

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        -[PuTTY release 0.76]
        +

        If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.

        diff --git a/code/doc/index.but b/code/doc/index.but index f7e7145..4c76bb0 100644 --- a/code/doc/index.but +++ b/code/doc/index.but @@ -245,6 +245,7 @@ saved sessions from \IM{-m} \c{-m} command-line option \IM{-P-upper} \c{-P} command-line option \IM{-pw} \c{-pw} command-line option +\IM{-pwfile} \c{-pwfile} command-line option \IM{-A-upper} \c{-A} command-line option \IM{-a} \c{-a} command-line option \IM{-X-upper} \c{-X} command-line option @@ -607,8 +608,11 @@ saved sessions from \IM{proxy authentication} proxy authentication \IM{proxy authentication} authentication, to proxy -\IM{HTTP basic} HTTP \q{basic} authentication -\IM{HTTP basic} \q{basic} authentication (HTTP) +\IM{HTTP Basic} HTTP Basic authentication +\IM{HTTP Basic} \q{basic} authentication (HTTP) + +\IM{HTTP Digest} HTTP Digest authentication +\IM{HTTP Digest} \q{digest} authentication (HTTP) \IM{plaintext password} plain text password \IM{plaintext password} password, plain text @@ -863,6 +867,11 @@ saved sessions from \IM{authentication agent} agent, authentication \IM{-c-pageant} \c{-c} Pageant command-line option +\IM{--keylist} \c{--keylist} Pageant command-line option +\IM{--openssh-config} \c{--openssh-config} Pageant command-line option + +\IM{Windows OpenSSH} Windows OpenSSH +\IM{Windows OpenSSH} OpenSSH, on Windows \IM{FAQ} FAQ \IM{FAQ} Frequently Asked Questions @@ -930,3 +939,6 @@ saved sessions from \IM{system tray} system tray, Windows \IM{system tray} notification area, Windows (aka system tray) \IM{system tray} taskbar notification area, Windows (aka system tray) + +\IM{shifted arrow keys} arrow keys, shifted +\IM{shifted arrow keys} shifted arrow keys diff --git a/code/doc/licence.but b/code/doc/licence.but deleted file mode 100644 index f316ec1..0000000 --- a/code/doc/licence.but +++ /dev/null @@ -1,15 +0,0 @@ -\# Generated by licence.pl from LICENCE. -\# You should edit those files rather than editing this one. - -\A{licence} PuTTY \ii{Licence} - -PuTTY is \i{copyright} 1997-2021 Simon Tatham. - -Portions copyright Robert de Bath, Joris van Rantwijk, Delian Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn, Colin Watson, Christopher Staite, Lorenz Diener, Christian Brabandt, Jeff Smith, Pavel Kryukov, Maxim Kuznetsov, Svyatoslav Kuzmich, Nico Williams, Viktor Dukhovni, Josh Dersch, Lars Brinkhoff,Daniel Risacher, Joshua Dantzler, Bryan Berns, and CORE SDI S.A. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \q{Software}), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED \q{AS IS}, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/code/doc/man-pageant.but b/code/doc/man-pageant.but index 358f3a0..3f407a4 100644 --- a/code/doc/man-pageant.but +++ b/code/doc/man-pageant.but @@ -41,7 +41,7 @@ extract their public half. The agent protocol used by \c{pageant} is compatible with the PuTTY tools and also with other implementations such as OpenSSH's SSH client -and \e{ssh-agent(1)}. Some \c{pageant} features are implemented with +and \cw{ssh-agent}(\e{1}). Some \c{pageant} features are implemented with protocol extensions, so will only work if \c{pageant} is on both ends. To run \c{pageant} as an agent, you must provide an option to tell it @@ -317,15 +317,15 @@ by the SSH agent protocol. \dt \cw{--askpass} \e{prompt} -\dd With this option, \c{pageant} acts as an \e{ssh-askpass(1)} +\dd With this option, \c{pageant} acts as an \cw{ssh-askpass}(\e{1}) replacement, rather than performing any SSH agent functionality. This may be useful if you prefer Pageant's GUI prompt style, which minimises information leakage about your passphrase length in its -visual feedback, compared to other \e{ssh-askpass(1)} implementations. +visual feedback, compared to other \cw{ssh-askpass}(\e{1}) implementations. \lcont{ -\c{pageant --askpass} implements the standard \e{ssh-askpass(1)} +\c{pageant --askpass} implements the standard \cw{ssh-askpass}(\e{1}) interface: it can be passed a prompt to display (as a single argument) and, if successful, prints the passphrase on standard output and returns a zero exit status. Typically you would use the environment diff --git a/code/doc/man-plink.but b/code/doc/man-plink.but index 26e65f7..2a3b36c 100644 --- a/code/doc/man-plink.but +++ b/code/doc/man-plink.but @@ -59,9 +59,9 @@ to aid in verifying new files released by the PuTTY team. \dt \cw{-ssh-connection} \dd Force use of the \q{bare \cw{ssh-connection}} protocol. This is -only likely to be useful when connecting to a \e{psusan(1)} server, -most likely with an absolute path to a Unix-domain socket in place -of \e{host}. +only likely to be useful when connecting to a \cw{psusan}(\e{1}) +server, most likely with an absolute path to a Unix-domain socket in +place of \e{host}. \dt \cw{\-proxycmd} \e{command} @@ -114,11 +114,16 @@ sequences. These options override Plink's default behaviour to enable or disabling such filtering on the standard error and standard output channels. +\dt \cw{-pwfile} \e{filename} + +\dd Open the specified file, and use the first line of text read from +it as the remote password. + \dt \cw{-pw} \e{password} \dd Set remote password to \e{password}. \e{CAUTION:} this will likely make the password visible to other users of the local machine (via -commands such as \q{\c{w}}). +commands such as \q{\c{ps}} or \q{\c{w}}). Use \cw{-pwfile} instead. \dt \cw{\-L} \cw{[}\e{srcaddr}\cw{:]}\e{srcport}\cw{:}\e{desthost}\cw{:}\e{destport} diff --git a/code/doc/man-pscp.but b/code/doc/man-pscp.but index 60ce4f5..544d3a4 100644 --- a/code/doc/man-pscp.but +++ b/code/doc/man-pscp.but @@ -101,11 +101,16 @@ channel from the server, to prevent remote processes sending confusing escape sequences. This option forces the standard error channel to not be filtered. +\dt \cw{-pwfile} \e{filename} + +\dd Open the specified file, and use the first line of text read from +it as the remote password. + \dt \cw{-pw} \e{password} \dd Set remote password to \e{password}. \e{CAUTION:} this will likely make the password visible to other users of the local machine (via -commands such as \q{\c{w}}). +commands such as \q{\c{ps}} or \q{\c{w}}). Use \cw{-pwfile} instead. \dt \cw{-1} @@ -118,9 +123,9 @@ commands such as \q{\c{w}}). \dt \cw{-ssh-connection} \dd Force use of the \q{bare \cw{ssh-connection}} protocol. This is -only likely to be useful when connecting to a \e{psusan(1)} server, -most likely with an absolute path to a Unix-domain socket in place -of \e{host}. +only likely to be useful when connecting to a \cw{psusan}(\e{1}) +server, most likely with an absolute path to a Unix-domain socket in +place of \e{host}. \dt \cw{-ssh} diff --git a/code/doc/man-psftp.but b/code/doc/man-psftp.but index 5261729..e0b4860 100644 --- a/code/doc/man-psftp.but +++ b/code/doc/man-psftp.but @@ -89,11 +89,16 @@ channel from the server, to prevent remote processes sending confusing escape sequences. This option forces the standard error channel to not be filtered. +\dt \cw{-pwfile} \e{filename} + +\dd Open the specified file, and use the first line of text read from +it as the remote password. + \dt \cw{-pw} \e{password} \dd Set remote password to \e{password}. \e{CAUTION:} this will likely make the password visible to other users of the local machine (via -commands such as \q{\c{w}}). +commands such as \q{\c{ps}} or \q{\c{w}}). Use \cw{-pwfile} instead. \dt \cw{-1} @@ -106,9 +111,9 @@ commands such as \q{\c{w}}). \dt \cw{-ssh-connection} \dd Force use of the \q{bare \cw{ssh-connection}} protocol. This is -only likely to be useful when connecting to a \e{psusan(1)} server, -most likely with an absolute path to a Unix-domain socket in place -of \e{host}. +only likely to be useful when connecting to a \cw{psusan}(\e{1}) +server, most likely with an absolute path to a Unix-domain socket in +place of \e{host}. \dt \cw{-ssh} diff --git a/code/doc/man-psocks.but b/code/doc/man-psocks.but index a9792e4..eb075a6 100644 --- a/code/doc/man-psocks.but +++ b/code/doc/man-psocks.but @@ -18,8 +18,8 @@ IPv4 and IPv6 connections. It does not support requiring authentication of its clients. \cw{psocks} can be used together with an SSH client such as -\cw{putty(1)} to implement a reverse dynamic SSH tunnel. It can also -be used for network protocol debugging, as it can record all the +\cw{putty}(\e{1}) to implement a reverse dynamic SSH tunnel. It can +also be used for network protocol debugging, as it can record all the traffic passing through it in various ways. By default, \cw{psocks} listens to connections from localhost only, @@ -84,8 +84,8 @@ have the connection's traffic piped into it, similar to \cw{-f}. \S{psocks-manpage-examples} EXAMPLES -In combination with the \e{plink(1)} SSH client, to set up a reverse -dynamic SSH tunnel, in which the remote listening port 1080 on +In combination with the \cw{plink}(\e{1}) SSH client, to set up a +reverse dynamic SSH tunnel, in which the remote listening port 1080 on remote host \cw{myhost} acts as a SOCKS server giving access to your local network: diff --git a/code/doc/man-psusan.but b/code/doc/man-psusan.but index fa986e8..64d3a03 100644 --- a/code/doc/man-psusan.but +++ b/code/doc/man-psusan.but @@ -191,15 +191,36 @@ And the setup script \cw{uml-psusan.sh} might look like this: \c # Choose what shell you want to run inside psusan \e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii \c export SHELL=/bin/bash +\c # Set up a default path +\e iiiiiiiiiiiiiiiiiiiiiii +\c export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin \c # And now run psusan over the serial port \e iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii \c exec /home/simon/src/putty/misc/psusan -Now set up a PuTTY saved session as in the Docker example above, using -that \cw{linux} command as the local proxy command, and you'll have a -PuTTY session that starts up a clean UML instance when you run it, and -(if you enabled connection sharing) further instances of the same -session will connect to the same instance again. +Now set up a PuTTY saved session as in the Docker example above. +Basically you'll want to use the above \cw{linux} command as the local +proxy command. However, it's worth wrapping it in \cw{setsid}(\e{1}), +because when UML terminates, it kills its entire process group. So +it's better that PuTTY should not be part of that group, and should +have the opportunity to shut down cleanly by itself. So probably you +end up setting the proxy command to be something more like: + +\c setsid linux mem=512M rootfstype=hostfs rootflags=/ rw \ +\c con=fd:2,fd:2 ssl0=fd:0,fd:1 init=/some/path/to/uml-psusan.sh +\e iiiiiiiiiiiiiiiiiiiiiiiiiii + +You may also find that you have to enable the bug workaround that +indicates that the server \q{Discards data sent before its greeting}, +because otherwise PuTTY's outgoing protocol greeting can be +accidentally lost during UML startup. (See +\W{https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991958}{Debian +bug #991958}.) + +Once you've done that, you'll have a PuTTY session that starts up a +clean UML instance when you run it, and (if you enabled connection +sharing) further instances of the same session will connect to the +same instance again. \S2{psusan-manpage-examples-wsl} Windows Subsystem for Linux @@ -231,6 +252,39 @@ ports in and out of the WSL environment (e.g. expose a WSL2 network service through the hypervisor's internal NAT), forward Pageant into it, and so on. +\S2{psusan-manpage-examples-cygwin} Cygwin + +Another Unix-like environment on Windows is Cygwin. That comes with +its own GUI terminal application, \cw{mintty} (as it happens, a +derivative of PuTTY); but if you'd prefer to use PuTTY itself to talk +to your Cygwin terminal sessions, \cw{psusan} can help. + +To do this, you'll first need to build the Unix PuTTY tools inside +Cygwin (via the usual \cw{cmake} method). Then, copy the resulting +\cw{psusan.exe} into Cygwin's \cw{/bin} directory. (It has to be +in that directory for non-Cygwin programs to run it; otherwise it +won't be able to find the Cygwin DLL at startup.) + +Then set up your PuTTY saved session like this: + +\b set the local proxy command to run \cw{psusan.exe} via its real +Windows path. You might also want to add the \cw{--sessiondir} option +so that shell sessions start up in your Cygwin home directory. For +example, you might use the command \cq{c:\\cygwin64\\bin\\psusan.exe +--sessiondir /home/simon} (changing the pathname and username to match +your setup). + +\b enter anything you like in the host name box; \cq{Cygwin} is +probably a good choice + +\b set the protocol to \q{Bare ssh-connection}, as usual. + +Port forwarding is probably not particularly useful in this case, +since Cygwin shares the same network port space as the host machine. +But turning on agent forwarding is useful, because then the Cygwin +command-line SSH client can talk to Pageant without any further +configuration. + \S2{psusan-manpage-examples-schroot} \cw{schroot} Another example of a container-like environment is the alternative diff --git a/code/doc/man-pterm.but b/code/doc/man-pterm.but index fec97f1..d3d1d96 100644 --- a/code/doc/man-pterm.but +++ b/code/doc/man-pterm.but @@ -76,7 +76,7 @@ will be ignored unless the \cw{BoldAsColour} resource is set to 0 or 2. \dt \cw{\-geometry} \e{geometry} \dd Specify the size of the terminal, in rows and columns of text. See -\e{X(7)} for more information on the syntax of geometry +\cw{X}(\e{7}) for more information on the syntax of geometry specifications. \dt \cw{\-sl} \e{lines} diff --git a/code/doc/man-putty.but b/code/doc/man-putty.but index 858ec0b..a85b450 100644 --- a/code/doc/man-putty.but +++ b/code/doc/man-putty.but @@ -55,7 +55,7 @@ will be ignored unless the \cw{BoldAsColour} resource is set to 0 or 2. \dt \cw{\-geometry} \e{geometry} \dd Specify the size of the terminal, in rows and columns of text. -See \e{X(7)} for more information on the syntax of geometry +See \cw{X}(\e{7}) for more information on the syntax of geometry specifications. \dt \cw{\-sl} \e{lines} diff --git a/code/doc/man-puttytel.but b/code/doc/man-puttytel.but index bf852dd..075eeea 100644 --- a/code/doc/man-puttytel.but +++ b/code/doc/man-puttytel.but @@ -56,7 +56,7 @@ will be ignored unless the \cw{BoldAsColour} resource is set to 0 or 2. \dt \cw{\-geometry} \e{geometry} \dd Specify the size of the terminal, in rows and columns of text. See -\e{X(7)} for more information on the syntax of geometry +\cw{X}(\e{7}) for more information on the syntax of geometry specifications. \dt \cw{\-sl} \e{lines} diff --git a/code/doc/pageant.1 b/code/doc/pageant.1 index 1147365..13020df 100644 --- a/code/doc/pageant.1 +++ b/code/doc/pageant.1 @@ -23,7 +23,7 @@ When running as an SSH agent, it listens on a Unix-domain socket for connections .PP \fBpageant\fP can also act as a client program itself, communicating with an already-running agent to add or remove keys, list the keys, or extract their public half. .PP -The agent protocol used by \fBpageant\fP is compatible with the PuTTY tools and also with other implementations such as OpenSSH\*(Aqs SSH client and \fIssh-agent(1)\fP. Some \fBpageant\fP features are implemented with protocol extensions, so will only work if \fBpageant\fP is on both ends. +The agent protocol used by \fBpageant\fP is compatible with the PuTTY tools and also with other implementations such as OpenSSH\*(Aqs SSH client and \fBssh-agent\fP(\fI1\fP). Some \fBpageant\fP features are implemented with protocol extensions, so will only work if \fBpageant\fP is on both ends. .PP To run \fBpageant\fP as an agent, you must provide an option to tell it what its \fIlifetime\fP should be. Typically you would probably want Pageant to last for the duration of a login session, in which case you should use either \fB-X\fP or \fB-T\fP, depending on whether your login session is GUI or purely terminal-based respectively. For example, in your X session startup script you might write .PP @@ -154,10 +154,10 @@ The data to sign is taken from standard input, signed by the agent with the key .RE .SH "SSH-ASKPASS REPLACEMENT" .IP "\fB--askpass\fP \fIprompt\fP" -With this option, \fBpageant\fP acts as an \fIssh-askpass(1)\fP replacement, rather than performing any SSH agent functionality. This may be useful if you prefer Pageant\*(Aqs GUI prompt style, which minimises information leakage about your passphrase length in its visual feedback, compared to other \fIssh-askpass(1)\fP implementations. +With this option, \fBpageant\fP acts as an \fBssh-askpass\fP(\fI1\fP) replacement, rather than performing any SSH agent functionality. This may be useful if you prefer Pageant\*(Aqs GUI prompt style, which minimises information leakage about your passphrase length in its visual feedback, compared to other \fBssh-askpass\fP(\fI1\fP) implementations. .RS .PP -\fBpageant --askpass\fP implements the standard \fIssh-askpass(1)\fP interface: it can be passed a prompt to display (as a single argument) and, if successful, prints the passphrase on standard output and returns a zero exit status. Typically you would use the environment variable \fBSSH_ASKPASS\fP to tell other programs to use \fBpageant\fP in this way. +\fBpageant --askpass\fP implements the standard \fBssh-askpass\fP(\fI1\fP) interface: it can be passed a prompt to display (as a single argument) and, if successful, prints the passphrase on standard output and returns a zero exit status. Typically you would use the environment variable \fBSSH_ASKPASS\fP to tell other programs to use \fBpageant\fP in this way. .RE .SH "OPTIONS" .IP "\fB-v\fP" diff --git a/code/doc/pageant.but b/code/doc/pageant.but index 8abb5cd..1f6b7c2 100644 --- a/code/doc/pageant.but +++ b/code/doc/pageant.but @@ -170,6 +170,53 @@ by the command, like this: \c C:\PuTTY\pageant.exe d:\main.ppk -c C:\PuTTY\putty.exe +\S{pageant-cmdline-openssh} Integrating with \i{Windows OpenSSH} + +Windows's own port of OpenSSH uses the same mechanism as Pageant to +talk to its SSH agent (Windows named pipes). This means that Windows +OpenSSH can talk directly to Pageant, if it knows where to find +Pageant's named pipe. + +When Pageant starts up, it can optionally write out a file containing +an OpenSSH configuration directive that tells the Windows \c{ssh.exe} +where to find Pageant. If you include this file from your Windows SSH +configuration, then \c{ssh.exe} should automatically use Pageant as +its agent, so that you can keep your keys in one place and have both +SSH clients able to use them. + +The option is \i\c{--openssh-config}, and you follow it with a filename. + +To refer to this file from your main OpenSSH configuration, you can +use the \cq{Include} directive. For example, you might run Pageant +like this (with your own username substituted, of course): + +\c pageant --openssh-config C:\Users\Simon\.ssh\pageant.conf + +and then add a directive like this to your main \cq{.ssh\\config} file +(assuming that lives in the same directory that you just put +\cw{pageant.conf}): + +\c Include pageant.conf + +\s{Note}: this technique only works with \e{Windows's} port of +OpenSSH, which lives at \cw{C:\\Windows\\System32\\OpenSSH\\ssh.exe} +if you have it installed. (If not, it can be installed as a Windows +optional feature, e.g., via Settings > Apps & features > Optional +features > Add a feature > OpenSSH Client.) + +There are other versions of OpenSSH for Windows, notably the one that +comes with Windows \cw{git}. Those will likely not work with the same +configuration, because they tend to depend on Unix emulation layers +like MinGW or MSys, so they won't speak Windows native pathname syntax +or understand named pipes. The above instructions will only work with +Windows's own version of OpenSSH. + +So, if you want to use Windows \cw{git} with an SSH key held in +Pageant, you'll have to set the environment variable \cw{GIT_SSH}, to +point at a different program. You could point it at +\cw{c:\\Windows\\System32\\OpenSSH\\ssh.exe} once you've done this +setup \dash but it's just as easy to point it at Plink! + \S{pageant-cmdline-keylist} Starting with the key list visible Start Pageant with the \i\c{--keylist} option to show the main window diff --git a/code/doc/pgpkeys.but b/code/doc/pgpkeys.but index 8fab615..7dc62f8 100644 --- a/code/doc/pgpkeys.but +++ b/code/doc/pgpkeys.but @@ -56,25 +56,25 @@ The current issue of those keys are available for download from the PuTTY website, and are also available on PGP keyservers using the key IDs listed below. -\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/master-2018.asc}{\s{Master Key} (2018)} +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/master-2021.asc}{\s{Master Key} (2021)} -\dd RSA, 4096-bit. Key ID: \cw{76BC7FE4EBFD2D9E}. Fingerprint: -\cw{24E1\_B1C5\_75EA\_3C9F\_F752\_\_A922\_76BC\_7FE4\_EBFD\_2D9E} +\dd RSA, 3072-bit. Key ID: \cw{DD4355EAAC1119DE}. Fingerprint: +\cw{A872\_D42F\_1660\_890F\_0E05\_223E\_DD43\_55EA\_AC11\_19DE} -\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/release-2018.asc}{\s{Release Key} (2018)} +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/release-2021.asc}{\s{Release Key} (2021)} -\dd RSA, 3072-bit. Key ID: \cw{6289A25F4AE8DA82}. Fingerprint: -\cw{E273\_94AC\_A3F9\_D904\_9522\_\_E054\_6289\_A25F\_4AE8\_DA82} +\dd RSA, 3072-bit. Key ID: \cw{E4F83EA2AA4915EC}. Fingerprint: +\cw{2CF6\_134B\_D3F7\_7A65\_88EB\_D668\_E4F8\_3EA2\_AA49\_15EC} -\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/snapshot-2018.asc}{\s{Snapshot Key} (2018)} +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/snapshot-2021.asc}{\s{Snapshot Key} (2021)} -\dd RSA, 3072-bit. Key ID: \cw{38BA7229B7588FD1}. Fingerprint: -\cw{C92B\_52E9\_9AB6\_1DDA\_33DB\_\_2B7A\_38BA\_7229\_B758\_8FD1} +\dd RSA, 3072-bit. Key ID: \cw{B43979F89F446CFD}. Fingerprint: +\cw{1FD3\_BCAC\_E532\_FBE0\_6A8C\_09E2\_B439\_79F8\_9F44\_6CFD} -\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/contact-2018.asc}{\s{Secure Contact Key} (2018)} +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/contact-2021.asc}{\s{Secure Contact Key} (2021)} -\dd RSA, 3072-bit. Key ID: \cw{657D487977F95C98}. Fingerprint: -\cw{A680\_0082\_2998\_6E46\_22CA\_\_0E43\_657D\_4879\_77F9\_5C98} +\dd RSA, 3072-bit. Key ID: \cw{012C59D4211BD62A}. Fingerprint: +\cw{E30F\_1354\_2A04\_BE0E\_56F0\_5801\_012C\_59D4\_211B\_D62A} \H{pgpkeys-security} Security details @@ -169,6 +169,28 @@ generated keys. The details of all previous keys are given here. +\s{Keys generated in the 2018 rollover} + +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/master-2018.asc}{\s{Master Key} (2018)} + +\dd RSA, 4096-bit. Key ID: \cw{76BC7FE4EBFD2D9E}. Fingerprint: +\cw{24E1\_B1C5\_75EA\_3C9F\_F752\_\_A922\_76BC\_7FE4\_EBFD\_2D9E} + +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/release-2018.asc}{\s{Release Key} (2018)} + +\dd RSA, 3072-bit. Key ID: \cw{6289A25F4AE8DA82}. Fingerprint: +\cw{E273\_94AC\_A3F9\_D904\_9522\_\_E054\_6289\_A25F\_4AE8\_DA82} + +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/snapshot-2018.asc}{\s{Snapshot Key} (2018)} + +\dd RSA, 3072-bit. Key ID: \cw{38BA7229B7588FD1}. Fingerprint: +\cw{C92B\_52E9\_9AB6\_1DDA\_33DB\_\_2B7A\_38BA\_7229\_B758\_8FD1} + +\dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/contact-2018.asc}{\s{Secure Contact Key} (2018)} + +\dd RSA, 3072-bit. Key ID: \cw{657D487977F95C98}. Fingerprint: +\cw{A680\_0082\_2998\_6E46\_22CA\_\_0E43\_657D\_4879\_77F9\_5C98} + \s{Key generated in 2016} (when we first introduced the Secure Contact Key) \dt \W{https://www.chiark.greenend.org.uk/~sgtatham/putty/keys/contact-2016.asc}{\s{Secure Contact Key} (2016)} diff --git a/code/doc/plink.1 b/code/doc/plink.1 index a70606d..d8cecd4 100644 --- a/code/doc/plink.1 +++ b/code/doc/plink.1 @@ -34,7 +34,7 @@ Force raw mode. .IP "\fB-serial\fP" Force serial mode. .IP "\fB-ssh-connection\fP" -Force use of the `bare \fBssh-connection\fP' protocol. This is only likely to be useful when connecting to a \fIpsusan(1)\fP server, most likely with an absolute path to a Unix-domain socket in place of \fIhost\fP. +Force use of the `bare \fBssh-connection\fP' protocol. This is only likely to be useful when connecting to a \fBpsusan\fP(\fI1\fP) server, most likely with an absolute path to a Unix-domain socket in place of \fIhost\fP. .IP "\fB\-proxycmd\fP \fIcommand\fP" Instead of making a TCP connection, use \fIcommand\fP as a proxy; network traffic will be redirected to the standard input and output of \fIcommand\fP. \fIcommand\fP must be a single word, so is likely to need quoting by the shell. .RS @@ -61,8 +61,10 @@ Disable interactive prompts. .IP "\fB-no-sanitise-stdout\fP" By default, Plink can choose to filter control characters if that seems appropriate, to prevent remote processes sending confusing escape sequences. These options override Plink's default behaviour to enable or disabling such filtering on the standard error and standard output channels. +.IP "\fB-pwfile\fP \fIfilename\fP" +Open the specified file, and use the first line of text read from it as the remote password. .IP "\fB-pw\fP \fIpassword\fP" -Set remote password to \fIpassword\fP. \fICAUTION:\fP this will likely make the password visible to other users of the local machine (via commands such as `\fBw\fP'). +Set remote password to \fIpassword\fP. \fICAUTION:\fP this will likely make the password visible to other users of the local machine (via commands such as `\fBps\fP' or `\fBw\fP'). Use \fB-pwfile\fP instead. .IP "\fB\-L\fP \fB[\fP\fIsrcaddr\fP\fB:]\fP\fIsrcport\fP\fB:\fP\fIdesthost\fP\fB:\fP\fIdestport\fP" Set up a local port forwarding: listen on \fIsrcport\fP (or \fIsrcaddr\fP:\fIsrcport\fP if specified), and forward any connections over the SSH connection to the destination address \fIdesthost\fP:\fIdestport\fP. Only works in SSH. .IP "\fB\-R\fP \fB[\fP\fIsrcaddr\fP\fB:]\fP\fIsrcport\fP\fB:\fP\fIdesthost\fP\fB:\fP\fIdestport\fP" diff --git a/code/doc/plink.but b/code/doc/plink.but index 30dcead..44b29c5 100644 --- a/code/doc/plink.but +++ b/code/doc/plink.but @@ -41,7 +41,7 @@ use Plink: \c C:\>plink \c Plink: command-line connection utility -\c Release 0.76 +\c Release 0.77 \c Usage: plink [options] [user@]host [command] \c ("host" can also be a PuTTY saved session name) \c Options: @@ -61,7 +61,7 @@ use Plink: \c -sercfg configuration-string (e.g. 19200,8,n,1,X) \c Specify the serial configuration (serial only) \c The following options only apply to SSH connections: -\c -pw passw login with specified password +\c -pwfile file login with password read from specified file \c -D [listen-IP:]listen-port \c Dynamic SOCKS-based port forwarding \c -L [listen-IP:]listen-port:host:port diff --git a/code/doc/pscp.1 b/code/doc/pscp.1 index da8f964..6495caa 100644 --- a/code/doc/pscp.1 +++ b/code/doc/pscp.1 @@ -53,14 +53,16 @@ Set remote username to \fIuser\fP. Disable interactive prompts. .IP "\fB-no-sanitise-stderr\fP" By default, PSCP will filter control characters from the standard error channel from the server, to prevent remote processes sending confusing escape sequences. This option forces the standard error channel to not be filtered. +.IP "\fB-pwfile\fP \fIfilename\fP" +Open the specified file, and use the first line of text read from it as the remote password. .IP "\fB-pw\fP \fIpassword\fP" -Set remote password to \fIpassword\fP. \fICAUTION:\fP this will likely make the password visible to other users of the local machine (via commands such as `\fBw\fP'). +Set remote password to \fIpassword\fP. \fICAUTION:\fP this will likely make the password visible to other users of the local machine (via commands such as `\fBps\fP' or `\fBw\fP'). Use \fB-pwfile\fP instead. .IP "\fB-1\fP" Force use of SSH protocol version 1. .IP "\fB-2\fP" Force use of SSH protocol version 2. .IP "\fB-ssh-connection\fP" -Force use of the `bare \fBssh-connection\fP' protocol. This is only likely to be useful when connecting to a \fIpsusan(1)\fP server, most likely with an absolute path to a Unix-domain socket in place of \fIhost\fP. +Force use of the `bare \fBssh-connection\fP' protocol. This is only likely to be useful when connecting to a \fBpsusan\fP(\fI1\fP) server, most likely with an absolute path to a Unix-domain socket in place of \fIhost\fP. .IP "\fB-ssh\fP" Force use of the SSH protocol. (This is usually not needed; it's only likely to be useful if you need to override some other configuration of the `bare \fBssh-connection\fP' protocol.) .IP "\fB-4\fP, \fB-6\fP" diff --git a/code/doc/pscp.but b/code/doc/pscp.but index e816f3e..23b17a6 100644 --- a/code/doc/pscp.but +++ b/code/doc/pscp.but @@ -39,7 +39,7 @@ use PSCP: \c C:\>pscp \c PuTTY Secure Copy client -\c Release 0.76 +\c Release 0.77 \c Usage: pscp [options] [user@]host:source target \c pscp [options] source [source...] [user@]host:target \c pscp [options] -ls [user@]host:filespec @@ -53,7 +53,7 @@ use PSCP: \c -load sessname Load settings from saved session \c -P port connect to specified port \c -l user connect with specified username -\c -pw passw login with specified password +\c -pwfile file login with password read from specified file \c -1 -2 force use of particular SSH protocol version \c -ssh -ssh-connection \c force use of particular SSH protocol variant diff --git a/code/doc/psftp.1 b/code/doc/psftp.1 index ae704e4..47b0880 100644 --- a/code/doc/psftp.1 +++ b/code/doc/psftp.1 @@ -47,14 +47,16 @@ Set remote username to \fIuser\fP. Disable interactive prompts. .IP "\fB-no-sanitise-stderr\fP" By default, PSFTP will filter control characters from the standard error channel from the server, to prevent remote processes sending confusing escape sequences. This option forces the standard error channel to not be filtered. +.IP "\fB-pwfile\fP \fIfilename\fP" +Open the specified file, and use the first line of text read from it as the remote password. .IP "\fB-pw\fP \fIpassword\fP" -Set remote password to \fIpassword\fP. \fICAUTION:\fP this will likely make the password visible to other users of the local machine (via commands such as `\fBw\fP'). +Set remote password to \fIpassword\fP. \fICAUTION:\fP this will likely make the password visible to other users of the local machine (via commands such as `\fBps\fP' or `\fBw\fP'). Use \fB-pwfile\fP instead. .IP "\fB-1\fP" Force use of SSH protocol version 1. .IP "\fB-2\fP" Force use of SSH protocol version 2. .IP "\fB-ssh-connection\fP" -Force use of the `bare \fBssh-connection\fP' protocol. This is only likely to be useful when connecting to a \fIpsusan(1)\fP server, most likely with an absolute path to a Unix-domain socket in place of \fIhost\fP. +Force use of the `bare \fBssh-connection\fP' protocol. This is only likely to be useful when connecting to a \fBpsusan\fP(\fI1\fP) server, most likely with an absolute path to a Unix-domain socket in place of \fIhost\fP. .IP "\fB-ssh\fP" Force use of the SSH protocol. (This is usually not needed; it's only likely to be useful if you need to override some other configuration of the `bare \fBssh-connection\fP' protocol.) .IP "\fB-4\fP, \fB-6\fP" diff --git a/code/doc/pterm.1 b/code/doc/pterm.1 index b9c65c0..6e79b78 100644 --- a/code/doc/pterm.1 +++ b/code/doc/pterm.1 @@ -36,7 +36,7 @@ Specify the font to use for double-width characters (typically Chinese, Japanese .IP "\fB\-fwb\fP \fIfont-name\fP" Specify the font to use for bold double-width characters (typically Chinese, Japanese and Korean text). Like \fB-fb\fP, this will be ignored unless the \fBBoldAsColour\fP resource is set to 0 or 2. .IP "\fB\-geometry\fP \fIgeometry\fP" -Specify the size of the terminal, in rows and columns of text. See \fIX(7)\fP for more information on the syntax of geometry specifications. +Specify the size of the terminal, in rows and columns of text. See \fBX\fP(\fI7\fP) for more information on the syntax of geometry specifications. .IP "\fB\-sl\fP \fIlines\fP" Specify the number of lines of scrollback to save off the top of the terminal. .IP "\fB\-fg\fP \fIcolour\fP" diff --git a/code/doc/pubkey.but b/code/doc/pubkey.but index f40c952..8038207 100644 --- a/code/doc/pubkey.but +++ b/code/doc/pubkey.but @@ -56,7 +56,7 @@ and convenience. See \k{pageant} for further details. There is more than one \i{public-key algorithm} available. The most common are \i{RSA} and \i{ECDSA}, but others exist, notably \i{DSA} -(otherwise known as DSS), the USA's federal Digital Signature Standard. +(otherwise known as \i{DSS}), the USA's federal Digital Signature Standard. The key types supported by PuTTY are described in \k{puttygen-keytype}. \H{pubkey-puttygen} Using \i{PuTTYgen}, the PuTTY key generator @@ -177,6 +177,15 @@ are prime, because it generates the output number together with a proof of its primality. This takes more effort, but it eliminates that theoretical risk in the probabilistic method. +There in one way in which PuTTYgen's \q{proven primes} method is not +strictly better than its \q{probable primes} method. If you use +PuTTYgen to generate an RSA key on a computer that is potentially +susceptible to timing- or cache-based \i{side-channel attacks}, such +as a shared computer, the \q{probable primes} method is designed to +resist such attacks, whereas the \q{proven primes} methods are not. +(This is only a concern for RSA keys; for other key types, primes +are either not secret or not involved.) + You might choose to switch from probable to proven primes if you have a local security standard that demands it, or if you don't trust the probabilistic argument for the safety of the usual method. @@ -389,8 +398,8 @@ These options only affect PPK version 3. \dt Key derivation function \dd The variant of the \i{Argon2} key derivation function to use. -You might change this if you consider your exposure to side-channel -attacks to be different to the norm. +You might change this if you consider your exposure to \i{side-channel +attacks} to be different to the norm. \dt Memory to use for passphrase hash @@ -469,6 +478,82 @@ you have generated an SSH-1 private key using OpenSSH or Hence, the export options are not available if you have generated an SSH-1 key. +\S{puttygen-cli} PuTTYgen command-line configuration + +PuTTYgen supports a set of command-line options to configure many of +the same settings you can select in the GUI. This allows you to start +it up with your own preferences ready-selected, which might be useful +if you generate a lot of keys. (For example, you could make a Windows +shortcut that runs PuTTYgen with some command line options, or a batch +file or Powershell script that you could distribute to a whole +organisation containing your local standards.) + +The options supported on the command line are: + +\dt \cw{\-t} \e{keytype} + +\dd Type of key to generate. You can select \c{rsa}, \c{dsa}, +\c{ecdsa}, \c{eddsa} or \c{rsa1}. See \k{puttygen-keytype}. + +\dt \cw{\-b} \e{bits} + +\dd Size of the key to generate, in bits. See \k{puttygen-strength}. + +\dt \cw{\-\-primes} \e{method} + +\dd Method for generating prime numbers. You can select \c{probable}, +\c{proven}, and \c{proven-even}. See \k{puttygen-primes}. + +\dt \cw{\-\-strong-rsa} + +\dd When generating an RSA key, make sure the prime factors of the key +modulus are \q{strong primes}. See \k{puttygen-primes}. + +\dt \cw{\-\-ppk-param} \e{key}\cw{=}\e{value}\cw{,}... + +\dd Allows setting all the same details of the PPK save file format +described in \k{puttygen-save-params}. + +\lcont{ + +Aspects to change are specified as a series of \e{key}\cw{=}\e{value} pairs +separated by commas. The \e{key}s are: + +\dt \cw{version} + +\dd The PPK format version: either \cw{3} or \cw{2}. + +\dt \cw{kdf} + +\dd The variant of Argon2 to use: \cw{argon2id}, \cw{argon2i}, and +\cw{argon2d}. + +\dt \cw{memory} + +\dd The amount of memory needed to decrypt the key, in Kbyte. + +\dt \cw{time} + +\dd Specifies how much time is required to attempt decrypting the key, +in milliseconds. + +\dt \cw{passes} + +\dd Alternative to \cw{time}: specifies the number of hash passes +required to attempt decrypting the key. + +\dt \cw{parallelism} + +\dd Number of parallelisable threads that can be used to decrypt the +key. + +} + +\dt \cw{\-E} \e{fptype} + +\dd Algorithm to use when displaying key fingerprints. You can +select \c{sha256} or \c{md5}. See \k{puttygen-fingerprint}. + \H{pubkey-gettingready} Getting ready for public key authentication Connect to your SSH server using PuTTY with the SSH protocol. When the diff --git a/code/doc/putty.1 b/code/doc/putty.1 index 20ab813..07209fe 100644 --- a/code/doc/putty.1 +++ b/code/doc/putty.1 @@ -26,7 +26,7 @@ Specify the font to use for double-width characters (typically Chinese, Japanese .IP "\fB\-fwb\fP \fIfont-name\fP" Specify the font to use for bold double-width characters (typically Chinese, Japanese and Korean text). Like \fB-fb\fP, this will be ignored unless the \fBBoldAsColour\fP resource is set to 0 or 2. .IP "\fB\-geometry\fP \fIgeometry\fP" -Specify the size of the terminal, in rows and columns of text. See \fIX(7)\fP for more information on the syntax of geometry specifications. +Specify the size of the terminal, in rows and columns of text. See \fBX\fP(\fI7\fP) for more information on the syntax of geometry specifications. .IP "\fB\-sl\fP \fIlines\fP" Specify the number of lines of scrollback to save off the top of the terminal. .IP "\fB\-fg\fP \fIcolour\fP" diff --git a/code/doc/putty.chm b/code/doc/putty.chm new file mode 100644 index 0000000..43a6e05 Binary files /dev/null and b/code/doc/putty.chm differ diff --git a/code/doc/puttydoc.txt b/code/doc/puttydoc.txt index b8642dd..a8d8e9a 100644 --- a/code/doc/puttydoc.txt +++ b/code/doc/puttydoc.txt @@ -12,7 +12,7 @@ not described here; and the pterm and command-line puttygen and pageant utilities are not described at all. The only Unix-specific documentation that currently exists is the man pages. -This manual is copyright 1997-2021 Simon Tatham. All rights reserved. You +This manual is copyright 1997-2022 Simon Tatham. All rights reserved. You may distribute this documentation under the MIT licence. See appendix D for the licence text in full. @@ -158,8 +158,9 @@ Chapter 2: Getting started with PuTTY If you are using SSH to connect to a server for the first time, you will probably see a message looking something like this: - The server's host key is not cached in the registry. You have no - guarantee that the server is the computer you think it is. + The host key is not cached for this server: + ssh.example.com (port 22) + You have no guarantee that the server is the computer you think it is. The server's ssh-ed25519 key fingerprint is: ssh-ed25519 255 SHA256:TddlQk20DVs4LRcAsIfDN9pInKpY06D+h4kSHwWAj4w If you trust this host, press "Accept" to add the key to PuTTY's @@ -1082,15 +1083,22 @@ Chapter 3: Using PuTTY This option is equivalent to the port number control in the Session panel of the PuTTY configuration box (see section 4.1.1). -3.11.3.8 `-pw': specify a password +3.11.3.8 `-pwfile' and `-pw': specify a password A simple way to automate a remote login is to supply your password - on the command line. This is _not recommended_ for reasons of - security. If you possibly can, we recommend you set up public-key - authentication instead. See chapter 8 for details. + on the command line. - Note that the `-pw' option only works when you are using the - SSH protocol. Due to fundamental limitations of Telnet, Rlogin, + The `-pwfile' option takes a file name as an argument. The first + line of text in that file will be used as your password. + + The `-pw' option takes the password itself as an argument. This is + *NOT SECURE* if anybody else uses the same computer, because the + whole command line (including the password) is likely to show up + if another user lists the running processes. `-pw' is retained for + backwards compatibility only; you should use `-pwfile' instead. + + Note that these options only work when you are using the SSH + protocol. Due to fundamental limitations of Telnet, Rlogin, and SUPDUP, these protocols do not support automated password authentication. @@ -1178,14 +1186,19 @@ Chapter 3: Using PuTTY plink host1.example.com -nc host2.example.com:1234 - You might want to use this feature if you needed to make an SSH - connection to a target host which you can only reach by going - through a proxy host, and rather than using port forwarding you - prefer to use the local proxy feature (see section 4.16.1 for more - about local proxies). In this situation you might select `Local' - proxy type, set your local proxy command to be `plink %proxyhost - - nc %host:%port', enter the target host name on the Session panel, - and enter the directly reachable proxy host name on the Proxy panel. + This can be useful if you're trying to make a connection to a target + host which you can only reach by SSH forwarding through a proxy + host. One way to do this would be to have an existing SSH connection + to the proxy host, with a port forwarding, but if you prefer to have + the connection started on demand as needed, then this approach can + also work. + + However, this does depend on the program _using_ the proxy being + able to run a subprocess in place of making a network connection. + PuTTY itself can do this using the `Local' proxy type, but there's a + built-in more flexible way using the `SSH' proxy type. (See section + 4.16.1 for a description of both.) So this feature is probably most + useful with another client program as the end user. This feature is only available in SSH protocol version 2 (since the version 1 protocol assumes you will always want to run a shell). It @@ -1963,10 +1976,36 @@ Chapter 4: Configuring PuTTY to `ESC [v', and with shift and control together they generate `ESC [w' through to `ESC [{'. + - In Xterm 216 mode, the unshifted function keys behave the same + as Xterm R6 mode. But pressing a function key together with + Shift or Alt or Ctrl generates a different sequence containing + an extra numeric parameter of the form (1 for Shift) + (2 for + Alt) + (4 for Ctrl) + 1. For F1-F4, the basic sequences like + `ESC OP' become ESC [1;_bitmap_P and similar; for F5 and above, + ESC[_index_~ becomes ESC[_index_;_bitmap_~. + If you don't know what any of this means, you probably don't need to fiddle with it. - 4.4.4 Controlling Application Cursor Keys mode + 4.4.4 Changing the action of the shifted arrow keys + + This option affects the arrow keys, if you press one with any of the + modifier keys Shift, Ctrl or Alt held down. + + - In the default mode, labelled `Ctrl toggles app mode', the + Ctrl key toggles between the default arrow-key sequences like + `ESC [A' and `ESC [B', and the sequences Digital's terminals + generate in `application cursor keys' mode, i.e. `ESC O A' and + so on. Shift and Alt have no effect. + + - In the `xterm-style bitmap' mode, Shift, Ctrl and Alt all + generate different sequences, with a number indicating which set + of modifiers is active. + + If you don't know what any of this means, you probably don't need to + fiddle with it. + + 4.4.5 Controlling Application Cursor Keys mode Application Cursor Keys mode is a way for the server to change the control sequences sent by the arrow keys. In normal mode, the arrow @@ -1980,7 +2019,7 @@ Chapter 4: Configuring PuTTY You can also disable application cursor keys mode completely, using the `Features' configuration panel; see section 4.6.1. - 4.4.5 Controlling Application Keypad mode + 4.4.6 Controlling Application Keypad mode Application Keypad mode is a way for the server to change the behaviour of the numeric keypad. @@ -2005,7 +2044,7 @@ Chapter 4: Configuring PuTTY You can also disable application keypad mode completely, using the `Features' configuration panel; see section 4.6.1. - 4.4.6 Using NetHack keypad mode + 4.4.7 Using NetHack keypad mode PuTTY has a special mode for playing NetHack. You can enable it by selecting `NetHack' in the `Initial state of numeric keypad' @@ -2024,7 +2063,7 @@ Chapter 4: Configuring PuTTY For some reason, this feature only works properly when Num Lock is on. We don't know why. - 4.4.7 Enabling a DEC-like Compose key + 4.4.8 Enabling a DEC-like Compose key DEC terminals have a Compose key, which provides an easy-to-remember way of typing accented characters. You press Compose and then type @@ -2037,7 +2076,7 @@ Chapter 4: Configuring PuTTY key in PuTTY. Alternatively, if you enable the `AltGr acts as Compose key' option, the AltGr key will become a Compose key. - 4.4.8 `Control-Alt is different from AltGr' + 4.4.9 `Control-Alt is different from AltGr' Some old keyboards do not have an AltGr key, which can make it difficult to type some characters. PuTTY can be configured to treat @@ -2056,7 +2095,7 @@ Chapter 4: Configuring PuTTY (However, Ctrl-Alt will never act as a Compose key, regardless of the setting of `AltGr acts as Compose key' described in section - 4.4.7.) + 4.4.8.) 4.5 The Bell panel @@ -2162,8 +2201,8 @@ Chapter 4: Configuring PuTTY 4.6.1 Disabling application keypad and cursor keys - Application keypad mode (see section 4.4.5) and application cursor - keys mode (see section 4.4.4) alter the behaviour of the keypad and + Application keypad mode (see section 4.4.6) and application cursor + keys mode (see section 4.4.5) alter the behaviour of the keypad and cursor keys. Some applications enable these modes but then do not deal correctly with the modified keys. You can force these modes to be permanently disabled no matter what the server tries to do. @@ -2702,8 +2741,8 @@ Chapter 4: Configuring PuTTY by holding down Ctrl and right-clicking, regardless of the setting of this option.) - (When PuTTY iself is running on Unix, it follows the X Window System - convention.) + (When PuTTY itself is running on Unix, it follows the X Window + System convention.) 4.11.2 `Shift overrides application's use of mouse' @@ -3046,7 +3085,7 @@ Chapter 4: Configuring PuTTY alternative, see section 4.14.3.) Note that if you are using SSH-1 and the server has a bug that makes - it unable to deal with SSH-1 ignore messages (see section 4.26.11), + it unable to deal with SSH-1 ignore messages (see section 4.26.12), enabling keepalives will have no effect. 4.14.2 `Disable Nagle's algorithm' @@ -3278,11 +3317,24 @@ Chapter 4: Configuring PuTTY - Selecting `SOCKS 4' or `SOCKS 5' allows you to proxy your connections through a SOCKS server. - - Many firewalls implement a less formal type of proxy in which - a user can make a Telnet connection directly to the firewall - machine and enter a command such as `connect myhost.com 22' to - connect through to an external host. Selecting `Telnet' allows - you to tell PuTTY to use this type of proxy. + - Many firewalls implement a less formal type of proxy in + which a user can make a Telnet or TCP connection directly + to the firewall machine and enter a command such as + `connect myhost.com 22' to connect through to an external host. + Selecting `Telnet' allows you to tell PuTTY to use this type + of proxy, with the precise command specified as described in + section 4.16.5. + + - Selecting `SSH' causes PuTTY to make a secondary SSH connection + to the proxy host (sometimes called a `jump host' in this + context), and then open a port-forwarding channel to the final + destination host. + + The `Proxy hostname' field will be interpreted as the name of a + PuTTY saved session if one exists, or a hostname if not. This + allows multi-hop jump paths, if the referenced saved session is + itself configured to use an SSH proxy; and it allows combining + SSH and non-SSH proxying. - Selecting `Local' allows you to specify an arbitrary command on the local machine to act as a proxy. When the session is @@ -3294,11 +3346,6 @@ Chapter 4: Configuring PuTTY network proxy that PuTTY does not natively support; or you could tunnel a connection over something other than TCP/IP entirely. - If you want your local proxy command to make a secondary - SSH connection to a proxy host and then tunnel the primary - connection over that, you might well want the `-nc' command-line - option in Plink. See section 3.11.3.14 for more information. - You can also enable this mode on the command line; see section 3.11.3.26. @@ -3354,9 +3401,9 @@ Chapter 4: Configuring PuTTY without trying to look them up first. If you set this option to `Auto' (the default), PuTTY will do - something it considers appropriate for each type of proxy. Telnet, - HTTP, and SOCKS5 proxies will have host names passed straight to - them; SOCKS4 proxies will not. + something it considers appropriate for each type of proxy. Most + types of proxy (HTTP, SOCK5, SSH, Telnet, and local) will have host + names passed straight to them; SOCKS4 proxies will not. Note that if you are doing DNS at the proxy, you should make sure that your proxy exclusion settings (see section 4.16.2) do not @@ -3369,15 +3416,30 @@ Chapter 4: Configuring PuTTY all SOCKS 4 servers provide this extension. If you enable proxy DNS and your SOCKS 4 server cannot deal with it, this might be why. + If you want to avoid PuTTY making _any_ DNS query related to your + destination host name (for example, because your local DNS resolver + is very slow to return a negative response in that situation), then + as well as setting this control to `Yes', you may also need to + turn off GSSAPI authentication and GSSAPI key exchange in SSH (see + section 4.22 and section 4.18.1.1 respectively). This is because + GSSAPI setup also involves a DNS query for the destination host + name, and that query is performed by the separate GSSAPI library, so + PuTTY can't override or reconfigure it. + 4.16.4 Username and password - If your proxy requires authentication, you can enter a username and - a password in the `Username' and `Password' boxes. + You can enter a username and a password in the `Username' and + `Password' boxes, which will be used if your proxy requires + authentication. Note that if you save your session, the proxy password will be saved in plain text, so anyone who can access your PuTTY configuration data will be able to discover it. + If PuTTY discovers that it needs a proxy username or password + and you have not specified one here, PuTTY will prompt for it + interactively in the terminal window. + Authentication is not fully supported for all forms of proxy: - Username and password authentication is supported for HTTP @@ -3387,15 +3449,26 @@ Chapter 4: Configuring PuTTY supports it (this is not supported in PuTTYtel); otherwise the password is sent to the proxy in plain text. - - With HTTP proxying, the only currently supported - authentication method is `basic', where the password is sent - to the proxy in plain text. + - With HTTP proxying, authentication is via `HTTP Digest' + if possible (again, not supported in PuTTYtel), or `HTTP + Basic'. In the latter case, the password is sent to the + proxy in plain text. - SOCKS 4 can use the `Username' field, but does not support passwords. + - SSH proxying can use all the same forms of SSH authentication + supported by PuTTY for its main connection. If the SSH server + requests password authentication, any configured proxy password + will be used, but other authentication methods such as public + keys and GSSAPI will be tried first, just as for a primary + SSH connection, and if they require credentials such as a key + passphrase, PuTTY will interactively prompt for these. + - You can specify a way to include a username and password in the - Telnet/Local proxy command (see section 4.16.5). + Telnet/Local proxy command (see section 4.16.5). If you do so, + and don't also specify the actual username and/or password in + the configuration, PuTTY will interactively prompt for them. 4.16.5 Specifying the Telnet or Local proxy command @@ -3415,21 +3488,22 @@ Chapter 4: Configuring PuTTY Also, the special strings `%host' and `%port' will be replaced by the host name and port number you want to connect to. The strings `%user' and `%pass' will be replaced by the proxy username and - password you specify. The strings `%proxyhost' and `%proxyport' will - be replaced by the host details specified on the _Proxy_ panel, if - any (this is most likely to be useful for the Local proxy type). To - get a literal `%' sign, enter `%%'. + password (which, if not specified in the configuration, will be + prompted for). The strings `%proxyhost' and `%proxyport' will be + replaced by the host details specified on the _Proxy_ panel, if any + (this is most likely to be useful for the Local proxy type). To get + a literal `%' sign, enter `%%'. If a Telnet proxy server prompts for a username and password before commands can be sent, you can use a command such as: %user\n%pass\nconnect %host %port\n - This will send your username and password as the first two lines - to the proxy, followed by a command to connect to the desired host - and port. Note that if you do not include the `%user' or `%pass' - tokens in the Telnet command, then the `Username' and `Password' - configuration fields will be ignored. + This will send your username and password as the first two lines to + the proxy, followed by a command to connect to the desired host and + port. Note that if you do not include the `%user' or `%pass' tokens + in the Telnet command, then anything specified in `Username' and + `Password' configuration fields will be ignored. 4.16.6 Controlling proxy logging @@ -3740,16 +3814,16 @@ Chapter 4: Configuring PuTTY 4.19 The Host Keys panel - The Host Keys panel allows you to configure options related to SSH-2 - host key management. + The Host Keys panel allows you to configure options related to host + key management. Host keys are used to prove the server's identity, and assure you that the server is not being spoofed (either by a man-in-the-middle attack or by completely replacing it on the network). See section 2.2 for a basic introduction to host keys. - This entire panel is only relevant to SSH protocol version 2; none - of these settings affect SSH-1 at all. + Much of this panel is only relevant to SSH protocol version 2; SSH-1 + only supports one type of host key. 4.19.1 Host key type selection @@ -3788,9 +3862,9 @@ Chapter 4: Configuring PuTTY 4.19.2 Preferring known host keys - By default, PuTTY will adjust the preference order for host key - algorithms so that any host keys it already knows are moved to the - top of the list. + By default, PuTTY will adjust the preference order for SSH-2 host + key algorithms so that any host keys it already knows are moved to + the top of the list. This prevents you from having to check and confirm a new host key for a server you already had one for (e.g. because the server has @@ -4523,7 +4597,10 @@ Chapter 4: Configuring PuTTY - `On': PuTTY will assume the server _does_ have the bug. - `Auto': PuTTY will use the server's version number announcement - to try to guess whether or not the server has the bug. + to try to guess whether or not the server has the bug. (This + option is not available for bugs that _cannot_ be detected from + the server version, e.g. because they must be acted on before + the server version is known.) 4.26.1 `Chokes on SSH-2 ignore messages' @@ -4614,7 +4691,29 @@ Chapter 4: Configuring PuTTY server, the session will work correctly, but download performance will be less than it could be. -4.26.6 `Requires padding on SSH-2 RSA signatures' +4.26.6 `Discards data sent before its greeting' + + Just occasionally, an SSH connection can be established over some + channel that will accidentally discard outgoing data very early in + the connection. + + This is not typically seen as a bug in an actual SSH server, but + it can sometimes occur in situations involving a complicated proxy + process. An example is Debian bug #991958, in which a connection + going over the console of a User Mode Linux kernel can lose outgoing + data before the kernel has fully booted. + + You can work around this problem by manually enabling this bug flag, + which will cause PuTTY to wait to send its initial SSH greeting + until after it sees the greeting from the server. + + Note that this bug flag can never be automatically detected, + since auto-detection relies on the version string in the server's + greeting, and PuTTY has to decide whether to expect this bug + _before_ it sees the server's greeting. So this is a manual + workaround only. + +4.26.7 `Requires padding on SSH-2 RSA signatures' Versions below 3.3 of OpenSSH require SSH-2 RSA signatures to be padded with zero bytes to the same length as the RSA key modulus. @@ -4631,7 +4730,7 @@ Chapter 4: Configuring PuTTY This is an SSH-2-specific bug. -4.26.7 `Only supports pre-RFC4419 SSH-2 DH GEX' +4.26.8 `Only supports pre-RFC4419 SSH-2 DH GEX' The SSH key exchange method that uses Diffie-Hellman group exchange was redesigned after its original release, to use a slightly more @@ -4646,7 +4745,7 @@ Chapter 4: Configuring PuTTY This is an SSH-2-specific bug. -4.26.8 `Miscomputes SSH-2 HMAC keys' +4.26.9 `Miscomputes SSH-2 HMAC keys' Versions 2.3.0 and below of the SSH server software from ssh.com compute the keys for their HMAC message authentication codes @@ -4661,7 +4760,7 @@ Chapter 4: Configuring PuTTY This is an SSH-2-specific bug. -4.26.9 `Misuses the session ID in SSH-2 PK auth' +4.26.10 `Misuses the session ID in SSH-2 PK auth' Versions below 2.3 of OpenSSH require SSH-2 public-key authentication to be done slightly differently: the data to be @@ -4677,7 +4776,7 @@ Chapter 4: Configuring PuTTY This is an SSH-2-specific bug. -4.26.10 `Miscomputes SSH-2 encryption keys' +4.26.11 `Miscomputes SSH-2 encryption keys' Versions below 2.0.11 of the SSH server software from ssh.com compute the keys for the session encryption incorrectly. This @@ -4691,7 +4790,7 @@ Chapter 4: Configuring PuTTY This is an SSH-2-specific bug. -4.26.11 `Chokes on SSH-1 ignore messages' +4.26.12 `Chokes on SSH-1 ignore messages' An ignore message (SSH_MSG_IGNORE) is a message in the SSH protocol which can be sent from the client to the server, or from the server @@ -4704,15 +4803,15 @@ Chapter 4: Configuring PuTTY If this bug is detected, PuTTY will stop using ignore messages. This means that keepalives will stop working, and PuTTY will have to fall back to a secondary defence against SSH-1 password- - length eavesdropping. See section 4.26.12. If this bug is enabled + length eavesdropping. See section 4.26.13. If this bug is enabled when talking to a correct server, the session will succeed, but keepalives will not work and the session might be more vulnerable to eavesdroppers than it could be. -4.26.12 `Refuses all SSH-1 password camouflage' +4.26.13 `Refuses all SSH-1 password camouflage' When talking to an SSH-1 server which cannot deal with ignore - messages (see section 4.26.11), PuTTY will attempt to disguise the + messages (see section 4.26.12), PuTTY will attempt to disguise the length of the user's password by sending additional padding _within_ the password packet. This is technically a violation of the SSH- 1 specification, and so PuTTY will only do it when it cannot use @@ -4732,7 +4831,7 @@ Chapter 4: Configuring PuTTY This is an SSH-1-specific bug. SSH-2 is secure against this type of attack. -4.26.13 `Chokes on SSH-1 RSA authentication' +4.26.14 `Chokes on SSH-1 RSA authentication' Some SSH-1 servers cannot deal with RSA authentication messages at all. If Pageant is running and contains any SSH-1 keys, PuTTY will @@ -5110,7 +5209,7 @@ Chapter 5: Using PSCP to transfer files securely C:\>pscp PuTTY Secure Copy client - Release 0.76 + Release 0.77 Usage: pscp [options] [user@]host:source target pscp [options] source [source...] [user@]host:target pscp [options] -ls [user@]host:filespec @@ -5124,7 +5223,7 @@ Chapter 5: Using PSCP to transfer files securely -load sessname Load settings from saved session -P port connect to specified port -l user connect with specified username - -pw passw login with specified password + -pwfile file login with password read from specified file -1 -2 force use of particular SSH protocol version -ssh -ssh-connection force use of particular SSH protocol variant @@ -6032,7 +6131,7 @@ Chapter 7: Using the command-line connection tool Plink C:\>plink Plink: command-line connection utility - Release 0.76 + Release 0.77 Usage: plink [options] [user@]host [command] ("host" can also be a PuTTY saved session name) Options: @@ -6052,7 +6151,7 @@ Chapter 7: Using the command-line connection tool Plink -sercfg configuration-string (e.g. 19200,8,n,1,X) Specify the serial configuration (serial only) The following options only apply to SSH connections: - -pw passw login with specified password + -pwfile file login with password read from specified file -D [listen-IP:]listen-port Dynamic SOCKS-based port forwarding -L [listen-IP:]listen-port:host:port @@ -6604,6 +6703,15 @@ Chapter 8: Using public keys for SSH authentication proof of its primality. This takes more effort, but it eliminates that theoretical risk in the probabilistic method. + There in one way in which PuTTYgen's `proven primes' method is + not strictly better than its `probable primes' method. If you use + PuTTYgen to generate an RSA key on a computer that is potentially + susceptible to timing- or cache-based side-channel attacks, such + as a shared computer, the `probable primes' method is designed to + resist such attacks, whereas the `proven primes' methods are not. + (This is only a concern for RSA keys; for other key types, primes + are either not secret or not involved.) + You might choose to switch from probable to proven primes if you have a local security standard that demands it, or if you don't trust the probabilistic argument for the safety of the usual method. @@ -6889,6 +6997,78 @@ Chapter 8: Using public keys for SSH authentication client, you can use it with PuTTY, and vice versa. Hence, the export options are not available if you have generated an SSH-1 key. +8.2.15 PuTTYgen command-line configuration + + PuTTYgen supports a set of command-line options to configure many + of the same settings you can select in the GUI. This allows you to + start it up with your own preferences ready-selected, which might be + useful if you generate a lot of keys. (For example, you could make a + Windows shortcut that runs PuTTYgen with some command line options, + or a batch file or Powershell script that you could distribute to a + whole organisation containing your local standards.) + + The options supported on the command line are: + + -t _keytype_ + + Type of key to generate. You can select `rsa', `dsa', `ecdsa', + `eddsa' or `rsa1'. See section 8.2.2. + + -b _bits_ + + Size of the key to generate, in bits. See section 8.2.3. + + --primes _method_ + + Method for generating prime numbers. You can select `probable', + `proven', and `proven-even'. See section 8.2.4. + + --strong-rsa + + When generating an RSA key, make sure the prime factors of the + key modulus are `strong primes'. See section 8.2.4. + + --ppk-param _key_=_value_,... + + Allows setting all the same details of the PPK save file format + described in section 8.2.12. + + Aspects to change are specified as a series of _key_=_value_ + pairs separated by commas. The _key_s are: + + version + + The PPK format version: either 3 or 2. + + kdf + + The variant of Argon2 to use: argon2id, argon2i, and + argon2d. + + memory + + The amount of memory needed to decrypt the key, in Kbyte. + + time + + Specifies how much time is required to attempt decrypting + the key, in milliseconds. + + passes + + Alternative to time: specifies the number of hash passes + required to attempt decrypting the key. + + parallelism + + Number of parallelisable threads that can be used to decrypt + the key. + + -E _fptype_ + + Algorithm to use when displaying key fingerprints. You can + select `sha256' or `md5'. See section 8.2.6. + 8.3 Getting ready for public key authentication Connect to your SSH server using PuTTY with the SSH protocol. When @@ -7116,12 +7296,59 @@ Chapter 9: Using Pageant for authentication C:\PuTTY\pageant.exe d:\main.ppk -c C:\PuTTY\putty.exe - 9.3.3 Starting with the key list visible + 9.3.3 Integrating with Windows OpenSSH + + Windows's own port of OpenSSH uses the same mechanism as Pageant to + talk to its SSH agent (Windows named pipes). This means that Windows + OpenSSH can talk directly to Pageant, if it knows where to find + Pageant's named pipe. + + When Pageant starts up, it can optionally write out a file + containing an OpenSSH configuration directive that tells the Windows + `ssh.exe' where to find Pageant. If you include this file from your + Windows SSH configuration, then `ssh.exe' should automatically use + Pageant as its agent, so that you can keep your keys in one place + and have both SSH clients able to use them. + + The option is `--openssh-config', and you follow it with a filename. + + To refer to this file from your main OpenSSH configuration, you can + use the `Include' directive. For example, you might run Pageant like + this (with your own username substituted, of course): + + pageant --openssh-config C:\Users\Simon\.ssh\pageant.conf + + and then add a directive like this to your main `.ssh\config' + file (assuming that lives in the same directory that you just put + pageant.conf): + + Include pageant.conf + + *Note*: this technique only works with _Windows's_ port of OpenSSH, + which lives at C:\Windows\System32\OpenSSH\ssh.exe if you have + it installed. (If not, it can be installed as a Windows optional + feature, e.g., via Settings > Apps & features > Optional features > + Add a feature > OpenSSH Client.) + + There are other versions of OpenSSH for Windows, notably the one + that comes with Windows git. Those will likely not work with the + same configuration, because they tend to depend on Unix emulation + layers like MinGW or MSys, so they won't speak Windows native + pathname syntax or understand named pipes. The above instructions + will only work with Windows's own version of OpenSSH. + + So, if you want to use Windows git with an SSH key held in + Pageant, you'll have to set the environment variable GIT_SSH, + to point at a different program. You could point it at + c:\Windows\System32\OpenSSH\ssh.exe once you've done this setup - + but it's just as easy to point it at Plink! + + 9.3.4 Starting with the key list visible Start Pageant with the `--keylist' option to show the main window as soon as it starts up. - 9.3.4 Restricting the Windows process ACL + 9.3.5 Restricting the Windows process ACL Pageant supports the same `-restrict-acl' option as the other PuTTY utilities to lock down the Pageant process's access control; see @@ -7304,7 +7531,7 @@ Chapter 10: Common error messages which you don't understand, report it to us as a bug (see appendix B) and we will add documentation for it. - 10.1 `The server's host key is not cached in the registry' + 10.1 `The host key is not cached for this server' This error message occurs when PuTTY connects to a new SSH server. Every server identifies itself by means of a host key; once PuTTY @@ -7328,7 +7555,7 @@ Chapter 10: Common error messages 10.2 `WARNING - POTENTIAL SECURITY BREACH!' This message, followed by `The server's host key does not match - the one PuTTY has cached in the registry', means that PuTTY has + the one PuTTY has cached for this server', means that PuTTY has connected to the SSH server before, knows what its host key _should_ be, but has found a different one. @@ -7494,7 +7721,7 @@ Chapter 10: Common error messages This error can be caused by buggy SSH-1 servers that fail to cope with the various strategies we use for camouflaging passwords in transit. Upgrade your server, or use the workarounds described in - section 4.26.11 and possibly section 4.26.12. + section 4.26.12 and possibly section 4.26.13. 10.11 `No supported authentication methods available' @@ -7521,7 +7748,7 @@ Chapter 10: Common error messages which may not be noticed. Occasionally this has been caused by server bugs. An example is the - bug described at section 4.26.8, although you're very unlikely to + bug described at section 4.26.9, although you're very unlikely to encounter that one these days. In this context MAC stands for Message Authentication Code. It's a @@ -7538,7 +7765,7 @@ Chapter 10: Common error messages If you get this error, one thing you could try would be to fiddle with the setting of `Miscomputes SSH-2 encryption keys' (see section - 4.26.10) or `Ignores SSH-2 maximum packet size' (see section 4.26.5) + 4.26.11) or `Ignores SSH-2 maximum packet size' (see section 4.26.5) on the Bugs panel. 10.14 `PuTTY X11 proxy: _various errors_' @@ -7969,9 +8196,9 @@ A.2.11 Can PSCP or PSFTP transfer files in ASCII mode? substantially unfinished. If any OS X and/or GTK programming experts are keen to have a - finished version of this, we urge them to help out with some of the - remaining problems! See the TODO list in `unix/gtkapp.c' in the - source code. + finished version of this, we urge them to help out with some of + the remaining problems! See the TODO list in `unix/main-gtk- + application.c' in the source code. A.3.7 Will there be a port to EPOC? @@ -10021,7 +10248,7 @@ Appendix C: PPK file format Appendix D: PuTTY Licence ------------------------- - PuTTY is copyright 1997-2021 Simon Tatham. + PuTTY is copyright 1997-2022 Simon Tatham. Portions copyright Robert de Bath, Joris van Rantwijk, Delian Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, @@ -10076,9 +10303,9 @@ Appendix E: PuTTY hacking guide the `unix' subdirectory; the Windows-specific modules are in the `windows' subdirectory. - All the modules in the main source directory - notably _all_ of the - code for the various back ends - are platform-generic. We want to - keep them that way. + All the modules in the main source directory and other + subdirectories - notably _all_ of the code for the various back ends + - are platform-generic. We want to keep them that way. This also means you should stick to the C semantics guaranteed by the C standard: try not to make assumptions about the precise size @@ -10220,9 +10447,7 @@ Appendix E: PuTTY hacking guide We want PuTTY to continue being pure C, at least in the platform- independent parts and the currently existing ports. Patches which switch the Makefiles to compile it as C++ and start using classes - will not be accepted. Also, in particular, we disapprove of // - comments, at least for the moment. (Perhaps once C99 becomes - genuinely widespread we might be more lenient.) + will not be accepted. The one exception: a port to a new platform may use languages other than C if they are necessary to code on that platform. If your @@ -10326,16 +10551,17 @@ Appendix E: PuTTY hacking guide and is passed on to our window procedure by the MessageBox() message loop. - Also, the front ends (in particular Windows Plink) can use multiple - threads if they like. However, Windows Plink keeps _very_ tight - control of its auxiliary threads, and uses them pretty much - exclusively as a form of select(). Pretty much all the code outside - windows/winplink.c is _only_ ever called from the one primary - thread; the others just loop round blocking on file handles and - send messages to the main thread when some real work needs doing. - This is not considered a portability hazard because that bit of - windows/winplink.c will need rewriting on other platforms in any - case. + Also, the front ends can use multiple threads if they like. For + example, the Windows front-end code spawns subthreads to deal with + bidirectional blocking I/O on non-network streams such as Windows + pipes. However, it keeps tight control of its auxiliary threads, and + uses them only for that one purpose, as a form of select(). Pretty + much all the code outside windows/handle-io.c is _only_ ever called + from the one primary thread; the others just loop round blocking + on file handles, and signal the main thread (via Windows event + objects) when some real work needs doing. This is not considered a + portability hazard because that code is already Windows-specific and + needs rewriting on other platforms. One important consequence of this: PuTTY has only one thread in which to do everything. That `everything' may include managing @@ -10380,49 +10606,11 @@ Appendix E: PuTTY hacking guide boxes and you find yourself wanting to increase the size of the whole box, _don't_. Split it into more panels instead. - E.11 Automatically generated Makefiles - - PuTTY is intended to compile on multiple platforms, and with - multiple compilers. It would be horrifying to try to maintain a - single Makefile which handled all possible situations, and just as - painful to try to directly maintain a set of matching Makefiles for - each different compilation environment. - - Therefore, we have moved the problem up by one level. In the PuTTY - source archive is a file called `Recipe', which lists which source - files combine to produce which binaries; and there is also a script - called mkfiles.pl, which reads `Recipe' and writes out the real - Makefiles. (The script also reads all the source files and analyses - their dependencies on header files, so we get an extra benefit from - doing it this way, which is that we can supply correct dependency - information even in environments where it's difficult to set up an - automated `make depend' phase.) - - You should _never_ edit any of the PuTTY Makefiles directly. - They are not stored in our source repository at all. They are - automatically generated by mkfiles.pl from the file `Recipe'. - - If you need to add a new object file to a particular binary, the - right thing to do is to edit `Recipe' and re-run mkfiles.pl. This - will cause the new object file to be added in every tool that - requires it, on every platform where it matters, in every Makefile - to which it is relevant, _and_ to get all the dependency data right. - - If you send us a patch that modifies one of the Makefiles, you just - waste our time, because we will have to convert it into a change - to `Recipe'. If you send us a patch that modifies _all_ of the - Makefiles, you will have wasted a lot of _your_ time as well! - - (There is a comment at the top of every Makefile in the PuTTY source - archive saying this, but many people don't seem to read it, so it's - worth repeating here.) - - E.12 Coroutines in the SSH code - - Large parts of the code in the various SSH modules (in fact most - of the protocol layers) are structured using a set of macros that - implement (something close to) Donald Knuth's `coroutines' concept - in C. + E.11 Coroutines in protocol code + + Large parts of the code in modules implementing wire protocols + (mainly SSH) are structured using a set of macros that implement + (something close to) Donald Knuth's `coroutines' concept in C. Essentially, the purpose of these macros are to arrange that a function can call crReturn() to return to its caller, and the next @@ -10433,8 +10621,8 @@ Appendix E: PuTTY hacking guide function will be corrupted every time you call crReturn. If you need a variable to persist for longer than that, you _must_ make it a field in some appropriate structure containing the persistent state - of the coroutine - typically the main state structure for an SSH - protocol layer. + of the coroutine - typically the main state structure for a protocol + layer. See `https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html' for a more in-depth discussion of what these macros are for and how @@ -10456,7 +10644,7 @@ Appendix E: PuTTY hacking guide function is called, it can reliably free the memory if there is any, and not crash if there isn't. - E.13 Explicit vtable structures to implement traits + E.12 Explicit vtable structures to implement traits A lot of PuTTY's code is written in a style that looks structurally rather like an object-oriented language, in spite of PuTTY being a @@ -10589,13 +10777,13 @@ Appendix E: PuTTY hacking guide to write a set of static inline wrapper functions in the same header file that defined the MyAbstraction structure types, like this: - static MyAbstraction *myabs_new(const MyAbstractionVtable *vt) + static inline MyAbstraction *myabs_new(const MyAbstractionVtable *vt) { return vt->new(vt); } - static void myabs_free(MyAbstraction *myabs) + static inline void myabs_free(MyAbstraction *myabs) { myabs->vt->free(myabs); } - static void myimpl_modify(MyAbstraction *myabs, unsigned param) + static inline void myimpl_modify(MyAbstraction *myabs, unsigned param) { myabs->vt->modify(myabs, param); } - static unsigned myimpl_query(MyAbstraction *myabs, unsigned param) + static inline unsigned myimpl_query(MyAbstraction *myabs, unsigned param) { return myabs->vt->query(myabs, param); } And now call sites can use those reasonably clean-looking wrapper @@ -10642,8 +10830,8 @@ Appendix E: PuTTY hacking guide This system is flexible enough to permit `multiple inheritance', or rather, multiple _implementation_: having one object type - implement more than one trait. For example, the Proxy type - implements both the Socket trait and the Plug trait that + implement more than one trait. For example, the ProxySocket + type implements both the Socket trait and the Plug trait that connects to it, because it has to act as an adapter between another instance of each of those types. @@ -10823,46 +11011,7 @@ Appendix E: PuTTY hacking guide whose vt field points to &ssh_sha256: they all point to one of the other two full implementation vtables. - E.14 Single compilation of each source file - - The PuTTY build system for any given platform works on the following - very simple model: - - - Each source file is compiled precisely once, to produce a single - object file. - - - Each binary is created by linking together some combination of - those object files. - - Therefore, if you need to introduce functionality to a particular - module which is only available in some of the tool binaries (for - example, a cryptographic proxy authentication mechanism which needs - to be left out of PuTTYtel to maintain its usability in crypto- - hostile jurisdictions), the _wrong_ way to do it is by adding - #ifdefs in (say) proxy.c. This would require separate compilation - of proxy.c for PuTTY and PuTTYtel, which means that the entire - Makefile-generation architecture (see section E.11) would have to - be significantly redesigned. Unless you are prepared to do that - redesign yourself, _and_ guarantee that it will still port to any - future platforms we might decide to run on, you should not attempt - this! - - The _right_ way to introduce a feature like this is to put the - new code in a separate source file, and (if necessary) introduce - a second new source file defining the same set of functions, but - defining them as stubs which don't provide the feature. Then the - module whose behaviour needs to vary (proxy.c in this example) can - call the functions defined in these two modules, and it will either - provide the new feature or not provide it according to which of your - new modules it is linked with. - - Of course, object files are never shared _between_ platforms; so it - is allowable to use #ifdef to select between platforms. This happens - in puttyps.h (choosing which of the platform-specific include files - to use), and also in misc.c (the Windows-specific `Minefield' memory - diagnostic system). It should be used sparingly, though, if at all. - - E.15 Do as we say, not as we do + E.13 Do as we say, not as we do The current PuTTY code probably does not conform strictly to _all_ of the principles listed above. There may be the occasional SSH- @@ -10934,25 +11083,25 @@ Appendix F: PuTTY download keys and signatures PuTTY website, and are also available on PGP keyservers using the key IDs listed below. - *Master Key* (2018) + *Master Key* (2021) - RSA, 4096-bit. Key ID: 76BC7FE4EBFD2D9E. Fingerprint: - 24E1 B1C5 75EA 3C9F F752 A922 76BC 7FE4 EBFD 2D9E + RSA, 3072-bit. Key ID: DD4355EAAC1119DE. Fingerprint: + A872 D42F 1660 890F 0E05 223E DD43 55EA AC11 19DE - *Release Key* (2018) + *Release Key* (2021) - RSA, 3072-bit. Key ID: 6289A25F4AE8DA82. Fingerprint: - E273 94AC A3F9 D904 9522 E054 6289 A25F 4AE8 DA82 + RSA, 3072-bit. Key ID: E4F83EA2AA4915EC. Fingerprint: + 2CF6 134B D3F7 7A65 88EB D668 E4F8 3EA2 AA49 15EC - *Snapshot Key* (2018) + *Snapshot Key* (2021) - RSA, 3072-bit. Key ID: 38BA7229B7588FD1. Fingerprint: - C92B 52E9 9AB6 1DDA 33DB 2B7A 38BA 7229 B758 8FD1 + RSA, 3072-bit. Key ID: B43979F89F446CFD. Fingerprint: + 1FD3 BCAC E532 FBE0 6A8C 09E2 B439 79F8 9F44 6CFD - *Secure Contact Key* (2018) + *Secure Contact Key* (2021) - RSA, 3072-bit. Key ID: 657D487977F95C98. Fingerprint: - A680 0082 2998 6E46 22CA 0E43 657D 4879 77F9 5C98 + RSA, 3072-bit. Key ID: 012C59D4211BD62A. Fingerprint: + E30F 1354 2A04 BE0E 56F0 5801 012C 59D4 211B D62A F.2 Security details @@ -11049,6 +11198,28 @@ Appendix F: PuTTY download keys and signatures The details of all previous keys are given here. + *Keys generated in the 2018 rollover* + + *Master Key* (2018) + + RSA, 4096-bit. Key ID: 76BC7FE4EBFD2D9E. Fingerprint: + 24E1 B1C5 75EA 3C9F F752 A922 76BC 7FE4 EBFD 2D9E + + *Release Key* (2018) + + RSA, 3072-bit. Key ID: 6289A25F4AE8DA82. Fingerprint: + E273 94AC A3F9 D904 9522 E054 6289 A25F 4AE8 DA82 + + *Snapshot Key* (2018) + + RSA, 3072-bit. Key ID: 38BA7229B7588FD1. Fingerprint: + C92B 52E9 9AB6 1DDA 33DB 2B7A 38BA 7229 B758 8FD1 + + *Secure Contact Key* (2018) + + RSA, 3072-bit. Key ID: 657D487977F95C98. Fingerprint: + A680 0082 2998 6E46 22CA 0E43 657D 4879 77F9 5C98 + *Key generated in 2016* (when we first introduced the Secure Contact Key) @@ -11244,4 +11415,5 @@ Appendix G: SSH-2 names specified for PuTTY user will have to supply a passphrase before the key can be used). -[PuTTY release 0.76] + ersionid PuTTY release 0.77 + diff --git a/code/doc/puttytel.1 b/code/doc/puttytel.1 index 9153769..cba7ec0 100644 --- a/code/doc/puttytel.1 +++ b/code/doc/puttytel.1 @@ -26,7 +26,7 @@ Specify the font to use for double-width characters (typically Chinese, Japanese .IP "\fB\-fwb\fP \fIfont-name\fP" Specify the font to use for bold double-width characters (typically Chinese, Japanese and Korean text). Like \fB-fb\fP, this will be ignored unless the \fBBoldAsColour\fP resource is set to 0 or 2. .IP "\fB\-geometry\fP \fIgeometry\fP" -Specify the size of the terminal, in rows and columns of text. See \fIX(7)\fP for more information on the syntax of geometry specifications. +Specify the size of the terminal, in rows and columns of text. See \fBX\fP(\fI7\fP) for more information on the syntax of geometry specifications. .IP "\fB\-sl\fP \fIlines\fP" Specify the number of lines of scrollback to save off the top of the terminal. .IP "\fB\-fg\fP \fIcolour\fP" diff --git a/code/doc/udp.but b/code/doc/udp.but index b3570d5..12b3392 100644 --- a/code/doc/udp.but +++ b/code/doc/udp.but @@ -28,9 +28,9 @@ platform-generic modules. The Unix-specific modules are all in the \c{unix} subdirectory; the Windows-specific modules are in the \c{windows} subdirectory. -All the modules in the main source directory - notably \e{all} of -the code for the various back ends - are platform-generic. We want -to keep them that way. +All the modules in the main source directory and other +subdirectories - notably \e{all} of the code for the various back +ends - are platform-generic. We want to keep them that way. This also means you should stick to the C semantics guaranteed by the C standard: try not to make assumptions about the precise size of @@ -171,9 +171,7 @@ to. C++ friendliness is really a side benefit.) We want PuTTY to continue being pure C, at least in the platform-independent parts and the currently existing ports. Patches which switch the Makefiles to compile it as C++ and start using -classes will not be accepted. Also, in particular, we disapprove of -\cw{//} comments, at least for the moment. (Perhaps once C99 becomes -genuinely widespread we might be more lenient.) +classes will not be accepted. The one exception: a port to a new platform may use languages other than C if they are necessary to code on that platform. If your @@ -278,16 +276,17 @@ should be aware that you might be re-entered if a network event comes in and is passed on to our window procedure by the \cw{MessageBox()} message loop. -Also, the front ends (in particular Windows Plink) can use multiple -threads if they like. However, Windows Plink keeps \e{very} tight -control of its auxiliary threads, and uses them pretty much -exclusively as a form of \cw{select()}. Pretty much all the code -outside \cw{windows/winplink.c} is \e{only} ever called from the one -primary thread; the others just loop round blocking on file handles -and send messages to the main thread when some real work needs -doing. This is not considered a portability hazard because that bit -of \cw{windows/winplink.c} will need rewriting on other platforms in -any case. +Also, the front ends can use multiple threads if they like. For +example, the Windows front-end code spawns subthreads to deal with +bidirectional blocking I/O on non-network streams such as Windows +pipes. However, it keeps tight control of its auxiliary threads, and +uses them only for that one purpose, as a form of \cw{select()}. +Pretty much all the code outside \cw{windows/handle-io.c} is \e{only} +ever called from the one primary thread; the others just loop round +blocking on file handles, and signal the main thread (via Windows +event objects) when some real work needs doing. This is not considered +a portability hazard because that code is already Windows-specific and +needs rewriting on other platforms. One important consequence of this: PuTTY has only one thread in which to do everything. That \q{everything} may include managing @@ -333,51 +332,11 @@ on a 640\u00D7{x}480 display. If you're adding controls to either of these boxes and you find yourself wanting to increase the size of the whole box, \e{don't}. Split it into more panels instead. -\H{udp-makefiles-auto} Automatically generated \cw{Makefile}s - -PuTTY is intended to compile on multiple platforms, and with -multiple compilers. It would be horrifying to try to maintain a -single \cw{Makefile} which handled all possible situations, and just -as painful to try to directly maintain a set of matching -\cw{Makefile}s for each different compilation environment. - -Therefore, we have moved the problem up by one level. In the PuTTY -source archive is a file called \c{Recipe}, which lists which source -files combine to produce which binaries; and there is also a script -called \cw{mkfiles.pl}, which reads \c{Recipe} and writes out the -real \cw{Makefile}s. (The script also reads all the source files and -analyses their dependencies on header files, so we get an extra -benefit from doing it this way, which is that we can supply correct -dependency information even in environments where it's difficult to -set up an automated \c{make depend} phase.) - -You should \e{never} edit any of the PuTTY \cw{Makefile}s directly. -They are not stored in our source repository at all. They are -automatically generated by \cw{mkfiles.pl} from the file \c{Recipe}. - -If you need to add a new object file to a particular binary, the -right thing to do is to edit \c{Recipe} and re-run \cw{mkfiles.pl}. -This will cause the new object file to be added in every tool that -requires it, on every platform where it matters, in every -\cw{Makefile} to which it is relevant, \e{and} to get all the -dependency data right. - -If you send us a patch that modifies one of the \cw{Makefile}s, you -just waste our time, because we will have to convert it into a -change to \c{Recipe}. If you send us a patch that modifies \e{all} -of the \cw{Makefile}s, you will have wasted a lot of \e{your} time -as well! - -(There is a comment at the top of every \cw{Makefile} in the PuTTY -source archive saying this, but many people don't seem to read it, -so it's worth repeating here.) - -\H{udp-ssh-coroutines} Coroutines in the SSH code - -Large parts of the code in the various SSH modules (in fact most of -the protocol layers) are structured using a set of macros that -implement (something close to) Donald Knuth's \q{coroutines} concept -in C. +\H{udp-ssh-coroutines} Coroutines in protocol code + +Large parts of the code in modules implementing wire protocols +(mainly SSH) are structured using a set of macros that implement +(something close to) Donald Knuth's \q{coroutines} concept in C. Essentially, the purpose of these macros are to arrange that a function can call \cw{crReturn()} to return to its caller, and the @@ -388,7 +347,7 @@ This means that any local (automatic) variables declared in such a function will be corrupted every time you call \cw{crReturn}. If you need a variable to persist for longer than that, you \e{must} make it a field in some appropriate structure containing the persistent state -of the coroutine \dash typically the main state structure for an SSH +of the coroutine \dash typically the main state structure for a protocol layer. See @@ -544,13 +503,13 @@ call sites. Instead, what we generally do in this code base is to write a set of \cw{static inline} wrapper functions in the same header file that defined the \cw{MyAbstraction} structure types, like this: -\c static MyAbstraction *myabs_new(const MyAbstractionVtable *vt) +\c static inline MyAbstraction *myabs_new(const MyAbstractionVtable *vt) \c { return vt->new(vt); } -\c static void myabs_free(MyAbstraction *myabs) +\c static inline void myabs_free(MyAbstraction *myabs) \c { myabs->vt->free(myabs); } -\c static void myimpl_modify(MyAbstraction *myabs, unsigned param) +\c static inline void myimpl_modify(MyAbstraction *myabs, unsigned param) \c { myabs->vt->modify(myabs, param); } -\c static unsigned myimpl_query(MyAbstraction *myabs, unsigned param) +\c static inline unsigned myimpl_query(MyAbstraction *myabs, unsigned param) \c { return myabs->vt->query(myabs, param); } And now call sites can use those reasonably clean-looking wrapper @@ -598,8 +557,8 @@ based on the offset within that structure of the field called This system is flexible enough to permit \q{multiple inheritance}, or rather, multiple \e{implementation}: having one object type implement -more than one trait. For example, the \cw{Proxy} type implements both -the \cw{Socket} trait and the \cw{Plug} trait that connects to it, +more than one trait. For example, the \cw{ProxySocket} type implements +both the \cw{Socket} trait and the \cw{Plug} trait that connects to it, because it has to act as an adapter between another instance of each of those types. @@ -791,46 +750,6 @@ other two full implementation vtables. } -\H{udp-compile-once} Single compilation of each source file - -The PuTTY build system for any given platform works on the following -very simple model: - -\b Each source file is compiled precisely once, to produce a single -object file. - -\b Each binary is created by linking together some combination of -those object files. - -Therefore, if you need to introduce functionality to a particular -module which is only available in some of the tool binaries (for -example, a cryptographic proxy authentication mechanism which needs -to be left out of PuTTYtel to maintain its usability in -crypto-hostile jurisdictions), the \e{wrong} way to do it is by -adding \cw{#ifdef}s in (say) \cw{proxy.c}. This would require -separate compilation of \cw{proxy.c} for PuTTY and PuTTYtel, which -means that the entire \cw{Makefile}-generation architecture (see -\k{udp-makefiles-auto}) would have to be significantly redesigned. -Unless you are prepared to do that redesign yourself, \e{and} -guarantee that it will still port to any future platforms we might -decide to run on, you should not attempt this! - -The \e{right} way to introduce a feature like this is to put the new -code in a separate source file, and (if necessary) introduce a -second new source file defining the same set of functions, but -defining them as stubs which don't provide the feature. Then the -module whose behaviour needs to vary (\cw{proxy.c} in this example) -can call the functions defined in these two modules, and it will -either provide the new feature or not provide it according to which -of your new modules it is linked with. - -Of course, object files are never shared \e{between} platforms; so -it is allowable to use \cw{#ifdef} to select between platforms. This -happens in \cw{puttyps.h} (choosing which of the platform-specific -include files to use), and also in \cw{misc.c} (the Windows-specific -\q{Minefield} memory diagnostic system). It should be used -sparingly, though, if at all. - \H{udp-perfection} Do as we say, not as we do The current PuTTY code probably does not conform strictly to \e{all} diff --git a/code/doc/using.but b/code/doc/using.but index 02a6780..d5cf41c 100644 --- a/code/doc/using.but +++ b/code/doc/using.but @@ -838,17 +838,23 @@ any case.) This option is equivalent to the port number control in the Session panel of the PuTTY configuration box (see \k{config-hostname}). -\S2{using-cmdline-pw} \i\c{-pw}: specify a \i{password} +\S2{using-cmdline-pw} \i\c{-pwfile} and \i\c{-pw}: specify a \i{password} A simple way to automate a remote login is to supply your password -on the command line. This is \e{not recommended} for reasons of -security. If you possibly can, we recommend you set up public-key -authentication instead. See \k{pubkey} for details. +on the command line. -Note that the \c{-pw} option only works when you are using the SSH -protocol. Due to fundamental limitations of Telnet, Rlogin, and -SUPDUP, these protocols do not support automated password -authentication. +The \c{-pwfile} option takes a file name as an argument. The first +line of text in that file will be used as your password. + +The \c{-pw} option takes the password itself as an argument. This is +\s{NOT SECURE} if anybody else uses the same computer, because the +whole command line (including the password) is likely to show up if +another user lists the running processes. \c{-pw} is retained for +backwards compatibility only; you should use \c{-pwfile} instead. + +Note that these options only work when you are using the SSH protocol. +Due to fundamental limitations of Telnet, Rlogin, and SUPDUP, these +protocols do not support automated password authentication. \S2{using-cmdline-agentauth} \i\c{-agent} and \i\c{-noagent}: control use of Pageant for authentication @@ -941,15 +947,19 @@ this: \c plink host1.example.com -nc host2.example.com:1234 -You might want to use this feature if you needed to make an SSH -connection to a target host which you can only reach by going -through a proxy host, and rather than using port forwarding you -prefer to use the local proxy feature (see \k{config-proxy-type} for -more about local proxies). In this situation you might select -\q{Local} proxy type, set your local proxy command to be \cq{plink -%proxyhost -nc %host:%port}, enter the target host name on the -Session panel, and enter the directly reachable proxy host name on -the Proxy panel. +This can be useful if you're trying to make a connection to a target +host which you can only reach by SSH forwarding through a proxy host. +One way to do this would be to have an existing SSH connection to the +proxy host, with a port forwarding, but if you prefer to have the +connection started on demand as needed, then this approach can also +work. + +However, this does depend on the program \e{using} the proxy being +able to run a subprocess in place of making a network connection. +PuTTY itself can do this using the \q{Local} proxy type, but there's a +built-in more flexible way using the \q{SSH} proxy type. (See +\k{config-proxy-type} for a description of both.) So this feature is +probably most useful with another client program as the end user. This feature is only available in SSH protocol version 2 (since the version 1 protocol assumes you will always want to run a shell). It diff --git a/code/doc/version.but b/code/doc/version.but new file mode 100644 index 0000000..3b91f15 --- /dev/null +++ b/code/doc/version.but @@ -0,0 +1 @@ + ersionid PuTTY release 0.77 diff --git a/code/doc/vstr.but b/code/doc/vstr.but deleted file mode 100644 index f97ad6b..0000000 --- a/code/doc/vstr.but +++ /dev/null @@ -1 +0,0 @@ -\versionid PuTTY release 0.76 diff --git a/code/empty.h b/code/empty.h deleted file mode 100644 index 52cebd7..0000000 --- a/code/empty.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty file touched by automake makefile to force rebuild of version.o */ diff --git a/code/icons/Makefile b/code/icons/Makefile index 3bdba19..71b4387 100644 --- a/code/icons/Makefile +++ b/code/icons/Makefile @@ -14,7 +14,7 @@ MONOPNGS = $(patsubst %.pam,%.png,$(MONOPAMS)) TRUEPNGS = $(patsubst %.pam,%.png,$(TRUEPAMS)) ICOS = putty.ico puttygen.ico pscp.ico pageant.ico pageants.ico puttycfg.ico \ - puttyins.ico + puttyins.ico pterm.ico ptermcfg.ico ICNS = PuTTY.icns Pterm.icns CICONS = xpmputty.c xpmpucfg.c xpmpterm.c xpmptcfg.c @@ -69,6 +69,14 @@ pscp.ico: pscp-16.png pscp-32.png pscp-48.png \ pscp-16-mono.png pscp-32-mono.png pscp-48-mono.png ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ +pterm.ico: pterm-16.png pterm-32.png pterm-48.png \ + pterm-16-mono.png pterm-32-mono.png pterm-48-mono.png + ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ + +ptermcfg.ico: ptermcfg-16.png ptermcfg-32.png ptermcfg-48.png \ + ptermcfg-16-mono.png ptermcfg-32-mono.png ptermcfg-48-mono.png + ./icon.pl -4 $(filter-out %-mono.png, $^) -1 $(filter %-mono.png, $^) > $@ + # Because the installer icon makes heavy use of brown when drawing # the cardboard box, it's worth having 8-bit versions of it in # addition to the 4- and 1-bit ones. diff --git a/code/import.c b/code/import.c index 553fa75..41c06a9 100644 --- a/code/import.c +++ b/code/import.c @@ -775,7 +775,7 @@ static ssh2_userkey *openssh_pem_read( */ assert(privptr > 0); /* should have bombed by now if not */ retkey = snew(ssh2_userkey); - alg = (key->keytype == OP_RSA ? &ssh_rsa : &ssh_dss); + alg = (key->keytype == OP_RSA ? &ssh_rsa : &ssh_dsa); retkey->key = ssh_key_new_priv( alg, make_ptrlen(blob->u, privptr), make_ptrlen(blob->u+privptr, blob->len-privptr)); @@ -841,11 +841,11 @@ static bool openssh_pem_write( * line. */ if (ssh_key_alg(key->key) == &ssh_rsa || - ssh_key_alg(key->key) == &ssh_dss) { + ssh_key_alg(key->key) == &ssh_dsa) { strbuf *seq; /* - * The RSA and DSS handlers share some code because the two + * The RSA and DSA handlers share some code because the two * key types have very similar ASN.1 representations, as a * plain SEQUENCE of big integers. So we set up a list of * bignums per key type and then construct the actual blob in @@ -1363,9 +1363,8 @@ static ssh2_userkey *openssh_new_read( memset(keybuf, 0, keysize); break; case ON_K_BCRYPT: - openssh_bcrypt(passphrase, - key->kdfopts.bcrypt.salt.ptr, - key->kdfopts.bcrypt.salt.len, + openssh_bcrypt(ptrlen_from_asciz(passphrase), + key->kdfopts.bcrypt.salt, key->kdfopts.bcrypt.rounds, keybuf, keysize); break; @@ -1583,9 +1582,9 @@ static bool openssh_new_write( unsigned char keybuf[48]; ssh_cipher *cipher; - openssh_bcrypt(passphrase, - bcrypt_salt, sizeof(bcrypt_salt), bcrypt_rounds, - keybuf, sizeof(keybuf)); + openssh_bcrypt(ptrlen_from_asciz(passphrase), + make_ptrlen(bcrypt_salt, sizeof(bcrypt_salt)), + bcrypt_rounds, keybuf, sizeof(keybuf)); cipher = ssh_cipher_new(&ssh_aes256_sdctr); ssh_cipher_setkey(cipher, keybuf); @@ -1634,7 +1633,7 @@ static bool openssh_auto_write( * assume that anything not in that fixed list is newer, and hence * will use the new format. */ - if (ssh_key_alg(key->key) == &ssh_dss || + if (ssh_key_alg(key->key) == &ssh_dsa || ssh_key_alg(key->key) == &ssh_rsa || ssh_key_alg(key->key) == &ssh_ecdsa_nistp256 || ssh_key_alg(key->key) == &ssh_ecdsa_nistp384 || @@ -2111,7 +2110,7 @@ static ssh2_userkey *sshcom_read( goto error; } - alg = &ssh_dss; + alg = &ssh_dsa; put_stringz(blob, "ssh-dss"); put_mp_ssh2_from_string(blob, p); put_mp_ssh2_from_string(blob, q); @@ -2202,7 +2201,7 @@ static bool sshcom_write( nnumbers = 6; initial_zero = false; type = "if-modn{sign{rsa-pkcs1-sha1},encrypt{rsa-pkcs1v2-oaep}}"; - } else if (ssh_key_alg(key->key) == &ssh_dss) { + } else if (ssh_key_alg(key->key) == &ssh_dsa) { ptrlen p, q, g, y, x; /* diff --git a/code/install-sh b/code/install-sh deleted file mode 100644 index 8175c64..0000000 --- a/code/install-sh +++ /dev/null @@ -1,518 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2018-03-11.20; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/code/keygen/CMakeLists.txt b/code/keygen/CMakeLists.txt new file mode 100644 index 0000000..17eea2b --- /dev/null +++ b/code/keygen/CMakeLists.txt @@ -0,0 +1,10 @@ +add_sources_from_current_dir(keygen + dsa.c + ecdsa.c + millerrabin.c + mpunsafe.c + pockle.c + prime.c + primecandidate.c + rsa.c + smallprimes.c) diff --git a/code/sshdssg.c b/code/keygen/dsa.c similarity index 96% rename from code/sshdssg.c rename to code/keygen/dsa.c index 3b52725..a7ea4f5 100644 --- a/code/sshdssg.c +++ b/code/keygen/dsa.c @@ -1,5 +1,5 @@ /* - * DSS key generation. + * DSA key generation. */ #include "misc.h" @@ -7,7 +7,7 @@ #include "sshkeygen.h" #include "mpint.h" -int dsa_generate(struct dss_key *key, int bits, PrimeGenerationContext *pgc, +int dsa_generate(struct dsa_key *key, int bits, PrimeGenerationContext *pgc, ProgressReceiver *prog) { /* @@ -91,7 +91,7 @@ int dsa_generate(struct dss_key *key, int bits, PrimeGenerationContext *pgc, mp_free(two); mp_free(qm1); - key->sshk.vt = &ssh_dss; + key->sshk.vt = &ssh_dsa; key->p = p; key->q = q; diff --git a/code/sshecdsag.c b/code/keygen/ecdsa.c similarity index 100% rename from code/sshecdsag.c rename to code/keygen/ecdsa.c diff --git a/code/millerrabin.c b/code/keygen/millerrabin.c similarity index 55% rename from code/millerrabin.c rename to code/keygen/millerrabin.c index 3358bc5..24ee619 100644 --- a/code/millerrabin.c +++ b/code/keygen/millerrabin.c @@ -95,10 +95,8 @@ struct MillerRabin { MontyContext *mc; - size_t k; - mp_int *q; - - mp_int *two, *pm1, *m_pm1; + mp_int *pm1, *m_pm1; + mp_int *lowbit, *two; }; MillerRabin *miller_rabin_new(mp_int *p) @@ -108,15 +106,18 @@ MillerRabin *miller_rabin_new(mp_int *p) assert(mp_hs_integer(p, 2)); assert(mp_get_bit(p, 0) == 1); - mr->k = 1; - while (!mp_get_bit(p, mr->k)) - mr->k++; - mr->q = mp_rshift_safe(p, mr->k); + mr->pm1 = mp_copy(p); + mp_sub_integer_into(mr->pm1, mr->pm1, 1); - mr->two = mp_from_integer(2); + /* + * Standard bit-twiddling trick for isolating the lowest set bit + * of a number: x & (-x) + */ + mr->lowbit = mp_new(mp_max_bits(mr->pm1)); + mp_sub_into(mr->lowbit, mr->lowbit, mr->pm1); + mp_and_into(mr->lowbit, mr->lowbit, mr->pm1); - mr->pm1 = mp_unsafe_copy(p); - mp_sub_integer_into(mr->pm1, mr->pm1, 1); + mr->two = mp_from_integer(2); mr->mc = monty_new(p); mr->m_pm1 = monty_import(mr->mc, mr->pm1); @@ -126,55 +127,128 @@ MillerRabin *miller_rabin_new(mp_int *p) void miller_rabin_free(MillerRabin *mr) { - mp_free(mr->q); - mp_free(mr->two); mp_free(mr->pm1); mp_free(mr->m_pm1); + mp_free(mr->lowbit); + mp_free(mr->two); monty_free(mr->mc); smemclr(mr, sizeof(*mr)); sfree(mr); } -struct mr_result { - bool passed; - bool potential_primitive_root; -}; - -static struct mr_result miller_rabin_test_inner(MillerRabin *mr, mp_int *w) +/* + * The main internal function that implements a single M-R test. + * + * Expects the witness integer to be in Montgomery representation. + * (Since in live use witnesses are invented at random, this imposes + * no extra cost on the callers, and saves effort in here.) + */ +static struct mr_result miller_rabin_test_inner(MillerRabin *mr, mp_int *mw) { - /* - * Compute w^q mod p. - */ - mp_int *wqp = monty_pow(mr->mc, w, mr->q); + mp_int *acc = mp_copy(monty_identity(mr->mc)); + mp_int *spare = mp_new(mp_max_bits(mr->pm1)); + size_t bit = mp_max_bits(mr->pm1); /* - * See if this is 1, or if it is -1, or if it becomes -1 - * when squared at most k-1 times. + * The obvious approach to Miller-Rabin would be to start by + * calling monty_pow to raise w to the power q, and then square it + * k times ourselves. But that introduces a timing leak that gives + * away the value of k, i.e., how many factors of 2 there are in + * p-1. + * + * Instead, we don't call monty_pow at all. We do a modular + * exponentiation ourselves to compute w^((p-1)/2), using the + * technique that works from the top bit of the exponent + * downwards. That is, in each iteration we compute + * w^floor(exponent/2^i) for i one less than the previous + * iteration, by squaring the value we previously had and then + * optionally multiplying in w if the next exponent bit is 1. + * + * At the end of that process, once i <= k, the division + * (exponent/2^i) yields an integer, so the values we're computing + * are not just w^(floor of that), but w^(exactly that). In other + * words, the last k intermediate values of this modexp are + * precisely the values M-R wants to check against +1 or -1. + * + * So we interleave those checks with the modexp loop itself, and + * to avoid a timing leak, we check _every_ intermediate result + * against (the Montgomery representations of) both +1 and -1. And + * then we do bitwise masking to arrange that only the sensible + * ones of those checks find their way into our final answer. */ + + unsigned active = 0; + struct mr_result result; - result.passed = false; - result.potential_primitive_root = false; - - if (mp_cmp_eq(wqp, monty_identity(mr->mc))) { - result.passed = true; - } else { - for (size_t i = 0; i < mr->k; i++) { - if (mp_cmp_eq(wqp, mr->m_pm1)) { - result.passed = true; - result.potential_primitive_root = (i == mr->k - 1); - break; - } - if (i == mr->k - 1) - break; - monty_mul_into(mr->mc, wqp, wqp, wqp); - } + result.passed = result.potential_primitive_root = 0; + + while (bit-- > 1) { + /* + * In this iteration, we're computing w^(2e) or w^(2e+1), + * where we have w^e from the previous iteration. So we square + * the value we had already, and then optionally multiply in + * another copy of w depending on the next bit of the exponent. + */ + monty_mul_into(mr->mc, acc, acc, acc); + monty_mul_into(mr->mc, spare, acc, mw); + mp_select_into(acc, acc, spare, mp_get_bit(mr->pm1, bit)); + + /* + * mr->lowbit is a number with only one bit set, corresponding + * to the lowest set bit in p-1. So when that's the bit of the + * exponent we've just processed, we'll detect it by setting + * first_iter to true. That's our indication that we're now + * generating intermediate results useful to M-R, so we also + * set 'active', which stays set from then on. + */ + unsigned first_iter = mp_get_bit(mr->lowbit, bit); + active |= first_iter; + + /* + * Check the intermediate result against both +1 and -1. + */ + unsigned is_plus_1 = mp_cmp_eq(acc, monty_identity(mr->mc)); + unsigned is_minus_1 = mp_cmp_eq(acc, mr->m_pm1); + + /* + * M-R must report success iff either: the first of the useful + * intermediate results (which is w^q) is 1, or _any_ of them + * (from w^q all the way up to w^((p-1)/2)) is -1. + * + * So we want to pass the test if is_plus_1 is set on the + * first iteration, or if is_minus_1 is set on any iteration. + */ + result.passed |= (first_iter & is_plus_1); + result.passed |= (active & is_minus_1); + + /* + * In the final iteration, is_minus_1 is also used to set the + * 'potential primitive root' flag, because we haven't found + * any exponent smaller than p-1 for which w^(that) == 1. + */ + if (bit == 1) + result.potential_primitive_root = is_minus_1; } - mp_free(wqp); + mp_free(acc); + mp_free(spare); return result; } +/* + * Wrapper on miller_rabin_test_inner for the convenience of + * testcrypt. Expects the witness integer to be literal, so we + * monty_import it before running the real test. + */ +struct mr_result miller_rabin_test(MillerRabin *mr, mp_int *w) +{ + mp_int *mw = monty_import(mr->mc, w); + struct mr_result result = miller_rabin_test_inner(mr, mw); + mp_free(mw); + return result; +} + bool miller_rabin_test_random(MillerRabin *mr) { mp_int *mw = mp_random_in_range(mr->two, mr->pm1); diff --git a/code/mpunsafe.c b/code/keygen/mpunsafe.c similarity index 75% rename from code/mpunsafe.c rename to code/keygen/mpunsafe.c index beec13f..6265d40 100644 --- a/code/mpunsafe.c +++ b/code/keygen/mpunsafe.c @@ -7,10 +7,10 @@ #include "puttymem.h" #include "mpint.h" -#include "mpint_i.h" +#include "crypto/mpint_i.h" /* - * This global symbol is also defined in ssh2kex-client.c, to ensure + * This global symbol is also defined in ssh/kex2-client.c, to ensure * that these unsafe non-constant-time mp_int functions can't end up * accidentally linked in to any PuTTY tool that actually makes an SSH * client connection. @@ -45,13 +45,3 @@ mp_int *mp_unsafe_copy(mp_int *x) mp_copy_into(copy, x); return copy; } - -uint32_t mp_unsafe_mod_integer(mp_int *x, uint32_t modulus) -{ - uint64_t accumulator = 0; - for (size_t i = mp_max_bytes(x); i-- > 0 ;) { - accumulator = 0x100 * accumulator + mp_get_byte(x, i); - accumulator %= modulus; - } - return accumulator; -} diff --git a/code/mpunsafe.h b/code/keygen/mpunsafe.h similarity index 87% rename from code/mpunsafe.h rename to code/keygen/mpunsafe.h index 0b6ba3b..0721537 100644 --- a/code/mpunsafe.h +++ b/code/keygen/mpunsafe.h @@ -36,11 +36,4 @@ mp_int *mp_unsafe_shrink(mp_int *m); mp_int *mp_unsafe_copy(mp_int *m); -/* - * Compute the residue of x mod m. This is implemented in the most - * obvious way using the C % operator, which won't be constant-time on - * many C implementations. - */ -uint32_t mp_unsafe_mod_integer(mp_int *x, uint32_t m); - #endif /* PUTTY_MPINT_UNSAFE_H */ diff --git a/code/pockle.c b/code/keygen/pockle.c similarity index 96% rename from code/pockle.c rename to code/keygen/pockle.c index 60017e3..2a072f1 100644 --- a/code/pockle.c +++ b/code/keygen/pockle.c @@ -410,10 +410,10 @@ strbuf *pockle_mpu(Pockle *pockle, mp_int *p) memset(needed, 0, pockle->nlist * sizeof(bool)); needed[pr->index] = true; - strbuf_catf(sb, "[MPU - Primality Certificate]\nVersion 1.0\nBase 10\n\n" - "Proof for:\nN "); + put_fmt(sb, "[MPU - Primality Certificate]\nVersion 1.0\nBase 10\n\n" + "Proof for:\nN "); mp_write_decimal(sb, p); - strbuf_catf(sb, "\n"); + put_fmt(sb, "\n"); for (size_t index = pockle->nlist; index-- > 0 ;) { if (!needed[index]) @@ -421,27 +421,27 @@ strbuf *pockle_mpu(Pockle *pockle, mp_int *p) pr = pockle->list[index]; if (mp_get_nbits(pr->prime) <= 64) { - strbuf_catf(sb, "\nType Small\nN "); + put_fmt(sb, "\nType Small\nN "); mp_write_decimal(sb, pr->prime); - strbuf_catf(sb, "\n"); + put_fmt(sb, "\n"); } else { assert(pr->witness); - strbuf_catf(sb, "\nType BLS5\nN "); + put_fmt(sb, "\nType BLS5\nN "); mp_write_decimal(sb, pr->prime); - strbuf_catf(sb, "\n"); + put_fmt(sb, "\n"); for (size_t i = 0; i < pr->nfactors; i++) { - strbuf_catf(sb, "Q[%"SIZEu"] ", i+1); + put_fmt(sb, "Q[%"SIZEu"] ", i+1); mp_write_decimal(sb, pr->factors[i]->prime); assert(pr->factors[i]->index < index); needed[pr->factors[i]->index] = true; - strbuf_catf(sb, "\n"); + put_fmt(sb, "\n"); } for (size_t i = 0; i < pr->nfactors + 1; i++) { - strbuf_catf(sb, "A[%"SIZEu"] ", i); + put_fmt(sb, "A[%"SIZEu"] ", i); mp_write_decimal(sb, pr->witness); - strbuf_catf(sb, "\n"); + put_fmt(sb, "\n"); } - strbuf_catf(sb, "----\n"); + put_fmt(sb, "----\n"); } } sfree(needed); diff --git a/code/sshprime.c b/code/keygen/prime.c similarity index 100% rename from code/sshprime.c rename to code/keygen/prime.c diff --git a/code/primecandidate.c b/code/keygen/primecandidate.c similarity index 98% rename from code/primecandidate.c rename to code/keygen/primecandidate.c index cf55919..fca2b29 100644 --- a/code/primecandidate.c +++ b/code/keygen/primecandidate.c @@ -341,8 +341,8 @@ void pcs_ready(PrimeCandidateSource *s) int64_t mod = s->avoids[i].mod, res = s->avoids[i].res; if (mod != last_mod) { last_mod = mod; - addend_m = mp_unsafe_mod_integer(s->addend, mod); - factor_m = mp_unsafe_mod_integer(s->factor, mod); + addend_m = mp_mod_known_integer(s->addend, mod); + factor_m = mp_mod_known_integer(s->factor, mod); } if (factor_m == 0) { @@ -385,7 +385,7 @@ mp_int *pcs_generate(PrimeCandidateSource *s) if (mod != last_mod) { last_mod = mod; - x_res = mp_unsafe_mod_integer(x, mod); + x_res = mp_mod_known_integer(x, mod); } if (x_res == avoid_res) { @@ -396,6 +396,8 @@ mp_int *pcs_generate(PrimeCandidateSource *s) if (!ok) { mp_free(x); + if (s->one_shot) + return NULL; continue; /* try a new x */ } diff --git a/code/sshrsag.c b/code/keygen/rsa.c similarity index 100% rename from code/sshrsag.c rename to code/keygen/rsa.c diff --git a/code/smallprimes.c b/code/keygen/smallprimes.c similarity index 100% rename from code/smallprimes.c rename to code/keygen/smallprimes.c diff --git a/code/ldisc.c b/code/ldisc.c index f097c04..f0e5965 100644 --- a/code/ldisc.c +++ b/code/ldisc.c @@ -11,7 +11,62 @@ #include "putty.h" #include "terminal.h" -#include "ldisc.h" + +struct Ldisc_tag { + Terminal *term; + Backend *backend; + Seat *seat; + + /* + * When the backend is not reporting true from sendok(), terminal + * input that comes here is stored in this bufchain instead. When + * the backend later decides it wants session input, we empty the + * queue in ldisc_check_sendok_callback(), passing its contents on + * to the backend. Before then, we also provide data from this + * queue to term_get_userpass_input() via ldisc_get_input_token(), + * to be interpreted as user responses to username and password + * prompts during authentication. + * + * Unfortunately, the data stored in this queue is not all of the + * same type: our output to the backend consists of both raw bytes + * sent to backend_send(), and also session specials such as + * SS_EOL and SS_EC. So we have to encode our queued data in a way + * that can represent both. + * + * The encoding is private to this source file, so we can change + * it if necessary and only have to worry about the encode and + * decode functions here. Currently, it is: + * + * - Bytes other than 0xFF are stored literally. + * - The byte 0xFF itself is stored as 0xFF 0xFF. + * - A session special (code, arg) is stored as 0xFF, followed by + * a big-endian 4-byte integer containing code, followed by + * another big-endian 4-byte integer containing arg. + * + * (This representation relies on session special codes being at + * most 0xFEFFFFFF when represented in 32 bits, so that the first + * byte of the 'code' integer can't be confused with the 0xFF + * followup byte indicating a literal 0xFF, But since session + * special codes are defined by an enum counting up from zero, and + * there are only a couple of dozen of them, that shouldn't be a + * problem! Even so, just in case, an assertion checks that at + * encode time.) + */ + bufchain input_queue; + + IdempotentCallback input_queue_callback; + prompts_t *prompts; + + /* + * Values cached out of conf. + */ + bool telnet_keyboard, telnet_newline; + int protocol, localecho, localedit; + + char *buf; + size_t buflen, bufsiz; + bool quotenext; +}; #define ECHOING (ldisc->localecho == FORCE_ON || \ (ldisc->localecho == AUTO && \ @@ -72,6 +127,8 @@ static void bsb(Ldisc *ldisc, int n) c_write(ldisc, "\010 \010", 3); } +static void ldisc_input_queue_callback(void *ctx); + #define CTRL(x) (x^'@') #define KCTRL(x) ((x^'@') | 0x100) @@ -88,6 +145,14 @@ Ldisc *ldisc_create(Conf *conf, Terminal *term, Backend *backend, Seat *seat) ldisc->term = term; ldisc->seat = seat; + bufchain_init(&ldisc->input_queue); + + ldisc->prompts = NULL; + ldisc->input_queue_callback.fn = ldisc_input_queue_callback; + ldisc->input_queue_callback.ctx = ldisc; + ldisc->input_queue_callback.queued = false; + bufchain_set_callback(&ldisc->input_queue, &ldisc->input_queue_callback); + ldisc_configure(ldisc, conf); /* Link ourselves into the backend and the terminal */ @@ -110,12 +175,16 @@ void ldisc_configure(Ldisc *ldisc, Conf *conf) void ldisc_free(Ldisc *ldisc) { + bufchain_clear(&ldisc->input_queue); if (ldisc->term) ldisc->term->ldisc = NULL; if (ldisc->backend) backend_provide_ldisc(ldisc->backend, NULL); if (ldisc->buf) sfree(ldisc->buf); + if (ldisc->prompts && ldisc->prompts->ldisc_ptr_to_us == &ldisc->prompts) + ldisc->prompts->ldisc_ptr_to_us = NULL; + delete_callbacks_for_context(ldisc); sfree(ldisc); } @@ -124,6 +193,173 @@ void ldisc_echoedit_update(Ldisc *ldisc) seat_echoedit_update(ldisc->seat, ECHOING, EDITING); } +void ldisc_enable_prompt_callback(Ldisc *ldisc, prompts_t *prompts) +{ + /* + * Called by the terminal to indicate that there's a prompts_t + * currently in flight, or to indicate that one has just finished + * (by passing NULL). When ldisc->prompts is not null, we notify + * the terminal whenever new data arrives in our input queue, so + * that it can continue the interactive prompting process. + */ + ldisc->prompts = prompts; + if (prompts) + ldisc->prompts->ldisc_ptr_to_us = &ldisc->prompts; +} + +static void ldisc_input_queue_callback(void *ctx) +{ + /* + * Toplevel callback that is triggered whenever the input queue + * lengthens. If we're currently processing an interactive prompt, + * we call back the Terminal to tell it to do some more stuff with + * that prompt based on the new input. + */ + Ldisc *ldisc = (Ldisc *)ctx; + if (ldisc->term && ldisc->prompts) { + /* + * The integer return value from this call is discarded, + * because we have no channel to pass it on to the backend + * that originally wanted it. But that's OK, because if the + * return value is >= 0 (that is, the prompts are either + * completely filled in, or aborted by the user), then the + * terminal will notify the callback in the prompts_t, and + * when that calls term_get_userpass_input again, it will + * return the same answer again. + */ + term_get_userpass_input(ldisc->term, ldisc->prompts); + } +} + +static void ldisc_to_backend_raw( + Ldisc *ldisc, const void *vbuf, size_t len) +{ + if (backend_sendok(ldisc->backend)) { + backend_send(ldisc->backend, vbuf, len); + } else { + const char *buf = (const char *)vbuf; + while (len > 0) { + /* + * Encode raw data in input_queue, by storing large chunks + * as long as they don't include 0xFF, and pausing every + * time they do to escape it. + */ + const char *ff = memchr(buf, '\xFF', len); + size_t this_len = ff ? ff - buf : len; + if (this_len > 0) { + bufchain_add(&ldisc->input_queue, buf, len); + } else { + bufchain_add(&ldisc->input_queue, "\xFF\xFF", 2); + this_len = 1; + } + buf += this_len; + len -= this_len; + } + } +} + +static void ldisc_to_backend_special( + Ldisc *ldisc, SessionSpecialCode code, int arg) +{ + if (backend_sendok(ldisc->backend)) { + backend_special(ldisc->backend, code, arg); + } else { + /* + * Encode a session special in input_queue. + */ + unsigned char data[9]; + data[0] = 0xFF; + PUT_32BIT_MSB_FIRST(data+1, code); + PUT_32BIT_MSB_FIRST(data+5, arg); + assert(data[1] != 0xFF && + "SessionSpecialCode encoding collides with FF FF escape"); + bufchain_add(&ldisc->input_queue, data, 9); + } +} + +bool ldisc_has_input_buffered(Ldisc *ldisc) +{ + return bufchain_size(&ldisc->input_queue) > 0; +} + +LdiscInputToken ldisc_get_input_token(Ldisc *ldisc) +{ + assert(bufchain_size(&ldisc->input_queue) > 0 && + "You're not supposed to call this unless there is buffered input!"); + + LdiscInputToken tok; + + char c; + bufchain_fetch_consume(&ldisc->input_queue, &c, 1); + if (c != '\xFF') { + /* A literal non-FF byte */ + tok.is_special = false; + tok.chr = c; + return tok; + } else { + char data[8]; + + /* See if the byte after the FF is also FF, indicating a literal FF */ + bufchain_fetch_consume(&ldisc->input_queue, data, 1); + if (data[0] == '\xFF') { + tok.is_special = false; + tok.chr = '\xFF'; + return tok; + } + + /* If not, get the rest of an 8-byte chunk and decode a special */ + bufchain_fetch_consume(&ldisc->input_queue, data+1, 7); + tok.is_special = true; + tok.code = GET_32BIT_MSB_FIRST(data); + tok.arg = toint(GET_32BIT_MSB_FIRST(data+4)); + return tok; + } +} + +static void ldisc_check_sendok_callback(void *ctx) +{ + Ldisc *ldisc = (Ldisc *)ctx; + + if (!(ldisc->backend && backend_sendok(ldisc->backend))) + return; + + /* + * Flush the ldisc input queue into the backend, which is now + * willing to receive the data. + */ + while (bufchain_size(&ldisc->input_queue) > 0) { + /* + * Process either a chunk of non-special data, or an FF + * escape, depending on whether the first thing we see is an + * FF byte. + */ + ptrlen data = bufchain_prefix(&ldisc->input_queue); + const char *ff = memchr(data.ptr, '\xFF', data.len); + if (ff != data.ptr) { + /* Send a maximal block of data not containing any + * difficult bytes. */ + if (ff) + data.len = ff - (const char *)data.ptr; + backend_send(ldisc->backend, data.ptr, data.len); + bufchain_consume(&ldisc->input_queue, data.len); + } else { + /* Decode either a special or an escaped FF byte. The + * easiest way to do this is to reuse the decoding code + * already in ldisc_get_input_token. */ + LdiscInputToken tok = ldisc_get_input_token(ldisc); + if (tok.is_special) + backend_special(ldisc->backend, tok.code, tok.arg); + else + backend_send(ldisc->backend, &tok.chr, 1); + } + } +} + +void ldisc_check_sendok(Ldisc *ldisc) +{ + queue_toplevel_callback(ldisc_check_sendok_callback, ldisc); +} + void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) { const char *buf = (const char *)vbuf; @@ -206,7 +442,7 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) bsb(ldisc, plen(ldisc, ldisc->buf[ldisc->buflen - 1])); ldisc->buflen--; } - backend_special(ldisc->backend, SS_EL, 0); + ldisc_to_backend_special(ldisc, SS_EL, 0); /* * We don't send IP, SUSP or ABORT if the user has * configured telnet specials off! This breaks @@ -215,11 +451,11 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) if (!ldisc->telnet_keyboard) goto default_case; if (c == CTRL('C')) - backend_special(ldisc->backend, SS_IP, 0); + ldisc_to_backend_special(ldisc, SS_IP, 0); if (c == CTRL('Z')) - backend_special(ldisc->backend, SS_SUSP, 0); + ldisc_to_backend_special(ldisc, SS_SUSP, 0); if (c == CTRL('\\')) - backend_special(ldisc->backend, SS_ABORT, 0); + ldisc_to_backend_special(ldisc, SS_ABORT, 0); break; case CTRL('R'): /* redraw line */ if (ECHOING) { @@ -234,9 +470,9 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) break; case CTRL('D'): /* logout or send */ if (ldisc->buflen == 0) { - backend_special(ldisc->backend, SS_EOF, 0); + ldisc_to_backend_special(ldisc, SS_EOF, 0); } else { - backend_send(ldisc->backend, ldisc->buf, ldisc->buflen); + ldisc_to_backend_raw(ldisc, ldisc->buf, ldisc->buflen); ldisc->buflen = 0; } break; @@ -272,14 +508,13 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) /* FALLTHROUGH */ case KCTRL('M'): /* send with newline */ if (ldisc->buflen > 0) - backend_send(ldisc->backend, - ldisc->buf, ldisc->buflen); + ldisc_to_backend_raw(ldisc, ldisc->buf, ldisc->buflen); if (ldisc->protocol == PROT_RAW) - backend_send(ldisc->backend, "\r\n", 2); + ldisc_to_backend_raw(ldisc, "\r\n", 2); else if (ldisc->protocol == PROT_TELNET && ldisc->telnet_newline) - backend_special(ldisc->backend, SS_EOL, 0); + ldisc_to_backend_special(ldisc, SS_EOL, 0); else - backend_send(ldisc->backend, "\r", 1); + ldisc_to_backend_raw(ldisc, "\r", 1); if (ECHOING) c_write(ldisc, "\r\n", 2); ldisc->buflen = 0; @@ -298,7 +533,7 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) } } else { if (ldisc->buflen != 0) { - backend_send(ldisc->backend, ldisc->buf, ldisc->buflen); + ldisc_to_backend_raw(ldisc, ldisc->buf, ldisc->buflen); while (ldisc->buflen > 0) { bsb(ldisc, plen(ldisc, ldisc->buf[ldisc->buflen - 1])); ldisc->buflen--; @@ -311,33 +546,33 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive) switch (buf[0]) { case CTRL('M'): if (ldisc->protocol == PROT_TELNET && ldisc->telnet_newline) - backend_special(ldisc->backend, SS_EOL, 0); + ldisc_to_backend_special(ldisc, SS_EOL, 0); else - backend_send(ldisc->backend, "\r", 1); + ldisc_to_backend_raw(ldisc, "\r", 1); break; case CTRL('?'): case CTRL('H'): if (ldisc->telnet_keyboard) { - backend_special(ldisc->backend, SS_EC, 0); + ldisc_to_backend_special(ldisc, SS_EC, 0); break; } case CTRL('C'): if (ldisc->telnet_keyboard) { - backend_special(ldisc->backend, SS_IP, 0); + ldisc_to_backend_special(ldisc, SS_IP, 0); break; } case CTRL('Z'): if (ldisc->telnet_keyboard) { - backend_special(ldisc->backend, SS_SUSP, 0); + ldisc_to_backend_special(ldisc, SS_SUSP, 0); break; } default: - backend_send(ldisc->backend, buf, len); + ldisc_to_backend_raw(ldisc, buf, len); break; } } else - backend_send(ldisc->backend, buf, len); + ldisc_to_backend_raw(ldisc, buf, len); } } } diff --git a/code/ldisc.h b/code/ldisc.h deleted file mode 100644 index 770b4b0..0000000 --- a/code/ldisc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * ldisc.h: defines the Ldisc data structure used by ldisc.c and - * ldiscucs.c. (Unfortunately it was necessary to split the ldisc - * module in two, to avoid unnecessarily linking in the Unicode - * stuff in tools that don't require it.) - */ - -#ifndef PUTTY_LDISC_H -#define PUTTY_LDISC_H - -struct Ldisc_tag { - Terminal *term; - Backend *backend; - Seat *seat; - - /* - * Values cached out of conf. - */ - bool telnet_keyboard, telnet_newline; - int protocol, localecho, localedit; - - char *buf; - size_t buflen, bufsiz; - bool quotenext; -}; - -#endif /* PUTTY_LDISC_H */ diff --git a/code/licence.h b/code/licence.h deleted file mode 100644 index 9ad3f81..0000000 --- a/code/licence.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * licence.h - macro definitions for the PuTTY licence. - * - * Generated by licence.pl from LICENCE. - * You should edit those files rather than editing this one. - */ - -#define LICENCE_TEXT(parsep) \ - "PuTTY is copyright 1997-2021 Simon Tatham." \ - parsep \ - "Portions copyright Robert de Bath, Joris van Rantwijk, Delian Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn, Colin Watson, Christopher Staite, Lorenz Diener, Christian Brabandt, Jeff Smith, Pavel Kryukov, Maxim Kuznetsov, Svyatoslav Kuzmich, Nico Williams, Viktor Dukhovni, Josh Dersch, Lars Brinkhoff, Daniel Risacher, Joshua Dantzler, Bryan Berns, and CORE SDI S.A." \ - parsep \ - "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:" \ - parsep \ - "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." \ - parsep \ - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." - -#define SHORT_COPYRIGHT_DETAILS "1997-2021 Simon Tatham" diff --git a/code/licence.pl b/code/licence.pl index e1d3a51..f927bcb 100644 --- a/code/licence.pl +++ b/code/licence.pl @@ -1,17 +1,31 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # This script generates licence.h (containing the PuTTY licence in the # form of macros expanding to C string literals) from the LICENCE # master file. It also regenerates the licence-related Halibut input # files. +use warnings; use File::Basename; - -# Read the input file. -$infile = "LICENCE"; +use Getopt::Long; + +my $usage = "usage: licence.pl (--header|--licencedoc|--copyrightdoc) " . + "[-o OUTFILE]\n"; +my $mode = undef; +my $output = undef; +GetOptions("--header" => sub {$mode = "header"}, + "--licencedoc" => sub {$mode = "licencedoc"}, + "--copyrightdoc" => sub {$mode = "copyrightdoc"}, + "o|output=s" => \$output) + and defined $mode + or die $usage; + +# Read the input file. We expect to find that alongside this script. +my $infile = (dirname __FILE__) . "/LICENCE"; open my $in, $infile or die "$infile: open: $!\n"; my @lines = (); while (<$in>) { + y/\r//d; chomp; push @lines, $_; } @@ -36,76 +50,68 @@ unless $paras[0] =~ m!copyright ([^\.]*)\.!i; $shortdetails = $1; -# Write out licence.h. - -$outfile = "licence.h"; -open my $out, ">", $outfile or die "$outfile: open: $!\n"; -select $out; - -print "/*\n"; -print " * $outfile - macro definitions for the PuTTY licence.\n"; -print " *\n"; -print " * Generated by @{[basename __FILE__]} from $infile.\n"; -print " * You should edit those files rather than editing this one.\n"; -print " */\n"; -print "\n"; - -print "#define LICENCE_TEXT(parsep) \\\n"; -for my $i (0..$#paras) { - my $lit = &stringlit($paras[$i]); - print " parsep \\\n" if $i > 0; - print " \"$lit\""; - print " \\" if $i < $#paras; - print "\n"; -} -print "\n"; - -printf "#define SHORT_COPYRIGHT_DETAILS \"%s\"\n", &stringlit($shortdetails); - -sub stringlit { - my ($lit) = @_; - $lit =~ s!\\!\\\\!g; - $lit =~ s!"!\\"!g; - return $lit; -} - -close $out; - -# Write out doc/licence.but. +my $out = ""; + +if ($mode eq "header") { + $out .= "/*\n"; + $out .= " * licence.h - macro definitions for the PuTTY licence.\n"; + $out .= " *\n"; + $out .= " * Generated by @{[basename __FILE__]} from $infile.\n"; + $out .= " * You should edit those files rather than editing this one.\n"; + $out .= " */\n"; + $out .= "\n"; + + $out .= "#define LICENCE_TEXT(parsep) \\\n"; + for my $i (0..$#paras) { + my $lit = &stringlit($paras[$i]); + $out .= " parsep \\\n" if $i > 0; + $out .= " \"$lit\""; + $out .= " \\" if $i < $#paras; + $out .= "\n"; + } + $out .= "\n"; -$outfile = "doc/licence.but"; -open $out, ">", $outfile or die "$outfile: open: $!\n"; -select $out; + $out .= sprintf "#define SHORT_COPYRIGHT_DETAILS \"%s\"\n", + &stringlit($shortdetails); +} elsif ($mode eq "licencedoc") { + # Write out doc/licence.but. -print "\\# Generated by @{[basename __FILE__]} from $infile.\n"; -print "\\# You should edit those files rather than editing this one.\n\n"; + $out .= "\\# Generated by @{[basename __FILE__]} from $infile.\n"; + $out .= "\\# You should edit those files rather than editing this one.\n\n"; -print "\\A{licence} PuTTY \\ii{Licence}\n\n"; + $out .= "\\A{licence} PuTTY \\ii{Licence}\n\n"; -for my $i (0..$#paras) { - my $para = &halibutescape($paras[$i]); - if ($i == 0) { - $para =~ s!copyright!\\i{copyright}!; # index term in paragraph 1 + for my $i (0..$#paras) { + my $para = &halibutescape($paras[$i]); + if ($i == 0) { + $para =~ s!copyright!\\i{copyright}!; # index term in paragraph 1 + } + $out .= "$para\n\n"; } - print "$para\n\n"; -} - -close $out; +} elsif ($mode eq "copyrightdoc") { + # Write out doc/copy.but, which defines a macro used in the manual + # preamble blurb. -# And write out doc/copy.but, which defines a macro used in the manual -# preamble blurb. + $out .= "\\# Generated by @{[basename __FILE__]} from $infile.\n"; + $out .= "\\# You should edit those files rather than editing this one.\n\n"; -$outfile = "doc/copy.but"; -open $out, ">", $outfile or die "$outfile: open: $!\n"; -select $out; - -print "\\# Generated by @{[basename __FILE__]} from $infile.\n"; -print "\\# You should edit those files rather than editing this one.\n\n"; + $out .= sprintf "\\define{shortcopyrightdetails} %s\n\n", + &halibutescape($shortdetails); +} -printf "\\define{shortcopyrightdetails} %s\n\n", - &halibutescape($shortdetails); +my $outfile; +my $opened = (defined $output) ? + (open $outfile, ">", $output) : (open $outfile, ">-"); +$opened or die "$output: open: $!\n"; +print $outfile $out; +close $outfile; -close $out; +sub stringlit { + my ($lit) = @_; + $lit =~ s!\\!\\\\!g; + $lit =~ s!"!\\"!g; + return $lit; +} sub halibutescape { my ($text) = @_; @@ -113,3 +119,16 @@ sub halibutescape { $text =~ s!"([^"]*)"!\\q{$1}!g; # convert quoted strings to \q{} return $text; } + +sub write { + my ($filename, $newcontents) = @_; + if (open my $fh, "<", $filename) { + my $oldcontents = ""; + $oldcontents .= $_ while <$fh>; + close $fh; + return if $oldcontents eq $newcontents; + } + open my $fh, ">", $filename or die "$filename: open: $!\n"; + print $fh $newcontents; + close $fh; +} diff --git a/code/logging.c b/code/logging.c index 31cbccf..e065f1a 100644 --- a/code/logging.c +++ b/code/logging.c @@ -81,6 +81,11 @@ void logflush(LogContext *ctx) fflush(ctx->lgfp); } +LogPolicy *log_get_policy(LogContext *ctx) +{ + return ctx->lp; +} + static void logfopen_callback(void *vctx, int mode) { LogContext *ctx = (LogContext *)vctx; diff --git a/code/marshal.h b/code/marshal.h index 108d8ae..4d5b007 100644 --- a/code/marshal.h +++ b/code/marshal.h @@ -4,6 +4,7 @@ #include "defs.h" #include +#include /* * A sort of 'abstract base class' or 'interface' or 'trait' which is @@ -12,6 +13,7 @@ */ struct BinarySink { void (*write)(BinarySink *sink, const void *data, size_t len); + void (*writefmtv)(BinarySink *sink, const char *fmt, va_list ap); BinarySink *binarysink_; }; @@ -25,6 +27,7 @@ struct BinarySink { #define BinarySink_IMPLEMENTATION BinarySink binarysink_[1] #define BinarySink_INIT(obj, writefn) \ ((obj)->binarysink_->write = (writefn), \ + (obj)->binarysink_->writefmtv = NULL, \ (obj)->binarysink_->binarysink_ = (obj)->binarysink_) /* @@ -138,6 +141,20 @@ struct BinarySink { BinarySink_put_data(BinarySink_UPCAST(bs), val, len) #define put_datapl(bs, pl) \ BinarySink_put_datapl(BinarySink_UPCAST(bs), pl) +#define put_dataz(bs, val) \ + BinarySink_put_datapl(BinarySink_UPCAST(bs), ptrlen_from_asciz(val)) +#define put_datalit(bs, val) \ + BinarySink_put_datapl(BinarySink_UPCAST(bs), PTRLEN_LITERAL(val)) + +/* Emit printf-formatted data, with no terminator. */ +#define put_fmt(bs, ...) \ + BinarySink_put_fmt(BinarySink_UPCAST(bs), __VA_ARGS__) +#define put_fmtv(bs, fmt, ap) \ + BinarySink_put_fmtv(BinarySink_UPCAST(bs), fmt, ap) + +/* More complicated function implemented in write_c_string_literal.c */ +#define put_c_string_literal(bs, str) \ + BinarySink_put_c_string_literal(BinarySink_UPCAST(bs), str) /* * The underlying real C functions that implement most of those @@ -160,12 +177,14 @@ void BinarySink_put_uint64(BinarySink *, uint64_t); void BinarySink_put_string(BinarySink *, const void *data, size_t len); void BinarySink_put_stringpl(BinarySink *, ptrlen); void BinarySink_put_stringz(BinarySink *, const char *str); -struct strbuf; -void BinarySink_put_stringsb(BinarySink *, struct strbuf *); +void BinarySink_put_stringsb(BinarySink *, strbuf *); void BinarySink_put_asciz(BinarySink *, const char *str); bool BinarySink_put_pstring(BinarySink *, const char *str); void BinarySink_put_mp_ssh1(BinarySink *bs, mp_int *x); void BinarySink_put_mp_ssh2(BinarySink *bs, mp_int *x); +void BinarySink_put_fmt(BinarySink *, const char *fmt, ...) PRINTF_LIKE(2, 3); +void BinarySink_put_fmtv(BinarySink *, const char *fmt, va_list ap); +void BinarySink_put_c_string_literal(BinarySink *, ptrlen); /* ---------------------------------------------------------------------- */ diff --git a/code/minibidi.c b/code/minibidi.c deleted file mode 100644 index 05d15b3..0000000 --- a/code/minibidi.c +++ /dev/null @@ -1,2025 +0,0 @@ -/************************************************************************ - * - * ------------ - * Description: - * ------------ - * This is an implementation of Unicode's Bidirectional Algorithm - * (known as UAX #9). - * - * http://www.unicode.org/reports/tr9/ - * - * Author: Ahmad Khalifa - * - * (www.arabeyes.org - under MIT license) - * - ************************************************************************/ - -/* - * TODO: - * ===== - * - Explicit marks need to be handled (they are not 100% now) - * - Ligatures - */ - -#include /* definition of wchar_t*/ - -#include "putty.h" -#include "misc.h" - -#define LMASK 0x3F /* Embedding Level mask */ -#define OMASK 0xC0 /* Override mask */ -#define OISL 0x80 /* Override is L */ -#define OISR 0x40 /* Override is R */ - -/* For standalone compilation in a testing mode. - * Still depends on the PuTTY headers for snewn and sfree, but can avoid - * _linking_ with any other PuTTY code. */ -#ifdef TEST_GETTYPE -#define safemalloc malloc -#define safefree free -#endif - -/* Shaping Helpers */ -#define STYPE(xh) ((((xh) >= SHAPE_FIRST) && ((xh) <= SHAPE_LAST)) ? \ -shapetypes[(xh)-SHAPE_FIRST].type : SU) /*))*/ -#define SISOLATED(xh) (shapetypes[(xh)-SHAPE_FIRST].form_b) -#define SFINAL(xh) ((xh)+1) -#define SINITIAL(xh) ((xh)+2) -#define SMEDIAL(ch) ((ch)+3) - -#define leastGreaterOdd(x) ( ((x)+1) | 1 ) -#define leastGreaterEven(x) ( ((x)+2) &~ 1 ) - -/* function declarations */ -static void flipThisRun( - bidi_char *from, unsigned char *level, int max, int count); -static int findIndexOfRun( - unsigned char *level, int start, int count, int tlevel); -static unsigned char getType(int ch); -static unsigned char setOverrideBits( - unsigned char level, unsigned char override); -static int getPreviousLevel(unsigned char *level, int from); -static void doMirror(unsigned int *ch); - -/* character types */ -enum { - L, - LRE, - LRO, - R, - AL, - RLE, - RLO, - PDF, - EN, - ES, - ET, - AN, - CS, - NSM, - BN, - B, - S, - WS, - ON -}; - -/* Shaping Types */ -enum { - SL, /* Left-Joining, doesn't exist in U+0600 - U+06FF */ - SR, /* Right-Joining, ie has Isolated, Final */ - SD, /* Dual-Joining, ie has Isolated, Final, Initial, Medial */ - SU, /* Non-Joining */ - SC /* Join-Causing, like U+0640 (TATWEEL) */ -}; - -typedef struct { - char type; - wchar_t form_b; -} shape_node; - -/* Kept near the actual table, for verification. */ -#define SHAPE_FIRST 0x621 -#define SHAPE_LAST (SHAPE_FIRST + lenof(shapetypes) - 1) - -static const shape_node shapetypes[] = { - /* index, Typ, Iso, Ligature Index*/ - /* 621 */ {SU, 0xFE80}, - /* 622 */ {SR, 0xFE81}, - /* 623 */ {SR, 0xFE83}, - /* 624 */ {SR, 0xFE85}, - /* 625 */ {SR, 0xFE87}, - /* 626 */ {SD, 0xFE89}, - /* 627 */ {SR, 0xFE8D}, - /* 628 */ {SD, 0xFE8F}, - /* 629 */ {SR, 0xFE93}, - /* 62A */ {SD, 0xFE95}, - /* 62B */ {SD, 0xFE99}, - /* 62C */ {SD, 0xFE9D}, - /* 62D */ {SD, 0xFEA1}, - /* 62E */ {SD, 0xFEA5}, - /* 62F */ {SR, 0xFEA9}, - /* 630 */ {SR, 0xFEAB}, - /* 631 */ {SR, 0xFEAD}, - /* 632 */ {SR, 0xFEAF}, - /* 633 */ {SD, 0xFEB1}, - /* 634 */ {SD, 0xFEB5}, - /* 635 */ {SD, 0xFEB9}, - /* 636 */ {SD, 0xFEBD}, - /* 637 */ {SD, 0xFEC1}, - /* 638 */ {SD, 0xFEC5}, - /* 639 */ {SD, 0xFEC9}, - /* 63A */ {SD, 0xFECD}, - /* 63B */ {SU, 0x0}, - /* 63C */ {SU, 0x0}, - /* 63D */ {SU, 0x0}, - /* 63E */ {SU, 0x0}, - /* 63F */ {SU, 0x0}, - /* 640 */ {SC, 0x0}, - /* 641 */ {SD, 0xFED1}, - /* 642 */ {SD, 0xFED5}, - /* 643 */ {SD, 0xFED9}, - /* 644 */ {SD, 0xFEDD}, - /* 645 */ {SD, 0xFEE1}, - /* 646 */ {SD, 0xFEE5}, - /* 647 */ {SD, 0xFEE9}, - /* 648 */ {SR, 0xFEED}, - /* 649 */ {SR, 0xFEEF}, /* SD */ - /* 64A */ {SD, 0xFEF1}, - /* 64B */ {SU, 0x0}, - /* 64C */ {SU, 0x0}, - /* 64D */ {SU, 0x0}, - /* 64E */ {SU, 0x0}, - /* 64F */ {SU, 0x0}, - /* 650 */ {SU, 0x0}, - /* 651 */ {SU, 0x0}, - /* 652 */ {SU, 0x0}, - /* 653 */ {SU, 0x0}, - /* 654 */ {SU, 0x0}, - /* 655 */ {SU, 0x0}, - /* 656 */ {SU, 0x0}, - /* 657 */ {SU, 0x0}, - /* 658 */ {SU, 0x0}, - /* 659 */ {SU, 0x0}, - /* 65A */ {SU, 0x0}, - /* 65B */ {SU, 0x0}, - /* 65C */ {SU, 0x0}, - /* 65D */ {SU, 0x0}, - /* 65E */ {SU, 0x0}, - /* 65F */ {SU, 0x0}, - /* 660 */ {SU, 0x0}, - /* 661 */ {SU, 0x0}, - /* 662 */ {SU, 0x0}, - /* 663 */ {SU, 0x0}, - /* 664 */ {SU, 0x0}, - /* 665 */ {SU, 0x0}, - /* 666 */ {SU, 0x0}, - /* 667 */ {SU, 0x0}, - /* 668 */ {SU, 0x0}, - /* 669 */ {SU, 0x0}, - /* 66A */ {SU, 0x0}, - /* 66B */ {SU, 0x0}, - /* 66C */ {SU, 0x0}, - /* 66D */ {SU, 0x0}, - /* 66E */ {SU, 0x0}, - /* 66F */ {SU, 0x0}, - /* 670 */ {SU, 0x0}, - /* 671 */ {SR, 0xFB50}, - /* 672 */ {SU, 0x0}, - /* 673 */ {SU, 0x0}, - /* 674 */ {SU, 0x0}, - /* 675 */ {SU, 0x0}, - /* 676 */ {SU, 0x0}, - /* 677 */ {SU, 0x0}, - /* 678 */ {SU, 0x0}, - /* 679 */ {SD, 0xFB66}, - /* 67A */ {SD, 0xFB5E}, - /* 67B */ {SD, 0xFB52}, - /* 67C */ {SU, 0x0}, - /* 67D */ {SU, 0x0}, - /* 67E */ {SD, 0xFB56}, - /* 67F */ {SD, 0xFB62}, - /* 680 */ {SD, 0xFB5A}, - /* 681 */ {SU, 0x0}, - /* 682 */ {SU, 0x0}, - /* 683 */ {SD, 0xFB76}, - /* 684 */ {SD, 0xFB72}, - /* 685 */ {SU, 0x0}, - /* 686 */ {SD, 0xFB7A}, - /* 687 */ {SD, 0xFB7E}, - /* 688 */ {SR, 0xFB88}, - /* 689 */ {SU, 0x0}, - /* 68A */ {SU, 0x0}, - /* 68B */ {SU, 0x0}, - /* 68C */ {SR, 0xFB84}, - /* 68D */ {SR, 0xFB82}, - /* 68E */ {SR, 0xFB86}, - /* 68F */ {SU, 0x0}, - /* 690 */ {SU, 0x0}, - /* 691 */ {SR, 0xFB8C}, - /* 692 */ {SU, 0x0}, - /* 693 */ {SU, 0x0}, - /* 694 */ {SU, 0x0}, - /* 695 */ {SU, 0x0}, - /* 696 */ {SU, 0x0}, - /* 697 */ {SU, 0x0}, - /* 698 */ {SR, 0xFB8A}, - /* 699 */ {SU, 0x0}, - /* 69A */ {SU, 0x0}, - /* 69B */ {SU, 0x0}, - /* 69C */ {SU, 0x0}, - /* 69D */ {SU, 0x0}, - /* 69E */ {SU, 0x0}, - /* 69F */ {SU, 0x0}, - /* 6A0 */ {SU, 0x0}, - /* 6A1 */ {SU, 0x0}, - /* 6A2 */ {SU, 0x0}, - /* 6A3 */ {SU, 0x0}, - /* 6A4 */ {SD, 0xFB6A}, - /* 6A5 */ {SU, 0x0}, - /* 6A6 */ {SD, 0xFB6E}, - /* 6A7 */ {SU, 0x0}, - /* 6A8 */ {SU, 0x0}, - /* 6A9 */ {SD, 0xFB8E}, - /* 6AA */ {SU, 0x0}, - /* 6AB */ {SU, 0x0}, - /* 6AC */ {SU, 0x0}, - /* 6AD */ {SD, 0xFBD3}, - /* 6AE */ {SU, 0x0}, - /* 6AF */ {SD, 0xFB92}, - /* 6B0 */ {SU, 0x0}, - /* 6B1 */ {SD, 0xFB9A}, - /* 6B2 */ {SU, 0x0}, - /* 6B3 */ {SD, 0xFB96}, - /* 6B4 */ {SU, 0x0}, - /* 6B5 */ {SU, 0x0}, - /* 6B6 */ {SU, 0x0}, - /* 6B7 */ {SU, 0x0}, - /* 6B8 */ {SU, 0x0}, - /* 6B9 */ {SU, 0x0}, - /* 6BA */ {SR, 0xFB9E}, - /* 6BB */ {SD, 0xFBA0}, - /* 6BC */ {SU, 0x0}, - /* 6BD */ {SU, 0x0}, - /* 6BE */ {SD, 0xFBAA}, - /* 6BF */ {SU, 0x0}, - /* 6C0 */ {SR, 0xFBA4}, - /* 6C1 */ {SD, 0xFBA6}, - /* 6C2 */ {SU, 0x0}, - /* 6C3 */ {SU, 0x0}, - /* 6C4 */ {SU, 0x0}, - /* 6C5 */ {SR, 0xFBE0}, - /* 6C6 */ {SR, 0xFBD9}, - /* 6C7 */ {SR, 0xFBD7}, - /* 6C8 */ {SR, 0xFBDB}, - /* 6C9 */ {SR, 0xFBE2}, - /* 6CA */ {SU, 0x0}, - /* 6CB */ {SR, 0xFBDE}, - /* 6CC */ {SD, 0xFBFC}, - /* 6CD */ {SU, 0x0}, - /* 6CE */ {SU, 0x0}, - /* 6CF */ {SU, 0x0}, - /* 6D0 */ {SU, 0x0}, - /* 6D1 */ {SU, 0x0}, - /* 6D2 */ {SR, 0xFBAE}, -}; - -/* - * Flips the text buffer, according to max level, and - * all higher levels - * - * Input: - * from: text buffer, on which to apply flipping - * level: resolved levels buffer - * max: the maximum level found in this line (should be unsigned char) - * count: line size in bidi_char - */ -static void flipThisRun( - bidi_char *from, unsigned char *level, int max, int count) -{ - int i, j, k, tlevel; - bidi_char temp; - - j = i = 0; - while (i j; k--, j++) { - temp = from[k]; - from[k] = from[j]; - from[j] = temp; - } - } -} - -/* - * Finds the index of a run with level equals tlevel - */ -static int findIndexOfRun( - unsigned char *level , int start, int count, int tlevel) -{ - int i; - for (i=start; i 1) { - k = (i + j) / 2; - if (ch < lookup[k].first) - j = k; - else if (ch > lookup[k].last) - i = k; - else - return lookup[k].type; - } - - /* - * If we reach here, the character was not in any of the - * intervals listed in the lookup table. This means we return - * ON (`Other Neutrals'). This is the appropriate code for any - * character genuinely not listed in the Unicode table, and - * also the table above has deliberately left out any - * characters _explicitly_ listed as ON (to save space!). - */ - return ON; -} - -/* - * Function exported to front ends to allow them to identify - * bidi-active characters (in case, for example, the platform's - * text display function can't conveniently be prevented from doing - * its own bidi and so special treatment is required for characters - * that would cause the bidi algorithm to activate). - * - * This function is passed a single Unicode code point, and returns - * nonzero if the presence of this code point can possibly cause - * the bidi algorithm to do any reordering. Thus, any string - * composed entirely of characters for which is_rtl() returns zero - * should be safe to pass to a bidi-active platform display - * function without fear. - * - * (is_rtl() must therefore also return true for any character - * which would be affected by Arabic shaping, but this isn't - * important because all such characters are right-to-left so it - * would have flagged them anyway.) - */ -bool is_rtl(int c) -{ - /* - * After careful reading of the Unicode bidi algorithm (URL as - * given at the top of this file) I believe that the only - * character classes which can possibly cause trouble are R, - * AL, RLE and RLO. I think that any string containing no - * character in any of those classes will be displayed - * uniformly left-to-right by the Unicode bidi algorithm. - */ - const int mask = (1< 0) { - unsigned char current = level[--from]; - - while (from >= 0 && level[from] == current) - from--; - - if (from >= 0) - return level[from]; - - return -1; - } else - return -1; -} - -/* The Main shaping function, and the only one to be used - * by the outside world. - * - * line: buffer to apply shaping to. this must be passed by doBidi() first - * to: output buffer for the shaped data - * count: number of characters in line - */ -int do_shape(bidi_char *line, bidi_char *to, int count) -{ - int i, tempShape; - bool ligFlag = false; - - for (i=0; i 0) switch (line[i-1].wc) { - case 0x622: - ligFlag = true; - if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) - to[i].wc = 0xFEF6; - else - to[i].wc = 0xFEF5; - break; - case 0x623: - ligFlag = true; - if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) - to[i].wc = 0xFEF8; - else - to[i].wc = 0xFEF7; - break; - case 0x625: - ligFlag = true; - if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) - to[i].wc = 0xFEFA; - else - to[i].wc = 0xFEF9; - break; - case 0x627: - ligFlag = true; - if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) - to[i].wc = 0xFEFC; - else - to[i].wc = 0xFEFB; - break; - } - if (ligFlag) { - to[i-1].wc = 0x20; - ligFlag = false; - break; - } - } - - if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) { - tempShape = (i > 0 ? STYPE(line[i-1].wc) : SU); - if ((tempShape == SR) || (tempShape == SD) || (tempShape == SC)) - to[i].wc = SMEDIAL((SISOLATED(line[i].wc))); - else - to[i].wc = SFINAL((SISOLATED(line[i].wc))); - break; - } - - tempShape = (i > 0 ? STYPE(line[i-1].wc) : SU); - if ((tempShape == SR) || (tempShape == SD) || (tempShape == SC)) - to[i].wc = SINITIAL((SISOLATED(line[i].wc))); - else - to[i].wc = SISOLATED(line[i].wc); - break; - - - } - } - return 1; -} - -/* - * The Main Bidi Function, and the only function that should - * be used by the outside world. - * - * line: a buffer of size count containing text to apply - * the Bidirectional algorithm to. - */ - -int do_bidi(bidi_char *line, int count) -{ - unsigned char* types; - unsigned char* levels; - unsigned char paragraphLevel; - unsigned char currentEmbedding; - unsigned char currentOverride; - unsigned char tempType; - int i, j; - bool yes, bover; - - /* Check the presence of R or AL types as optimization */ - yes = false; - for (i=0; i= 0) { - if (types[j] == AL) { - types[i] = AN; - break; - } else if (types[j] == R || types[j] == L) { - break; - } - j--; - } - } - } - - /* Rule (W3) - * W3. Change all ALs to R. - * - * Optimization: on Rule Xn, we might set a flag on AL type - * to prevent this loop in L R lines only... - */ - for (i=0; i 0 && types[i-1] == EN) { - types[i] = EN; - continue; - } else if (i < count-1 && types[i+1] == EN) { - types[i] = EN; - continue; - } else if (i < count-1 && types[i+1] == ET) { - j=i; - while (j < count-1 && types[j] == ET) { - j++; - } - if (types[j] == EN) - types[i] = EN; - } - } - } - - /* Rule (W6) - * W6. Otherwise, separators and terminators change to Other Neutral: - */ - for (i=0; i= 0) { - if (types[j] == L) { - types[i] = L; - break; - } else if (types[j] == R || types[j] == AL) { - break; - } - j--; - } - } - } - - /* Rule (N1) - * N1. A sequence of neutrals takes the direction of the surrounding - * strong text if the text on both sides has the same direction. European - * and Arabic numbers are treated as though they were R. - */ - if (count >= 2 && types[0] == ON) { - if ((types[1] == R) || (types[1] == EN) || (types[1] == AN)) - types[0] = R; - else if (types[1] == L) - types[0] = L; - } - for (i=1; i<(count-1); i++) { - if (types[i] == ON) { - if (types[i-1] == L) { - j=i; - while (j<(count-1) && types[j] == ON) { - j++; - } - if (types[j] == L) { - while (i= 2 && types[count-1] == ON) { - if (types[count-2] == R || types[count-2] == EN || types[count-2] == AN) - types[count-1] = R; - else if (types[count-2] == L) - types[count-1] = L; - } - - /* Rule (N2) - * N2. Any remaining neutrals take the embedding direction. - */ - for (i=0; i0 && (getType(line[j].wc) == WS)) { - j--; - } - if (j < (count-1)) { - for (j++; j=i ; j--) { - levels[j] = paragraphLevel; - } - } - } else if (tempType == B || tempType == S) { - levels[i] = paragraphLevel; - } - } - - /* Rule (L4) NOT IMPLEMENTED - * L4. A character that possesses the mirrored property as specified by - * Section 4.7, Mirrored, must be depicted by a mirrored glyph if the - * resolved directionality of that character is R. - */ - /* Note: this is implemented before L2 for efficiency */ - for (i=0; i tempType) - tempType = levels[i]; - i++; - } - /* maximum level in tempType. */ - while (tempType > 0) { /* loop from highest level to the least odd, */ - /* which i assume is 1 */ - flipThisRun(line, levels, tempType, count); - tempType--; - } - - /* Rule (L3) NOT IMPLEMENTED - * L3. Combining marks applied to a right-to-left base character will at - * this point precede their base character. If the rendering engine - * expects them to follow the base characters in the final display - * process, then the ordering of the marks and the base character must - * be reversed. - */ - sfree(types); - sfree(levels); - return R; -} - - -/* - * Bad, Horrible function - * takes a pointer to a character that is checked for - * having a mirror glyph. - */ -static void doMirror(unsigned int *ch) -{ - if ((*ch & 0xFF00) == 0) { - switch (*ch) { - case 0x0028: *ch = 0x0029; break; - case 0x0029: *ch = 0x0028; break; - case 0x003C: *ch = 0x003E; break; - case 0x003E: *ch = 0x003C; break; - case 0x005B: *ch = 0x005D; break; - case 0x005D: *ch = 0x005B; break; - case 0x007B: *ch = 0x007D; break; - case 0x007D: *ch = 0x007B; break; - case 0x00AB: *ch = 0x00BB; break; - case 0x00BB: *ch = 0x00AB; break; - } - } else if ((*ch & 0xFF00) == 0x2000) { - switch (*ch) { - case 0x2039: *ch = 0x203A; break; - case 0x203A: *ch = 0x2039; break; - case 0x2045: *ch = 0x2046; break; - case 0x2046: *ch = 0x2045; break; - case 0x207D: *ch = 0x207E; break; - case 0x207E: *ch = 0x207D; break; - case 0x208D: *ch = 0x208E; break; - case 0x208E: *ch = 0x208D; break; - } - } else if ((*ch & 0xFF00) == 0x2200) { - switch (*ch) { - case 0x2208: *ch = 0x220B; break; - case 0x2209: *ch = 0x220C; break; - case 0x220A: *ch = 0x220D; break; - case 0x220B: *ch = 0x2208; break; - case 0x220C: *ch = 0x2209; break; - case 0x220D: *ch = 0x220A; break; - case 0x2215: *ch = 0x29F5; break; - case 0x223C: *ch = 0x223D; break; - case 0x223D: *ch = 0x223C; break; - case 0x2243: *ch = 0x22CD; break; - case 0x2252: *ch = 0x2253; break; - case 0x2253: *ch = 0x2252; break; - case 0x2254: *ch = 0x2255; break; - case 0x2255: *ch = 0x2254; break; - case 0x2264: *ch = 0x2265; break; - case 0x2265: *ch = 0x2264; break; - case 0x2266: *ch = 0x2267; break; - case 0x2267: *ch = 0x2266; break; - case 0x2268: *ch = 0x2269; break; - case 0x2269: *ch = 0x2268; break; - case 0x226A: *ch = 0x226B; break; - case 0x226B: *ch = 0x226A; break; - case 0x226E: *ch = 0x226F; break; - case 0x226F: *ch = 0x226E; break; - case 0x2270: *ch = 0x2271; break; - case 0x2271: *ch = 0x2270; break; - case 0x2272: *ch = 0x2273; break; - case 0x2273: *ch = 0x2272; break; - case 0x2274: *ch = 0x2275; break; - case 0x2275: *ch = 0x2274; break; - case 0x2276: *ch = 0x2277; break; - case 0x2277: *ch = 0x2276; break; - case 0x2278: *ch = 0x2279; break; - case 0x2279: *ch = 0x2278; break; - case 0x227A: *ch = 0x227B; break; - case 0x227B: *ch = 0x227A; break; - case 0x227C: *ch = 0x227D; break; - case 0x227D: *ch = 0x227C; break; - case 0x227E: *ch = 0x227F; break; - case 0x227F: *ch = 0x227E; break; - case 0x2280: *ch = 0x2281; break; - case 0x2281: *ch = 0x2280; break; - case 0x2282: *ch = 0x2283; break; - case 0x2283: *ch = 0x2282; break; - case 0x2284: *ch = 0x2285; break; - case 0x2285: *ch = 0x2284; break; - case 0x2286: *ch = 0x2287; break; - case 0x2287: *ch = 0x2286; break; - case 0x2288: *ch = 0x2289; break; - case 0x2289: *ch = 0x2288; break; - case 0x228A: *ch = 0x228B; break; - case 0x228B: *ch = 0x228A; break; - case 0x228F: *ch = 0x2290; break; - case 0x2290: *ch = 0x228F; break; - case 0x2291: *ch = 0x2292; break; - case 0x2292: *ch = 0x2291; break; - case 0x2298: *ch = 0x29B8; break; - case 0x22A2: *ch = 0x22A3; break; - case 0x22A3: *ch = 0x22A2; break; - case 0x22A6: *ch = 0x2ADE; break; - case 0x22A8: *ch = 0x2AE4; break; - case 0x22A9: *ch = 0x2AE3; break; - case 0x22AB: *ch = 0x2AE5; break; - case 0x22B0: *ch = 0x22B1; break; - case 0x22B1: *ch = 0x22B0; break; - case 0x22B2: *ch = 0x22B3; break; - case 0x22B3: *ch = 0x22B2; break; - case 0x22B4: *ch = 0x22B5; break; - case 0x22B5: *ch = 0x22B4; break; - case 0x22B6: *ch = 0x22B7; break; - case 0x22B7: *ch = 0x22B6; break; - case 0x22C9: *ch = 0x22CA; break; - case 0x22CA: *ch = 0x22C9; break; - case 0x22CB: *ch = 0x22CC; break; - case 0x22CC: *ch = 0x22CB; break; - case 0x22CD: *ch = 0x2243; break; - case 0x22D0: *ch = 0x22D1; break; - case 0x22D1: *ch = 0x22D0; break; - case 0x22D6: *ch = 0x22D7; break; - case 0x22D7: *ch = 0x22D6; break; - case 0x22D8: *ch = 0x22D9; break; - case 0x22D9: *ch = 0x22D8; break; - case 0x22DA: *ch = 0x22DB; break; - case 0x22DB: *ch = 0x22DA; break; - case 0x22DC: *ch = 0x22DD; break; - case 0x22DD: *ch = 0x22DC; break; - case 0x22DE: *ch = 0x22DF; break; - case 0x22DF: *ch = 0x22DE; break; - case 0x22E0: *ch = 0x22E1; break; - case 0x22E1: *ch = 0x22E0; break; - case 0x22E2: *ch = 0x22E3; break; - case 0x22E3: *ch = 0x22E2; break; - case 0x22E4: *ch = 0x22E5; break; - case 0x22E5: *ch = 0x22E4; break; - case 0x22E6: *ch = 0x22E7; break; - case 0x22E7: *ch = 0x22E6; break; - case 0x22E8: *ch = 0x22E9; break; - case 0x22E9: *ch = 0x22E8; break; - case 0x22EA: *ch = 0x22EB; break; - case 0x22EB: *ch = 0x22EA; break; - case 0x22EC: *ch = 0x22ED; break; - case 0x22ED: *ch = 0x22EC; break; - case 0x22F0: *ch = 0x22F1; break; - case 0x22F1: *ch = 0x22F0; break; - case 0x22F2: *ch = 0x22FA; break; - case 0x22F3: *ch = 0x22FB; break; - case 0x22F4: *ch = 0x22FC; break; - case 0x22F6: *ch = 0x22FD; break; - case 0x22F7: *ch = 0x22FE; break; - case 0x22FA: *ch = 0x22F2; break; - case 0x22FB: *ch = 0x22F3; break; - case 0x22FC: *ch = 0x22F4; break; - case 0x22FD: *ch = 0x22F6; break; - case 0x22FE: *ch = 0x22F7; break; - } - } else if ((*ch & 0xFF00) == 0x2300) { - switch (*ch) { - case 0x2308: *ch = 0x2309; break; - case 0x2309: *ch = 0x2308; break; - case 0x230A: *ch = 0x230B; break; - case 0x230B: *ch = 0x230A; break; - case 0x2329: *ch = 0x232A; break; - case 0x232A: *ch = 0x2329; break; - } - } else if ((*ch & 0xFF00) == 0x2700) { - switch (*ch) { - case 0x2768: *ch = 0x2769; break; - case 0x2769: *ch = 0x2768; break; - case 0x276A: *ch = 0x276B; break; - case 0x276B: *ch = 0x276A; break; - case 0x276C: *ch = 0x276D; break; - case 0x276D: *ch = 0x276C; break; - case 0x276E: *ch = 0x276F; break; - case 0x276F: *ch = 0x276E; break; - case 0x2770: *ch = 0x2771; break; - case 0x2771: *ch = 0x2770; break; - case 0x2772: *ch = 0x2773; break; - case 0x2773: *ch = 0x2772; break; - case 0x2774: *ch = 0x2775; break; - case 0x2775: *ch = 0x2774; break; - case 0x27D5: *ch = 0x27D6; break; - case 0x27D6: *ch = 0x27D5; break; - case 0x27DD: *ch = 0x27DE; break; - case 0x27DE: *ch = 0x27DD; break; - case 0x27E2: *ch = 0x27E3; break; - case 0x27E3: *ch = 0x27E2; break; - case 0x27E4: *ch = 0x27E5; break; - case 0x27E5: *ch = 0x27E4; break; - case 0x27E6: *ch = 0x27E7; break; - case 0x27E7: *ch = 0x27E6; break; - case 0x27E8: *ch = 0x27E9; break; - case 0x27E9: *ch = 0x27E8; break; - case 0x27EA: *ch = 0x27EB; break; - case 0x27EB: *ch = 0x27EA; break; - } - } else if ((*ch & 0xFF00) == 0x2900) { - switch (*ch) { - case 0x2983: *ch = 0x2984; break; - case 0x2984: *ch = 0x2983; break; - case 0x2985: *ch = 0x2986; break; - case 0x2986: *ch = 0x2985; break; - case 0x2987: *ch = 0x2988; break; - case 0x2988: *ch = 0x2987; break; - case 0x2989: *ch = 0x298A; break; - case 0x298A: *ch = 0x2989; break; - case 0x298B: *ch = 0x298C; break; - case 0x298C: *ch = 0x298B; break; - case 0x298D: *ch = 0x2990; break; - case 0x298E: *ch = 0x298F; break; - case 0x298F: *ch = 0x298E; break; - case 0x2990: *ch = 0x298D; break; - case 0x2991: *ch = 0x2992; break; - case 0x2992: *ch = 0x2991; break; - case 0x2993: *ch = 0x2994; break; - case 0x2994: *ch = 0x2993; break; - case 0x2995: *ch = 0x2996; break; - case 0x2996: *ch = 0x2995; break; - case 0x2997: *ch = 0x2998; break; - case 0x2998: *ch = 0x2997; break; - case 0x29B8: *ch = 0x2298; break; - case 0x29C0: *ch = 0x29C1; break; - case 0x29C1: *ch = 0x29C0; break; - case 0x29C4: *ch = 0x29C5; break; - case 0x29C5: *ch = 0x29C4; break; - case 0x29CF: *ch = 0x29D0; break; - case 0x29D0: *ch = 0x29CF; break; - case 0x29D1: *ch = 0x29D2; break; - case 0x29D2: *ch = 0x29D1; break; - case 0x29D4: *ch = 0x29D5; break; - case 0x29D5: *ch = 0x29D4; break; - case 0x29D8: *ch = 0x29D9; break; - case 0x29D9: *ch = 0x29D8; break; - case 0x29DA: *ch = 0x29DB; break; - case 0x29DB: *ch = 0x29DA; break; - case 0x29F5: *ch = 0x2215; break; - case 0x29F8: *ch = 0x29F9; break; - case 0x29F9: *ch = 0x29F8; break; - case 0x29FC: *ch = 0x29FD; break; - case 0x29FD: *ch = 0x29FC; break; - } - } else if ((*ch & 0xFF00) == 0x2A00) { - switch (*ch) { - case 0x2A2B: *ch = 0x2A2C; break; - case 0x2A2C: *ch = 0x2A2B; break; - case 0x2A2D: *ch = 0x2A2C; break; - case 0x2A2E: *ch = 0x2A2D; break; - case 0x2A34: *ch = 0x2A35; break; - case 0x2A35: *ch = 0x2A34; break; - case 0x2A3C: *ch = 0x2A3D; break; - case 0x2A3D: *ch = 0x2A3C; break; - case 0x2A64: *ch = 0x2A65; break; - case 0x2A65: *ch = 0x2A64; break; - case 0x2A79: *ch = 0x2A7A; break; - case 0x2A7A: *ch = 0x2A79; break; - case 0x2A7D: *ch = 0x2A7E; break; - case 0x2A7E: *ch = 0x2A7D; break; - case 0x2A7F: *ch = 0x2A80; break; - case 0x2A80: *ch = 0x2A7F; break; - case 0x2A81: *ch = 0x2A82; break; - case 0x2A82: *ch = 0x2A81; break; - case 0x2A83: *ch = 0x2A84; break; - case 0x2A84: *ch = 0x2A83; break; - case 0x2A8B: *ch = 0x2A8C; break; - case 0x2A8C: *ch = 0x2A8B; break; - case 0x2A91: *ch = 0x2A92; break; - case 0x2A92: *ch = 0x2A91; break; - case 0x2A93: *ch = 0x2A94; break; - case 0x2A94: *ch = 0x2A93; break; - case 0x2A95: *ch = 0x2A96; break; - case 0x2A96: *ch = 0x2A95; break; - case 0x2A97: *ch = 0x2A98; break; - case 0x2A98: *ch = 0x2A97; break; - case 0x2A99: *ch = 0x2A9A; break; - case 0x2A9A: *ch = 0x2A99; break; - case 0x2A9B: *ch = 0x2A9C; break; - case 0x2A9C: *ch = 0x2A9B; break; - case 0x2AA1: *ch = 0x2AA2; break; - case 0x2AA2: *ch = 0x2AA1; break; - case 0x2AA6: *ch = 0x2AA7; break; - case 0x2AA7: *ch = 0x2AA6; break; - case 0x2AA8: *ch = 0x2AA9; break; - case 0x2AA9: *ch = 0x2AA8; break; - case 0x2AAA: *ch = 0x2AAB; break; - case 0x2AAB: *ch = 0x2AAA; break; - case 0x2AAC: *ch = 0x2AAD; break; - case 0x2AAD: *ch = 0x2AAC; break; - case 0x2AAF: *ch = 0x2AB0; break; - case 0x2AB0: *ch = 0x2AAF; break; - case 0x2AB3: *ch = 0x2AB4; break; - case 0x2AB4: *ch = 0x2AB3; break; - case 0x2ABB: *ch = 0x2ABC; break; - case 0x2ABC: *ch = 0x2ABB; break; - case 0x2ABD: *ch = 0x2ABE; break; - case 0x2ABE: *ch = 0x2ABD; break; - case 0x2ABF: *ch = 0x2AC0; break; - case 0x2AC0: *ch = 0x2ABF; break; - case 0x2AC1: *ch = 0x2AC2; break; - case 0x2AC2: *ch = 0x2AC1; break; - case 0x2AC3: *ch = 0x2AC4; break; - case 0x2AC4: *ch = 0x2AC3; break; - case 0x2AC5: *ch = 0x2AC6; break; - case 0x2AC6: *ch = 0x2AC5; break; - case 0x2ACD: *ch = 0x2ACE; break; - case 0x2ACE: *ch = 0x2ACD; break; - case 0x2ACF: *ch = 0x2AD0; break; - case 0x2AD0: *ch = 0x2ACF; break; - case 0x2AD1: *ch = 0x2AD2; break; - case 0x2AD2: *ch = 0x2AD1; break; - case 0x2AD3: *ch = 0x2AD4; break; - case 0x2AD4: *ch = 0x2AD3; break; - case 0x2AD5: *ch = 0x2AD6; break; - case 0x2AD6: *ch = 0x2AD5; break; - case 0x2ADE: *ch = 0x22A6; break; - case 0x2AE3: *ch = 0x22A9; break; - case 0x2AE4: *ch = 0x22A8; break; - case 0x2AE5: *ch = 0x22AB; break; - case 0x2AEC: *ch = 0x2AED; break; - case 0x2AED: *ch = 0x2AEC; break; - case 0x2AF7: *ch = 0x2AF8; break; - case 0x2AF8: *ch = 0x2AF7; break; - case 0x2AF9: *ch = 0x2AFA; break; - case 0x2AFA: *ch = 0x2AF9; break; - } - } else if ((*ch & 0xFF00) == 0x3000) { - switch (*ch) { - case 0x3008: *ch = 0x3009; break; - case 0x3009: *ch = 0x3008; break; - case 0x300A: *ch = 0x300B; break; - case 0x300B: *ch = 0x300A; break; - case 0x300C: *ch = 0x300D; break; - case 0x300D: *ch = 0x300C; break; - case 0x300E: *ch = 0x300F; break; - case 0x300F: *ch = 0x300E; break; - case 0x3010: *ch = 0x3011; break; - case 0x3011: *ch = 0x3010; break; - case 0x3014: *ch = 0x3015; break; - case 0x3015: *ch = 0x3014; break; - case 0x3016: *ch = 0x3017; break; - case 0x3017: *ch = 0x3016; break; - case 0x3018: *ch = 0x3019; break; - case 0x3019: *ch = 0x3018; break; - case 0x301A: *ch = 0x301B; break; - case 0x301B: *ch = 0x301A; break; - } - } else if ((*ch & 0xFF00) == 0xFF00) { - switch (*ch) { - case 0xFF08: *ch = 0xFF09; break; - case 0xFF09: *ch = 0xFF08; break; - case 0xFF1C: *ch = 0xFF1E; break; - case 0xFF1E: *ch = 0xFF1C; break; - case 0xFF3B: *ch = 0xFF3D; break; - case 0xFF3D: *ch = 0xFF3B; break; - case 0xFF5B: *ch = 0xFF5D; break; - case 0xFF5D: *ch = 0xFF5B; break; - case 0xFF5F: *ch = 0xFF60; break; - case 0xFF60: *ch = 0xFF5F; break; - case 0xFF62: *ch = 0xFF63; break; - case 0xFF63: *ch = 0xFF62; break; - } - } -} - -#ifdef TEST_GETTYPE - -#include -#include - -int main(int argc, char **argv) -{ - static const struct { int type; char *name; } typetoname[] = { -#define TYPETONAME(X) { X , #X } - TYPETONAME(L), - TYPETONAME(LRE), - TYPETONAME(LRO), - TYPETONAME(R), - TYPETONAME(AL), - TYPETONAME(RLE), - TYPETONAME(RLO), - TYPETONAME(PDF), - TYPETONAME(EN), - TYPETONAME(ES), - TYPETONAME(ET), - TYPETONAME(AN), - TYPETONAME(CS), - TYPETONAME(NSM), - TYPETONAME(BN), - TYPETONAME(B), - TYPETONAME(S), - TYPETONAME(WS), - TYPETONAME(ON), -#undef TYPETONAME - }; - int i; - - for (i = 1; i < argc; i++) { - unsigned long chr = strtoul(argv[i], NULL, 0); - int type = getType(chr); - assert(typetoname[type].type == type); - printf("U+%04x: %s\n", (unsigned)chr, typetoname[type].name); - } - - return 0; -} - -#endif diff --git a/code/misc.c b/code/misc.c deleted file mode 100644 index 82a1d77..0000000 --- a/code/misc.c +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Platform-independent routines shared between all PuTTY programs. - * - * This file contains functions that use the kind of infrastructure - * like conf.c that tends to only live in the main applications, or - * that do things that only something like a main PuTTY application - * would need. So standalone test programs should generally be able to - * avoid linking against it. - * - * More standalone functions that depend on nothing but the C library - * live in utils.c. - */ - -#include -#include -#include -#include -#include -#include - -#include "defs.h" -#include "putty.h" -#include "misc.h" - -#define BASE64_CHARS_NOEQ \ - "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/" -#define BASE64_CHARS_ALL BASE64_CHARS_NOEQ "=" - -void seat_connection_fatal(Seat *seat, const char *fmt, ...) -{ - va_list ap; - char *msg; - - va_start(ap, fmt); - msg = dupvprintf(fmt, ap); - va_end(ap); - - seat->vt->connection_fatal(seat, msg); - sfree(msg); /* if we return */ -} - -prompts_t *new_prompts(void) -{ - prompts_t *p = snew(prompts_t); - p->prompts = NULL; - p->n_prompts = p->prompts_size = 0; - p->data = NULL; - p->to_server = true; /* to be on the safe side */ - p->name = p->instruction = NULL; - p->name_reqd = p->instr_reqd = false; - return p; -} -void add_prompt(prompts_t *p, char *promptstr, bool echo) -{ - prompt_t *pr = snew(prompt_t); - pr->prompt = promptstr; - pr->echo = echo; - pr->result = strbuf_new_nm(); - sgrowarray(p->prompts, p->prompts_size, p->n_prompts); - p->prompts[p->n_prompts++] = pr; -} -void prompt_set_result(prompt_t *pr, const char *newstr) -{ - strbuf_clear(pr->result); - put_datapl(pr->result, ptrlen_from_asciz(newstr)); -} -const char *prompt_get_result_ref(prompt_t *pr) -{ - return pr->result->s; -} -char *prompt_get_result(prompt_t *pr) -{ - return dupstr(pr->result->s); -} -void free_prompts(prompts_t *p) -{ - size_t i; - for (i=0; i < p->n_prompts; i++) { - prompt_t *pr = p->prompts[i]; - strbuf_free(pr->result); - sfree(pr->prompt); - sfree(pr); - } - sfree(p->prompts); - sfree(p->name); - sfree(p->instruction); - sfree(p); -} - -/* - * Determine whether or not a Conf represents a session which can - * sensibly be launched right now. - */ -bool conf_launchable(Conf *conf) -{ - if (conf_get_int(conf, CONF_protocol) == PROT_SERIAL) - return conf_get_str(conf, CONF_serline)[0] != 0; - else - return conf_get_str(conf, CONF_host)[0] != 0; -} - -char const *conf_dest(Conf *conf) -{ - if (conf_get_int(conf, CONF_protocol) == PROT_SERIAL) - return conf_get_str(conf, CONF_serline); - else - return conf_get_str(conf, CONF_host); -} - -/* - * Validate a manual host key specification (either entered in the - * GUI, or via -hostkey). If valid, we return true, and update 'key' - * to contain a canonicalised version of the key string in 'key' - * (which is guaranteed to take up at most as much space as the - * original version), suitable for putting into the Conf. If not - * valid, we return false. - */ -bool validate_manual_hostkey(char *key) -{ - char *p, *q, *r, *s; - - /* - * Step through the string word by word, looking for a word that's - * in one of the formats we like. - */ - p = key; - while ((p += strspn(p, " \t"))[0]) { - q = p; - p += strcspn(p, " \t"); - if (*p) *p++ = '\0'; - - /* - * Now q is our word. - */ - - if (strstartswith(q, "SHA256:")) { - /* Test for a valid SHA256 key fingerprint. */ - r = q + 7; - if (strlen(r) == 43 && r[strspn(r, BASE64_CHARS_NOEQ)] == 0) - return true; - } - - r = q; - if (strstartswith(r, "MD5:")) - r += 4; - if (strlen(r) == 16*3 - 1 && - r[strspn(r, "0123456789abcdefABCDEF:")] == 0) { - /* - * Test for a valid MD5 key fingerprint. Check the colons - * are in the right places, and if so, return the same - * fingerprint canonicalised into lowercase. - */ - int i; - for (i = 0; i < 16; i++) - if (r[3*i] == ':' || r[3*i+1] == ':') - goto not_fingerprint; /* sorry */ - for (i = 0; i < 15; i++) - if (r[3*i+2] != ':') - goto not_fingerprint; /* sorry */ - for (i = 0; i < 16*3 - 1; i++) - key[i] = tolower(r[i]); - key[16*3 - 1] = '\0'; - return true; - } - not_fingerprint:; - - /* - * Before we check for a public-key blob, trim newlines out of - * the middle of the word, in case someone's managed to paste - * in a public-key blob _with_ them. - */ - for (r = s = q; *r; r++) - if (*r != '\n' && *r != '\r') - *s++ = *r; - *s = '\0'; - - if (strlen(q) % 4 == 0 && strlen(q) > 2*4 && - q[strspn(q, BASE64_CHARS_ALL)] == 0) { - /* - * Might be a base64-encoded SSH-2 public key blob. Check - * that it starts with a sensible algorithm string. No - * canonicalisation is necessary for this string type. - * - * The algorithm string must be at most 64 characters long - * (RFC 4251 section 6). - */ - unsigned char decoded[6]; - unsigned alglen; - int minlen; - int len = 0; - - len += base64_decode_atom(q, decoded+len); - if (len < 3) - goto not_ssh2_blob; /* sorry */ - len += base64_decode_atom(q+4, decoded+len); - if (len < 4) - goto not_ssh2_blob; /* sorry */ - - alglen = GET_32BIT_MSB_FIRST(decoded); - if (alglen > 64) - goto not_ssh2_blob; /* sorry */ - - minlen = ((alglen + 4) + 2) / 3; - if (strlen(q) < minlen) - goto not_ssh2_blob; /* sorry */ - - strcpy(key, q); - return true; - } - not_ssh2_blob:; - } - - return false; -} - -char *buildinfo(const char *newline) -{ - strbuf *buf = strbuf_new(); - - strbuf_catf(buf, "Build platform: %d-bit %s", - (int)(CHAR_BIT * sizeof(void *)), - BUILDINFO_PLATFORM); - -#ifdef __clang_version__ -#define FOUND_COMPILER - strbuf_catf(buf, "%sCompiler: clang %s", newline, __clang_version__); -#elif defined __GNUC__ && defined __VERSION__ -#define FOUND_COMPILER - strbuf_catf(buf, "%sCompiler: gcc %s", newline, __VERSION__); -#endif - -#if defined _MSC_VER -#ifndef FOUND_COMPILER -#define FOUND_COMPILER - strbuf_catf(buf, "%sCompiler: ", newline); -#else - strbuf_catf(buf, ", emulating "); -#endif - strbuf_catf(buf, "Visual Studio"); - -#if 0 - /* - * List of _MSC_VER values and their translations taken from - * https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros - * - * The pointless #if 0 branch containing this comment is there so - * that every real clause can start with #elif and there's no - * anomalous first clause. That way the patch looks nicer when you - * add extra ones. - */ -#elif _MSC_VER == 1928 && _MSC_FULL_VER >= 192829500 - /* - * 16.9 and 16.8 have the same _MSC_VER value, and have to be - * distinguished by _MSC_FULL_VER. As of 2021-03-04 that is not - * mentioned on the above page, but see e.g. - * https://developercommunity.visualstudio.com/t/the-169-cc-compiler-still-uses-the-same-version-nu/1335194#T-N1337120 - * which says that 16.9 builds will have versions starting at - * 19.28.29500.* and going up. Hence, 19 28 29500 is what we - * compare _MSC_FULL_VER against above. - */ - strbuf_catf(buf, " 2019 (16.9)"); -#elif _MSC_VER == 1928 - strbuf_catf(buf, " 2019 (16.8)"); -#elif _MSC_VER == 1927 - strbuf_catf(buf, " 2019 (16.7)"); -#elif _MSC_VER == 1926 - strbuf_catf(buf, " 2019 (16.6)"); -#elif _MSC_VER == 1925 - strbuf_catf(buf, " 2019 (16.5)"); -#elif _MSC_VER == 1924 - strbuf_catf(buf, " 2019 (16.4)"); -#elif _MSC_VER == 1923 - strbuf_catf(buf, " 2019 (16.3)"); -#elif _MSC_VER == 1922 - strbuf_catf(buf, " 2019 (16.2)"); -#elif _MSC_VER == 1921 - strbuf_catf(buf, " 2019 (16.1)"); -#elif _MSC_VER == 1920 - strbuf_catf(buf, " 2019 (16.0)"); -#elif _MSC_VER == 1916 - strbuf_catf(buf, " 2017 version 15.9"); -#elif _MSC_VER == 1915 - strbuf_catf(buf, " 2017 version 15.8"); -#elif _MSC_VER == 1914 - strbuf_catf(buf, " 2017 version 15.7"); -#elif _MSC_VER == 1913 - strbuf_catf(buf, " 2017 version 15.6"); -#elif _MSC_VER == 1912 - strbuf_catf(buf, " 2017 version 15.5"); -#elif _MSC_VER == 1911 - strbuf_catf(buf, " 2017 version 15.3"); -#elif _MSC_VER == 1910 - strbuf_catf(buf, " 2017 RTW (15.0)"); -#elif _MSC_VER == 1900 - strbuf_catf(buf, " 2015 (14.0)"); -#elif _MSC_VER == 1800 - strbuf_catf(buf, " 2013 (12.0)"); -#elif _MSC_VER == 1700 - strbuf_catf(buf, " 2012 (11.0)"); -#elif _MSC_VER == 1600 - strbuf_catf(buf, " 2010 (10.0)"); -#elif _MSC_VER == 1500 - strbuf_catf(buf, " 2008 (9.0)"); -#elif _MSC_VER == 1400 - strbuf_catf(buf, " 2005 (8.0)"); -#elif _MSC_VER == 1310 - strbuf_catf(buf, " .NET 2003 (7.1)"); -#elif _MSC_VER == 1300 - strbuf_catf(buf, " .NET 2002 (7.0)"); -#elif _MSC_VER == 1200 - strbuf_catf(buf, " 6.0"); -#else -#ifdef PUTTY_CAC -#if _MSC_VER == 1929 && _MSC_FULL_VER >= 192930133 - strbuf_catf(buf, " 2019 (16.11)"); -#elif _MSC_VER == 1929 - strbuf_catf(buf, " 2019 (16.10)"); -#elif _MSC_VER == 1930 - strbuf_catf(buf, " 2022 (17.0)"); -#endif -#else - strbuf_catf(buf, ", unrecognised version"); -#endif // PUTTY_CAC -#endif - strbuf_catf(buf, ", _MSC_VER=%d", (int)_MSC_VER); -#endif - -#ifdef BUILDINFO_GTK - { - char *gtk_buildinfo = buildinfo_gtk_version(); - if (gtk_buildinfo) { - strbuf_catf(buf, "%sCompiled against GTK version %s", - newline, gtk_buildinfo); - sfree(gtk_buildinfo); - } - } -#endif -#if defined _WINDOWS - { - int echm = has_embedded_chm(); - if (echm >= 0) - strbuf_catf(buf, "%sEmbedded HTML Help file: %s", newline, - echm ? "yes" : "no"); - } -#endif - -#if defined _WINDOWS && defined MINEFIELD - strbuf_catf(buf, "%sBuild option: MINEFIELD", newline); -#endif -#ifdef NO_SECURITY - strbuf_catf(buf, "%sBuild option: NO_SECURITY", newline); -#endif -#ifdef NO_SECUREZEROMEMORY - strbuf_catf(buf, "%sBuild option: NO_SECUREZEROMEMORY", newline); -#endif -#ifdef NO_IPV6 - strbuf_catf(buf, "%sBuild option: NO_IPV6", newline); -#endif -#ifdef NO_GSSAPI - strbuf_catf(buf, "%sBuild option: NO_GSSAPI", newline); -#endif -#ifdef STATIC_GSSAPI - strbuf_catf(buf, "%sBuild option: STATIC_GSSAPI", newline); -#endif -#ifdef UNPROTECT - strbuf_catf(buf, "%sBuild option: UNPROTECT", newline); -#endif -#ifdef FUZZING - strbuf_catf(buf, "%sBuild option: FUZZING", newline); -#endif -#ifdef DEBUG - strbuf_catf(buf, "%sBuild option: DEBUG", newline); -#endif - - strbuf_catf(buf, "%sSource commit: %s", newline, commitid); - - return strbuf_to_str(buf); -} - -size_t nullseat_output( - Seat *seat, bool is_stderr, const void *data, size_t len) { return 0; } -bool nullseat_eof(Seat *seat) { return true; } -int nullseat_get_userpass_input( - Seat *seat, prompts_t *p, bufchain *input) { return 0; } -void nullseat_notify_remote_exit(Seat *seat) {} -void nullseat_connection_fatal(Seat *seat, const char *message) {} -void nullseat_update_specials_menu(Seat *seat) {} -char *nullseat_get_ttymode(Seat *seat, const char *mode) { return NULL; } -void nullseat_set_busy_status(Seat *seat, BusyStatus status) {} -int nullseat_verify_ssh_host_key( - Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **key_fingerprints, - void (*callback)(void *ctx, int result), void *ctx) { return 0; } -int nullseat_confirm_weak_crypto_primitive( - Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx) { return 0; } -int nullseat_confirm_weak_cached_hostkey( - Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx) { return 0; } -bool nullseat_is_never_utf8(Seat *seat) { return false; } -bool nullseat_is_always_utf8(Seat *seat) { return true; } -void nullseat_echoedit_update(Seat *seat, bool echoing, bool editing) {} -const char *nullseat_get_x_display(Seat *seat) { return NULL; } -bool nullseat_get_windowid(Seat *seat, long *id_out) { return false; } -bool nullseat_get_window_pixel_size( - Seat *seat, int *width, int *height) { return false; } -StripCtrlChars *nullseat_stripctrl_new( - Seat *seat, BinarySink *bs_out, SeatInteractionContext sic) {return NULL;} -bool nullseat_set_trust_status(Seat *seat, bool tr) { return false; } -bool nullseat_set_trust_status_vacuously(Seat *seat, bool tr) { return true; } -bool nullseat_verbose_no(Seat *seat) { return false; } -bool nullseat_verbose_yes(Seat *seat) { return true; } -bool nullseat_interactive_no(Seat *seat) { return false; } -bool nullseat_interactive_yes(Seat *seat) { return true; } -bool nullseat_get_cursor_position(Seat *seat, int *x, int *y) { return false; } - -bool null_lp_verbose_no(LogPolicy *lp) { return false; } -bool null_lp_verbose_yes(LogPolicy *lp) { return true; } - -void sk_free_peer_info(SocketPeerInfo *pi) -{ - if (pi) { - sfree((char *)pi->addr_text); - sfree((char *)pi->log_text); - sfree(pi); - } -} - -void out_of_memory(void) -{ - modalfatalbox("Out of memory"); -} diff --git a/code/misc.h b/code/misc.h index 7b4012b..dea7190 100644 --- a/code/misc.h +++ b/code/misc.h @@ -1,5 +1,6 @@ /* - * Header for misc.c. + * Header for miscellaneous helper functions, mostly defined in the + * utils subdirectory. */ #ifndef PUTTY_MISC_H @@ -33,7 +34,7 @@ void burnstr(char *string); /* * The visible part of a strbuf structure. There's a surrounding - * implementation struct in misc.c, which isn't exposed to client + * implementation struct in strbuf.c, which isn't exposed to client * code. */ struct strbuf { @@ -56,8 +57,6 @@ void *strbuf_append(strbuf *buf, size_t len); void strbuf_shrink_to(strbuf *buf, size_t new_len); void strbuf_shrink_by(strbuf *buf, size_t amount_to_remove); char *strbuf_to_str(strbuf *buf); /* does free buf, but you must free result */ -void strbuf_catf(strbuf *buf, const char *fmt, ...) PRINTF_LIKE(2, 3); -void strbuf_catfv(strbuf *buf, const char *fmt, va_list ap); static inline void strbuf_clear(strbuf *buf) { strbuf_shrink_to(buf, 0); } bool strbuf_chomp(strbuf *buf, char char_to_remove); @@ -65,13 +64,13 @@ strbuf *strbuf_new_for_agent_query(void); void strbuf_finalise_agent_query(strbuf *buf); /* String-to-Unicode converters that auto-allocate the destination and - * work around the rather deficient interface of mb_to_wc. - * - * These actually live in miscucs.c, not misc.c (the distinction being - * that the former is only linked into tools that also have the main - * Unicode support). */ + * work around the rather deficient interface of mb_to_wc. */ wchar_t *dup_mb_to_wc_c(int codepage, int flags, const char *string, int len); wchar_t *dup_mb_to_wc(int codepage, int flags, const char *string); +char *dup_wc_to_mb_c(int codepage, int flags, const wchar_t *string, int len, + const char *defchr, struct unicode_data *ucsdata); +char *dup_wc_to_mb(int codepage, int flags, const wchar_t *string, + const char *defchr, struct unicode_data *ucsdata); static inline int toint(unsigned u) { @@ -123,6 +122,8 @@ ptrlen bufchain_prefix(bufchain *ch); void bufchain_consume(bufchain *ch, size_t len); void bufchain_fetch(bufchain *ch, void *data, size_t len); void bufchain_fetch_consume(bufchain *ch, void *data, size_t len); +bool bufchain_try_consume(bufchain *ch, size_t len); +bool bufchain_try_fetch(bufchain *ch, void *data, size_t len); bool bufchain_try_fetch_consume(bufchain *ch, void *data, size_t len); size_t bufchain_fetch_consume_up_to(bufchain *ch, void *data, size_t len); void bufchain_set_callback_inner( @@ -132,9 +133,9 @@ static inline void bufchain_set_callback(bufchain *ch, IdempotentCallback *ic) { extern void queue_idempotent_callback(struct IdempotentCallback *ic); /* Wrapper that puts in the standard queue_idempotent_callback - * function. Lives here rather than in utils.c so that standalone - * programs can use the bufchain facility without this optional - * callback feature and not need to provide a stub of + * function. Lives here rather than in bufchain.c so that + * standalone programs can use the bufchain facility without this + * optional callback feature and not need to provide a stub of * queue_idempotent_callback. */ bufchain_set_callback_inner(ch, ic, queue_idempotent_callback); } @@ -215,6 +216,22 @@ bool smemeq(const void *av, const void *bv, size_t len); * been removed. */ size_t encode_utf8(void *output, unsigned long ch); +/* Encode a wide-character string into UTF-8. Tolerates surrogates if + * sizeof(wchar_t) == 2, assuming that in that case the wide string is + * encoded in UTF-16. */ +char *encode_wide_string_as_utf8(const wchar_t *wstr); + +/* Decode a single UTF-8 character. Returns U+FFFD for any of the + * illegal cases. */ +unsigned long decode_utf8(const char **utf8); + +/* Decode a single UTF-8 character to an output buffer of the + * platform's wchar_t. May write a pair of surrogates if + * sizeof(wchar_t) == 2, assuming that in that case the wide string is + * encoded in UTF-16. Otherwise, writes one character. Returns the + * number written. */ +size_t decode_utf8_to_wchar(const char **utf8, wchar_t *out); + /* Write a string out in C string-literal format. */ void write_c_string_literal(FILE *fp, ptrlen str); @@ -374,6 +391,22 @@ static inline void PUT_16BIT_MSB_FIRST(void *vp, uint16_t value) p[0] = (uint8_t)(value >> 8); } +/* For use in X11-related applications, an endianness-variable form of + * {GET,PUT}_16BIT which expects 'endian' to be either 'B' or 'l' */ + +static inline uint16_t GET_16BIT_X11(char endian, const void *p) +{ + return endian == 'B' ? GET_16BIT_MSB_FIRST(p) : GET_16BIT_LSB_FIRST(p); +} + +static inline void PUT_16BIT_X11(char endian, void *p, uint16_t value) +{ + if (endian == 'B') + PUT_16BIT_MSB_FIRST(p, value); + else + PUT_16BIT_LSB_FIRST(p, value); +} + /* Replace NULL with the empty string, permitting an idiom in which we * get a string (pointer,length) pair that might be NULL,0 and can * then safely say things like printf("%.*s", length, NULLTOEMPTY(ptr)) */ diff --git a/code/missing b/code/missing deleted file mode 100644 index 625aeb1..0000000 --- a/code/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/code/mkauto.sh b/code/mkauto.sh deleted file mode 100644 index 9759438..0000000 --- a/code/mkauto.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh -# This script makes the autoconf mechanism for the Unix port work. -# It's separate from mkfiles.pl because it won't work (and isn't needed) -# on a non-Unix system. - -# It's nice to be able to run this from inside the unix subdir as -# well as from outside. -test -f unix.h && cd .. - -# Run autoconf on our real configure.in. -autoreconf -i && rm -rf autom4te.cache diff --git a/code/mkfiles.pl b/code/mkfiles.pl deleted file mode 100644 index b323e87..0000000 --- a/code/mkfiles.pl +++ /dev/null @@ -1,2092 +0,0 @@ -#!/usr/bin/env perl -# -# Cross-platform Makefile generator. -# -# Reads the file `Recipe' to determine the list of generated -# executables and their component objects. Then reads the source -# files to compute #include dependencies. Finally, writes out the -# various target Makefiles. - -# PuTTY specifics which could still do with removing: -# - Mac makefile is not portabilised at all. Include directories -# are hardwired, and also the libraries are fixed. This is -# mainly because I was too scared to go anywhere near it. -# - sbcsgen.pl is still run at startup. -# -# FIXME: no attempt made to handle !forceobj in the project files. - -use warnings; -use FileHandle; -use File::Basename; -use Cwd; -use Digest::SHA qw(sha512_hex); - -if ($#ARGV >= 0 and ($ARGV[0] eq "-u" or $ARGV[0] eq "-U")) { - # Convenience for Unix users: -u means that after we finish what - # we're doing here, we also run mkauto.sh and then 'configure' in - # the Unix subdirectory. So it's a one-stop shop for regenerating - # the actual end-product Unix makefile. - # - # Arguments supplied after -u go to configure. - # - # -U is identical, but runs 'configure' at the _top_ level, for - # people who habitually do that. - $do_unix = ($ARGV[0] eq "-U" ? 2 : 1); - shift @ARGV; - @confargs = @ARGV; -} - -open IN, "Recipe" or do { - # We want to deal correctly with being run from one of the - # subdirs in the source tree. So if we can't find Recipe here, - # try one level up. - chdir ".."; - open IN, "Recipe" or die "unable to open Recipe file\n"; -}; - -# HACK: One of the source files in `charset' is auto-generated by -# sbcsgen.pl, and licence.h is likewise generated by licence.pl. We -# need to generate those _now_, before attempting dependency analysis. -eval 'chdir "charset"; require "./sbcsgen.pl"; chdir ".."; select STDOUT;'; -eval 'require "./licence.pl"; select STDOUT;'; - -@srcdirs = ("./"); - -$divert = undef; # ref to scalar in which text is currently being put -$help = ""; # list of newline-free lines of help text -$project_name = "project"; # this is a good enough default -%makefiles = (); # maps makefile types to output makefile pathnames -%makefile_extra = (); # maps makefile types to extra Makefile text -%programs = (); # maps prog name + type letter to listref of objects/resources -%groups = (); # maps group name to listref of objects/resources - -while () { - chomp; - @_ = split; - - # If we're gathering help text, keep doing so. - if (defined $divert) { - if ((defined $_[0]) && $_[0] eq "!end") { - $divert = undef; - } else { - ${$divert} .= "$_\n"; - } - next; - } - # Skip comments and blank lines. - next if /^\s*#/ or scalar @_ == 0; - - if ($_[0] eq "!begin" and $_[1] eq "help") { $divert = \$help; next; } - if ($_[0] eq "!end") { $divert = undef; next; } - if ($_[0] eq "!name") { $project_name = $_[1]; next; } - if ($_[0] eq "!srcdir") { push @srcdirs, $_[1]; next; } - if ($_[0] eq "!makefile" and &mfval($_[1])) { $makefiles{$_[1]}=$_[2]; next;} - if ($_[0] eq "!specialobj" and &mfval($_[1])) { $specialobj{$_[1]}->{$_[2]} = 1; next;} - if ($_[0] eq "!cflags" and &mfval($_[1])) { - ($rest = $_) =~ s/^\s*\S+\s+\S+\s+\S+\s*//; # find rest of input line - if ($rest eq "") { - # Make sure this file doesn't get lumped together with any - # other file's cflags. - $rest = "F" . $_[2]; - } else { - # Give this file a specific set of cflags, but permit it to - # go together with other files using the same set. - $rest = "C" . $rest; - } - $cflags{$_[1]}->{$_[2]} = $rest; - next; - } - if ($_[0] eq "!forceobj") { $forceobj{$_[1]} = 1; next; } - if ($_[0] eq "!begin") { - if ($_[1] =~ /^>(.*)/) { - $divert = \$auxfiles{$1}; - } elsif (&mfval($_[1])) { - $sect = $_[2] ? $_[2] : "end"; - $divert = \($makefile_extra{$_[1]}->{$sect}); - } else { - $dummy = ''; - $divert = \$dummy; - } - next; - } - # If we're gathering help/verbatim text, keep doing so. - if (defined $divert) { ${$divert} .= "$_\n"; next; } - # Ignore blank lines. - next if scalar @_ == 0; - - # Now we have an ordinary line. See if it's an = line, a : line - # or a + line. - @objs = @_; - - if ($_[0] eq "+") { - $listref = $lastlistref; - $prog = undef; - die "$.: unexpected + line\n" if !defined $lastlistref; - } elsif ($#_ >= 1 && $_[1] eq "=") { - $groups{$_[0]} = [] if !defined $groups{$_[0]}; - $listref = $groups{$_[0]}; - $prog = undef; - shift @objs; # eat the group name - } elsif ($#_ >= 1 && $_[1] eq ":") { - $listref = []; - $prog = $_[0]; - shift @objs; # eat the program name - } else { - die "$.: unrecognised line type\n"; - } - shift @objs; # eat the +, the = or the : - - while (scalar @objs > 0) { - $i = shift @objs; - if ($groups{$i}) { - foreach $j (@{$groups{$i}}) { unshift @objs, $j; } - } elsif (($i =~ /^\[([A-Z]*)\]$/) and defined $prog) { - $type = substr($i,1,(length $i)-2); - die "unrecognised program type for $prog [$type]\n" - if ! grep { $type eq $_ } qw(G C X U MX XT UT); - } else { - push @$listref, $i; - } - } - if ($prog and $type) { - die "multiple program entries for $prog [$type]\n" - if defined $programs{$prog . "," . $type}; - $programs{$prog . "," . $type} = $listref; - } - $lastlistref = $listref; -} - -close IN; - -foreach $aux (sort keys %auxfiles) { - open AUX, ">$aux"; - print AUX $auxfiles{$aux}; - close AUX; -} - -# Now retrieve the complete list of objects and resource files, and -# construct dependency data for them. While we're here, expand the -# object list for each program, and complain if its type isn't set. -@prognames = sort keys %programs; -%depends = (); -@scanlist = (); -foreach $i (@prognames) { - ($prog, $type) = split ",", $i; - # Strip duplicate object names. - $prev = ''; - @list = grep { $status = ($prev ne $_); $prev=$_; $status } - sort @{$programs{$i}}; - $programs{$i} = [@list]; - foreach $j (@list) { - # Dependencies for "x" start with "x.c" or "x.m" (depending on - # which one exists). - # Dependencies for "x.res" start with "x.rc". - # Dependencies for "x.rsrc" start with "x.r". - # Both types of file are pushed on the list of files to scan. - # Libraries (.lib) don't have dependencies at all. - if ($j =~ /^(.*)\.res$/) { - $file = "$1.rc"; - $depends{$j} = [$file]; - push @scanlist, $file; - } elsif ($j =~ /^(.*)\.rsrc$/) { - $file = "$1.r"; - $depends{$j} = [$file]; - push @scanlist, $file; - } elsif ($j !~ /\./) { - $file = "$j.c"; - $file = "$j.m" unless &findfile($file); - $depends{$j} = [$file]; - push @scanlist, $file; - } - } -} - -# Scan each file on @scanlist and find further inclusions. -# Inclusions are given by lines of the form `#include "otherfile"' -# (system headers are automatically ignored by this because they'll -# be given in angle brackets). Files included by this method are -# added back on to @scanlist to be scanned in turn (if not already -# done). -# -# Resource scripts (.rc) can also include a file by means of: -# - a line # ending `ICON "filename"'; -# - a line ending `RT_MANIFEST "filename"'. -# Files included by this method are not added to @scanlist because -# they can never include further files. -# -# In this pass we write out a hash %further which maps a source -# file name into a listref containing further source file names. - -%further = (); -%allsourcefiles = (); # this is wanted by some makefiles -while (scalar @scanlist > 0) { - $file = shift @scanlist; - next if defined $further{$file}; # skip if we've already done it - $further{$file} = []; - $dirfile = &findfile($file); - $allsourcefiles{$dirfile} = 1; - open IN, "$dirfile" or die "unable to open source file $file\n"; - while () { - chomp; - /^\s*#include\s+\"([^\"]+)\"/ and do { - push @{$further{$file}}, $1; - push @scanlist, $1; - next; - }; - /(RT_MANIFEST|ICON)\s+\"([^\"]+)\"\s*$/ and do { - push @{$further{$file}}, $2; - next; - } - } - close IN; -} - -# Now we're ready to generate the final dependencies section. For -# each key in %depends, we must expand the dependencies list by -# iteratively adding entries from %further. -foreach $i (keys %depends) { - %dep = (); - @scanlist = @{$depends{$i}}; - foreach $i (@scanlist) { $dep{$i} = 1; } - while (scalar @scanlist > 0) { - $file = shift @scanlist; - foreach $j (@{$further{$file}}) { - if (!$dep{$j}) { - $dep{$j} = 1; - push @{$depends{$i}}, $j; - push @scanlist, $j; - } - } - } -# printf "%s: %s\n", $i, join ' ',@{$depends{$i}}; -} - -# Validation of input. - -sub mfval($) { - my ($type) = @_; - # Returns true if the argument is a known makefile type. Otherwise, - # prints a warning and returns false; - if (grep { $type eq $_ } - ("vc","vcproj","cygwin","lcc","devcppproj","gtk","unix", - "am","osx","vstudio10","vstudio12","clangcl")) { - return 1; - } - warn "$.:unknown makefile type '$type'\n"; - return 0; -} - -# Utility routines while writing out the Makefiles. - -sub def { - my ($x) = shift @_; - return (defined $x) ? $x : ""; -} - -sub dirpfx { - my ($path) = shift @_; - my ($sep) = shift @_; - my $ret = ""; - my $i; - - while (($i = index $path, $sep) >= 0 || - ($j = index $path, "/") >= 0) { - if ($i >= 0 and ($j < 0 or $i < $j)) { - $path = substr $path, ($i + length $sep); - } else { - $path = substr $path, ($j + 1); - } - $ret .= "..$sep"; - } - return $ret; -} - -sub findfile { - my ($name) = @_; - my $dir = ''; - my $i; - my $outdir = undef; - unless (defined $findfilecache{$name}) { - $i = 0; - foreach $dir (@srcdirs) { - if (-f "$dir$name") { - $outdir = $dir; - $i++; - $outdir =~ s/^\.\///; - } - } - die "multiple instances of source file $name\n" if $i > 1; - $findfilecache{$name} = (defined $outdir ? $outdir . $name : undef); - } - return $findfilecache{$name}; -} - -sub objects { - my ($prog, $otmpl, $rtmpl, $ltmpl, $prefix, $dirsep) = @_; - my @ret; - my ($i, $x, $y); - ($otmpl, $rtmpl, $ltmpl) = map { defined $_ ? $_ : "" } ($otmpl, $rtmpl, $ltmpl); - @ret = (); - foreach $i (@{$programs{$prog}}) { - $x = ""; - if ($i =~ /^(.*)\.(res|rsrc)/) { - $y = $1; - ($x = $rtmpl) =~ s/X/$y/; - } elsif ($i =~ /^(.*)\.lib/) { - $y = $1; - ($x = $ltmpl) =~ s/X/$y/; - } elsif ($i !~ /\./) { - ($x = $otmpl) =~ s/X/$i/; - } - push @ret, $x if $x ne ""; - } - return join " ", @ret; -} - -sub special { - my ($prog, $suffix) = @_; - my @ret; - my ($i, $x, $y); - ($otmpl, $rtmpl, $ltmpl) = map { defined $_ ? $_ : "" } ($otmpl, $rtmpl, $ltmpl); - @ret = (); - foreach $i (@{$programs{$prog}}) { - if (substr($i, (length $i) - (length $suffix)) eq $suffix) { - push @ret, $i; - } - } - return (scalar @ret) ? (join " ", @ret) : undef; -} - -sub splitline { - my ($line, $width, $splitchar) = @_; - my $result = ""; - my $len; - $len = (defined $width ? $width : 76); - $splitchar = (defined $splitchar ? $splitchar : '\\'); - while (length $line > $len) { - $line =~ /^(.{0,$len})\s(.*)$/ or $line =~ /^(.{$len,})?\s(.*)$/; - $result .= $1; - $result .= " ${splitchar}\n\t\t" if $2 ne ''; - $line = $2; - $len = 60; - } - return $result . $line; -} - -sub deps { - my ($otmpl, $rtmpl, $prefix, $dirsep, $mftyp, $depchar, $splitchar) = @_; - my ($i, $x, $y); - my @deps; - my @ret; - @ret = (); - $depchar ||= ':'; - foreach $i (sort keys %depends) { - next if $specialobj{$mftyp}->{$i}; - if ($i =~ /^(.*)\.(res|rsrc)/) { - next if !defined $rtmpl; - $y = $1; - ($x = $rtmpl) =~ s/X/$y/; - } else { - ($x = $otmpl) =~ s/X/$i/; - } - @deps = @{$depends{$i}}; - @deps = map { - $_ = &findfile($_); - s/\//$dirsep/g; - $_ = $prefix . $_; - } @deps; - push @ret, {obj => $x, obj_orig => $i, deps => [@deps]}; - } - return @ret; -} - -sub prognames { - my ($types) = @_; - my ($n, $prog, $type); - my @ret; - @ret = (); - foreach $n (@prognames) { - ($prog, $type) = split ",", $n; - push @ret, $n if index(":$types:", ":$type:") >= 0; - } - return @ret; -} - -sub progrealnames { - my ($types) = @_; - my ($n, $prog, $type); - my @ret; - @ret = (); - foreach $n (@prognames) { - ($prog, $type) = split ",", $n; - push @ret, $prog if index(":$types:", ":$type:") >= 0; - } - return @ret; -} - -sub manpages { - my ($types,$suffix) = @_; - - # assume that all UNIX programs have a man page - if($suffix eq "1" && $types =~ /:X:/) { - return map("$_.1", &progrealnames($types)); - } - return (); -} - -$orig_dir = cwd; - -# Now we're ready to output the actual Makefiles. - -if (defined $makefiles{'clangcl'}) { - $dirpfx = &dirpfx($makefiles{'clangcl'}, "/"); - - ##-- Makefile for cross-compiling using clang-cl, lld-link, and - ## MinGW's windres for resource compilation. - # - # This makefile allows a complete Linux-based cross-compile, but - # using the real Visual Studio header files and libraries. In - # order to run it, you will need: - # - # - clang-cl, llvm-rc and lld-link on your PATH. - # * I built these from the up-to-date LLVM project trunk git - # repositories, as of 2018-05-29. - # - case-mashed copies of the Visual Studio include directories. - # * On a real VS installation, run vcvars32.bat and look at - # the resulting value of %INCLUDE%. Take a full copy of each - # of those directories, and inside the copy, for each - # include file that has an uppercase letter in its name, - # make a lowercased symlink to it. Additionally, one of the - # directories will contain files called driverspecs.h and - # specstrings.h, and those will need symlinks called - # DriverSpecs.h and SpecStrings.h. - # * Now, on Linux, define the environment variable INCLUDE to - # be a list, separated by *semicolons* (in the Windows - # style), of those directories, but before all of them you - # must also include lib/clang/5.0.0/include from the clang - # installation area (which contains in particular a - # clang-compatible stdarg.h overriding the Visual Studio - # one). - # - similarly case-mashed copies of the library directories. - # * Again, on a real VS installation, run vcvars32 or - # vcvarsx86_amd64 (as appropriate), look at %LIB%, make a - # copy of each directory, and provide symlinks within that - # directory so that all the files can be opened as - # lowercase. - # * Then set LIB to be a semicolon-separated list of those - # directories (but you'll need to change which set of - # directories depending on whether you want to do a 32-bit - # or 64-bit build). - # - for a 64-bit build, set 'Platform=x64' in the environment as - # well, or else on the make command line. - # * This is a variable understood only by this makefile - none - # of the tools we invoke will know it - but it's consistent - # with the way the VS scripts like vcvarsx86_amd64.bat set - # things up, and since the environment has to change - # _anyway_ between 32- and 64-bit builds (different set of - # paths in $LIB) it's reasonable to have the choice of - # compilation target driven by another environment variable - # set in parallel with that one. - # - for older versions of the VS libraries you may also have to - # set EXTRA_console and/or EXTRA_windows to the name of an - # object file manually extracted from one of those libraries. - # * This is because old VS seems to manage its startup code by - # having libcmt.lib contain lots of *crt0.obj objects, one - # for each possible user entry point (main, WinMain and the - # wide-char versions of both), of which the linker arranges - # to include the right one by special-case code. But lld - # only seems to mimic half of that code - it does include - # the right crt0 object, but it doesn't also deliberately - # _avoid_ including the _wrong_ ones, and since all those - # objects define a common set of global symbols for other - # parts of the library to use, lld may well select an - # arbitrary one of them the first time it sees a reference - # to one of those global symbols, and then later also select - # the _right_ one for the application's entry point, causing - # a multiple-definitions crash. - # * So the workaround is to explicitly include the right - # *crt0.obj file on the linker command line before lld even - # begins searching libraries. Hence, for a console - # application, you might extract crt0.obj from the library - # in question and set EXTRA_console=crt0.obj, and for a GUI - # application, do the same with wincrt0.obj. Then this - # makefile will include the right one of those objects - # alongside the matching /subsystem linker option. - # - also for older versions of the VS libraries, you may also - # have to set EXTRA_libs to include extra library files. - - open OUT, ">$makefiles{'clangcl'}"; select OUT; - print - "# Makefile for cross-compiling $project_name using clang-cl, lld-link,\n". - "# and llvm-rc, using GNU make on Linux.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - print $help; - print - "\n". - "CCCMD = clang-cl\n". - "RCCMD = llvm-rc\n". - "ifeq (\$(Platform),x64)\n". - "CCTARGET = x86_64-pc-windows-msvc18.0.0\n". - "PLATFORMCFLAGS =\n". - "else ifeq (\$(Platform),arm)\n". - "CCTARGET = arm-pc-windows-msvc18.0.0\n". - "PLATFORMCFLAGS = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /GS-\n". - "else ifeq (\$(Platform),arm64)\n". - "CCTARGET = arm64-pc-windows-msvc18.0.0\n". - "PLATFORMCFLAGS = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /GS-\n". - "else\n". - "CCTARGET = i386-pc-windows-msvc18.0.0\n". - "PLATFORMCFLAGS =\n". - "endif\n". - "CC = \$(CCCMD)\n". - "RC = \$(RCCMD) /c 1252 \n". - "RCPREPROC = \$(CCCMD) /P /TC\n". - "LD = lld-link\n". - "\n". - "# C compilation flags\n". - &splitline("CFLAGS = --target=\$(CCTARGET) /nologo /W3 /O1 -Wvla " . - (join " ", map {"-I$dirpfx$_"} @srcdirs) . - " /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 ". - "/D_CRT_SECURE_NO_WARNINGS /D_WINSOCK_DEPRECATED_NO_WARNINGS"). - " \$(PLATFORMCFLAGS)\n". - "LFLAGS = /incremental:no /dynamicbase /nxcompat\n". - &splitline("RCPPFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs). - " -DWIN32 -D_WIN32 -DWINVER=0x0400")." \$(RCFL)\n". - "\n". - &def($makefile_extra{'clangcl'}->{'vars'}) . - "\n". - "\n"; - print &splitline("all:" . join "", map { " \$(BUILDDIR)$_.exe" } &progrealnames("G:C")); - print "\n\n"; - foreach $p (&prognames("G:C")) { - ($prog, $type) = split ",", $p; - $objstr = &objects($p, "\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", undef); - print &splitline("\$(BUILDDIR)$prog.exe: " . $objstr), "\n"; - - $objstr = &objects($p, "\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", "X.lib"); - $subsys = ($type eq "G") ? "windows" : "console"; - print &splitline("\t\$(LD) \$(LFLAGS) \$(XLFLAGS) ". - "/out:\$(BUILDDIR)$prog.exe ". - "/lldmap:\$(BUILDDIR)$prog.map ". - "/subsystem:$subsys\$(SUBSYSVER) ". - "\$(EXTRA_$subsys) $objstr \$(EXTRA_libs)")."\n\n"; - } - my $rc_pp_rules = ""; - foreach $d (&deps("\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", $dirpfx, "/", "vc")) { - $extradeps = $forceobj{$d->{obj_orig}} ? ["*.c","*.h","*.rc"] : []; - my $rule; - my @deps = @{$d->{deps}}; - my @incdeps = grep { m!\.rc2?$! } @deps; - my @rcdeps = grep { ! m!\.rc2$! } @deps; - if ($d->{obj} =~ /\.res$/) { - my $rc = $deps[0]; - my $rcpp = $rc; - $rcpp =~ s!.*/!!; - $rcpp =~ s/\.rc$/.rcpp/; - $rcpp = "\$(BUILDDIR)" . $rcpp; - $rule = "\$(RC) ".$rcpp." /FO ".$d->{obj}; - $rc_pp_rules .= &splitline( - sprintf("%s: %s", $rcpp, join " ", @incdeps)) ."\n" . - "\t\$(RCPREPROC) \$(RCPPFLAGS) /Fi\$\@ \$<\n\n"; - $rcdeps[0] = $rcpp; - } else { - $rule = "\$(CC) /Fo\$(BUILDDIR) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) /c \$<"; - } - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @$extradeps, @rcdeps)), "\n"; - print "\t" . $rule . "\n\n"; - } - print "\n" . $rc_pp_rules; - print &def($makefile_extra{'clangcl'}->{'end'}); - print "\nclean:\n". - &splitline("\trm -f \$(BUILDDIR)*.obj \$(BUILDDIR)*.exe ". - "\$(BUILDDIR)*.rcpp \$(BUILDDIR)*.res \$(BUILDDIR)*.map ". - "\$(BUILDDIR)*.exe.manifest")."\n"; - select STDOUT; close OUT; -} - -if (defined $makefiles{'cygwin'}) { - $dirpfx = &dirpfx($makefiles{'cygwin'}, "/"); - - ##-- MinGW/CygWin makefile (called 'cygwin' for historical reasons) - open OUT, ">$makefiles{'cygwin'}"; select OUT; - print - "# Makefile for $project_name under MinGW, Cygwin, or Winelib.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - # gcc command line option is -D not /D - ($_ = $help) =~ s/([=" ])\/D/$1-D/gs; - print $_; - print - "\n". - "# You can define this path to point at your tools if you need to\n". - "# TOOLPATH = c:\\cygwin\\bin\\ # or similar, if you're running Windows\n". - "# TOOLPATH = /pkg/mingw32msvc/i386-mingw32msvc/bin/\n". - "# TOOLPATH = i686-w64-mingw32-\n". - "CC = \$(TOOLPATH)gcc\n". - "RC = \$(TOOLPATH)windres\n". - "# Uncomment the following two lines to compile under Winelib\n". - "# CC = winegcc\n". - "# RC = wrc\n". - "# You may also need to tell windres where to find include files:\n". - "# RCINC = --include-dir c:\\cygwin\\include\\\n". - "\n". - &splitline("CFLAGS = -Wall -O2 -std=gnu99 -Wvla -D_WINDOWS". - " -DWIN32S_COMPAT -D_NO_OLDNAMES -D__USE_MINGW_ANSI_STDIO=1 " . - (join " ", map {"-I$dirpfx$_"} @srcdirs)) . - "\n". - "LDFLAGS = -s\n". - &splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1 ". - "--define WINVER=0x0400 ".(join " ", map {"-I$dirpfx$_"} @srcdirs))."\n". - "\n". - &def($makefile_extra{'cygwin'}->{'vars'}) . - "\n". - ".SUFFIXES:\n". - "\n"; - print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C")); - print "\n\n"; - foreach $p (&prognames("G:C")) { - ($prog, $type) = split ",", $p; - $objstr = &objects($p, "X.o", "X.res.o", undef); - print &splitline($prog . ".exe: " . $objstr), "\n"; - my $mw = $type eq "G" ? " -mwindows" : ""; - $libstr = &objects($p, undef, undef, "-lX"); - print &splitline("\t\$(CC)" . $mw . " \$(LDFLAGS) -o \$@ " . - "-Wl,-Map,$prog.map " . - $objstr . " $libstr", 69), "\n\n"; - } - foreach $d (&deps("X.o", "X.res.o", $dirpfx, "/", "cygwin")) { - if ($forceobj{$d->{obj_orig}}) { - printf ("%s: FORCE\n", $d->{obj}); - } else { - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @{$d->{deps}})), "\n"; - } - if ($d->{obj} =~ /\.res\.o$/) { - print "\t\$(RC) \$(RCFL) \$(RCFLAGS) ".$d->{deps}->[0]." -o ".$d->{obj}."\n\n"; - } else { - print "\t\$(CC) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) -c ".$d->{deps}->[0]."\n\n"; - } - } - print "\n"; - print &def($makefile_extra{'cygwin'}->{'end'}); - print "\nclean:\n". - "\trm -f *.o *.exe *.res.o *.so *.map\n". - "\n". - "FORCE:\n"; - select STDOUT; close OUT; - -} - -if (defined $makefiles{'vc'}) { - $dirpfx = &dirpfx($makefiles{'vc'}, "\\"); - - ##-- Visual C++ makefile - open OUT, ">$makefiles{'vc'}"; select OUT; - print - "# Makefile for $project_name under Visual C.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - print $help; - print - "\n". - "# If you rename this file to `Makefile', you should change this line,\n". - "# so that the .rsp files still depend on the correct makefile.\n". - "MAKEFILE = Makefile.vc\n". - "\n". - "# C compilation flags\n". - "CFLAGS = /nologo /W3 /O1 " . - (join " ", map {"-I$dirpfx$_"} @srcdirs) . - " /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 /D_CRT_SECURE_NO_WARNINGS /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE\n". - "LFLAGS = /incremental:no /dynamicbase /nxcompat\n". - "RCFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs). - " -DWIN32 -D_WIN32 -DWINVER=0x0400\n". - "\n". - &def($makefile_extra{'vc'}->{'vars'}) . - "\n". - "\n"; - print &splitline("all:" . join "", map { " \$(BUILDDIR)$_.exe" } &progrealnames("G:C")); - print "\n\n"; - foreach $p (&prognames("G:C")) { - ($prog, $type) = split ",", $p; - $objstr = &objects($p, "\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", undef); - print &splitline("\$(BUILDDIR)$prog.exe: " . $objstr), "\n"; - - $objstr = &objects($p, "\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", "X.lib"); - $subsys = ($type eq "G") ? "windows" : "console"; - $inlinefilename = "link_$prog"; - print "\ttype <<$inlinefilename\n"; - @objlist = split " ", $objstr; - @objlines = (""); - foreach $i (@objlist) { - if (length($objlines[$#objlines] . " $i") > 72) { - push @objlines, ""; - } - $objlines[$#objlines] .= " $i"; - } - for ($i=0; $i<=$#objlines; $i++) { - print "$objlines[$i]\n"; - } - print "<<\n"; - print "\tlink \$(LFLAGS) \$(XLFLAGS) -out:\$(BUILDDIR)$prog.exe -map:\$(BUILDDIR)$prog.map -nologo -subsystem:$subsys\$(SUBSYSVER) \@$inlinefilename\n\n"; - } - foreach $d (&deps("\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", $dirpfx, "\\", "vc")) { - $extradeps = $forceobj{$d->{obj_orig}} ? ["*.c","*.h","*.rc"] : []; - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @$extradeps, @{$d->{deps}})), "\n"; - if ($d->{obj} =~ /.res$/) { - print "\trc /Fo@{[$d->{obj}]} \$(RCFL) -r \$(RCFLAGS) ".$d->{deps}->[0],"\n\n"; - } - } - print "\n"; - foreach $real_srcdir ("", @srcdirs) { - $srcdir = $real_srcdir; - if ($srcdir ne "") { - $srcdir =~ s!/!\\!g; - $srcdir = $dirpfx . $srcdir; - $srcdir =~ s!\\\.\\!\\!; - $srcdir = "{$srcdir}"; - } - # The double colon at the end of the line makes this a - # 'batch-mode inference rule', which means that nmake will - # aggregate multiple invocations of the rule and issue just - # one cl command with multiple source-file arguments. That - # noticeably speeds up builds, since starting up the cl - # process is a noticeable overhead and now has to be done far - # fewer times. - print "${srcdir}.c.obj::\n\tcl /Fo\$(BUILDDIR) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) /c \$<\n\n"; - } - print &def($makefile_extra{'vc'}->{'end'}); - print "\nclean: tidy\n". - "\t-del \$(BUILDDIR)*.exe\n\n". - "tidy:\n". - "\t-del \$(BUILDDIR)*.obj\n". - "\t-del \$(BUILDDIR)*.res\n". - "\t-del \$(BUILDDIR)*.pch\n". - "\t-del \$(BUILDDIR)*.aps\n". - "\t-del \$(BUILDDIR)*.ilk\n". - "\t-del \$(BUILDDIR)*.pdb\n". - "\t-del \$(BUILDDIR)*.rsp\n". - "\t-del \$(BUILDDIR)*.dsp\n". - "\t-del \$(BUILDDIR)*.dsw\n". - "\t-del \$(BUILDDIR)*.ncb\n". - "\t-del \$(BUILDDIR)*.opt\n". - "\t-del \$(BUILDDIR)*.plg\n". - "\t-del \$(BUILDDIR)*.map\n". - "\t-del \$(BUILDDIR)*.idb\n". - "\t-del \$(BUILDDIR)debug.log\n"; - select STDOUT; close OUT; -} - -if (defined $makefiles{'vcproj'}) { - $dirpfx = &dirpfx($makefiles{'vcproj'}, "\\"); - - ##-- MSVC 6 Workspace and projects - # - # Note: All files created in this section are written in binary - # mode, because although MSVC's command-line make can deal with - # LF-only line endings, MSVC project files really _need_ to be - # CRLF. Hence, in order for mkfiles.pl to generate usable project - # files even when run from Unix, I make sure all files are binary - # and explicitly write the CRLFs. - # - # Create directories if necessary - mkdir $makefiles{'vcproj'} - if(! -d $makefiles{'vcproj'}); - chdir $makefiles{'vcproj'}; - @deps = &deps("X.obj", "X.res", $dirpfx, "\\", "vcproj"); - %all_object_deps = map {$_->{obj} => $_->{deps}} @deps; - # Create the project files - # Get names of all Windows projects (GUI and console) - my @prognames = &prognames("G:C"); - foreach $progname (@prognames) { - create_vc_project(\%all_object_deps, $progname); - } - # Create the workspace file - open OUT, ">$project_name.dsw"; binmode OUT; select OUT; - print - "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n". - "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n". - "\r\n". - "###############################################################################\r\n". - "\r\n"; - # List projects - foreach $progname (@prognames) { - ($windows_project, $type) = split ",", $progname; - print "Project: \"$windows_project\"=\".\\$windows_project\\$windows_project.dsp\" - Package Owner=<4>\r\n"; - } - print - "\r\n". - "Package=<5>\r\n". - "{{{\r\n". - "}}}\r\n". - "\r\n". - "Package=<4>\r\n". - "{{{\r\n". - "}}}\r\n". - "\r\n". - "###############################################################################\r\n". - "\r\n". - "Global:\r\n". - "\r\n". - "Package=<5>\r\n". - "{{{\r\n". - "}}}\r\n". - "\r\n". - "Package=<3>\r\n". - "{{{\r\n". - "}}}\r\n". - "\r\n". - "###############################################################################\r\n". - "\r\n"; - select STDOUT; close OUT; - chdir $orig_dir; - - sub create_vc_project { - my ($all_object_deps, $progname) = @_; - # Construct program's dependency info - %seen_objects = (); - %lib_files = (); - %source_files = (); - %header_files = (); - %resource_files = (); - @object_files = split " ", &objects($progname, "X.obj", "X.res", "X.lib"); - foreach $object_file (@object_files) { - next if defined $seen_objects{$object_file}; - $seen_objects{$object_file} = 1; - if($object_file =~ /\.lib$/io) { - $lib_files{$object_file} = 1; - next; - } - $object_deps = $all_object_deps{$object_file}; - foreach $object_dep (@$object_deps) { - if($object_dep =~ /\.c$/io) { - $source_files{$object_dep} = 1; - next; - } - if($object_dep =~ /\.h$/io) { - $header_files{$object_dep} = 1; - next; - } - if($object_dep =~ /\.(rc|ico)$/io) { - $resource_files{$object_dep} = 1; - next; - } - } - } - $libs = join " ", sort keys %lib_files; - @source_files = sort keys %source_files; - @header_files = sort keys %header_files; - @resources = sort keys %resource_files; - ($windows_project, $type) = split ",", $progname; - mkdir $windows_project - if(! -d $windows_project); - chdir $windows_project; - $subsys = ($type eq "G") ? "windows" : "console"; - open OUT, ">$windows_project.dsp"; binmode OUT; select OUT; - print - "# Microsoft Developer Studio Project File - Name=\"$windows_project\" - Package Owner=<4>\r\n". - "# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n". - "# ** DO NOT EDIT **\r\n". - "\r\n". - "# TARGTYPE \"Win32 (x86) Application\" 0x0101\r\n". - "\r\n". - "CFG=$windows_project - Win32 Debug\r\n". - "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n". - "!MESSAGE use the Export Makefile command and run\r\n". - "!MESSAGE \r\n". - "!MESSAGE NMAKE /f \"$windows_project.mak\".\r\n". - "!MESSAGE \r\n". - "!MESSAGE You can specify a configuration when running NMAKE\r\n". - "!MESSAGE by defining the macro CFG on the command line. For example:\r\n". - "!MESSAGE \r\n". - "!MESSAGE NMAKE /f \"$windows_project.mak\" CFG=\"$windows_project - Win32 Debug\"\r\n". - "!MESSAGE \r\n". - "!MESSAGE Possible choices for configuration are:\r\n". - "!MESSAGE \r\n". - "!MESSAGE \"$windows_project - Win32 Release\" (based on \"Win32 (x86) Application\")\r\n". - "!MESSAGE \"$windows_project - Win32 Debug\" (based on \"Win32 (x86) Application\")\r\n". - "!MESSAGE \r\n". - "\r\n". - "# Begin Project\r\n". - "# PROP AllowPerConfigDependencies 0\r\n". - "# PROP Scc_ProjName \"\"\r\n". - "# PROP Scc_LocalPath \"\"\r\n". - "CPP=cl.exe\r\n". - "MTL=midl.exe\r\n". - "RSC=rc.exe\r\n". - "\r\n". - "!IF \"\$(CFG)\" == \"$windows_project - Win32 Release\"\r\n". - "\r\n". - "# PROP BASE Use_MFC 0\r\n". - "# PROP BASE Use_Debug_Libraries 0\r\n". - "# PROP BASE Output_Dir \"Release\"\r\n". - "# PROP BASE Intermediate_Dir \"Release\"\r\n". - "# PROP BASE Target_Dir \"\"\r\n". - "# PROP Use_MFC 0\r\n". - "# PROP Use_Debug_Libraries 0\r\n". - "# PROP Output_Dir \"Release\"\r\n". - "# PROP Intermediate_Dir \"Release\"\r\n". - "# PROP Ignore_Export_Lib 0\r\n". - "# PROP Target_Dir \"\"\r\n". - "# ADD BASE CPP /nologo /W3 /GX /O2 ". - (join " ", map {"/I \"..\\..\\$dirpfx$_\""} @srcdirs) . - " /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /YX /FD /c\r\n". - "# ADD CPP /nologo /W3 /GX /O2 ". - (join " ", map {"/I \"..\\..\\$dirpfx$_\""} @srcdirs) . - " /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /YX /FD /c\r\n". - "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n". - "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n". - "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\r\n". - "# ADD RSC /l 0x809 /d \"NDEBUG\"\r\n". - "BSC32=bscmake.exe\r\n". - "# ADD BASE BSC32 /nologo\r\n". - "# ADD BSC32 /nologo\r\n". - "LINK32=link.exe\r\n". - "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:$subsys /machine:I386\r\n". - "# ADD LINK32 $libs /nologo /subsystem:$subsys /machine:I386\r\n". - "# SUBTRACT LINK32 /pdb:none\r\n". - "\r\n". - "!ELSEIF \"\$(CFG)\" == \"$windows_project - Win32 Debug\"\r\n". - "\r\n". - "# PROP BASE Use_MFC 0\r\n". - "# PROP BASE Use_Debug_Libraries 1\r\n". - "# PROP BASE Output_Dir \"Debug\"\r\n". - "# PROP BASE Intermediate_Dir \"Debug\"\r\n". - "# PROP BASE Target_Dir \"\"\r\n". - "# PROP Use_MFC 0\r\n". - "# PROP Use_Debug_Libraries 1\r\n". - "# PROP Output_Dir \"Debug\"\r\n". - "# PROP Intermediate_Dir \"Debug\"\r\n". - "# PROP Ignore_Export_Lib 0\r\n". - "# PROP Target_Dir \"\"\r\n". - "# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od ". - (join " ", map {"/I \"..\\..\\$dirpfx$_\""} @srcdirs) . - " /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /YX /FD /GZ /c\r\n". - "# ADD CPP /nologo /W3 /Gm /GX /ZI /Od ". - (join " ", map {"/I \"..\\..\\$dirpfx$_\""} @srcdirs) . - " /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /YX /FD /GZ /c\r\n". - "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n". - "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n". - "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\r\n". - "# ADD RSC /l 0x809 /d \"_DEBUG\"\r\n". - "BSC32=bscmake.exe\r\n". - "# ADD BASE BSC32 /nologo\r\n". - "# ADD BSC32 /nologo\r\n". - "LINK32=link.exe\r\n". - "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:$subsys /debug /machine:I386 /pdbtype:sept\r\n". - "# ADD LINK32 $libs /nologo /subsystem:$subsys /debug /machine:I386 /pdbtype:sept\r\n". - "# SUBTRACT LINK32 /pdb:none\r\n". - "\r\n". - "!ENDIF \r\n". - "\r\n". - "# Begin Target\r\n". - "\r\n". - "# Name \"$windows_project - Win32 Release\"\r\n". - "# Name \"$windows_project - Win32 Debug\"\r\n". - "# Begin Group \"Source Files\"\r\n". - "\r\n". - "# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\r\n"; - foreach $source_file (@source_files) { - print - "# Begin Source File\r\n". - "\r\n". - "SOURCE=..\\..\\$source_file\r\n"; - if($source_file =~ /ssh\.c/io) { - # Disable 'Edit and continue' as Visual Studio can't handle the macros - print - "\r\n". - "!IF \"\$(CFG)\" == \"$windows_project - Win32 Release\"\r\n". - "\r\n". - "!ELSEIF \"\$(CFG)\" == \"$windows_project - Win32 Debug\"\r\n". - "\r\n". - "# ADD CPP /Zi\r\n". - "\r\n". - "!ENDIF \r\n". - "\r\n"; - } - print "# End Source File\r\n"; - } - print - "# End Group\r\n". - "# Begin Group \"Header Files\"\r\n". - "\r\n". - "# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\r\n"; - foreach $header_file (@header_files) { - print - "# Begin Source File\r\n". - "\r\n". - "SOURCE=..\\..\\$header_file\r\n". - "# End Source File\r\n"; - } - print - "# End Group\r\n". - "# Begin Group \"Resource Files\"\r\n". - "\r\n". - "# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\r\n"; - foreach $resource_file (@resources) { - print - "# Begin Source File\r\n". - "\r\n". - "SOURCE=..\\..\\$resource_file\r\n". - "# End Source File\r\n"; - } - print - "# End Group\r\n". - "# End Target\r\n". - "# End Project\r\n"; - select STDOUT; close OUT; - chdir ".."; - } -} - -if (defined $makefiles{'vstudio10'} || defined $makefiles{'vstudio12'}) { - - ##-- Visual Studio 2010+ Solution and Projects - - if (defined $makefiles{'vstudio10'}) { - create_vs_solution('vstudio10', "2010", "11.00", "v100"); - } - - if (defined $makefiles{'vstudio12'}) { - create_vs_solution('vstudio12', "2012", "12.00", "v110"); - } - - sub create_vs_solution { - my ($makefilename, $name, $version, $toolsver) = @_; - - $dirpfx = &dirpfx($makefiles{$makefilename}, "\\"); - - @deps = &deps("X.obj", "X.res", $dirpfx, "\\", $makefilename); - %all_object_deps = map {$_->{obj} => $_->{deps}} @deps; - - my @prognames = &prognames("G:C"); - - # Create the solution file. - mkdir $makefiles{$makefilename} - if(! -f $makefiles{$makefilename}); - chdir $makefiles{$makefilename}; - - open OUT, ">$project_name.sln"; select OUT; - - print - "Microsoft Visual Studio Solution File, Format Version $version\n" . - "# Visual Studio $name\n"; - - my %projguids = (); - foreach $progname (@prognames) { - ($windows_project, $type) = split ",", $progname; - - $projguids{$windows_project} = $guid = - &invent_guid("project:$progname"); - - print - "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"$windows_project\", \"$windows_project\\$windows_project.vcxproj\", \"{$guid}\"\n" . - "EndProject\n"; - } - - print - "Global\n" . - " GlobalSection(SolutionConfigurationPlatforms) = preSolution\n" . - " Debug|Win32 = Debug|Win32\n" . - " Release|Win32 = Release|Win32\n" . - " EndGlobalSection\n" . - " GlobalSection(ProjectConfigurationPlatforms) = postSolution\n" ; - - foreach my $projguid (values %projguids) { - print - " {$projguid}.Debug|Win32.ActiveCfg = Debug|Win32\n" . - " {$projguid}.Debug|Win32.Build.0 = Debug|Win32\n" . - " {$projguid}.Release|Win32.ActiveCfg = Release|Win32\n" . - " {$projguid}.Release|Win32.Build.0 = Release|Win32\n"; - } - - print - " EndGlobalSection\n" . - " GlobalSection(SolutionProperties) = preSolution\n" . - " HideSolutionNode = FALSE\n" . - " EndGlobalSection\n" . - "EndGlobal\n"; - - select STDOUT; close OUT; - - foreach $progname (@prognames) { - ($windows_project, $type) = split ",", $progname; - create_vs_project(\%all_object_deps, $windows_project, $type, $projguids{$windows_project}, $toolsver); - } - - chdir $orig_dir; - } - - sub create_vs_project { - my ($all_object_deps, $windows_project, $type, $projguid, $toolsver) = @_; - - # Break down the project's dependency information into the appropriate - # groups. - %seen_objects = (); - %lib_files = (); - %source_files = (); - %header_files = (); - %resource_files = (); - %icon_files = (); - - @object_files = split " ", &objects($progname, "X.obj", "X.res", "X.lib"); - foreach $object_file (@object_files) { - next if defined $seen_objects{$object_file}; - $seen_objects{$object_file} = 1; - - if($object_file =~ /\.lib$/io) { - $lib_files{$object_file} = 1; - next; - } - - $object_deps = $all_object_deps{$object_file}; - foreach $object_dep (@$object_deps) { - if($object_dep eq $object_deps->[0]) { - if($object_dep =~ /\.c$/io) { - $source_files{$object_dep} = 1; - } elsif($object_dep =~ /\.rc$/io) { - $resource_files{$object_dep} = 1; - } - } elsif ($object_dep =~ /\.[ch]$/io) { - $header_files{$object_dep} = 1; - } elsif ($object_dep =~ /\.ico$/io) { - $icon_files{$object_dep} = 1; - } - } - } - - $libs = join ";", sort keys %lib_files; - @source_files = sort keys %source_files; - @header_files = sort keys %header_files; - @resources = sort keys %resource_files; - @icons = sort keys %icon_files; - $subsystem = ($type eq "G") ? "Windows" : "Console"; - - mkdir $windows_project - if(! -d $windows_project); - chdir $windows_project; - open OUT, ">$windows_project.vcxproj"; select OUT; - open FILTERS, ">$windows_project.vcxproj.filters"; - - # The bulk of the project file is just boilerplate stuff, so we - # can mostly just dump it out here. Note, buried in the ClCompile - # item definition, that we use a debug information format of - # ProgramDatabase, which disables the edit-and-continue support - # that breaks most of the project builds. - print - "\n" . - "\n" . - " \n" . - " \n" . - " Debug\n" . - " Win32\n" . - " \n" . - " \n" . - " Release\n" . - " Win32\n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " {$projguid}\n" . - " \n" . - " \n" . - " \n" . - " Application\n" . - " false\n" . - " MultiByte\n" . - " $toolsver\n" . - " \n" . - " \n" . - " Application\n" . - " false\n" . - " MultiByte\n" . - " $toolsver\n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " .\\Release\\\n" . - " .\\Release\\\n" . - " false\n" . - " \n" . - " \n" . - " .\\Debug\\\n" . - " .\\Debug\\\n" . - " true\n" . - " \n" . - " \n" . - " \n" . - " MultiThreaded\n" . - " OnlyExplicitInline\n" . - " true\n" . - " true\n" . - " MaxSpeed\n" . - " true\n" . - " Level3\n" . - " " . (join ";", map {"..\\..\\$dirpfx$_"} @srcdirs) . ";%(AdditionalIncludeDirectories)\n" . - " WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)\n" . - " .\\Release\\\n" . - " .\\Release\\$windows_project.pch\n" . - " .\\Release\\\n" . - " .\\Release\\\n" . - " \n" . - " \n" . - " true\n" . - " NDEBUG;%(PreprocessorDefinitions)\n" . - " .\\Release\\$windows_project.tlb\n" . - " true\n" . - " Win32\n" . - " \n" . - " \n" . - " 0x0809\n" . - " NDEBUG;%(PreprocessorDefinitions)\n" . - " \n" . - " \n" . - " true\n" . - " .\\Release\\$windows_project.bsc\n" . - " \n" . - " \n" . - " true\n" . - " $subsystem\n" . - " .\\Release\\$windows_project.exe\n" . - " $libs;%(AdditionalDependencies)\n" . - " \n" . - " \n" . - " \n" . - " \n" . - " MultiThreadedDebug\n" . - " Default\n" . - " false\n" . - " Disabled\n" . - " true\n" . - " Level3\n" . - " true\n" . - " ProgramDatabase\n" . - " " . (join ";", map {"..\\..\\$dirpfx$_"} @srcdirs) . ";%(AdditionalIncludeDirectories)\n" . - " WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)\n" . - " .\\Debug\\\n" . - " .\\Debug\\$windows_project.pch\n" . - " .\\Debug\\\n" . - " .\\Debug\\\n" . - " EnableFastChecks\n" . - " \n" . - " \n" . - " true\n" . - " _DEBUG;%(PreprocessorDefinitions)\n" . - " .\\Debug\\$windows_project.tlb\n" . - " true\n" . - " Win32\n" . - " \n" . - " \n" . - " 0x0809\n" . - " _DEBUG;%(PreprocessorDefinitions)\n" . - " \n" . - " \n" . - " true\n" . - " .\\Debug\\$windows_project.bsc\n" . - " \n" . - " \n" . - " true\n" . - " true\n" . - " $subsystem\n" . - " \$(TargetPath)\n" . - " $libs;%(AdditionalDependencies)\n" . - " \n" . - " \n"; - - # The VC++ projects don't have physical structure to them, instead - # the files are organized by logical "filters" that are stored in - # a separate file, so different users can organize things differently. - # The filters file contains a copy of the ItemGroup elements from - # the main project file that list the included items, but tack - # on a filter name where needed. - print FILTERS - "\n" . - "\n"; - - print " \n"; - print FILTERS " \n"; - foreach $icon_file (@icons) { - $icon_file =~ s/..\\windows\\//; - print " \n"; - print FILTERS - " \n" . - " Resource Files\n" . - " \n"; - } - print FILTERS " \n"; - print " \n"; - - print " \n"; - print FILTERS " \n"; - foreach $resource_file (@resources) { - $resource_file =~ s/..\\windows\\//; - print - " \n" . - " ..\\..;%(AdditionalIncludeDirectories)\n" . - " ..\\..;%(AdditionalIncludeDirectories)\n" . - " \n"; - print FILTERS - " \n" . - " Resource Files\n" . - " \n"; - } - print FILTERS " \n"; - print " \n"; - - print " \n"; - print FILTERS " \n"; - foreach $source_file (@source_files) { - $source_file =~ s/..\\windows\\//; - print " \n"; - print FILTERS - " \n" . - " Source Files\n" . - " "; - } - print FILTERS " \n"; - print " \n"; - - print " \n"; - print FILTERS " \n"; - foreach $header_file (@header_files) { - $header_file =~ s/..\\windows\\//; - print " \n"; - print FILTERS - " \n" . - " Header Files\n" . - " "; - } - print FILTERS " \n"; - print " \n"; - - print - " \n" . - ""; - - print FILTERS - " \n" . - " \n" . - " {" . &invent_guid("sources:$windows_project") . "}\n" . - " \n" . - " \n" . - " {" . &invent_guid("headers:$windows_project") . "}\n" . - " \n" . - " \n" . - " {" . &invent_guid("resources:$windows_project") . "}\n" . - " \n" . - " \n" . - ""; - - select STDOUT; close OUT; close FILTERS; - chdir ".."; - } -} - -if (defined $makefiles{'gtk'}) { - $dirpfx = &dirpfx($makefiles{'gtk'}, "/"); - - ##-- X/GTK/Unix makefile - open OUT, ">$makefiles{'gtk'}"; select OUT; - print - "# Makefile for $project_name under X/GTK and Unix.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - # gcc command line option is -D not /D - ($_ = $help) =~ s/([=" ])\/D/$1-D/gs; - print $_; - print - "\n". - "# You can define this path to point at your tools if you need to\n". - "# TOOLPATH = /opt/gcc/bin\n". - "CC = \$(TOOLPATH)cc\n". - "# If necessary set the path to krb5-config here\n". - "KRB5CONFIG=krb5-config\n". - "# You can manually set this to `gtk-config' or `pkg-config gtk+-1.2'\n". - "# (depending on what works on your system) if you want to enforce\n". - "# building with GTK 1.2, or you can set it to `pkg-config gtk+-2.0 x11'\n". - "# if you want to enforce 2.0. The default is to try 2.0 and fall back\n". - "# to 1.2 if it isn't found.\n". - "GTK_CONFIG = sh -c 'pkg-config gtk+-3.0 x11 \$\$0 2>/dev/null || pkg-config gtk+-2.0 x11 \$\$0 2>/dev/null || gtk-config \$\$0'\n". - "\n". - "-include Makefile.local\n". - "\n". - "unexport CFLAGS # work around a weird issue with krb5-config\n". - "\n". - &splitline("CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g " . - (join " ", map {"-I$dirpfx$_"} @srcdirs) . - " \$(shell \$(GTK_CONFIG) --cflags)"). - " -D _FILE_OFFSET_BITS=64\n". - "XLDFLAGS = \$(LDFLAGS) \$(shell \$(GTK_CONFIG) --libs)\n". - "ULDFLAGS = \$(LDFLAGS)\n". - "ifeq (,\$(findstring NO_GSSAPI,\$(COMPAT)))\n". - "ifeq (,\$(findstring STATIC_GSSAPI,\$(COMPAT)))\n". - "XLDFLAGS+= -ldl\n". - "ULDFLAGS+= -ldl\n". - "else\n". - "CFLAGS+= -DNO_LIBDL \$(shell \$(KRB5CONFIG) --cflags gssapi)\n". - "XLDFLAGS+= \$(shell \$(KRB5CONFIG) --libs gssapi)\n". - "ULDFLAGS+= \$(shell \$(KRB5CONFIG) --libs gssapi)\n". - "endif\n". - "endif\n". - "INSTALL=install\n". - "INSTALL_PROGRAM=\$(INSTALL)\n". - "INSTALL_DATA=\$(INSTALL)\n". - "prefix=/usr/local\n". - "exec_prefix=\$(prefix)\n". - "bindir=\$(exec_prefix)/bin\n". - "mandir=\$(prefix)/man\n". - "man1dir=\$(mandir)/man1\n". - "\n". - &def($makefile_extra{'gtk'}->{'vars'}) . - "\n". - ".SUFFIXES:\n". - "\n". - "\n"; - print &splitline("all:" . join "", map { " $_" } - &progrealnames("X:XT:U:UT")); - print "\n\n"; - foreach $p (&prognames("X:XT:U:UT")) { - ($prog, $type) = split ",", $p; - ($ldflags = $type) =~ s/T$//; - $objstr = &objects($p, "X.o", undef, undef); - print &splitline($prog . ": " . $objstr), "\n"; - $libstr = &objects($p, undef, undef, "-lX"); - print &splitline("\t\$(CC) -o \$@ " . - $objstr . " \$(${ldflags}LDFLAGS) $libstr", 69), "\n\n"; - } - foreach $d (&deps("X.o", undef, $dirpfx, "/", "gtk")) { - if ($forceobj{$d->{obj_orig}}) { - printf("%s: FORCE\n", $d->{obj}); - } else { - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @{$d->{deps}})), "\n"; - } - print &splitline("\t\$(CC) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) -c $d->{deps}->[0]\n"); - } - print "\n"; - print &def($makefile_extra{'gtk'}->{'end'}); - print "\nclean:\n". - "\trm -f *.o". (join "", map { " $_" } &progrealnames("X:XT:U:UT")) . "\n"; - print "\nFORCE:\n"; - select STDOUT; close OUT; -} - -if (defined $makefiles{'unix'}) { - $dirpfx = &dirpfx($makefiles{'unix'}, "/"); - - ##-- GTK-free pure-Unix makefile for non-GUI apps only - open OUT, ">$makefiles{'unix'}"; select OUT; - print - "# Makefile for $project_name under Unix.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - # gcc command line option is -D not /D - ($_ = $help) =~ s/([=" ])\/D/$1-D/gs; - print $_; - print - "\n". - "# You can define this path to point at your tools if you need to\n". - "# TOOLPATH = /opt/gcc/bin\n". - "CC = \$(TOOLPATH)cc\n". - "\n". - "-include Makefile.local\n". - "\n". - "unexport CFLAGS # work around a weird issue with krb5-config\n". - "\n". - &splitline("CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g " . - (join " ", map {"-I$dirpfx$_"} @srcdirs)). - " -D _FILE_OFFSET_BITS=64\n". - "ULDFLAGS = \$(LDFLAGS)\n". - "INSTALL=install\n". - "INSTALL_PROGRAM=\$(INSTALL)\n". - "INSTALL_DATA=\$(INSTALL)\n". - "prefix=/usr/local\n". - "exec_prefix=\$(prefix)\n". - "bindir=\$(exec_prefix)/bin\n". - "mandir=\$(prefix)/man\n". - "man1dir=\$(mandir)/man1\n". - "\n". - &def($makefile_extra{'unix'}->{'vars'}) . - "\n". - ".SUFFIXES:\n". - "\n". - "\n"; - print &splitline("all:" . join "", map { " $_" } &progrealnames("U:UT")); - print "\n\n"; - foreach $p (&prognames("U:UT")) { - ($prog, $type) = split ",", $p; - ($ldflags = $type) =~ s/T$//; - $objstr = &objects($p, "X.o", undef, undef); - print &splitline($prog . ": " . $objstr), "\n"; - $libstr = &objects($p, undef, undef, "-lX"); - print &splitline("\t\$(CC) -o \$@ " . - $objstr . " \$(${ldflags}LDFLAGS) $libstr", 69), "\n\n"; - } - foreach $d (&deps("X.o", undef, $dirpfx, "/", "unix")) { - if ($forceobj{$d->{obj_orig}}) { - printf("%s: FORCE\n", $d->{obj}); - } else { - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @{$d->{deps}})), "\n"; - } - print &splitline("\t\$(CC) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) -c $d->{deps}->[0]\n"); - } - print "\n"; - print &def($makefile_extra{'unix'}->{'end'}); - print "\nclean:\n". - "\trm -f *.o". (join "", map { " $_" } &progrealnames("U:UT")) . "\n"; - print "\nFORCE:\n"; - select STDOUT; close OUT; -} - -if (defined $makefiles{'am'}) { - die "Makefile.am in a subdirectory is not supported\n" - if &dirpfx($makefiles{'am'}, "/") ne ""; - - ##-- Unix/autoconf Makefile.am - open OUT, ">$makefiles{'am'}"; select OUT; - print - "# Makefile.am for $project_name under Unix with Autoconf/Automake.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n\n"; - - # 2014-02-22: as of automake-1.14 we begin to get complained at if - # we don't use this option - print "AUTOMAKE_OPTIONS = subdir-objects\n\n"; - - # Complete list of source and header files. Not used by the - # auto-generated parts of this makefile, but Recipe might like to - # have it available as a variable so that mandatory-rebuild things - # (version.o) can conveniently be made to depend on it. - @sources = ("allsources", "=", - sort grep {$_ ne "empty.h"} keys %allsourcefiles); - print &splitline(join " ", @sources), "\n\n"; - - @cliprogs = ("bin_PROGRAMS", "="); - foreach $p (&prognames("U")) { - ($prog, $type) = split ",", $p; - push @cliprogs, $prog; - } - @allprogs = @cliprogs; - foreach $p (&prognames("X")) { - ($prog, $type) = split ",", $p; - push @allprogs, $prog; - } - print "if HAVE_GTK\n"; - print &splitline(join " ", @allprogs), "\n"; - print "else\n"; - print &splitline(join " ", @cliprogs), "\n"; - print "endif\n\n"; - - @noinstcliprogs = ("noinst_PROGRAMS", "="); - foreach $p (&prognames("UT")) { - ($prog, $type) = split ",", $p; - push @noinstcliprogs, $prog; - } - @noinstallprogs = @noinstcliprogs; - foreach $p (&prognames("XT")) { - ($prog, $type) = split ",", $p; - push @noinstallprogs, $prog; - } - print "if HAVE_GTK\n"; - print &splitline(join " ", @noinstallprogs), "\n"; - print "else\n"; - print &splitline(join " ", @noinstcliprogs), "\n"; - print "endif\n\n"; - - %objtosrc = (); - foreach $d (&deps("X", undef, "", "/", "am")) { - $objtosrc{$d->{obj}} = $d->{deps}->[0]; - } - - print &splitline(join " ", "AM_CPPFLAGS", "=", - map {"-I\$(srcdir)/$_"} @srcdirs), "\n"; - - @amcflags = ("\$(COMPAT)", "\$(XFLAGS)", "\$(WARNINGOPTS)"); - print "if HAVE_GTK\n"; - print &splitline(join " ", "AM_CFLAGS", "=", - "\$(GTK_CFLAGS)", @amcflags), "\n"; - print "else\n"; - print &splitline(join " ", "AM_CFLAGS", "=", @amcflags), "\n"; - print "endif\n\n"; - - %amspeciallibs = (); - foreach $obj (sort { $a cmp $b } keys %{$cflags{'am'}}) { - my $flags = $cflags{'am'}->{$obj}; - $flags = "" if $flags !~ s/^C//; - print "lib${obj}_a_SOURCES = ", $objtosrc{$obj}, "\n"; - print &splitline(join " ", "lib${obj}_a_CFLAGS", "=", @amcflags, - $flags), "\n"; - $amspeciallibs{$obj} = "lib${obj}.a"; - } - print &splitline(join " ", "noinst_LIBRARIES", "=", - sort { $a cmp $b } values %amspeciallibs), "\n\n"; - - foreach $p (&prognames("X:XT:U:UT")) { - ($prog, $type) = split ",", $p; - print "if HAVE_GTK\n" if $type eq "X" || $type eq "XT"; - @progsources = ("${prog}_SOURCES", "="); - %sourcefiles = (); - @ldadd = (); - $objstr = &objects($p, "X", undef, undef); - foreach $obj (split / /,$objstr) { - if ($amspeciallibs{$obj}) { - push @ldadd, $amspeciallibs{$obj}; - } else { - $sourcefiles{$objtosrc{$obj}} = 1; - } - } - push @progsources, sort { $a cmp $b } keys %sourcefiles; - print &splitline(join " ", @progsources), "\n"; - if ($type eq "X" || $type eq "XT") { - push @ldadd, "\$(GTK_LIBS)"; - } - if (@ldadd) { - print &splitline(join " ", "${prog}_LDADD", "=", @ldadd), "\n"; - } - print "endif\n" if $type eq "X" || $type eq "XT"; - print "\n"; - } - print &def($makefile_extra{'am'}->{'end'}); - select STDOUT; close OUT; -} - -if (defined $makefiles{'lcc'}) { - $dirpfx = &dirpfx($makefiles{'lcc'}, "\\"); - - ##-- lcc makefile - open OUT, ">$makefiles{'lcc'}"; select OUT; - print - "# Makefile for $project_name under lcc.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - # lcc command line option is -D not /D - ($_ = $help) =~ s/([=" ])\/D/$1-D/gs; - print $_; - print - "\n". - "# If you rename this file to `Makefile', you should change this line,\n". - "# so that the .rsp files still depend on the correct makefile.\n". - "MAKEFILE = Makefile.lcc\n". - "\n". - "# C compilation flags\n". - "CFLAGS = -D_WINDOWS " . - (join " ", map {"-I$dirpfx$_"} @srcdirs) . - "\n". - "# Resource compilation flags\n". - "RCFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs)."\n". - "\n". - "# Get include directory for resource compiler\n". - "\n". - &def($makefile_extra{'lcc'}->{'vars'}) . - "\n"; - print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C")); - print "\n\n"; - foreach $p (&prognames("G:C")) { - ($prog, $type) = split ",", $p; - $objstr = &objects($p, "X.obj", "X.res", undef); - print &splitline("$prog.exe: " . $objstr ), "\n"; - $subsystemtype = ''; - if ($type eq "G") { $subsystemtype = "-subsystem windows"; } - my $libss = "shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib imm32.lib"; - print &splitline("\tlcclnk $subsystemtype -o $prog.exe $objstr $libss"); - print "\n\n"; - } - - foreach $d (&deps("X.obj", "X.res", $dirpfx, "\\", "lcc")) { - if ($forceobj{$d->{obj_orig}}) { - printf("%s: FORCE\n", $d->{obj}); - } else { - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @{$d->{deps}})), "\n"; - } - if ($d->{obj} =~ /\.obj$/) { - print &splitline("\tlcc -O -p6 \$(COMPAT)". - " \$(CFLAGS) \$(XFLAGS) ".$d->{deps}->[0],69)."\n"; - } else { - print &splitline("\tlrc \$(RCFL) -r \$(RCFLAGS) ". - $d->{deps}->[0],69)."\n"; - } - } - print "\n"; - print &def($makefile_extra{'lcc'}->{'end'}); - print "\nclean:\n". - "\t-del *.obj\n". - "\t-del *.exe\n". - "\t-del *.res\n". - "\n". - "FORCE:\n"; - - select STDOUT; close OUT; -} - -if (defined $makefiles{'osx'}) { - $dirpfx = &dirpfx($makefiles{'osx'}, "/"); - - ##-- Mac OS X makefile - open OUT, ">$makefiles{'osx'}"; select OUT; - print - "# Makefile for $project_name under Mac OS X.\n". - "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". - "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; - # gcc command line option is -D not /D - ($_ = $help) =~ s/([=" ])\/D/$1-D/gs; - print $_; - print - "CC = \$(TOOLPATH)gcc\n". - "\n". - &splitline("CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g " . - (join " ", map {"-I$dirpfx$_"} @srcdirs))."\n". - "MLDFLAGS = -framework Cocoa\n". - "ULDFLAGS =\n". - "\n" . - &def($makefile_extra{'osx'}->{'vars'}) . - "\n" . - &splitline("all:" . join "", map { " $_" } &progrealnames("MX:U:UT")) . - "\n"; - foreach $p (&prognames("MX")) { - ($prog, $type) = split ",", $p; - $objstr = &objects($p, "X.o", undef, undef); - $icon = &special($p, ".icns"); - $infoplist = &special($p, "info.plist"); - print "${prog}.app:\n\tmkdir -p \$\@\n"; - print "${prog}.app/Contents: ${prog}.app\n\tmkdir -p \$\@\n"; - print "${prog}.app/Contents/MacOS: ${prog}.app/Contents\n\tmkdir -p \$\@\n"; - $targets = "${prog}.app/Contents/MacOS/$prog"; - if (defined $icon) { - print "${prog}.app/Contents/Resources: ${prog}.app/Contents\n\tmkdir -p \$\@\n"; - print "${prog}.app/Contents/Resources/${prog}.icns: ${prog}.app/Contents/Resources $icon\n\tcp $icon \$\@\n"; - $targets .= " ${prog}.app/Contents/Resources/${prog}.icns"; - } - if (defined $infoplist) { - print "${prog}.app/Contents/Info.plist: ${prog}.app/Contents/Resources $infoplist\n\tcp $infoplist \$\@\n"; - $targets .= " ${prog}.app/Contents/Info.plist"; - } - $targets .= " \$(${prog}_extra)"; - print &splitline("${prog}: $targets", 69) . "\n\n"; - print &splitline("${prog}.app/Contents/MacOS/$prog: ". - "${prog}.app/Contents/MacOS " . $objstr), "\n"; - $libstr = &objects($p, undef, undef, "-lX"); - print &splitline("\t\$(CC) \$(MLDFLAGS) -o \$@ " . - $objstr . " $libstr", 69), "\n\n"; - } - foreach $p (&prognames("U:UT")) { - ($prog, $type) = split ",", $p; - $objstr = &objects($p, "X.o", undef, undef); - print &splitline($prog . ": " . $objstr), "\n"; - $libstr = &objects($p, undef, undef, "-lX"); - print &splitline("\t\$(CC) \$(ULDFLAGS) -o \$@ " . - $objstr . " $libstr", 69), "\n\n"; - } - foreach $d (&deps("X.o", undef, $dirpfx, "/", "osx")) { - if ($forceobj{$d->{obj_orig}}) { - printf("%s: FORCE\n", $d->{obj}); - } else { - print &splitline(sprintf("%s: %s", $d->{obj}, - join " ", @{$d->{deps}})), "\n"; - } - $firstdep = $d->{deps}->[0]; - if ($firstdep =~ /\.c$/) { - print "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(CFLAGS) \$(XFLAGS) -c \$<\n"; - } elsif ($firstdep =~ /\.m$/) { - print "\t\$(CC) -x objective-c \$(COMPAT) \$(FWHACK) \$(CFLAGS) \$(XFLAGS) -c \$<\n"; - } - } - print "\n".&def($makefile_extra{'osx'}->{'end'}); - print "\nclean:\n". - "\trm -f *.o *.dmg". (join "", map { " $_" } &progrealnames("U:UT")) . "\n". - "\trm -rf *.app\n". - "\n". - "FORCE:\n"; - select STDOUT; close OUT; -} - -if (defined $makefiles{'devcppproj'}) { - $dirpfx = &dirpfx($makefiles{'devcppproj'}, "\\"); - $orig_dir = cwd; - - ##-- Dev-C++ 5 projects - # - # Note: All files created in this section are written in binary - # mode to prevent any posibility of misinterpreted line endings. - # I don't know if Dev-C++ is as touchy as MSVC with LF-only line - # endings. But however, CRLF line endings are the common way on - # Win32 machines where Dev-C++ is running. - # Hence, in order for mkfiles.pl to generate CRLF project files - # even when run from Unix, I make sure all files are binary and - # explicitly write the CRLFs. - # - # Create directories if necessary - mkdir $makefiles{'devcppproj'} - if(! -d $makefiles{'devcppproj'}); - chdir $makefiles{'devcppproj'}; - @deps = &deps("X.obj", "X.res", $dirpfx, "\\", "devcppproj"); - %all_object_deps = map {$_->{obj} => $_->{deps}} @deps; - # Make dir names FAT/NTFS compatible - my @srcdirs = @srcdirs; - for ($i=0; $i<@srcdirs; $i++) { - $srcdirs[$i] =~ s/\//\\/g; - $srcdirs[$i] =~ s/\\$//; - } - # Create the project files - # Get names of all Windows projects (GUI and console) - my @prognames = &prognames("G:C"); - foreach $progname (@prognames) { - create_devcpp_project(\%all_object_deps, $progname); - } - - chdir $orig_dir; - - sub create_devcpp_project { - my ($all_object_deps, $progname) = @_; - # Construct program's dependency info (Taken from 'vcproj', seems to work right here, too.) - %seen_objects = (); - %lib_files = (); - %source_files = (); - %header_files = (); - %resource_files = (); - @object_files = split " ", &objects($progname, "X.obj", "X.res", "X.lib"); - foreach $object_file (@object_files) { - next if defined $seen_objects{$object_file}; - $seen_objects{$object_file} = 1; - if($object_file =~ /\.lib$/io) { - $lib_files{$object_file} = 1; - next; - } - $object_deps = $all_object_deps{$object_file}; - foreach $object_dep (@$object_deps) { - if($object_dep =~ /\.c$/io) { - $source_files{$object_dep} = 1; - next; - } - if($object_dep =~ /\.h$/io) { - $header_files{$object_dep} = 1; - next; - } - if($object_dep =~ /\.(rc|ico)$/io) { - $resource_files{$object_dep} = 1; - next; - } - } - } - $libs = join " ", sort keys %lib_files; - @source_files = sort keys %source_files; - @header_files = sort keys %header_files; - @resources = sort keys %resource_files; - ($windows_project, $type) = split ",", $progname; - mkdir $windows_project - if(! -d $windows_project); - chdir $windows_project; - - $subsys = ($type eq "G") ? "0" : "1"; # 0 = Win32 GUI, 1 = Win32 Console - open OUT, ">$windows_project.dev"; binmode OUT; select OUT; - print - "# DEV-C++ 5 Project File - $windows_project.dev\r\n". - "# ** DO NOT EDIT **\r\n". - "\r\n". - # No difference between DEBUG and RELEASE here as in 'vcproj', because - # Dev-C++ does not support multiple compilation profiles in one single project. - # (At least I can say this for Dev-C++ 5 Beta) - "[Project]\r\n". - "FileName=$windows_project.dev\r\n". - "Name=$windows_project\r\n". - "Ver=1\r\n". - "IsCpp=1\r\n". - "Type=$subsys\r\n". - # Multimon is disabled here, as Dev-C++ (Version 5 Beta) does not have multimon.h - "Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_\@\@_\r\n". - "CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_\@\@_\r\n". - "Includes=" . (join ";", map {"..\\..\\$dirpfx$_"} @srcdirs) . "\r\n". - "Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_\@\@_\r\n". - "Libs=\r\n". - "UnitCount=" . (@source_files + @header_files + @resources) . "\r\n". - "Folders=\"Header Files\",\"Resource Files\",\"Source Files\"\r\n". - "ObjFiles=\r\n". - "PrivateResource=${windows_project}_private.rc\r\n". - "ResourceIncludes=..\\..\\..\\WINDOWS\r\n". - "MakeIncludes=\r\n". - "Icon=\r\n". # It's ok to leave this blank. - "ExeOutput=\r\n". - "ObjectOutput=\r\n". - "OverrideOutput=0\r\n". - "OverrideOutputName=$windows_project.exe\r\n". - "HostApplication=\r\n". - "CommandLine=\r\n". - "UseCustomMakefile=0\r\n". - "CustomMakefile=\r\n". - "IncludeVersionInfo=0\r\n". - "SupportXPThemes=0\r\n". - "CompilerSet=0\r\n". - "CompilerSettings=0000000000000000000000\r\n". - "\r\n"; - $unit_count = 1; - foreach $source_file (@source_files) { - print - "[Unit$unit_count]\r\n". - "FileName=..\\..\\$source_file\r\n". - "Folder=Source Files\r\n". - "Compile=1\r\n". - "CompileCpp=0\r\n". - "Link=1\r\n". - "Priority=1000\r\n". - "OverrideBuildCmd=0\r\n". - "BuildCmd=\r\n". - "\r\n"; - $unit_count++; - } - foreach $header_file (@header_files) { - print - "[Unit$unit_count]\r\n". - "FileName=..\\..\\$header_file\r\n". - "Folder=Header Files\r\n". - "Compile=1\r\n". - "CompileCpp=1\r\n". # Dev-C++ want's to compile all header files with both compilers C and C++. It does not hurt. - "Link=1\r\n". - "Priority=1000\r\n". - "OverrideBuildCmd=0\r\n". - "BuildCmd=\r\n". - "\r\n"; - $unit_count++; - } - foreach $resource_file (@resources) { - if ($resource_file =~ /.*\.(ico|cur|bmp|dlg|rc2|rct|bin|rgs|gif|jpg|jpeg|jpe)/io) { # Default filter as in 'vcproj' - $Compile = "0"; # Don't compile images and other binary resource files - $CompileCpp = "0"; - } else { - $Compile = "1"; - $CompileCpp = "1"; # Dev-C++ want's to compile all .rc files with both compilers C and C++. It does not hurt. - } - print - "[Unit$unit_count]\r\n". - "FileName=..\\..\\$resource_file\r\n". - "Folder=Resource Files\r\n". - "Compile=$Compile\r\n". - "CompileCpp=$CompileCpp\r\n". - "Link=0\r\n". - "Priority=1000\r\n". - "OverrideBuildCmd=0\r\n". - "BuildCmd=\r\n". - "\r\n"; - $unit_count++; - } - #Note: By default, [VersionInfo] is not used. - print - "[VersionInfo]\r\n". - "Major=0\r\n". - "Minor=0\r\n". - "Release=1\r\n". - "Build=1\r\n". - "LanguageID=1033\r\n". - "CharsetID=1252\r\n". - "CompanyName=\r\n". - "FileVersion=0.1\r\n". - "FileDescription=\r\n". - "InternalName=\r\n". - "LegalCopyright=\r\n". - "LegalTrademarks=\r\n". - "OriginalFilename=$windows_project.exe\r\n". - "ProductName=$windows_project\r\n". - "ProductVersion=0.1\r\n". - "AutoIncBuildNr=0\r\n"; - select STDOUT; close OUT; - chdir ".."; - } -} - -# All done, so do the Unix postprocessing if asked to. - -if ($do_unix) { - chdir $orig_dir; - system "./mkauto.sh"; - die "mkfiles.pl: mkauto.sh returned $?\n" if $? > 0; - if ($do_unix == 1) { - chdir ($targetdir = "unix") - or die "$targetdir: chdir: $!\n"; - } - system "./configure", @confargs; - die "mkfiles.pl: configure returned $?\n" if $? > 0; -} - -sub invent_guid($) { - my ($name) = @_; - - # Invent a GUID for use in Visual Studio project files. We need - # a few of these for every executable file we build. - # - # In order to avoid having to use the non-core Perl module - # Data::GUID, and also arrange for GUIDs to be stable, we generate - # our GUIDs by hashing a pile of fixed (but originally randomly - # generated) data with the filename for which we need an id. - # - # Hashing _just_ the filenames would clearly be cheating (it's - # quite conceivable that someone might hash the same string for - # another reason and so generate a colliding GUID), but hashing a - # whole SHA-512 data block of random gibberish as well should make - # these GUIDs pseudo-random enough to not collide with anyone - # else's. - - my $randdata = pack "N*", - 0xD4AB035F,0x76998BA0,0x2DCCB0BD,0x6D3FA320,0x53638051,0xFE312F35, - 0xDE1CECC0,0x784DF852,0x6C9F4589,0x54B7AC23,0x14E7A1C4,0xF9BF04DF, - 0x19C08B6D,0x3FB69EF1,0xB2DA9043,0xDB5362F3,0x25718DB6,0x733560DA, - 0xFEF871B0,0xFECF7A0C,0x67D19C95,0xB492E911,0xF5D562A3,0xFCE1D478, - 0x02C50434,0xF7326B7E,0x93D39872,0xCF0D0269,0x9EF24C0F,0x827689AD, - 0x88BD20BC,0x74EA6AFE,0x29223682,0xB9AB9287,0x7EA7CE4F,0xCF81B379, - 0x9AE4A954,0x81C7AD97,0x2FF2F031,0xC51DA3C2,0xD311CCE7,0x0A31EB8B, - 0x1AB04242,0xAF53B714,0xFC574D40,0x8CB4ED01,0x29FEB16F,0x4904D7ED, - 0xF5C5F5E1,0xF138A4C2,0xA9D881CE,0xCEA65187,0x4421BA97,0x0EE8428E, - 0x9556E384,0x6D0484C9,0x561BD84B,0xD9516A40,0x6B4FD33F,0xDDFFE4C8, - 0x3D5DF8A5,0xFE6B7D99,0x3443371B,0xF4E30A3E,0xE62B9FDA,0x6BAA75DB, - 0x9EF3C2C7,0x6815CA42,0xE6536076,0xF851E6E2,0x39D16E69,0xBCDF3BB6, - 0x50EFFA41,0x378CDF2A,0xB5EC0D0C,0x1E94C433,0xE818241A,0x2689EB1F, - 0xB649CEF9,0xD7344D46,0x59C1BB13,0x27511FDF,0x7DAD1768,0xB355E29E, - 0xDFAE550C,0x2433005B,0x09DE10B0,0xAA00BA6B,0xC144ED2D,0x8513D007, - 0xB0315232,0x7A10DAB6,0x1D97654E,0xF048214D,0xE3059E75,0x83C225D1, - 0xFC7AB177,0x83F2B553,0x79F7A0AF,0x1C94582C,0xF5E4AF4B,0xFB39C865, - 0x58ABEB27,0xAAB28058,0x52C15A89,0x0EBE9741,0x343F4D26,0xF941202A, - 0xA32FD32F,0xDCC055B8,0x64281BF3,0x468BD7BA,0x0CEE09D3,0xBB5FD2B6, - 0xA528D412,0xA6A6967E,0xEAAF5DAE,0xDE7B2FAE,0xCA36887B,0x0DE196EB, - 0x74B95EF0,0x9EB8B7C2,0x020BFC83,0x1445086F,0xBF4B61B2,0x89AFACEC, - 0x80A5CD69,0xC790F744,0x435A6998,0x8DE7AC48,0x32F31BC9,0x8F760D3D, - 0xF02A74CB,0xD7B47E20,0x9EC91035,0x70FDE74D,0x9B531362,0x9D81739A, - 0x59ADC2EB,0x511555B5,0xCA84B8D5,0x3EC325FF,0x2E442A4C,0x82AF30D9, - 0xBFD3EC87,0x90C59E07,0x1C6DC991,0x2D16B822,0x7EA44EB5,0x3A655A39, - 0xAB640886,0x09311821,0x777801D9,0x489DBE61,0xA1FFEC65,0x978B49B1, - 0x7DB700CD,0x263CF3D6,0xF977E89F,0xBA0B3D01,0x6C6CED19,0x1BE6F23A, - 0x19E0ED98,0x8E71A499,0x70BA3271,0x3FB7EE98,0xABA46848,0x2B797959, - 0x72C6DE59,0xE08B795C,0x02936C39,0x02185CCB,0xD6F3CE18,0xD0157A40, - 0x833DEC3F,0x319B00C4,0x97B59513,0x900B81FD,0x9A022379,0x16E44E1A, - 0x0C4CC540,0xCA98E7F9,0xF9431A26,0x290BCFAC,0x406B82C0,0xBC1C4585, - 0x55C54528,0x811EBB77,0xD4EDD4F3,0xA70DC02E,0x8AD5C0D1,0x28D64EF4, - 0xBEFF5C69,0x99852C4A,0xB4BBFF7B,0x069230AC,0xA3E141FA,0x4E99FB0E, - 0xBC154DAA,0x323C7F15,0x86E0247E,0x2EEA3054,0xC9CA1D32,0x8964A006, - 0xC93978AC,0xF9B2C159,0x03F2079E,0xB051D284,0x4A7EA9A9,0xF001DA1F, - 0xD47A0DAA,0xCF7B6B73,0xF18293B2,0x84303E34,0xF8BC76C4,0xAFBEE24F, - 0xB589CA80,0x77B5BF86,0x21B9FD5B,0x1A5071DF,0xA3863110,0x0E50CA61, - 0x939151A5,0xD2A59021,0x83A9CDCE,0xCEC69767,0xC906BB16,0x3EE1FF4D, - 0x1321EAE4,0x0BF940D6,0x52471E61,0x8A087056,0x66E54293,0xF84AAB9B, - 0x08835EF1,0x8F12B77A,0xD86935A5,0x200281D7,0xCD3C37C9,0x30ABEC05, - 0x7067E8A0,0x608C4838,0xC9F51CDE,0xA6D318DE,0x41C05B2A,0x694CCE0E, - 0xC7842451,0xA3194393,0xFBDC2C84,0xA6D2B577,0xC91E7924,0x01EDA708, - 0x22FBB61E,0x662F9B7B,0xDE3150C3,0x2397058C; - my $digest = sha512_hex($name . "\0" . $randdata); - return sprintf("%s-%s-%04x-%04x-%s", - substr($digest,0,8), - substr($digest,8,4), - 0x4000 | (0xFFF & hex(substr($digest,12,4))), - 0x8000 | (0x3FFF & hex(substr($digest,16,4))), - substr($digest,20,12)); -} diff --git a/code/mksrcarc.sh b/code/mksrcarc.sh deleted file mode 100644 index 9b53317..0000000 --- a/code/mksrcarc.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -set -e - -perl mkfiles.pl -# These are text files. -text=`{ find . -name CVS -prune -o \ - -name .cvsignore -prune -o \ - -name .svn -prune -o \ - -name LATEST.VER -prune -o \ - -name CHECKLST.txt -prune -o \ - -name mksrcarc.sh -prune -o \ - -name '*.dsp' -prune -o \ - -name '*.dsw' -prune -o \ - -type f -print | sed 's/^\.\///'; } | \ - grep -ivE 'test/.*\.txt|MODULE|website.url' | grep -vF .ico | grep -vF .icns` -# These are files which I'm _sure_ should be treated as text, but -# which zip might complain about, so we direct its moans to -# /dev/null! Apparently its heuristics are doubtful of UTF-8 text -# files. -bintext=test/*.txt -# These are actual binary files which we don't want transforming. -bin=`{ ls -1 windows/*.ico windows/website.url; \ - find . -name '*.dsp' -print -o -name '*.dsw' -print; }` - -verbosely() { - echo "$@" - "$@" -} - -verbosely zip -l putty-src.zip $text -verbosely zip -l putty-src.zip $bintext -verbosely zip putty-src.zip $bin diff --git a/code/mkunxarc.sh b/code/mkunxarc.sh index 34aee8b..cb79c05 100644 --- a/code/mkunxarc.sh +++ b/code/mkunxarc.sh @@ -3,16 +3,10 @@ # Build a Unix source distribution from the PuTTY CVS area. # # Expects the following arguments: -# - the version number to write into configure.ac # - the suffix to put on the Unix source tarball # - the options to put on the 'make' command line for the docs -autoconfver="$1" -arcsuffix="$2" -docver="$3" - -perl mkfiles.pl -(cd doc && make -s ${docver:+"$docver"}) +arcsuffix="$1" relver=`cat LATEST.VER` arcname="putty$arcsuffix" @@ -27,12 +21,9 @@ find . -name uxarc -prune -o \ -name CVS -prune -o \ -name .cvsignore -prune -o \ -name .svn -prune -o \ - -name configure.ac -prune -o \ -name '*.zip' -prune -o \ -name '*.tar.gz' -prune -o \ -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \; -sed "s/^AC_INIT(putty,.*/AC_INIT(putty, $autoconfver)/" configure.ac > uxarc/$arcname/configure.ac -(cd uxarc/$arcname && sh mkauto.sh) 2>errors || { cat errors >&2; exit 1; } tar -C uxarc -chzof $arcname.tar.gz $arcname rm -rf uxarc diff --git a/code/mpint.h b/code/mpint.h index 5611a00..ae09a24 100644 --- a/code/mpint.h +++ b/code/mpint.h @@ -257,6 +257,12 @@ void mp_divmod_into(mp_int *n, mp_int *d, mp_int *q, mp_int *r); mp_int *mp_div(mp_int *n, mp_int *d); mp_int *mp_mod(mp_int *x, mp_int *modulus); +/* + * Compute the residue of x mod m, where m is a small integer. x is + * kept secret, but m is not. + */ +uint32_t mp_mod_known_integer(mp_int *x, uint32_t m); + /* * Integer nth root. mp_nthroot returns the largest integer x such * that x^n <= y, and if 'remainder' is non-NULL then it fills it with @@ -422,10 +428,10 @@ mp_int *mp_rshift_fixed(mp_int *x, size_t shift); * * The _function_ definitions here will expect to be given a gen_data * function that provides random data. Normally you'd use this using - * random_read() from random.c, and the macro wrappers automate that. + * random_read() from sshrand.c, and the macro wrappers automate that. * * (This is a bit of a dodge to avoid mpint.c having a link-time - * dependency on random.c, so that programs can link against one but + * dependency on sshrand.c, so that programs can link against one but * not the other: if a client of this header uses one of these macros * then _they_ have link-time dependencies on both modules.) * diff --git a/code/network.h b/code/network.h index 89419fb..4c0b033 100644 --- a/code/network.h +++ b/code/network.h @@ -51,9 +51,14 @@ typedef enum PlugLogType { PLUGLOG_PROXY_MSG, } PlugLogType; +typedef enum PlugCloseType { + PLUGCLOSE_NORMAL, + PLUGCLOSE_ERROR, + PLUGCLOSE_BROKEN_PIPE, + PLUGCLOSE_USER_ABORT, +} PlugCloseType; + struct PlugVtable { - void (*log)(Plug *p, PlugLogType type, SockAddr *addr, int port, - const char *error_msg, int error_code); /* * Passes the client progress reports on the process of setting * up the connection. @@ -67,22 +72,63 @@ struct PlugVtable { * addresses to fall back to. When it _is_ fatal, the closing() * function will be called. * - * - PLUGLOG_CONNECT_SUCCESS means we have succeeded in - * connecting to address `addr'. + * - PLUGLOG_CONNECT_SUCCESS means we have succeeded in making a + * connection. `addr' gives the address we connected to, if + * available. (But sometimes, in cases of complicated proxy + * setups, it might not be available, so receivers of this log + * event should be prepared to deal with addr==NULL.) * * - PLUGLOG_PROXY_MSG means that error_msg contains a line of * logging information from whatever the connection is being * proxied through. This will typically be a wodge of * standard-error output from a local proxy command, so the * receiver should probably prefix it to indicate this. + * + * Note that sometimes log messages may be sent even to Socket + * types that don't involve making an outgoing connection, e.g. + * because the same core implementation (such as Windows handle + * sockets) is shared between listening and connecting sockets. So + * all Plugs must implement this method, even if only to ignore + * the logged events. */ - void (*closing) - (Plug *p, const char *error_msg, int error_code, bool calling_back); - /* error_msg is NULL iff it is not an error (ie it closed normally) */ - /* calling_back != 0 iff there is a Plug function */ - /* currently running (would cure the fixme in try_send()) */ - void (*receive) (Plug *p, int urgent, const char *data, size_t len); + void (*log)(Plug *p, PlugLogType type, SockAddr *addr, int port, + const char *error_msg, int error_code); + + /* + * Notifies the Plug that the socket is closing, and something + * about why. + * + * - PLUGCLOSE_NORMAL means an ordinary non-error closure. In + * this case, error_msg should be ignored (and hopefully + * callers will have passed NULL). + * + * - PLUGCLOSE_ERROR indicates that an OS error occurred, and + * 'error_msg' contains a string describing it, for use in + * diagnostics. (Ownership of the string is not transferred.) + * This error class covers anything other than the special + * case below: + * + * - PLUGCLOSE_BROKEN_PIPE behaves like PLUGCLOSE_ERROR (in + * particular, there's still an error message provided), but + * distinguishes the particular error condition signalled by + * EPIPE / ERROR_BROKEN_PIPE, which ssh/sharing.c needs to + * recognise and handle specially in one situation. + * + * - PLUGCLOSE_USER_ABORT means that the close has happened as a + * result of some kind of deliberate user action (e.g. hitting + * ^C at a password prompt presented by a proxy socket setup + * phase). This can be used to suppress interactive error + * messages sent to the user (such as dialog boxes), on the + * grounds that the user already knows. However, 'error_msg' + * will still contain some appropriate text, so that + * non-interactive error reporting (e.g. event logs) can still + * record why the connection terminated. + */ + void (*closing)(Plug *p, PlugCloseType type, const char *error_msg); + /* + * Provides incoming socket data to the Plug. Three cases: + * * - urgent==0. `data' points to `len' bytes of perfectly * ordinary data. * @@ -92,28 +138,52 @@ struct PlugVtable { * - urgent==2. `data' points to `len' bytes of data, * the first of which was the one at the Urgent mark. */ - void (*sent) (Plug *p, size_t bufsize); + void (*receive) (Plug *p, int urgent, const char *data, size_t len); + /* - * The `sent' function is called when the pending send backlog - * on a socket is cleared or partially cleared. The new backlog - * size is passed in the `bufsize' parameter. + * Called when the pending send backlog on a socket is cleared or + * partially cleared. The new backlog size is passed in the + * `bufsize' parameter. */ - int (*accepting)(Plug *p, accept_fn_t constructor, accept_ctx_t ctx); + void (*sent) (Plug *p, size_t bufsize); + /* - * `accepting' is called only on listener-type sockets, and is - * passed a constructor function+context that will create a fresh - * Socket describing the connection. It returns nonzero if it - * doesn't want the connection for some reason, or 0 on success. + * Only called on listener-type sockets, and is passed a + * constructor function+context that will create a fresh Socket + * describing the connection. It returns nonzero if it doesn't + * want the connection for some reason, or 0 on success. */ + int (*accepting)(Plug *p, accept_fn_t constructor, accept_ctx_t ctx); }; -/* proxy indirection layer */ -/* NB, control of 'addr' is passed via new_connection, which takes - * responsibility for freeing it */ +/* Proxy indirection layer. + * + * Calling new_connection transfers ownership of 'addr': the proxy + * layer is now responsible for freeing it, and the caller shouldn't + * assume it exists any more. + * + * If calling this from a backend with a Seat, you can also give it a + * pointer to the backend's Interactor trait. In that situation, it + * might replace the backend's seat with a temporary seat of its own, + * and give the real Seat to an Interactor somewhere in the proxy + * system so that it can ask for passwords (and, in the case of SSH + * proxying, other prompts like host key checks). If that happens, + * then the resulting 'temp seat' is the backend's property, and it + * will have to remember to free it when cleaning up, or after + * flushing it back into the real seat when the network connection + * attempt completes. + * + * You can free your TempSeat and resume using the real Seat when one + * of two things happens: either your Plug's closing() method is + * called (indicating failure to connect), or its log() method is + * called with PLUGLOG_CONNECT_SUCCESS. In the latter case, you'll + * probably want to flush the TempSeat's contents into the real Seat, + * of course. + */ Socket *new_connection(SockAddr *addr, const char *hostname, int port, bool privport, bool oobinline, bool nodelay, bool keepalive, - Plug *plug, Conf *conf); + Plug *plug, Conf *conf, Interactor *interactor); Socket *new_listener(const char *srcaddr, int port, Plug *plug, bool local_host_only, Conf *conf, int addressfamily); SockAddr *name_lookup(const char *host, int port, char **canonicalname, @@ -125,7 +195,13 @@ SockAddr *name_lookup(const char *host, int port, char **canonicalname, Socket *platform_new_connection(SockAddr *addr, const char *hostname, int port, bool privport, bool oobinline, bool nodelay, bool keepalive, - Plug *plug, Conf *conf); + Plug *plug, Conf *conf, Interactor *itr); + +/* callback for SSH jump-host proxying */ +Socket *sshproxy_new_connection(SockAddr *addr, const char *hostname, + int port, bool privport, + bool oobinline, bool nodelay, bool keepalive, + Plug *plug, Conf *conf, Interactor *itr); /* socket functions */ @@ -171,9 +247,14 @@ static inline void sk_write_eof(Socket *s) static inline void plug_log( Plug *p, int type, SockAddr *addr, int port, const char *msg, int code) { p->vt->log(p, type, addr, port, msg, code); } -static inline void plug_closing( - Plug *p, const char *msg, int code, bool calling_back) -{ p->vt->closing(p, msg, code, calling_back); } +static inline void plug_closing(Plug *p, PlugCloseType type, const char *msg) +{ p->vt->closing(p, type, msg); } +static inline void plug_closing_normal(Plug *p) +{ p->vt->closing(p, PLUGCLOSE_NORMAL, NULL); } +static inline void plug_closing_error(Plug *p, const char *msg) +{ p->vt->closing(p, PLUGCLOSE_ERROR, msg); } +static inline void plug_closing_user_abort(Plug *p) +{ p->vt->closing(p, PLUGCLOSE_USER_ABORT, "User aborted connection setup"); } static inline void plug_receive(Plug *p, int urg, const char *data, size_t len) { p->vt->receive(p, urg, data, len); } static inline void plug_sent (Plug *p, size_t bufsize) @@ -221,7 +302,7 @@ static inline SocketPeerInfo *sk_peer_info(Socket *s) /* * The structure returned from sk_peer_info, and a function to free - * one (in misc.c). + * one (in utils). */ struct SocketPeerInfo { int addressfamily; @@ -259,13 +340,13 @@ struct SocketPeerInfo { void sk_free_peer_info(SocketPeerInfo *pi); /* - * Simple wrapper on getservbyname(), needed by ssh.c. Returns the + * Simple wrapper on getservbyname(), needed by portfwd.c. Returns the * port number, in host byte order (suitable for printf and so on). * Returns 0 on failure. Any platform not supporting getservbyname * can just return 0 - this function is not required to handle * numeric port specifications. */ -int net_service_lookup(char *service); +int net_service_lookup(const char *service); /* * Look up the local hostname; return value needs freeing. @@ -289,15 +370,25 @@ Socket *new_error_socket_consume_string(Plug *plug, char *errmsg); */ extern Plug *const nullplug; +/* + * Some trivial no-op plug functions, also in nullplug.c; exposed here + * so that other Plug implementations can use them too. + * + * In particular, nullplug_log is useful to Plugs that don't need to + * worry about logging. + */ +void nullplug_log(Plug *plug, PlugLogType type, SockAddr *addr, + int port, const char *err_msg, int err_code); +void nullplug_closing(Plug *plug, PlugCloseType type, const char *error_msg); +void nullplug_receive(Plug *plug, int urgent, const char *data, size_t len); +void nullplug_sent(Plug *plug, size_t bufsize); + /* ---------------------------------------------------------------------- * Functions defined outside the network code, which have to be * declared in this header file rather than the main putty.h because * they use types defined here. */ -/* - * Exports from be_misc.c. - */ void backend_socket_log(Seat *seat, LogContext *logctx, PlugLogType type, SockAddr *addr, int port, const char *error_msg, int error_code, Conf *conf, @@ -311,4 +402,31 @@ void psb_init(ProxyStderrBuf *psb); void log_proxy_stderr( Plug *plug, ProxyStderrBuf *psb, const void *vdata, size_t len); +/* ---------------------------------------------------------------------- + * The DeferredSocketOpener trait. This is a thing that some Socket + * implementations may choose to own if they need to delay actually + * setting up the underlying connection. For example, sockets used in + * local-proxy handling (Unix FdSocket / Windows HandleSocket) might + * need to do this if they have to prompt the user interactively for + * parts of the command they'll run. + * + * Mostly, a DeferredSocketOpener implementation will keep to itself, + * arrange its own callbacks in order to do whatever setup it needs, + * and when it's ready, call back to its parent Socket via some + * implementation-specific API of its own. So the shared API here + * requires almost nothing: the only thing we need is a free function, + * so that if the owner of a Socket of this kind needs to close it + * before the deferred connection process is finished, the Socket can + * also clean up the DeferredSocketOpener dangling off it. + */ + +struct DeferredSocketOpener { + const DeferredSocketOpenerVtable *vt; +}; +struct DeferredSocketOpenerVtable { + void (*free)(DeferredSocketOpener *); +}; +static inline void deferred_socket_opener_free(DeferredSocketOpener *dso) +{ dso->vt->free(dso); } + #endif diff --git a/code/nocmdline.c b/code/nocmdline.c deleted file mode 100644 index e4c6d08..0000000 --- a/code/nocmdline.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * nocmdline.c - stubs in applications which don't do the - * standard(ish) PuTTY tools' command-line parsing - */ - -#include -#include -#include -#include "putty.h" - -/* - * Stub version of the function in cmdline.c which provides the - * password to SSH authentication by remembering it having been passed - * as a command-line option. If we're not doing normal command-line - * handling, then there is no such option, so that function always - * returns failure. - */ -int cmdline_get_passwd_input(prompts_t *p) -{ - return -1; -} - -/* - * The main cmdline_process_param function is normally called from - * applications' main(). An application linking against this stub - * module shouldn't have a main() that calls it in the first place :-) - * but it is just occasionally called by other supporting functions, - * such as one in uxputty.c which sometimes handles a non-option - * argument by making up equivalent options and passing them back to - * this function. So we have to provide a link-time stub of this - * function, but it had better not end up being called at run time. - */ -int cmdline_process_param(const char *p, char *value, - int need_save, Conf *conf) -{ - unreachable("cmdline_process_param should never be called"); -} diff --git a/code/nocproxy.c b/code/nocproxy.c deleted file mode 100644 index f93214f..0000000 --- a/code/nocproxy.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Routines to refuse to do cryptographic interaction with proxies - * in PuTTY. This is a stub implementation of the same interfaces - * provided by cproxy.c, for use in PuTTYtel. - */ - -#include -#include -#include - -#include "putty.h" -#include "network.h" -#include "proxy.h" - -void proxy_socks5_offerencryptedauth(BinarySink *bs) -{ - /* For telnet, don't add any new encrypted authentication routines */ -} - -int proxy_socks5_handlechap (ProxySocket *p) -{ - - plug_closing(p->plug, "Proxy error: Trying to handle a SOCKS5 CHAP request" - " in telnet-only build", - PROXY_ERROR_GENERAL, 0); - return 1; -} - -int proxy_socks5_selectchap(ProxySocket *p) -{ - plug_closing(p->plug, "Proxy error: Trying to handle a SOCKS5 CHAP request" - " in telnet-only build", - PROXY_ERROR_GENERAL, 0); - return 1; -} diff --git a/code/otherbackends/CMakeLists.txt b/code/otherbackends/CMakeLists.txt new file mode 100644 index 0000000..099d125 --- /dev/null +++ b/code/otherbackends/CMakeLists.txt @@ -0,0 +1,6 @@ +add_sources_from_current_dir(otherbackends + raw.c + rlogin.c + supdup.c + telnet.c + testback.c) diff --git a/code/raw.c b/code/otherbackends/raw.c similarity index 76% rename from code/raw.c rename to code/otherbackends/raw.c index 0c45498..c9a32e0 100644 --- a/code/raw.c +++ b/code/otherbackends/raw.c @@ -17,12 +17,15 @@ struct Raw { size_t bufsize; Seat *seat; LogContext *logctx; - bool sent_console_eof, sent_socket_eof, session_started; + Ldisc *ldisc; + bool sent_console_eof, sent_socket_eof, socket_connected; + char *description; Conf *conf; Plug plug; Backend backend; + Interactor interactor; }; static void raw_size(Backend *be, int width, int height); @@ -37,8 +40,13 @@ static void raw_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, const char *error_msg, int error_code) { Raw *raw = container_of(plug, Raw, plug); - backend_socket_log(raw->seat, raw->logctx, type, addr, port, - error_msg, error_code, raw->conf, raw->session_started); + backend_socket_log(raw->seat, raw->logctx, type, addr, port, error_msg, + error_code, raw->conf, raw->socket_connected); + if (type == PLUGLOG_CONNECT_SUCCESS) { + raw->socket_connected = true; + if (raw->ldisc) + ldisc_check_sendok(raw->ldisc); + } } static void raw_check_close(Raw *raw) @@ -52,25 +60,27 @@ static void raw_check_close(Raw *raw) sk_close(raw->s); raw->s = NULL; seat_notify_remote_exit(raw->seat); + seat_notify_remote_disconnect(raw->seat); } } } -static void raw_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void raw_closing(Plug *plug, PlugCloseType type, const char *error_msg) { Raw *raw = container_of(plug, Raw, plug); - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { /* A socket error has occurred. */ if (raw->s) { sk_close(raw->s); raw->s = NULL; raw->closed_on_socket_error = true; seat_notify_remote_exit(raw->seat); + seat_notify_remote_disconnect(raw->seat); } logevent(raw->logctx, error_msg); - seat_connection_fatal(raw->seat, "%s", error_msg); + if (type != PLUGCLOSE_USER_ABORT) + seat_connection_fatal(raw->seat, "%s", error_msg); } else { /* Otherwise, the remote side closed the connection normally. */ if (!raw->sent_console_eof && seat_eof(raw->seat)) { @@ -93,15 +103,13 @@ static void raw_receive(Plug *plug, int urgent, const char *data, size_t len) { Raw *raw = container_of(plug, Raw, plug); c_write(raw, data, len); - /* We count 'session start', for proxy logging purposes, as being - * when data is received from the network and printed. */ - raw->session_started = true; } static void raw_sent(Plug *plug, size_t bufsize) { Raw *raw = container_of(plug, Raw, plug); raw->bufsize = bufsize; + seat_sent(raw->seat, raw->bufsize); } static const PlugVtable Raw_plugvt = { @@ -111,6 +119,37 @@ static const PlugVtable Raw_plugvt = { .sent = raw_sent, }; +static char *raw_description(Interactor *itr) +{ + Raw *raw = container_of(itr, Raw, interactor); + return dupstr(raw->description); +} + +static LogPolicy *raw_logpolicy(Interactor *itr) +{ + Raw *raw = container_of(itr, Raw, interactor); + return log_get_policy(raw->logctx); +} + +static Seat *raw_get_seat(Interactor *itr) +{ + Raw *raw = container_of(itr, Raw, interactor); + return raw->seat; +} + +static void raw_set_seat(Interactor *itr, Seat *seat) +{ + Raw *raw = container_of(itr, Raw, interactor); + raw->seat = seat; +} + +static const InteractorVtable Raw_interactorvt = { + .description = raw_description, + .logpolicy = raw_logpolicy, + .get_seat = raw_get_seat, + .set_seat = raw_set_seat, +}; + /* * Called to set up the raw connection. * @@ -130,19 +169,20 @@ static char *raw_init(const BackendVtable *vt, Seat *seat, int addressfamily; char *loghost; - /* No local authentication phase in this protocol */ - seat_set_trust_status(seat, false); - raw = snew(Raw); + memset(raw, 0, sizeof(Raw)); raw->plug.vt = &Raw_plugvt; raw->backend.vt = vt; + raw->interactor.vt = &Raw_interactorvt; + raw->backend.interactor = &raw->interactor; raw->s = NULL; raw->closed_on_socket_error = false; *backend_handle = &raw->backend; raw->sent_console_eof = raw->sent_socket_eof = false; raw->bufsize = 0; - raw->session_started = false; + raw->socket_connected = false; raw->conf = conf_copy(conf); + raw->description = default_description(vt, host, port); raw->seat = seat; raw->logctx = logctx; @@ -165,10 +205,13 @@ static char *raw_init(const BackendVtable *vt, Seat *seat, * Open socket. */ raw->s = new_connection(addr, *realhost, port, false, true, nodelay, - keepalive, &raw->plug, conf); + keepalive, &raw->plug, conf, &raw->interactor); if ((err = sk_socket_error(raw->s)) != NULL) return dupstr(err); + /* No local authentication phase in this protocol */ + seat_set_trust_status(raw->seat, false); + loghost = conf_get_str(conf, CONF_loghost); if (*loghost) { char *colon; @@ -188,9 +231,12 @@ static void raw_free(Backend *be) { Raw *raw = container_of(be, Raw, backend); + if (is_tempseat(raw->seat)) + tempseat_free(raw->seat); if (raw->s) sk_close(raw->s); conf_free(raw->conf); + sfree(raw->description); sfree(raw); } @@ -204,16 +250,14 @@ static void raw_reconfig(Backend *be, Conf *conf) /* * Called to send data down the raw connection. */ -static size_t raw_send(Backend *be, const char *buf, size_t len) +static void raw_send(Backend *be, const char *buf, size_t len) { Raw *raw = container_of(be, Raw, backend); if (raw->s == NULL) - return 0; + return; raw->bufsize = sk_write(raw->s, buf, len); - - return raw->bufsize; } /* @@ -266,7 +310,8 @@ static bool raw_connected(Backend *be) static bool raw_sendok(Backend *be) { - return true; + Raw *raw = container_of(be, Raw, backend); + return raw->socket_connected; } static void raw_unthrottle(Backend *be, size_t backlog) @@ -284,7 +329,8 @@ static bool raw_ldisc(Backend *be, int option) static void raw_provide_ldisc(Backend *be, Ldisc *ldisc) { - /* This is a stub. */ + Raw *raw = container_of(be, Raw, backend); + raw->ldisc = ldisc; } static int raw_exitcode(Backend *be) @@ -324,7 +370,8 @@ const BackendVtable raw_backend = { .unthrottle = raw_unthrottle, .cfg_info = raw_cfg_info, .id = "raw", - .displayname = "Raw", + .displayname_tc = "Raw", + .displayname_lc = "raw", .protocol = PROT_RAW, .default_port = 0, }; diff --git a/code/rlogin.c b/code/otherbackends/rlogin.c similarity index 60% rename from code/rlogin.c rename to code/otherbackends/rlogin.c index 2a3714e..3708725 100644 --- a/code/rlogin.c +++ b/code/otherbackends/rlogin.c @@ -16,11 +16,14 @@ struct Rlogin { Socket *s; bool closed_on_socket_error; int bufsize; + bool socket_connected; bool firstbyte; bool cansize; int term_width, term_height; Seat *seat; LogContext *logctx; + Ldisc *ldisc; + char *description; Conf *conf; @@ -29,8 +32,13 @@ struct Rlogin { Plug plug; Backend backend; + Interactor interactor; }; +static void rlogin_startup(Rlogin *rlogin, SeatPromptResult spr, + const char *ruser); +static void rlogin_try_username_prompt(void *ctx); + static void c_write(Rlogin *rlogin, const void *buf, size_t len) { size_t backlog = seat_stdout(rlogin->seat, buf, len); @@ -43,11 +51,42 @@ static void rlogin_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, Rlogin *rlogin = container_of(plug, Rlogin, plug); backend_socket_log(rlogin->seat, rlogin->logctx, type, addr, port, error_msg, error_code, - rlogin->conf, !rlogin->firstbyte); + rlogin->conf, rlogin->socket_connected); + if (type == PLUGLOG_CONNECT_SUCCESS) { + rlogin->socket_connected = true; + + char *ruser = get_remote_username(rlogin->conf); + if (ruser) { + /* + * If we already know the remote username, call + * rlogin_startup, which will send the initial protocol + * greeting including local username, remote username, + * terminal type and terminal speed. + */ + /* Next terminal output will come from server */ + seat_set_trust_status(rlogin->seat, false); + rlogin_startup(rlogin, SPR_OK, ruser); + sfree(ruser); + } else { + /* + * Otherwise, set up a prompts_t asking for the local + * username. If it completes synchronously, call + * rlogin_startup as above; otherwise, wait until it does. + */ + rlogin->prompt = new_prompts(); + rlogin->prompt->to_server = true; + rlogin->prompt->from_server = false; + rlogin->prompt->name = dupstr("Rlogin login name"); + rlogin->prompt->callback = rlogin_try_username_prompt; + rlogin->prompt->callback_ctx = rlogin; + add_prompt(rlogin->prompt, dupstr("rlogin username: "), true); + rlogin_try_username_prompt(rlogin); + } + } } -static void rlogin_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void rlogin_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { Rlogin *rlogin = container_of(plug, Rlogin, plug); @@ -63,12 +102,15 @@ static void rlogin_closing(Plug *plug, const char *error_msg, int error_code, if (error_msg) rlogin->closed_on_socket_error = true; seat_notify_remote_exit(rlogin->seat); + seat_notify_remote_disconnect(rlogin->seat); } - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { /* A socket error has occurred. */ logevent(rlogin->logctx, error_msg); - seat_connection_fatal(rlogin->seat, "%s", error_msg); - } /* Otherwise, the remote side closed the connection normally. */ + if (type != PLUGCLOSE_USER_ABORT) + seat_connection_fatal(rlogin->seat, "%s", error_msg); + } + /* Otherwise, the remote side closed the connection normally. */ } static void rlogin_receive( @@ -115,27 +157,46 @@ static void rlogin_sent(Plug *plug, size_t bufsize) { Rlogin *rlogin = container_of(plug, Rlogin, plug); rlogin->bufsize = bufsize; + seat_sent(rlogin->seat, rlogin->bufsize); } -static void rlogin_startup(Rlogin *rlogin, const char *ruser) +static void rlogin_startup(Rlogin *rlogin, SeatPromptResult spr, + const char *ruser) { char z = 0; char *p; - sk_write(rlogin->s, &z, 1); - p = conf_get_str(rlogin->conf, CONF_localusername); - sk_write(rlogin->s, p, strlen(p)); - sk_write(rlogin->s, &z, 1); - sk_write(rlogin->s, ruser, strlen(ruser)); - sk_write(rlogin->s, &z, 1); - p = conf_get_str(rlogin->conf, CONF_termtype); - sk_write(rlogin->s, p, strlen(p)); - sk_write(rlogin->s, "/", 1); - p = conf_get_str(rlogin->conf, CONF_termspeed); - sk_write(rlogin->s, p, strspn(p, "0123456789")); - rlogin->bufsize = sk_write(rlogin->s, &z, 1); + if (spr.kind == SPRK_USER_ABORT) { + /* User aborted at the username prompt. */ + sk_close(rlogin->s); + rlogin->s = NULL; + seat_notify_remote_exit(rlogin->seat); + } else if (spr.kind == SPRK_SW_ABORT) { + /* Something else went wrong at the username prompt, so we + * have to show some kind of error. */ + sk_close(rlogin->s); + rlogin->s = NULL; + char *err = spr_get_error_message(spr); + seat_connection_fatal(rlogin->seat, "%s", err); + sfree(err); + } else { + sk_write(rlogin->s, &z, 1); + p = conf_get_str(rlogin->conf, CONF_localusername); + sk_write(rlogin->s, p, strlen(p)); + sk_write(rlogin->s, &z, 1); + sk_write(rlogin->s, ruser, strlen(ruser)); + sk_write(rlogin->s, &z, 1); + p = conf_get_str(rlogin->conf, CONF_termtype); + sk_write(rlogin->s, p, strlen(p)); + sk_write(rlogin->s, "/", 1); + p = conf_get_str(rlogin->conf, CONF_termspeed); + sk_write(rlogin->s, p, strspn(p, "0123456789")); + rlogin->bufsize = sk_write(rlogin->s, &z, 1); + } rlogin->prompt = NULL; + if (rlogin->ldisc) + ldisc_check_sendok(rlogin->ldisc); } static const PlugVtable Rlogin_plugvt = { @@ -145,6 +206,37 @@ static const PlugVtable Rlogin_plugvt = { .sent = rlogin_sent, }; +static char *rlogin_description(Interactor *itr) +{ + Rlogin *rlogin = container_of(itr, Rlogin, interactor); + return dupstr(rlogin->description); +} + +static LogPolicy *rlogin_logpolicy(Interactor *itr) +{ + Rlogin *rlogin = container_of(itr, Rlogin, interactor); + return log_get_policy(rlogin->logctx); +} + +static Seat *rlogin_get_seat(Interactor *itr) +{ + Rlogin *rlogin = container_of(itr, Rlogin, interactor); + return rlogin->seat; +} + +static void rlogin_set_seat(Interactor *itr, Seat *seat) +{ + Rlogin *rlogin = container_of(itr, Rlogin, interactor); + rlogin->seat = seat; +} + +static const InteractorVtable Rlogin_interactorvt = { + .description = rlogin_description, + .logpolicy = rlogin_logpolicy, + .get_seat = rlogin_get_seat, + .set_seat = rlogin_set_seat, +}; + /* * Called to set up the rlogin connection. * @@ -161,23 +253,27 @@ static char *rlogin_init(const BackendVtable *vt, Seat *seat, SockAddr *addr; const char *err; Rlogin *rlogin; - char *ruser; int addressfamily; char *loghost; rlogin = snew(Rlogin); + memset(rlogin, 0, sizeof(Rlogin)); rlogin->plug.vt = &Rlogin_plugvt; rlogin->backend.vt = vt; + rlogin->interactor.vt = &Rlogin_interactorvt; + rlogin->backend.interactor = &rlogin->interactor; rlogin->s = NULL; rlogin->closed_on_socket_error = false; rlogin->seat = seat; rlogin->logctx = logctx; rlogin->term_width = conf_get_int(conf, CONF_width); rlogin->term_height = conf_get_int(conf, CONF_height); + rlogin->socket_connected = false; rlogin->firstbyte = true; rlogin->cansize = false; rlogin->prompt = NULL; rlogin->conf = conf_copy(conf); + rlogin->description = default_description(vt, host, port); *backend_handle = &rlogin->backend; addressfamily = conf_get_int(conf, CONF_addressfamily); @@ -198,7 +294,8 @@ static char *rlogin_init(const BackendVtable *vt, Seat *seat, * Open socket. */ rlogin->s = new_connection(addr, *realhost, port, true, false, - nodelay, keepalive, &rlogin->plug, conf); + nodelay, keepalive, &rlogin->plug, conf, + &rlogin->interactor); if ((err = sk_socket_error(rlogin->s)) != NULL) return dupstr(err); @@ -214,34 +311,6 @@ static char *rlogin_init(const BackendVtable *vt, Seat *seat, *colon++ = '\0'; } - /* - * Send local username, remote username, terminal type and - * terminal speed - unless we don't have the remote username yet, - * in which case we prompt for it and may end up deferring doing - * anything else until the local prompt mechanism returns. - */ - if ((ruser = get_remote_username(conf)) != NULL) { - /* Next terminal output will come from server */ - seat_set_trust_status(rlogin->seat, false); - rlogin_startup(rlogin, ruser); - sfree(ruser); - } else { - int ret; - - rlogin->prompt = new_prompts(); - rlogin->prompt->to_server = true; - rlogin->prompt->from_server = false; - rlogin->prompt->name = dupstr("Rlogin login name"); - add_prompt(rlogin->prompt, dupstr("rlogin username: "), true); - ret = seat_get_userpass_input(rlogin->seat, rlogin->prompt, NULL); - if (ret >= 0) { - /* Next terminal output will come from server */ - seat_set_trust_status(rlogin->seat, false); - rlogin_startup(rlogin, prompt_get_result_ref( - rlogin->prompt->prompts[0])); - } - } - return NULL; } @@ -249,11 +318,14 @@ static void rlogin_free(Backend *be) { Rlogin *rlogin = container_of(be, Rlogin, backend); + if (is_tempseat(rlogin->seat)) + tempseat_free(rlogin->seat); if (rlogin->prompt) free_prompts(rlogin->prompt); if (rlogin->s) sk_close(rlogin->s); conf_free(rlogin->conf); + sfree(rlogin->description); sfree(rlogin); } @@ -264,47 +336,37 @@ static void rlogin_reconfig(Backend *be, Conf *conf) { } +static void rlogin_try_username_prompt(void *ctx) +{ + Rlogin *rlogin = (Rlogin *)ctx; + + SeatPromptResult spr = seat_get_userpass_input( + interactor_announce(&rlogin->interactor), rlogin->prompt); + if (spr.kind == SPRK_INCOMPLETE) + return; + + /* Next terminal output will come from server */ + seat_set_trust_status(rlogin->seat, false); + + /* Send the rlogin setup protocol data, and then we're ready to + * start receiving normal input to send down the wire, which + * rlogin_startup will signal to rlogin_sendok by nulling out + * rlogin->prompt. */ + rlogin_startup( + rlogin, spr, prompt_get_result_ref(rlogin->prompt->prompts[0])); +} + /* * Called to send data down the rlogin connection. */ -static size_t rlogin_send(Backend *be, const char *buf, size_t len) +static void rlogin_send(Backend *be, const char *buf, size_t len) { Rlogin *rlogin = container_of(be, Rlogin, backend); - bufchain bc; if (rlogin->s == NULL) - return 0; - - bufchain_init(&bc); - bufchain_add(&bc, buf, len); - - if (rlogin->prompt) { - /* - * We're still prompting for a username, and aren't talking - * directly to the network connection yet. - */ - int ret = seat_get_userpass_input(rlogin->seat, rlogin->prompt, &bc); - if (ret >= 0) { - /* Next terminal output will come from server */ - seat_set_trust_status(rlogin->seat, false); - rlogin_startup(rlogin, prompt_get_result_ref( - rlogin->prompt->prompts[0])); - /* that nulls out rlogin->prompt, so then we'll start sending - * data down the wire in the obvious way */ - } - } - - if (!rlogin->prompt) { - while (bufchain_size(&bc) > 0) { - ptrlen data = bufchain_prefix(&bc); - rlogin->bufsize = sk_write(rlogin->s, data.ptr, data.len); - bufchain_consume(&bc, len); - } - } - - bufchain_clear(&bc); + return; - return rlogin->bufsize; + rlogin->bufsize = sk_write(rlogin->s, buf, len); } /* @@ -364,8 +426,12 @@ static bool rlogin_connected(Backend *be) static bool rlogin_sendok(Backend *be) { - /* Rlogin *rlogin = container_of(be, Rlogin, backend); */ - return true; + /* + * We only want to receive input data if the socket is connected + * and we're not still at the username prompt stage. + */ + Rlogin *rlogin = container_of(be, Rlogin, backend); + return rlogin->socket_connected && !rlogin->prompt; } static void rlogin_unthrottle(Backend *be, size_t backlog) @@ -382,7 +448,8 @@ static bool rlogin_ldisc(Backend *be, int option) static void rlogin_provide_ldisc(Backend *be, Ldisc *ldisc) { - /* This is a stub. */ + Rlogin *rlogin = container_of(be, Rlogin, backend); + rlogin->ldisc = ldisc; } static int rlogin_exitcode(Backend *be) @@ -422,7 +489,8 @@ const BackendVtable rlogin_backend = { .unthrottle = rlogin_unthrottle, .cfg_info = rlogin_cfg_info, .id = "rlogin", - .displayname = "Rlogin", + .displayname_tc = "Rlogin", + .displayname_lc = "Rlogin", /* proper name, so capitalise it anyway */ .protocol = PROT_RLOGIN, .default_port = 513, }; diff --git a/code/supdup.c b/code/otherbackends/supdup.c similarity index 90% rename from code/supdup.c rename to code/otherbackends/supdup.c index f210ebe..a272b25 100644 --- a/code/supdup.c +++ b/code/otherbackends/supdup.c @@ -66,11 +66,14 @@ typedef struct supdup_tag Supdup; struct supdup_tag { Socket *s; + bool socket_connected; bool closed_on_socket_error; Seat *seat; LogContext *logctx; + Ldisc *ldisc; int term_width, term_height; + char *description; long long ttyopt; long tcmxv; @@ -104,6 +107,7 @@ struct supdup_tag Plug plug; Backend backend; + Interactor interactor; }; #define SUPDUP_MAX_BACKLOG 4096 @@ -285,7 +289,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) */ // We only care about the new position. - strbuf_catf(outbuf, "\033[%d;%dH", supdup->td_args[2]+1, supdup->td_args[3]+1); + put_fmt(outbuf, "\033[%d;%dH", supdup->td_args[2]+1, supdup->td_args[3]+1); break; case TDMV0: @@ -294,7 +298,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) General cursor position code. Followed by two bytes; the new vertical and horizontal positions. */ - strbuf_catf(outbuf, "\033[%d;%dH", supdup->td_args[0]+1, supdup->td_args[1]+1); + put_fmt(outbuf, "\033[%d;%dH", supdup->td_args[0]+1, supdup->td_args[1]+1); break; case TDEOF: @@ -308,7 +312,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) lines lower on the screen than the cursor. The cursor does not move. */ - strbuf_catf(outbuf, "\033[J"); + put_fmt(outbuf, "\033[J"); break; case TDEOL: @@ -317,7 +321,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) position the cursor is at and all positions to the right on the same line. The cursor does not move. */ - strbuf_catf(outbuf, "\033[K"); + put_fmt(outbuf, "\033[K"); break; case TDDLF: @@ -325,7 +329,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) Clear the character position the cursor is on. The cursor does not move. */ - strbuf_catf(outbuf, "\033[X"); + put_fmt(outbuf, "\033[X"); break; case TDCRL: @@ -335,7 +339,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) that line. If the cursor is at the bottom line, scroll up. */ - strbuf_catf(outbuf, "\015\012"); + put_fmt(outbuf, "\015\012"); break; case TDNOP: @@ -379,7 +383,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) line. */ - strbuf_catf(outbuf, "\033[C"); + put_fmt(outbuf, "\033[C"); break; case TDCLR: @@ -387,7 +391,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) Erase the screen. Home the cursor to the top left hand corner of the screen. */ - strbuf_catf(outbuf, "\033[2J\033[H"); + put_fmt(outbuf, "\033[2J\033[H"); break; case TDBEL: @@ -395,7 +399,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) Generate an audio tone, bell, whatever. */ - strbuf_catf(outbuf, "\007"); + put_fmt(outbuf, "\007"); break; case TDILP: @@ -406,7 +410,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) on and all lines below it move down; lines moved off the bottom of the screen are lost. */ - strbuf_catf(outbuf, "\033[%dL", supdup->td_args[0]); + put_fmt(outbuf, "\033[%dL", supdup->td_args[0]); break; case TDDLP: @@ -417,7 +421,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) Newly- created lines at the bottom of the screen are blank. */ - strbuf_catf(outbuf, "\033[%dM", supdup->td_args[0]); + put_fmt(outbuf, "\033[%dM", supdup->td_args[0]); break; case TDICP: @@ -428,7 +432,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) current line move to the right; characters moved off the end of the line are lost. */ - strbuf_catf(outbuf, "\033[%d@", supdup->td_args[0]); + put_fmt(outbuf, "\033[%d@", supdup->td_args[0]); break; case TDDCP: @@ -438,7 +442,7 @@ static void do_argsdone(Supdup *supdup, strbuf *outbuf, int c) the one the cursor is on. Newly-created characters at the end of the line are blank. */ - strbuf_catf(outbuf, "\033[%dP", supdup->td_args[0]); + put_fmt(outbuf, "\033[%dP", supdup->td_args[0]); break; case TDBOW: @@ -561,11 +565,16 @@ static void supdup_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, Supdup *supdup = container_of(plug, Supdup, plug); backend_socket_log(supdup->seat, supdup->logctx, type, addr, port, error_msg, error_code, - supdup->conf, supdup->state != CONNECTING); + supdup->conf, supdup->socket_connected); + if (type == PLUGLOG_CONNECT_SUCCESS) { + supdup->socket_connected = true; + if (supdup->ldisc) + ldisc_check_sendok(supdup->ldisc); + } } -static void supdup_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void supdup_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { Supdup *supdup = container_of(plug, Supdup, plug); @@ -581,10 +590,12 @@ static void supdup_closing(Plug *plug, const char *error_msg, int error_code, if (error_msg) supdup->closed_on_socket_error = true; seat_notify_remote_exit(supdup->seat); + seat_notify_remote_disconnect(supdup->seat); } - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { logevent(supdup->logctx, error_msg); - seat_connection_fatal(supdup->seat, "%s", error_msg); + if (type != PLUGCLOSE_USER_ABORT) + seat_connection_fatal(supdup->seat, "%s", error_msg); } /* Otherwise, the remote side closed the connection normally. */ } @@ -599,6 +610,7 @@ static void supdup_sent(Plug *plug, size_t bufsize) { Supdup *supdup = container_of(plug, Supdup, plug); supdup->bufsize = bufsize; + seat_sent(supdup->seat, supdup->bufsize); } static void supdup_send_36bits(Supdup *supdup, unsigned long long thirtysix) @@ -627,6 +639,37 @@ static void supdup_send_config(Supdup *supdup) supdup_send_36bits(supdup, TTYROL); // scroll amount } +static char *supdup_description(Interactor *itr) +{ + Supdup *supdup = container_of(itr, Supdup, interactor); + return dupstr(supdup->description); +} + +static LogPolicy *supdup_logpolicy(Interactor *itr) +{ + Supdup *supdup = container_of(itr, Supdup, interactor); + return log_get_policy(supdup->logctx); +} + +static Seat *supdup_get_seat(Interactor *itr) +{ + Supdup *supdup = container_of(itr, Supdup, interactor); + return supdup->seat; +} + +static void supdup_set_seat(Interactor *itr, Seat *seat) +{ + Supdup *supdup = container_of(itr, Supdup, interactor); + supdup->seat = seat; +} + +static const InteractorVtable Supdup_interactorvt = { + .description = supdup_description, + .logpolicy = supdup_logpolicy, + .get_seat = supdup_get_seat, + .set_seat = supdup_set_seat, +}; + /* * Called to set up the Supdup connection. * @@ -655,17 +698,22 @@ static char *supdup_init(const BackendVtable *x, Seat *seat, const char *utf8 = "\033%G"; supdup = snew(struct supdup_tag); + memset(supdup, 0, sizeof(Supdup)); supdup->plug.vt = &fn_table; supdup->backend.vt = &supdup_backend; + supdup->interactor.vt = &Supdup_interactorvt; + supdup->backend.interactor = &supdup->interactor; supdup->logctx = logctx; supdup->conf = conf_copy(conf); supdup->s = NULL; + supdup->socket_connected = false; supdup->closed_on_socket_error = false; supdup->seat = seat; supdup->term_width = conf_get_int(supdup->conf, CONF_width); supdup->term_height = conf_get_int(supdup->conf, CONF_height); supdup->pinger = NULL; supdup->sent_location = false; + supdup->description = default_description(supdup->backend.vt, host, port); *backend_handle = &supdup->backend; switch (conf_get_int(supdup->conf, CONF_supdup_ascii_set)) { @@ -706,7 +754,8 @@ static char *supdup_init(const BackendVtable *x, Seat *seat, * Open socket. */ supdup->s = new_connection(addr, *realhost, port, false, true, - nodelay, keepalive, &supdup->plug, supdup->conf); + nodelay, keepalive, &supdup->plug, supdup->conf, + &supdup->interactor); if ((err = sk_socket_error(supdup->s)) != NULL) return dupstr(err); @@ -776,11 +825,14 @@ static void supdup_free(Backend *be) { Supdup *supdup = container_of(be, Supdup, backend); + if (is_tempseat(supdup->seat)) + tempseat_free(supdup->seat); if (supdup->s) sk_close(supdup->s); if (supdup->pinger) pinger_free(supdup->pinger); conf_free(supdup->conf); + sfree(supdup->description); sfree(supdup); } @@ -795,14 +847,14 @@ static void supdup_reconfig(Backend *be, Conf *conf) /* * Called to send data down the Supdup connection. */ -static size_t supdup_send(Backend *be, const char *buf, size_t len) +static void supdup_send(Backend *be, const char *buf, size_t len) { Supdup *supdup = container_of(be, Supdup, backend); char c; int i; if (supdup->s == NULL) - return 0; + return; for (i = 0; i < len; i++) { if (buf[i] == 034) @@ -812,7 +864,6 @@ static size_t supdup_send(Backend *be, const char *buf, size_t len) supdup->bufsize = sk_write(supdup->s, &c, 1); } } - return supdup->bufsize; } /* @@ -860,7 +911,8 @@ static bool supdup_connected(Backend *be) static bool supdup_sendok(Backend *be) { - return 1; + Supdup *supdup = container_of(be, Supdup, backend); + return supdup->socket_connected; } static void supdup_unthrottle(Backend *be, size_t backlog) @@ -877,6 +929,8 @@ static bool supdup_ldisc(Backend *be, int option) static void supdup_provide_ldisc(Backend *be, Ldisc *ldisc) { + Supdup *supdup = container_of(be, Supdup, backend); + supdup->ldisc = ldisc; } static int supdup_exitcode(Backend *be) @@ -916,7 +970,8 @@ const BackendVtable supdup_backend = { .unthrottle = supdup_unthrottle, .cfg_info = supdup_cfg_info, .id = "supdup", - .displayname = "SUPDUP", + .displayname_tc = "SUPDUP", + .displayname_lc = "SUPDUP", /* proper name, so capitalise it anyway */ .protocol = PROT_SUPDUP, .default_port = 0137, .flags = BACKEND_RESIZE_FORBIDDEN | BACKEND_NEEDS_TERMINAL, diff --git a/code/telnet.c b/code/otherbackends/telnet.c similarity index 91% rename from code/telnet.c rename to code/otherbackends/telnet.c index 3a60e64..1c0f5d6 100644 --- a/code/telnet.c +++ b/code/otherbackends/telnet.c @@ -171,12 +171,14 @@ static const struct Opt *const opts[] = { typedef struct Telnet Telnet; struct Telnet { Socket *s; + bool socket_connected; bool closed_on_socket_error; Seat *seat; LogContext *logctx; Ldisc *ldisc; int term_width, term_height; + char *description; int opt_states[NUM_OPTS]; @@ -186,7 +188,6 @@ struct Telnet { bool in_synch; int sb_opt; strbuf *sb_buf; - bool session_started; enum { TOP_LEVEL, SEENIAC, SEENWILL, SEENWONT, SEENDO, SEENDONT, @@ -199,6 +200,7 @@ struct Telnet { Plug plug; Backend backend; + Interactor interactor; }; #define TELNET_MAX_BACKLOG 4096 @@ -218,7 +220,7 @@ static void log_option(Telnet *telnet, const char *sender, int cmd, int option) * trigraph - a double question mark followed by > maps to a * closing brace character! */ - logeventf(telnet->logctx, "%s:\t%s %s", sender, + logeventf(telnet->logctx, "%s negotiation: %s %s", sender, (cmd == WILL ? "WILL" : cmd == WONT ? "WONT" : cmd == DO ? "DO" : cmd == DONT ? "DONT" : ""), telopt(option)); @@ -374,11 +376,13 @@ static void process_subneg(Telnet *telnet) b[n] = IAC; b[n + 1] = SE; telnet->bufsize = sk_write(telnet->s, b, n + 2); - logevent(telnet->logctx, "server:\tSB TSPEED SEND"); - logeventf(telnet->logctx, "client:\tSB TSPEED IS %s", termspeed); + logevent(telnet->logctx, "server subnegotiation: SB TSPEED SEND"); + logeventf(telnet->logctx, + "client subnegotiation: SB TSPEED IS %s", termspeed); sfree(b); } else - logevent(telnet->logctx, "server:\tSB TSPEED "); + logevent(telnet->logctx, + "server subnegotiation: SB TSPEED "); break; case TELOPT_TTYPE: if (telnet->sb_buf->len == 1 && telnet->sb_buf->u[0] == TELQUAL_SEND) { @@ -396,11 +400,14 @@ static void process_subneg(Telnet *telnet) b[n + 5] = SE; telnet->bufsize = sk_write(telnet->s, b, n + 6); b[n + 4] = 0; - logevent(telnet->logctx, "server:\tSB TTYPE SEND"); - logeventf(telnet->logctx, "client:\tSB TTYPE IS %s", b + 4); + logevent(telnet->logctx, + "server subnegotiation: SB TTYPE SEND"); + logeventf(telnet->logctx, + "client subnegotiation: SB TTYPE IS %s", b + 4); sfree(b); } else - logevent(telnet->logctx, "server:\tSB TTYPE \r\n"); + logevent(telnet->logctx, + "server subnegotiation: SB TTYPE \r\n"); break; case TELOPT_OLD_ENVIRON: case TELOPT_NEW_ENVIRON: @@ -408,7 +415,7 @@ static void process_subneg(Telnet *telnet) q = p + telnet->sb_buf->len; if (p < q && *p == TELQUAL_SEND) { p++; - logeventf(telnet->logctx, "server:\tSB %s SEND", + logeventf(telnet->logctx, "server subnegotiation: SB %s SEND", telopt(telnet->sb_opt)); if (telnet->sb_opt == TELOPT_OLD_ENVIRON) { if (conf_get_bool(telnet->conf, CONF_rfc_environ)) { @@ -482,20 +489,21 @@ static void process_subneg(Telnet *telnet) b[n++] = SE; telnet->bufsize = sk_write(telnet->s, b, n); if (n == 6) { - logeventf(telnet->logctx, "client:\tSB %s IS ", + logeventf(telnet->logctx, + "client subnegotiation: SB %s IS ", telopt(telnet->sb_opt)); } else { - logeventf(telnet->logctx, "client:\tSB %s IS:", + logeventf(telnet->logctx, "client subnegotiation: SB %s IS:", telopt(telnet->sb_opt)); for (eval = conf_get_str_strs(telnet->conf, CONF_environmt, NULL, &ekey); eval != NULL; eval = conf_get_str_strs(telnet->conf, CONF_environmt, ekey, &ekey)) { - logeventf(telnet->logctx, "\t%s=%s", ekey, eval); + logeventf(telnet->logctx, " %s=%s", ekey, eval); } if (user) - logeventf(telnet->logctx, "\tUSER=%s", user); + logeventf(telnet->logctx, " USER=%s", user); } sfree(b); sfree(user); @@ -619,11 +627,16 @@ static void telnet_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, Telnet *telnet = container_of(plug, Telnet, plug); backend_socket_log(telnet->seat, telnet->logctx, type, addr, port, error_msg, error_code, telnet->conf, - telnet->session_started); + telnet->socket_connected); + if (type == PLUGLOG_CONNECT_SUCCESS) { + telnet->socket_connected = true; + if (telnet->ldisc) + ldisc_check_sendok(telnet->ldisc); + } } -static void telnet_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void telnet_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { Telnet *telnet = container_of(plug, Telnet, plug); @@ -639,10 +652,12 @@ static void telnet_closing(Plug *plug, const char *error_msg, int error_code, if (error_msg) telnet->closed_on_socket_error = true; seat_notify_remote_exit(telnet->seat); + seat_notify_remote_disconnect(telnet->seat); } - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { logevent(telnet->logctx, error_msg); - seat_connection_fatal(telnet->seat, "%s", error_msg); + if (type != PLUGCLOSE_USER_ABORT) + seat_connection_fatal(telnet->seat, "%s", error_msg); } /* Otherwise, the remote side closed the connection normally. */ } @@ -653,7 +668,6 @@ static void telnet_receive( Telnet *telnet = container_of(plug, Telnet, plug); if (urgent) telnet->in_synch = true; - telnet->session_started = true; do_telnet_read(telnet, data, len); } @@ -661,6 +675,7 @@ static void telnet_sent(Plug *plug, size_t bufsize) { Telnet *telnet = container_of(plug, Telnet, plug); telnet->bufsize = bufsize; + seat_sent(telnet->seat, telnet->bufsize); } static const PlugVtable Telnet_plugvt = { @@ -670,6 +685,37 @@ static const PlugVtable Telnet_plugvt = { .sent = telnet_sent, }; +static char *telnet_description(Interactor *itr) +{ + Telnet *telnet = container_of(itr, Telnet, interactor); + return dupstr(telnet->description); +} + +static LogPolicy *telnet_logpolicy(Interactor *itr) +{ + Telnet *telnet = container_of(itr, Telnet, interactor); + return log_get_policy(telnet->logctx); +} + +static Seat *telnet_get_seat(Interactor *itr) +{ + Telnet *telnet = container_of(itr, Telnet, interactor); + return telnet->seat; +} + +static void telnet_set_seat(Interactor *itr, Seat *seat) +{ + Telnet *telnet = container_of(itr, Telnet, interactor); + telnet->seat = seat; +} + +static const InteractorVtable Telnet_interactorvt = { + .description = telnet_description, + .logpolicy = telnet_logpolicy, + .get_seat = telnet_get_seat, + .set_seat = telnet_set_seat, +}; + /* * Called to set up the Telnet connection. * @@ -689,14 +735,15 @@ static char *telnet_init(const BackendVtable *vt, Seat *seat, char *loghost; int addressfamily; - /* No local authentication phase in this protocol */ - seat_set_trust_status(seat, false); - telnet = snew(Telnet); + memset(telnet, 0, sizeof(Telnet)); telnet->plug.vt = &Telnet_plugvt; telnet->backend.vt = vt; + telnet->interactor.vt = &Telnet_interactorvt; + telnet->backend.interactor = &telnet->interactor; telnet->conf = conf_copy(conf); telnet->s = NULL; + telnet->socket_connected = false; telnet->closed_on_socket_error = false; telnet->echoing = true; telnet->editing = true; @@ -709,7 +756,7 @@ static char *telnet_init(const BackendVtable *vt, Seat *seat, telnet->state = TOP_LEVEL; telnet->ldisc = NULL; telnet->pinger = NULL; - telnet->session_started = true; + telnet->description = default_description(vt, host, port); *backend_handle = &telnet->backend; /* @@ -730,10 +777,14 @@ static char *telnet_init(const BackendVtable *vt, Seat *seat, * Open socket. */ telnet->s = new_connection(addr, *realhost, port, false, true, nodelay, - keepalive, &telnet->plug, telnet->conf); + keepalive, &telnet->plug, telnet->conf, + &telnet->interactor); if ((err = sk_socket_error(telnet->s)) != NULL) return dupstr(err); + /* No local authentication phase in this protocol */ + seat_set_trust_status(telnet->seat, false); + telnet->pinger = pinger_new(telnet->conf, &telnet->backend); /* @@ -787,12 +838,15 @@ static void telnet_free(Backend *be) { Telnet *telnet = container_of(be, Telnet, backend); + if (is_tempseat(telnet->seat)) + tempseat_free(telnet->seat); strbuf_free(telnet->sb_buf); if (telnet->s) sk_close(telnet->s); if (telnet->pinger) pinger_free(telnet->pinger); conf_free(telnet->conf); + sfree(telnet->description); sfree(telnet); } /* @@ -811,7 +865,7 @@ static void telnet_reconfig(Backend *be, Conf *conf) /* * Called to send data down the Telnet connection. */ -static size_t telnet_send(Backend *be, const char *buf, size_t len) +static void telnet_send(Backend *be, const char *buf, size_t len) { Telnet *telnet = container_of(be, Telnet, backend); unsigned char *p, *end; @@ -822,7 +876,7 @@ static size_t telnet_send(Backend *be, const char *buf, size_t len) #endif if (telnet->s == NULL) - return 0; + return; p = (unsigned char *)buf; end = (unsigned char *)(buf + len); @@ -839,8 +893,6 @@ static size_t telnet_send(Backend *be, const char *buf, size_t len) p++; } } - - return telnet->bufsize; } /* @@ -881,7 +933,7 @@ static void telnet_size(Backend *be, int width, int height) b[n++] = IAC; b[n++] = SE; telnet->bufsize = sk_write(telnet->s, b, n); - logeventf(telnet->logctx, "client:\tSB NAWS %d,%d", + logeventf(telnet->logctx, "client subnegotiation: SB NAWS %d,%d", telnet->term_width, telnet->term_height); } @@ -1001,8 +1053,8 @@ static bool telnet_connected(Backend *be) static bool telnet_sendok(Backend *be) { - /* Telnet *telnet = container_of(be, Telnet, backend); */ - return true; + Telnet *telnet = container_of(be, Telnet, backend); + return telnet->socket_connected; } static void telnet_unthrottle(Backend *be, size_t backlog) @@ -1064,7 +1116,8 @@ const BackendVtable telnet_backend = { .unthrottle = telnet_unthrottle, .cfg_info = telnet_cfg_info, .id = "telnet", - .displayname = "Telnet", + .displayname_tc = "Telnet", + .displayname_lc = "Telnet", /* proper name, so capitalise it anyway */ .protocol = PROT_TELNET, .default_port = 23, }; diff --git a/code/testback.c b/code/otherbackends/testback.c similarity index 74% rename from code/testback.c rename to code/otherbackends/testback.c index 173786e..f46d1d9 100644 --- a/code/testback.c +++ b/code/otherbackends/testback.c @@ -32,30 +32,28 @@ #include "putty.h" -static char *null_init(const BackendVtable *, Seat *, Backend **, LogContext *, - Conf *, const char *, int, char **, bool, bool); static char *loop_init(const BackendVtable *, Seat *, Backend **, LogContext *, Conf *, const char *, int, char **, bool, bool); -static void null_free(Backend *); static void loop_free(Backend *); static void null_reconfig(Backend *, Conf *); -static size_t null_send(Backend *, const char *, size_t); -static size_t loop_send(Backend *, const char *, size_t); +static void null_send(Backend *, const char *, size_t); +static void loop_send(Backend *, const char *, size_t); static size_t null_sendbuffer(Backend *); +static size_t loop_sendbuffer(Backend *); static void null_size(Backend *, int, int); static void null_special(Backend *, SessionSpecialCode, int); static const SessionSpecial *null_get_specials(Backend *); -static int null_connected(Backend *); +static bool null_connected(Backend *); static int null_exitcode(Backend *); -static int null_sendok(Backend *); -static int null_ldisc(Backend *, int); +static bool null_sendok(Backend *); +static bool null_ldisc(Backend *, int); static void null_provide_ldisc(Backend *, Ldisc *); static void null_unthrottle(Backend *, size_t); static int null_cfg_info(Backend *); const BackendVtable null_backend = { - .init = null_init, - .free = null_free, + .init = loop_init, + .free = loop_free, .reconfig = null_reconfig, .send = null_send, .sendbuffer = null_sendbuffer, @@ -70,7 +68,8 @@ const BackendVtable null_backend = { .unthrottle = null_unthrottle, .cfg_info = null_cfg_info, .id = "null", - .displayname = "null", + .displayname_tc = "Null", + .displayname_lc = "null", .protocol = -1, .default_port = 0, }; @@ -80,7 +79,7 @@ const BackendVtable loop_backend = { .free = loop_free, .reconfig = null_reconfig, .send = loop_send, - .sendbuffer = null_sendbuffer, + .sendbuffer = loop_sendbuffer, .size = null_size, .special = null_special, .get_specials = null_get_specials, @@ -92,7 +91,8 @@ const BackendVtable loop_backend = { .unthrottle = null_unthrottle, .cfg_info = null_cfg_info, .id = "loop", - .displayname = "loop", + .displayname_tc = "Loop", + .displayname_lc = "loop", .protocol = -1, .default_port = 0, }; @@ -100,19 +100,9 @@ const BackendVtable loop_backend = { struct loop_state { Seat *seat; Backend backend; + size_t sendbuffer; }; -static char *null_init(const BackendVtable *vt, Seat *seat, - Backend **backend_handle, LogContext *logctx, - Conf *conf, const char *host, int port, - char **realhost, bool nodelay, bool keepalive) { - /* No local authentication phase in this protocol */ - seat_set_trust_status(seat, false); - - *backend_handle = NULL; - return NULL; -} - static char *loop_init(const BackendVtable *vt, Seat *seat, Backend **backend_handle, LogContext *logctx, Conf *conf, const char *host, int port, @@ -123,13 +113,12 @@ static char *loop_init(const BackendVtable *vt, Seat *seat, seat_set_trust_status(seat, false); st->seat = seat; + st->backend.vt = vt; *backend_handle = &st->backend; - return NULL; -} -static void null_free(Backend *be) -{ + *realhost = dupstr(host); + return NULL; } static void loop_free(Backend *be) @@ -143,15 +132,14 @@ static void null_reconfig(Backend *be, Conf *conf) { } -static size_t null_send(Backend *be, const char *buf, size_t len) { +static void null_send(Backend *be, const char *buf, size_t len) { - return 0; } -static size_t loop_send(Backend *be, const char *buf, size_t len) { +static void loop_send(Backend *be, const char *buf, size_t len) { struct loop_state *st = container_of(be, struct loop_state, backend); - return seat_output(st->seat, 0, buf, len); + st->sendbuffer = seat_output(st->seat, 0, buf, len); } static size_t null_sendbuffer(Backend *be) { @@ -159,6 +147,12 @@ static size_t null_sendbuffer(Backend *be) { return 0; } +static size_t loop_sendbuffer(Backend *be) { + struct loop_state *st = container_of(be, struct loop_state, backend); + + return st->sendbuffer; +} + static void null_size(Backend *be, int width, int height) { } @@ -172,9 +166,9 @@ static const SessionSpecial *null_get_specials (Backend *be) { return NULL; } -static int null_connected(Backend *be) { +static bool null_connected(Backend *be) { - return 0; + return false; } static int null_exitcode(Backend *be) { @@ -182,18 +176,18 @@ static int null_exitcode(Backend *be) { return 0; } -static int null_sendok(Backend *be) { +static bool null_sendok(Backend *be) { - return 1; + return true; } static void null_unthrottle(Backend *be, size_t backlog) { } -static int null_ldisc(Backend *be, int option) { +static bool null_ldisc(Backend *be, int option) { - return 0; + return false; } static void null_provide_ldisc (Backend *be, Ldisc *ldisc) { @@ -204,11 +198,3 @@ static int null_cfg_info(Backend *be) { return 0; } - - -/* - * Emacs magic: - * Local Variables: - * c-file-style: "simon" - * End: - */ diff --git a/code/pageant.c b/code/pageant.c index e6afd0b..d70cf7e 100644 --- a/code/pageant.c +++ b/code/pageant.c @@ -461,9 +461,7 @@ static void signop_coroutine(PageantAsyncOp *pao) #ifdef PUTTY_CAC if (cert_is_certpath(so->pk->comment)) { - DWORD siglen = 0; - LPBYTE sig = cert_sign(so->pk->skey, (LPCBYTE)so->data_to_sign->u, so->data_to_sign->len, &siglen, so->flags); - put_data(BinarySink_UPCAST(signature), sig, siglen); + cert_sign(so->pk->skey, (LPCBYTE)so->data_to_sign->u, so->data_to_sign->len, so->flags, signature); } else #endif // PUTTY_CAC @@ -859,6 +857,7 @@ static PageantAsyncOp *pageant_make_op( so->pao.info = pc->info; so->pao.cr.prev = pc->info->head.prev; so->pao.cr.next = &pc->info->head; + so->pao.cr.prev->next = so->pao.cr.next->prev = &so->pao.cr; so->pao.reqid = reqid; so->pk = pk; so->pkr.prev = so->pkr.next = NULL; @@ -938,18 +937,22 @@ static PageantAsyncOp *pageant_make_op( } #ifdef PUTTY_CAC - /* scan the message looking for a capi or pkcs identifier */ - for (const char * pSearch = msg->data; pSearch + IDEN_CAPI_SIZE + SHA1_HEX_SIZE - 1 < - (((const char *) msg->data) + msg->len); pSearch++) + /* scan the message looking for a capi, fido, or pkcs identifier */ + size_t current_pos = msg->pos; + for (ptrlen t = get_string(msg); t.len != 0; t = get_string(msg)) { - if (cert_is_certpath(pSearch)) + char * search = dupprintf("%.*s", (int) t.len, t.ptr); + if (cert_is_certpath(search)) { - if (key->key) ssh_key_free(key->key); - sfree(key); - key = cert_load_key(pSearch, NULL); - BinarySource_REWIND_TO(msg, (pSearch - ((const char*) msg->data) - 4)); + key = cert_load_key(search, NULL); + BinarySource_REWIND_TO(msg, ((char *) t.ptr - (char*) msg->data) - 4); + sfree(search); + break; } + sfree(search); } + + if (key->key == NULL) BinarySource_REWIND_TO(msg, current_pos); if (key->key == NULL) #endif // PUTTY_CAC key->key = ssh_key_new_priv_openssh(alg, msg); @@ -1391,6 +1394,7 @@ static PageantAsyncOp *pageant_make_op( io->pao.info = pc->info; io->pao.cr.prev = pc->info->head.prev; io->pao.cr.next = &pc->info->head; + io->pao.cr.prev->next = io->pao.cr.next->prev = &io->pao.cr; io->pao.reqid = reqid; io->response = sb; io->crLine = 0; @@ -1499,12 +1503,12 @@ struct pageant_conn_state { Plug plug; }; -static void pageant_conn_closing(Plug *plug, const char *error_msg, - int error_code, bool calling_back) +static void pageant_conn_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { struct pageant_conn_state *pc = container_of( plug, struct pageant_conn_state, plug); - if (error_msg) + if (type != PLUGCLOSE_NORMAL) pageant_listener_client_log(pc->plc, "c#%"SIZEu": error: %s", pc->conn_index, error_msg); else @@ -1646,12 +1650,12 @@ struct pageant_listen_state { Plug plug; }; -static void pageant_listen_closing(Plug *plug, const char *error_msg, - int error_code, bool calling_back) +static void pageant_listen_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { struct pageant_listen_state *pl = container_of( plug, struct pageant_listen_state, plug); - if (error_msg) + if (type != PLUGCLOSE_NORMAL) pageant_listener_client_log(pl->plc, "listening socket: error: %s", error_msg); sk_close(pl->listensock); @@ -1662,6 +1666,7 @@ static const PlugVtable pageant_connection_plugvt = { .closing = pageant_conn_closing, .receive = pageant_conn_receive, .sent = pageant_conn_sent, + .log = nullplug_log, }; static int pageant_listen_accepting(Plug *plug, @@ -1710,6 +1715,7 @@ static int pageant_listen_accepting(Plug *plug, static const PlugVtable pageant_listener_plugvt = { .closing = pageant_listen_closing, .accepting = pageant_listen_accepting, + .log = nullplug_log, }; struct pageant_listen_state *pageant_listener_new( diff --git a/code/proxy.c b/code/proxy.c deleted file mode 100644 index d7069cb..0000000 --- a/code/proxy.c +++ /dev/null @@ -1,1513 +0,0 @@ -/* - * Network proxy abstraction in PuTTY - * - * A proxy layer, if necessary, wedges itself between the network - * code and the higher level backend. - */ - -#include -#include -#include - -#include "putty.h" -#include "network.h" -#include "proxy.h" - -#define do_proxy_dns(conf) \ - (conf_get_int(conf, CONF_proxy_dns) == FORCE_ON || \ - (conf_get_int(conf, CONF_proxy_dns) == AUTO && \ - conf_get_int(conf, CONF_proxy_type) != PROXY_SOCKS4)) - -/* - * Call this when proxy negotiation is complete, so that this - * socket can begin working normally. - */ -void proxy_activate (ProxySocket *p) -{ - size_t output_before, output_after; - - p->state = PROXY_STATE_ACTIVE; - - /* we want to ignore new receive events until we have sent - * all of our buffered receive data. - */ - sk_set_frozen(p->sub_socket, true); - - /* how many bytes of output have we buffered? */ - output_before = bufchain_size(&p->pending_oob_output_data) + - bufchain_size(&p->pending_output_data); - /* and keep track of how many bytes do not get sent. */ - output_after = 0; - - /* send buffered OOB writes */ - while (bufchain_size(&p->pending_oob_output_data) > 0) { - ptrlen data = bufchain_prefix(&p->pending_oob_output_data); - output_after += sk_write_oob(p->sub_socket, data.ptr, data.len); - bufchain_consume(&p->pending_oob_output_data, data.len); - } - - /* send buffered normal writes */ - while (bufchain_size(&p->pending_output_data) > 0) { - ptrlen data = bufchain_prefix(&p->pending_output_data); - output_after += sk_write(p->sub_socket, data.ptr, data.len); - bufchain_consume(&p->pending_output_data, data.len); - } - - /* if we managed to send any data, let the higher levels know. */ - if (output_after < output_before) - plug_sent(p->plug, output_after); - - /* if we have a pending EOF to send, send it */ - if (p->pending_eof) sk_write_eof(p->sub_socket); - - /* if the backend wanted the socket unfrozen, try to unfreeze. - * our set_frozen handler will flush buffered receive data before - * unfreezing the actual underlying socket. - */ - if (!p->freeze) - sk_set_frozen(&p->sock, false); -} - -/* basic proxy socket functions */ - -static Plug *sk_proxy_plug (Socket *s, Plug *p) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - Plug *ret = ps->plug; - if (p) - ps->plug = p; - return ret; -} - -static void sk_proxy_close (Socket *s) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - - sk_close(ps->sub_socket); - sk_addr_free(ps->remote_addr); - sfree(ps); -} - -static size_t sk_proxy_write (Socket *s, const void *data, size_t len) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - - if (ps->state != PROXY_STATE_ACTIVE) { - bufchain_add(&ps->pending_output_data, data, len); - return bufchain_size(&ps->pending_output_data); - } - return sk_write(ps->sub_socket, data, len); -} - -static size_t sk_proxy_write_oob (Socket *s, const void *data, size_t len) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - - if (ps->state != PROXY_STATE_ACTIVE) { - bufchain_clear(&ps->pending_output_data); - bufchain_clear(&ps->pending_oob_output_data); - bufchain_add(&ps->pending_oob_output_data, data, len); - return len; - } - return sk_write_oob(ps->sub_socket, data, len); -} - -static void sk_proxy_write_eof (Socket *s) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - - if (ps->state != PROXY_STATE_ACTIVE) { - ps->pending_eof = true; - return; - } - sk_write_eof(ps->sub_socket); -} - -static void sk_proxy_set_frozen (Socket *s, bool is_frozen) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - - if (ps->state != PROXY_STATE_ACTIVE) { - ps->freeze = is_frozen; - return; - } - - /* handle any remaining buffered recv data first */ - if (bufchain_size(&ps->pending_input_data) > 0) { - ps->freeze = is_frozen; - - /* loop while we still have buffered data, and while we are - * unfrozen. the plug_receive call in the loop could result - * in a call back into this function refreezing the socket, - * so we have to check each time. - */ - while (!ps->freeze && bufchain_size(&ps->pending_input_data) > 0) { - char databuf[512]; - ptrlen data = bufchain_prefix(&ps->pending_input_data); - if (data.len > lenof(databuf)) - data.len = lenof(databuf); - memcpy(databuf, data.ptr, data.len); - bufchain_consume(&ps->pending_input_data, data.len); - plug_receive(ps->plug, 0, databuf, data.len); - } - - /* if we're still frozen, we'll have to wait for another - * call from the backend to finish unbuffering the data. - */ - if (ps->freeze) return; - } - - sk_set_frozen(ps->sub_socket, is_frozen); -} - -static const char * sk_proxy_socket_error (Socket *s) -{ - ProxySocket *ps = container_of(s, ProxySocket, sock); - if (ps->error != NULL || ps->sub_socket == NULL) { - return ps->error; - } - return sk_socket_error(ps->sub_socket); -} - -/* basic proxy plug functions */ - -static void plug_proxy_log(Plug *plug, PlugLogType type, SockAddr *addr, - int port, const char *error_msg, int error_code) -{ - ProxySocket *ps = container_of(plug, ProxySocket, plugimpl); - - plug_log(ps->plug, type, addr, port, error_msg, error_code); -} - -static void plug_proxy_closing (Plug *p, const char *error_msg, - int error_code, bool calling_back) -{ - ProxySocket *ps = container_of(p, ProxySocket, plugimpl); - - if (ps->state != PROXY_STATE_ACTIVE) { - ps->closing_error_msg = error_msg; - ps->closing_error_code = error_code; - ps->closing_calling_back = calling_back; - ps->negotiate(ps, PROXY_CHANGE_CLOSING); - } else { - plug_closing(ps->plug, error_msg, error_code, calling_back); - } -} - -static void plug_proxy_receive( - Plug *p, int urgent, const char *data, size_t len) -{ - ProxySocket *ps = container_of(p, ProxySocket, plugimpl); - - if (ps->state != PROXY_STATE_ACTIVE) { - /* we will lose the urgentness of this data, but since most, - * if not all, of this data will be consumed by the negotiation - * process, hopefully it won't affect the protocol above us - */ - bufchain_add(&ps->pending_input_data, data, len); - ps->receive_urgent = (urgent != 0); - ps->receive_data = data; - ps->receive_len = len; - ps->negotiate(ps, PROXY_CHANGE_RECEIVE); - } else { - plug_receive(ps->plug, urgent, data, len); - } -} - -static void plug_proxy_sent (Plug *p, size_t bufsize) -{ - ProxySocket *ps = container_of(p, ProxySocket, plugimpl); - - if (ps->state != PROXY_STATE_ACTIVE) { - ps->negotiate(ps, PROXY_CHANGE_SENT); - return; - } - plug_sent(ps->plug, bufsize); -} - -static int plug_proxy_accepting(Plug *p, - accept_fn_t constructor, accept_ctx_t ctx) -{ - ProxySocket *ps = container_of(p, ProxySocket, plugimpl); - - if (ps->state != PROXY_STATE_ACTIVE) { - ps->accepting_constructor = constructor; - ps->accepting_ctx = ctx; - return ps->negotiate(ps, PROXY_CHANGE_ACCEPTING); - } - return plug_accepting(ps->plug, constructor, ctx); -} - -/* - * This function can accept a NULL pointer as `addr', in which case - * it will only check the host name. - */ -static bool proxy_for_destination(SockAddr *addr, const char *hostname, - int port, Conf *conf) -{ - int s = 0, e = 0; - char hostip[64]; - int hostip_len, hostname_len; - const char *exclude_list; - - /* - * Special local connections such as Unix-domain sockets - * unconditionally cannot be proxied, even in proxy-localhost - * mode. There just isn't any way to ask any known proxy type for - * them. - */ - if (addr && sk_address_is_special_local(addr)) - return false; /* do not proxy */ - - /* - * Check the host name and IP against the hard-coded - * representations of `localhost'. - */ - if (!conf_get_bool(conf, CONF_even_proxy_localhost) && - (sk_hostname_is_local(hostname) || - (addr && sk_address_is_local(addr)))) - return false; /* do not proxy */ - - /* we want a string representation of the IP address for comparisons */ - if (addr) { - sk_getaddr(addr, hostip, 64); - hostip_len = strlen(hostip); - } else - hostip_len = 0; /* placate gcc; shouldn't be required */ - - hostname_len = strlen(hostname); - - exclude_list = conf_get_str(conf, CONF_proxy_exclude_list); - - /* now parse the exclude list, and see if either our IP - * or hostname matches anything in it. - */ - - while (exclude_list[s]) { - while (exclude_list[s] && - (isspace((unsigned char)exclude_list[s]) || - exclude_list[s] == ',')) s++; - - if (!exclude_list[s]) break; - - e = s; - - while (exclude_list[e] && - (isalnum((unsigned char)exclude_list[e]) || - exclude_list[e] == '-' || - exclude_list[e] == '.' || - exclude_list[e] == '*')) e++; - - if (exclude_list[s] == '*') { - /* wildcard at beginning of entry */ - - if ((addr && strnicmp(hostip + hostip_len - (e - s - 1), - exclude_list + s + 1, e - s - 1) == 0) || - strnicmp(hostname + hostname_len - (e - s - 1), - exclude_list + s + 1, e - s - 1) == 0) { - /* IP/hostname range excluded. do not use proxy. */ - return false; - } - } else if (exclude_list[e-1] == '*') { - /* wildcard at end of entry */ - - if ((addr && strnicmp(hostip, exclude_list + s, e - s - 1) == 0) || - strnicmp(hostname, exclude_list + s, e - s - 1) == 0) { - /* IP/hostname range excluded. do not use proxy. */ - return false; - } - } else { - /* no wildcard at either end, so let's try an absolute - * match (ie. a specific IP) - */ - - if (addr && strnicmp(hostip, exclude_list + s, e - s) == 0) - return false; /* IP/hostname excluded. do not use proxy. */ - if (strnicmp(hostname, exclude_list + s, e - s) == 0) - return false; /* IP/hostname excluded. do not use proxy. */ - } - - s = e; - - /* Make sure we really have reached the next comma or end-of-string */ - while (exclude_list[s] && - !isspace((unsigned char)exclude_list[s]) && - exclude_list[s] != ',') s++; - } - - /* no matches in the exclude list, so use the proxy */ - return true; -} - -static char *dns_log_msg(const char *host, int addressfamily, - const char *reason) -{ - return dupprintf("Looking up host \"%s\"%s for %s", host, - (addressfamily == ADDRTYPE_IPV4 ? " (IPv4)" : - addressfamily == ADDRTYPE_IPV6 ? " (IPv6)" : - ""), reason); -} - -SockAddr *name_lookup(const char *host, int port, char **canonicalname, - Conf *conf, int addressfamily, LogContext *logctx, - const char *reason) -{ - if (conf_get_int(conf, CONF_proxy_type) != PROXY_NONE && - do_proxy_dns(conf) && - proxy_for_destination(NULL, host, port, conf)) { - - if (logctx) - logeventf(logctx, "Leaving host lookup to proxy of \"%s\"" - " (for %s)", host, reason); - - *canonicalname = dupstr(host); - return sk_nonamelookup(host); - } else { - if (logctx) - logevent_and_free( - logctx, dns_log_msg(host, addressfamily, reason)); - - return sk_namelookup(host, canonicalname, addressfamily); - } -} - -static const SocketVtable ProxySocket_sockvt = { - .plug = sk_proxy_plug, - .close = sk_proxy_close, - .write = sk_proxy_write, - .write_oob = sk_proxy_write_oob, - .write_eof = sk_proxy_write_eof, - .set_frozen = sk_proxy_set_frozen, - .socket_error = sk_proxy_socket_error, - .peer_info = NULL, -}; - -static const PlugVtable ProxySocket_plugvt = { - .log = plug_proxy_log, - .closing = plug_proxy_closing, - .receive = plug_proxy_receive, - .sent = plug_proxy_sent, - .accepting = plug_proxy_accepting -}; - -Socket *new_connection(SockAddr *addr, const char *hostname, - int port, bool privport, - bool oobinline, bool nodelay, bool keepalive, - Plug *plug, Conf *conf) -{ - if (conf_get_int(conf, CONF_proxy_type) != PROXY_NONE && - proxy_for_destination(addr, hostname, port, conf)) - { - ProxySocket *ret; - SockAddr *proxy_addr; - char *proxy_canonical_name; - const char *proxy_type; - Socket *sret; - int type; - - if ((sret = platform_new_connection(addr, hostname, port, privport, - oobinline, nodelay, keepalive, - plug, conf)) != NULL) - return sret; - - ret = snew(ProxySocket); - ret->sock.vt = &ProxySocket_sockvt; - ret->plugimpl.vt = &ProxySocket_plugvt; - ret->conf = conf_copy(conf); - ret->plug = plug; - ret->remote_addr = addr; /* will need to be freed on close */ - ret->remote_port = port; - - ret->error = NULL; - ret->pending_eof = false; - ret->freeze = false; - - bufchain_init(&ret->pending_input_data); - bufchain_init(&ret->pending_output_data); - bufchain_init(&ret->pending_oob_output_data); - - ret->sub_socket = NULL; - ret->state = PROXY_STATE_NEW; - ret->negotiate = NULL; - - type = conf_get_int(conf, CONF_proxy_type); - if (type == PROXY_HTTP) { - ret->negotiate = proxy_http_negotiate; - proxy_type = "HTTP"; - } else if (type == PROXY_SOCKS4) { - ret->negotiate = proxy_socks4_negotiate; - proxy_type = "SOCKS 4"; - } else if (type == PROXY_SOCKS5) { - ret->negotiate = proxy_socks5_negotiate; - proxy_type = "SOCKS 5"; - } else if (type == PROXY_TELNET) { - ret->negotiate = proxy_telnet_negotiate; - proxy_type = "Telnet"; - } else { - ret->error = "Proxy error: Unknown proxy method"; - return &ret->sock; - } - - { - char *logmsg = dupprintf("Will use %s proxy at %s:%d to connect" - " to %s:%d", proxy_type, - conf_get_str(conf, CONF_proxy_host), - conf_get_int(conf, CONF_proxy_port), - hostname, port); - plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); - sfree(logmsg); - } - - { - char *logmsg = dns_log_msg(conf_get_str(conf, CONF_proxy_host), - conf_get_int(conf, CONF_addressfamily), - "proxy"); - plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); - sfree(logmsg); - } - - /* look-up proxy */ - proxy_addr = sk_namelookup(conf_get_str(conf, CONF_proxy_host), - &proxy_canonical_name, - conf_get_int(conf, CONF_addressfamily)); - if (sk_addr_error(proxy_addr) != NULL) { - ret->error = "Proxy error: Unable to resolve proxy host name"; - sk_addr_free(proxy_addr); - return &ret->sock; - } - sfree(proxy_canonical_name); - - { - char addrbuf[256], *logmsg; - sk_getaddr(proxy_addr, addrbuf, lenof(addrbuf)); - logmsg = dupprintf("Connecting to %s proxy at %s port %d", - proxy_type, addrbuf, - conf_get_int(conf, CONF_proxy_port)); - plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); - sfree(logmsg); - } - - /* create the actual socket we will be using, - * connected to our proxy server and port. - */ - ret->sub_socket = sk_new(proxy_addr, - conf_get_int(conf, CONF_proxy_port), - privport, oobinline, - nodelay, keepalive, &ret->plugimpl); - if (sk_socket_error(ret->sub_socket) != NULL) - return &ret->sock; - - /* start the proxy negotiation process... */ - sk_set_frozen(ret->sub_socket, false); - ret->negotiate(ret, PROXY_CHANGE_NEW); - - return &ret->sock; - } - - /* no proxy, so just return the direct socket */ - return sk_new(addr, port, privport, oobinline, nodelay, keepalive, plug); -} - -Socket *new_listener(const char *srcaddr, int port, Plug *plug, - bool local_host_only, Conf *conf, int addressfamily) -{ - /* TODO: SOCKS (and potentially others) support inbound - * TODO: connections via the proxy. support them. - */ - - return sk_newlistener(srcaddr, port, plug, local_host_only, addressfamily); -} - -/* ---------------------------------------------------------------------- - * HTTP CONNECT proxy type. - */ - -static bool get_line_end(char *data, size_t len, size_t *out) -{ - size_t off = 0; - - while (off < len) - { - if (data[off] == '\n') { - /* we have a newline */ - off++; - - /* is that the only thing on this line? */ - if (off <= 2) { - *out = off; - return true; - } - - /* if not, then there is the possibility that this header - * continues onto the next line, if it starts with a space - * or a tab. - */ - - if (off + 1 < len && data[off+1] != ' ' && data[off+1] != '\t') { - *out = off; - return true; - } - - /* the line does continue, so we have to keep going - * until we see an the header's "real" end of line. - */ - off++; - } - - off++; - } - - return false; -} - -int proxy_http_negotiate (ProxySocket *p, int change) -{ - if (p->state == PROXY_STATE_NEW) { - /* we are just beginning the proxy negotiate process, - * so we'll send off the initial bits of the request. - * for this proxy method, it's just a simple HTTP - * request - */ - char *buf, dest[512]; - char *username, *password; - - sk_getaddr(p->remote_addr, dest, lenof(dest)); - - buf = dupprintf("CONNECT %s:%i HTTP/1.1\r\nHost: %s:%i\r\n", - dest, p->remote_port, dest, p->remote_port); - sk_write(p->sub_socket, buf, strlen(buf)); - sfree(buf); - - username = conf_get_str(p->conf, CONF_proxy_username); - password = conf_get_str(p->conf, CONF_proxy_password); - if (username[0] || password[0]) { - char *buf, *buf2; - int i, j, len; - buf = dupprintf("%s:%s", username, password); - len = strlen(buf); - buf2 = snewn(len * 4 / 3 + 100, char); - sprintf(buf2, "Proxy-Authorization: Basic "); - for (i = 0, j = strlen(buf2); i < len; i += 3, j += 4) - base64_encode_atom((unsigned char *)(buf+i), - (len-i > 3 ? 3 : len-i), buf2+j); - strcpy(buf2+j, "\r\n"); - sk_write(p->sub_socket, buf2, strlen(buf2)); - sfree(buf); - sfree(buf2); - } - - sk_write(p->sub_socket, "\r\n", 2); - - p->state = 1; - return 0; - } - - if (change == PROXY_CHANGE_CLOSING) { - /* if our proxy negotiation process involves closing and opening - * new sockets, then we would want to intercept this closing - * callback when we were expecting it. if we aren't anticipating - * a socket close, then some error must have occurred. we'll - * just pass those errors up to the backend. - */ - plug_closing(p->plug, p->closing_error_msg, p->closing_error_code, - p->closing_calling_back); - return 0; /* ignored */ - } - - if (change == PROXY_CHANGE_SENT) { - /* some (or all) of what we wrote to the proxy was sent. - * we don't do anything new, however, until we receive the - * proxy's response. we might want to set a timer so we can - * timeout the proxy negotiation after a while... - */ - return 0; - } - - if (change == PROXY_CHANGE_ACCEPTING) { - /* we should _never_ see this, as we are using our socket to - * connect to a proxy, not accepting inbound connections. - * what should we do? close the socket with an appropriate - * error message? - */ - return plug_accepting(p->plug, - p->accepting_constructor, p->accepting_ctx); - } - - if (change == PROXY_CHANGE_RECEIVE) { - /* we have received data from the underlying socket, which - * we'll need to parse, process, and respond to appropriately. - */ - - char *data, *datap; - size_t len, eol; - - if (p->state == 1) { - - int min_ver, maj_ver, status; - - /* get the status line */ - len = bufchain_size(&p->pending_input_data); - assert(len > 0); /* or we wouldn't be here */ - data = snewn(len+1, char); - bufchain_fetch(&p->pending_input_data, data, len); - /* - * We must NUL-terminate this data, because Windows - * sscanf appears to require a NUL at the end of the - * string because it strlens it _first_. Sigh. - */ - data[len] = '\0'; - - if (!get_line_end(data, len, &eol)) { - sfree(data); - return 1; - } - - status = -1; - /* We can't rely on whether the %n incremented the sscanf return */ - if (sscanf((char *)data, "HTTP/%i.%i %n", - &maj_ver, &min_ver, &status) < 2 || status == -1) { - plug_closing(p->plug, "Proxy error: HTTP response was absent", - PROXY_ERROR_GENERAL, 0); - sfree(data); - return 1; - } - - /* remove the status line from the input buffer. */ - bufchain_consume(&p->pending_input_data, eol); - if (data[status] != '2') { - /* error */ - char *buf; - data[eol] = '\0'; - while (eol > status && - (data[eol-1] == '\r' || data[eol-1] == '\n')) - data[--eol] = '\0'; - buf = dupprintf("Proxy error: %s", data+status); - plug_closing(p->plug, buf, PROXY_ERROR_GENERAL, 0); - sfree(buf); - sfree(data); - return 1; - } - - sfree(data); - - p->state = 2; - } - - if (p->state == 2) { - - /* get headers. we're done when we get a - * header of length 2, (ie. just "\r\n") - */ - - len = bufchain_size(&p->pending_input_data); - assert(len > 0); /* or we wouldn't be here */ - data = snewn(len, char); - datap = data; - bufchain_fetch(&p->pending_input_data, data, len); - - if (!get_line_end(datap, len, &eol)) { - sfree(data); - return 1; - } - while (eol > 2) { - bufchain_consume(&p->pending_input_data, eol); - datap += eol; - len -= eol; - if (!get_line_end(datap, len, &eol)) - eol = 0; /* terminate the loop */ - } - - if (eol == 2) { - /* we're done */ - bufchain_consume(&p->pending_input_data, 2); - proxy_activate(p); - /* proxy activate will have dealt with - * whatever is left of the buffer */ - sfree(data); - return 1; - } - - sfree(data); - return 1; - } - } - - plug_closing(p->plug, "Proxy error: unexpected proxy error", - PROXY_ERROR_UNEXPECTED, 0); - return 1; -} - -/* ---------------------------------------------------------------------- - * SOCKS proxy type. - */ - -/* SOCKS version 4 */ -int proxy_socks4_negotiate (ProxySocket *p, int change) -{ - if (p->state == PROXY_CHANGE_NEW) { - - /* request format: - * version number (1 byte) = 4 - * command code (1 byte) - * 1 = CONNECT - * 2 = BIND - * dest. port (2 bytes) [network order] - * dest. address (4 bytes) - * user ID (variable length, null terminated string) - */ - - strbuf *command = strbuf_new(); - char hostname[512]; - bool write_hostname = false; - - put_byte(command, 4); /* SOCKS version 4 */ - put_byte(command, 1); /* CONNECT command */ - put_uint16(command, p->remote_port); - - switch (sk_addrtype(p->remote_addr)) { - case ADDRTYPE_IPV4: { - char addr[4]; - sk_addrcopy(p->remote_addr, addr); - put_data(command, addr, 4); - break; - } - case ADDRTYPE_NAME: - sk_getaddr(p->remote_addr, hostname, lenof(hostname)); - put_uint32(command, 1); - write_hostname = true; - break; - case ADDRTYPE_IPV6: - p->error = "Proxy error: SOCKS version 4 does not support IPv6"; - strbuf_free(command); - return 1; - } - - put_asciz(command, conf_get_str(p->conf, CONF_proxy_username)); - if (write_hostname) - put_asciz(command, hostname); - sk_write(p->sub_socket, command->s, command->len); - strbuf_free(command); - - p->state = 1; - return 0; - } - - if (change == PROXY_CHANGE_CLOSING) { - /* if our proxy negotiation process involves closing and opening - * new sockets, then we would want to intercept this closing - * callback when we were expecting it. if we aren't anticipating - * a socket close, then some error must have occurred. we'll - * just pass those errors up to the backend. - */ - plug_closing(p->plug, p->closing_error_msg, p->closing_error_code, - p->closing_calling_back); - return 0; /* ignored */ - } - - if (change == PROXY_CHANGE_SENT) { - /* some (or all) of what we wrote to the proxy was sent. - * we don't do anything new, however, until we receive the - * proxy's response. we might want to set a timer so we can - * timeout the proxy negotiation after a while... - */ - return 0; - } - - if (change == PROXY_CHANGE_ACCEPTING) { - /* we should _never_ see this, as we are using our socket to - * connect to a proxy, not accepting inbound connections. - * what should we do? close the socket with an appropriate - * error message? - */ - return plug_accepting(p->plug, - p->accepting_constructor, p->accepting_ctx); - } - - if (change == PROXY_CHANGE_RECEIVE) { - /* we have received data from the underlying socket, which - * we'll need to parse, process, and respond to appropriately. - */ - - if (p->state == 1) { - /* response format: - * version number (1 byte) = 4 - * reply code (1 byte) - * 90 = request granted - * 91 = request rejected or failed - * 92 = request rejected due to lack of IDENTD on client - * 93 = request rejected due to difference in user ID - * (what we sent vs. what IDENTD said) - * dest. port (2 bytes) - * dest. address (4 bytes) - */ - - char data[8]; - - if (bufchain_size(&p->pending_input_data) < 8) - return 1; /* not got anything yet */ - - /* get the response */ - bufchain_fetch(&p->pending_input_data, data, 8); - - if (data[0] != 0) { - plug_closing(p->plug, "Proxy error: SOCKS proxy responded with " - "unexpected reply code version", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - if (data[1] != 90) { - - switch (data[1]) { - case 92: - plug_closing(p->plug, "Proxy error: SOCKS server wanted IDENTD on client", - PROXY_ERROR_GENERAL, 0); - break; - case 93: - plug_closing(p->plug, "Proxy error: Username and IDENTD on client don't agree", - PROXY_ERROR_GENERAL, 0); - break; - case 91: - default: - plug_closing(p->plug, "Proxy error: Error while communicating with proxy", - PROXY_ERROR_GENERAL, 0); - break; - } - - return 1; - } - bufchain_consume(&p->pending_input_data, 8); - - /* we're done */ - proxy_activate(p); - /* proxy activate will have dealt with - * whatever is left of the buffer */ - return 1; - } - } - - plug_closing(p->plug, "Proxy error: unexpected proxy error", - PROXY_ERROR_UNEXPECTED, 0); - return 1; -} - -/* SOCKS version 5 */ -int proxy_socks5_negotiate (ProxySocket *p, int change) -{ - if (p->state == PROXY_CHANGE_NEW) { - - /* initial command: - * version number (1 byte) = 5 - * number of available authentication methods (1 byte) - * available authentication methods (1 byte * previous value) - * authentication methods: - * 0x00 = no authentication - * 0x01 = GSSAPI - * 0x02 = username/password - * 0x03 = CHAP - */ - - strbuf *command; - char *username, *password; - int method_count_offset, methods_start; - - command = strbuf_new(); - put_byte(command, 5); /* SOCKS version 5 */ - username = conf_get_str(p->conf, CONF_proxy_username); - password = conf_get_str(p->conf, CONF_proxy_password); - - method_count_offset = command->len; - put_byte(command, 0); - methods_start = command->len; - - put_byte(command, 0x00); /* no authentication */ - - if (username[0] || password[0]) { - proxy_socks5_offerencryptedauth(BinarySink_UPCAST(command)); - put_byte(command, 0x02); /* username/password */ - } - - command->u[method_count_offset] = command->len - methods_start; - - sk_write(p->sub_socket, command->s, command->len); - strbuf_free(command); - - p->state = 1; - return 0; - } - - if (change == PROXY_CHANGE_CLOSING) { - /* if our proxy negotiation process involves closing and opening - * new sockets, then we would want to intercept this closing - * callback when we were expecting it. if we aren't anticipating - * a socket close, then some error must have occurred. we'll - * just pass those errors up to the backend. - */ - plug_closing(p->plug, p->closing_error_msg, p->closing_error_code, - p->closing_calling_back); - return 0; /* ignored */ - } - - if (change == PROXY_CHANGE_SENT) { - /* some (or all) of what we wrote to the proxy was sent. - * we don't do anything new, however, until we receive the - * proxy's response. we might want to set a timer so we can - * timeout the proxy negotiation after a while... - */ - return 0; - } - - if (change == PROXY_CHANGE_ACCEPTING) { - /* we should _never_ see this, as we are using our socket to - * connect to a proxy, not accepting inbound connections. - * what should we do? close the socket with an appropriate - * error message? - */ - return plug_accepting(p->plug, - p->accepting_constructor, p->accepting_ctx); - } - - if (change == PROXY_CHANGE_RECEIVE) { - /* we have received data from the underlying socket, which - * we'll need to parse, process, and respond to appropriately. - */ - - if (p->state == 1) { - - /* initial response: - * version number (1 byte) = 5 - * authentication method (1 byte) - * authentication methods: - * 0x00 = no authentication - * 0x01 = GSSAPI - * 0x02 = username/password - * 0x03 = CHAP - * 0xff = no acceptable methods - */ - char data[2]; - - if (bufchain_size(&p->pending_input_data) < 2) - return 1; /* not got anything yet */ - - /* get the response */ - bufchain_fetch(&p->pending_input_data, data, 2); - - if (data[0] != 5) { - plug_closing(p->plug, "Proxy error: SOCKS proxy returned unexpected version", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - if (data[1] == 0x00) p->state = 2; /* no authentication needed */ - else if (data[1] == 0x01) p->state = 4; /* GSSAPI authentication */ - else if (data[1] == 0x02) p->state = 5; /* username/password authentication */ - else if (data[1] == 0x03) p->state = 6; /* CHAP authentication */ - else { - plug_closing(p->plug, "Proxy error: SOCKS proxy did not accept our authentication", - PROXY_ERROR_GENERAL, 0); - return 1; - } - bufchain_consume(&p->pending_input_data, 2); - } - - if (p->state == 7) { - - /* password authentication reply format: - * version number (1 bytes) = 1 - * reply code (1 byte) - * 0 = succeeded - * >0 = failed - */ - char data[2]; - - if (bufchain_size(&p->pending_input_data) < 2) - return 1; /* not got anything yet */ - - /* get the response */ - bufchain_fetch(&p->pending_input_data, data, 2); - - if (data[0] != 1) { - plug_closing(p->plug, "Proxy error: SOCKS password " - "subnegotiation contained wrong version number", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - if (data[1] != 0) { - - plug_closing(p->plug, "Proxy error: SOCKS proxy refused" - " password authentication", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - bufchain_consume(&p->pending_input_data, 2); - p->state = 2; /* now proceed as authenticated */ - } - - if (p->state == 8) { - int ret; - ret = proxy_socks5_handlechap(p); - if (ret) return ret; - } - - if (p->state == 2) { - - /* request format: - * version number (1 byte) = 5 - * command code (1 byte) - * 1 = CONNECT - * 2 = BIND - * 3 = UDP ASSOCIATE - * reserved (1 byte) = 0x00 - * address type (1 byte) - * 1 = IPv4 - * 3 = domainname (first byte has length, no terminating null) - * 4 = IPv6 - * dest. address (variable) - * dest. port (2 bytes) [network order] - */ - - strbuf *command = strbuf_new(); - put_byte(command, 5); /* SOCKS version 5 */ - put_byte(command, 1); /* CONNECT command */ - put_byte(command, 0x00); /* reserved byte */ - - switch (sk_addrtype(p->remote_addr)) { - case ADDRTYPE_IPV4: - put_byte(command, 1); /* IPv4 */ - sk_addrcopy(p->remote_addr, strbuf_append(command, 4)); - break; - case ADDRTYPE_IPV6: - put_byte(command, 4); /* IPv6 */ - sk_addrcopy(p->remote_addr, strbuf_append(command, 16)); - break; - case ADDRTYPE_NAME: { - char hostname[512]; - put_byte(command, 3); /* domain name */ - sk_getaddr(p->remote_addr, hostname, lenof(hostname)); - if (!put_pstring(command, hostname)) { - p->error = "Proxy error: SOCKS 5 cannot " - "support host names longer than 255 chars"; - strbuf_free(command); - return 1; - } - break; - } - } - - put_uint16(command, p->remote_port); - - sk_write(p->sub_socket, command->s, command->len); - - strbuf_free(command); - - p->state = 3; - return 1; - } - - if (p->state == 3) { - - /* reply format: - * version number (1 bytes) = 5 - * reply code (1 byte) - * 0 = succeeded - * 1 = general SOCKS server failure - * 2 = connection not allowed by ruleset - * 3 = network unreachable - * 4 = host unreachable - * 5 = connection refused - * 6 = TTL expired - * 7 = command not supported - * 8 = address type not supported - * reserved (1 byte) = x00 - * address type (1 byte) - * 1 = IPv4 - * 3 = domainname (first byte has length, no terminating null) - * 4 = IPv6 - * server bound address (variable) - * server bound port (2 bytes) [network order] - */ - char data[5]; - int len; - - /* First 5 bytes of packet are enough to tell its length. */ - if (bufchain_size(&p->pending_input_data) < 5) - return 1; /* not got anything yet */ - - /* get the response */ - bufchain_fetch(&p->pending_input_data, data, 5); - - if (data[0] != 5) { - plug_closing(p->plug, "Proxy error: SOCKS proxy returned wrong version number", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - if (data[1] != 0) { - char buf[256]; - - strcpy(buf, "Proxy error: "); - - switch (data[1]) { - case 1: strcat(buf, "General SOCKS server failure"); break; - case 2: strcat(buf, "Connection not allowed by ruleset"); break; - case 3: strcat(buf, "Network unreachable"); break; - case 4: strcat(buf, "Host unreachable"); break; - case 5: strcat(buf, "Connection refused"); break; - case 6: strcat(buf, "TTL expired"); break; - case 7: strcat(buf, "Command not supported"); break; - case 8: strcat(buf, "Address type not supported"); break; - default: sprintf(buf+strlen(buf), - "Unrecognised SOCKS error code %d", - data[1]); - break; - } - plug_closing(p->plug, buf, PROXY_ERROR_GENERAL, 0); - - return 1; - } - - /* - * Eat the rest of the reply packet. - */ - len = 6; /* first 4 bytes, last 2 */ - switch (data[3]) { - case 1: len += 4; break; /* IPv4 address */ - case 4: len += 16; break;/* IPv6 address */ - case 3: len += 1+(unsigned char)data[4]; break; /* domain name */ - default: - plug_closing(p->plug, "Proxy error: SOCKS proxy returned " - "unrecognised address format", - PROXY_ERROR_GENERAL, 0); - return 1; - } - if (bufchain_size(&p->pending_input_data) < len) - return 1; /* not got whole reply yet */ - bufchain_consume(&p->pending_input_data, len); - - /* we're done */ - proxy_activate(p); - return 1; - } - - if (p->state == 4) { - /* TODO: Handle GSSAPI authentication */ - plug_closing(p->plug, "Proxy error: We don't support GSSAPI authentication", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - if (p->state == 5) { - const char *username = conf_get_str(p->conf, CONF_proxy_username); - const char *password = conf_get_str(p->conf, CONF_proxy_password); - if (username[0] || password[0]) { - strbuf *auth = strbuf_new_nm(); - put_byte(auth, 1); /* version number of subnegotiation */ - if (!put_pstring(auth, username)) { - p->error = "Proxy error: SOCKS 5 authentication cannot " - "support usernames longer than 255 chars"; - strbuf_free(auth); - return 1; - } - if (!put_pstring(auth, password)) { - p->error = "Proxy error: SOCKS 5 authentication cannot " - "support passwords longer than 255 chars"; - strbuf_free(auth); - return 1; - } - sk_write(p->sub_socket, auth->s, auth->len); - strbuf_free(auth); - p->state = 7; - } else - plug_closing(p->plug, "Proxy error: Server chose " - "username/password authentication but we " - "didn't offer it!", - PROXY_ERROR_GENERAL, 0); - return 1; - } - - if (p->state == 6) { - int ret; - ret = proxy_socks5_selectchap(p); - if (ret) return ret; - } - - } - - plug_closing(p->plug, "Proxy error: Unexpected proxy error", - PROXY_ERROR_UNEXPECTED, 0); - return 1; -} - -/* ---------------------------------------------------------------------- - * `Telnet' proxy type. - * - * (This is for ad-hoc proxies where you connect to the proxy's - * telnet port and send a command such as `connect host port'. The - * command is configurable, since this proxy type is typically not - * standardised or at all well-defined.) - */ - -char *format_telnet_command(SockAddr *addr, int port, Conf *conf) -{ - char *fmt = conf_get_str(conf, CONF_proxy_telnet_command); - int so = 0, eo = 0; - strbuf *buf = strbuf_new(); - - /* we need to escape \\, \%, \r, \n, \t, \x??, \0???, - * %%, %host, %port, %user, and %pass - */ - - while (fmt[eo] != 0) { - - /* scan forward until we hit end-of-line, - * or an escape character (\ or %) */ - while (fmt[eo] != 0 && fmt[eo] != '%' && fmt[eo] != '\\') - eo++; - - /* if we hit eol, break out of our escaping loop */ - if (fmt[eo] == 0) break; - - /* if there was any unescaped text before the escape - * character, send that now */ - if (eo != so) - put_data(buf, fmt + so, eo - so); - - so = eo++; - - /* if the escape character was the last character of - * the line, we'll just stop and send it. */ - if (fmt[eo] == 0) break; - - if (fmt[so] == '\\') { - - /* we recognize \\, \%, \r, \n, \t, \x??. - * anything else, we just send unescaped (including the \). - */ - - switch (fmt[eo]) { - - case '\\': - put_byte(buf, '\\'); - eo++; - break; - - case '%': - put_byte(buf, '%'); - eo++; - break; - - case 'r': - put_byte(buf, '\r'); - eo++; - break; - - case 'n': - put_byte(buf, '\n'); - eo++; - break; - - case 't': - put_byte(buf, '\t'); - eo++; - break; - - case 'x': - case 'X': { - /* escaped hexadecimal value (ie. \xff) */ - unsigned char v = 0; - int i = 0; - - for (;;) { - eo++; - if (fmt[eo] >= '0' && fmt[eo] <= '9') - v += fmt[eo] - '0'; - else if (fmt[eo] >= 'a' && fmt[eo] <= 'f') - v += fmt[eo] - 'a' + 10; - else if (fmt[eo] >= 'A' && fmt[eo] <= 'F') - v += fmt[eo] - 'A' + 10; - else { - /* non hex character, so we abort and just - * send the whole thing unescaped (including \x) - */ - put_byte(buf, '\\'); - eo = so + 1; - break; - } - - /* we only extract two hex characters */ - if (i == 1) { - put_byte(buf, v); - eo++; - break; - } - - i++; - v <<= 4; - } - break; - } - - default: - put_data(buf, fmt + so, 2); - eo++; - break; - } - } else { - - /* % escape. we recognize %%, %host, %port, %user, %pass. - * %proxyhost, %proxyport. Anything else we just send - * unescaped (including the %). - */ - - if (fmt[eo] == '%') { - put_byte(buf, '%'); - eo++; - } - else if (strnicmp(fmt + eo, "host", 4) == 0) { - char dest[512]; - sk_getaddr(addr, dest, lenof(dest)); - put_data(buf, dest, strlen(dest)); - eo += 4; - } - else if (strnicmp(fmt + eo, "port", 4) == 0) { - strbuf_catf(buf, "%d", port); - eo += 4; - } - else if (strnicmp(fmt + eo, "user", 4) == 0) { - const char *username = conf_get_str(conf, CONF_proxy_username); - put_data(buf, username, strlen(username)); - eo += 4; - } - else if (strnicmp(fmt + eo, "pass", 4) == 0) { - const char *password = conf_get_str(conf, CONF_proxy_password); - put_data(buf, password, strlen(password)); - eo += 4; - } - else if (strnicmp(fmt + eo, "proxyhost", 9) == 0) { - const char *host = conf_get_str(conf, CONF_proxy_host); - put_data(buf, host, strlen(host)); - eo += 9; - } - else if (strnicmp(fmt + eo, "proxyport", 9) == 0) { - int port = conf_get_int(conf, CONF_proxy_port); - strbuf_catf(buf, "%d", port); - eo += 9; - } - else { - /* we don't escape this, so send the % now, and - * don't advance eo, so that we'll consider the - * text immediately following the % as unescaped. - */ - put_byte(buf, '%'); - } - } - - /* resume scanning for additional escapes after this one. */ - so = eo; - } - - /* if there is any unescaped text at the end of the line, send it */ - if (eo != so) { - put_data(buf, fmt + so, eo - so); - } - - return strbuf_to_str(buf); -} - -int proxy_telnet_negotiate (ProxySocket *p, int change) -{ - if (p->state == PROXY_CHANGE_NEW) { - char *formatted_cmd; - - formatted_cmd = format_telnet_command(p->remote_addr, p->remote_port, - p->conf); - - { - /* - * Re-escape control chars in the command, for logging. - */ - char *reescaped = snewn(4*strlen(formatted_cmd) + 1, char); - const char *in; - char *out; - char *logmsg; - - for (in = formatted_cmd, out = reescaped; *in; in++) { - if (*in == '\n') { - *out++ = '\\'; *out++ = 'n'; - } else if (*in == '\r') { - *out++ = '\\'; *out++ = 'r'; - } else if (*in == '\t') { - *out++ = '\\'; *out++ = 't'; - } else if (*in == '\\') { - *out++ = '\\'; *out++ = '\\'; - } else if ((unsigned)(((unsigned char)*in) - 0x20) < - (0x7F-0x20)) { - *out++ = *in; - } else { - out += sprintf(out, "\\x%02X", (unsigned)*in & 0xFF); - } - } - *out = '\0'; - - logmsg = dupprintf("Sending Telnet proxy command: %s", reescaped); - plug_log(p->plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); - sfree(logmsg); - sfree(reescaped); - } - - sk_write(p->sub_socket, formatted_cmd, strlen(formatted_cmd)); - sfree(formatted_cmd); - - p->state = 1; - return 0; - } - - if (change == PROXY_CHANGE_CLOSING) { - /* if our proxy negotiation process involves closing and opening - * new sockets, then we would want to intercept this closing - * callback when we were expecting it. if we aren't anticipating - * a socket close, then some error must have occurred. we'll - * just pass those errors up to the backend. - */ - plug_closing(p->plug, p->closing_error_msg, p->closing_error_code, - p->closing_calling_back); - return 0; /* ignored */ - } - - if (change == PROXY_CHANGE_SENT) { - /* some (or all) of what we wrote to the proxy was sent. - * we don't do anything new, however, until we receive the - * proxy's response. we might want to set a timer so we can - * timeout the proxy negotiation after a while... - */ - return 0; - } - - if (change == PROXY_CHANGE_ACCEPTING) { - /* we should _never_ see this, as we are using our socket to - * connect to a proxy, not accepting inbound connections. - * what should we do? close the socket with an appropriate - * error message? - */ - return plug_accepting(p->plug, - p->accepting_constructor, p->accepting_ctx); - } - - if (change == PROXY_CHANGE_RECEIVE) { - /* we have received data from the underlying socket, which - * we'll need to parse, process, and respond to appropriately. - */ - - /* we're done */ - proxy_activate(p); - /* proxy activate will have dealt with - * whatever is left of the buffer */ - return 1; - } - - plug_closing(p->plug, "Proxy error: Unexpected proxy error", - PROXY_ERROR_UNEXPECTED, 0); - return 1; -} diff --git a/code/proxy.h b/code/proxy.h deleted file mode 100644 index f11e1e3..0000000 --- a/code/proxy.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Network proxy abstraction in PuTTY - * - * A proxy layer, if necessary, wedges itself between the - * network code and the higher level backend. - * - * Supported proxies: HTTP CONNECT, generic telnet, SOCKS 4 & 5 - */ - -#ifndef PUTTY_PROXY_H -#define PUTTY_PROXY_H - -#define PROXY_ERROR_GENERAL 8000 -#define PROXY_ERROR_UNEXPECTED 8001 - -typedef struct ProxySocket ProxySocket; - -struct ProxySocket { - const char *error; - - Socket *sub_socket; - Plug *plug; - SockAddr *remote_addr; - int remote_port; - - bufchain pending_output_data; - bufchain pending_oob_output_data; - bufchain pending_input_data; - bool pending_eof; - -#define PROXY_STATE_NEW -1 -#define PROXY_STATE_ACTIVE 0 - - int state; /* proxy states greater than 0 are implementation - * dependent, but represent various stages/states - * of the initialization/setup/negotiation with the - * proxy server. - */ - bool freeze; /* should we freeze the underlying socket when - * we are done with the proxy negotiation? this - * simply caches the value of sk_set_frozen calls. - */ - -#define PROXY_CHANGE_NEW -1 -#define PROXY_CHANGE_CLOSING 0 -#define PROXY_CHANGE_SENT 1 -#define PROXY_CHANGE_RECEIVE 2 -#define PROXY_CHANGE_ACCEPTING 3 - - /* something has changed (a call from the sub socket - * layer into our Proxy Plug layer, or we were just - * created, etc), so the proxy layer needs to handle - * this change (the type of which is the second argument) - * and further the proxy negotiation process. - */ - - int (*negotiate) (ProxySocket * /* this */, int /* change type */); - - /* current arguments of plug handlers - * (for use by proxy's negotiate function) - */ - - /* closing */ - const char *closing_error_msg; - int closing_error_code; - bool closing_calling_back; - - /* receive */ - bool receive_urgent; - const char *receive_data; - int receive_len; - - /* accepting */ - accept_fn_t accepting_constructor; - accept_ctx_t accepting_ctx; - - /* configuration, used to look up proxy settings */ - Conf *conf; - - /* CHAP transient data */ - int chap_num_attributes; - int chap_num_attributes_processed; - int chap_current_attribute; - int chap_current_datalen; - - Socket sock; - Plug plugimpl; -}; - -extern void proxy_activate (ProxySocket *); - -extern int proxy_http_negotiate (ProxySocket *, int); -extern int proxy_telnet_negotiate (ProxySocket *, int); -extern int proxy_socks4_negotiate (ProxySocket *, int); -extern int proxy_socks5_negotiate (ProxySocket *, int); - -/* - * This may be reused by local-command proxies on individual - * platforms. - */ -char *format_telnet_command(SockAddr *addr, int port, Conf *conf); - -/* - * These are implemented in cproxy.c or nocproxy.c, depending on - * whether encrypted proxy authentication is available. - */ -extern void proxy_socks5_offerencryptedauth(BinarySink *); -extern int proxy_socks5_handlechap (ProxySocket *); -extern int proxy_socks5_selectchap(ProxySocket *); - -#endif diff --git a/code/proxy/cproxy.c b/code/proxy/cproxy.c new file mode 100644 index 0000000..38e6eef --- /dev/null +++ b/code/proxy/cproxy.c @@ -0,0 +1,188 @@ +/* + * Routines to do cryptographic interaction with proxies in PuTTY. + * This is in a separate module from proxy.c, so that it can be + * conveniently removed in PuTTYtel by replacing this module with + * the stub version nocproxy.c. + */ + +#include +#include +#include + +#include "putty.h" +#include "ssh.h" /* For MD5 support */ +#include "network.h" +#include "proxy.h" +#include "marshal.h" + +const bool socks5_chap_available = true; +const bool http_digest_available = true; + +strbuf *chap_response(ptrlen challenge, ptrlen password) +{ + strbuf *sb = strbuf_new_nm(); + const ssh2_macalg *alg = &ssh_hmac_md5; + mac_simple(alg, password, challenge, strbuf_append(sb, alg->len)); + return sb; +} + +void BinarySink_put_hex_data(BinarySink *bs, const void *vptr, size_t len) +{ + const unsigned char *p = (const unsigned char *)vptr; + const char *hexdigits = "0123456789abcdef"; + while (len-- > 0) { + unsigned c = *p++; + put_byte(bs, hexdigits[0xF & (c >> 4)]); + put_byte(bs, hexdigits[0xF & (c )]); + } +} + +#define put_hex_data(bs, p, len) \ + BinarySink_put_hex_data(BinarySink_UPCAST(bs), p, len) + +const char *const httphashnames[] = { + #define DECL_ARRAY(id, str, alg, bits, accepted) str, + HTTP_DIGEST_HASHES(DECL_ARRAY) + #undef DECL_ARRAY +}; + +const bool httphashaccepted[] = { + #define DECL_ARRAY(id, str, alg, bits, accepted) accepted, + HTTP_DIGEST_HASHES(DECL_ARRAY) + #undef DECL_ARRAY +}; + +static const ssh_hashalg *const httphashalgs[] = { + #define DECL_ARRAY(id, str, alg, bits, accepted) alg, + HTTP_DIGEST_HASHES(DECL_ARRAY) + #undef DECL_ARRAY +}; +static const size_t httphashlengths[] = { + #define DECL_ARRAY(id, str, alg, bits, accepted) bits/8, + HTTP_DIGEST_HASHES(DECL_ARRAY) + #undef DECL_ARRAY +}; + +void http_digest_response(BinarySink *bs, ptrlen username, ptrlen password, + ptrlen realm, ptrlen method, ptrlen uri, ptrlen qop, + ptrlen nonce, ptrlen opaque, uint32_t nonce_count, + HttpDigestHash hash, bool hash_username) +{ + unsigned char a1hash[MAX_HASH_LEN]; + unsigned char a2hash[MAX_HASH_LEN]; + unsigned char rsphash[MAX_HASH_LEN]; + const ssh_hashalg *alg = httphashalgs[hash]; + size_t hashlen = httphashlengths[hash]; + + unsigned char ncbuf[4]; + PUT_32BIT_MSB_FIRST(ncbuf, nonce_count); + + unsigned char client_nonce_raw[33]; + random_read(client_nonce_raw, lenof(client_nonce_raw)); + char client_nonce_base64[lenof(client_nonce_raw) / 3 * 4]; + for (unsigned i = 0; i < lenof(client_nonce_raw)/3; i++) + base64_encode_atom(client_nonce_raw + 3*i, 3, + client_nonce_base64 + 4*i); + + /* + * RFC 7616 section 3.4.2: the hash "A1" is a hash of + * username:realm:password (in the absence of hash names like + * "MD5-sess" which as far as I know don't sensibly apply to + * proxies and HTTP CONNECT). + */ + ssh_hash *h = ssh_hash_new(alg); + put_datapl(h, username); + put_byte(h, ':'); + put_datapl(h, realm); + put_byte(h, ':'); + put_datapl(h, password); + ssh_hash_digest_nondestructive(h, a1hash); + + /* + * RFC 7616 section 3.4.3: the hash "A2" is a hash of method:uri + * (in the absence of more interesting quality-of-protection + * schemes than plain "auth" - e.g. "auth-int" hashes the entire + * document as well - which again I don't think make sense in the + * context of proxies and CONNECT). + */ + ssh_hash_reset(h); + put_datapl(h, method); + put_byte(h, ':'); + put_datapl(h, uri); + ssh_hash_digest_nondestructive(h, a2hash); + + /* + * RFC 7616 section 3.4.1: the overall output hash in the + * "response" parameter of the authorization header is a hash of + * A1:nonce:nonce-count:client-nonce:qop:A2, where A1 and A2 are + * the hashes computed above. + */ + ssh_hash_reset(h); + put_hex_data(h, a1hash, hashlen); + put_byte(h, ':'); + put_datapl(h, nonce); + put_byte(h, ':'); + put_hex_data(h, ncbuf, 4); + put_byte(h, ':'); + put_data(h, client_nonce_base64, lenof(client_nonce_base64)); + put_byte(h, ':'); + put_datapl(h, qop); + put_byte(h, ':'); + put_hex_data(h, a2hash, hashlen); + ssh_hash_final(h, rsphash); + + /* + * Now construct the output header (everything after the initial + * "Proxy-Authorization: Digest ") and write it to the provided + * BinarySink. + */ + put_datalit(bs, "username=\""); + if (hash_username) { + /* + * RFC 7616 section 3.4.4: if we're hashing the username, we + * actually hash username:realm (like a truncated version of + * A1 above). + */ + ssh_hash *h = ssh_hash_new(alg); + put_datapl(h, username); + put_byte(h, ':'); + put_datapl(h, realm); + ssh_hash_final(h, a1hash); + put_hex_data(bs, a1hash, hashlen); + } else { + put_datapl(bs, username); + } + put_datalit(bs, "\", realm=\""); + put_datapl(bs, realm); + put_datalit(bs, "\", uri=\""); + put_datapl(bs, uri); + put_datalit(bs, "\", algorithm="); + put_dataz(bs, httphashnames[hash]); + put_datalit(bs, ", nonce=\""); + put_datapl(bs, nonce); + put_datalit(bs, "\", nc="); + put_hex_data(bs, ncbuf, 4); + put_datalit(bs, ", cnonce=\""); + put_data(bs, client_nonce_base64, lenof(client_nonce_base64)); + put_datalit(bs, "\", qop="); + put_datapl(bs, qop); + put_datalit(bs, ", response=\""); + put_hex_data(bs, rsphash, hashlen); + put_datalit(bs, "\""); + + if (opaque.ptr) { + put_datalit(bs, ", opaque=\""); + put_datapl(bs, opaque); + put_datalit(bs, "\""); + } + + if (hash_username) { + put_datalit(bs, ", userhash=true"); + } + + smemclr(a1hash, lenof(a1hash)); + smemclr(a2hash, lenof(a2hash)); + smemclr(rsphash, lenof(rsphash)); + smemclr(client_nonce_raw, lenof(client_nonce_raw)); + smemclr(client_nonce_base64, lenof(client_nonce_base64)); +} diff --git a/code/proxy/cproxy.h b/code/proxy/cproxy.h new file mode 100644 index 0000000..34058dd --- /dev/null +++ b/code/proxy/cproxy.h @@ -0,0 +1,99 @@ +/* + * Header for the interaction between proxy.c and cproxy.c. Separated + * from proxy.h proper so that testcrypt can include it conveniently. + */ + +extern const bool socks5_chap_available; +strbuf *chap_response(ptrlen challenge, ptrlen password); +extern const bool http_digest_available; + +/* + * List macro for the various hash functions defined for HTTP Digest. + * + * Of these, MD5 is the original one; SHA-256 is unambiguous; but + * SHA-512-256 seems to be controversial. + * + * RFC 7616 doesn't provide a normative reference, or any text + * explaining what they mean by it. They apparently expect you to + * already know. The problem with that is that there are two plausible + * things they _might_ have meant: + * + * 1. Ordinary SHA-512, truncated to 256 bits by discarding the + * second half of the hash output, per FIPS 180-4 section 7 (which + * says that in general it's OK to truncate hash functions like + * that if you need to). FIPS 180-4 assigns no particular specific + * spelling to this kind of truncated hash. + * + * 2. The same except that the initial state of the SHA-512 algorithm + * is reset to a different 512-bit vector to ensure that it's a + * distinguishable hash function in its own right, per FIPS 180-4 + * section 6.7 (which in turn refers to section 5.3.6.2 for the + * actual initial values). FIPS 180-4 spells this "SHA-512/256". + * + * The text of RFC 7616 is totally silent as to which of these they + * meant. Their spelling is inconsistent: the protocol identifier is + * "SHA-512-256", but in some places in the RFC they say + * "SHA-512/256", matching FIPS's spelling for the hash in option 2 + * above. On the other hand, the example authentication exchange in + * section 3.9.2 of the RFC contains hashes that are consistent with + * option 1 above (a truncation of plain SHA-512). + * + * Erratum 4897, https://www.rfc-editor.org/errata/eid4897, points out + * this ambiguity, and suggests correcting the example exchange to be + * consistent with option 2. However, as of 2021-11-27, that erratum + * is shown on the RFC Editor website in state "Reported", with no + * response (positive _or_ negative) from the RFC authors or anyone + * else. (And it was reported in 2016, so it's not as if they haven't + * had time.) + * + * So, which hash should we implement? Perhaps there's a consensus + * among existing implementations in the wild? + * + * I rigged up an HTTP server to present a SHA-512-256 Digest auth + * request, and tried various HTTP clients against it. The only HTTP + * client I found that accepts 'algorithm="SHA-512-256"' and sends + * back an auth attempt quoting the same hash is curl - and curl, + * bizarrely, seems to treat "SHA-512-256" as _neither_ of the above + * options, but as simply an alias for SHA-256! + * + * Therefore, I think the only safe answer is to refuse to support + * that hash at all: it's too confusing. + * + * However, I keep it in the list of hashes here, so that we can check + * the test case from RFC 7616, because that test case is also the + * only test of username hashing. So we reject it in proxy/http.c, but + * accept it in the internal function http_digest_response(), and + * treat it as option 1 (truncated SHA-512). + * + * Therefore, the parameters to each invocation of X in the following + * list macro are: + * + * - internal enum id for the hash + * - protocol identifier string + * - algorithm to use for computing it (as a const ssh_hashalg *) + * - length to truncate the output to + * - whether we accept it in http.c or not. + * + * Finally, the ordering of the accepted hashes is our preference + * order among them if the server offers a choice. + */ +#define HTTP_DIGEST_HASHES(X) \ + X(HTTP_DIGEST_MD5, "MD5", &ssh_md5, 128, true) \ + X(HTTP_DIGEST_SHA256, "SHA-256", &ssh_sha256, 256, true) \ + X(HTTP_DIGEST_SHA512_256, "SHA-512-256", &ssh_sha512, 256, false) \ + /* end of list */ + +typedef enum HttpDigestHash { + #define DECL_ENUM(id, str, alg, bits, accepted) id, + HTTP_DIGEST_HASHES(DECL_ENUM) + #undef DECL_ENUM + N_HTTP_DIGEST_HASHES +} HttpDigestHash; + +extern const char *const httphashnames[]; +extern const bool httphashaccepted[]; + +void http_digest_response(BinarySink *bs, ptrlen username, ptrlen password, + ptrlen realm, ptrlen method, ptrlen uri, ptrlen qop, + ptrlen nonce, ptrlen opaque, uint32_t nonce_count, + HttpDigestHash hash, bool hash_username); diff --git a/code/proxy/http.c b/code/proxy/http.c new file mode 100644 index 0000000..0738e37 --- /dev/null +++ b/code/proxy/http.c @@ -0,0 +1,781 @@ +/* + * HTTP CONNECT proxy negotiation. + */ + +#include "putty.h" +#include "network.h" +#include "proxy.h" +#include "sshcr.h" + +static bool read_line(bufchain *input, strbuf *output, bool is_header) +{ + char c; + + while (bufchain_try_fetch(input, &c, 1)) { + if (is_header && output->len > 0 && + output->s[output->len - 1] == '\n') { + /* + * A newline terminates the header, provided we're sure it + * is _not_ followed by a space or a tab. + */ + if (c != ' ' && c != '\t') + goto done; /* we have a complete header line */ + } else { + put_byte(output, c); + bufchain_consume(input, 1); + + if (!is_header && output->len > 0 && + output->s[output->len - 1] == '\n') { + /* If we're looking for just a line, not an HTTP + * header, then any newline terminates it. */ + goto done; + } + } + } + + return false; + + done: + strbuf_chomp(output, '\n'); + strbuf_chomp(output, '\r'); + return true; +} + +/* Types of HTTP authentication, in preference order. */ +typedef enum HttpAuthType { + AUTH_ERROR, /* if an HttpAuthDetails was never satisfactorily filled in */ + AUTH_NONE, /* if no auth header is seen, assume no auth required */ + AUTH_BASIC, /* username + password sent in clear (only keyless base64) */ + AUTH_DIGEST, /* cryptographic hash, most preferred if available */ +} HttpAuthType; + +typedef struct HttpAuthDetails { + HttpAuthType auth_type; + bool digest_nonce_was_stale; + HttpDigestHash digest_hash; + strbuf *realm, *nonce, *opaque, *error; + bool got_opaque; + bool hash_username; +} HttpAuthDetails; + +typedef struct HttpProxyNegotiator { + int crLine; + strbuf *response, *header, *token; + int http_status_pos; + size_t header_pos; + strbuf *username, *password; + int http_status; + bool connection_close; + HttpAuthDetails *next_auth; + bool try_auth_from_conf; + strbuf *uri; + uint32_t nonce_count; + prompts_t *prompts; + int username_prompt_index, password_prompt_index; + size_t content_length, chunk_length; + bool chunked_transfer; + ProxyNegotiator pn; +} HttpProxyNegotiator; + +static inline HttpAuthDetails *auth_error(HttpAuthDetails *d, + const char *fmt, ...) +{ + d->auth_type = AUTH_ERROR; + put_fmt(d->error, "Unable to parse auth header from HTTP proxy"); + if (fmt) { + va_list ap; + va_start(ap, fmt); + put_datalit(d->error, ": "); + put_fmtv(d->error, fmt, ap); + va_end(ap); + } + return d; +} + +static HttpAuthDetails *http_auth_details_new(void) +{ + HttpAuthDetails *d = snew(HttpAuthDetails); + memset(d, 0, sizeof(*d)); + d->realm = strbuf_new(); + d->nonce = strbuf_new(); + d->opaque = strbuf_new(); + d->error = strbuf_new(); + return d; +} + +static void http_auth_details_free(HttpAuthDetails *d) +{ + strbuf_free(d->realm); + strbuf_free(d->nonce); + strbuf_free(d->opaque); + strbuf_free(d->error); + sfree(d); +} + +static ProxyNegotiator *proxy_http_new(const ProxyNegotiatorVT *vt) +{ + HttpProxyNegotiator *s = snew(HttpProxyNegotiator); + memset(s, 0, sizeof(*s)); + s->pn.vt = vt; + s->response = strbuf_new(); + s->header = strbuf_new(); + s->token = strbuf_new(); + s->username = strbuf_new(); + s->password = strbuf_new_nm(); + s->uri = strbuf_new(); + s->nonce_count = 0; + /* + * Always start with a CONNECT request containing no auth. If the + * proxy rejects that, it will tell us what kind of auth it would + * prefer. + */ + s->next_auth = http_auth_details_new(); + s->next_auth->auth_type = AUTH_NONE; + return &s->pn; +} + +static void proxy_http_free(ProxyNegotiator *pn) +{ + HttpProxyNegotiator *s = container_of(pn, HttpProxyNegotiator, pn); + strbuf_free(s->response); + strbuf_free(s->header); + strbuf_free(s->token); + strbuf_free(s->username); + strbuf_free(s->password); + strbuf_free(s->uri); + http_auth_details_free(s->next_auth); + if (s->prompts) + free_prompts(s->prompts); + sfree(s); +} + +#define HTTP_HEADER_LIST(X) \ + X(HDR_CONNECTION, "Connection") \ + X(HDR_CONTENT_LENGTH, "Content-Length") \ + X(HDR_TRANSFER_ENCODING, "Transfer-Encoding") \ + X(HDR_PROXY_AUTHENTICATE, "Proxy-Authenticate") \ + X(HDR_PROXY_CONNECTION, "Proxy-Connection") \ + /* end of list */ + +typedef enum HttpHeader { + #define ENUM_DEF(id, string) id, + HTTP_HEADER_LIST(ENUM_DEF) + #undef ENUM_DEF + HDR_UNKNOWN +} HttpHeader; + +static inline bool is_whitespace(char c) +{ + return (c == ' ' || c == '\t' || c == '\n'); +} + +static inline bool is_separator(char c) +{ + return (c == '(' || c == ')' || c == '<' || c == '>' || c == '@' || + c == ',' || c == ';' || c == ':' || c == '\\' || c == '"' || + c == '/' || c == '[' || c == ']' || c == '?' || c == '=' || + c == '{' || c == '}'); +} + +#define HTTP_SEPARATORS + +static bool get_end_of_header(HttpProxyNegotiator *s) +{ + size_t pos = s->header_pos; + + while (pos < s->header->len && is_whitespace(s->header->s[pos])) + pos++; + + if (pos == s->header->len) { + s->header_pos = pos; + return true; + } + + return false; +} + +static bool get_token(HttpProxyNegotiator *s) +{ + size_t pos = s->header_pos; + + while (pos < s->header->len && is_whitespace(s->header->s[pos])) + pos++; + + if (pos == s->header->len) + return false; /* end of string */ + + if (is_separator(s->header->s[pos])) + return false; + + strbuf_clear(s->token); + while (pos < s->header->len && + !is_whitespace(s->header->s[pos]) && + !is_separator(s->header->s[pos])) + put_byte(s->token, s->header->s[pos++]); + + s->header_pos = pos; + return true; +} + +static bool get_separator(HttpProxyNegotiator *s, char sep) +{ + size_t pos = s->header_pos; + + while (pos < s->header->len && is_whitespace(s->header->s[pos])) + pos++; + + if (pos == s->header->len) + return false; /* end of string */ + + if (s->header->s[pos] != sep) + return false; + + s->header_pos = ++pos; + return true; +} + +static bool get_quoted_string(HttpProxyNegotiator *s) +{ + size_t pos = s->header_pos; + + while (pos < s->header->len && is_whitespace(s->header->s[pos])) + pos++; + + if (pos == s->header->len) + return false; /* end of string */ + + if (s->header->s[pos] != '"') + return false; + pos++; + + strbuf_clear(s->token); + while (pos < s->header->len && s->header->s[pos] != '"') { + if (s->header->s[pos] == '\\') { + /* Backslash makes the next char literal, even if it's " or \ */ + pos++; + if (pos == s->header->len) + return false; /* unexpected end of string */ + } + put_byte(s->token, s->header->s[pos++]); + } + + if (pos == s->header->len) + return false; /* no closing quote */ + pos++; + + s->header_pos = pos; + return true; +} + +static HttpAuthDetails *parse_http_auth_header(HttpProxyNegotiator *s) +{ + HttpAuthDetails *d = http_auth_details_new(); + + /* Default hash for HTTP Digest is MD5, if none specified explicitly */ + d->digest_hash = HTTP_DIGEST_MD5; + + if (!get_token(s)) + return auth_error(d, "parse error"); + + if (!stricmp(s->token->s, "Basic")) { + /* For Basic authentication, we don't need anything else. The + * realm string is not required for the protocol. */ + d->auth_type = AUTH_BASIC; + return d; + } + + if (!stricmp(s->token->s, "Digest")) { + /* Parse all the additional parts of the Digest header. */ + if (!http_digest_available) + return auth_error(d, "Digest authentication not supported"); + + /* Parse the rest of the Digest header */ + while (true) { + if (!get_token(s)) + return auth_error(d, "parse error in Digest header"); + + if (!stricmp(s->token->s, "realm")) { + if (!get_separator(s, '=') || + !get_quoted_string(s)) + return auth_error(d, "parse error in Digest realm field"); + put_datapl(d->realm, ptrlen_from_strbuf(s->token)); + } else if (!stricmp(s->token->s, "nonce")) { + if (!get_separator(s, '=') || + !get_quoted_string(s)) + return auth_error(d, "parse error in Digest nonce field"); + put_datapl(d->nonce, ptrlen_from_strbuf(s->token)); + } else if (!stricmp(s->token->s, "opaque")) { + if (!get_separator(s, '=') || + !get_quoted_string(s)) + return auth_error(d, "parse error in Digest opaque field"); + put_datapl(d->opaque, + ptrlen_from_strbuf(s->token)); + d->got_opaque = true; + } else if (!stricmp(s->token->s, "stale")) { + if (!get_separator(s, '=') || + !get_token(s)) + return auth_error(d, "parse error in Digest stale field"); + d->digest_nonce_was_stale = !stricmp( + s->token->s, "true"); + } else if (!stricmp(s->token->s, "userhash")) { + if (!get_separator(s, '=') || + !get_token(s)) + return auth_error(d, "parse error in Digest userhash " + "field"); + d->hash_username = !stricmp(s->token->s, "true"); + } else if (!stricmp(s->token->s, "algorithm")) { + if (!get_separator(s, '=') || + (!get_token(s) && !get_quoted_string(s))) + return auth_error(d, "parse error in Digest algorithm " + "field"); + bool found = false; + size_t i; + + for (i = 0; i < N_HTTP_DIGEST_HASHES; i++) { + if (!stricmp(s->token->s, httphashnames[i])) { + found = true; + break; + } + } + + if (!found) { + /* We don't even recognise the name */ + return auth_error(d, "Digest hash algorithm '%s' not " + "recognised", s->token->s); + } + + if (!httphashaccepted[i]) { + /* We do recognise the name but we + * don't like it (see comment in cproxy.h) */ + return auth_error(d, "Digest hash algorithm '%s' not " + "supported", s->token->s); + } + + d->digest_hash = i; + } else if (!stricmp(s->token->s, "qop")) { + if (!get_separator(s, '=') || + !get_quoted_string(s)) + return auth_error(d, "parse error in Digest qop field"); + if (stricmp(s->token->s, "auth")) + return auth_error(d, "quality-of-protection type '%s' not " + "supported", s->token->s); + } else { + /* Ignore any other auth-param */ + if (!get_separator(s, '=') || + (!get_quoted_string(s) && !get_token(s))) + return auth_error(d, "parse error in Digest header"); + } + + if (get_end_of_header(s)) + break; + if (!get_separator(s, ',')) + return auth_error(d, "parse error in Digest header"); + } + d->auth_type = AUTH_DIGEST; + return d; + } + + return auth_error(d, "authentication type '%s' not supported", + s->token->s); +} + +static void proxy_http_process_queue(ProxyNegotiator *pn) +{ + HttpProxyNegotiator *s = container_of(pn, HttpProxyNegotiator, pn); + + crBegin(s->crLine); + + /* + * Initialise our username and password strbufs from the Conf. + */ + put_dataz(s->username, conf_get_str(pn->ps->conf, CONF_proxy_username)); + put_dataz(s->password, conf_get_str(pn->ps->conf, CONF_proxy_password)); + if (s->username->len || s->password->len) + s->try_auth_from_conf = true; + + /* + * Set up the host:port string we're trying to connect to, also + * used as the URI string in HTTP Digest auth. + */ + { + char dest[512]; + sk_getaddr(pn->ps->remote_addr, dest, lenof(dest)); + put_fmt(s->uri, "%s:%d", dest, pn->ps->remote_port); + } + + while (true) { + /* + * Standard prefix for the HTTP CONNECT request. + */ + put_fmt(pn->output, + "CONNECT %s HTTP/1.1\r\n" + "Host: %s\r\n", s->uri->s, s->uri->s); + + /* + * Add an auth header, if we're planning to this time round. + */ + if (s->next_auth->auth_type == AUTH_BASIC) { + put_datalit(pn->output, "Proxy-Authorization: Basic "); + + strbuf *base64_input = strbuf_new_nm(); + put_datapl(base64_input, ptrlen_from_strbuf(s->username)); + put_byte(base64_input, ':'); + put_datapl(base64_input, ptrlen_from_strbuf(s->password)); + + char base64_output[4]; + for (size_t i = 0, e = base64_input->len; i < e; i += 3) { + base64_encode_atom(base64_input->u + i, + e-i > 3 ? 3 : e-i, base64_output); + put_data(pn->output, base64_output, 4); + } + strbuf_free(base64_input); + smemclr(base64_output, sizeof(base64_output)); + put_datalit(pn->output, "\r\n"); + } else if (s->next_auth->auth_type == AUTH_DIGEST) { + put_datalit(pn->output, "Proxy-Authorization: Digest "); + + /* If we have a fresh nonce, reset the + * nonce count. Otherwise, keep incrementing it. */ + if (!ptrlen_eq_ptrlen(ptrlen_from_strbuf(s->token), + ptrlen_from_strbuf(s->next_auth->nonce))) + s->nonce_count = 0; + + http_digest_response(BinarySink_UPCAST(pn->output), + ptrlen_from_strbuf(s->username), + ptrlen_from_strbuf(s->password), + ptrlen_from_strbuf(s->next_auth->realm), + PTRLEN_LITERAL("CONNECT"), + ptrlen_from_strbuf(s->uri), + PTRLEN_LITERAL("auth"), + ptrlen_from_strbuf(s->next_auth->nonce), + (s->next_auth->got_opaque ? + ptrlen_from_strbuf(s->next_auth->opaque) : + make_ptrlen(NULL, 0)), + ++s->nonce_count, s->next_auth->digest_hash, + s->next_auth->hash_username); + put_datalit(pn->output, "\r\n"); + } + + /* + * Blank line to terminate the HTTP request. + */ + put_datalit(pn->output, "\r\n"); + crReturnV; + + s->content_length = 0; + s->chunked_transfer = false; + s->connection_close = false; + + /* + * Read and parse the HTTP status line, and check if it's a 2xx + * for success. + */ + strbuf_clear(s->response); + crMaybeWaitUntilV(read_line(pn->input, s->response, false)); + { + int maj_ver, min_ver, n_scanned; + n_scanned = sscanf( + s->response->s, "HTTP/%d.%d %n%d", + &maj_ver, &min_ver, &s->http_status_pos, &s->http_status); + + if (n_scanned < 3) { + pn->error = dupstr("HTTP response was absent or malformed"); + crStopV; + } + + if (maj_ver < 1 || (maj_ver == 1 && min_ver < 1)) { + /* Before HTTP/1.1, connections close by default */ + s->connection_close = true; + } + } + + if (s->http_status == 407) { + /* + * If this is going to be an auth request, we expect to + * see at least one Proxy-Authorization header offering us + * auth options. Start by preloading s->next_auth with a + * fallback error message, which will be used if nothing + * better is available. + */ + http_auth_details_free(s->next_auth); + s->next_auth = http_auth_details_new(); + auth_error(s->next_auth, "no Proxy-Authorization header seen in " + "HTTP 407 Proxy Authentication Required response"); + } + + /* + * Read the HTTP response header section. + */ + do { + strbuf_clear(s->header); + crMaybeWaitUntilV(read_line(pn->input, s->header, true)); + s->header_pos = 0; + + if (!get_token(s)) { + /* Possibly we ought to panic if we see an HTTP header + * we can't make any sense of at all? But whatever, + * ignore it and hope the next one makes more sense */ + continue; + } + + /* Parse the header name */ + HttpHeader hdr = HDR_UNKNOWN; + { + #define CHECK_HEADER(id, string) \ + if (!stricmp(s->token->s, string)) hdr = id; + HTTP_HEADER_LIST(CHECK_HEADER); + #undef CHECK_HEADER + } + + if (!get_separator(s, ':')) + continue; + + if (hdr == HDR_CONTENT_LENGTH) { + if (!get_token(s)) + continue; + s->content_length = strtoumax(s->token->s, NULL, 10); + } else if (hdr == HDR_TRANSFER_ENCODING) { + /* + * The Transfer-Encoding header value should be a + * comma-separated list of keywords including + * "chunked", "deflate" and "gzip". We parse it in the + * most superficial way, by just looking for "chunked" + * and ignoring everything else. + * + * It's OK to do that because we're not actually + * _using_ the error document - we only have to skip + * over it to find the end of the HTTP response. So we + * don't care if it's gzipped or not. + */ + while (get_token(s)) { + if (!stricmp(s->token->s, "chunked")) + s->chunked_transfer = true; + } + } else if (hdr == HDR_CONNECTION || + hdr == HDR_PROXY_CONNECTION) { + if (!get_token(s)) + continue; + if (!stricmp(s->token->s, "close")) + s->connection_close = true; + else if (!stricmp(s->token->s, "keep-alive")) + s->connection_close = false; + } else if (hdr == HDR_PROXY_AUTHENTICATE) { + HttpAuthDetails *auth = parse_http_auth_header(s); + + /* + * See if we prefer this set of auth details to the + * previous one we had (either from a previous auth + * header, or the fallback when no auth header is + * provided at all). + */ + bool change; + + if (auth->auth_type != s->next_auth->auth_type) { + /* Use the preference order implied by the enum */ + change = auth->auth_type > s->next_auth->auth_type; + } else if (auth->auth_type == AUTH_DIGEST && + auth->digest_hash != s->next_auth->digest_hash) { + /* Choose based on the hash functions */ + change = auth->digest_hash > s->next_auth->digest_hash; + } else { + /* + * If in doubt, go with the later one of the + * headers. + * + * The main reason for this is so that an error in + * interpreting an auth header will supersede the + * default error we preload saying 'no header + * found', because that would be a particularly + * bad error to report if there _was_ one. + * + * But we're in a tie-breaking situation by now, + * so there's no other reason to choose - we might + * as well apply the same policy everywhere else + * too. + */ + change = true; + } + + if (change) { + http_auth_details_free(s->next_auth); + s->next_auth = auth; + } else { + http_auth_details_free(auth); + } + } + } while (s->header->len > 0); + + /* Read and ignore the entire response document */ + if (!s->chunked_transfer) { + /* Simple approach: read exactly Content-Length bytes */ + crMaybeWaitUntilV(bufchain_try_consume( + pn->input, s->content_length)); + } else { + /* Chunked transfer: read a sequence of + * \r\n\r\n chunks, terminating in one with + * zero length */ + do { + /* + * Expect a chunk length + */ + s->chunk_length = 0; + while (true) { + char c; + crMaybeWaitUntilV(bufchain_try_fetch_consume( + pn->input, &c, 1)); + if (c == '\r') { + continue; + } else if (c == '\n') { + break; + } else if ('0' <= c && c <= '9') { + s->chunk_length = s->chunk_length*16 + (c-'0'); + } else if ('A' <= c && c <= 'F') { + s->chunk_length = s->chunk_length*16 + (c-'A'+10); + } else if ('a' <= c && c <= 'f') { + s->chunk_length = s->chunk_length*16 + (c-'a'+10); + } else { + pn->error = dupprintf( + "Received bad character 0x%02X in chunk length " + "during HTTP chunked transfer encoding", + (unsigned)(unsigned char)c); + crStopV; + } + } + + /* + * Expect that many bytes of chunked data + */ + crMaybeWaitUntilV(bufchain_try_consume( + pn->input, s->chunk_length)); + + /* Now expect \r\n */ + { + char buf[2]; + crMaybeWaitUntilV(bufchain_try_fetch_consume( + pn->input, buf, 2)); + if (memcmp(buf, "\r\n", 2)) { + pn->error = dupprintf( + "Missing CRLF after chunk " + "during HTTP chunked transfer encoding"); + crStopV; + } + } + } while (s->chunk_length); + } + + if (200 <= s->http_status && s->http_status < 300) { + /* Any 2xx HTTP response means we're done */ + goto authenticated; + } else if (s->http_status == 407) { + /* 407 is Proxy Authentication Required, which we may be + * able to do something about. */ + if (s->connection_close) { + /* If we got 407 + connection closed, reconnect before + * sending our next request. */ + pn->reconnect = true; + } + + /* If the best we can do is report some kind of error from + * a Proxy-Auth header (or an error saying there wasn't + * one at all), and no successful parsing of an auth + * header superseded that, then just throw that error and + * die. */ + if (s->next_auth->auth_type == AUTH_ERROR) { + pn->error = dupstr(s->next_auth->error->s); + crStopV; + } + + /* If we have auth details from the Conf and haven't tried + * them yet, that's our first step. */ + if (s->try_auth_from_conf) { + s->try_auth_from_conf = false; + continue; + } + + /* If the server sent us stale="true" in a Digest auth + * header, that means we _don't_ need to request a new + * password yet; just try again with the existing details + * and the fresh nonce it sent us. */ + if (s->next_auth->digest_nonce_was_stale) + continue; + + /* Either we never had a password in the first place, or + * the one we already presented was rejected. We can only + * proceed from here if we have a way to ask the user + * questions. */ + if (!pn->itr) { + pn->error = dupprintf("HTTP proxy requested authentication " + "which we do not have"); + crStopV; + } + + /* + * Send some prompts to the user. We'll assume the + * password is always required (since it's just been + * rejected, even if we did send one before), and we'll + * prompt for the username only if we don't have one from + * the Conf. + */ + s->prompts = proxy_new_prompts(pn->ps); + s->prompts->to_server = true; + s->prompts->from_server = false; + s->prompts->name = dupstr("HTTP proxy authentication"); + if (!s->username->len) { + s->username_prompt_index = s->prompts->n_prompts; + add_prompt(s->prompts, dupstr("Proxy username: "), true); + } else { + s->username_prompt_index = -1; + } + + s->password_prompt_index = s->prompts->n_prompts; + add_prompt(s->prompts, dupstr("Proxy password: "), false); + + while (true) { + SeatPromptResult spr = seat_get_userpass_input( + interactor_announce(pn->itr), s->prompts); + if (spr.kind == SPRK_OK) { + break; + } else if (spr_is_abort(spr)) { + proxy_spr_abort(pn, spr); + crStopV; + } + crReturnV; + } + + if (s->username_prompt_index != -1) { + strbuf_clear(s->username); + put_dataz(s->username, + prompt_get_result_ref( + s->prompts->prompts[s->username_prompt_index])); + } + + strbuf_clear(s->password); + put_dataz(s->password, + prompt_get_result_ref( + s->prompts->prompts[s->password_prompt_index])); + + free_prompts(s->prompts); + s->prompts = NULL; + } else { + /* Any other HTTP response is treated as permanent failure */ + pn->error = dupprintf("HTTP response %s", + s->response->s + s->http_status_pos); + crStopV; + } + } + + authenticated: + /* + * Success! Hand over to the main connection. + */ + pn->done = true; + + crFinishV; +} + +const struct ProxyNegotiatorVT http_proxy_negotiator_vt = { + .new = proxy_http_new, + .free = proxy_http_free, + .process_queue = proxy_http_process_queue, + .type = "HTTP", +}; diff --git a/code/proxy/interactor.c b/code/proxy/interactor.c new file mode 100644 index 0000000..d069d22 --- /dev/null +++ b/code/proxy/interactor.c @@ -0,0 +1,119 @@ +/* + * Centralised functions for the Interactor trait. + */ + +#include "putty.h" + +Seat *interactor_borrow_seat(Interactor *itr) +{ + Seat *clientseat = interactor_get_seat(itr); + if (!clientseat) + return NULL; + + /* If the client has already had its Seat borrowed, then look + * through the existing TempSeat to find the underlying one. */ + if (is_tempseat(clientseat)) + return tempseat_get_real(clientseat); + + /* Otherwise, make a new TempSeat and give that to the client. */ + Seat *tempseat = tempseat_new(clientseat); + interactor_set_seat(itr, tempseat); + return clientseat; +} + +static Interactor *interactor_toplevel(Interactor *itr, unsigned *level_out) +{ + /* + * Find the Interactor at the top of the chain, so that all the + * Interactors in a stack can share that one's last-to-talk field. + * Also, count how far we had to go to get to it, to put in the + * message. + */ + Interactor *itr_top = itr; + unsigned level = 0; + while (itr_top->parent) { + itr_top = itr_top->parent; + level++; + } + + if (level_out) + *level_out = level; + return itr_top; +} + +void interactor_return_seat(Interactor *itr) +{ + Seat *tempseat = interactor_get_seat(itr); + if (!is_tempseat(tempseat)) + return; /* no-op */ + + /* + * We're about to hand this seat back to the parent Interactor to + * do its own thing with. It will typically expect to start in the + * same state as if the seat had never been borrowed, i.e. in the + * starting trust state. + * + * However, this may be overridden by the tempseat_flush call. + */ + Seat *realseat = tempseat_get_real(tempseat); + seat_set_trust_status(realseat, true); + + tempseat_flush(tempseat); + interactor_set_seat(itr, realseat); + tempseat_free(tempseat); + + /* + * If we have a parent Interactor, and anyone has ever called + * interactor_announce, then all Interactors from now on will + * announce themselves even if they have nothing to say. + */ + Interactor *itr_top = interactor_toplevel(itr, NULL); + if (itr_top->last_to_talk) + interactor_announce(itr); +} + +InteractionReadySeat interactor_announce(Interactor *itr) +{ + Seat *seat = interactor_get_seat(itr); + assert(!is_tempseat(seat) && + "Shouldn't call announce when someone else is using our seat"); + + InteractionReadySeat iseat; + iseat.seat = seat; + + unsigned level; + Interactor *itr_top = interactor_toplevel(itr, &level); + + /* + * Generally, we should announce ourself if the previous + * Interactor that said anything was not us. That includes if + * there was no previous Interactor to talk (i.e. if we're the + * first to say anything) - *except* that the primary Interactor + * doesn't need to announce itself, if no proxy has intervened + * before it. + */ + bool need_announcement = (itr_top->last_to_talk != itr); + if (!itr->parent && !itr_top->last_to_talk) + need_announcement = false; + + if (need_announcement) { + const char *prefix = ""; + if (itr_top->last_to_talk != NULL) + seat_antispoof_msg(iseat, ""); /* leave a separating blank line */ + + char *desc = interactor_description(itr); + char *adjective = (level == 0 ? dupstr("primary") : + level == 1 ? dupstr("proxy") : + dupprintf("proxy^%u", level)); + char *msg = dupprintf("%sMaking %s %s", prefix, adjective, desc); + sfree(adjective); + sfree(desc); + + seat_antispoof_msg(iseat, msg); + sfree(msg); + + itr_top->last_to_talk = itr; + } + + return iseat; +} diff --git a/code/proxy/local.c b/code/proxy/local.c new file mode 100644 index 0000000..3b2d130 --- /dev/null +++ b/code/proxy/local.c @@ -0,0 +1,272 @@ +/* + * Implement LocalProxyOpener, a centralised system for setting up the + * command string to be run by platform-specific local-subprocess + * proxy types. + * + * The platform-specific local proxy code is expected to use this + * system by calling local_proxy_opener() from + * platform_new_connection(); then using the resulting + * DeferredSocketOpener to make a deferred version of whatever local + * socket type is used for talking to subcommands (Unix FdSocket, + * Windows HandleSocket); then passing the 'Socket *' back to us via + * local_proxy_opener_set_socket(). + * + * The LocalProxyOpener object implemented by this code will set + * itself up as an Interactor if possible, so that it can prompt for + * the proxy username and/or password if they're referred to in the + * command string but not given in the config (exactly as the Telnet + * proxy does). Once it knows the exact command it wants to run - + * whether that was done immediately or after user interaction - it + * calls back to platform_setup_local_proxy() with the full command, + * which is expected to actually start the subprocess and fill in the + * missing details in the deferred socket, freeing the + * LocalProxyOpener as a side effect. + */ + +#include "tree234.h" +#include "putty.h" +#include "network.h" +#include "sshcr.h" +#include "proxy/proxy.h" + +typedef struct LocalProxyOpener { + int crLine; + + Socket *socket; + char *formatted_cmd; + Plug *plug; + SockAddr *addr; + int port; + Conf *conf; + + Interactor *clientitr; + LogPolicy *clientlp; + Seat *clientseat; + prompts_t *prompts; + int username_prompt_index, password_prompt_index; + + Interactor interactor; + DeferredSocketOpener opener; +} LocalProxyOpener; + +static void local_proxy_opener_free(DeferredSocketOpener *opener) +{ + LocalProxyOpener *lp = container_of(opener, LocalProxyOpener, opener); + burnstr(lp->formatted_cmd); + if (lp->prompts) + free_prompts(lp->prompts); + sk_addr_free(lp->addr); + conf_free(lp->conf); + sfree(lp); +} + +static const DeferredSocketOpenerVtable LocalProxyOpener_openervt = { + .free = local_proxy_opener_free, +}; + +static char *local_proxy_opener_description(Interactor *itr) +{ + return dupstr("connection via local command"); +} + +static LogPolicy *local_proxy_opener_logpolicy(Interactor *itr) +{ + LocalProxyOpener *lp = container_of(itr, LocalProxyOpener, interactor); + return lp->clientlp; +} + +static Seat *local_proxy_opener_get_seat(Interactor *itr) +{ + LocalProxyOpener *lp = container_of(itr, LocalProxyOpener, interactor); + return lp->clientseat; +} + +static void local_proxy_opener_set_seat(Interactor *itr, Seat *seat) +{ + LocalProxyOpener *lp = container_of(itr, LocalProxyOpener, interactor); + lp->clientseat = seat; +} + +static const InteractorVtable LocalProxyOpener_interactorvt = { + .description = local_proxy_opener_description, + .logpolicy = local_proxy_opener_logpolicy, + .get_seat = local_proxy_opener_get_seat, + .set_seat = local_proxy_opener_set_seat, +}; + +static void local_proxy_opener_cleanup_interactor(LocalProxyOpener *lp) +{ + if (lp->clientseat) { + interactor_return_seat(lp->clientitr); + lp->clientitr = NULL; + lp->clientseat = NULL; + } +} + +static void local_proxy_opener_coroutine(void *vctx) +{ + LocalProxyOpener *lp = (LocalProxyOpener *)vctx; + + crBegin(lp->crLine); + + /* + * Make an initial attempt to figure out the command we want, and + * see if it tried to include a username or password that we don't + * have. + */ + { + unsigned flags; + lp->formatted_cmd = format_telnet_command( + lp->addr, lp->port, lp->conf, &flags); + + if (lp->clientseat && (flags & (TELNET_CMD_MISSING_USERNAME | + TELNET_CMD_MISSING_PASSWORD))) { + burnstr(lp->formatted_cmd); + lp->formatted_cmd = NULL; + + /* + * We're missing at least one of the two parts, and we + * have an Interactor we can use to prompt for them, so + * try it. + */ + lp->prompts = new_prompts(); + lp->prompts->callback = local_proxy_opener_coroutine; + lp->prompts->callback_ctx = lp; + lp->prompts->to_server = true; + lp->prompts->from_server = false; + lp->prompts->name = dupstr("Local proxy authentication"); + if (flags & TELNET_CMD_MISSING_USERNAME) { + lp->username_prompt_index = lp->prompts->n_prompts; + add_prompt(lp->prompts, dupstr("Proxy username: "), true); + } else { + lp->username_prompt_index = -1; + } + if (flags & TELNET_CMD_MISSING_PASSWORD) { + lp->password_prompt_index = lp->prompts->n_prompts; + add_prompt(lp->prompts, dupstr("Proxy password: "), false); + } else { + lp->password_prompt_index = -1; + } + + while (true) { + SeatPromptResult spr = seat_get_userpass_input( + interactor_announce(&lp->interactor), lp->prompts); + if (spr.kind == SPRK_OK) { + break; + } else if (spr.kind == SPRK_USER_ABORT) { + local_proxy_opener_cleanup_interactor(lp); + plug_closing_user_abort(lp->plug); + /* That will have freed us, so we must just return + * without calling any crStop */ + return; + } else if (spr.kind == SPRK_SW_ABORT) { + local_proxy_opener_cleanup_interactor(lp); + char *err = spr_get_error_message(spr); + plug_closing_error(lp->plug, err); + sfree(err); + return; /* without crStop, as above */ + } + crReturnV; + } + + if (lp->username_prompt_index != -1) { + conf_set_str( + lp->conf, CONF_proxy_username, + prompt_get_result_ref( + lp->prompts->prompts[lp->username_prompt_index])); + } + + if (lp->password_prompt_index != -1) { + conf_set_str( + lp->conf, CONF_proxy_password, + prompt_get_result_ref( + lp->prompts->prompts[lp->password_prompt_index])); + } + + free_prompts(lp->prompts); + lp->prompts = NULL; + } + + /* + * Now format the command a second time, with the results of + * those prompts written into lp->conf. + */ + lp->formatted_cmd = format_telnet_command( + lp->addr, lp->port, lp->conf, NULL); + } + + /* + * Log the command, with some changes. Firstly, we regenerate it + * with the password masked; secondly, we escape control + * characters so that the log message is printable. + */ + conf_set_str(lp->conf, CONF_proxy_password, "*password*"); + { + char *censored_cmd = format_telnet_command( + lp->addr, lp->port, lp->conf, NULL); + + strbuf *logmsg = strbuf_new(); + put_datapl(logmsg, PTRLEN_LITERAL("Starting local proxy command: ")); + put_c_string_literal(logmsg, ptrlen_from_asciz(censored_cmd)); + + plug_log(lp->plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg->s, 0); + strbuf_free(logmsg); + sfree(censored_cmd); + } + + /* + * Now we're ready to actually do the platform-specific socket + * setup. + */ + char *cmd = lp->formatted_cmd; + lp->formatted_cmd = NULL; + + local_proxy_opener_cleanup_interactor(lp); + + char *error_msg = platform_setup_local_proxy(lp->socket, cmd); + burnstr(cmd); + + if (error_msg) { + plug_closing_error(lp->plug, error_msg); + sfree(error_msg); + } else { + /* If error_msg was NULL, there was no error in setup, + * which means that platform_setup_local_proxy will have + * called back to free us. So return without calling any + * crStop. */ + return; + } + + crFinishV; +} + +DeferredSocketOpener *local_proxy_opener( + SockAddr *addr, int port, Plug *plug, Conf *conf, Interactor *itr) +{ + LocalProxyOpener *lp = snew(LocalProxyOpener); + memset(lp, 0, sizeof(*lp)); + lp->plug = plug; + lp->opener.vt = &LocalProxyOpener_openervt; + lp->interactor.vt = &LocalProxyOpener_interactorvt; + lp->addr = sk_addr_dup(addr); + lp->port = port; + lp->conf = conf_copy(conf); + + if (itr) { + lp->clientitr = itr; + interactor_set_child(lp->clientitr, &lp->interactor); + lp->clientlp = interactor_logpolicy(lp->clientitr); + lp->clientseat = interactor_borrow_seat(lp->clientitr); + } + + return &lp->opener; +} + +void local_proxy_opener_set_socket(DeferredSocketOpener *opener, + Socket *socket) +{ + assert(opener->vt == &LocalProxyOpener_openervt); + LocalProxyOpener *lp = container_of(opener, LocalProxyOpener, opener); + lp->socket = socket; + queue_toplevel_callback(local_proxy_opener_coroutine, lp); +} diff --git a/code/proxy/nocproxy.c b/code/proxy/nocproxy.c new file mode 100644 index 0000000..8934148 --- /dev/null +++ b/code/proxy/nocproxy.c @@ -0,0 +1,33 @@ +/* + * Routines to refuse to do cryptographic interaction with proxies + * in PuTTY. This is a stub implementation of the same interfaces + * provided by cproxy.c, for use in PuTTYtel. + */ + +#include +#include +#include + +#include "putty.h" +#include "network.h" +#include "proxy.h" + +const bool socks5_chap_available = false; +const bool http_digest_available = false; + +strbuf *chap_response(ptrlen challenge, ptrlen password) +{ + unreachable("CHAP is not built into this binary"); +} + +/* dummy arrays to prevent link error */ +const char *const httphashnames[] = { NULL }; +const bool httphashaccepted[] = { false }; + +void http_digest_response(BinarySink *bs, ptrlen username, ptrlen password, + ptrlen realm, ptrlen method, ptrlen uri, ptrlen qop, + ptrlen nonce, ptrlen opaque, uint32_t nonce_count, + HttpDigestHash hash, bool hash_username) +{ + unreachable("HTTP DIGEST is not built into this binary"); +} diff --git a/code/noproxy.c b/code/proxy/noproxy.c similarity index 94% rename from code/noproxy.c rename to code/proxy/noproxy.c index 1d37293..248688e 100644 --- a/code/noproxy.c +++ b/code/proxy/noproxy.c @@ -20,7 +20,7 @@ SockAddr *name_lookup(const char *host, int port, char **canonicalname, Socket *new_connection(SockAddr *addr, const char *hostname, int port, bool privport, bool oobinline, bool nodelay, bool keepalive, - Plug *plug, Conf *conf) + Plug *plug, Conf *conf, Interactor *itr) { return sk_new(addr, port, privport, oobinline, nodelay, keepalive, plug); } diff --git a/code/proxy/nosshproxy.c b/code/proxy/nosshproxy.c new file mode 100644 index 0000000..1160b8d --- /dev/null +++ b/code/proxy/nosshproxy.c @@ -0,0 +1,16 @@ +/* + * nosshproxy.c: stub implementation of sshproxy_new_connection(). + */ + +#include "putty.h" +#include "network.h" + +const bool ssh_proxy_supported = false; + +Socket *sshproxy_new_connection(SockAddr *addr, const char *hostname, + int port, bool privport, + bool oobinline, bool nodelay, bool keepalive, + Plug *plug, Conf *conf, Interactor *itr) +{ + return NULL; +} diff --git a/code/pproxy.c b/code/proxy/pproxy.c similarity index 85% rename from code/pproxy.c rename to code/proxy/pproxy.c index 4b08606..1712ae8 100644 --- a/code/pproxy.c +++ b/code/proxy/pproxy.c @@ -11,7 +11,7 @@ Socket *platform_new_connection(SockAddr *addr, const char *hostname, int port, int privport, int oobinline, int nodelay, int keepalive, - Plug *plug, Conf *conf) + Plug *plug, Conf *conf, Interactor *itr) { return NULL; } diff --git a/code/proxy/proxy.c b/code/proxy/proxy.c new file mode 100644 index 0000000..801c28f --- /dev/null +++ b/code/proxy/proxy.c @@ -0,0 +1,654 @@ +/* + * Network proxy abstraction in PuTTY + * + * A proxy layer, if necessary, wedges itself between the network + * code and the higher level backend. + */ + +#include +#include +#include + +#include "putty.h" +#include "network.h" +#include "proxy.h" + +#define do_proxy_dns(conf) \ + (conf_get_int(conf, CONF_proxy_dns) == FORCE_ON || \ + (conf_get_int(conf, CONF_proxy_dns) == AUTO && \ + conf_get_int(conf, CONF_proxy_type) != PROXY_SOCKS4)) + +static void proxy_negotiator_cleanup(ProxySocket *ps) +{ + if (ps->pn) { + proxy_negotiator_free(ps->pn); + ps->pn = NULL; + } + if (ps->clientseat) { + interactor_return_seat(ps->clientitr); + ps->clientitr = NULL; + ps->clientseat = NULL; + } +} + +/* + * Call this when proxy negotiation is complete, so that this + * socket can begin working normally. + */ +void proxy_activate(ProxySocket *ps) +{ + size_t output_before, output_after; + + proxy_negotiator_cleanup(ps); + + plug_log(ps->plug, PLUGLOG_CONNECT_SUCCESS, NULL, 0, NULL, 0); + + /* we want to ignore new receive events until we have sent + * all of our buffered receive data. + */ + sk_set_frozen(ps->sub_socket, true); + + /* how many bytes of output have we buffered? */ + output_before = bufchain_size(&ps->pending_oob_output_data) + + bufchain_size(&ps->pending_output_data); + /* and keep track of how many bytes do not get sent. */ + output_after = 0; + + /* send buffered OOB writes */ + while (bufchain_size(&ps->pending_oob_output_data) > 0) { + ptrlen data = bufchain_prefix(&ps->pending_oob_output_data); + output_after += sk_write_oob(ps->sub_socket, data.ptr, data.len); + bufchain_consume(&ps->pending_oob_output_data, data.len); + } + + /* send buffered normal writes */ + while (bufchain_size(&ps->pending_output_data) > 0) { + ptrlen data = bufchain_prefix(&ps->pending_output_data); + output_after += sk_write(ps->sub_socket, data.ptr, data.len); + bufchain_consume(&ps->pending_output_data, data.len); + } + + /* if we managed to send any data, let the higher levels know. */ + if (output_after < output_before) + plug_sent(ps->plug, output_after); + + /* if we have a pending EOF to send, send it */ + if (ps->pending_eof) sk_write_eof(ps->sub_socket); + + /* if the backend wanted the socket unfrozen, try to unfreeze. + * our set_frozen handler will flush buffered receive data before + * unfreezing the actual underlying socket. + */ + if (!ps->freeze) + sk_set_frozen(&ps->sock, false); +} + +/* basic proxy socket functions */ + +static Plug *sk_proxy_plug (Socket *s, Plug *p) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + Plug *ret = ps->plug; + if (p) + ps->plug = p; + return ret; +} + +static void sk_proxy_close (Socket *s) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + + sk_close(ps->sub_socket); + sk_addr_free(ps->proxy_addr); + sk_addr_free(ps->remote_addr); + proxy_negotiator_cleanup(ps); + bufchain_clear(&ps->output_from_negotiator); + sfree(ps); +} + +static size_t sk_proxy_write (Socket *s, const void *data, size_t len) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + + if (ps->pn) { + bufchain_add(&ps->pending_output_data, data, len); + return bufchain_size(&ps->pending_output_data); + } + return sk_write(ps->sub_socket, data, len); +} + +static size_t sk_proxy_write_oob (Socket *s, const void *data, size_t len) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + + if (ps->pn) { + bufchain_clear(&ps->pending_output_data); + bufchain_clear(&ps->pending_oob_output_data); + bufchain_add(&ps->pending_oob_output_data, data, len); + return len; + } + return sk_write_oob(ps->sub_socket, data, len); +} + +static void sk_proxy_write_eof (Socket *s) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + + if (ps->pn) { + ps->pending_eof = true; + return; + } + sk_write_eof(ps->sub_socket); +} + +static void sk_proxy_set_frozen (Socket *s, bool is_frozen) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + + if (ps->pn) { + ps->freeze = is_frozen; + return; + } + + /* handle any remaining buffered recv data first */ + if (bufchain_size(&ps->pending_input_data) > 0) { + ps->freeze = is_frozen; + + /* loop while we still have buffered data, and while we are + * unfrozen. the plug_receive call in the loop could result + * in a call back into this function refreezing the socket, + * so we have to check each time. + */ + while (!ps->freeze && bufchain_size(&ps->pending_input_data) > 0) { + char databuf[512]; + ptrlen data = bufchain_prefix(&ps->pending_input_data); + if (data.len > lenof(databuf)) + data.len = lenof(databuf); + memcpy(databuf, data.ptr, data.len); + bufchain_consume(&ps->pending_input_data, data.len); + plug_receive(ps->plug, 0, databuf, data.len); + } + + /* if we're still frozen, we'll have to wait for another + * call from the backend to finish unbuffering the data. + */ + if (ps->freeze) return; + } + + sk_set_frozen(ps->sub_socket, is_frozen); +} + +static const char * sk_proxy_socket_error (Socket *s) +{ + ProxySocket *ps = container_of(s, ProxySocket, sock); + if (ps->error != NULL || ps->sub_socket == NULL) { + return ps->error; + } + return sk_socket_error(ps->sub_socket); +} + +/* basic proxy plug functions */ + +static void plug_proxy_log(Plug *plug, PlugLogType type, SockAddr *addr, + int port, const char *error_msg, int error_code) +{ + ProxySocket *ps = container_of(plug, ProxySocket, plugimpl); + + plug_log(ps->plug, type, addr, port, error_msg, error_code); +} + +static void plug_proxy_closing(Plug *p, PlugCloseType type, + const char *error_msg) +{ + ProxySocket *ps = container_of(p, ProxySocket, plugimpl); + + proxy_negotiator_cleanup(ps); + plug_closing(ps->plug, type, error_msg); +} + +static void proxy_negotiate(ProxySocket *ps) +{ + assert(ps->pn); + proxy_negotiator_process_queue(ps->pn); + + if (ps->pn->error) { + char *err = dupprintf("Proxy error: %s", ps->pn->error); + sfree(ps->pn->error); + proxy_negotiator_cleanup(ps); + plug_closing_error(ps->plug, err); + sfree(err); + return; + } else if (ps->pn->aborted) { + proxy_negotiator_cleanup(ps); + plug_closing_user_abort(ps->plug); + return; + } + + if (ps->pn->reconnect) { + sk_close(ps->sub_socket); + SockAddr *proxy_addr = sk_addr_dup(ps->proxy_addr); + ps->sub_socket = sk_new(proxy_addr, ps->proxy_port, + ps->proxy_privport, ps->proxy_oobinline, + ps->proxy_nodelay, ps->proxy_keepalive, + &ps->plugimpl); + ps->pn->reconnect = false; + /* If the negotiator has asked us to reconnect, they are + * expecting that on the next call their input queue will + * consist entirely of data from the _new_ connection, without + * any remaining data buffered from the old one. (If they'd + * wanted the latter, they could have read it out of the input + * queue before asking us to close the connection.) */ + bufchain_clear(&ps->pending_input_data); + } + + while (bufchain_size(&ps->output_from_negotiator)) { + ptrlen data = bufchain_prefix(&ps->output_from_negotiator); + sk_write(ps->sub_socket, data.ptr, data.len); + bufchain_consume(&ps->output_from_negotiator, data.len); + } + if (ps->pn->done) + proxy_activate(ps); +} + +static void plug_proxy_receive( + Plug *p, int urgent, const char *data, size_t len) +{ + ProxySocket *ps = container_of(p, ProxySocket, plugimpl); + + if (ps->pn) { + /* we will lose the urgentness of this data, but since most, + * if not all, of this data will be consumed by the negotiation + * process, hopefully it won't affect the protocol above us + */ + bufchain_add(&ps->pending_input_data, data, len); + proxy_negotiate(ps); + } else { + plug_receive(ps->plug, urgent, data, len); + } +} + +static void plug_proxy_sent (Plug *p, size_t bufsize) +{ + ProxySocket *ps = container_of(p, ProxySocket, plugimpl); + + if (ps->pn) + return; + plug_sent(ps->plug, bufsize); +} + +static int plug_proxy_accepting(Plug *p, + accept_fn_t constructor, accept_ctx_t ctx) +{ + unreachable("ProxySockets never create listening Sockets"); +} + +/* + * This function can accept a NULL pointer as `addr', in which case + * it will only check the host name. + */ +static bool proxy_for_destination(SockAddr *addr, const char *hostname, + int port, Conf *conf) +{ + int s = 0, e = 0; + char hostip[64]; + int hostip_len, hostname_len; + const char *exclude_list; + + /* + * Special local connections such as Unix-domain sockets + * unconditionally cannot be proxied, even in proxy-localhost + * mode. There just isn't any way to ask any known proxy type for + * them. + */ + if (addr && sk_address_is_special_local(addr)) + return false; /* do not proxy */ + + /* + * Check the host name and IP against the hard-coded + * representations of `localhost'. + */ + if (!conf_get_bool(conf, CONF_even_proxy_localhost) && + (sk_hostname_is_local(hostname) || + (addr && sk_address_is_local(addr)))) + return false; /* do not proxy */ + + /* we want a string representation of the IP address for comparisons */ + if (addr) { + sk_getaddr(addr, hostip, 64); + hostip_len = strlen(hostip); + } else + hostip_len = 0; /* placate gcc; shouldn't be required */ + + hostname_len = strlen(hostname); + + exclude_list = conf_get_str(conf, CONF_proxy_exclude_list); + + /* now parse the exclude list, and see if either our IP + * or hostname matches anything in it. + */ + + while (exclude_list[s]) { + while (exclude_list[s] && + (isspace((unsigned char)exclude_list[s]) || + exclude_list[s] == ',')) s++; + + if (!exclude_list[s]) break; + + e = s; + + while (exclude_list[e] && + (isalnum((unsigned char)exclude_list[e]) || + exclude_list[e] == '-' || + exclude_list[e] == '.' || + exclude_list[e] == '*')) e++; + + if (exclude_list[s] == '*') { + /* wildcard at beginning of entry */ + + if ((addr && strnicmp(hostip + hostip_len - (e - s - 1), + exclude_list + s + 1, e - s - 1) == 0) || + strnicmp(hostname + hostname_len - (e - s - 1), + exclude_list + s + 1, e - s - 1) == 0) { + /* IP/hostname range excluded. do not use proxy. */ + return false; + } + } else if (exclude_list[e-1] == '*') { + /* wildcard at end of entry */ + + if ((addr && strnicmp(hostip, exclude_list + s, e - s - 1) == 0) || + strnicmp(hostname, exclude_list + s, e - s - 1) == 0) { + /* IP/hostname range excluded. do not use proxy. */ + return false; + } + } else { + /* no wildcard at either end, so let's try an absolute + * match (ie. a specific IP) + */ + + if (addr && strnicmp(hostip, exclude_list + s, e - s) == 0) + return false; /* IP/hostname excluded. do not use proxy. */ + if (strnicmp(hostname, exclude_list + s, e - s) == 0) + return false; /* IP/hostname excluded. do not use proxy. */ + } + + s = e; + + /* Make sure we really have reached the next comma or end-of-string */ + while (exclude_list[s] && + !isspace((unsigned char)exclude_list[s]) && + exclude_list[s] != ',') s++; + } + + /* no matches in the exclude list, so use the proxy */ + return true; +} + +static char *dns_log_msg(const char *host, int addressfamily, + const char *reason) +{ + return dupprintf("Looking up host \"%s\"%s for %s", host, + (addressfamily == ADDRTYPE_IPV4 ? " (IPv4)" : + addressfamily == ADDRTYPE_IPV6 ? " (IPv6)" : + ""), reason); +} + +SockAddr *name_lookup(const char *host, int port, char **canonicalname, + Conf *conf, int addressfamily, LogContext *logctx, + const char *reason) +{ + if (conf_get_int(conf, CONF_proxy_type) != PROXY_NONE && + do_proxy_dns(conf) && + proxy_for_destination(NULL, host, port, conf)) { + + if (logctx) + logeventf(logctx, "Leaving host lookup to proxy of \"%s\"" + " (for %s)", host, reason); + + *canonicalname = dupstr(host); + return sk_nonamelookup(host); + } else { + if (logctx) + logevent_and_free( + logctx, dns_log_msg(host, addressfamily, reason)); + + return sk_namelookup(host, canonicalname, addressfamily); + } +} + +static const SocketVtable ProxySocket_sockvt = { + .plug = sk_proxy_plug, + .close = sk_proxy_close, + .write = sk_proxy_write, + .write_oob = sk_proxy_write_oob, + .write_eof = sk_proxy_write_eof, + .set_frozen = sk_proxy_set_frozen, + .socket_error = sk_proxy_socket_error, + .peer_info = NULL, +}; + +static const PlugVtable ProxySocket_plugvt = { + .log = plug_proxy_log, + .closing = plug_proxy_closing, + .receive = plug_proxy_receive, + .sent = plug_proxy_sent, + .accepting = plug_proxy_accepting +}; + +static char *proxy_description(Interactor *itr) +{ + ProxySocket *ps = container_of(itr, ProxySocket, interactor); + assert(ps->pn); + return dupprintf("%s connection to %s port %d", ps->pn->vt->type, + conf_get_str(ps->conf, CONF_proxy_host), + conf_get_int(ps->conf, CONF_proxy_port)); +} + +static LogPolicy *proxy_logpolicy(Interactor *itr) +{ + ProxySocket *ps = container_of(itr, ProxySocket, interactor); + return ps->clientlp; +} + +static Seat *proxy_get_seat(Interactor *itr) +{ + ProxySocket *ps = container_of(itr, ProxySocket, interactor); + return ps->clientseat; +} + +static void proxy_set_seat(Interactor *itr, Seat *seat) +{ + ProxySocket *ps = container_of(itr, ProxySocket, interactor); + ps->clientseat = seat; +} + +static const InteractorVtable ProxySocket_interactorvt = { + .description = proxy_description, + .logpolicy = proxy_logpolicy, + .get_seat = proxy_get_seat, + .set_seat = proxy_set_seat, +}; + +static void proxy_prompts_callback(void *ctx) +{ + proxy_negotiate((ProxySocket *)ctx); +} + +prompts_t *proxy_new_prompts(ProxySocket *ps) +{ + prompts_t *prs = new_prompts(); + prs->callback = proxy_prompts_callback; + prs->callback_ctx = ps; + return prs; +} + +void proxy_spr_abort(ProxyNegotiator *pn, SeatPromptResult spr) +{ + if (spr.kind == SPRK_SW_ABORT) { + pn->error = spr_get_error_message(spr); + } else { + assert(spr.kind == SPRK_USER_ABORT); + pn->aborted = true; + } +} + +Socket *new_connection(SockAddr *addr, const char *hostname, + int port, bool privport, + bool oobinline, bool nodelay, bool keepalive, + Plug *plug, Conf *conf, Interactor *itr) +{ + int type = conf_get_int(conf, CONF_proxy_type); + + if (type != PROXY_NONE && + proxy_for_destination(addr, hostname, port, conf)) + { + ProxySocket *ps; + SockAddr *proxy_addr; + char *proxy_canonical_name; + Socket *sret; + + if (type == PROXY_SSH && + (sret = sshproxy_new_connection(addr, hostname, port, privport, + oobinline, nodelay, keepalive, + plug, conf, itr)) != NULL) + return sret; + + if ((sret = platform_new_connection(addr, hostname, port, privport, + oobinline, nodelay, keepalive, + plug, conf, itr)) != NULL) + return sret; + + ps = snew(ProxySocket); + ps->sock.vt = &ProxySocket_sockvt; + ps->plugimpl.vt = &ProxySocket_plugvt; + ps->interactor.vt = &ProxySocket_interactorvt; + ps->conf = conf_copy(conf); + ps->plug = plug; + ps->remote_addr = addr; /* will need to be freed on close */ + ps->remote_port = port; + + ps->error = NULL; + ps->pending_eof = false; + ps->freeze = false; + + bufchain_init(&ps->pending_input_data); + bufchain_init(&ps->pending_output_data); + bufchain_init(&ps->pending_oob_output_data); + bufchain_init(&ps->output_from_negotiator); + + ps->sub_socket = NULL; + + /* + * If we've been given an Interactor by the caller, set ourselves + * up to work with it. + */ + if (itr) { + ps->clientitr = itr; + interactor_set_child(ps->clientitr, &ps->interactor); + ps->clientlp = interactor_logpolicy(ps->clientitr); + ps->clientseat = interactor_borrow_seat(ps->clientitr); + } + + const ProxyNegotiatorVT *vt; + switch (type) { + case PROXY_HTTP: + vt = &http_proxy_negotiator_vt; + break; + case PROXY_SOCKS4: + vt = &socks4_proxy_negotiator_vt; + break; + case PROXY_SOCKS5: + vt = &socks5_proxy_negotiator_vt; + break; + case PROXY_TELNET: + vt = &telnet_proxy_negotiator_vt; + break; + default: + ps->error = "Proxy error: Unknown proxy method"; + return &ps->sock; + } + ps->pn = proxy_negotiator_new(vt); + ps->pn->ps = ps; + ps->pn->done = false; + ps->pn->error = NULL; + ps->pn->aborted = false; + ps->pn->input = &ps->pending_input_data; + /* Provide an Interactor to the negotiator if and only if we + * are usefully able to ask interactive questions of the user */ + ps->pn->itr = ps->clientseat ? &ps->interactor : NULL; + bufchain_sink_init(ps->pn->output, &ps->output_from_negotiator); + + { + char *logmsg = dupprintf("Will use %s proxy at %s:%d to connect" + " to %s:%d", vt->type, + conf_get_str(conf, CONF_proxy_host), + conf_get_int(conf, CONF_proxy_port), + hostname, port); + plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); + sfree(logmsg); + } + + { + char *logmsg = dns_log_msg(conf_get_str(conf, CONF_proxy_host), + conf_get_int(conf, CONF_addressfamily), + "proxy"); + plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); + sfree(logmsg); + } + + /* look-up proxy */ + proxy_addr = sk_namelookup(conf_get_str(conf, CONF_proxy_host), + &proxy_canonical_name, + conf_get_int(conf, CONF_addressfamily)); + if (sk_addr_error(proxy_addr) != NULL) { + ps->error = "Proxy error: Unable to resolve proxy host name"; + sk_addr_free(proxy_addr); + return &ps->sock; + } + sfree(proxy_canonical_name); + + { + char addrbuf[256], *logmsg; + sk_getaddr(proxy_addr, addrbuf, lenof(addrbuf)); + logmsg = dupprintf("Connecting to %s proxy at %s port %d", + vt->type, addrbuf, + conf_get_int(conf, CONF_proxy_port)); + plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); + sfree(logmsg); + } + + /* create the actual socket we will be using, + * connected to our proxy server and port. + */ + ps->proxy_addr = sk_addr_dup(proxy_addr); + ps->proxy_port = conf_get_int(conf, CONF_proxy_port); + ps->proxy_privport = privport; + ps->proxy_oobinline = oobinline; + ps->proxy_nodelay = nodelay; + ps->proxy_keepalive = keepalive; + ps->sub_socket = sk_new(proxy_addr, ps->proxy_port, + ps->proxy_privport, ps->proxy_oobinline, + ps->proxy_nodelay, ps->proxy_keepalive, + &ps->plugimpl); + if (sk_socket_error(ps->sub_socket) != NULL) + return &ps->sock; + + /* start the proxy negotiation process... */ + sk_set_frozen(ps->sub_socket, false); + proxy_negotiate(ps); + + return &ps->sock; + } + + /* no proxy, so just return the direct socket */ + return sk_new(addr, port, privport, oobinline, nodelay, keepalive, plug); +} + +Socket *new_listener(const char *srcaddr, int port, Plug *plug, + bool local_host_only, Conf *conf, int addressfamily) +{ + /* TODO: SOCKS (and potentially others) support inbound + * TODO: connections via the proxy. support them. + */ + + return sk_newlistener(srcaddr, port, plug, local_host_only, addressfamily); +} diff --git a/code/proxy/proxy.h b/code/proxy/proxy.h new file mode 100644 index 0000000..72d06d4 --- /dev/null +++ b/code/proxy/proxy.h @@ -0,0 +1,127 @@ +/* + * Network proxy abstraction in PuTTY + * + * A proxy layer, if necessary, wedges itself between the + * network code and the higher level backend. + * + * Supported proxies: HTTP CONNECT, generic telnet, SOCKS 4 & 5 + */ + +#ifndef PUTTY_PROXY_H +#define PUTTY_PROXY_H + +typedef struct ProxySocket ProxySocket; +typedef struct ProxyNegotiator ProxyNegotiator; +typedef struct ProxyNegotiatorVT ProxyNegotiatorVT; + +struct ProxySocket { + const char *error; + + Socket *sub_socket; + Plug *plug; + SockAddr *remote_addr; + int remote_port; + + /* Parameters needed to make further connections to the proxy */ + SockAddr *proxy_addr; + int proxy_port; + bool proxy_privport, proxy_oobinline, proxy_nodelay, proxy_keepalive; + + bufchain pending_output_data; + bufchain pending_oob_output_data; + bufchain pending_input_data; + bool pending_eof; + + bool freeze; /* should we freeze the underlying socket when + * we are done with the proxy negotiation? this + * simply caches the value of sk_set_frozen calls. + */ + + ProxyNegotiator *pn; /* non-NULL if still negotiating */ + bufchain output_from_negotiator; + + /* configuration, used to look up proxy settings */ + Conf *conf; + + /* for interaction with the Seat */ + Interactor *clientitr; + LogPolicy *clientlp; + Seat *clientseat; + + Socket sock; + Plug plugimpl; + Interactor interactor; +}; + +struct ProxyNegotiator { + const ProxyNegotiatorVT *vt; + + /* Standard fields for any ProxyNegotiator. new() and free() don't + * have to set these up; that's done centrally, to save duplication. */ + ProxySocket *ps; + bufchain *input; + bufchain_sink output[1]; + Interactor *itr; /* NULL if we are not able to interact with the user */ + + /* Set to report success during proxy negotiation. */ + bool done; + + /* Set to report an error during proxy negotiation. The main + * ProxySocket will free it, and will then guarantee never to call + * process_queue again. */ + char *error; + + /* Set to report user abort during proxy negotiation. */ + bool aborted; + + /* Set to request the centralised code to make a fresh connection + * to the proxy server, e.g. because an HTTP proxy slammed the + * connection shut after sending 407 Proxy Auth Required. */ + bool reconnect; +}; + +struct ProxyNegotiatorVT { + ProxyNegotiator *(*new)(const ProxyNegotiatorVT *); + void (*process_queue)(ProxyNegotiator *); + void (*free)(ProxyNegotiator *); + const char *type; +}; + +static inline ProxyNegotiator *proxy_negotiator_new( + const ProxyNegotiatorVT *vt) +{ return vt->new(vt); } +static inline void proxy_negotiator_process_queue(ProxyNegotiator *pn) +{ pn->vt->process_queue(pn); } +static inline void proxy_negotiator_free(ProxyNegotiator *pn) +{ pn->vt->free(pn); } + +extern const ProxyNegotiatorVT http_proxy_negotiator_vt; +extern const ProxyNegotiatorVT socks4_proxy_negotiator_vt; +extern const ProxyNegotiatorVT socks5_proxy_negotiator_vt; +extern const ProxyNegotiatorVT telnet_proxy_negotiator_vt; + +/* + * Centralised functions to allow ProxyNegotiators to get hold of a + * prompts_t, and to deal with SeatPromptResults coming back. + */ +prompts_t *proxy_new_prompts(ProxySocket *ps); +void proxy_spr_abort(ProxyNegotiator *pn, SeatPromptResult spr); + +/* + * This may be reused by local-command proxies on individual + * platforms. + */ +#define TELNET_CMD_MISSING_USERNAME 0x0001 +#define TELNET_CMD_MISSING_PASSWORD 0x0002 +char *format_telnet_command(SockAddr *addr, int port, Conf *conf, + unsigned *flags_out); + +DeferredSocketOpener *local_proxy_opener( + SockAddr *addr, int port, Plug *plug, Conf *conf, Interactor *itr); +void local_proxy_opener_set_socket(DeferredSocketOpener *opener, + Socket *socket); +char *platform_setup_local_proxy(Socket *socket, const char *cmd); + +#include "cproxy.h" + +#endif diff --git a/code/proxy/socks.h b/code/proxy/socks.h new file mode 100644 index 0000000..3e86ae2 --- /dev/null +++ b/code/proxy/socks.h @@ -0,0 +1,72 @@ +/* + * Constants used in the SOCKS protocols. + */ + +/* Command codes common to both versions */ +#define SOCKS_CMD_CONNECT 1 +#define SOCKS_CMD_BIND 2 + +/* SOCKS 4 definitions */ + +#define SOCKS4_REQUEST_VERSION 4 +#define SOCKS4_REPLY_VERSION 0 + +#define SOCKS4_RESP_SUCCESS 90 +#define SOCKS4_RESP_FAILURE 91 +#define SOCKS4_RESP_WANT_IDENTD 92 +#define SOCKS4_RESP_IDENTD_MISMATCH 93 + +/* + * Special nonsense IP address range, used as a signal to indicate + * that an ASCIZ hostname follows the user id field. + * + * Strictly speaking, the use of this extension indicates that we're + * speaking SOCKS 4A rather than vanilla SOCKS 4, although we don't + * bother to draw the distinction. + */ +#define SOCKS4A_NAME_FOLLOWS_BASE 0x00000001 /* inclusive */ +#define SOCKS4A_NAME_FOLLOWS_LIMIT 0x00000100 /* exclusive */ + +/* SOCKS 5 definitions */ + +#define SOCKS5_REQUEST_VERSION 5 +#define SOCKS5_REPLY_VERSION 5 + +/* Extra command codes extending the SOCKS_CMD_* list above */ +#define SOCKS5_CMD_UDP_ASSOCIATE 3 + +#define SOCKS5_AUTH_NONE 0 +#define SOCKS5_AUTH_GSSAPI 1 +#define SOCKS5_AUTH_PASSWORD 2 +#define SOCKS5_AUTH_CHAP 3 +#define SOCKS5_AUTH_REJECTED 0xFF /* used in reply to indicate 'no + * acceptable method offered' */ + +#define SOCKS5_AUTH_PASSWORD_VERSION 1 + +#define SOCKS5_AUTH_CHAP_VERSION 1 + +#define SOCKS5_AUTH_CHAP_ATTR_STATUS 0x00 +#define SOCKS5_AUTH_CHAP_ATTR_INFO 0x01 +#define SOCKS5_AUTH_CHAP_ATTR_USERNAME 0x02 +#define SOCKS5_AUTH_CHAP_ATTR_CHALLENGE 0x03 +#define SOCKS5_AUTH_CHAP_ATTR_RESPONSE 0x04 +#define SOCKS5_AUTH_CHAP_ATTR_CHARSET 0x05 +#define SOCKS5_AUTH_CHAP_ATTR_IDENTIFIER 0x10 +#define SOCKS5_AUTH_CHAP_ATTR_ALGLIST 0x11 + +#define SOCKS5_AUTH_CHAP_ALG_HMACMD5 0x85 + +#define SOCKS5_ADDR_IPV4 1 +#define SOCKS5_ADDR_IPV6 4 +#define SOCKS5_ADDR_HOSTNAME 3 + +#define SOCKS5_RESP_SUCCESS 0 +#define SOCKS5_RESP_FAILURE 1 +#define SOCKS5_RESP_CONNECTION_NOT_ALLOWED_BY_RULESET 2 +#define SOCKS5_RESP_NETWORK_UNREACHABLE 3 +#define SOCKS5_RESP_HOST_UNREACHABLE 4 +#define SOCKS5_RESP_CONNECTION_REFUSED 5 +#define SOCKS5_RESP_TTL_EXPIRED 6 +#define SOCKS5_RESP_COMMAND_NOT_SUPPORTED 7 +#define SOCKS5_RESP_ADDRTYPE_NOT_SUPPORTED 8 diff --git a/code/proxy/socks4.c b/code/proxy/socks4.c new file mode 100644 index 0000000..ac85ec0 --- /dev/null +++ b/code/proxy/socks4.c @@ -0,0 +1,136 @@ +/* + * SOCKS 4 proxy negotiation. + */ + +#include "putty.h" +#include "network.h" +#include "proxy.h" +#include "socks.h" +#include "sshcr.h" + +typedef struct Socks4ProxyNegotiator { + int crLine; + ProxyNegotiator pn; +} Socks4ProxyNegotiator; + +static ProxyNegotiator *proxy_socks4_new(const ProxyNegotiatorVT *vt) +{ + Socks4ProxyNegotiator *s = snew(Socks4ProxyNegotiator); + s->pn.vt = vt; + s->crLine = 0; + return &s->pn; +} + +static void proxy_socks4_free(ProxyNegotiator *pn) +{ + Socks4ProxyNegotiator *s = container_of(pn, Socks4ProxyNegotiator, pn); + sfree(s); +} + +static void proxy_socks4_process_queue(ProxyNegotiator *pn) +{ + Socks4ProxyNegotiator *s = container_of(pn, Socks4ProxyNegotiator, pn); + + crBegin(s->crLine); + + { + char hostname[512]; + bool write_hostname = false; + + /* + * SOCKS 4 request packet: + * + * byte version + * byte command + * uint16 destination port number + * uint32 destination IPv4 address (or something in the + * SOCKS4A_NAME_FOLLOWS range) + * asciz username + * asciz destination hostname (if we sent SOCKS4A_NAME_FOLLOWS_*) + */ + + put_byte(pn->output, SOCKS4_REQUEST_VERSION); + put_byte(pn->output, SOCKS_CMD_CONNECT); + put_uint16(pn->output, pn->ps->remote_port); + + switch (sk_addrtype(pn->ps->remote_addr)) { + case ADDRTYPE_IPV4: { + char addr[4]; + sk_addrcopy(pn->ps->remote_addr, addr); + put_data(pn->output, addr, 4); + break; + } + case ADDRTYPE_NAME: + put_uint32(pn->output, SOCKS4A_NAME_FOLLOWS_BASE); + sk_getaddr(pn->ps->remote_addr, hostname, lenof(hostname)); + write_hostname = true; + break; + case ADDRTYPE_IPV6: + pn->error = dupstr("SOCKS version 4 does not support IPv6"); + crStopV; + } + + put_asciz(pn->output, conf_get_str(pn->ps->conf, CONF_proxy_username)); + + if (write_hostname) + put_asciz(pn->output, hostname); + } + + crReturnV; + + { + unsigned char data[8]; + crMaybeWaitUntilV(bufchain_try_fetch_consume(pn->input, data, 8)); + + /* + * SOCKS 4 response packet: + * + * byte version + * byte status + * uint16 port number + * uint32 IPv4 address + * + * We don't need to worry about the port and destination address. + */ + + if (data[0] != SOCKS4_REPLY_VERSION) { + pn->error = dupprintf("SOCKS proxy response contained reply " + "version number %d (expected 0)", + (int)data[0]); + crStopV; + } + + switch (data[1]) { + case SOCKS4_RESP_SUCCESS: + pn->done = true; + break; + + case SOCKS4_RESP_FAILURE: + pn->error = dupstr("SOCKS server reported failure to connect"); + break; + + case SOCKS4_RESP_WANT_IDENTD: + pn->error = dupstr("SOCKS server wanted IDENTD on client"); + break; + + case SOCKS4_RESP_IDENTD_MISMATCH: + pn->error = dupstr("Username and IDENTD on client don't agree"); + break; + + default: + pn->error = dupprintf("SOCKS server sent unrecognised error " + "code %d", (int)data[1]); + break; + } + crStopV; + } + + crFinishV; +} + +const struct ProxyNegotiatorVT socks4_proxy_negotiator_vt = { + .new = proxy_socks4_new, + .free = proxy_socks4_free, + .process_queue = proxy_socks4_process_queue, + .type = "SOCKS 4", +}; diff --git a/code/proxy/socks5.c b/code/proxy/socks5.c new file mode 100644 index 0000000..87a0bbc --- /dev/null +++ b/code/proxy/socks5.c @@ -0,0 +1,498 @@ +/* + * SOCKS 5 proxy negotiation. + */ + +#include "putty.h" +#include "network.h" +#include "proxy.h" +#include "socks.h" +#include "sshcr.h" + +static inline const char *socks5_auth_name(unsigned char m) +{ + switch (m) { + case SOCKS5_AUTH_NONE: return "none"; + case SOCKS5_AUTH_GSSAPI: return "GSSAPI"; + case SOCKS5_AUTH_PASSWORD: return "password"; + case SOCKS5_AUTH_CHAP: return "CHAP"; + default: return "unknown"; + } +} + +static inline const char *socks5_response_text(unsigned char m) +{ + switch (m) { + case SOCKS5_RESP_SUCCESS: return "success"; + case SOCKS5_RESP_FAILURE: return "unspecified failure"; + case SOCKS5_RESP_CONNECTION_NOT_ALLOWED_BY_RULESET: + return "connection not allowed by ruleset"; + case SOCKS5_RESP_NETWORK_UNREACHABLE: return "network unreachable"; + case SOCKS5_RESP_HOST_UNREACHABLE: return "host unreachable"; + case SOCKS5_RESP_CONNECTION_REFUSED: return "connection refused"; + case SOCKS5_RESP_TTL_EXPIRED: return "TTL expired"; + case SOCKS5_RESP_COMMAND_NOT_SUPPORTED: return "command not supported"; + case SOCKS5_RESP_ADDRTYPE_NOT_SUPPORTED: + return "address type not supported"; + default: return "unknown"; + } +} + +typedef struct Socks5ProxyNegotiator { + int crLine; + strbuf *auth_methods_offered; + unsigned char auth_method; + unsigned n_chap_attrs; + unsigned chap_attr, chap_attr_len; + unsigned char chap_buf[256]; + strbuf *username, *password; + prompts_t *prompts; + int username_prompt_index, password_prompt_index; + int response_addr_length; + ProxyNegotiator pn; +} Socks5ProxyNegotiator; + +static ProxyNegotiator *proxy_socks5_new(const ProxyNegotiatorVT *vt) +{ + Socks5ProxyNegotiator *s = snew(Socks5ProxyNegotiator); + memset(s, 0, sizeof(*s)); + s->pn.vt = vt; + s->auth_methods_offered = strbuf_new(); + s->username = strbuf_new(); + s->password = strbuf_new_nm(); + return &s->pn; +} + +static void proxy_socks5_free(ProxyNegotiator *pn) +{ + Socks5ProxyNegotiator *s = container_of(pn, Socks5ProxyNegotiator, pn); + strbuf_free(s->auth_methods_offered); + strbuf_free(s->username); + strbuf_free(s->password); + if (s->prompts) + free_prompts(s->prompts); + smemclr(s, sizeof(*s)); + sfree(s); +} + +static void proxy_socks5_process_queue(ProxyNegotiator *pn) +{ + Socks5ProxyNegotiator *s = container_of(pn, Socks5ProxyNegotiator, pn); + + crBegin(s->crLine); + + /* + * SOCKS 5 initial client packet: + * + * byte version + * byte number of available auth methods + * byte[] that many bytes indicating auth types + */ + + put_byte(pn->output, SOCKS5_REQUEST_VERSION); + + strbuf_clear(s->auth_methods_offered); + + /* + * We have two basic kinds of authentication to offer: none at + * all, and password-based systems (whether the password is sent + * in cleartext or proved via CHAP). + * + * We always offer 'none' as an option. We offer 'password' if we + * either have a username and password already from the Conf, or + * we have a Seat available to ask for them interactively. If + * neither, we don't offer those options in the first place. + */ + put_byte(s->auth_methods_offered, SOCKS5_AUTH_NONE); + + put_dataz(s->username, conf_get_str(pn->ps->conf, CONF_proxy_username)); + put_dataz(s->password, conf_get_str(pn->ps->conf, CONF_proxy_password)); + if (pn->itr || (s->username->len && s->password->len)) { + if (socks5_chap_available) + put_byte(s->auth_methods_offered, SOCKS5_AUTH_CHAP); + + put_byte(s->auth_methods_offered, SOCKS5_AUTH_PASSWORD); + } + + put_byte(pn->output, s->auth_methods_offered->len); + put_datapl(pn->output, ptrlen_from_strbuf(s->auth_methods_offered)); + + crReturnV; + + /* + * SOCKS 5 initial server packet: + * + * byte version + * byte selected auth method, or SOCKS5_AUTH_REJECTED + */ + { + unsigned char data[2]; + crMaybeWaitUntilV(bufchain_try_fetch_consume(pn->input, data, 2)); + + if (data[0] != SOCKS5_REPLY_VERSION) { + pn->error = dupprintf("SOCKS proxy returned unexpected " + "reply version %d (expected %d)", + (int)data[0], SOCKS5_REPLY_VERSION); + crStopV; + } + + if (data[1] == SOCKS5_AUTH_REJECTED) { + pn->error = dupstr("SOCKS server rejected every authentication " + "method we offered"); + crStopV; + } + + { + bool found = false; + for (size_t i = 0; i < s->auth_methods_offered->len; i++) + if (s->auth_methods_offered->u[i] == data[1]) { + found = true; + break; + } + + if (!found) { + pn->error = dupprintf("SOCKS server asked for auth method %d " + "(%s), which we did not offer", + (int)data[1], socks5_auth_name(data[1])); + crStopV; + } + } + + s->auth_method = data[1]; + } + + /* + * The 'none' auth option requires no further negotiation. If that + * was the one we selected, go straight to making the connection. + */ + if (s->auth_method == SOCKS5_AUTH_NONE) + goto authenticated; + + /* + * Otherwise, we're going to need a username and password, so this + * is the moment to stop and ask for one if we don't already have + * them. + */ + if (pn->itr && (!s->username->len || !s->password->len)) { + s->prompts = proxy_new_prompts(pn->ps); + s->prompts->to_server = true; + s->prompts->from_server = false; + s->prompts->name = dupstr("SOCKS proxy authentication"); + if (!s->username->len) { + s->username_prompt_index = s->prompts->n_prompts; + add_prompt(s->prompts, dupstr("Proxy username: "), true); + } else { + s->username_prompt_index = -1; + } + if (!s->password->len) { + s->password_prompt_index = s->prompts->n_prompts; + add_prompt(s->prompts, dupstr("Proxy password: "), false); + } else { + s->password_prompt_index = -1; + } + + while (true) { + SeatPromptResult spr = seat_get_userpass_input( + interactor_announce(pn->itr), s->prompts); + if (spr.kind == SPRK_OK) { + break; + } else if (spr_is_abort(spr)) { + proxy_spr_abort(pn, spr); + crStopV; + } + crReturnV; + } + + if (s->username_prompt_index != -1) { + strbuf_clear(s->username); + put_dataz(s->username, + prompt_get_result_ref( + s->prompts->prompts[s->username_prompt_index])); + } + + if (s->password_prompt_index != -1) { + strbuf_clear(s->password); + put_dataz(s->password, + prompt_get_result_ref( + s->prompts->prompts[s->password_prompt_index])); + } + + free_prompts(s->prompts); + s->prompts = NULL; + } + + /* + * Now process the different auth methods that will use that + * username and password. Note we can't do this using the natural + * idiom of a switch statement, because there are crReturns inside + * some cases. + */ + if (s->auth_method == SOCKS5_AUTH_PASSWORD) { + /* + * SOCKS 5 password auth packet: + * + * byte version + * pstring username + * pstring password + */ + put_byte(pn->output, SOCKS5_AUTH_PASSWORD_VERSION); + if (!put_pstring(pn->output, s->username->s)) { + pn->error = dupstr("SOCKS 5 authentication cannot support " + "usernames longer than 255 chars"); + crStopV; + } + if (!put_pstring(pn->output, s->password->s)) { + pn->error = dupstr("SOCKS 5 authentication cannot support " + "passwords longer than 255 chars"); + crStopV; + } + + /* + * SOCKS 5 password reply packet: + * + * byte version + * byte 0 for success, >0 for failure + */ + unsigned char data[2]; + crMaybeWaitUntilV(bufchain_try_fetch_consume(pn->input, data, 2)); + + if (data[0] != SOCKS5_AUTH_PASSWORD_VERSION) { + pn->error = dupprintf( + "SOCKS 5 password reply had version number %d (expected " + "%d)", (int)data[0], SOCKS5_AUTH_PASSWORD_VERSION); + crStopV; + } + + if (data[1] != 0) { + pn->error = dupstr("SOCKS 5 server rejected our password"); + crStopV; + } + } else if (s->auth_method == SOCKS5_AUTH_CHAP) { + assert(socks5_chap_available); + + /* + * All CHAP packets, in both directions, have the same + * overall format: + * + * byte version + * byte number of attributes + * + * and then for each attribute: + * + * byte attribute type + * byte length + * byte[] that many bytes of payload + * + * In the initial outgoing packet we send two attributes: + * the list of supported algorithm names, and the + * username. + * + * (It's possible that we ought to delay sending the + * username until the second packet, in case the proxy + * sent back an attribute indicating which character set + * it would like us to use.) + */ + put_byte(pn->output, SOCKS5_AUTH_CHAP_VERSION); + put_byte(pn->output, 2); /* number of attributes */ + + put_byte(pn->output, SOCKS5_AUTH_CHAP_ATTR_ALGLIST); + put_byte(pn->output, 1); /* string length */ + put_byte(pn->output, SOCKS5_AUTH_CHAP_ALG_HMACMD5); + + /* Second attribute: username */ + { + put_byte(pn->output, SOCKS5_AUTH_CHAP_ATTR_USERNAME); + if (!put_pstring(pn->output, s->username->s)) { + pn->error = dupstr( + "SOCKS 5 CHAP authentication cannot support " + "usernames longer than 255 chars"); + crStopV; + } + } + + while (true) { + /* + * Process a CHAP response packet, which has the same + * overall format as the outgoing packet shown above. + */ + unsigned char data[2]; + crMaybeWaitUntilV(bufchain_try_fetch_consume( + pn->input, data, 2)); + if (data[0] != SOCKS5_AUTH_CHAP_VERSION) { + pn->error = dupprintf( + "SOCKS 5 CHAP reply had version number %d (expected " + "%d)", (int)data[0], SOCKS5_AUTH_CHAP_VERSION); + crStopV; + } + + s->n_chap_attrs = data[1]; + if (s->n_chap_attrs == 0) { + /* + * If we receive a CHAP packet containing no + * attributes, then we have nothing we didn't have + * before, and can't make further progress. + */ + pn->error = dupprintf( + "SOCKS 5 CHAP reply sent no attributes"); + crStopV; + } + while (s->n_chap_attrs-- > 0) { + unsigned char data[2]; + crMaybeWaitUntilV(bufchain_try_fetch_consume( + pn->input, data, 2)); + s->chap_attr = data[0]; + s->chap_attr_len = data[1]; + crMaybeWaitUntilV(bufchain_try_fetch_consume( + pn->input, s->chap_buf, s->chap_attr_len)); + + if (s->chap_attr == SOCKS5_AUTH_CHAP_ATTR_STATUS) { + if (s->chap_attr_len == 1 && s->chap_buf[0] == 0) { + /* Status 0 means success: we are authenticated! */ + goto authenticated; + } else { + pn->error = dupstr( + "SOCKS 5 CHAP authentication failed"); + crStopV; + } + } else if (s->chap_attr==SOCKS5_AUTH_CHAP_ATTR_CHALLENGE) { + /* The CHAP challenge string. Send the response */ + strbuf *response = chap_response( + make_ptrlen(s->chap_buf, s->chap_attr_len), + ptrlen_from_strbuf(s->password)); + + put_byte(pn->output, SOCKS5_AUTH_CHAP_VERSION); + put_byte(pn->output, 1); /* number of attributes */ + put_byte(pn->output, SOCKS5_AUTH_CHAP_ATTR_RESPONSE); + put_byte(pn->output, response->len); + put_datapl(pn->output, ptrlen_from_strbuf(response)); + + strbuf_free(response); + } else { + /* ignore all other attributes */ + } + } + } + } else { + unreachable("bad auth method in SOCKS 5 negotiation"); + } + + authenticated: + + /* + * SOCKS 5 connection command: + * + * byte version + * byte command + * byte reserved (send as zero) + * byte address type + * byte[] address, with variable size (see below) + * uint16 port + */ + put_byte(pn->output, SOCKS5_REPLY_VERSION); + put_byte(pn->output, SOCKS_CMD_CONNECT); + put_byte(pn->output, 0); /* reserved byte */ + + switch (sk_addrtype(pn->ps->remote_addr)) { + case ADDRTYPE_IPV4: { + /* IPv4: address is 4 raw bytes */ + put_byte(pn->output, SOCKS5_ADDR_IPV4); + char buf[4]; + sk_addrcopy(pn->ps->remote_addr, buf); + put_data(pn->output, buf, sizeof(buf)); + break; + } + case ADDRTYPE_IPV6: { + /* IPv6: address is 16 raw bytes */ + put_byte(pn->output, SOCKS5_ADDR_IPV6); + char buf[16]; + sk_addrcopy(pn->ps->remote_addr, buf); + put_data(pn->output, buf, sizeof(buf)); + break; + } + case ADDRTYPE_NAME: { + /* Hostname: address is a pstring (Pascal-style string, + * unterminated but with a one-byte prefix length) */ + put_byte(pn->output, SOCKS5_ADDR_HOSTNAME); + char hostname[512]; + sk_getaddr(pn->ps->remote_addr, hostname, lenof(hostname)); + if (!put_pstring(pn->output, hostname)) { + pn->error = dupstr( + "SOCKS 5 cannot support host names longer than 255 chars"); + crStopV; + } + break; + } + default: + unreachable("Unexpected addrtype in SOCKS 5 proxy"); + } + + put_uint16(pn->output, pn->ps->remote_port); + crReturnV; + + /* + * SOCKS 5 connection response: + * + * byte version + * byte status + * byte reserved + * byte address type + * byte[] address bound to (same formats as in connection request) + * uint16 port + * + * We read the first four bytes and then decide what to do next. + */ + { + unsigned char data[4]; + crMaybeWaitUntilV(bufchain_try_fetch_consume(pn->input, data, 4)); + + if (data[0] != SOCKS5_REPLY_VERSION) { + pn->error = dupprintf("SOCKS proxy returned unexpected " + "reply version %d (expected %d)", + (int)data[0], SOCKS5_REPLY_VERSION); + crStopV; + } + + if (data[1] != SOCKS5_RESP_SUCCESS) { + pn->error = dupprintf("SOCKS proxy failed to connect, error %d " + "(%s)", (int)data[1], + socks5_response_text(data[1])); + crStopV; + } + + /* + * Process each address type to find out the size of the rest + * of the packet. Note we can't do this using the natural + * idiom of a switch statement, because there are crReturns + * inside some cases. + */ + if (data[3] == SOCKS5_ADDR_IPV4) { + s->response_addr_length = 4; + } else if (data[3] == SOCKS5_ADDR_IPV6) { + s->response_addr_length = 16; + } else if (data[3] == SOCKS5_ADDR_HOSTNAME) { + /* Read the hostname length byte to find out how much to read */ + unsigned char len; + crMaybeWaitUntilV(bufchain_try_fetch_consume(pn->input, &len, 1)); + s->response_addr_length = len; + break; + } else { + pn->error = dupprintf("SOCKS proxy response included unknown " + "address type %d", (int)data[3]); + crStopV; + } + + /* Read and ignore the address and port fields */ + crMaybeWaitUntilV(bufchain_try_consume( + pn->input, s->response_addr_length + 2)); + } + + /* And we're done! */ + pn->done = true; + crFinishV; +} + +const struct ProxyNegotiatorVT socks5_proxy_negotiator_vt = { + .new = proxy_socks5_new, + .free = proxy_socks5_free, + .process_queue = proxy_socks5_process_queue, + .type = "SOCKS 5", +}; diff --git a/code/proxy/sshproxy.c b/code/proxy/sshproxy.c new file mode 100644 index 0000000..a699cd7 --- /dev/null +++ b/code/proxy/sshproxy.c @@ -0,0 +1,688 @@ +/* + * sshproxy.c: implement a Socket type that talks to an entire + * subsidiary SSH connection (sometimes called a 'jump host'). + */ + +#include +#include + +#include "putty.h" +#include "ssh.h" +#include "network.h" +#include "storage.h" + +const bool ssh_proxy_supported = true; + +typedef struct SshProxy { + char *errmsg; + Conf *conf; + LogContext *logctx; + Backend *backend; + LogPolicy *clientlp; + Seat *clientseat; + Interactor *clientitr; + + bool got_proxy_password, tried_proxy_password; + char *proxy_password; + + ProxyStderrBuf psb; + Plug *plug; + + bool frozen; + bufchain ssh_to_socket; + bool rcvd_eof_ssh_to_socket, sent_eof_ssh_to_socket; + bool conn_established; + + SockAddr *addr; + int port; + + /* Traits implemented: we're a Socket from the point of view of + * the client connection, and a Seat from the POV of the SSH + * backend we instantiate. */ + Socket sock; + LogPolicy logpolicy; + Seat seat; +} SshProxy; + +static Plug *sshproxy_plug(Socket *s, Plug *p) +{ + SshProxy *sp = container_of(s, SshProxy, sock); + Plug *oldplug = sp->plug; + if (p) + sp->plug = p; + return oldplug; +} + +static void sshproxy_close(Socket *s) +{ + SshProxy *sp = container_of(s, SshProxy, sock); + + sk_addr_free(sp->addr); + sfree(sp->errmsg); + conf_free(sp->conf); + if (sp->backend) + backend_free(sp->backend); + if (sp->logctx) + log_free(sp->logctx); + if (sp->proxy_password) + burnstr(sp->proxy_password); + bufchain_clear(&sp->ssh_to_socket); + + delete_callbacks_for_context(sp); + sfree(sp); +} + +static size_t sshproxy_write(Socket *s, const void *data, size_t len) +{ + SshProxy *sp = container_of(s, SshProxy, sock); + if (!sp->backend) + return 0; + backend_send(sp->backend, data, len); + return backend_sendbuffer(sp->backend); +} + +static size_t sshproxy_write_oob(Socket *s, const void *data, size_t len) +{ + /* + * oob data is treated as inband; nasty, but nothing really + * better we can do + */ + return sshproxy_write(s, data, len); +} + +static void sshproxy_write_eof(Socket *s) +{ + SshProxy *sp = container_of(s, SshProxy, sock); + if (!sp->backend) + return; + backend_special(sp->backend, SS_EOF, 0); +} + +static void try_send_ssh_to_socket(void *ctx); + +static void try_send_ssh_to_socket_cb(void *ctx) +{ + SshProxy *sp = (SshProxy *)ctx; + try_send_ssh_to_socket(sp); + if (sp->backend) + backend_unthrottle(sp->backend, bufchain_size(&sp->ssh_to_socket)); +} + +static void sshproxy_set_frozen(Socket *s, bool is_frozen) +{ + SshProxy *sp = container_of(s, SshProxy, sock); + sp->frozen = is_frozen; + if (!sp->frozen) + queue_toplevel_callback(try_send_ssh_to_socket_cb, sp); +} + +static const char *sshproxy_socket_error(Socket *s) +{ + SshProxy *sp = container_of(s, SshProxy, sock); + return sp->errmsg; +} + +static SocketPeerInfo *sshproxy_peer_info(Socket *s) +{ + return NULL; +} + +static const SocketVtable SshProxy_sock_vt = { + .plug = sshproxy_plug, + .close = sshproxy_close, + .write = sshproxy_write, + .write_oob = sshproxy_write_oob, + .write_eof = sshproxy_write_eof, + .set_frozen = sshproxy_set_frozen, + .socket_error = sshproxy_socket_error, + .peer_info = sshproxy_peer_info, +}; + +static void sshproxy_eventlog(LogPolicy *lp, const char *event) +{ + SshProxy *sp = container_of(lp, SshProxy, logpolicy); + log_proxy_stderr(sp->plug, &sp->psb, event, strlen(event)); + log_proxy_stderr(sp->plug, &sp->psb, "\n", 1); +} + +static int sshproxy_askappend(LogPolicy *lp, Filename *filename, + void (*callback)(void *ctx, int result), + void *ctx) +{ + SshProxy *sp = container_of(lp, SshProxy, logpolicy); + + /* + * If we have access to the outer LogPolicy, pass on this request + * to the end user. + */ + if (sp->clientlp) + return lp_askappend(sp->clientlp, filename, callback, ctx); + + /* + * Otherwise, fall back to the safe noninteractive assumption. + */ + char *msg = dupprintf("Log file \"%s\" already exists; logging cancelled", + filename_to_str(filename)); + sshproxy_eventlog(lp, msg); + sfree(msg); + return 0; +} + +static void sshproxy_logging_error(LogPolicy *lp, const char *event) +{ + SshProxy *sp = container_of(lp, SshProxy, logpolicy); + + /* + * If we have access to the outer LogPolicy, pass on this request + * to it. + */ + if (sp->clientlp) { + lp_logging_error(sp->clientlp, event); + return; + } + + /* + * Otherwise, the best we can do is to put it in the outer SSH + * connection's Event Log. + */ + char *msg = dupprintf("Logging error: %s", event); + sshproxy_eventlog(lp, msg); + sfree(msg); +} + +static const LogPolicyVtable SshProxy_logpolicy_vt = { + .eventlog = sshproxy_eventlog, + .askappend = sshproxy_askappend, + .logging_error = sshproxy_logging_error, + .verbose = null_lp_verbose_no, +}; + +/* + * Function called when we encounter an error during connection setup that's + * likely to be the cause of terminating the proxy SSH connection. Putting it + * in the Event Log is useful on general principles; also putting it in + * sp->errmsg meaks that it will be passed back through plug_closing when the + * proxy SSH connection actually terminates, so that the end user will see + * what went wrong in the proxy connection. + */ +static void sshproxy_error(SshProxy *sp, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + char *msg = dupvprintf(fmt, ap); + va_end(ap); + + if (!sp->errmsg) + sp->errmsg = dupstr(msg); + + sshproxy_eventlog(&sp->logpolicy, msg); + sfree(msg); +} + +static void try_send_ssh_to_socket(void *ctx) +{ + SshProxy *sp = (SshProxy *)ctx; + + if (sp->frozen) + return; + + while (bufchain_size(&sp->ssh_to_socket)) { + ptrlen pl = bufchain_prefix(&sp->ssh_to_socket); + plug_receive(sp->plug, 0, pl.ptr, pl.len); + bufchain_consume(&sp->ssh_to_socket, pl.len); + } + + if (sp->rcvd_eof_ssh_to_socket && + !sp->sent_eof_ssh_to_socket) { + sp->sent_eof_ssh_to_socket = true; + plug_closing_normal(sp->plug); + } +} + +static void sshproxy_notify_session_started(Seat *seat) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + + if (sp->clientseat) + interactor_return_seat(sp->clientitr); + sp->conn_established = true; + + plug_log(sp->plug, PLUGLOG_CONNECT_SUCCESS, sp->addr, sp->port, NULL, 0); +} + +static size_t sshproxy_output(Seat *seat, SeatOutputType type, + const void *data, size_t len) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + bufchain_add(&sp->ssh_to_socket, data, len); + try_send_ssh_to_socket(sp); + return bufchain_size(&sp->ssh_to_socket); +} + +static inline InteractionReadySeat wrap(Seat *seat) +{ + /* + * When we receive interaction requests from the proxy and want to + * pass them on to our client Seat, we have to present them to the + * latter in the form of an InteractionReadySeat. This forwarding + * scenario is the one case where we _mustn't_ get an + * InteractionReadySeat by calling interactor_announce(), because + * the point is that we're _not_ the originating Interactor, we're + * just forwarding the request from the real one, which has + * already announced itself. + * + * So, just here in the code, it really is the right thing to make + * an InteractionReadySeat out of a plain Seat * without an + * announcement. + */ + InteractionReadySeat iseat; + iseat.seat = seat; + return iseat; +} + +static size_t sshproxy_banner(Seat *seat, const void *data, size_t len) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + if (sp->clientseat) { + /* + * If we have access to the outer Seat, pass the SSH login + * banner on to it. + */ + return seat_banner(wrap(sp->clientseat), data, len); + } else { + return 0; + } +} + +static bool sshproxy_eof(Seat *seat) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + sp->rcvd_eof_ssh_to_socket = true; + try_send_ssh_to_socket(sp); + return false; +} + +static void sshproxy_sent(Seat *seat, size_t new_bufsize) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + plug_sent(sp->plug, new_bufsize); +} + +static void sshproxy_send_close(SshProxy *sp) +{ + if (sp->clientseat) + interactor_return_seat(sp->clientitr); + + if (!sp->conn_established) + plug_log(sp->plug, PLUGLOG_CONNECT_FAILED, sp->addr, sp->port, + sp->errmsg, 0); + + if (sp->errmsg) + plug_closing_error(sp->plug, sp->errmsg); + else if (!sp->conn_established && backend_exitcode(sp->backend) == 0) + plug_closing_user_abort(sp->plug); + else + plug_closing_normal(sp->plug); +} + +static void sshproxy_notify_remote_disconnect_callback(void *vctx) +{ + SshProxy *sp = (SshProxy *)vctx; + + /* notify_remote_disconnect can be called redundantly, so first + * check if the backend really has become disconnected */ + if (backend_connected(sp->backend)) + return; + + sshproxy_send_close(sp); +} + +static void sshproxy_notify_remote_disconnect(Seat *seat) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + queue_toplevel_callback(sshproxy_notify_remote_disconnect_callback, sp); +} + +static SeatPromptResult sshproxy_get_userpass_input(Seat *seat, prompts_t *p) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + + /* + * If we have a stored proxy_password, use that, via logic similar + * to cmdline_get_passwd_input: we only try it if we're given a + * prompts_t containing exactly one prompt, and that prompt is set + * to non-echoing. + */ + if (sp->got_proxy_password && !sp->tried_proxy_password && + p->n_prompts == 1 && !p->prompts[0]->echo) { + prompt_set_result(p->prompts[0], sp->proxy_password); + burnstr(sp->proxy_password); + sp->proxy_password = NULL; + sp->tried_proxy_password = true; + return SPR_OK; + } + + if (sp->clientseat) { + /* + * If we have access to the outer Seat, pass this prompt + * request on to it. + */ + return seat_get_userpass_input(wrap(sp->clientseat), p); + } + + /* + * Otherwise, behave as if noninteractive (like plink -batch): + * reject all attempts to present a prompt to the user, and log in + * the Event Log to say why not. + */ + sshproxy_error(sp, "Unable to provide interactive authentication " + "requested by proxy SSH connection"); + return SPR_SW_ABORT("Noninteractive SSH proxy cannot perform " + "interactive authentication"); +} + +static void sshproxy_connection_fatal_callback(void *vctx) +{ + SshProxy *sp = (SshProxy *)vctx; + sshproxy_send_close(sp); +} + +static void sshproxy_connection_fatal(Seat *seat, const char *message) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + if (!sp->errmsg) { + sp->errmsg = dupprintf( + "fatal error in proxy SSH connection: %s", message); + queue_toplevel_callback(sshproxy_connection_fatal_callback, sp); + } +} + +static SeatPromptResult sshproxy_confirm_ssh_host_key( + Seat *seat, const char *host, int port, const char *keytype, + char *keystr, const char *keydisp, char **key_fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + + if (sp->clientseat) { + /* + * If we have access to the outer Seat, pass this prompt + * request on to it. + */ + return seat_confirm_ssh_host_key( + wrap(sp->clientseat), host, port, keytype, keystr, keydisp, + key_fingerprints, mismatch, callback, ctx); + } + + /* + * Otherwise, behave as if we're in batch mode, i.e. take the safe + * option in the absence of interactive confirmation, i.e. abort + * the connection. + */ + return SPR_SW_ABORT("Noninteractive SSH proxy cannot confirm host key"); +} + +static SeatPromptResult sshproxy_confirm_weak_crypto_primitive( + Seat *seat, const char *algtype, const char *algname, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + + if (sp->clientseat) { + /* + * If we have access to the outer Seat, pass this prompt + * request on to it. + */ + return seat_confirm_weak_crypto_primitive( + wrap(sp->clientseat), algtype, algname, callback, ctx); + } + + /* + * Otherwise, behave as if we're in batch mode: take the safest + * option. + */ + sshproxy_error(sp, "First %s supported by server is %s, below warning " + "threshold. Abandoning proxy SSH connection.", + algtype, algname); + return SPR_SW_ABORT("Noninteractive SSH proxy cannot confirm " + "weak crypto primitive"); +} + +static SeatPromptResult sshproxy_confirm_weak_cached_hostkey( + Seat *seat, const char *algname, const char *betteralgs, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + + if (sp->clientseat) { + /* + * If we have access to the outer Seat, pass this prompt + * request on to it. + */ + return seat_confirm_weak_cached_hostkey( + wrap(sp->clientseat), algname, betteralgs, callback, ctx); + } + + /* + * Otherwise, behave as if we're in batch mode: take the safest + * option. + */ + sshproxy_error(sp, "First host key type stored for server is %s, below " + "warning threshold. Abandoning proxy SSH connection.", + algname); + return SPR_SW_ABORT("Noninteractive SSH proxy cannot confirm " + "weak cached host key"); +} + +static StripCtrlChars *sshproxy_stripctrl_new( + Seat *seat, BinarySink *bs_out, SeatInteractionContext sic) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + if (sp->clientseat) + return seat_stripctrl_new(sp->clientseat, bs_out, sic); + else + return NULL; +} + +static void sshproxy_set_trust_status(Seat *seat, bool trusted) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + if (sp->clientseat) + seat_set_trust_status(sp->clientseat, trusted); +} + +static bool sshproxy_can_set_trust_status(Seat *seat) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + return sp->clientseat && seat_can_set_trust_status(sp->clientseat); +} + +static bool sshproxy_verbose(Seat *seat) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + return sp->clientseat && seat_verbose(sp->clientseat); +} + +static bool sshproxy_interactive(Seat *seat) +{ + SshProxy *sp = container_of(seat, SshProxy, seat); + return sp->clientseat && seat_interactive(sp->clientseat); +} + +static const SeatVtable SshProxy_seat_vt = { + .output = sshproxy_output, + .eof = sshproxy_eof, + .sent = sshproxy_sent, + .banner = sshproxy_banner, + .get_userpass_input = sshproxy_get_userpass_input, + .notify_session_started = sshproxy_notify_session_started, + .notify_remote_exit = nullseat_notify_remote_exit, + .notify_remote_disconnect = sshproxy_notify_remote_disconnect, + .connection_fatal = sshproxy_connection_fatal, + .update_specials_menu = nullseat_update_specials_menu, + .get_ttymode = nullseat_get_ttymode, + .set_busy_status = nullseat_set_busy_status, + .confirm_ssh_host_key = sshproxy_confirm_ssh_host_key, + .confirm_weak_crypto_primitive = sshproxy_confirm_weak_crypto_primitive, + .confirm_weak_cached_hostkey = sshproxy_confirm_weak_cached_hostkey, + .is_utf8 = nullseat_is_never_utf8, + .echoedit_update = nullseat_echoedit_update, + .get_x_display = nullseat_get_x_display, + .get_windowid = nullseat_get_windowid, + .get_window_pixel_size = nullseat_get_window_pixel_size, + .stripctrl_new = sshproxy_stripctrl_new, + .set_trust_status = sshproxy_set_trust_status, + .can_set_trust_status = sshproxy_can_set_trust_status, + .has_mixed_input_stream = nullseat_has_mixed_input_stream_no, + .verbose = sshproxy_verbose, + .interactive = sshproxy_interactive, + .get_cursor_position = nullseat_get_cursor_position, +}; + +Socket *sshproxy_new_connection(SockAddr *addr, const char *hostname, + int port, bool privport, + bool oobinline, bool nodelay, bool keepalive, + Plug *plug, Conf *clientconf, + Interactor *clientitr) +{ + SshProxy *sp = snew(SshProxy); + memset(sp, 0, sizeof(*sp)); + + sp->sock.vt = &SshProxy_sock_vt; + sp->logpolicy.vt = &SshProxy_logpolicy_vt; + sp->seat.vt = &SshProxy_seat_vt; + sp->plug = plug; + psb_init(&sp->psb); + bufchain_init(&sp->ssh_to_socket); + + sp->addr = addr; + sp->port = port; + + sp->conf = conf_new(); + /* Try to treat proxy_hostname as the title of a saved session. If + * that fails, set up a default Conf of our own treating it as a + * hostname. */ + const char *proxy_hostname = conf_get_str(clientconf, CONF_proxy_host); + if (do_defaults(proxy_hostname, sp->conf)) { + if (!conf_launchable(sp->conf)) { + sp->errmsg = dupprintf("saved session '%s' is not launchable", + proxy_hostname); + return &sp->sock; + } + } else { + do_defaults(NULL, sp->conf); + /* In hostname mode, we default to PROT_SSH. This is more useful than + * the obvious approach of defaulting to the protocol defined in + * Default Settings, because only SSH (ok, and bare ssh-connection) + * can be used for this kind of proxy. */ + conf_set_int(sp->conf, CONF_protocol, PROT_SSH); + conf_set_str(sp->conf, CONF_host, proxy_hostname); + conf_set_int(sp->conf, CONF_port, + conf_get_int(clientconf, CONF_proxy_port)); + } + const char *proxy_username = conf_get_str(clientconf, CONF_proxy_username); + if (*proxy_username) + conf_set_str(sp->conf, CONF_username, proxy_username); + + const char *proxy_password = conf_get_str(clientconf, CONF_proxy_password); + if (*proxy_password) { + sp->proxy_password = dupstr(proxy_password); + sp->got_proxy_password = true; + } + + const struct BackendVtable *backvt = backend_vt_from_proto( + conf_get_int(sp->conf, CONF_protocol)); + + /* + * We don't actually need an _SSH_ session specifically: it's also + * OK to use PROT_SSHCONN, because really, the criterion is + * whether setting CONF_ssh_nc_host will do anything useful. So + * our check is for whether the backend sets the flag promising + * that it does. + */ + if (!backvt || !(backvt->flags & BACKEND_SUPPORTS_NC_HOST)) { + sp->errmsg = dupprintf("saved session '%s' is not an SSH session", + proxy_hostname); + return &sp->sock; + } + + /* + * We also expect that the backend will announce a willingness to + * notify us that the session has started. Any backend providing + * NC_HOST should also provide this. + */ + assert(backvt->flags & BACKEND_NOTIFIES_SESSION_START && + "Backend provides NC_HOST without SESSION_START!"); + + /* + * Turn off SSH features we definitely don't want. It would be + * awkward and counterintuitive to have the proxy SSH connection + * become a connection-sharing upstream (but it's fine to have it + * be a downstream, if that's configured). And we don't want to + * open X forwardings, agent forwardings or (other) port + * forwardings as a side effect of this one operation. + */ + conf_set_bool(sp->conf, CONF_ssh_connection_sharing_upstream, false); + conf_set_bool(sp->conf, CONF_x11_forward, false); + conf_set_bool(sp->conf, CONF_agentfwd, false); + for (const char *subkey; + (subkey = conf_get_str_nthstrkey(sp->conf, CONF_portfwd, 0)) != NULL;) + conf_del_str_str(sp->conf, CONF_portfwd, subkey); + + /* + * We'll only be running one channel through this connection + * (since we've just turned off all the other things we might have + * done with it), so we can configure it as simple. + */ + conf_set_bool(sp->conf, CONF_ssh_simple, true); + + /* + * Configure the main channel of this SSH session to be a + * direct-tcpip connection to the destination host/port. + */ + conf_set_str(sp->conf, CONF_ssh_nc_host, hostname); + conf_set_int(sp->conf, CONF_ssh_nc_port, port); + + /* + * Do the usual normalisation of things in the Conf like a "user@" + * prefix on the hostname field. + */ + prepare_session(sp->conf); + + sp->logctx = log_init(&sp->logpolicy, sp->conf); + + char *error, *realhost; + error = backend_init(backvt, &sp->seat, &sp->backend, sp->logctx, sp->conf, + conf_get_str(sp->conf, CONF_host), + conf_get_int(sp->conf, CONF_port), + &realhost, nodelay, + conf_get_bool(sp->conf, CONF_tcp_keepalives)); + if (error) { + sp->errmsg = dupprintf("unable to open SSH proxy connection: %s", + error); + return &sp->sock; + } + + sfree(realhost); + + /* + * If we've been given an Interactor by the caller, set ourselves + * up to work with it. + */ + if (clientitr) { + sp->clientitr = clientitr; + interactor_set_child(sp->clientitr, sp->backend->interactor); + + sp->clientlp = interactor_logpolicy(clientitr); + + /* + * We can only borrow the client's Seat if our own backend + * will tell us when to give it back. (SSH-based backends + * _should_ do that, but we check the flag here anyway.) + */ + if (backvt->flags & BACKEND_NOTIFIES_SESSION_START) + sp->clientseat = interactor_borrow_seat(clientitr); + } + + return &sp->sock; +} diff --git a/code/proxy/telnet.c b/code/proxy/telnet.c new file mode 100644 index 0000000..242c402 --- /dev/null +++ b/code/proxy/telnet.c @@ -0,0 +1,368 @@ +/* + * "Telnet" proxy negotiation. + * + * (This is for ad-hoc proxies where you connect to the proxy's + * telnet port and send a command such as `connect host port'. The + * command is configurable, since this proxy type is typically not + * standardised or at all well-defined.) + */ + +#include "putty.h" +#include "network.h" +#include "proxy.h" +#include "sshcr.h" + +char *format_telnet_command(SockAddr *addr, int port, Conf *conf, + unsigned *flags_out) +{ + char *fmt = conf_get_str(conf, CONF_proxy_telnet_command); + int so = 0, eo = 0; + strbuf *buf = strbuf_new(); + unsigned flags = 0; + + /* we need to escape \\, \%, \r, \n, \t, \x??, \0???, + * %%, %host, %port, %user, and %pass + */ + + while (fmt[eo] != 0) { + + /* scan forward until we hit end-of-line, + * or an escape character (\ or %) */ + while (fmt[eo] != 0 && fmt[eo] != '%' && fmt[eo] != '\\') + eo++; + + /* if we hit eol, break out of our escaping loop */ + if (fmt[eo] == 0) break; + + /* if there was any unescaped text before the escape + * character, send that now */ + if (eo != so) + put_data(buf, fmt + so, eo - so); + + so = eo++; + + /* if the escape character was the last character of + * the line, we'll just stop and send it. */ + if (fmt[eo] == 0) break; + + if (fmt[so] == '\\') { + + /* we recognize \\, \%, \r, \n, \t, \x??. + * anything else, we just send unescaped (including the \). + */ + + switch (fmt[eo]) { + + case '\\': + put_byte(buf, '\\'); + eo++; + break; + + case '%': + put_byte(buf, '%'); + eo++; + break; + + case 'r': + put_byte(buf, '\r'); + eo++; + break; + + case 'n': + put_byte(buf, '\n'); + eo++; + break; + + case 't': + put_byte(buf, '\t'); + eo++; + break; + + case 'x': + case 'X': { + /* escaped hexadecimal value (ie. \xff) */ + unsigned char v = 0; + int i = 0; + + for (;;) { + eo++; + if (fmt[eo] >= '0' && fmt[eo] <= '9') + v += fmt[eo] - '0'; + else if (fmt[eo] >= 'a' && fmt[eo] <= 'f') + v += fmt[eo] - 'a' + 10; + else if (fmt[eo] >= 'A' && fmt[eo] <= 'F') + v += fmt[eo] - 'A' + 10; + else { + /* non hex character, so we abort and just + * send the whole thing unescaped (including \x) + */ + put_byte(buf, '\\'); + eo = so + 1; + break; + } + + /* we only extract two hex characters */ + if (i == 1) { + put_byte(buf, v); + eo++; + break; + } + + i++; + v <<= 4; + } + break; + } + + default: + put_data(buf, fmt + so, 2); + eo++; + break; + } + } else { + + /* % escape. we recognize %%, %host, %port, %user, %pass. + * %proxyhost, %proxyport. Anything else we just send + * unescaped (including the %). + */ + + if (fmt[eo] == '%') { + put_byte(buf, '%'); + eo++; + } + else if (strnicmp(fmt + eo, "host", 4) == 0) { + char dest[512]; + sk_getaddr(addr, dest, lenof(dest)); + put_data(buf, dest, strlen(dest)); + eo += 4; + } + else if (strnicmp(fmt + eo, "port", 4) == 0) { + put_fmt(buf, "%d", port); + eo += 4; + } + else if (strnicmp(fmt + eo, "user", 4) == 0) { + const char *username = conf_get_str(conf, CONF_proxy_username); + put_data(buf, username, strlen(username)); + eo += 4; + if (!*username) + flags |= TELNET_CMD_MISSING_USERNAME; + } + else if (strnicmp(fmt + eo, "pass", 4) == 0) { + const char *password = conf_get_str(conf, CONF_proxy_password); + put_data(buf, password, strlen(password)); + eo += 4; + if (!*password) + flags |= TELNET_CMD_MISSING_PASSWORD; + } + else if (strnicmp(fmt + eo, "proxyhost", 9) == 0) { + const char *host = conf_get_str(conf, CONF_proxy_host); + put_data(buf, host, strlen(host)); + eo += 9; + } + else if (strnicmp(fmt + eo, "proxyport", 9) == 0) { + int port = conf_get_int(conf, CONF_proxy_port); + put_fmt(buf, "%d", port); + eo += 9; + } + else { + /* we don't escape this, so send the % now, and + * don't advance eo, so that we'll consider the + * text immediately following the % as unescaped. + */ + put_byte(buf, '%'); + } + } + + /* resume scanning for additional escapes after this one. */ + so = eo; + } + + /* if there is any unescaped text at the end of the line, send it */ + if (eo != so) { + put_data(buf, fmt + so, eo - so); + } + + if (flags_out) + *flags_out = flags; + return strbuf_to_str(buf); +} + +typedef struct TelnetProxyNegotiator { + int crLine; + Conf *conf; + char *formatted_cmd; + prompts_t *prompts; + int username_prompt_index, password_prompt_index; + ProxyNegotiator pn; +} TelnetProxyNegotiator; + +static ProxyNegotiator *proxy_telnet_new(const ProxyNegotiatorVT *vt) +{ + TelnetProxyNegotiator *s = snew(TelnetProxyNegotiator); + memset(s, 0, sizeof(*s)); + s->pn.vt = vt; + return &s->pn; +} + +static void proxy_telnet_free(ProxyNegotiator *pn) +{ + TelnetProxyNegotiator *s = container_of(pn, TelnetProxyNegotiator, pn); + if (s->conf) + conf_free(s->conf); + if (s->prompts) + free_prompts(s->prompts); + burnstr(s->formatted_cmd); + delete_callbacks_for_context(s); + sfree(s); +} + +static void proxy_telnet_process_queue_callback(void *vctx) +{ + TelnetProxyNegotiator *s = (TelnetProxyNegotiator *)vctx; + proxy_negotiator_process_queue(&s->pn); +} + +static void proxy_telnet_process_queue(ProxyNegotiator *pn) +{ + TelnetProxyNegotiator *s = container_of(pn, TelnetProxyNegotiator, pn); + + crBegin(s->crLine); + + s->conf = conf_copy(pn->ps->conf); + + /* + * Make an initial attempt to figure out the command we want, and + * see if it tried to include a username or password that we don't + * have. + */ + { + unsigned flags; + s->formatted_cmd = format_telnet_command( + pn->ps->remote_addr, pn->ps->remote_port, s->conf, &flags); + + if (pn->itr && (flags & (TELNET_CMD_MISSING_USERNAME | + TELNET_CMD_MISSING_PASSWORD))) { + burnstr(s->formatted_cmd); + s->formatted_cmd = NULL; + + /* + * We're missing at least one of the two parts, and we + * have an Interactor we can use to prompt for them, so + * try it. + */ + s->prompts = proxy_new_prompts(pn->ps); + s->prompts->to_server = true; + s->prompts->from_server = false; + s->prompts->name = dupstr("Telnet proxy authentication"); + if (flags & TELNET_CMD_MISSING_USERNAME) { + s->username_prompt_index = s->prompts->n_prompts; + add_prompt(s->prompts, dupstr("Proxy username: "), true); + } else { + s->username_prompt_index = -1; + } + if (flags & TELNET_CMD_MISSING_PASSWORD) { + s->password_prompt_index = s->prompts->n_prompts; + add_prompt(s->prompts, dupstr("Proxy password: "), false); + } else { + s->password_prompt_index = -1; + } + + /* + * This prompt is presented extremely early in PuTTY's + * setup. (Very promptly, you might say.) + * + * In particular, we can get here through a chain of + * synchronous calls from backend_init, which means (in + * GUI PuTTY) that the terminal we'll be sending this + * prompt to may not have its Ldisc set up yet (due to + * cyclic dependencies among all the things that have to + * be initialised). + * + * So we'll start by having ourself called back via a + * toplevel callback, to make sure we don't call + * seat_get_userpass_input until we've returned from + * backend_init and the frontend has finished getting + * everything ready. + */ + queue_toplevel_callback(proxy_telnet_process_queue_callback, s); + crReturnV; + + while (true) { + SeatPromptResult spr = seat_get_userpass_input( + interactor_announce(pn->itr), s->prompts); + if (spr.kind == SPRK_OK) { + break; + } else if (spr_is_abort(spr)) { + proxy_spr_abort(pn, spr); + crStopV; + } + crReturnV; + } + + if (s->username_prompt_index != -1) { + conf_set_str( + s->conf, CONF_proxy_username, + prompt_get_result_ref( + s->prompts->prompts[s->username_prompt_index])); + } + + if (s->password_prompt_index != -1) { + conf_set_str( + s->conf, CONF_proxy_password, + prompt_get_result_ref( + s->prompts->prompts[s->password_prompt_index])); + } + + free_prompts(s->prompts); + s->prompts = NULL; + } + + /* + * Now format the command a second time, with the results of + * those prompts written into s->conf. + */ + s->formatted_cmd = format_telnet_command( + pn->ps->remote_addr, pn->ps->remote_port, s->conf, NULL); + } + + /* + * Log the command, with some changes. Firstly, we regenerate it + * with the password masked; secondly, we escape control + * characters so that the log message is printable. + */ + conf_set_str(s->conf, CONF_proxy_password, "*password*"); + { + char *censored_cmd = format_telnet_command( + pn->ps->remote_addr, pn->ps->remote_port, s->conf, NULL); + + strbuf *logmsg = strbuf_new(); + put_datapl(logmsg, PTRLEN_LITERAL("Sending Telnet proxy command: ")); + put_c_string_literal(logmsg, ptrlen_from_asciz(censored_cmd)); + + plug_log(pn->ps->plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg->s, 0); + strbuf_free(logmsg); + sfree(censored_cmd); + } + + /* + * Actually send the command. + */ + put_dataz(pn->output, s->formatted_cmd); + + /* + * Unconditionally report success. We don't hang around waiting + * for error messages from the proxy, because this proxy type is + * so ad-hoc that we wouldn't know how to even recognise an error + * message if we saw one, let alone what to do about it. + */ + pn->done = true; + + crFinishV; +} + +const struct ProxyNegotiatorVT telnet_proxy_negotiator_vt = { + .new = proxy_telnet_new, + .free = proxy_telnet_free, + .process_queue = proxy_telnet_process_queue, + .type = "Telnet", +}; diff --git a/code/pscp.c b/code/pscp.c index a11d1e1..da9e9aa 100644 --- a/code/pscp.c +++ b/code/pscp.c @@ -1,5 +1,5 @@ /* - * scp.c - Scp (Secure Copy) client for PuTTY. + * pscp.c - Scp (Secure Copy) client for PuTTY. * Joris van Rantwijk, Simon Tatham * * This is mainly based on ssh-1.2.26/scp.c by Timo Rinne & Tatu Ylonen. @@ -22,7 +22,7 @@ #include "putty.h" #include "psftp.h" #include "ssh.h" -#include "sftp.h" +#include "ssh/sftp.h" #include "storage.h" static bool list = false; @@ -49,8 +49,6 @@ static void source(const char *src); static void rsource(const char *src); static void sink(const char *targ, const char *src); -const char *const appname = "PSCP"; - /* * The maximum amount of queued data we accept before we stop and * wait for the server to process some. @@ -58,20 +56,25 @@ const char *const appname = "PSCP"; #define MAX_SCP_BUFSIZE 16384 void ldisc_echoedit_update(Ldisc *ldisc) { } +void ldisc_check_sendok(Ldisc *ldisc) { } -static size_t pscp_output(Seat *, bool is_stderr, const void *, size_t); +static size_t pscp_output(Seat *, SeatOutputType type, const void *, size_t); static bool pscp_eof(Seat *); static const SeatVtable pscp_seat_vt = { .output = pscp_output, .eof = pscp_eof, + .sent = nullseat_sent, + .banner = nullseat_banner_to_stderr, .get_userpass_input = filexfer_get_userpass_input, + .notify_session_started = nullseat_notify_session_started, .notify_remote_exit = nullseat_notify_remote_exit, + .notify_remote_disconnect = nullseat_notify_remote_disconnect, .connection_fatal = console_connection_fatal, .update_specials_menu = nullseat_update_specials_menu, .get_ttymode = nullseat_get_ttymode, .set_busy_status = nullseat_set_busy_status, - .verify_ssh_host_key = console_verify_ssh_host_key, + .confirm_ssh_host_key = console_confirm_ssh_host_key, .confirm_weak_crypto_primitive = console_confirm_weak_crypto_primitive, .confirm_weak_cached_hostkey = console_confirm_weak_cached_hostkey, .is_utf8 = nullseat_is_never_utf8, @@ -80,7 +83,9 @@ static const SeatVtable pscp_seat_vt = { .get_windowid = nullseat_get_windowid, .get_window_pixel_size = nullseat_get_window_pixel_size, .stripctrl_new = console_stripctrl_new, - .set_trust_status = nullseat_set_trust_status_vacuously, + .set_trust_status = nullseat_set_trust_status, + .can_set_trust_status = nullseat_can_set_trust_status_yes, + .has_mixed_input_stream = nullseat_has_mixed_input_stream_no, .verbose = cmdline_seat_verbose, .interactive = nullseat_interactive_no, .get_cursor_position = nullseat_get_cursor_position, @@ -141,13 +146,14 @@ static PRINTF_LIKE(2, 3) void tell_user(FILE *stream, const char *fmt, ...) static bufchain received_data; static BinarySink *stderr_bs; static size_t pscp_output( - Seat *seat, bool is_stderr, const void *data, size_t len) + Seat *seat, SeatOutputType type, const void *data, size_t len) { /* - * stderr data is just spouted to local stderr (optionally via a - * sanitiser) and otherwise ignored. + * Non-stdout data (both stderr and SSH auth banners) is just + * spouted to local stderr (optionally via a sanitiser) and + * otherwise ignored. */ - if (is_stderr) { + if (type != SEAT_OUTPUT_STDOUT) { put_data(stderr_bs, data, len); return 0; } @@ -848,7 +854,8 @@ int scp_send_filedata(char *data, int len) scp_sftp_fileoffset += len; return 0; } else { - int bufsize = backend_send(backend, data, len); + backend_send(backend, data, len); + int bufsize = backend_sendbuffer(backend); /* * If the network transfer is backing up - that is, the @@ -1806,7 +1813,7 @@ static void sink(const char *targ, const char *src) striptarget = stripslashes(act.name, true); if (striptarget != act.name) { with_stripctrl(sanname, act.name) { - with_stripctrl(santarg, act.name) { + with_stripctrl(santarg, striptarget) { tell_user(stderr, "warning: remote host sent a" " compound pathname '%s'", sanname); tell_user(stderr, " renaming local" @@ -2194,7 +2201,7 @@ static void usage(void) printf(" -load sessname Load settings from saved session\n"); printf(" -P port connect to specified port\n"); printf(" -l user connect with specified username\n"); - printf(" -pw passw login with specified password\n"); + printf(" -pwfile file login with password read from specified file\n"); printf(" -1 -2 force use of particular SSH protocol version\n"); printf(" -ssh -ssh-connection\n"); printf(" force use of particular SSH protocol variant\n"); diff --git a/code/psftp.c b/code/psftp.c index c4b5374..bddc18a 100644 --- a/code/psftp.c +++ b/code/psftp.c @@ -12,9 +12,7 @@ #include "psftp.h" #include "storage.h" #include "ssh.h" -#include "sftp.h" - -const char *const appname = "PSFTP"; +#include "ssh/sftp.h" /* * Since SFTP is a request-response oriented protocol, it requires @@ -41,19 +39,23 @@ static bool sent_eof = false; * Seat vtable. */ -static size_t psftp_output(Seat *, bool is_stderr, const void *, size_t); +static size_t psftp_output(Seat *, SeatOutputType type, const void *, size_t); static bool psftp_eof(Seat *); static const SeatVtable psftp_seat_vt = { .output = psftp_output, .eof = psftp_eof, + .sent = nullseat_sent, + .banner = nullseat_banner_to_stderr, .get_userpass_input = filexfer_get_userpass_input, + .notify_session_started = nullseat_notify_session_started, .notify_remote_exit = nullseat_notify_remote_exit, + .notify_remote_disconnect = nullseat_notify_remote_disconnect, .connection_fatal = console_connection_fatal, .update_specials_menu = nullseat_update_specials_menu, .get_ttymode = nullseat_get_ttymode, .set_busy_status = nullseat_set_busy_status, - .verify_ssh_host_key = console_verify_ssh_host_key, + .confirm_ssh_host_key = console_confirm_ssh_host_key, .confirm_weak_crypto_primitive = console_confirm_weak_crypto_primitive, .confirm_weak_cached_hostkey = console_confirm_weak_cached_hostkey, .is_utf8 = nullseat_is_never_utf8, @@ -62,7 +64,9 @@ static const SeatVtable psftp_seat_vt = { .get_windowid = nullseat_get_windowid, .get_window_pixel_size = nullseat_get_window_pixel_size, .stripctrl_new = console_stripctrl_new, - .set_trust_status = nullseat_set_trust_status_vacuously, + .set_trust_status = nullseat_set_trust_status, + .can_set_trust_status = nullseat_can_set_trust_status_yes, + .has_mixed_input_stream = nullseat_has_mixed_input_stream_no, .verbose = cmdline_seat_verbose, .interactive = nullseat_interactive_yes, .get_cursor_position = nullseat_get_cursor_position, @@ -2444,6 +2448,7 @@ int do_sftp(int mode, int modeflags, char *batchfile) static bool verbose = false; void ldisc_echoedit_update(Ldisc *ldisc) { } +void ldisc_check_sendok(Ldisc *ldisc) { } /* * Receive a block of data from the SSH link. Block until all data @@ -2456,13 +2461,14 @@ void ldisc_echoedit_update(Ldisc *ldisc) { } static bufchain received_data; static BinarySink *stderr_bs; static size_t psftp_output( - Seat *seat, bool is_stderr, const void *data, size_t len) + Seat *seat, SeatOutputType type, const void *data, size_t len) { /* - * stderr data is just spouted to local stderr (optionally via a - * sanitiser) and otherwise ignored. + * Non-stdout data (both stderr and SSH auth banners) is just + * spouted to local stderr (optionally via a sanitiser) and + * otherwise ignored. */ - if (is_stderr) { + if (type != SEAT_OUTPUT_STDOUT) { put_data(stderr_bs, data, len); return 0; } @@ -2529,7 +2535,7 @@ static void usage(void) printf(" -load sessname Load settings from saved session\n"); printf(" -l user connect with specified username\n"); printf(" -P port connect to specified port\n"); - printf(" -pw passw login with specified password\n"); + printf(" -pwfile file login with password read from specified file\n"); printf(" -1 -2 force use of particular SSH protocol version\n"); printf(" -ssh -ssh-connection\n"); printf(" force use of particular SSH protocol variant\n"); diff --git a/code/psftpcommon.c b/code/psftpcommon.c index 21f3737..e6c8e2d 100644 --- a/code/psftpcommon.c +++ b/code/psftpcommon.c @@ -8,7 +8,7 @@ #include #include "putty.h" -#include "sftp.h" +#include "ssh/sftp.h" #include "psftp.h" #define MAX_NAMES_MEMORY ((size_t)8 << 20) diff --git a/code/psocks.c b/code/psocks.c index f29eeaa..64c4695 100644 --- a/code/psocks.c +++ b/code/psocks.c @@ -9,7 +9,7 @@ #include "putty.h" #include "misc.h" #include "ssh.h" -#include "sshchan.h" +#include "ssh/channel.h" #include "psocks.h" /* @@ -94,8 +94,7 @@ static const SshChannelVtable psocks_scvt = { static void psocks_plug_log(Plug *p, PlugLogType type, SockAddr *addr, int port, const char *error_msg, int error_code); -static void psocks_plug_closing(Plug *p, const char *error_msg, - int error_code, bool calling_back); +static void psocks_plug_closing(Plug *p, PlugCloseType, const char *error_msg); static void psocks_plug_receive(Plug *p, int urgent, const char *data, size_t len); static void psocks_plug_sent(Plug *p, size_t bufsize); @@ -354,8 +353,8 @@ static void psocks_plug_log(Plug *plug, PlugLogType type, SockAddr *addr, }; } -static void psocks_plug_closing(Plug *plug, const char *error_msg, - int error_code, bool calling_back) +static void psocks_plug_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { psocks_connection *conn = container_of(plug, psocks_connection, plug); if (conn->connecting) { @@ -523,8 +522,8 @@ void psocks_start(psocks_state *ps) * Some stubs that are needed to link against PuTTY modules. */ -int verify_host_key(const char *hostname, int port, - const char *keytype, const char *key) +int check_stored_host_key(const char *hostname, int port, + const char *keytype, const char *key) { unreachable("host keys not handled in this tool"); } diff --git a/code/putty.h b/code/putty.h index 867671a..8c3b0d8 100644 --- a/code/putty.h +++ b/code/putty.h @@ -5,7 +5,7 @@ #include /* for INT_MAX */ #include "defs.h" -#include "puttyps.h" +#include "platform.h" #include "network.h" #include "misc.h" #include "marshal.h" @@ -21,14 +21,14 @@ * Fingerprints of the current and previous PGP master keys, to * establish a trust path between an executable and other files. */ -#define PGP_MASTER_KEY_YEAR "2018" -#define PGP_MASTER_KEY_DETAILS "RSA, 4096-bit" -#define PGP_MASTER_KEY_FP \ - "24E1 B1C5 75EA 3C9F F752 A922 76BC 7FE4 EBFD 2D9E" -#define PGP_PREV_MASTER_KEY_YEAR "2015" +#define PGP_MASTER_KEY_YEAR "2021" +#define PGP_MASTER_KEY_DETAILS "RSA, 3072-bit" +#define PGP_MASTER_KEY_FP \ + "A872 D42F 1660 890F 0E05 223E DD43 55EA AC11 19DE" +#define PGP_PREV_MASTER_KEY_YEAR "2018" #define PGP_PREV_MASTER_KEY_DETAILS "RSA, 4096-bit" #define PGP_PREV_MASTER_KEY_FP \ - "440D E3B5 B7A1 CA85 B3CC 1718 AB58 5DC6 0467 6F7C" + "24E1 B1C5 75EA 3C9F F752 A922 76BC 7FE4 EBFD 2D9E" /* * Definitions of three separate indexing schemes for colour palette @@ -326,13 +326,13 @@ typedef enum { /* * Send a POSIX-style signal. (Useful in SSH and also pterm.) * - * We use the master list in sshsignals.h to define these enum + * We use the master list in ssh/signal-list.h to define these enum * values, which will come out looking like names of the form * SS_SIGABRT, SS_SIGINT etc. */ #define SIGNAL_MAIN(name, text) SS_SIG ## name, #define SIGNAL_SUB(name) SS_SIG ## name, - #include "sshsignals.h" + #include "ssh/signal-list.h" #undef SIGNAL_MAIN #undef SIGNAL_SUB @@ -356,7 +356,7 @@ struct SessionSpecial { int arg; }; -/* Needed by both sshchan.h and sshppl.h */ +/* Needed by both ssh/channel.h and ssh/ppl.h */ typedef void (*add_special_fn_t)( void *ctx, const char *text, SessionSpecialCode code, int arg); @@ -474,7 +474,8 @@ enum { * Proxy types. */ PROXY_NONE, PROXY_SOCKS4, PROXY_SOCKS5, - PROXY_HTTP, PROXY_TELNET, PROXY_CMD, PROXY_FUZZ + PROXY_HTTP, PROXY_TELNET, PROXY_CMD, PROXY_SSH, + PROXY_FUZZ }; enum { @@ -529,7 +530,14 @@ enum { FUNKY_XTERM, FUNKY_VT400, FUNKY_VT100P, - FUNKY_SCO + FUNKY_SCO, + FUNKY_XTERM_216 +}; + +enum { + /* Shifted arrow key types (CONF_sharrow_type) */ + SHARROW_APPLICATION, /* Ctrl flips between ESC O A and ESC [ A */ + SHARROW_BITMAP /* ESC [ 1 ; n A, where n = 1 + bitmap of CAS */ }; enum { @@ -617,9 +625,123 @@ enum { #define BACKEND_RESIZE_FORBIDDEN 0x01 /* Backend does not allow resizing terminal */ #define BACKEND_NEEDS_TERMINAL 0x02 /* Backend must have terminal */ +#define BACKEND_SUPPORTS_NC_HOST 0x04 /* Backend can honour + CONF_ssh_nc_host */ +#define BACKEND_NOTIFIES_SESSION_START 0x08 /* Backend will call + seat_notify_session_started */ + +/* In (no)sshproxy.c */ +extern const bool ssh_proxy_supported; + +/* + * This structure type wraps a Seat pointer, in a way that has no + * purpose except to be a different type. + * + * The Seat wrapper functions that present interactive prompts all + * expect one of these in place of their ordinary Seat pointer. You + * get one by calling interactor_announce (defined below), which will + * print a message (if not already done) identifying the Interactor + * that originated the prompt. + * + * This arranges that the C type system itself will check that no call + * to any of those Seat methods has omitted the mandatory call to + * interactor_announce beforehand. + */ +struct InteractionReadySeat { + Seat *seat; +}; + +/* + * The Interactor trait is implemented by anything that is capable of + * presenting interactive prompts or questions to the user during + * network connection setup. Every Backend that ever needs to do this + * is an Interactor, but also, while a Backend is making its initial + * network connection, it may go via network proxy code which is also + * an Interactor and can ask questions of its own. + */ +struct Interactor { + const InteractorVtable *vt; + + /* The parent Interactor that we are a proxy for, if any. */ + Interactor *parent; + + /* + * If we're the top-level Interactor (parent==NULL), then this + * field records the last Interactor that actually did anything + * interactive, so that we know when to announce a changeover + * between levels of proxying. + * + * If parent != NULL, this field is not used. + */ + Interactor *last_to_talk; +}; + +struct InteractorVtable { + /* + * Returns a user-facing description of the nature of the network + * connection being made. Used in interactive proxy authentication + * to announce which connection attempt is now in control of the + * Seat. + * + * The idea is not just to be written in natural language, but to + * connect with the user's idea of _why_ they think some + * connection is being made. For example, instead of saying 'TCP + * connection to 123.45.67.89 port 22', you might say 'SSH + * connection to [logical host name for SSH host key purposes]'. + * + * The returned string must be freed by the caller. + */ + char *(*description)(Interactor *itr); + + /* + * Returns the LogPolicy associated with this Interactor. (A + * Backend can derive this from its logging context; a proxy + * Interactor inherits it from the Interactor for the parent + * network connection.) + */ + LogPolicy *(*logpolicy)(Interactor *itr); + + /* + * Gets and sets the Seat that this Interactor talks to. When a + * Seat is borrowed and replaced with a TempSeat, this will be the + * mechanism by which that replacement happens. + */ + Seat *(*get_seat)(Interactor *itr); + void (*set_seat)(Interactor *itr, Seat *seat); +}; + +static inline char *interactor_description(Interactor *itr) +{ return itr->vt->description(itr); } +static inline LogPolicy *interactor_logpolicy(Interactor *itr) +{ return itr->vt->logpolicy(itr); } +static inline Seat *interactor_get_seat(Interactor *itr) +{ return itr->vt->get_seat(itr); } +static inline void interactor_set_seat(Interactor *itr, Seat *seat) +{ itr->vt->set_seat(itr, seat); } + +static inline void interactor_set_child(Interactor *parent, Interactor *child) +{ child->parent = parent; } +Seat *interactor_borrow_seat(Interactor *itr); +void interactor_return_seat(Interactor *itr); +InteractionReadySeat interactor_announce(Interactor *itr); + +/* Interactors that are Backends will find this helper function useful + * in constructing their description strings */ +char *default_description(const BackendVtable *backvt, + const char *host, int port); + +/* + * The Backend trait is the top-level one that governs each of the + * user-facing main modes that PuTTY can use to talk to some + * destination: SSH, Telnet, serial port, pty, etc. + */ struct Backend { const BackendVtable *vt; + + /* Many Backends are also Interactors. If this one is, a pointer + * to its Interactor trait lives here. */ + Interactor *interactor; }; struct BackendVtable { char *(*init) (const BackendVtable *vt, Seat *seat, @@ -630,9 +752,8 @@ struct BackendVtable { void (*free) (Backend *be); /* Pass in a replacement configuration. */ void (*reconfig) (Backend *be, Conf *conf); - /* send() returns the current amount of buffered data. */ - size_t (*send) (Backend *be, const char *buf, size_t len); - /* sendbuffer() does the same thing but without attempting a send */ + void (*send) (Backend *be, const char *buf, size_t len); + /* sendbuffer() returns the current amount of buffered data */ size_t (*sendbuffer) (Backend *be); void (*size) (Backend *be, int width, int height); void (*special) (Backend *be, SessionSpecialCode code, int arg); @@ -641,7 +762,14 @@ struct BackendVtable { int (*exitcode) (Backend *be); /* If back->sendok() returns false, the backend doesn't currently * want input data, so the frontend should avoid acquiring any if - * possible (passing back-pressure on to its sender). */ + * possible (passing back-pressure on to its sender). + * + * Policy rule: no backend shall return true from sendok() while + * its network connection attempt is still ongoing. This ensures + * that if making the network connection involves a proxy type + * which wants to interact with the user via the terminal, the + * proxy implementation and the backend itself won't fight over + * who gets the terminal input. */ bool (*sendok) (Backend *be); bool (*ldisc_option_state) (Backend *be, int); void (*provide_ldisc) (Backend *be, Ldisc *ldisc); @@ -660,9 +788,10 @@ struct BackendVtable { char *(*close_warn_text)(Backend *be); /* 'id' is a machine-readable name for the backend, used in - * saved-session storage. 'displayname' is a human-readable name - * for error messages. */ - const char *id, *displayname; + * saved-session storage. 'displayname_tc' and 'displayname_lc' + * are human-readable names, one in title-case for config boxes, + * and one in lower-case for use in mid-sentence. */ + const char *id, *displayname_tc, *displayname_lc; int protocol; int default_port; @@ -681,8 +810,8 @@ static inline void backend_free(Backend *be) { be->vt->free(be); } static inline void backend_reconfig(Backend *be, Conf *conf) { be->vt->reconfig(be, conf); } -static inline size_t backend_send(Backend *be, const char *buf, size_t len) -{ return be->vt->send(be, buf, len); } +static inline void backend_send(Backend *be, const char *buf, size_t len) +{ be->vt->send(be, buf, len); } static inline size_t backend_sendbuffer(Backend *be) { return be->vt->sendbuffer(be); } static inline void backend_size(Backend *be, int width, int height) @@ -727,6 +856,87 @@ extern const int be_default_protocol; */ extern const char *const appname; +/* + * Used by callback.c; declared up here so that prompts_t can use it + */ +typedef void (*toplevel_callback_fn_t)(void *ctx); + +/* Enum of result types in SeatPromptResult below */ +typedef enum SeatPromptResultKind { + /* Answer not yet available at all; either try again later or wait + * for a callback (depending on the request's API) */ + SPRK_INCOMPLETE, + + /* We're abandoning the connection because the user interactively + * told us to. (Hence, no need to present an error message + * telling the user we're doing that: they already know.) */ + SPRK_USER_ABORT, + + /* We're abandoning the connection for some other reason (e.g. we + * were unable to present the prompt at all, or a batch-mode + * configuration told us to give the answer no). This may + * ultimately have stemmed from some user configuration, but they + * didn't _tell us right now_ to abandon this connection, so we + * still need to inform them that we've done so. */ + SPRK_SW_ABORT, + + /* We're proceeding with the connection and have all requested + * information (if any) */ + SPRK_OK +} SeatPromptResultKind; + +/* Small struct to present the results of interactive requests from + * backend to Seat (see below) */ +struct SeatPromptResult { + SeatPromptResultKind kind; + + /* + * In the case of SPRK_SW_ABORT, the frontend provides an error + * message to present to the user. But dynamically allocating it + * up front would mean having to make sure it got freed at any + * call site where one of these structs is received (and freed + * _once_ no matter how many times the struct is copied). So + * instead we provide a function that will generate the error + * message into a BinarySink. + */ + void (*errfn)(SeatPromptResult, BinarySink *); + + /* + * And some fields the error function can use to construct the + * message (holding, e.g. an OS error code). + */ + const char *errdata_lit; /* statically allocated, e.g. a string literal */ + unsigned errdata_u; +}; + +/* Helper function to construct the simple versions of these + * structures inline */ +static inline SeatPromptResult make_spr_simple(SeatPromptResultKind kind) +{ + SeatPromptResult spr; + spr.kind = kind; + spr.errdata_lit = NULL; + return spr; +} + +/* Most common constructor function for SPRK_SW_ABORT errors */ +SeatPromptResult make_spr_sw_abort_static(const char *); + +/* Convenience macros wrapping those constructors in turn */ +#define SPR_INCOMPLETE make_spr_simple(SPRK_INCOMPLETE) +#define SPR_USER_ABORT make_spr_simple(SPRK_USER_ABORT) +#define SPR_SW_ABORT(lit) make_spr_sw_abort_static(lit) +#define SPR_OK make_spr_simple(SPRK_OK) + +/* Query function that folds both kinds of abort together */ +static inline bool spr_is_abort(SeatPromptResult spr) +{ + return spr.kind == SPRK_USER_ABORT || spr.kind == SPRK_SW_ABORT; +} + +/* Function to return a dynamically allocated copy of the error message */ +char *spr_get_error_message(SeatPromptResult spr); + /* * Mechanism for getting text strings such as usernames and passwords * from the front-end. @@ -748,7 +958,8 @@ typedef struct { bool echo; strbuf *result; } prompt_t; -typedef struct { +typedef struct prompts_t prompts_t; +struct prompts_t { /* * Indicates whether the information entered is to be used locally * (for instance a key passphrase prompt), or is destined for the wire. @@ -776,7 +987,25 @@ typedef struct { prompt_t **prompts; void *data; /* slot for housekeeping data, managed by * seat_get_userpass_input(); initially NULL */ -} prompts_t; + SeatPromptResult spr; /* some implementations need to cache one of these */ + + /* + * Callback you can fill in to be notified when all the prompts' + * responses are available. After you receive this notification, a + * further call to the get_userpass_input function will return the + * final state of the prompts system, which is guaranteed not to + * be negative for 'still ongoing'. + */ + toplevel_callback_fn_t callback; + void *callback_ctx; + + /* + * When this prompts_t is known to an Ldisc, we might need to + * break the connection if things get freed in an emergency. So + * this is a pointer to the Ldisc's pointer to us. + */ + prompts_t **ldisc_ptr_to_us; +}; prompts_t *new_prompts(void); void add_prompt(prompts_t *p, char *promptstr, bool echo); void prompt_set_result(prompt_t *pr, const char *newstr); @@ -851,6 +1080,10 @@ typedef enum SeatInteractionContext { SIC_BANNER, SIC_KI_PROMPTS } SeatInteractionContext; +typedef enum SeatOutputType { + SEAT_OUTPUT_STDOUT, SEAT_OUTPUT_STDERR +} SeatOutputType; + /* * Data type 'Seat', which is an API intended to contain essentially * everything that a back end might need to talk to its client for: @@ -863,14 +1096,16 @@ struct Seat { }; struct SeatVtable { /* - * Provide output from the remote session. 'is_stderr' indicates - * that the output should be sent to a separate error message - * channel, if the seat has one. But combining both channels into - * one is OK too; that's what terminal-window based seats do. + * Provide output from the remote session. 'type' indicates the + * type of the output (stdout or stderr), which can be used to + * split the output into separate message channels, if the seat + * wants to handle them differently. But combining the channels + * into one is OK too; that's what terminal-window based seats do. * * The return value is the current size of the output backlog. */ - size_t (*output)(Seat *seat, bool is_stderr, const void *data, size_t len); + size_t (*output)(Seat *seat, SeatOutputType type, + const void *data, size_t len); /* * Called when the back end wants to indicate that EOF has arrived @@ -880,41 +1115,50 @@ struct SeatVtable { */ bool (*eof)(Seat *seat); + /* + * Called by the back end to notify that the output backlog has + * changed size. A front end in control of the event loop won't + * necessarily need this (they can just keep checking it via + * backend_sendbuffer at every opportunity), but one buried in the + * depths of something else (like an SSH proxy) will need to be + * proactively notified that the amount of buffered data has + * become smaller. + */ + void (*sent)(Seat *seat, size_t new_sendbuffer); + + /* + * Provide authentication-banner output from the session setup. + * End-user Seats can treat this as very similar to 'output', but + * intermediate Seats in complex proxying situations will want to + * implement this and 'output' differently. + */ + size_t (*banner)(Seat *seat, const void *data, size_t len); + /* * Try to get answers from a set of interactive login prompts. The - * prompts are provided in 'p'; the bufchain 'input' holds the - * data currently outstanding in the session's normal standard- - * input channel. Seats may implement this function by consuming - * data from 'input' (e.g. password prompts in GUI PuTTY, - * displayed in the same terminal as the subsequent session), or - * by doing something entirely different (e.g. directly - * interacting with standard I/O, or putting up a dialog box). - * - * A positive return value means that all prompts have had answers - * filled in. A zero return means that the user performed a - * deliberate 'cancel' UI action. A negative return means that no - * answer can be given yet but please try again later. + * prompts are provided in 'p'. * - * (FIXME: it would be nice to distinguish two classes of cancel - * action, so the user could specify 'I want to abandon this + * (FIXME: it would be nice to distinguish two classes of user- + * abort action, so the user could specify 'I want to abandon this * entire attempt to start a session' or the milder 'I want to * abandon this particular form of authentication and fall back to * a different one' - e.g. if you turn out not to be able to * remember your private key passphrase then perhaps you'd rather * fall back to password auth rather than aborting the whole * session.) + */ + SeatPromptResult (*get_userpass_input)(Seat *seat, prompts_t *p); + + /* + * Notify the seat that the main session channel has been + * successfully set up. * - * (Also FIXME: currently, backends' only response to the 'try - * again later' is to try again when more input data becomes - * available, because they assume that a seat is returning that - * value because it's consuming keyboard input. But a seat that - * handled this function by putting up a dialog box might want to - * put it up non-modally, and therefore would want to proactively - * notify the backend to retry once the dialog went away. So if I - * ever do want to move password prompts into a dialog box, I'll - * want a backend method for sending that notification.) + * This is only used as part of the SSH proxying system, so it's + * not necessary to implement it in all backends. A backend must + * call this if it advertises the BACKEND_NOTIFIES_SESSION_START + * flag, and otherwise, doesn't have to. */ - int (*get_userpass_input)(Seat *seat, prompts_t *p, bufchain *input); + void (*notify_session_started)(Seat *seat); /* * Notify the seat that the process running at the other end of @@ -922,6 +1166,29 @@ struct SeatVtable { */ void (*notify_remote_exit)(Seat *seat); + /* + * Notify the seat that the whole connection has finished. + * (Distinct from notify_remote_exit, e.g. in the case where you + * have port forwardings still active when the main foreground + * session goes away: then you'd get notify_remote_exit when the + * foreground session dies, but notify_remote_disconnect when the + * last forwarding vanishes and the network connection actually + * closes.) + * + * This function might be called multiple times by accident; seats + * should be prepared to cope. + * + * More precisely: this function notifies the seat that + * backend_connected() might now return false where previously it + * returned true. (Note the 'might': an accidental duplicate call + * might happen when backend_connected() was already returning + * false. Or even, in weird situations, when it hadn't stopped + * returning true yet. The point is, when you get this + * notification, all it's really telling you is that it's worth + * _checking_ backend_connected, if you weren't already.) + */ + void (*notify_remote_disconnect)(Seat *seat); + /* * Notify the seat that the connection has suffered a fatal error. */ @@ -962,35 +1229,48 @@ struct SeatVtable { /* * Ask the seat whether a given SSH host key should be accepted. - * This may return immediately after checking saved configuration - * or command-line options, or it may have to present a prompt to - * the user and return asynchronously later. + * This is called after we've already checked it by any means we + * can do ourselves, such as checking against host key + * fingerprints in the Conf or the host key cache on disk: once we + * call this function, we've already decided there's nothing for + * it but to prompt the user. + * + * 'mismatch' reports the result of checking the host key cache: + * it is true if the server has presented a host key different + * from the one we expected, and false if we had no expectation in + * the first place. + * + * This call may prompt the user synchronously and not return + * until the answer is available, or it may present the prompt and + * return immediately, giving the answer later via the provided + * callback. * * Return values: * - * - +1 means `key was OK' (either already known or the user just - * approved it) `so continue with the connection' + * - +1 means `user approved the key, so continue with the + * connection' * - * - 0 means `key was not OK, abandon the connection' + * - 0 means `user rejected the key, abandon the connection' * * - -1 means `I've initiated enquiries, please wait to be called * back via the provided function with a result that's either 0 * or +1'. */ - int (*verify_ssh_host_key)( + SeatPromptResult (*confirm_ssh_host_key)( Seat *seat, const char *host, int port, const char *keytype, char *keystr, const char *keydisp, char **key_fingerprints, - void (*callback)(void *ctx, int result), void *ctx); + bool mismatch, void (*callback)(void *ctx, SeatPromptResult result), + void *ctx); /* * Check with the seat whether it's OK to use a cryptographic * primitive from below the 'warn below this line' threshold in * the input Conf. Return values are the same as - * verify_ssh_host_key above. + * confirm_ssh_host_key above. */ - int (*confirm_weak_crypto_primitive)( + SeatPromptResult (*confirm_weak_crypto_primitive)( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx); + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); /* * Variant form of confirm_weak_crypto_primitive, which prints a @@ -1003,9 +1283,9 @@ struct SeatVtable { * threshold is available that we don't have cached. 'betteralgs' * lists the better algorithm(s). */ - int (*confirm_weak_cached_hostkey)( + SeatPromptResult (*confirm_weak_cached_hostkey)( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx); + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); /* * Indicates whether the seat is expecting to interact with the @@ -1057,13 +1337,31 @@ struct SeatVtable { * (and hence, can be trusted if it's asking you for secrets such * as your passphrase); false means output is coming from the * server. + */ + void (*set_trust_status)(Seat *seat, bool trusted); + + /* + * Query whether this Seat can do anything user-visible in + * response to set_trust_status. * * Returns true if the seat has a way to indicate this * distinction. Returns false if not, in which case the backend * should use a fallback defence against spoofing of PuTTY's local * prompts by malicious servers. */ - bool (*set_trust_status)(Seat *seat, bool trusted); + bool (*can_set_trust_status)(Seat *seat); + + /* + * Query whether this Seat's interactive prompt responses and its + * session input come from the same place. + * + * If false, this is used to suppress the final 'Press Return to + * begin session' anti-spoofing prompt in Plink. For example, + * Plink itself sets this flag if its standard input is redirected + * (and therefore not coming from the same place as the console + * it's sending its prompts to). + */ + bool (*has_mixed_input_stream)(Seat *seat); /* * Ask the seat whether it would like verbose messages. @@ -1084,34 +1382,46 @@ struct SeatVtable { }; static inline size_t seat_output( - Seat *seat, bool err, const void *data, size_t len) -{ return seat->vt->output(seat, err, data, len); } + Seat *seat, SeatOutputType type, const void *data, size_t len) +{ return seat->vt->output(seat, type, data, len); } static inline bool seat_eof(Seat *seat) { return seat->vt->eof(seat); } -static inline int seat_get_userpass_input( - Seat *seat, prompts_t *p, bufchain *input) -{ return seat->vt->get_userpass_input(seat, p, input); } +static inline void seat_sent(Seat *seat, size_t bufsize) +{ seat->vt->sent(seat, bufsize); } +static inline size_t seat_banner( + InteractionReadySeat iseat, const void *data, size_t len) +{ return iseat.seat->vt->banner(iseat.seat, data, len); } +static inline SeatPromptResult seat_get_userpass_input( + InteractionReadySeat iseat, prompts_t *p) +{ return iseat.seat->vt->get_userpass_input(iseat.seat, p); } +static inline void seat_notify_session_started(Seat *seat) +{ seat->vt->notify_session_started(seat); } static inline void seat_notify_remote_exit(Seat *seat) { seat->vt->notify_remote_exit(seat); } +static inline void seat_notify_remote_disconnect(Seat *seat) +{ seat->vt->notify_remote_disconnect(seat); } static inline void seat_update_specials_menu(Seat *seat) { seat->vt->update_specials_menu(seat); } static inline char *seat_get_ttymode(Seat *seat, const char *mode) { return seat->vt->get_ttymode(seat, mode); } static inline void seat_set_busy_status(Seat *seat, BusyStatus status) { seat->vt->set_busy_status(seat, status); } -static inline int seat_verify_ssh_host_key( - Seat *seat, const char *h, int p, const char *ktyp, char *kstr, - const char *kdsp, char **fps, void (*cb)(void *ctx, int result), void *ctx) -{ return seat->vt->verify_ssh_host_key(seat, h, p, ktyp, kstr, kdsp, fps, - cb, ctx); } -static inline int seat_confirm_weak_crypto_primitive( - Seat *seat, const char *atyp, const char *aname, - void (*cb)(void *ctx, int result), void *ctx) -{ return seat->vt->confirm_weak_crypto_primitive(seat, atyp, aname, cb, ctx); } -static inline int seat_confirm_weak_cached_hostkey( - Seat *seat, const char *aname, const char *better, - void (*cb)(void *ctx, int result), void *ctx) -{ return seat->vt->confirm_weak_cached_hostkey(seat, aname, better, cb, ctx); } +static inline SeatPromptResult seat_confirm_ssh_host_key( + InteractionReadySeat iseat, const char *h, int p, const char *ktyp, + char *kstr, const char *kdsp, char **fps, bool mis, + void (*cb)(void *ctx, SeatPromptResult result), void *ctx) +{ return iseat.seat->vt->confirm_ssh_host_key( + iseat.seat, h, p, ktyp, kstr, kdsp, fps, mis, cb, ctx); } +static inline SeatPromptResult seat_confirm_weak_crypto_primitive( + InteractionReadySeat iseat, const char *atyp, const char *aname, + void (*cb)(void *ctx, SeatPromptResult result), void *ctx) +{ return iseat.seat->vt->confirm_weak_crypto_primitive( + iseat.seat, atyp, aname, cb, ctx); } +static inline SeatPromptResult seat_confirm_weak_cached_hostkey( + InteractionReadySeat iseat, const char *aname, const char *better, + void (*cb)(void *ctx, SeatPromptResult result), void *ctx) +{ return iseat.seat->vt->confirm_weak_cached_hostkey( + iseat.seat, aname, better, cb, ctx); } static inline bool seat_is_utf8(Seat *seat) { return seat->vt->is_utf8(seat); } static inline void seat_echoedit_update(Seat *seat, bool ec, bool ed) @@ -1125,8 +1435,12 @@ static inline bool seat_get_window_pixel_size(Seat *seat, int *w, int *h) static inline StripCtrlChars *seat_stripctrl_new( Seat *seat, BinarySink *bs, SeatInteractionContext sic) { return seat->vt->stripctrl_new(seat, bs, sic); } -static inline bool seat_set_trust_status(Seat *seat, bool trusted) -{ return seat->vt->set_trust_status(seat, trusted); } +static inline void seat_set_trust_status(Seat *seat, bool trusted) +{ seat->vt->set_trust_status(seat, trusted); } +static inline bool seat_can_set_trust_status(Seat *seat) +{ return seat->vt->can_set_trust_status(seat); } +static inline bool seat_has_mixed_input_stream(Seat *seat) +{ return seat->vt->has_mixed_input_stream(seat); } static inline bool seat_verbose(Seat *seat) { return seat->vt->verbose(seat); } static inline bool seat_interactive(Seat *seat) @@ -1136,18 +1450,26 @@ static inline bool seat_get_cursor_position(Seat *seat, int *x, int *y) /* Unlike the seat's actual method, the public entry point * seat_connection_fatal is a wrapper function with a printf-like API, - * defined in misc.c. */ + * defined in utils. */ void seat_connection_fatal(Seat *seat, const char *fmt, ...) PRINTF_LIKE(2, 3); /* Handy aliases for seat_output which set is_stderr to a fixed value. */ static inline size_t seat_stdout(Seat *seat, const void *data, size_t len) -{ return seat_output(seat, false, data, len); } +{ return seat_output(seat, SEAT_OUTPUT_STDOUT, data, len); } static inline size_t seat_stdout_pl(Seat *seat, ptrlen data) -{ return seat_output(seat, false, data.ptr, data.len); } +{ return seat_output(seat, SEAT_OUTPUT_STDOUT, data.ptr, data.len); } static inline size_t seat_stderr(Seat *seat, const void *data, size_t len) -{ return seat_output(seat, true, data, len); } +{ return seat_output(seat, SEAT_OUTPUT_STDERR, data, len); } static inline size_t seat_stderr_pl(Seat *seat, ptrlen data) -{ return seat_output(seat, true, data.ptr, data.len); } +{ return seat_output(seat, SEAT_OUTPUT_STDERR, data.ptr, data.len); } + +/* Alternative API for seat_banner taking a ptrlen */ +static inline size_t seat_banner_pl(InteractionReadySeat iseat, ptrlen data) +{ return iseat.seat->vt->banner(iseat.seat, data.ptr, data.len); } + +/* In the utils subdir: print a message to the Seat which can't be + * spoofed by server-supplied auth-time output such as SSH banners */ +void seat_antispoof_msg(InteractionReadySeat iseat, const char *msg); /* * Stub methods for seat implementations that want to use the obvious @@ -1157,24 +1479,29 @@ static inline size_t seat_stderr_pl(Seat *seat, ptrlen data) * plausibly want to return either fixed answer 'no' or 'yes'. */ size_t nullseat_output( - Seat *seat, bool is_stderr, const void *data, size_t len); + Seat *seat, SeatOutputType type, const void *data, size_t len); bool nullseat_eof(Seat *seat); -int nullseat_get_userpass_input(Seat *seat, prompts_t *p, bufchain *input); +void nullseat_sent(Seat *seat, size_t bufsize); +size_t nullseat_banner(Seat *seat, const void *data, size_t len); +size_t nullseat_banner_to_stderr(Seat *seat, const void *data, size_t len); +SeatPromptResult nullseat_get_userpass_input(Seat *seat, prompts_t *p); +void nullseat_notify_session_started(Seat *seat); void nullseat_notify_remote_exit(Seat *seat); +void nullseat_notify_remote_disconnect(Seat *seat); void nullseat_connection_fatal(Seat *seat, const char *message); void nullseat_update_specials_menu(Seat *seat); char *nullseat_get_ttymode(Seat *seat, const char *mode); void nullseat_set_busy_status(Seat *seat, BusyStatus status); -int nullseat_verify_ssh_host_key( +SeatPromptResult nullseat_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **key_fingerprints, - void (*callback)(void *ctx, int result), void *ctx); -int nullseat_confirm_weak_crypto_primitive( + char *keystr, const char *keydisp, char **key_fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); +SeatPromptResult nullseat_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx); -int nullseat_confirm_weak_cached_hostkey( + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); +SeatPromptResult nullseat_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx); + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); bool nullseat_is_never_utf8(Seat *seat); bool nullseat_is_always_utf8(Seat *seat); void nullseat_echoedit_update(Seat *seat, bool echoing, bool editing); @@ -1183,8 +1510,11 @@ bool nullseat_get_windowid(Seat *seat, long *id_out); bool nullseat_get_window_pixel_size(Seat *seat, int *width, int *height); StripCtrlChars *nullseat_stripctrl_new( Seat *seat, BinarySink *bs_out, SeatInteractionContext sic); -bool nullseat_set_trust_status(Seat *seat, bool trusted); -bool nullseat_set_trust_status_vacuously(Seat *seat, bool trusted); +void nullseat_set_trust_status(Seat *seat, bool trusted); +bool nullseat_can_set_trust_status_yes(Seat *seat); +bool nullseat_can_set_trust_status_no(Seat *seat); +bool nullseat_has_mixed_input_stream_yes(Seat *seat); +bool nullseat_has_mixed_input_stream_no(Seat *seat); bool nullseat_verbose_no(Seat *seat); bool nullseat_verbose_yes(Seat *seat); bool nullseat_interactive_no(Seat *seat); @@ -1193,30 +1523,57 @@ bool nullseat_get_cursor_position(Seat *seat, int *x, int *y); /* * Seat functions provided by the platform's console-application - * support module (wincons.c, uxcons.c). + * support module (console.c in each platform subdirectory). */ void console_connection_fatal(Seat *seat, const char *message); -int console_verify_ssh_host_key( +SeatPromptResult console_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **key_fingerprints, - void (*callback)(void *ctx, int result), void *ctx); -int console_confirm_weak_crypto_primitive( + char *keystr, const char *keydisp, char **key_fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); +SeatPromptResult console_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx); -int console_confirm_weak_cached_hostkey( + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); +SeatPromptResult console_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx); + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); StripCtrlChars *console_stripctrl_new( Seat *seat, BinarySink *bs_out, SeatInteractionContext sic); -bool console_set_trust_status(Seat *seat, bool trusted); +void console_set_trust_status(Seat *seat, bool trusted); +bool console_can_set_trust_status(Seat *seat); +bool console_has_mixed_input_stream(Seat *seat); /* * Other centralised seat functions. */ -int filexfer_get_userpass_input(Seat *seat, prompts_t *p, bufchain *input); +SeatPromptResult filexfer_get_userpass_input(Seat *seat, prompts_t *p); bool cmdline_seat_verbose(Seat *seat); +/* + * TempSeat: a seat implementation that can be given to a backend + * temporarily while network proxy setup is using the real seat. + * Buffers output and trust-status changes until the real seat is + * available again. + */ + +/* Called by the proxy code to make a TempSeat. */ +Seat *tempseat_new(Seat *real); + +/* Query functions to tell if a Seat _is_ temporary, and if so, to + * return the underlying real Seat. */ +bool is_tempseat(Seat *seat); +Seat *tempseat_get_real(Seat *seat); + +/* Called by interactor_return_seat once the proxy connection has + * finished setting up (or failed), to pass on any buffered stuff to + * the real seat. */ +void tempseat_flush(Seat *ts); + +/* Frees a TempSeat, without flushing anything it has buffered. (Call + * this after tempseat_flush, or alternatively, when you were going to + * abandon the whole connection anyway.) */ +void tempseat_free(Seat *ts); + typedef struct rgb { uint8_t r, g, b; } rgb; @@ -1279,8 +1636,9 @@ struct TermWinVtable { void (*request_resize)(TermWin *, int w, int h); - void (*set_title)(TermWin *, const char *title); - void (*set_icon_title)(TermWin *, const char *icontitle); + void (*set_title)(TermWin *, const char *title, int codepage); + void (*set_icon_title)(TermWin *, const char *icontitle, int codepage); + /* set_minimised and set_maximised are assumed to set two * independent settings, rather than a single three-way * {min,normal,max} switch. The idea is that when you un-minimise @@ -1307,6 +1665,11 @@ struct TermWinVtable { * object, because that doesn't happen until term_init * returns. */ void (*palette_get_overrides)(TermWin *, Terminal *); + + /* Notify the front end that the terminal's buffer of unprocessed + * output has reduced. (Front ends will likely pass this straight + * on to backend_unthrottle.) */ + void (*unthrottle)(TermWin *, size_t bufsize); }; static inline bool win_setup_draw_ctx(TermWin *win) @@ -1345,10 +1708,11 @@ static inline void win_refresh(TermWin *win) { win->vt->refresh(win); } static inline void win_request_resize(TermWin *win, int w, int h) { win->vt->request_resize(win, w, h); } -static inline void win_set_title(TermWin *win, const char *title) -{ win->vt->set_title(win, title); } -static inline void win_set_icon_title(TermWin *win, const char *icontitle) -{ win->vt->set_icon_title(win, icontitle); } +static inline void win_set_title(TermWin *win, const char *title, int codepage) +{ win->vt->set_title(win, title, codepage); } +static inline void win_set_icon_title(TermWin *win, const char *icontitle, + int codepage) +{ win->vt->set_icon_title(win, icontitle, codepage); } static inline void win_set_minimised(TermWin *win, bool minimised) { win->vt->set_minimised(win, minimised); } static inline void win_set_maximised(TermWin *win, bool maximised) @@ -1362,6 +1726,8 @@ static inline void win_palette_set( { win->vt->palette_set(win, start, ncolours, colours); } static inline void win_palette_get_overrides(TermWin *win, Terminal *term) { win->vt->palette_get_overrides(win, term); } +static inline void win_unthrottle(TermWin *win, size_t size) +{ win->vt->unthrottle(win, size); } /* * Global functions not specific to a connection instance. @@ -1433,8 +1799,8 @@ NORETURN void cleanup_exit(int); X(BOOL, NONE, try_tis_auth) \ X(BOOL, NONE, try_ki_auth) \ /* PUTTY_CAC START */ \ - X(BOOL, NONE, try_cert_auth) /* check box */ \ - X(STR, NONE, cert_certid) /* cert sha-1 fingerprint (in hex) */ \ + X(BOOL, NONE, cert_attempt_auth) /* check box */ \ + X(STR, NONE, cert_fingerprint) /* cert sha-1 fingerprint (in hex) */ \ /* PUTTY_CAC END */ \ X(BOOL, NONE, try_gssapi_auth) /* attempt gssapi auth via ssh userauth */ \ X(BOOL, NONE, try_gssapi_kex) /* attempt gssapi auth via ssh kex */ \ @@ -1473,6 +1839,7 @@ NORETURN void cleanup_exit(int); X(BOOL, NONE, bksp_is_delete) \ X(BOOL, NONE, rxvt_homeend) \ X(INT, NONE, funky_type) /* FUNKY_XTERM, FUNKY_LINUX, ... */ \ + X(INT, NONE, sharrow_type) /* SHARROW_APPLICATION, SHARROW_BITMAP, ... */ \ X(BOOL, NONE, no_applic_c) /* totally disable app cursor keys */ \ X(BOOL, NONE, no_applic_k) /* totally disable app keypad */ \ X(BOOL, NONE, no_mouse_rep) /* totally disable mouse reporting */ \ @@ -1605,6 +1972,7 @@ NORETURN void cleanup_exit(int); X(INT, NONE, sshbug_oldgex2) \ X(INT, NONE, sshbug_winadj) \ X(INT, NONE, sshbug_chanreq) \ + X(INT, NONE, sshbug_dropstart) \ /* \ * ssh_simple means that we promise never to open any channel \ * other than the main one, which means it can safely use a very \ @@ -1685,7 +2053,7 @@ void fontspec_serialise(BinarySink *bs, FontSpec *f); FontSpec *fontspec_deserialise(BinarySource *src); /* - * Exports from noise.c. + * Exports from each platform's noise.c. */ typedef enum NoiseSourceId { NOISE_SOURCE_TIME, @@ -1711,6 +2079,10 @@ void noise_get_heavy(void (*func) (void *, int)); void noise_get_light(void (*func) (void *, int)); void noise_regular(void); void noise_ultralight(NoiseSourceId id, unsigned long data); + +/* + * Exports from sshrand.c. + */ void random_save_seed(void); void random_destroy_seed(void); @@ -1769,6 +2141,7 @@ void term_pwron(Terminal *, bool); void term_clrsb(Terminal *); void term_mouse(Terminal *, Mouse_Button, Mouse_Button, Mouse_Action, int, int, bool, bool, bool); +void term_cancel_selection_drag(Terminal *); void term_key(Terminal *, Key_Sym, wchar_t *, size_t, unsigned int, unsigned int); void term_lost_clipboard_ownership(Terminal *, int clipboard); @@ -1783,12 +2156,12 @@ void term_reconfig(Terminal *, Conf *); void term_request_copy(Terminal *, const int *clipboards, int n_clipboards); void term_request_paste(Terminal *, int clipboard); void term_seen_key_event(Terminal *); -size_t term_data(Terminal *, bool is_stderr, const void *data, size_t len); +size_t term_data(Terminal *, const void *data, size_t len); void term_provide_backend(Terminal *term, Backend *backend); void term_provide_logctx(Terminal *term, LogContext *logctx); void term_set_focus(Terminal *term, bool has_focus); char *term_get_ttymode(Terminal *term, const char *mode); -int term_get_userpass_input(Terminal *term, prompts_t *p, bufchain *input); +SeatPromptResult term_get_userpass_input(Terminal *term, prompts_t *p); void term_set_trust_status(Terminal *term, bool trusted); void term_keyinput(Terminal *, int codepage, const void *buf, int len); void term_keyinputw(Terminal *, const wchar_t * widebuf, int len); @@ -1803,9 +2176,10 @@ void term_palette_override(Terminal *term, unsigned osc4_index, rgb rgb); typedef enum SmallKeypadKey { SKK_HOME, SKK_END, SKK_INSERT, SKK_DELETE, SKK_PGUP, SKK_PGDN, } SmallKeypadKey; -int format_arrow_key(char *buf, Terminal *term, int xkey, bool ctrl); +int format_arrow_key(char *buf, Terminal *term, int xkey, + bool shift, bool ctrl, bool alt, bool *consumed_alt); int format_function_key(char *buf, Terminal *term, int key_number, - bool shift, bool ctrl); + bool shift, bool ctrl, bool alt, bool *consumed_alt); int format_small_keypad_key(char *buf, Terminal *term, SmallKeypadKey key); int format_numeric_keypad_key(char *buf, Terminal *term, char key, bool shift, bool ctrl); @@ -1869,7 +2243,7 @@ static inline void lp_logging_error(LogPolicy *lp, const char *event) static inline bool lp_verbose(LogPolicy *lp) { return lp->vt->verbose(lp); } -/* Defined in conscli.c, used in several console command-line tools */ +/* Defined in clicons.c, used in several console command-line tools */ extern LogPolicy console_cli_logpolicy[]; int console_askappend(LogPolicy *lp, Filename *filename, @@ -1887,6 +2261,7 @@ void logfopen(LogContext *logctx); void logfclose(LogContext *logctx); void logtraffic(LogContext *logctx, unsigned char c, int logmode); void logflush(LogContext *logctx); +LogPolicy *log_get_policy(LogContext *logctx); void logevent(LogContext *logctx, const char *event); void logeventf(LogContext *logctx, const char *fmt, ...) PRINTF_LIKE(2, 3); void logeventvf(LogContext *logctx, const char *fmt, va_list ap); @@ -1936,7 +2311,7 @@ extern const struct BackendVtable rlogin_backend; extern const struct BackendVtable telnet_backend; /* - * Exports from ssh.c. + * Exports from ssh/ssh.c. */ extern const struct BackendVtable ssh_backend; extern const struct BackendVtable sshconn_backend; @@ -1954,6 +2329,29 @@ void ldisc_configure(Ldisc *, Conf *); void ldisc_free(Ldisc *); void ldisc_send(Ldisc *, const void *buf, int len, bool interactive); void ldisc_echoedit_update(Ldisc *); +typedef struct LdiscInputToken { + /* + * Structure that encodes any single item of data that Ldisc can + * buffer: either a single character of raw data, or a session + * special. + */ + bool is_special; + union { + struct { + /* if is_special == false */ + char chr; + }; + struct { + /* if is_special == true */ + SessionSpecialCode code; + int arg; + }; + }; +} LdiscInputToken; +bool ldisc_has_input_buffered(Ldisc *); +LdiscInputToken ldisc_get_input_token(Ldisc *); /* asserts there is input */ +void ldisc_enable_prompt_callback(Ldisc *, prompts_t *); +void ldisc_check_sendok(Ldisc *); /* * Exports from sshrand.c. @@ -1998,7 +2396,7 @@ void pinger_reconfig(Pinger *, Conf *oldconf, Conf *newconf); void pinger_free(Pinger *); /* - * Exports from misc.c. + * Exports from modules in utils. */ #include "misc.h" @@ -2011,19 +2409,13 @@ char const *conf_dest(Conf *conf); void prepare_session(Conf *conf); /* - * Exports from sercfg.c. - */ -void ser_setup_config_box(struct controlbox *b, bool midsession, - int parity_mask, int flow_mask); - -/* - * Exports from version.c. + * Exports from version.c and cmake_commit.c. */ extern const char ver[]; extern const char commitid[]; /* - * Exports from unicode.c. + * Exports from unicode.c in platform subdirs. */ #ifndef CP_UTF8 #define CP_UTF8 65001 @@ -2051,7 +2443,7 @@ int mk_wcwidth_cjk(unsigned int ucs); int mk_wcswidth_cjk(const unsigned int *pwcs, size_t n); /* - * Exports from pageantc.c. + * Exports from agent-client.c in platform subdirs. * * agent_query returns NULL for here's-a-response, and non-NULL for * query-in- progress. In the latter case there will be a call to @@ -2070,8 +2462,8 @@ int mk_wcswidth_cjk(const unsigned int *pwcs, size_t n); * * Passing a null pointer as callback forces agent_query to behave * synchronously, i.e. it will block if necessary, and guarantee to - * return NULL. The wrapper function agent_query_synchronous() makes - * this easier. + * return NULL. The wrapper function agent_query_synchronous() + * (defined in its own module aqsync.c) makes this easier. */ typedef struct agent_pending_query agent_pending_query; agent_pending_query *agent_query( @@ -2093,7 +2485,7 @@ int wc_match(const char *wildcard, const char *target); bool wc_unescape(char *output, const char *wildcard); /* - * Exports from frontend (windlg.c etc) + * Exports from frontend (dialog.c etc) */ void pgp_fingerprints(void); /* @@ -2103,11 +2495,11 @@ void pgp_fingerprints(void); bool have_ssh_host_key(const char *host, int port, const char *keytype); /* - * Exports from console frontends (wincons.c, uxcons.c) + * Exports from console frontends (console.c in platform subdirs) * that aren't equivalents to things in windlg.c et al. */ extern bool console_batch_mode, console_antispoof_prompt; -int console_get_userpass_input(prompts_t *p); +SeatPromptResult console_get_userpass_input(prompts_t *p); bool is_interactive(void); void console_print_error_msg(const char *prefix, const char *msg); void console_print_error_msg_fmt_v( @@ -2116,7 +2508,7 @@ void console_print_error_msg_fmt(const char *prefix, const char *fmt, ...) PRINTF_LIKE(2, 3); /* - * Exports from printing.c. + * Exports from printing.c in platform subdirs. */ typedef struct printer_enum_tag printer_enum; typedef struct printer_job_tag printer_job; @@ -2137,10 +2529,15 @@ void printer_finish_job(printer_job *); * zero out password arguments in the hope of not having them show up * avoidably in Unix 'ps'. */ +struct cmdline_get_passwd_input_state { bool tried; }; +#define CMDLINE_GET_PASSWD_INPUT_STATE_INIT { .tried = false } +extern const cmdline_get_passwd_input_state cmdline_get_passwd_input_state_new; + int cmdline_process_param(const char *, char *, int, Conf *); void cmdline_run_saved(Conf *); void cmdline_cleanup(void); -int cmdline_get_passwd_input(prompts_t *p); +SeatPromptResult cmdline_get_passwd_input( + prompts_t *p, cmdline_get_passwd_input_state *state, bool restartable); bool cmdline_host_ok(Conf *); bool cmdline_verbose(void); bool cmdline_loaded_session(void); @@ -2196,14 +2593,16 @@ void setup_config_box(struct controlbox *b, bool midsession, int protocol, int protcfginfo); /* - * Exports from minibidi.c. + * Exports from bidi.c. */ #define BIDI_CHAR_INDEX_NONE ((unsigned short)-1) typedef struct bidi_char { unsigned int origwc, wc; unsigned short index, nchars; } bidi_char; -int do_bidi(bidi_char *line, int count); +BidiContext *bidi_new_context(void); +void bidi_free_context(BidiContext *ctx); +void do_bidi(BidiContext *ctx, bidi_char *line, size_t count); int do_shape(bidi_char *line, bidi_char *to, int count); bool is_rtl(int c); @@ -2216,7 +2615,7 @@ enum { X11_XDM, /* XDM-AUTHORIZATION-1 */ X11_NAUTHS }; -extern const char *const x11_authnames[]; /* declared in x11fwd.c */ +extern const char *const x11_authnames[X11_NAUTHS]; /* * An enum for the copy-paste UI action configuration. @@ -2370,7 +2769,6 @@ unsigned long timing_last_clock(void); * loop, as in PSFTP, for example - if a callback has run then perhaps * it might have done whatever the loop's caller was waiting for. */ -typedef void (*toplevel_callback_fn_t)(void *ctx); void queue_toplevel_callback(toplevel_callback_fn_t fn, void *ctx); bool run_toplevel_callbacks(void); bool toplevel_callback_pending(void); diff --git a/code/puttymem.h b/code/puttymem.h index 6513d6c..11c1f83 100644 --- a/code/puttymem.h +++ b/code/puttymem.h @@ -107,18 +107,19 @@ void *safegrowarray(void *array, size_t *size, size_t eltsize, /* * This function is called by the innermost safemalloc/saferealloc - * functions when allocation fails. Usually it's provided by misc.c - * which ties it into an application's existing modalfatalbox() - * system, but standalone test applications can reimplement it some - * other way if they prefer. + * functions when allocation fails. Usually it's provided by an + * implementation in utils, which ties it into an application's + * existing modalfatalbox() system, but standalone test applications + * can reimplement it some other way if they prefer. */ NORETURN void out_of_memory(void); #ifdef MINEFIELD /* * Definitions for Minefield, PuTTY's own Windows-specific malloc - * debugger in the style of Electric Fence. Implemented in winmisc.c, - * and referred to by the main malloc wrappers in memory.c. + * debugger in the style of Electric Fence. Implemented in + * windows/utils/minefield.c, and referred to by the main malloc + * wrappers in memory.c. */ void *minefield_c_malloc(size_t size); void minefield_c_free(void *p); diff --git a/code/puttyps.h b/code/puttyps.h deleted file mode 100644 index 27916d2..0000000 --- a/code/puttyps.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Find the platform-specific header for this platform. - */ - -#ifndef PUTTY_PUTTYPS_H -#define PUTTY_PUTTYPS_H - -#ifdef _WINDOWS - -#include "winstuff.h" - -#else - -#include "unix.h" - -#endif - -#endif diff --git a/code/release.pl b/code/release.pl index c4e9822..122cc02 100644 --- a/code/release.pl +++ b/code/release.pl @@ -34,10 +34,8 @@ my $builddir = tempdir(DIR => ".", CLEANUP => 1); 0 == system "git archive --format=tar HEAD | ( cd $builddir && tar xf - )" or die; - 0 == system "cd $builddir && ./mkfiles.pl" or die; - 0 == system "cd $builddir && ./mkauto.sh" or die; - 0 == system "cd $builddir && ./configure" or die; - 0 == system "cd $builddir && make pscp plink RELEASE=${version}" or die; + 0 == system "cd $builddir && cmake . -DCMAKE_C_FLAGS=-DRELEASE=${version}" or die; + 0 == system "cd $builddir && cmake --build . -t pscp -t plink -j" or die; our $pscp_transcript = `cd $builddir && ./pscp --help`; $pscp_transcript =~ s/^Unidentified build/Release ${version}/m or die; $pscp_transcript =~ s/^/\\c /mg; diff --git a/code/resource.h b/code/resource.h deleted file mode 100644 index e856d6b..0000000 --- a/code/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by win_res.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/code/settings.c b/code/settings.c index aeb039f..c23fe08 100644 --- a/code/settings.c +++ b/code/settings.c @@ -8,8 +8,8 @@ #include "putty.h" #include "storage.h" #ifndef NO_GSSAPI -#include "sshgssc.h" -#include "sshgss.h" +#include "ssh/gssc.h" +#include "ssh/gss.h" #endif #ifdef PUTTY_CAC @@ -52,9 +52,9 @@ static const struct keyvalwhere hknames[] = { /* * All the terminal modes that we know about for the "TerminalModes" * setting. (Also used by config.c for the drop-down list.) - * This is currently precisely the same as the set in ssh.c, but could - * in principle differ if other backends started to support tty modes - * (e.g., the pty backend). + * This is currently precisely the same as the set in + * ssh/ttymode-list.h, but could in principle differ if other backends + * started to support tty modes (e.g., the pty backend). * The set of modes in in this array is currently significant for * settings migration from old versions; if they change, review the * gppmap() invocation for "TerminalModes". @@ -630,13 +630,14 @@ void save_open_settings(settings_w *sesskey, Conf *conf) write_setting_s(sesskey, "RemoteCommand", conf_get_str(conf, CONF_remote_cmd)); write_setting_b(sesskey, "RFCEnviron", conf_get_bool(conf, CONF_rfc_environ)); #ifdef PUTTY_CAC - write_setting_b(sesskey, "AuthCAPI", conf_get_bool(conf, CONF_try_cert_auth)); - write_setting_s(sesskey, "CAPICertID", conf_get_str(conf, CONF_cert_certid)); + write_setting_b(sesskey, "AuthCAPI", conf_get_bool(conf, CONF_cert_attempt_auth)); + write_setting_s(sesskey, "CAPICertID", conf_get_str(conf, CONF_cert_fingerprint)); #endif // PUTTY_CAC write_setting_b(sesskey, "PassiveTelnet", conf_get_bool(conf, CONF_passive_telnet)); write_setting_b(sesskey, "BackspaceIsDelete", conf_get_bool(conf, CONF_bksp_is_delete)); write_setting_b(sesskey, "RXVTHomeEnd", conf_get_bool(conf, CONF_rxvt_homeend)); write_setting_i(sesskey, "LinuxFunctionKeys", conf_get_int(conf, CONF_funky_type)); + write_setting_i(sesskey, "ShiftedArrowKeys", conf_get_int(conf, CONF_sharrow_type)); write_setting_b(sesskey, "NoApplicationKeys", conf_get_bool(conf, CONF_no_applic_k)); write_setting_b(sesskey, "NoApplicationCursors", conf_get_bool(conf, CONF_no_applic_c)); write_setting_b(sesskey, "NoMouseReporting", conf_get_bool(conf, CONF_no_mouse_rep)); @@ -776,6 +777,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf) write_setting_i(sesskey, "BugOldGex2", 2-conf_get_int(conf, CONF_sshbug_oldgex2)); write_setting_i(sesskey, "BugWinadj", 2-conf_get_int(conf, CONF_sshbug_winadj)); write_setting_i(sesskey, "BugChanReq", 2-conf_get_int(conf, CONF_sshbug_chanreq)); + write_setting_i(sesskey, "BugDropStart", 2-conf_get_int(conf, CONF_sshbug_dropstart)); write_setting_b(sesskey, "StampUtmp", conf_get_bool(conf, CONF_stamp_utmp)); write_setting_b(sesskey, "LoginShell", conf_get_bool(conf, CONF_login_shell)); write_setting_b(sesskey, "ScrollbarOnLeft", conf_get_bool(conf, CONF_scrollbar_on_left)); @@ -1050,17 +1052,19 @@ void load_open_settings(settings_r *sesskey, Conf *conf) gppb(sesskey, "RFCEnviron", false, conf, CONF_rfc_environ); gppb(sesskey, "PassiveTelnet", false, conf, CONF_passive_telnet); #ifdef PUTTY_CAC - gppb(sesskey, "AuthCAPI", 0, conf, CONF_try_cert_auth); - gpps(sesskey, "CAPICertID", "", conf, CONF_cert_certid); + gppb(sesskey, "AuthCAPI", 0, conf, CONF_cert_attempt_auth); + gpps(sesskey, "CAPICertID", "", conf, CONF_cert_fingerprint); // convert certificate identifiers from old format - char * certid = conf_get_str(conf, CONF_cert_certid); + char * certid = conf_get_str(conf, CONF_cert_fingerprint); cert_convert_legacy(certid); - conf_set_str(conf, CONF_cert_certid, certid); + conf_set_str(conf, CONF_cert_fingerprint, certid); #endif // PUTTY_CAC gppb(sesskey, "BackspaceIsDelete", true, conf, CONF_bksp_is_delete); gppb(sesskey, "RXVTHomeEnd", false, conf, CONF_rxvt_homeend); gppi(sesskey, "LinuxFunctionKeys", 0, conf, CONF_funky_type); + gppi(sesskey, "ShiftedArrowKeys", SHARROW_APPLICATION, conf, + CONF_sharrow_type); gppb(sesskey, "NoApplicationKeys", false, conf, CONF_no_applic_k); gppb(sesskey, "NoApplicationCursors", false, conf, CONF_no_applic_c); gppb(sesskey, "NoMouseReporting", false, conf, CONF_no_mouse_rep); @@ -1260,6 +1264,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf) i = gppi_raw(sesskey, "BugOldGex2", 0); conf_set_int(conf, CONF_sshbug_oldgex2, 2-i); i = gppi_raw(sesskey, "BugWinadj", 0); conf_set_int(conf, CONF_sshbug_winadj, 2-i); i = gppi_raw(sesskey, "BugChanReq", 0); conf_set_int(conf, CONF_sshbug_chanreq, 2-i); + i = gppi_raw(sesskey, "BugDropStart", 1); conf_set_int(conf, CONF_sshbug_dropstart, 2-i); conf_set_bool(conf, CONF_ssh_simple, false); gppb(sesskey, "StampUtmp", true, conf, CONF_stamp_utmp); gppb(sesskey, "LoginShell", true, conf, CONF_login_shell); @@ -1318,6 +1323,8 @@ static int sessioncmp(const void *av, const void *bv) return strcmp(a, b); /* otherwise, compare normally */ } +bool sesslist_demo_mode = false; + void get_sesslist(struct sesslist *list, bool allocate) { int i; @@ -1327,12 +1334,18 @@ void get_sesslist(struct sesslist *list, bool allocate) if (allocate) { strbuf *sb = strbuf_new(); - if ((handle = enum_settings_start()) != NULL) { - while (enum_settings_next(handle, sb)) - put_byte(sb, '\0'); - enum_settings_finish(handle); + if (sesslist_demo_mode) { + put_asciz(sb, "demo-server"); + put_asciz(sb, "demo-server-2"); + } else { + if ((handle = enum_settings_start()) != NULL) { + while (enum_settings_next(handle, sb)) + put_byte(sb, '\0'); + enum_settings_finish(handle); + } + put_byte(sb, '\0'); } - put_byte(sb, '\0'); + list->buffer = strbuf_to_str(sb); /* diff --git a/code/sign.sh b/code/sign.sh index f330032..b40c2d4 100644 --- a/code/sign.sh +++ b/code/sign.sh @@ -9,14 +9,14 @@ set -e -keyname=38BA7229B7588FD1 +keyname=B43979F89F446CFD preliminary=false while :; do case "$1" in -r) shift - keyname=6289A25F4AE8DA82 + keyname=E4F83EA2AA4915EC ;; -p) shift diff --git a/code/ssh.h b/code/ssh.h index 49ab279..10c40a2 100644 --- a/code/ssh.h +++ b/code/ssh.h @@ -299,9 +299,15 @@ struct ConnectionLayerVtable { * subsequent channel-opens). */ void (*enable_x_fwd)(ConnectionLayer *cl); - /* Communicate to the connection layer whether the main session - * channel currently wants user input. */ + /* Communicate / query whether the main session channel currently + * wants user input. The set function is called by mainchan; the + * query function is called by the top-level ssh.c. */ void (*set_wants_user_input)(ConnectionLayer *cl, bool wanted); + bool (*get_wants_user_input)(ConnectionLayer *cl); + + /* Notify the connection layer that more data has been added to + * the user input queue. */ + void (*got_user_input)(ConnectionLayer *cl); }; struct ConnectionLayer { @@ -371,6 +377,10 @@ static inline void ssh_enable_x_fwd(ConnectionLayer *cl) { cl->vt->enable_x_fwd(cl); } static inline void ssh_set_wants_user_input(ConnectionLayer *cl, bool wanted) { cl->vt->set_wants_user_input(cl, wanted); } +static inline bool ssh_get_wants_user_input(ConnectionLayer *cl) +{ return cl->vt->get_wants_user_input(cl); } +static inline void ssh_got_user_input(ConnectionLayer *cl) +{ cl->vt->got_user_input(cl); } /* Exports from portfwd.c */ PortFwdManager *portfwdmgr_new(ConnectionLayer *cl); @@ -397,11 +407,13 @@ LogContext *ssh_get_logctx(Ssh *ssh); void ssh_throttle_conn(Ssh *ssh, int adjust); void ssh_got_exitcode(Ssh *ssh, int status); void ssh_ldisc_update(Ssh *ssh); +void ssh_check_sendok(Ssh *ssh); void ssh_got_fallback_cmd(Ssh *ssh); bool ssh_is_bare(Ssh *ssh); /* Communications back to ssh.c from the BPP */ void ssh_conn_processed_data(Ssh *ssh); +void ssh_sendbuffer_changed(Ssh *ssh); void ssh_check_frozen(Ssh *ssh); /* Functions to abort the connection, for various reasons. */ @@ -411,6 +423,7 @@ void ssh_proto_error(Ssh *ssh, const char *fmt, ...) PRINTF_LIKE(2, 3); void ssh_sw_abort(Ssh *ssh, const char *fmt, ...) PRINTF_LIKE(2, 3); void ssh_sw_abort_deferred(Ssh *ssh, const char *fmt, ...) PRINTF_LIKE(2, 3); void ssh_user_close(Ssh *ssh, const char *fmt, ...) PRINTF_LIKE(2, 3); +void ssh_spr_close(Ssh *ssh, SeatPromptResult spr, const char *context); /* Bit positions in the SSH-1 cipher protocol word */ #define SSH1_CIPHER_IDEA 1 @@ -446,7 +459,7 @@ struct RSAKey { ssh_key sshk; }; -struct dss_key { +struct dsa_key { mp_int *p, *q, *g, *y, *x; ssh_key sshk; }; @@ -518,12 +531,18 @@ struct ecdsa_key { WeierstrassPoint *publicKey; mp_int *privateKey; ssh_key sshk; +#ifdef PUTTY_CAC + char* appid; +#endif }; struct eddsa_key { const struct ec_curve *curve; EdwardsPoint *publicKey; mp_int *privateKey; ssh_key sshk; +#ifdef PUTTY_CAC + char* appid; +#endif }; WeierstrassPoint *ecdsa_public(mp_int *private_key, const ssh_keyalg *alg); @@ -614,7 +633,7 @@ mp_int *ssh_ecdhkex_getkey(ecdh_key *key, ptrlen remoteKey); /* * Helper function for k generation in DSA, reused in ECDSA */ -mp_int *dss_gen_k(const char *id_string, +mp_int *dsa_gen_k(const char *id_string, mp_int *modulus, mp_int *private_key, unsigned char *digest, int digest_len); @@ -722,7 +741,7 @@ static inline const char *ssh2_mac_text_name(ssh2_mac *m) static inline const ssh2_macalg *ssh2_mac_alg(ssh2_mac *m) { return m->vt; } -/* Centralised 'methods' for ssh2_mac, defined in sshmac.c. These run +/* Centralised 'methods' for ssh2_mac, defined in mac.c. These run * the MAC in a specifically SSH-2 style, i.e. taking account of a * packet sequence number as well as the data to be authenticated. */ bool ssh2_mac_verresult(ssh2_mac *, const void *); @@ -953,22 +972,28 @@ extern const ssh_cipheralg ssh_3des_ssh2; extern const ssh_cipheralg ssh_des; extern const ssh_cipheralg ssh_des_sshcom_ssh2; extern const ssh_cipheralg ssh_aes256_sdctr; -extern const ssh_cipheralg ssh_aes256_sdctr_hw; +extern const ssh_cipheralg ssh_aes256_sdctr_ni; +extern const ssh_cipheralg ssh_aes256_sdctr_neon; extern const ssh_cipheralg ssh_aes256_sdctr_sw; extern const ssh_cipheralg ssh_aes256_cbc; -extern const ssh_cipheralg ssh_aes256_cbc_hw; +extern const ssh_cipheralg ssh_aes256_cbc_ni; +extern const ssh_cipheralg ssh_aes256_cbc_neon; extern const ssh_cipheralg ssh_aes256_cbc_sw; extern const ssh_cipheralg ssh_aes192_sdctr; -extern const ssh_cipheralg ssh_aes192_sdctr_hw; +extern const ssh_cipheralg ssh_aes192_sdctr_ni; +extern const ssh_cipheralg ssh_aes192_sdctr_neon; extern const ssh_cipheralg ssh_aes192_sdctr_sw; extern const ssh_cipheralg ssh_aes192_cbc; -extern const ssh_cipheralg ssh_aes192_cbc_hw; +extern const ssh_cipheralg ssh_aes192_cbc_ni; +extern const ssh_cipheralg ssh_aes192_cbc_neon; extern const ssh_cipheralg ssh_aes192_cbc_sw; extern const ssh_cipheralg ssh_aes128_sdctr; -extern const ssh_cipheralg ssh_aes128_sdctr_hw; +extern const ssh_cipheralg ssh_aes128_sdctr_ni; +extern const ssh_cipheralg ssh_aes128_sdctr_neon; extern const ssh_cipheralg ssh_aes128_sdctr_sw; extern const ssh_cipheralg ssh_aes128_cbc; -extern const ssh_cipheralg ssh_aes128_cbc_hw; +extern const ssh_cipheralg ssh_aes128_cbc_ni; +extern const ssh_cipheralg ssh_aes128_cbc_neon; extern const ssh_cipheralg ssh_aes128_cbc_sw; extern const ssh_cipheralg ssh_blowfish_ssh2_ctr; extern const ssh_cipheralg ssh_blowfish_ssh2; @@ -983,16 +1008,18 @@ extern const ssh2_ciphers ssh2_arcfour; extern const ssh2_ciphers ssh2_ccp; extern const ssh_hashalg ssh_md5; extern const ssh_hashalg ssh_sha1; -extern const ssh_hashalg ssh_sha1_hw; +extern const ssh_hashalg ssh_sha1_ni; +extern const ssh_hashalg ssh_sha1_neon; extern const ssh_hashalg ssh_sha1_sw; extern const ssh_hashalg ssh_sha256; -extern const ssh_hashalg ssh_sha256_hw; +extern const ssh_hashalg ssh_sha256_ni; +extern const ssh_hashalg ssh_sha256_neon; extern const ssh_hashalg ssh_sha256_sw; extern const ssh_hashalg ssh_sha384; -extern const ssh_hashalg ssh_sha384_hw; +extern const ssh_hashalg ssh_sha384_neon; extern const ssh_hashalg ssh_sha384_sw; extern const ssh_hashalg ssh_sha512; -extern const ssh_hashalg ssh_sha512_hw; +extern const ssh_hashalg ssh_sha512_neon; extern const ssh_hashalg ssh_sha512_sw; extern const ssh_hashalg ssh_sha3_224; extern const ssh_hashalg ssh_sha3_256; @@ -1003,6 +1030,9 @@ extern const ssh_hashalg ssh_blake2b; extern const ssh_kexes ssh_diffiehellman_group1; extern const ssh_kexes ssh_diffiehellman_group14; extern const ssh_kexes ssh_diffiehellman_gex; +extern const ssh_kex ssh_diffiehellman_group1_sha1; +extern const ssh_kex ssh_diffiehellman_group14_sha256; +extern const ssh_kex ssh_diffiehellman_group14_sha1; extern const ssh_kexes ssh_gssk5_sha1_kex; extern const ssh_kexes ssh_rsa_kex; extern const ssh_kex ssh_ec_kex_curve25519; @@ -1011,7 +1041,7 @@ extern const ssh_kex ssh_ec_kex_nistp256; extern const ssh_kex ssh_ec_kex_nistp384; extern const ssh_kex ssh_ec_kex_nistp521; extern const ssh_kexes ssh_ecdh_kex; -extern const ssh_keyalg ssh_dss; +extern const ssh_keyalg ssh_dsa; extern const ssh_keyalg ssh_rsa; extern const ssh_keyalg ssh_rsa_sha256; extern const ssh_keyalg ssh_rsa_sha512; @@ -1020,6 +1050,12 @@ extern const ssh_keyalg ssh_ecdsa_ed448; extern const ssh_keyalg ssh_ecdsa_nistp256; extern const ssh_keyalg ssh_ecdsa_nistp384; extern const ssh_keyalg ssh_ecdsa_nistp521; +#ifdef PUTTY_CAC +extern const ssh_keyalg ssh_ecdsa_nistp256_sk; +extern const ssh_keyalg ssh_ecdsa_nistp384_sk; +extern const ssh_keyalg ssh_ecdsa_nistp521_sk; +extern const ssh_keyalg ssh_ecdsa_ed25519_sk; +#endif extern const ssh2_macalg ssh_hmac_md5; extern const ssh2_macalg ssh_hmac_sha1; extern const ssh2_macalg ssh_hmac_sha1_buggy; @@ -1039,10 +1075,10 @@ ssh_hash *blake2b_new_general(unsigned hashlen); * itself. If so, then this function should be implemented in each * platform subdirectory. */ -bool platform_aes_hw_available(void); -bool platform_sha256_hw_available(void); -bool platform_sha1_hw_available(void); -bool platform_sha512_hw_available(void); +bool platform_aes_neon_available(void); +bool platform_sha256_neon_available(void); +bool platform_sha1_neon_available(void); +bool platform_sha512_neon_available(void); /* * PuTTY version number formatted as an SSH version string. @@ -1051,13 +1087,13 @@ extern const char sshver[]; /* * Gross hack: pscp will try to start SFTP but fall back to scp1 if - * that fails. This variable is the means by which scp.c can reach + * that fails. This variable is the means by which pscp.c can reach * into the SSH code and find out which one it got. */ extern bool ssh_fallback_cmd(Backend *backend); /* - * The PRNG type, defined in sshprng.c. Visible data fields are + * The PRNG type, defined in prng.c. Visible data fields are * 'savesize', which suggests how many random bytes you should request * from a particular PRNG instance to write to putty.rnd, and a * BinarySink implementation which you can use to write seed data in @@ -1066,7 +1102,7 @@ extern bool ssh_fallback_cmd(Backend *backend); struct prng { size_t savesize; BinarySink_IMPLEMENTATION; - /* (also there's a surrounding implementation struct in sshprng.c) */ + /* (also there's a surrounding implementation struct in prng.c) */ }; prng *prng_new(const ssh_hashalg *hashalg); void prng_free(prng *p); @@ -1137,10 +1173,6 @@ struct X11FakeAuth { ssh_sharing_connstate *share_cs; share_channel *share_chan; }; -void *x11_make_greeting(int endian, int protomajor, int protominor, - int auth_proto, const void *auth_data, int auth_len, - const char *peer_ip, int peer_port, - int *outlen); int x11_authcmp(void *av, void *bv); /* for putting X11FakeAuth in a tree234 */ /* * x11_setup_display() parses the display variable and fills in an @@ -1170,7 +1202,7 @@ SockAddr *platform_get_x11_unix_address(const char *path, int displaynum); /* make up a SockAddr naming the address for displaynum */ char *platform_get_x_display(void); /* allocated local X display string, if any */ -/* Callbacks in x11.c usable _by_ platform X11 functions */ +/* X11-related helper functions in utils */ /* * This function does the job of platform_get_x11_auth, provided * it is told where to find a normally formatted .Xauthority file: @@ -1189,8 +1221,13 @@ void x11_get_auth_from_authfile(struct X11Display *display, void x11_format_auth_for_authfile( BinarySink *bs, SockAddr *addr, int display_no, ptrlen authproto, ptrlen authdata); +void *x11_make_greeting(int endian, int protomajor, int protominor, + int auth_proto, const void *auth_data, int auth_len, + const char *peer_ip, int peer_port, + int *outlen); int x11_identify_auth_proto(ptrlen protoname); void *x11_dehexify(ptrlen hex, int *outlen); +bool x11_parse_ip(const char *addr_string, unsigned long *ip); Channel *agentf_new(SshChannel *c); @@ -1199,7 +1236,7 @@ dh_ctx *dh_setup_group(const ssh_kex *kex); dh_ctx *dh_setup_gex(mp_int *pval, mp_int *gval); int dh_modulus_bit_size(const dh_ctx *ctx); void dh_cleanup(dh_ctx *); -mp_int *dh_create_e(dh_ctx *, int nbits); +mp_int *dh_create_e(dh_ctx *); const char *dh_validate_f(dh_ctx *, mp_int *f); mp_int *dh_find_K(dh_ctx *, mp_int *f); @@ -1389,8 +1426,7 @@ void aes256_decrypt_pubkey(const void *key, const void *iv, void des_encrypt_xdmauth(const void *key, void *blk, int len); void des_decrypt_xdmauth(const void *key, void *blk, int len); -void openssh_bcrypt(const char *passphrase, - const unsigned char *salt, int saltbytes, +void openssh_bcrypt(ptrlen passphrase, ptrlen salt, int rounds, unsigned char *out, int outbytes); /* @@ -1603,7 +1639,7 @@ enum { /* TTY modes with opcodes defined consistently in the SSH specs. */ #define TTYMODE_CHAR(name, val, index) SSH_TTYMODE_##name = val, #define TTYMODE_FLAG(name, val, field, mask) SSH_TTYMODE_##name = val, - #include "sshttymodes.h" + #include "ssh/ttymode-list.h" #undef TTYMODE_CHAR #undef TTYMODE_FLAG @@ -1686,7 +1722,11 @@ unsigned alloc_channel_id_general(tree234 *channels, size_t localid_offset); void add_to_commasep(strbuf *buf, const char *data); bool get_commasep_word(ptrlen *list, ptrlen *word); -int verify_ssh_manual_host_key(Conf *conf, char **fingerprints, ssh_key *key); +SeatPromptResult verify_ssh_host_key( + InteractionReadySeat iseat, Conf *conf, const char *host, int port, + ssh_key *key, const char *keytype, char *keystr, const char *keydisp, + char **fingerprints, void (*callback)(void *ctx, SeatPromptResult result), + void *ctx); typedef struct ssh_transient_hostkey_cache ssh_transient_hostkey_cache; ssh_transient_hostkey_cache *ssh_transient_hostkey_cache_new(void); diff --git a/code/ssh/CMakeLists.txt b/code/ssh/CMakeLists.txt new file mode 100644 index 0000000..4b0e03f --- /dev/null +++ b/code/ssh/CMakeLists.txt @@ -0,0 +1,51 @@ +add_library(sshcommon OBJECT + bpp1.c + bpp2.c + bpp-bare.c + censor1.c + censor2.c + common.c + connection1.c + connection2.c + crc-attack-detector.c + gssc.c + login1.c + pgssapi.c + portfwd.c + ../sshpubk.c + ../sshrand.c + transient-hostkey-cache.c + transport2.c + verstring.c + x11fwd.c + zlib.c) + +add_library(sftpcommon OBJECT sftpcommon.c) + +add_library(sshclient STATIC + agentf.c + connection1-client.c + connection2-client.c + kex2-client.c + mainchan.c + sharing.c + ssh.c + userauth2-client.c + $ + $ + $) + +add_library(sshserver STATIC + connection1-server.c + connection2-server.c + kex2-server.c + login1-server.c + server.c + sesschan.c + sftpserver.c + userauth2-server.c + $ + $) + +add_sources_from_current_dir(sftpclient sftp.c) +target_sources(sftpclient PRIVATE $) diff --git a/code/agentf.c b/code/ssh/agentf.c similarity index 99% rename from code/agentf.c rename to code/ssh/agentf.c index dc5bec0..6a5ecee 100644 --- a/code/agentf.c +++ b/code/ssh/agentf.c @@ -9,7 +9,7 @@ #include "putty.h" #include "ssh.h" #include "pageant.h" -#include "sshchan.h" +#include "channel.h" typedef struct agentf { SshChannel *c; diff --git a/code/ssh2bpp-bare.c b/code/ssh/bpp-bare.c similarity index 97% rename from code/ssh2bpp-bare.c rename to code/ssh/bpp-bare.c index 90f196e..f1a889a 100644 --- a/code/ssh2bpp-bare.c +++ b/code/ssh/bpp-bare.c @@ -7,7 +7,7 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" +#include "bpp.h" #include "sshcr.h" struct ssh2_bare_bpp_state { @@ -30,9 +30,9 @@ static const BinaryPacketProtocolVtable ssh2_bare_bpp_vtable = { .handle_input = ssh2_bare_bpp_handle_input, .handle_output = ssh2_bare_bpp_handle_output, .new_pktout = ssh2_bare_bpp_new_pktout, - .queue_disconnect = ssh2_bpp_queue_disconnect, /* in sshcommon.c */ + .queue_disconnect = ssh2_bpp_queue_disconnect, /* in common.c */ - /* packet size limit, per protocol spec in sshshare.c comment */ + /* packet size limit, per protocol spec in sharing.c comment */ .packet_size_limit = 0x4000, }; @@ -201,4 +201,6 @@ static void ssh2_bare_bpp_handle_output(BinaryPacketProtocol *bpp) ssh2_bare_bpp_format_packet(s, pkt); ssh_free_pktout(pkt); } + + ssh_sendbuffer_changed(bpp->ssh); } diff --git a/code/sshbpp.h b/code/ssh/bpp.h similarity index 100% rename from code/sshbpp.h rename to code/ssh/bpp.h diff --git a/code/ssh1bpp.c b/code/ssh/bpp1.c similarity index 99% rename from code/ssh1bpp.c rename to code/ssh/bpp1.c index 46eccbe..b82932f 100644 --- a/code/ssh1bpp.c +++ b/code/ssh/bpp1.c @@ -6,7 +6,7 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" +#include "bpp.h" #include "sshcr.h" struct ssh1_bpp_state { @@ -376,6 +376,8 @@ static void ssh1_bpp_handle_output(BinaryPacketProtocol *bpp) break; } } + + ssh_sendbuffer_changed(bpp->ssh); } static void ssh1_bpp_queue_disconnect(BinaryPacketProtocol *bpp, diff --git a/code/ssh2bpp.c b/code/ssh/bpp2.c similarity index 99% rename from code/ssh2bpp.c rename to code/ssh/bpp2.c index 09b23e5..dc98e27 100644 --- a/code/ssh2bpp.c +++ b/code/ssh/bpp2.c @@ -6,7 +6,7 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" +#include "bpp.h" #include "sshcr.h" struct ssh2_bpp_direction { @@ -54,7 +54,7 @@ static const BinaryPacketProtocolVtable ssh2_bpp_vtable = { .handle_input = ssh2_bpp_handle_input, .handle_output = ssh2_bpp_handle_output, .new_pktout = ssh2_bpp_new_pktout, - .queue_disconnect = ssh2_bpp_queue_disconnect, /* in sshcommon.c */ + .queue_disconnect = ssh2_bpp_queue_disconnect, /* in common.c */ .packet_size_limit = 0xFFFFFFFF, /* no special limit for this bpp */ }; @@ -979,4 +979,6 @@ static void ssh2_bpp_handle_output(BinaryPacketProtocol *bpp) ssh2_bpp_enable_pending_compression(s); } } + + ssh_sendbuffer_changed(bpp->ssh); } diff --git a/code/ssh1censor.c b/code/ssh/censor1.c similarity index 100% rename from code/ssh1censor.c rename to code/ssh/censor1.c diff --git a/code/ssh2censor.c b/code/ssh/censor2.c similarity index 100% rename from code/ssh2censor.c rename to code/ssh/censor2.c diff --git a/code/sshchan.h b/code/ssh/channel.h similarity index 100% rename from code/sshchan.h rename to code/ssh/channel.h diff --git a/code/sshcommon.c b/code/ssh/common.c similarity index 85% rename from code/sshcommon.c rename to code/ssh/common.c index 5485e33..0c9f51e 100644 --- a/code/sshcommon.c +++ b/code/ssh/common.c @@ -9,9 +9,10 @@ #include "putty.h" #include "mpint.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "storage.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" /* ---------------------------------------------------------------------- * Implementation of PacketQueue. @@ -407,7 +408,7 @@ struct ssh_ttymodes get_ttymodes_from_conf(Seat *seat, Conf *conf) } modes_names_types[] = { #define TTYMODE_CHAR(name, val, index) { #name, val, TYPE_CHAR }, #define TTYMODE_FLAG(name, val, field, mask) { #name, val, TYPE_BOOL }, - #include "sshttymodes.h" + #include "ttymode-list.h" #undef TTYMODE_CHAR #undef TTYMODE_FLAG }; @@ -682,7 +683,6 @@ void ssh_ppl_replace(PacketProtocolLayer *old, PacketProtocolLayer *new) new->bpp = old->bpp; ssh_ppl_setup_queues(new, old->in_pq, old->out_pq); new->selfptr = old->selfptr; - new->user_input = old->user_input; new->seat = old->seat; new->ssh = old->ssh; @@ -737,6 +737,19 @@ size_t ssh_ppl_default_queued_data_size(PacketProtocolLayer *ppl) return ppl->out_pq->pqb.total_size; } +static void ssh_ppl_prompts_callback(void *ctx) +{ + ssh_ppl_process_queue((PacketProtocolLayer *)ctx); +} + +prompts_t *ssh_ppl_new_prompts(PacketProtocolLayer *ppl) +{ + prompts_t *p = new_prompts(); + p->callback = ssh_ppl_prompts_callback; + p->callback_ctx = ppl; + return p; +} + /* ---------------------------------------------------------------------- * Common helper functions for clients and implementations of * BinaryPacketProtocol. @@ -786,8 +799,10 @@ void ssh2_bpp_queue_disconnect(BinaryPacketProtocol *bpp, pq_push(&bpp->out_pq, pkt); } -#define BITMAP_UNIVERSAL(y, name, value) \ - | (value >= y && value < y+32 ? 1UL << (value-y) : 0) +#define BITMAP_UNIVERSAL(y, name, value) \ + | (value >= y && value < y+32 \ + ? 1UL << (value >= y && value < y+32 ? (value-y) : 0) \ + : 0) #define BITMAP_CONDITIONAL(y, name, value, ctx) \ BITMAP_UNIVERSAL(y, name, value) #define SSH2_BITMAP_WORD(y) \ @@ -823,58 +838,91 @@ bool ssh2_bpp_check_unimplemented(BinaryPacketProtocol *bpp, PktIn *pktin) #undef SSH1_BITMAP_WORD /* ---------------------------------------------------------------------- - * Function to check a host key against any manually configured in Conf. + * Centralised component of SSH host key verification. + * + * verify_ssh_host_key is called from both the SSH-1 and SSH-2 + * transport layers, and does the initial work of checking whether the + * host key is already known. If so, it returns success on its own + * account; otherwise, it calls out to the Seat to give an interactive + * prompt (the nature of which varies depending on the Seat itself). */ -int verify_ssh_manual_host_key(Conf *conf, char **fingerprints, ssh_key *key) +SeatPromptResult verify_ssh_host_key( + InteractionReadySeat iseat, Conf *conf, const char *host, int port, + ssh_key *key, const char *keytype, char *keystr, const char *keydisp, + char **fingerprints, void (*callback)(void *ctx, SeatPromptResult result), + void *ctx) { - if (!conf_get_str_nthstrkey(conf, CONF_ssh_manual_hostkeys, 0)) - return -1; /* no manual keys configured */ + /* + * First, check if the Conf includes a manual specification of the + * expected host key. If so, that completely supersedes everything + * else, including the normal host key cache _and_ including + * manual overrides: we return success or failure immediately, + * entirely based on whether the key matches the Conf. + */ + if (conf_get_str_nthstrkey(conf, CONF_ssh_manual_hostkeys, 0)) { + if (fingerprints) { + for (size_t i = 0; i < SSH_N_FPTYPES; i++) { + /* + * Each fingerprint string we've been given will have + * things like 'ssh-rsa 2048' at the front of it. Strip + * those off and narrow down to just the hash at the end + * of the string. + */ + const char *fingerprint = fingerprints[i]; + if (!fingerprint) + continue; + const char *p = strrchr(fingerprint, ' '); + fingerprint = p ? p+1 : fingerprint; + if (conf_get_str_str_opt(conf, CONF_ssh_manual_hostkeys, + fingerprint)) + return SPR_OK; + } + } - if (fingerprints) { - for (size_t i = 0; i < SSH_N_FPTYPES; i++) { + if (key) { /* - * Each fingerprint string we've been given will have - * things like 'ssh-rsa 2048' at the front of it. Strip - * those off and narrow down to just the hash at the end - * of the string. + * Construct the base64-encoded public key blob and see if + * that's listed. */ - const char *fingerprint = fingerprints[i]; - if (!fingerprint) - continue; - const char *p = strrchr(fingerprint, ' '); - fingerprint = p ? p+1 : fingerprint; + strbuf *binblob; + char *base64blob; + int atoms, i; + binblob = strbuf_new(); + ssh_key_public_blob(key, BinarySink_UPCAST(binblob)); + atoms = (binblob->len + 2) / 3; + base64blob = snewn(atoms * 4 + 1, char); + for (i = 0; i < atoms; i++) + base64_encode_atom(binblob->u + 3*i, + binblob->len - 3*i, base64blob + 4*i); + base64blob[atoms * 4] = '\0'; + strbuf_free(binblob); if (conf_get_str_str_opt(conf, CONF_ssh_manual_hostkeys, - fingerprint)) - return 1; /* success */ - } - } - - if (key) { - /* - * Construct the base64-encoded public key blob and see if - * that's listed. - */ - strbuf *binblob; - char *base64blob; - int atoms, i; - binblob = strbuf_new(); - ssh_key_public_blob(key, BinarySink_UPCAST(binblob)); - atoms = (binblob->len + 2) / 3; - base64blob = snewn(atoms * 4 + 1, char); - for (i = 0; i < atoms; i++) - base64_encode_atom(binblob->u + 3*i, - binblob->len - 3*i, base64blob + 4*i); - base64blob[atoms * 4] = '\0'; - strbuf_free(binblob); - if (conf_get_str_str_opt(conf, CONF_ssh_manual_hostkeys, base64blob)) { + base64blob)) { + sfree(base64blob); + return SPR_OK; + } sfree(base64blob); - return 1; /* success */ } - sfree(base64blob); + + return SPR_SW_ABORT("Host key not in manually configured list"); } - return 0; + /* + * Next, check the host key cache. + */ + int storage_status = check_stored_host_key(host, port, keytype, keystr); + if (storage_status == 0) /* matching key was found in the cache */ + return SPR_OK; + + /* + * The key is either missing from the cache, or does not match. + * Either way, fall back to an interactive prompt from the Seat. + */ + bool mismatch = (storage_status != 1); + return seat_confirm_ssh_host_key( + iseat, host, port, keytype, keystr, keydisp, fingerprints, mismatch, + callback, ctx); } /* ---------------------------------------------------------------------- @@ -944,3 +992,22 @@ void ssh1_compute_session_id( put_data(hash, cookie, 8); ssh_hash_final(hash, session_id); } + +/* ---------------------------------------------------------------------- + * Wrapper function to handle the abort-connection modes of a + * SeatPromptResult without a lot of verbiage at every call site. + * + * Can become ssh_sw_abort or ssh_user_close, depending on the kind of + * negative SeatPromptResult. + */ +void ssh_spr_close(Ssh *ssh, SeatPromptResult spr, const char *context) +{ + if (spr.kind == SPRK_USER_ABORT) { + ssh_user_close(ssh, "User aborted at %s", context); + } else { + assert(spr.kind == SPRK_SW_ABORT); + char *err = spr_get_error_message(spr); + ssh_sw_abort(ssh, "%s", err); + sfree(err); + } +} diff --git a/code/ssh1connection-client.c b/code/ssh/connection1-client.c similarity index 98% rename from code/ssh1connection-client.c rename to code/ssh/connection1-client.c index cf7dd04..41bf971 100644 --- a/code/ssh1connection-client.c +++ b/code/ssh/connection1-client.c @@ -6,11 +6,11 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #include "sshcr.h" -#include "ssh1connection.h" +#include "connection1.h" void ssh1_connection_direction_specific_setup( struct ssh1_connection_state *s) @@ -543,5 +543,10 @@ SshChannel *ssh1_serverside_agent_open(ConnectionLayer *cl, Channel *chan) bool ssh1_connection_need_antispoof_prompt(struct ssh1_connection_state *s) { - return !seat_set_trust_status(s->ppl.seat, false); + seat_set_trust_status(s->ppl.seat, false); + if (!seat_has_mixed_input_stream(s->ppl.seat)) + return false; + if (seat_can_set_trust_status(s->ppl.seat)) + return false; + return true; } diff --git a/code/ssh1connection-server.c b/code/ssh/connection1-server.c similarity index 99% rename from code/ssh1connection-server.c rename to code/ssh/connection1-server.c index 4d55abe..1123327 100644 --- a/code/ssh1connection-server.c +++ b/code/ssh/connection1-server.c @@ -6,12 +6,12 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #include "sshcr.h" -#include "ssh1connection.h" -#include "sshserver.h" +#include "connection1.h" +#include "server.h" static size_t ssh1sesschan_write(SshChannel *c, bool is_stderr, const void *, size_t); diff --git a/code/ssh1connection.c b/code/ssh/connection1.c similarity index 95% rename from code/ssh1connection.c rename to code/ssh/connection1.c index d805dd2..0b5485f 100644 --- a/code/ssh1connection.c +++ b/code/ssh/connection1.c @@ -7,11 +7,11 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #include "sshcr.h" -#include "ssh1connection.h" +#include "connection1.h" static int ssh1_rportfwd_cmp(void *av, void *bv) { @@ -31,8 +31,6 @@ static void ssh1_connection_free(PacketProtocolLayer *); static void ssh1_connection_process_queue(PacketProtocolLayer *); static void ssh1_connection_special_cmd(PacketProtocolLayer *ppl, SessionSpecialCode code, int arg); -static bool ssh1_connection_want_user_input(PacketProtocolLayer *ppl); -static void ssh1_connection_got_user_input(PacketProtocolLayer *ppl); static void ssh1_connection_reconfigure(PacketProtocolLayer *ppl, Conf *conf); static const PacketProtocolLayerVtable ssh1_connection_vtable = { @@ -40,8 +38,6 @@ static const PacketProtocolLayerVtable ssh1_connection_vtable = { .process_queue = ssh1_connection_process_queue, .get_specials = ssh1_common_get_specials, .special_cmd = ssh1_connection_special_cmd, - .want_user_input = ssh1_connection_want_user_input, - .got_user_input = ssh1_connection_got_user_input, .reconfigure = ssh1_connection_reconfigure, .queued_data_size = ssh_ppl_default_queued_data_size, .name = NULL, /* no layer names in SSH-1 */ @@ -63,6 +59,8 @@ static bool ssh1_ldisc_option(ConnectionLayer *cl, int option); static void ssh1_set_ldisc_option(ConnectionLayer *cl, int option, bool value); static void ssh1_enable_x_fwd(ConnectionLayer *cl); static void ssh1_set_wants_user_input(ConnectionLayer *cl, bool wanted); +static bool ssh1_get_wants_user_input(ConnectionLayer *cl); +static void ssh1_got_user_input(ConnectionLayer *cl); static const ConnectionLayerVtable ssh1_connlayer_vtable = { .rportfwd_alloc = ssh1_rportfwd_alloc, @@ -81,6 +79,8 @@ static const ConnectionLayerVtable ssh1_connlayer_vtable = { .set_ldisc_option = ssh1_set_ldisc_option, .enable_x_fwd = ssh1_enable_x_fwd, .set_wants_user_input = ssh1_set_wants_user_input, + .get_wants_user_input = ssh1_get_wants_user_input, + .got_user_input = ssh1_got_user_input, /* other methods are NULL */ }; @@ -138,7 +138,7 @@ void ssh1_channel_free(struct ssh1_channel *c) } PacketProtocolLayer *ssh1_connection_new( - Ssh *ssh, Conf *conf, ConnectionLayer **cl_out) + Ssh *ssh, Conf *conf, bufchain *user_input, ConnectionLayer **cl_out) { struct ssh1_connection_state *s = snew(struct ssh1_connection_state); memset(s, 0, sizeof(*s)); @@ -150,6 +150,8 @@ PacketProtocolLayer *ssh1_connection_new( s->x11authtree = newtree234(x11_authcmp); + s->user_input = user_input; + /* Need to get the log context for s->cl now, because we won't be * helpfully notified when a copy is written into s->ppl by our * owner. */ @@ -370,7 +372,7 @@ static void ssh1_connection_process_queue(PacketProtocolLayer *ppl) * connection-sharing downstream). */ if (ssh1_connection_need_antispoof_prompt(s)) { - s->antispoof_prompt = new_prompts(); + s->antispoof_prompt = ssh_ppl_new_prompts(&s->ppl); s->antispoof_prompt->to_server = true; s->antispoof_prompt->from_server = false; s->antispoof_prompt->name = dupstr("Authentication successful"); @@ -378,19 +380,11 @@ static void ssh1_connection_process_queue(PacketProtocolLayer *ppl) s->antispoof_prompt, dupstr("Access granted. Press Return to begin session. "), false); s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt, NULL); - while (1) { - while (s->antispoof_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt, s->ppl.user_input); - - if (s->antispoof_ret >= 0) - break; - - s->want_user_input = true; + ppl_get_iseat(&s->ppl), s->antispoof_prompt); + while (s->antispoof_ret.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->antispoof_ret = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->antispoof_prompt); } free_prompts(s->antispoof_prompt); s->antispoof_prompt = NULL; @@ -775,30 +769,32 @@ static void ssh1_set_wants_user_input(ConnectionLayer *cl, bool wanted) s->want_user_input = wanted; s->finished_setup = true; + if (wanted) + ssh_check_sendok(s->ppl.ssh); } -static bool ssh1_connection_want_user_input(PacketProtocolLayer *ppl) +static bool ssh1_get_wants_user_input(ConnectionLayer *cl) { struct ssh1_connection_state *s = - container_of(ppl, struct ssh1_connection_state, ppl); + container_of(cl, struct ssh1_connection_state, cl); return s->want_user_input; } -static void ssh1_connection_got_user_input(PacketProtocolLayer *ppl) +static void ssh1_got_user_input(ConnectionLayer *cl) { struct ssh1_connection_state *s = - container_of(ppl, struct ssh1_connection_state, ppl); + container_of(cl, struct ssh1_connection_state, cl); - while (s->mainchan && bufchain_size(s->ppl.user_input) > 0) { + while (s->mainchan && bufchain_size(s->user_input) > 0) { /* * Add user input to the main channel's buffer. */ - ptrlen data = bufchain_prefix(s->ppl.user_input); + ptrlen data = bufchain_prefix(s->user_input); if (data.len > 512) data.len = 512; sshfwd_write(&s->mainchan_sc, data.ptr, data.len); - bufchain_consume(s->ppl.user_input, data.len); + bufchain_consume(s->user_input, data.len); } } diff --git a/code/ssh1connection.h b/code/ssh/connection1.h similarity index 98% rename from code/ssh1connection.h rename to code/ssh/connection1.h index 4437078..ff37013 100644 --- a/code/ssh1connection.h +++ b/code/ssh/connection1.h @@ -25,6 +25,7 @@ struct ssh1_connection_state { bool want_user_input; bool session_terminated; int term_width, term_height, term_width_orig, term_height_orig; + bufchain *user_input; bool X11_fwd_enabled; struct X11Display *x11disp; @@ -49,7 +50,7 @@ struct ssh1_connection_state { bool sent_exit_status; /* also for server mode */ prompts_t *antispoof_prompt; - int antispoof_ret; + SeatPromptResult antispoof_ret; const SshServerConfig *ssc; diff --git a/code/ssh2connection-client.c b/code/ssh/connection2-client.c similarity index 97% rename from code/ssh2connection-client.c rename to code/ssh/connection2-client.c index 0b13efe..f17d1e2 100644 --- a/code/ssh2connection-client.c +++ b/code/ssh/connection2-client.c @@ -6,11 +6,11 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #include "sshcr.h" -#include "ssh2connection.h" +#include "connection2.h" static ChanopenResult chan_open_x11( struct ssh2_connection_state *s, SshChannel *sc, @@ -500,6 +500,12 @@ void ssh2channel_send_terminal_size_change(SshChannel *sc, int w, int h) bool ssh2_connection_need_antispoof_prompt(struct ssh2_connection_state *s) { - bool success = seat_set_trust_status(s->ppl.seat, false); - return (!success && !ssh_is_bare(s->ppl.ssh)); + seat_set_trust_status(s->ppl.seat, false); + if (!seat_has_mixed_input_stream(s->ppl.seat)) + return false; + if (seat_can_set_trust_status(s->ppl.seat)) + return false; + if (ssh_is_bare(s->ppl.ssh)) + return false; + return true; } diff --git a/code/ssh2connection-server.c b/code/ssh/connection2-server.c similarity index 98% rename from code/ssh2connection-server.c rename to code/ssh/connection2-server.c index 1467db1..c871b4b 100644 --- a/code/ssh2connection-server.c +++ b/code/ssh/connection2-server.c @@ -6,12 +6,12 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #include "sshcr.h" -#include "ssh2connection.h" -#include "sshserver.h" +#include "connection2.h" +#include "server.h" void ssh2connection_server_configure( PacketProtocolLayer *ppl, const SftpServerVtable *sftpserver_vt, diff --git a/code/ssh2connection.c b/code/ssh/connection2.c similarity index 97% rename from code/ssh2connection.c rename to code/ssh/connection2.c index ecb421e..ec33092 100644 --- a/code/ssh2connection.c +++ b/code/ssh/connection2.c @@ -6,11 +6,11 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #include "sshcr.h" -#include "ssh2connection.h" +#include "connection2.h" static void ssh2_connection_free(PacketProtocolLayer *); static void ssh2_connection_process_queue(PacketProtocolLayer *); @@ -18,8 +18,6 @@ static bool ssh2_connection_get_specials( PacketProtocolLayer *ppl, add_special_fn_t add_special, void *ctx); static void ssh2_connection_special_cmd(PacketProtocolLayer *ppl, SessionSpecialCode code, int arg); -static bool ssh2_connection_want_user_input(PacketProtocolLayer *ppl); -static void ssh2_connection_got_user_input(PacketProtocolLayer *ppl); static void ssh2_connection_reconfigure(PacketProtocolLayer *ppl, Conf *conf); static const PacketProtocolLayerVtable ssh2_connection_vtable = { @@ -27,8 +25,6 @@ static const PacketProtocolLayerVtable ssh2_connection_vtable = { .process_queue = ssh2_connection_process_queue, .get_specials = ssh2_connection_get_specials, .special_cmd = ssh2_connection_special_cmd, - .want_user_input = ssh2_connection_want_user_input, - .got_user_input = ssh2_connection_got_user_input, .reconfigure = ssh2_connection_reconfigure, .queued_data_size = ssh_ppl_default_queued_data_size, .name = "ssh-connection", @@ -63,6 +59,8 @@ static bool ssh2_ldisc_option(ConnectionLayer *cl, int option); static void ssh2_set_ldisc_option(ConnectionLayer *cl, int option, bool value); static void ssh2_enable_x_fwd(ConnectionLayer *cl); static void ssh2_set_wants_user_input(ConnectionLayer *cl, bool wanted); +static bool ssh2_get_wants_user_input(ConnectionLayer *cl); +static void ssh2_got_user_input(ConnectionLayer *cl); static const ConnectionLayerVtable ssh2_connlayer_vtable = { .rportfwd_alloc = ssh2_rportfwd_alloc, @@ -88,6 +86,8 @@ static const ConnectionLayerVtable ssh2_connlayer_vtable = { .set_ldisc_option = ssh2_set_ldisc_option, .enable_x_fwd = ssh2_enable_x_fwd, .set_wants_user_input = ssh2_set_wants_user_input, + .get_wants_user_input = ssh2_get_wants_user_input, + .got_user_input = ssh2_got_user_input, }; static char *ssh2_channel_open_failure_error_text(PktIn *pktin) @@ -178,6 +178,7 @@ void ssh2_queue_global_request_handler( snew(struct outstanding_global_request); ogr->handler = handler; ogr->ctx = ctx; + ogr->next = NULL; if (s->globreq_tail) s->globreq_tail->next = ogr; else @@ -239,7 +240,8 @@ static void ssh2_channel_free(struct ssh2_channel *c) PacketProtocolLayer *ssh2_connection_new( Ssh *ssh, ssh_sharing_state *connshare, bool is_simple, - Conf *conf, const char *peer_verstring, ConnectionLayer **cl_out) + Conf *conf, const char *peer_verstring, bufchain *user_input, + ConnectionLayer **cl_out) { struct ssh2_connection_state *s = snew(struct ssh2_connection_state); memset(s, 0, sizeof(*s)); @@ -264,6 +266,8 @@ PacketProtocolLayer *ssh2_connection_new( s->x11authtree = newtree234(x11_authcmp); + s->user_input = user_input; + /* Need to get the log context for s->cl now, because we won't be * helpfully notified when a copy is written into s->ppl by our * owner. */ @@ -369,6 +373,8 @@ static bool ssh2_connection_filter_queue(struct ssh2_connection_state *s) s->globreq_head = s->globreq_head->next; sfree(tmp); } + if (!s->globreq_head) + s->globreq_tail = NULL; pq_pop(s->ppl.in_pq); break; @@ -391,7 +397,7 @@ static bool ssh2_connection_filter_queue(struct ssh2_connection_state *s) * This channel-open request needs to go to a * connection-sharing downstream, so abandon our own * channel-open procedure and just pass the message on - * to sshshare.c. + * to sharing.c. */ share_got_pkt_from_server( chanopen_result.u.downstream.share_ctx, pktin->type, @@ -982,7 +988,7 @@ static void ssh2_connection_process_queue(PacketProtocolLayer *ppl) * connection-sharing downstream). */ if (ssh2_connection_need_antispoof_prompt(s)) { - s->antispoof_prompt = new_prompts(); + s->antispoof_prompt = ssh_ppl_new_prompts(&s->ppl); s->antispoof_prompt->to_server = true; s->antispoof_prompt->from_server = false; s->antispoof_prompt->name = dupstr("Authentication successful"); @@ -990,19 +996,11 @@ static void ssh2_connection_process_queue(PacketProtocolLayer *ppl) s->antispoof_prompt, dupstr("Access granted. Press Return to begin session. "), false); s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt, NULL); - while (1) { - while (s->antispoof_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt, s->ppl.user_input); - - if (s->antispoof_ret >= 0) - break; - - s->want_user_input = true; + ppl_get_iseat(&s->ppl), s->antispoof_prompt); + while (s->antispoof_ret.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->antispoof_ret = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->antispoof_prompt); } free_prompts(s->antispoof_prompt); s->antispoof_prompt = NULL; @@ -1157,6 +1155,7 @@ static size_t ssh2_try_send(struct ssh2_channel *c) if (!bufsize && c->pending_eof) ssh2_channel_try_eof(c); + ssh_sendbuffer_changed(s->ppl.ssh); return bufsize; } @@ -1708,27 +1707,29 @@ static void ssh2_set_wants_user_input(ConnectionLayer *cl, bool wanted) container_of(cl, struct ssh2_connection_state, cl); s->want_user_input = wanted; + if (wanted) + ssh_check_sendok(s->ppl.ssh); } -static bool ssh2_connection_want_user_input(PacketProtocolLayer *ppl) +static bool ssh2_get_wants_user_input(ConnectionLayer *cl) { struct ssh2_connection_state *s = - container_of(ppl, struct ssh2_connection_state, ppl); + container_of(cl, struct ssh2_connection_state, cl); return s->want_user_input; } -static void ssh2_connection_got_user_input(PacketProtocolLayer *ppl) +static void ssh2_got_user_input(ConnectionLayer *cl) { struct ssh2_connection_state *s = - container_of(ppl, struct ssh2_connection_state, ppl); + container_of(cl, struct ssh2_connection_state, cl); - while (s->mainchan && bufchain_size(s->ppl.user_input) > 0) { + while (s->mainchan && bufchain_size(s->user_input) > 0) { /* * Add user input to the main channel's buffer. */ - ptrlen data = bufchain_prefix(s->ppl.user_input); + ptrlen data = bufchain_prefix(s->user_input); sshfwd_write(s->mainchan_sc, data.ptr, data.len); - bufchain_consume(s->ppl.user_input, data.len); + bufchain_consume(s->user_input, data.len); } } diff --git a/code/ssh2connection.h b/code/ssh/connection2.h similarity index 99% rename from code/ssh2connection.h rename to code/ssh/connection2.h index d3bb240..54c3ebf 100644 --- a/code/ssh2connection.h +++ b/code/ssh/connection2.h @@ -16,6 +16,7 @@ struct ssh2_connection_state { int session_attempt, session_status; int term_width, term_height; bool want_user_input; + bufchain *user_input; bool ssh_is_simple; bool persistent; @@ -36,7 +37,7 @@ struct ssh2_connection_state { bool portfwdmgr_configured; prompts_t *antispoof_prompt; - int antispoof_ret; + SeatPromptResult antispoof_ret; const SftpServerVtable *sftpserver_vt; const SshServerConfig *ssc; diff --git a/code/sshcrcda.c b/code/ssh/crc-attack-detector.c similarity index 100% rename from code/sshcrcda.c rename to code/ssh/crc-attack-detector.c diff --git a/code/sshgss.h b/code/ssh/gss.h similarity index 99% rename from code/sshgss.h rename to code/ssh/gss.h index c640636..c819d48 100644 --- a/code/sshgss.h +++ b/code/ssh/gss.h @@ -32,7 +32,7 @@ typedef gss_name_t Ssh_gss_name; #define GSS_DEF_REKEY_MINS 2 /* Default minutes between GSS cache checks */ -/* Functions, provided by either wingss.c or sshgssc.c */ +/* Functions, provided by either {windows,unix}/gss.c or gssc.c */ struct ssh_gss_library; diff --git a/code/sshgssc.c b/code/ssh/gssc.c similarity index 99% rename from code/sshgssc.c rename to code/ssh/gssc.c index d9f62c3..0224afe 100644 --- a/code/sshgssc.c +++ b/code/ssh/gssc.c @@ -2,7 +2,7 @@ #include #include -#include "sshgssc.h" +#include "gssc.h" #include "misc.h" #ifndef NO_GSSAPI diff --git a/code/sshgssc.h b/code/ssh/gssc.h similarity index 95% rename from code/sshgssc.h rename to code/ssh/gssc.h index 07fac00..d1d99eb 100644 --- a/code/sshgssc.h +++ b/code/ssh/gssc.h @@ -4,7 +4,7 @@ #ifndef NO_GSSAPI #include "pgssapi.h" -#include "sshgss.h" +#include "gss.h" typedef struct gssapi_ssh_gss_ctx { OM_uint32 maj_stat; diff --git a/code/ssh2kex-client.c b/code/ssh/kex2-client.c similarity index 96% rename from code/ssh2kex-client.c rename to code/ssh/kex2-client.c index 1dd960c..9a8f75e 100644 --- a/code/ssh2kex-client.c +++ b/code/ssh/kex2-client.c @@ -6,11 +6,11 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" #include "storage.h" -#include "ssh2transport.h" +#include "transport2.h" #include "mpint.h" /* @@ -118,7 +118,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted) * Now generate and send e for Diffie-Hellman. */ seat_set_busy_status(s->ppl.seat, BUSY_CPU); - s->e = dh_create_e(s->dh_ctx, s->nbits * 2); + s->e = dh_create_e(s->dh_ctx); pktout = ssh_bpp_new_pktout(s->ppl.bpp, s->kex_init_value); put_mp_ssh2(pktout, s->e); pq_push(s->ppl.out_pq, pktout); @@ -322,7 +322,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted) "exchange with hash %s", ssh_hash_alg(s->exhash)->text_name); /* Now generate e for Diffie-Hellman. */ seat_set_busy_status(s->ppl.seat, BUSY_CPU); - s->e = dh_create_e(s->dh_ctx, s->nbits * 2); + s->e = dh_create_e(s->dh_ctx); if (s->shgss->lib->gsslogmsg) ppl_logevent("%s", s->shgss->lib->gsslogmsg); @@ -843,39 +843,32 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted) * Authenticate remote host: verify host key. (We've already * checked the signature of the exchange hash.) */ - char **fingerprints = ssh2_all_fingerprints(s->hkey); - FingerprintType fptype_default = - ssh2_pick_default_fingerprint(fingerprints); - ppl_logevent("Host key fingerprint is:"); - ppl_logevent("%s", fingerprints[fptype_default]); - /* First check against manually configured host keys. */ - s->dlgret = verify_ssh_manual_host_key( - s->conf, fingerprints, s->hkey); - if (s->dlgret == 0) { /* did not match */ - ssh2_free_all_fingerprints(fingerprints); - ssh_sw_abort(s->ppl.ssh, "Host key did not appear in manually " - "configured list"); - *aborted = true; - return; - } else if (s->dlgret < 0) { /* none configured; use standard handling */ + { ssh2_userkey uk = { .key = s->hkey, .comment = NULL }; char *keydisp = ssh2_pubkey_openssh_str(&uk); - s->dlgret = seat_verify_ssh_host_key( - s->ppl.seat, s->savedhost, s->savedport, - ssh_key_cache_id(s->hkey), s->keystr, keydisp, + char **fingerprints = ssh2_all_fingerprints(s->hkey); + + FingerprintType fptype_default = + ssh2_pick_default_fingerprint(fingerprints); + ppl_logevent("Host key fingerprint is:"); + ppl_logevent("%s", fingerprints[fptype_default]); + + s->spr = verify_ssh_host_key( + ppl_get_iseat(&s->ppl), s->conf, s->savedhost, s->savedport, + s->hkey, ssh_key_cache_id(s->hkey), s->keystr, keydisp, fingerprints, ssh2_transport_dialog_callback, s); - sfree(keydisp); + ssh2_free_all_fingerprints(fingerprints); + sfree(keydisp); + } #ifdef FUZZING - s->dlgret = 1; + s->spr = SPR_OK; #endif - crMaybeWaitUntilV(s->dlgret >= 0); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, - "User aborted at host key verification"); - *aborted = true; - return; - } + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(s->spr)) { + *aborted = true; + ssh_spr_close(s->ppl.ssh, s->spr, "host key verification"); + return; } /* diff --git a/code/ssh2kex-server.c b/code/ssh/kex2-server.c similarity index 98% rename from code/ssh2kex-server.c rename to code/ssh/kex2-server.c index 1fbb588..3c01707 100644 --- a/code/ssh2kex-server.c +++ b/code/ssh/kex2-server.c @@ -6,13 +6,13 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" -#include "sshserver.h" +#include "server.h" #include "sshkeygen.h" #include "storage.h" -#include "ssh2transport.h" +#include "transport2.h" #include "mpint.h" void ssh2_transport_provide_hostkeys(PacketProtocolLayer *ppl, @@ -128,7 +128,7 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted) /* * Generate e for Diffie-Hellman. */ - s->e = dh_create_e(s->dh_ctx, s->nbits * 2); + s->e = dh_create_e(s->dh_ctx); /* * Wait to receive f. diff --git a/code/ssh1login-server.c b/code/ssh/login1-server.c similarity index 97% rename from code/ssh1login-server.c rename to code/ssh/login1-server.c index c9c10ee..30ff902 100644 --- a/code/ssh1login-server.c +++ b/code/ssh/login1-server.c @@ -7,10 +7,10 @@ #include "putty.h" #include "mpint.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" -#include "sshserver.h" +#include "server.h" #include "sshkeygen.h" struct ssh1_login_server_state { @@ -39,7 +39,6 @@ struct ssh1_login_server_state { unsigned ap_methods, current_method; unsigned char auth_rsa_expected_response[16]; RSAKey *authkey; - bool auth_successful; PacketProtocolLayer ppl; }; @@ -52,9 +51,6 @@ static bool ssh1_login_server_get_specials( void *ctx) { return false; } static void ssh1_login_server_special_cmd(PacketProtocolLayer *ppl, SessionSpecialCode code, int arg) {} -static bool ssh1_login_server_want_user_input( - PacketProtocolLayer *ppl) { return false; } -static void ssh1_login_server_got_user_input(PacketProtocolLayer *ppl) {} static void ssh1_login_server_reconfigure( PacketProtocolLayer *ppl, Conf *conf) {} @@ -63,8 +59,6 @@ static const PacketProtocolLayerVtable ssh1_login_server_vtable = { .process_queue = ssh1_login_server_process_queue, .get_specials = ssh1_login_server_get_specials, .special_cmd = ssh1_login_server_special_cmd, - .want_user_input = ssh1_login_server_want_user_input, - .got_user_input = ssh1_login_server_got_user_input, .reconfigure = ssh1_login_server_reconfigure, .queued_data_size = ssh_ppl_default_queued_data_size, .name = NULL, /* no layer names in SSH-1 */ @@ -267,7 +261,9 @@ static void ssh1_login_server_process_queue(PacketProtocolLayer *ppl) s->username.ptr = s->username_str = mkstr(s->username); ppl_logevent("Received username '%.*s'", PTRLEN_PRINTF(s->username)); - s->auth_successful = auth_none(s->authpolicy, s->username); + if (auth_none(s->authpolicy, s->username)) + goto auth_success; + while (1) { /* Signal failed authentication */ pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_SMSG_FAILURE); diff --git a/code/ssh1login.c b/code/ssh/login1.c similarity index 90% rename from code/ssh1login.c rename to code/ssh/login1.c index 519838d..7b345c7 100644 --- a/code/ssh1login.c +++ b/code/ssh/login1.c @@ -8,8 +8,8 @@ #include "putty.h" #include "ssh.h" #include "mpint.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" typedef struct agent_key { @@ -47,7 +47,7 @@ struct ssh1_login_state { char *publickey_comment; bool privatekey_available, privatekey_encrypted; prompts_t *cur_prompt; - int userpass_ret; + SeatPromptResult spr; char c; int pwpkt_type; void *agent_response_to_free; @@ -58,10 +58,8 @@ struct ssh1_login_state { size_t agent_key_index, agent_key_limit; bool authed; RSAKey key; - int dlgret; Filename *keyfile; RSAKey servkey, hostkey; - bool want_user_input; StripCtrlChars *tis_scc; bool tis_scc_initialised; @@ -71,11 +69,9 @@ struct ssh1_login_state { static void ssh1_login_free(PacketProtocolLayer *); static void ssh1_login_process_queue(PacketProtocolLayer *); -static void ssh1_login_dialog_callback(void *, int); +static void ssh1_login_dialog_callback(void *, SeatPromptResult); static void ssh1_login_special_cmd(PacketProtocolLayer *ppl, SessionSpecialCode code, int arg); -static bool ssh1_login_want_user_input(PacketProtocolLayer *ppl); -static void ssh1_login_got_user_input(PacketProtocolLayer *ppl); static void ssh1_login_reconfigure(PacketProtocolLayer *ppl, Conf *conf); static const PacketProtocolLayerVtable ssh1_login_vtable = { @@ -83,8 +79,6 @@ static const PacketProtocolLayerVtable ssh1_login_vtable = { .process_queue = ssh1_login_process_queue, .get_specials = ssh1_common_get_specials, .special_cmd = ssh1_login_special_cmd, - .want_user_input = ssh1_login_want_user_input, - .got_user_input = ssh1_login_got_user_input, .reconfigure = ssh1_login_reconfigure, .queued_data_size = ssh_ppl_default_queued_data_size, .name = NULL, /* no layer names in SSH-1 */ @@ -243,42 +237,28 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) * Verify the host key. */ { - /* - * First format the key into a string. - */ char *keystr = rsastr_fmt(&s->hostkey); + char *keydisp = ssh1_pubkey_str(&s->hostkey); char **fingerprints = rsa_ssh1_fake_all_fingerprints(&s->hostkey); - /* First check against manually configured host keys. */ - s->dlgret = verify_ssh_manual_host_key(s->conf, fingerprints, NULL); - if (s->dlgret == 0) { /* did not match */ - ssh2_free_all_fingerprints(fingerprints); - sfree(keystr); - ssh_proto_error(s->ppl.ssh, "Host key did not appear in manually " - "configured list"); - return; - } else if (s->dlgret < 0) { /* none configured; use standard handling */ - char *keydisp = ssh1_pubkey_str(&s->hostkey); - s->dlgret = seat_verify_ssh_host_key( - s->ppl.seat, s->savedhost, s->savedport, "rsa", keystr, - keydisp, fingerprints, ssh1_login_dialog_callback, s); - sfree(keydisp); - ssh2_free_all_fingerprints(fingerprints); - sfree(keystr); + s->spr = verify_ssh_host_key( + ppl_get_iseat(&s->ppl), s->conf, s->savedhost, s->savedport, NULL, + "rsa", keystr, keydisp, fingerprints, + ssh1_login_dialog_callback, s); + + ssh2_free_all_fingerprints(fingerprints); + sfree(keydisp); + sfree(keystr); + } + #ifdef FUZZING - s->dlgret = 1; + s->spr = SPR_OK; #endif - crMaybeWaitUntilV(s->dlgret >= 0); + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, - "User aborted at host key verification"); - return; - } - } else { - ssh2_free_all_fingerprints(fingerprints); - sfree(keystr); - } + if (spr_is_abort(s->spr)) { + ssh_spr_close(s->ppl.ssh, s->spr, "host key verification"); + return; } for (i = 0; i < 32; i++) { @@ -342,12 +322,12 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) /* Warn about chosen cipher if necessary. */ if (warn) { - s->dlgret = seat_confirm_weak_crypto_primitive( - s->ppl.seat, "cipher", cipher_string, + s->spr = seat_confirm_weak_crypto_primitive( + ppl_get_iseat(&s->ppl), "cipher", cipher_string, ssh1_login_dialog_callback, s); - crMaybeWaitUntilV(s->dlgret >= 0); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, "User aborted at cipher warning"); + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(s->spr)) { + ssh_spr_close(s->ppl.ssh, s->spr, "cipher warning"); return; } } @@ -404,31 +384,23 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) ppl_logevent("Successfully started encryption"); if ((s->username = get_remote_username(s->conf)) == NULL) { - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = true; s->cur_prompt->from_server = false; s->cur_prompt->name = dupstr("SSH login name"); add_prompt(s->cur_prompt, dupstr("login as: "), true); - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* * Failed to get a username. Terminate. */ - ssh_user_close(s->ppl.ssh, "No username provided"); + ssh_spr_close(s->ppl.ssh, s->spr, "username prompt"); return; } s->username = prompt_get_result(s->cur_prompt->prompts[0]); @@ -707,32 +679,23 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) ppl_printf("No passphrase required.\r\n"); passphrase = NULL; } else { - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = false; s->cur_prompt->from_server = false; s->cur_prompt->name = dupstr("SSH key passphrase"); add_prompt(s->cur_prompt, dupprintf("Passphrase for key \"%s\": ", s->publickey_comment), false); - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* Failed to get a passphrase. Terminate. */ - ssh_user_close(s->ppl.ssh, - "User aborted at passphrase prompt"); + ssh_spr_close(s->ppl.ssh, s->spr, "passphrase prompt"); return; } passphrase = prompt_get_result(s->cur_prompt->prompts[0]); @@ -846,7 +809,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) /* * Otherwise, try various forms of password-like authentication. */ - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); if (conf_get_bool(s->conf, CONF_try_tis_auth) && (s->supported_auths_mask & (1 << SSH1_AUTH_TIS)) && @@ -977,28 +940,20 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) * or CryptoCard exchange if we're doing TIS or CryptoCard * authentication. */ - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* * Failed to get a password (for example * because one was supplied on the command line * which has already failed to work). Terminate. */ - ssh_user_close(s->ppl.ssh, "User aborted at password prompt"); + ssh_spr_close(s->ppl.ssh, s->spr, "password prompt"); return; } @@ -1183,10 +1138,10 @@ static void ssh1_login_setup_tis_scc(struct ssh1_login_state *s) s->tis_scc_initialised = true; } -static void ssh1_login_dialog_callback(void *loginv, int ret) +static void ssh1_login_dialog_callback(void *loginv, SeatPromptResult spr) { struct ssh1_login_state *s = (struct ssh1_login_state *)loginv; - s->dlgret = ret; + s->spr = spr; ssh_ppl_process_queue(&s->ppl); } @@ -1231,21 +1186,6 @@ static void ssh1_login_special_cmd(PacketProtocolLayer *ppl, } } -static bool ssh1_login_want_user_input(PacketProtocolLayer *ppl) -{ - struct ssh1_login_state *s = - container_of(ppl, struct ssh1_login_state, ppl); - return s->want_user_input; -} - -static void ssh1_login_got_user_input(PacketProtocolLayer *ppl) -{ - struct ssh1_login_state *s = - container_of(ppl, struct ssh1_login_state, ppl); - if (s->want_user_input) - queue_idempotent_callback(&s->ppl.ic_process_queue); -} - static void ssh1_login_reconfigure(PacketProtocolLayer *ppl, Conf *conf) { struct ssh1_login_state *s = diff --git a/code/mainchan.c b/code/ssh/mainchan.c similarity index 96% rename from code/mainchan.c rename to code/ssh/mainchan.c index 8653ad0..5c1769e 100644 --- a/code/mainchan.c +++ b/code/ssh/mainchan.c @@ -8,8 +8,8 @@ #include "putty.h" #include "ssh.h" -#include "sshppl.h" -#include "sshchan.h" +#include "ppl.h" +#include "channel.h" static void mainchan_free(Channel *chan); static void mainchan_open_confirmation(Channel *chan); @@ -129,6 +129,7 @@ static void mainchan_open_confirmation(Channel *chan) seat_update_specials_menu(mc->ppl->seat); ppl_logevent("Opened main channel"); + seat_notify_session_started(mc->ppl->seat); if (mc->is_simple) sshfwd_hint_channel_is_simple(mc->sc); @@ -295,8 +296,8 @@ static void mainchan_request_response(Channel *chan, bool success) * If there's no remote_cmd2 configured, then we have no * fallback command, so we've run out of options. */ - ssh_sw_abort(mc->ppl->ssh, - "Server refused to start a shell/command"); + ssh_sw_abort_deferred(mc->ppl->ssh, + "Server refused to start a shell/command"); } return; } @@ -309,8 +310,8 @@ static void mainchan_request_response(Channel *chan, bool success) ssh_got_fallback_cmd(mc->ppl->ssh); mainchan_ready(mc); } else { - ssh_sw_abort(mc->ppl->ssh, - "Server refused to start a shell/command"); + ssh_sw_abort_deferred(mc->ppl->ssh, + "Server refused to start a shell/command"); } return; } @@ -321,7 +322,7 @@ static void mainchan_ready(mainchan *mc) mc->ready = true; ssh_set_wants_user_input(mc->cl, true); - ssh_ppl_got_user_input(mc->ppl); /* in case any is already queued */ + ssh_got_user_input(mc->cl); /* in case any is already queued */ /* If an EOF arrived before we were ready, handle it now. */ if (mc->eof_pending) { @@ -433,7 +434,7 @@ static bool mainchan_rcvd_exit_signal( exitcode = 128 + SIG ## s; #define SIGNAL_MAIN(s, text) SIGNAL_SUB(s) #define SIGNALS_LOCAL_ONLY - #include "sshsignals.h" + #include "signal-list.h" #undef SIGNAL_SUB #undef SIGNAL_MAIN #undef SIGNALS_LOCAL_ONLY @@ -473,7 +474,7 @@ void mainchan_get_specials( #define SIGNAL_MAIN(name, desc) \ add_special(ctx, "SIG" #name " (" desc ")", SS_SIG ## name, 0); #define SIGNAL_SUB(name) - #include "sshsignals.h" + #include "signal-list.h" #undef SIGNAL_MAIN #undef SIGNAL_SUB @@ -482,7 +483,7 @@ void mainchan_get_specials( #define SIGNAL_MAIN(name, desc) #define SIGNAL_SUB(name) \ add_special(ctx, "SIG" #name, SS_SIG ## name, 0); - #include "sshsignals.h" + #include "signal-list.h" #undef SIGNAL_MAIN #undef SIGNAL_SUB @@ -494,7 +495,7 @@ static const char *ssh_signal_lookup(SessionSpecialCode code) #define SIGNAL_SUB(name) \ if (code == SS_SIG ## name) return #name; #define SIGNAL_MAIN(name, desc) SIGNAL_SUB(name) - #include "sshsignals.h" + #include "signal-list.h" #undef SIGNAL_MAIN #undef SIGNAL_SUB diff --git a/code/sshnogss.c b/code/ssh/nogss.c similarity index 100% rename from code/sshnogss.c rename to code/ssh/nogss.c diff --git a/code/noshare.c b/code/ssh/nosharing.c similarity index 100% rename from code/noshare.c rename to code/ssh/nosharing.c diff --git a/code/pgssapi.c b/code/ssh/pgssapi.c similarity index 100% rename from code/pgssapi.c rename to code/ssh/pgssapi.c diff --git a/code/pgssapi.h b/code/ssh/pgssapi.h similarity index 100% rename from code/pgssapi.h rename to code/ssh/pgssapi.h diff --git a/code/portfwd.c b/code/ssh/portfwd.c similarity index 93% rename from code/portfwd.c rename to code/ssh/portfwd.c index f3349b8..1154456 100644 --- a/code/portfwd.c +++ b/code/ssh/portfwd.c @@ -8,7 +8,8 @@ #include "putty.h" #include "ssh.h" -#include "sshchan.h" +#include "channel.h" +#include "proxy/socks.h" /* * Enumeration of values that live in the 'socks_state' field of @@ -109,13 +110,12 @@ static void pfl_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, static void pfd_close(struct PortForwarding *pf); -static void pfd_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void pfd_closing(Plug *plug, PlugCloseType type, const char *error_msg) { struct PortForwarding *pf = container_of(plug, struct PortForwarding, plug); - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { /* * Socket error. Slam the connection instantly shut. */ @@ -142,8 +142,7 @@ static void pfd_closing(Plug *plug, const char *error_msg, int error_code, static void pfl_terminate(struct PortListener *pl); -static void pfl_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void pfl_closing(Plug *plug, PlugCloseType type, const char *error_msg) { struct PortListener *pl = (struct PortListener *) plug; pfl_terminate(pl); @@ -218,10 +217,10 @@ static void pfd_receive(Plug *plug, int urgent, const char *data, size_t len) * _must_ have by now) to find out which SOCKS major * version we're speaking. */ switch (pf->socksbuf->u[0]) { - case 4: + case SOCKS4_REQUEST_VERSION: pf->socks_state = SOCKS_4; break; - case 5: + case SOCKS5_REQUEST_VERSION: pf->socks_state = SOCKS_5_INITIAL; break; default: @@ -252,13 +251,15 @@ static void pfd_receive(Plug *plug, int urgent, const char *data, size_t len) if (get_err(src) == BSE_OUT_OF_DATA) return; - if (socks_version == 4 && message_type == 1) { + if (socks_version == SOCKS4_REQUEST_VERSION && + message_type == SOCKS_CMD_CONNECT) { /* CONNECT message */ bool name_based = false; port = get_uint16(src); ipv4 = get_uint32(src); - if (ipv4 > 0x00000000 && ipv4 < 0x00000100) { + if (ipv4 >= SOCKS4A_NAME_FOLLOWS_BASE && + ipv4 < SOCKS4A_NAME_FOLLOWS_LIMIT) { /* * Addresses in this range indicate the SOCKS 4A * extension to specify a hostname, which comes @@ -282,8 +283,8 @@ static void pfd_receive(Plug *plug, int urgent, const char *data, size_t len) } output = strbuf_new(); - put_byte(output, 0); /* reply version */ - put_byte(output, 90); /* SOCKS 4 'request granted' */ + put_byte(output, SOCKS4_REPLY_VERSION); + put_byte(output, SOCKS4_RESP_SUCCESS); put_uint16(output, 0); /* null port field */ put_uint32(output, 0); /* null address field */ sk_write(pf->s, output->u, output->len); @@ -296,8 +297,8 @@ static void pfd_receive(Plug *plug, int urgent, const char *data, size_t len) socks4_reject: output = strbuf_new(); - put_byte(output, 0); /* reply version */ - put_byte(output, 91); /* SOCKS 4 'request rejected' */ + put_byte(output, SOCKS4_REPLY_VERSION); + put_byte(output, SOCKS4_RESP_FAILURE); put_uint16(output, 0); /* null port field */ put_uint32(output, 0); /* null address field */ sk_write(pf->s, output->u, output->len); @@ -310,29 +311,31 @@ static void pfd_receive(Plug *plug, int urgent, const char *data, size_t len) socks_version = get_byte(src); methods = get_pstring(src); - method = 0xFF; /* means 'no usable method found' */ - { - int i; - for (i = 0; i < methods.len; i++) { - if (((const unsigned char *)methods.ptr)[i] == 0 ) { - method = 0; /* no auth */ - break; - } + method = SOCKS5_AUTH_REJECTED; + + /* Search the method list for AUTH_NONE, which is the + * only one this client code can speak */ + for (size_t i = 0; i < methods.len; i++) { + unsigned char this_method = + ((const unsigned char *)methods.ptr)[i]; + if (this_method == SOCKS5_AUTH_NONE) { + method = this_method; + break; } } if (get_err(src) == BSE_OUT_OF_DATA) return; if (get_err(src)) - method = 0xFF; + method = SOCKS5_AUTH_REJECTED; output = strbuf_new(); - put_byte(output, 5); /* SOCKS version */ - put_byte(output, method); /* selected auth method */ + put_byte(output, SOCKS5_REPLY_VERSION); + put_byte(output, method); sk_write(pf->s, output->u, output->len); strbuf_free(output); - if (method == 0xFF) { + if (method == SOCKS5_AUTH_REJECTED) { pfd_close(pf); return; } @@ -347,48 +350,49 @@ static void pfd_receive(Plug *plug, int urgent, const char *data, size_t len) message_type = get_byte(src); reserved_byte = get_byte(src); - if (socks_version == 5 && message_type == 1 && + if (socks_version == SOCKS5_REQUEST_VERSION && + message_type == SOCKS_CMD_CONNECT && reserved_byte == 0) { - reply_code = 0; /* success */ + reply_code = SOCKS5_RESP_SUCCESS; switch (get_byte(src)) { - case 1: /* IPv4 */ + case SOCKS5_ADDR_IPV4: pf->hostname = ipv4_to_string(get_uint32(src)); break; - case 4: /* IPv6 */ + case SOCKS5_ADDR_IPV6: pf->hostname = ipv6_to_string(get_data(src, 16)); break; - case 3: /* unresolved domain name */ + case SOCKS5_ADDR_HOSTNAME: pf->hostname = mkstr(get_pstring(src)); break; default: pf->hostname = NULL; - reply_code = 8; /* address type not supported */ + reply_code = SOCKS5_RESP_ADDRTYPE_NOT_SUPPORTED; break; } pf->port = get_uint16(src); } else { - reply_code = 7; /* command not supported */ + reply_code = SOCKS5_RESP_COMMAND_NOT_SUPPORTED; } if (get_err(src) == BSE_OUT_OF_DATA) return; if (get_err(src)) - reply_code = 1; /* general server failure */ + reply_code = SOCKS5_RESP_FAILURE; output = strbuf_new(); - put_byte(output, 5); /* SOCKS version */ + put_byte(output, SOCKS5_REPLY_VERSION); put_byte(output, reply_code); put_byte(output, 0); /* reserved */ - put_byte(output, 1); /* IPv4 address follows */ + put_byte(output, SOCKS5_ADDR_IPV4); /* IPv4 address follows */ put_uint32(output, 0); /* bound IPv4 address (unused) */ put_uint16(output, 0); /* bound port number (unused) */ sk_write(pf->s, output->u, output->len); strbuf_free(output); - if (reply_code != 0) { + if (reply_code != SOCKS5_RESP_SUCCESS) { pfd_close(pf); return; } @@ -1160,7 +1164,8 @@ char *portfwdmgr_connect(PortFwdManager *mgr, Channel **chan_ret, pf->socks_state = SOCKS_NONE; pf->s = new_connection(addr, dummy_realhost, port, - false, true, false, false, &pf->plug, mgr->conf); + false, true, false, false, &pf->plug, mgr->conf, + NULL); sfree(dummy_realhost); if ((err = sk_socket_error(pf->s)) != NULL) { char *err_ret = dupstr(err); diff --git a/code/sshppl.h b/code/ssh/ppl.h similarity index 91% rename from code/sshppl.h rename to code/ssh/ppl.h index 2c1dbf4..c362516 100644 --- a/code/sshppl.h +++ b/code/ssh/ppl.h @@ -17,8 +17,6 @@ struct PacketProtocolLayerVtable { PacketProtocolLayer *ppl, add_special_fn_t add_special, void *ctx); void (*special_cmd)( PacketProtocolLayer *ppl, SessionSpecialCode code, int arg); - bool (*want_user_input)(PacketProtocolLayer *ppl); - void (*got_user_input)(PacketProtocolLayer *ppl); void (*reconfigure)(PacketProtocolLayer *ppl, Conf *conf); size_t (*queued_data_size)(PacketProtocolLayer *ppl); @@ -48,13 +46,10 @@ struct PacketProtocolLayer { * pointer and then freeing itself. */ PacketProtocolLayer **selfptr; - /* Bufchain of keyboard input from the user, for login prompts and - * similar. */ - bufchain *user_input; - /* Logging and error-reporting facilities. */ LogContext *logctx; Seat *seat; /* for dialog boxes, session output etc */ + Interactor *interactor; /* for ppl_get_iseat */ Ssh *ssh; /* for session termination + assorted connection-layer ops */ /* Known bugs in the remote implementation. */ @@ -69,15 +64,14 @@ static inline bool ssh_ppl_get_specials( static inline void ssh_ppl_special_cmd( PacketProtocolLayer *ppl, SessionSpecialCode code, int arg) { ppl->vt->special_cmd(ppl, code, arg); } -static inline bool ssh_ppl_want_user_input(PacketProtocolLayer *ppl) -{ return ppl->vt->want_user_input(ppl); } -static inline void ssh_ppl_got_user_input(PacketProtocolLayer *ppl) -{ ppl->vt->got_user_input(ppl); } static inline void ssh_ppl_reconfigure(PacketProtocolLayer *ppl, Conf *conf) { ppl->vt->reconfigure(ppl, conf); } static inline size_t ssh_ppl_queued_data_size(PacketProtocolLayer *ppl) { return ppl->vt->queued_data_size(ppl); } +static inline InteractionReadySeat ppl_get_iseat(PacketProtocolLayer *ppl) +{ return interactor_announce(ppl->interactor); } + /* ssh_ppl_free is more than just a macro wrapper on the vtable; it * does centralised parts of the freeing too. */ void ssh_ppl_free(PacketProtocolLayer *ppl); @@ -103,7 +97,7 @@ PacketProtocolLayer *ssh1_login_new( Conf *conf, const char *host, int port, PacketProtocolLayer *successor_layer); PacketProtocolLayer *ssh1_connection_new( - Ssh *ssh, Conf *conf, ConnectionLayer **cl_out); + Ssh *ssh, Conf *conf, bufchain *user_input, ConnectionLayer **cl_out); struct DataTransferStats; struct ssh_connection_shared_gss_state; @@ -123,7 +117,8 @@ PacketProtocolLayer *ssh2_userauth_new( bool gssapi_fwd, struct ssh_connection_shared_gss_state *shgss); PacketProtocolLayer *ssh2_connection_new( Ssh *ssh, ssh_sharing_state *connshare, bool is_simple, - Conf *conf, const char *peer_verstring, ConnectionLayer **cl_out); + Conf *conf, const char *peer_verstring, bufchain *user_input, + ConnectionLayer **cl_out); /* Can't put this in the userauth constructor without having a * dependency loop at setup time (transport and userauth can't _both_ @@ -147,13 +142,18 @@ void ssh_ppl_user_output_string_and_free(PacketProtocolLayer *ppl, char *text); ptrlen ssh2_transport_get_session_id(PacketProtocolLayer *ssh2_transport_ptr); void ssh2_transport_notify_auth_done(PacketProtocolLayer *ssh2_transport_ptr); -/* Shared method between ssh2 layers (defined in ssh2transport.c) to +/* Shared method between ssh2 layers (defined in transport2.c) to * handle the common packets between login and connection: DISCONNECT, * DEBUG and IGNORE. Those messages are handled by the ssh2transport * layer if we have one, but in bare ssh2-connection mode they have to * be handled by ssh2connection. */ bool ssh2_common_filter_queue(PacketProtocolLayer *ppl); +/* Method for making a prompts_t in such a way that it will install a + * callback that causes this PPL's process_queue method to be called + * when asynchronous prompt input completes. */ +prompts_t *ssh_ppl_new_prompts(PacketProtocolLayer *ppl); + /* Methods for ssh1login to pass protocol flags to ssh1connection */ void ssh1_connection_set_protoflags( PacketProtocolLayer *ppl, int local, int remote); diff --git a/code/scpserver.c b/code/ssh/scpserver.c similarity index 99% rename from code/scpserver.c rename to code/ssh/scpserver.c index 3c6e455..15633ec 100644 --- a/code/scpserver.c +++ b/code/ssh/scpserver.c @@ -9,7 +9,7 @@ #include "putty.h" #include "ssh.h" #include "sshcr.h" -#include "sshchan.h" +#include "channel.h" #include "sftp.h" /* @@ -536,7 +536,7 @@ static void scp_source_send_E(ScpSource *scp) assert(scp->n_pending_commands == 0); scp->pending_commands[scp->n_pending_commands++] = cmd = strbuf_new(); - strbuf_catf(cmd, "E\012"); + put_fmt(cmd, "E\012"); } static void scp_source_send_CD( @@ -550,7 +550,7 @@ static void scp_source_send_CD( if (scp->send_file_times && (attrs.flags & SSH_FILEXFER_ATTR_ACMODTIME)) { scp->pending_commands[scp->n_pending_commands++] = cmd = strbuf_new(); /* Our SFTP-based filesystem API doesn't support microsecond times */ - strbuf_catf(cmd, "T%lu 0 %lu 0\012", attrs.mtime, attrs.atime); + put_fmt(cmd, "T%lu 0 %lu 0\012", attrs.mtime, attrs.atime); } const char *slash; @@ -559,9 +559,9 @@ static void scp_source_send_CD( slash+1, name.len - (slash+1 - (const char *)name.ptr)); scp->pending_commands[scp->n_pending_commands++] = cmd = strbuf_new(); - strbuf_catf(cmd, "%c%04o %"PRIu64" %.*s\012", cmdchar, - (unsigned)(attrs.permissions & 07777), - size, PTRLEN_PRINTF(name)); + put_fmt(cmd, "%c%04o %"PRIu64" %.*s\012", cmdchar, + (unsigned)(attrs.permissions & 07777), + size, PTRLEN_PRINTF(name)); if (cmdchar == 'C') { /* We'll also wait for an ack before sending the file data, diff --git a/code/sshserver.c b/code/ssh/server.c similarity index 93% rename from code/sshserver.c rename to code/ssh/server.c index cc1c880..f69bdd8 100644 --- a/code/sshserver.c +++ b/code/ssh/server.c @@ -7,13 +7,13 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" -#include "sshserver.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" +#include "server.h" #ifndef NO_GSSAPI -#include "sshgssc.h" -#include "sshgss.h" +#include "gssc.h" +#include "gss.h" #endif struct Ssh { int dummy; }; @@ -97,23 +97,29 @@ void mainchan_terminal_size(mainchan *mc, int width, int height) {} /* Seat functions to ensure we don't get choosy about crypto - as the * server, it's not up to us to give user warnings */ -static int server_confirm_weak_crypto_primitive( +static SeatPromptResult server_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx) { return 1; } -static int server_confirm_weak_cached_hostkey( + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ return SPR_OK; } +static SeatPromptResult server_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx) { return 1; } + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ return SPR_OK; } static const SeatVtable server_seat_vt = { .output = nullseat_output, .eof = nullseat_eof, + .sent = nullseat_sent, + .banner = nullseat_banner, .get_userpass_input = nullseat_get_userpass_input, + .notify_session_started = nullseat_notify_session_started, .notify_remote_exit = nullseat_notify_remote_exit, + .notify_remote_disconnect = nullseat_notify_remote_disconnect, .connection_fatal = nullseat_connection_fatal, .update_specials_menu = nullseat_update_specials_menu, .get_ttymode = nullseat_get_ttymode, .set_busy_status = nullseat_set_busy_status, - .verify_ssh_host_key = nullseat_verify_ssh_host_key, + .confirm_ssh_host_key = nullseat_confirm_ssh_host_key, .confirm_weak_crypto_primitive = server_confirm_weak_crypto_primitive, .confirm_weak_cached_hostkey = server_confirm_weak_cached_hostkey, .is_utf8 = nullseat_is_never_utf8, @@ -123,6 +129,8 @@ static const SeatVtable server_seat_vt = { .get_window_pixel_size = nullseat_get_window_pixel_size, .stripctrl_new = nullseat_stripctrl_new, .set_trust_status = nullseat_set_trust_status, + .can_set_trust_status = nullseat_can_set_trust_status_no, + .has_mixed_input_stream = nullseat_has_mixed_input_stream_no, .verbose = nullseat_verbose_no, .interactive = nullseat_interactive_no, .get_cursor_position = nullseat_get_cursor_position, @@ -135,11 +143,11 @@ static void server_socket_log(Plug *plug, PlugLogType type, SockAddr *addr, /* FIXME */ } -static void server_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void server_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { server *srv = container_of(plug, server, plug); - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { ssh_remote_error(&srv->ssh, "%s", error_msg); } else if (srv->bpp) { srv->bpp->input_eof = true; @@ -186,6 +194,10 @@ LogContext *ssh_get_logctx(Ssh *ssh) return srv->logctx; } +void ssh_sendbuffer_changed(Ssh *ssh) +{ +} + void ssh_throttle_conn(Ssh *ssh, int adjust) { server *srv = container_of(ssh, server, ssh); @@ -236,6 +248,8 @@ Conf *make_ssh_server_conf(void) return conf; } +void ssh_check_sendok(Ssh *ssh) {} + static const PlugVtable ssh_server_plugvt = { .log = server_socket_log, .closing = server_closing, @@ -362,10 +376,10 @@ static void server_connect_bpp(server *srv) static void server_connect_ppl(server *srv, PacketProtocolLayer *ppl) { ppl->bpp = srv->bpp; - ppl->user_input = &srv->dummy_user_input; ppl->logctx = srv->logctx; ppl->ssh = &srv->ssh; ppl->seat = &srv->seat; + ppl->interactor = NULL; ppl->remote_bugs = srv->remote_bugs; } @@ -506,7 +520,8 @@ static void server_got_ssh_version(struct ssh_version_receiver *rcv, connection_layer = ssh2_connection_new( &srv->ssh, NULL, false, srv->conf, - ssh_verstring_get_local(old_bpp), &srv->cl); + ssh_verstring_get_local(old_bpp), &srv->dummy_user_input, + &srv->cl); ssh2connection_server_configure(connection_layer, srv->sftpserver_vt, srv->ssc); server_connect_ppl(srv, connection_layer); @@ -520,7 +535,8 @@ static void server_got_ssh_version(struct ssh_version_receiver *rcv, connection_layer = ssh2_connection_new( &srv->ssh, NULL, false, srv->conf, - ssh_verstring_get_local(old_bpp), &srv->cl); + ssh_verstring_get_local(old_bpp), &srv->dummy_user_input, + &srv->cl); ssh2connection_server_configure(connection_layer, srv->sftpserver_vt, srv->ssc); server_connect_ppl(srv, connection_layer); @@ -556,7 +572,8 @@ static void server_got_ssh_version(struct ssh_version_receiver *rcv, srv->bpp = ssh1_bpp_new(srv->logctx); server_connect_bpp(srv); - connection_layer = ssh1_connection_new(&srv->ssh, srv->conf, &srv->cl); + connection_layer = ssh1_connection_new( + &srv->ssh, srv->conf, &srv->dummy_user_input, &srv->cl); ssh1connection_server_configure(connection_layer, srv->ssc); server_connect_ppl(srv, connection_layer); diff --git a/code/sshserver.h b/code/ssh/server.h similarity index 97% rename from code/sshserver.h rename to code/ssh/server.h index 5cc393d..c2b3647 100644 --- a/code/sshserver.h +++ b/code/ssh/server.h @@ -21,6 +21,8 @@ struct SshServerConfig { bool stunt_pretend_to_accept_any_pubkey; bool stunt_open_unconditional_agent_socket; + bool stunt_allow_trivial_ki_auth; + bool stunt_return_success_to_pubkey_offer; }; Plug *ssh_server_plug( @@ -135,7 +137,7 @@ int platform_make_x11_server(Plug *plug, const char *progname, int mindisp, Conf *make_ssh_server_conf(void); -/* Provided by Unix front end programs to uxsftpserver.c */ +/* Provided by Unix front end programs to unix/sftpserver.c */ void make_unix_sftp_filehandle_key(void *data, size_t size); typedef struct agentfwd agentfwd; diff --git a/code/sesschan.c b/code/ssh/sesschan.c similarity index 95% rename from code/sesschan.c rename to code/ssh/sesschan.c index 0cf85b3..978ffb9 100644 --- a/code/sesschan.c +++ b/code/ssh/sesschan.c @@ -9,8 +9,8 @@ #include "putty.h" #include "ssh.h" -#include "sshchan.h" -#include "sshserver.h" +#include "channel.h" +#include "server.h" #include "sftp.h" struct agentfwd { @@ -177,7 +177,7 @@ static const LogPolicyVtable sesschan_logpolicy_vt = { }; static size_t sesschan_seat_output( - Seat *, bool is_stderr, const void *, size_t); + Seat *, SeatOutputType type, const void *, size_t); static bool sesschan_seat_eof(Seat *); static void sesschan_notify_remote_exit(Seat *seat); static void sesschan_connection_fatal(Seat *seat, const char *message); @@ -186,13 +186,17 @@ static bool sesschan_get_window_pixel_size(Seat *seat, int *w, int *h); static const SeatVtable sesschan_seat_vt = { .output = sesschan_seat_output, .eof = sesschan_seat_eof, + .sent = nullseat_sent, + .banner = nullseat_banner, .get_userpass_input = nullseat_get_userpass_input, + .notify_session_started = nullseat_notify_session_started, .notify_remote_exit = sesschan_notify_remote_exit, + .notify_remote_disconnect = nullseat_notify_remote_disconnect, .connection_fatal = sesschan_connection_fatal, .update_specials_menu = nullseat_update_specials_menu, .get_ttymode = nullseat_get_ttymode, .set_busy_status = nullseat_set_busy_status, - .verify_ssh_host_key = nullseat_verify_ssh_host_key, + .confirm_ssh_host_key = nullseat_confirm_ssh_host_key, .confirm_weak_crypto_primitive = nullseat_confirm_weak_crypto_primitive, .confirm_weak_cached_hostkey = nullseat_confirm_weak_cached_hostkey, .is_utf8 = nullseat_is_never_utf8, @@ -202,6 +206,8 @@ static const SeatVtable sesschan_seat_vt = { .get_window_pixel_size = sesschan_get_window_pixel_size, .stripctrl_new = nullseat_stripctrl_new, .set_trust_status = nullseat_set_trust_status, + .can_set_trust_status = nullseat_can_set_trust_status_no, + .has_mixed_input_stream = nullseat_has_mixed_input_stream_no, .verbose = nullseat_verbose_no, .interactive = nullseat_interactive_no, .get_cursor_position = nullseat_get_cursor_position, @@ -224,7 +230,7 @@ Channel *sesschan_new(SshChannel *c, LogContext *logctx, sess->conf = conf_new(); load_open_settings(NULL, sess->conf); - /* Set close-on-exit = true to suppress uxpty.c's "[pterm: process + /* Set close-on-exit = true to suppress pty.c's "[pterm: process * terminated with status x]" message */ conf_set_int(sess->conf, CONF_close_on_exit, FORCE_ON); @@ -267,7 +273,8 @@ static size_t sesschan_send(Channel *chan, bool is_stderr, if (!sess->backend || sess->ignoring_input) return 0; - return backend_send(sess->backend, data, length); + backend_send(sess->backend, data, length); + return backend_sendbuffer(sess->backend); } static void sesschan_send_eof(Channel *chan) @@ -296,7 +303,7 @@ static void sesschan_start_backend(sesschan *sess, const char *cmd) * will be set as part of X or agent forwarding, and shouldn't be * confusingly set in the absence of that. * - * (DISPLAY must also be cleared, but uxpty.c will do that anyway + * (DISPLAY must also be cleared, but pty.c will do that anyway * when our get_x_display method returns NULL.) */ static const char *const env_to_unset[] = { @@ -361,8 +368,7 @@ bool sesschan_run_subsystem(Channel *chan, ptrlen subsys) static void fwd_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, const char *error_msg, int error_code) { /* don't expect any weirdnesses from a listening socket */ } -static void fwd_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void fwd_closing(Plug *plug, PlugCloseType type, const char *error_msg) { /* not here, either */ } static int xfwd_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) @@ -400,13 +406,10 @@ bool sesschan_enable_x11_forwarding( sesschan *sess = container_of(chan, sesschan, chan); strbuf *authdata_bin; size_t i; - char screensuffix[32]; if (oneshot) return false; /* not supported */ - snprintf(screensuffix, sizeof(screensuffix), ".%u", screen_number); - /* * Decode the authorisation data from ASCII hex into binary. */ @@ -430,11 +433,14 @@ bool sesschan_enable_x11_forwarding( sess->xfwd_plug.vt = &xfwd_plugvt; + char *screensuffix = dupprintf(".%u", screen_number); + sess->n_x11_sockets = platform_make_x11_server( &sess->xfwd_plug, appname, 10, screensuffix, authproto, ptrlen_from_strbuf(authdata_bin), sess->x11_sockets, sess->conf); + sfree(screensuffix); strbuf_free(authdata_bin); return sess->n_x11_sockets != 0; } @@ -554,7 +560,7 @@ bool sesschan_send_break(Channel *chan, unsigned length) if (sess->backend) { /* We ignore the break length. We could pass it through as the - * 'arg' parameter, and have uxpty.c collect it and pass it on + * 'arg' parameter, and have pty.c collect it and pass it on * to tcsendbreak, but since tcsendbreak in turn assigns * implementation-defined semantics to _its_ duration * parameter, this all just sounds too difficult. */ @@ -575,7 +581,7 @@ bool sesschan_send_signal(Channel *chan, ptrlen signame) #define SIGNAL_SUB(name) \ if (ptrlen_eq_string(signame, #name)) code = SS_SIG ## name; #define SIGNAL_MAIN(name, text) SIGNAL_SUB(name) - #include "sshsignals.h" + #include "signal-list.h" #undef SIGNAL_MAIN #undef SIGNAL_SUB @@ -607,10 +613,10 @@ bool sesschan_change_window_size( } static size_t sesschan_seat_output( - Seat *seat, bool is_stderr, const void *data, size_t len) + Seat *seat, SeatOutputType type, const void *data, size_t len) { sesschan *sess = container_of(seat, sesschan, seat); - return sshfwd_write_ext(sess->c, is_stderr, data, len); + return sshfwd_write_ext(sess->c, type == SEAT_OUTPUT_STDERR, data, len); } static void sesschan_check_close_callback(void *vctx) diff --git a/code/sftp.c b/code/ssh/sftp.c similarity index 100% rename from code/sftp.c rename to code/ssh/sftp.c diff --git a/code/sftp.h b/code/ssh/sftp.h similarity index 99% rename from code/sftp.h rename to code/ssh/sftp.h index 5835c16..fb7d326 100644 --- a/code/sftp.h +++ b/code/ssh/sftp.h @@ -327,7 +327,7 @@ struct SftpServerVtable { /* * Handle actual filesystem requests. * - * Each of these functions replies by calling an appropiate + * Each of these functions replies by calling an appropriate * sftp_reply_foo() function on the given reply packet. */ diff --git a/code/sftpcommon.c b/code/ssh/sftpcommon.c similarity index 100% rename from code/sftpcommon.c rename to code/ssh/sftpcommon.c diff --git a/code/sftpserver.c b/code/ssh/sftpserver.c similarity index 100% rename from code/sftpserver.c rename to code/ssh/sftpserver.c diff --git a/code/sshshare.c b/code/ssh/sharing.c similarity index 97% rename from code/sshshare.c rename to code/ssh/sharing.c index b5da865..7b52dc0 100644 --- a/code/sshshare.c +++ b/code/ssh/sharing.c @@ -937,28 +937,25 @@ static void share_disconnect(struct ssh_sharing_connstate *cs, share_begin_cleanup(cs); } -static void share_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void share_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { struct ssh_sharing_connstate *cs = container_of( plug, struct ssh_sharing_connstate, plug); - if (error_msg) { -#ifdef BROKEN_PIPE_ERROR_CODE - /* - * Most of the time, we log what went wrong when a downstream - * disappears with a socket error. One exception, though, is - * receiving EPIPE when we haven't received a protocol version - * string from the downstream, because that can happen as a result - * of plink -shareexists (opening the connection and instantly - * closing it again without bothering to read our version string). - * So that one case is not treated as a log-worthy error. - */ - if (error_code == BROKEN_PIPE_ERROR_CODE && !cs->got_verstring) - /* do nothing */; - else -#endif - log_downstream(cs, "Socket error: %s", error_msg); + /* + * Most of the time, we log what went wrong when a downstream + * disappears with a socket error. One exception, though, is + * receiving EPIPE when we haven't received a protocol version + * string from the downstream, because that can happen as a result + * of plink -shareexists (opening the connection and instantly + * closing it again without bothering to read our version string). + * So that one case is not treated as a log-worthy error. + */ + if (type == PLUGCLOSE_BROKEN_PIPE && !cs->got_verstring) { + /* do nothing */; + } else if (type != PLUGCLOSE_NORMAL) { + log_downstream(cs, "Socket error: %s", error_msg); } share_begin_cleanup(cs); } @@ -1180,7 +1177,7 @@ void share_got_pkt_from_server(ssh_sharing_connstate *cs, int type, case SSH2_MSG_REQUEST_SUCCESS: case SSH2_MSG_REQUEST_FAILURE: globreq = cs->globreq_head; - assert(globreq); /* should match the queue in ssh.c */ + assert(globreq); /* should match the queue in connection2.c */ if (globreq->type == GLOBREQ_TCPIP_FORWARD) { if (type == SSH2_MSG_REQUEST_FAILURE) { share_remove_forwarding(cs, globreq->fwd); @@ -1292,7 +1289,8 @@ void share_got_pkt_from_server(ssh_sharing_connstate *cs, int type, break; default: - unreachable("This packet type should never have come from ssh.c"); + unreachable("This packet type should never have come from " + "connection2.c"); } } @@ -1359,12 +1357,12 @@ static void share_got_pkt_from_downstream(struct ssh_sharing_connstate *cs, host = mkstr(hostpl); /* - * See if we can allocate space in ssh.c's tree of remote - * port forwardings. If we can't, it's because another - * client sharing this connection has already allocated - * the identical port forwarding, so we take it on - * ourselves to manufacture a failure packet and send it - * back to downstream. + * See if we can allocate space in the connection layer's + * tree of remote port forwardings. If we can't, it's + * because another client sharing this connection has + * already allocated the identical port forwarding, so we + * take it on ourselves to manufacture a failure packet + * and send it back to downstream. */ rpf = ssh_rportfwd_alloc( cs->parent->cl, host, port, NULL, 0, 0, NULL, NULL, cs); @@ -1433,8 +1431,8 @@ static void share_got_pkt_from_downstream(struct ssh_sharing_connstate *cs, } } else { /* - * Tell ssh.c to stop sending us channel-opens for - * this forwarding. + * Tell the connection layer to stop sending us + * channel-opens for this forwarding. */ ssh_rportfwd_remove(cs->parent->cl, fwd->rpf); @@ -1845,12 +1843,12 @@ static void share_sent(Plug *plug, size_t bufsize) */ } -static void share_listen_closing(Plug *plug, const char *error_msg, - int error_code, bool calling_back) +static void share_listen_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { ssh_sharing_state *sharestate = container_of(plug, ssh_sharing_state, plug); - if (error_msg) + if (type != PLUGCLOSE_NORMAL) log_general(sharestate, "listening socket: %s", error_msg); sk_close(sharestate->listensock); sharestate->listensock = NULL; @@ -1875,8 +1873,8 @@ void share_activate(ssh_sharing_state *sharestate, const char *server_verstring) { /* - * Indication from ssh.c that we are now ready to begin serving - * any downstreams that have already connected to us. + * Indication from connection layer that we are now ready to begin + * serving any downstreams that have already connected to us. */ struct ssh_sharing_connstate *cs; int i; @@ -1905,6 +1903,7 @@ static const PlugVtable ssh_sharing_conn_plugvt = { .closing = share_closing, .receive = share_receive, .sent = share_sent, + .log = nullplug_log, }; static int share_listen_accepting(Plug *plug, @@ -2046,6 +2045,7 @@ bool ssh_share_test_for_upstream(const char *host, int port, Conf *conf) static const PlugVtable ssh_sharing_listen_plugvt = { .closing = share_listen_closing, .accepting = share_listen_accepting, + .log = nullplug_log, }; void ssh_connshare_provide_connlayer(ssh_sharing_state *sharestate, diff --git a/code/sshsignals.h b/code/ssh/signal-list.h similarity index 100% rename from code/sshsignals.h rename to code/ssh/signal-list.h diff --git a/code/ssh.c b/code/ssh/ssh.c similarity index 92% rename from code/ssh.c rename to code/ssh/ssh.c index cfe78d3..3820aea 100644 --- a/code/ssh.c +++ b/code/ssh/ssh.c @@ -16,12 +16,12 @@ #include "marshal.h" #include "ssh.h" #include "sshcr.h" -#include "sshbpp.h" -#include "sshppl.h" -#include "sshchan.h" +#include "bpp.h" +#include "ppl.h" +#include "channel.h" #ifndef NO_GSSAPI -#include "sshgssc.h" -#include "sshgss.h" +#include "gssc.h" +#include "gss.h" #define MIN_CTXT_LIFETIME 5 /* Avoid rekey with short lifetime (seconds) */ #define GSS_KEX_CAPABLE (1<<0) /* Can do GSS KEX */ #define GSS_CRED_UPDATED (1<<1) /* Cred updated since previous delegation */ @@ -43,6 +43,7 @@ struct Ssh { Plug plug; Backend backend; + Interactor interactor; Ldisc *ldisc; LogContext *logctx; @@ -61,6 +62,7 @@ struct Ssh { char *savedhost; int savedport; char *fullhostname; + char *description; bool fallback_cmd; int exitcode; @@ -169,8 +171,8 @@ static void ssh_connect_bpp(Ssh *ssh) static void ssh_connect_ppl(Ssh *ssh, PacketProtocolLayer *ppl) { ppl->bpp = ssh->bpp; - ppl->user_input = &ssh->user_input; ppl->seat = ssh->seat; + ppl->interactor = &ssh->interactor; ppl->ssh = ssh; ppl->logctx = ssh->logctx; ppl->remote_bugs = ssh->remote_bugs; @@ -245,7 +247,7 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv, connection_layer = ssh2_connection_new( ssh, ssh->connshare, is_simple, ssh->conf, - ssh_verstring_get_remote(old_bpp), &ssh->cl); + ssh_verstring_get_remote(old_bpp), &ssh->user_input, &ssh->cl); ssh_connect_ppl(ssh, connection_layer); if (conf_get_bool(ssh->conf, CONF_ssh_no_userauth)) { @@ -255,10 +257,10 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv, char *username = get_remote_username(ssh->conf); #ifdef PUTTY_CAC - if (conf_get_bool(ssh->conf, CONF_try_cert_auth) && - cert_is_certpath(conf_get_str(ssh->conf, CONF_cert_certid))) + if (conf_get_bool(ssh->conf, CONF_cert_attempt_auth) && + cert_is_certpath(conf_get_str(ssh->conf, CONF_cert_fingerprint))) { - char * cert = conf_get_str(ssh->conf, CONF_cert_certid); + char * cert = conf_get_str(ssh->conf, CONF_cert_fingerprint); Filename * entry = filename_from_str(cert); conf_set_filename(ssh->conf, CONF_keyfile, entry); filename_free(entry); @@ -314,7 +316,8 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv, ssh->bpp = ssh1_bpp_new(ssh->logctx); ssh_connect_bpp(ssh); - connection_layer = ssh1_connection_new(ssh, ssh->conf, &ssh->cl); + connection_layer = ssh1_connection_new( + ssh, ssh->conf, &ssh->user_input, &ssh->cl); ssh_connect_ppl(ssh, connection_layer); ssh->base_layer = ssh1_login_new( @@ -329,7 +332,7 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv, connection_layer = ssh2_connection_new( ssh, ssh->connshare, false, ssh->conf, - ssh_verstring_get_remote(old_bpp), &ssh->cl); + ssh_verstring_get_remote(old_bpp), &ssh->user_input, &ssh->cl); ssh_connect_ppl(ssh, connection_layer); ssh->base_layer = connection_layer; } @@ -404,6 +407,7 @@ static void ssh_bpp_output_raw_data_callback(void *vctx) if (ssh->pending_close) { sk_close(ssh->s); ssh->s = NULL; + seat_notify_remote_disconnect(ssh->seat); } } @@ -445,6 +449,7 @@ static void ssh_shutdown(Ssh *ssh) if (ssh->s) { sk_close(ssh->s); ssh->s = NULL; + seat_notify_remote_disconnect(ssh->seat); } bufchain_clear(&ssh->in_raw); @@ -613,11 +618,12 @@ static void ssh_socket_log(Plug *plug, PlugLogType type, SockAddr *addr, ssh->session_started); } -static void ssh_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void ssh_closing(Plug *plug, PlugCloseType type, const char *error_msg) { Ssh *ssh = container_of(plug, Ssh, plug); - if (error_msg) { + if (type == PLUGCLOSE_USER_ABORT) { + ssh_user_close(ssh, "%s", error_msg); + } else if (type != PLUGCLOSE_NORMAL) { ssh_remote_error(ssh, "%s", error_msg); } else if (ssh->bpp) { ssh->bpp->input_eof = true; @@ -653,6 +659,7 @@ static void ssh_sent(Plug *plug, size_t bufsize) if (bufsize < SSH_MAX_BACKLOG) { ssh_throttle_all(ssh, false, bufsize); queue_idempotent_callback(&ssh->ic_out_raw); + ssh_sendbuffer_changed(ssh); } } @@ -728,6 +735,37 @@ static const PlugVtable Ssh_plugvt = { .sent = ssh_sent, }; +static char *ssh_description(Interactor *itr) +{ + Ssh *ssh = container_of(itr, Ssh, interactor); + return dupstr(ssh->description); +} + +static LogPolicy *ssh_logpolicy(Interactor *itr) +{ + Ssh *ssh = container_of(itr, Ssh, interactor); + return log_get_policy(ssh->logctx); +} + +static Seat *ssh_get_seat(Interactor *itr) +{ + Ssh *ssh = container_of(itr, Ssh, interactor); + return ssh->seat; +} + +static void ssh_set_seat(Interactor *itr, Seat *seat) +{ + Ssh *ssh = container_of(itr, Ssh, interactor); + ssh->seat = seat; +} + +static const InteractorVtable Ssh_interactorvt = { + .description = ssh_description, + .logpolicy = ssh_logpolicy, + .get_seat = ssh_get_seat, + .set_seat = ssh_set_seat, +}; + /* * Connect to specified host and port. * Returns an error message, or NULL on success. @@ -735,17 +773,13 @@ static const PlugVtable Ssh_plugvt = { * freed by the caller. */ static char *connect_to_host( - Ssh *ssh, const char *host, int port, char **realhost, + Ssh *ssh, const char *host, int port, char *loghost, char **realhost, bool nodelay, bool keepalive) { SockAddr *addr; const char *err; - char *loghost; int addressfamily, sshprot; - ssh_hostport_setup(host, port, ssh->conf, - &ssh->savedhost, &ssh->savedport, &loghost); - ssh->plug.vt = &Ssh_plugvt; /* @@ -801,10 +835,11 @@ static char *connect_to_host( ssh->s = new_connection(addr, *realhost, port, false, true, nodelay, keepalive, - &ssh->plug, ssh->conf); + &ssh->plug, ssh->conf, &ssh->interactor); if ((err = sk_socket_error(ssh->s)) != NULL) { ssh->s = NULL; seat_notify_remote_exit(ssh->seat); + seat_notify_remote_disconnect(ssh->seat); return dupstr(err); } } @@ -932,6 +967,8 @@ static char *ssh_init(const BackendVtable *vt, Seat *seat, ssh->term_height = conf_get_int(ssh->conf, CONF_height); ssh->backend.vt = vt; + ssh->interactor.vt = &Ssh_interactorvt; + ssh->backend.interactor = &ssh->interactor; *backend_handle = &ssh->backend; ssh->bare_connection = (vt->protocol == PROT_SSHCONN); @@ -940,11 +977,17 @@ static char *ssh_init(const BackendVtable *vt, Seat *seat, ssh->cl_dummy.vt = &dummy_connlayer_vtable; ssh->cl_dummy.logctx = ssh->logctx = logctx; + char *loghost; + + ssh_hostport_setup(host, port, ssh->conf, + &ssh->savedhost, &ssh->savedport, &loghost); + ssh->description = default_description(vt, ssh->savedhost, ssh->savedport); + random_ref(); /* do this now - may be needed by sharing setup code */ ssh->need_random_unref = true; char *conn_err = connect_to_host( - ssh, host, port, realhost, nodelay, keepalive); + ssh, host, port, loghost, realhost, nodelay, keepalive); if (conn_err) { /* Call random_unref now instead of waiting until the caller * frees this useless Ssh object, in case the caller is @@ -965,6 +1008,9 @@ static void ssh_free(Backend *be) ssh_shutdown(ssh); + if (is_tempseat(ssh->seat)) + tempseat_free(ssh->seat); + conf_free(ssh->conf); if (ssh->connshare) sharestate_free(ssh->connshare); @@ -984,6 +1030,7 @@ static void ssh_free(Backend *be) #endif sfree(ssh->deferred_abort_message); + sfree(ssh->description); delete_callbacks_for_context(ssh); /* likely to catch ic_out_raw */ @@ -1014,18 +1061,16 @@ static void ssh_reconfig(Backend *be, Conf *conf) /* * Called to send data down the SSH connection. */ -static size_t ssh_send(Backend *be, const char *buf, size_t len) +static void ssh_send(Backend *be, const char *buf, size_t len) { Ssh *ssh = container_of(be, Ssh, backend); if (ssh == NULL || ssh->s == NULL) - return 0; + return; bufchain_add(&ssh->user_input, buf, len); - if (ssh->base_layer) - ssh_ppl_got_user_input(ssh->base_layer); - - return backend_sendbuffer(&ssh->backend); + if (ssh->cl) + ssh_got_user_input(ssh->cl); } /* @@ -1054,6 +1099,11 @@ static size_t ssh_sendbuffer(Backend *be) return backlog; } +void ssh_sendbuffer_changed(Ssh *ssh) +{ + seat_sent(ssh->seat, ssh_sendbuffer(&ssh->backend)); +} + /* * Called to set the size of the window from SSH's POV. */ @@ -1148,7 +1198,15 @@ static bool ssh_connected(Backend *be) static bool ssh_sendok(Backend *be) { Ssh *ssh = container_of(be, Ssh, backend); - return ssh->base_layer && ssh_ppl_want_user_input(ssh->base_layer); + return ssh->cl && ssh_get_wants_user_input(ssh->cl); +} + +void ssh_check_sendok(Ssh *ssh) +{ + /* Called when the connection layer might have caused ssh_sendok + * to start returning true */ + if (ssh->ldisc) + ldisc_check_sendok(ssh->ldisc); } void ssh_ldisc_update(Ssh *ssh) @@ -1203,7 +1261,7 @@ static int ssh_cfg_info(Backend *be) /* * Gross hack: pscp will try to start SFTP but fall back to scp1 if - * that fails. This variable is the means by which scp.c can reach + * that fails. This variable is the means by which pscp.c can reach * into the SSH code and find out which one it got. */ extern bool ssh_fallback_cmd(Backend *be) @@ -1236,8 +1294,10 @@ const BackendVtable ssh_backend = { .test_for_upstream = ssh_test_for_upstream, .close_warn_text = ssh_close_warn_text, .id = "ssh", - .displayname = "SSH", + .displayname_tc = "SSH", + .displayname_lc = "SSH", /* proper name, so capitalise it anyway */ .protocol = PROT_SSH, + .flags = BACKEND_SUPPORTS_NC_HOST | BACKEND_NOTIFIES_SESSION_START, .default_port = 22, }; @@ -1260,6 +1320,8 @@ const BackendVtable sshconn_backend = { .test_for_upstream = ssh_test_for_upstream, .close_warn_text = ssh_close_warn_text, .id = "ssh-connection", - .displayname = "Bare ssh-connection", + .displayname_tc = "Bare ssh-connection", + .displayname_lc = "bare ssh-connection", .protocol = PROT_SSHCONN, + .flags = BACKEND_SUPPORTS_NC_HOST | BACKEND_NOTIFIES_SESSION_START, }; diff --git a/code/ssh2transhk.c b/code/ssh/transient-hostkey-cache.c similarity index 100% rename from code/ssh2transhk.c rename to code/ssh/transient-hostkey-cache.c diff --git a/code/ssh2transport.c b/code/ssh/transport2.c similarity index 96% rename from code/ssh2transport.c rename to code/ssh/transport2.c index 4e1b443..2f9b02a 100644 --- a/code/ssh2transport.c +++ b/code/ssh/transport2.c @@ -6,12 +6,12 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" -#include "sshserver.h" +#include "server.h" #include "storage.h" -#include "ssh2transport.h" +#include "transport2.h" #include "mpint.h" const struct ssh_signkey_with_user_pref_id ssh2_hostkey_algs[] = { @@ -73,8 +73,6 @@ static bool ssh2_transport_get_specials( PacketProtocolLayer *ppl, add_special_fn_t add_special, void *ctx); static void ssh2_transport_special_cmd(PacketProtocolLayer *ppl, SessionSpecialCode code, int arg); -static bool ssh2_transport_want_user_input(PacketProtocolLayer *ppl); -static void ssh2_transport_got_user_input(PacketProtocolLayer *ppl); static void ssh2_transport_reconfigure(PacketProtocolLayer *ppl, Conf *conf); static size_t ssh2_transport_queued_data_size(PacketProtocolLayer *ppl); @@ -87,8 +85,6 @@ static const PacketProtocolLayerVtable ssh2_transport_vtable = { .process_queue = ssh2_transport_process_queue, .get_specials = ssh2_transport_get_specials, .special_cmd = ssh2_transport_special_cmd, - .want_user_input = ssh2_transport_want_user_input, - .got_user_input = ssh2_transport_got_user_input, .reconfigure = ssh2_transport_reconfigure, .queued_data_size = ssh2_transport_queued_data_size, .name = NULL, /* no protocol name for this layer */ @@ -101,7 +97,7 @@ static void ssh2_transport_gss_update(struct ssh2_transport_state *s, static bool ssh2_transport_timer_update(struct ssh2_transport_state *s, unsigned long rekey_time); -static int ssh2_transport_confirm_weak_crypto_primitive( +static SeatPromptResult ssh2_transport_confirm_weak_crypto_primitive( struct ssh2_transport_state *s, const char *type, const char *name, const void *alg); @@ -1269,11 +1265,11 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) } if (s->warn_kex) { - s->dlgret = ssh2_transport_confirm_weak_crypto_primitive( + s->spr = ssh2_transport_confirm_weak_crypto_primitive( s, "key-exchange algorithm", s->kex_alg->name, s->kex_alg); - crMaybeWaitUntilV(s->dlgret >= 0); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, "User aborted at kex warning"); + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(s->spr)) { + ssh_spr_close(s->ppl.ssh, s->spr, "kex warning"); return; } } @@ -1314,44 +1310,44 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) } } if (betteralgs) { - /* Use the special warning prompt that lets us provide - * a list of better algorithms */ - s->dlgret = seat_confirm_weak_cached_hostkey( - s->ppl.seat, s->hostkey_alg->ssh_id, betteralgs, - ssh2_transport_dialog_callback, s); + /* Use the special warning prompt that lets us provide + * a list of better algorithms */ + s->spr = seat_confirm_weak_cached_hostkey( + ppl_get_iseat(&s->ppl), s->hostkey_alg->ssh_id, betteralgs, + ssh2_transport_dialog_callback, s); sfree(betteralgs); } else { - /* If none exist, use the more general 'weak crypto' - * warning prompt */ - s->dlgret = ssh2_transport_confirm_weak_crypto_primitive( - s, "host key type", s->hostkey_alg->ssh_id, - s->hostkey_alg); + /* If none exist, use the more general 'weak crypto' + * warning prompt */ + s->spr = ssh2_transport_confirm_weak_crypto_primitive( + s, "host key type", s->hostkey_alg->ssh_id, + s->hostkey_alg); } - crMaybeWaitUntilV(s->dlgret >= 0); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, "User aborted at host key warning"); + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(s->spr)) { + ssh_spr_close(s->ppl.ssh, s->spr, "host key warning"); return; } } if (s->warn_cscipher) { - s->dlgret = ssh2_transport_confirm_weak_crypto_primitive( + s->spr = ssh2_transport_confirm_weak_crypto_primitive( s, "client-to-server cipher", s->out.cipher->ssh2_id, s->out.cipher); - crMaybeWaitUntilV(s->dlgret >= 0); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, "User aborted at cipher warning"); + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(s->spr)) { + ssh_spr_close(s->ppl.ssh, s->spr, "cipher warning"); return; } } if (s->warn_sccipher) { - s->dlgret = ssh2_transport_confirm_weak_crypto_primitive( + s->spr = ssh2_transport_confirm_weak_crypto_primitive( s, "server-to-client cipher", s->in.cipher->ssh2_id, s->in.cipher); - crMaybeWaitUntilV(s->dlgret >= 0); - if (s->dlgret == 0) { - ssh_user_close(s->ppl.ssh, "User aborted at cipher warning"); + crMaybeWaitUntilV(s->spr.kind != SPRK_INCOMPLETE); + if (spr_is_abort(s->spr)) { + ssh_spr_close(s->ppl.ssh, s->spr, "cipher warning"); return; } } @@ -1484,6 +1480,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) * layer's outgoing queue on to our own. */ pq_concatenate(s->ppl.out_pq, s->ppl.out_pq, &s->pq_out_higher); + ssh_sendbuffer_changed(s->ppl.ssh); /* * Expect SSH2_MSG_NEWKEYS from server. @@ -1620,6 +1617,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) /* Pass through outgoing packets from the higher layer. */ pq_concatenate(s->ppl.out_pq, s->ppl.out_pq, &s->pq_out_higher); + ssh_sendbuffer_changed(s->ppl.ssh); /* Wait for either a KEXINIT, or something setting * s->rekey_class. This call to ssh2_transport_pop also has @@ -1817,10 +1815,10 @@ static bool ssh2_transport_timer_update(struct ssh2_transport_state *s, return false; } -void ssh2_transport_dialog_callback(void *loginv, int ret) +void ssh2_transport_dialog_callback(void *vctx, SeatPromptResult spr) { - struct ssh2_transport_state *s = (struct ssh2_transport_state *)loginv; - s->dlgret = ret; + struct ssh2_transport_state *s = (struct ssh2_transport_state *)vctx; + s->spr = spr; ssh_ppl_process_queue(&s->ppl); } @@ -1924,7 +1922,7 @@ static void ssh2_transport_gss_update(struct ssh2_transport_state *s, s->gss_status |= GSS_KEX_CAPABLE; /* - * When rekeying to cascade, avoding doing this too close to the + * When rekeying to cascade, avoid doing this too close to the * context expiration time, since the key exchange might fail. */ if (s->gss_ctxt_lifetime < MIN_CTXT_LIFETIME) @@ -2130,24 +2128,6 @@ static void ssh2_transport_reconfigure(PacketProtocolLayer *ppl, Conf *conf) ssh_ppl_reconfigure(s->higher_layer, conf); } -static bool ssh2_transport_want_user_input(PacketProtocolLayer *ppl) -{ - struct ssh2_transport_state *s = - container_of(ppl, struct ssh2_transport_state, ppl); - - /* Just delegate this to the higher layer */ - return ssh_ppl_want_user_input(s->higher_layer); -} - -static void ssh2_transport_got_user_input(PacketProtocolLayer *ppl) -{ - struct ssh2_transport_state *s = - container_of(ppl, struct ssh2_transport_state, ppl); - - /* Just delegate this to the higher layer */ - ssh_ppl_got_user_input(s->higher_layer); -} - static int weak_algorithm_compare(void *av, void *bv) { uintptr_t a = (uintptr_t)av, b = (uintptr_t)bv; @@ -2159,16 +2139,16 @@ static int weak_algorithm_compare(void *av, void *bv) * tree234 s->weak_algorithms_consented_to to ensure we ask at most * once about any given crypto primitive. */ -static int ssh2_transport_confirm_weak_crypto_primitive( +static SeatPromptResult ssh2_transport_confirm_weak_crypto_primitive( struct ssh2_transport_state *s, const char *type, const char *name, const void *alg) { if (find234(s->weak_algorithms_consented_to, (void *)alg, NULL)) - return 1; + return SPR_OK; add234(s->weak_algorithms_consented_to, (void *)alg); return seat_confirm_weak_crypto_primitive( - s->ppl.seat, type, name, ssh2_transport_dialog_callback, s); + ppl_get_iseat(&s->ppl), type, name, ssh2_transport_dialog_callback, s); } static size_t ssh2_transport_queued_data_size(PacketProtocolLayer *ppl) diff --git a/code/ssh2transport.h b/code/ssh/transport2.h similarity index 97% rename from code/ssh2transport.h rename to code/ssh/transport2.h index 349c06f..5f0df80 100644 --- a/code/ssh2transport.h +++ b/code/ssh/transport2.h @@ -6,8 +6,8 @@ #define PUTTY_SSH2TRANSPORT_H #ifndef NO_GSSAPI -#include "sshgssc.h" -#include "sshgss.h" +#include "gssc.h" +#include "gss.h" #define MIN_CTXT_LIFETIME 5 /* Avoid rekey with short lifetime (seconds) */ #define GSS_KEX_CAPABLE (1<<0) /* Can do GSS KEX */ #define GSS_CRED_UPDATED (1<<1) /* Cred updated since previous delegation */ @@ -52,7 +52,7 @@ struct kexinit_algorithm { X(HK_ECDSA, ssh_ecdsa_nistp256) \ X(HK_ECDSA, ssh_ecdsa_nistp384) \ X(HK_ECDSA, ssh_ecdsa_nistp521) \ - X(HK_DSA, ssh_dss) \ + X(HK_DSA, ssh_dsa) \ X(HK_RSA, ssh_rsa_sha512) \ X(HK_RSA, ssh_rsa_sha256) \ X(HK_RSA, ssh_rsa) \ @@ -186,7 +186,7 @@ struct ssh2_transport_state { bool warned_about_no_gss_transient_hostkey; bool got_session_id; bool can_send_ext_info, post_newkeys_ext_info; - int dlgret; + SeatPromptResult spr; bool guessok; bool ignorepkt; struct kexinit_algorithm kexlists[NKEXLIST][MAXKEXLIST]; @@ -231,7 +231,7 @@ struct ssh2_transport_state { /* Helpers shared between transport and kex */ PktIn *ssh2_transport_pop(struct ssh2_transport_state *s); -void ssh2_transport_dialog_callback(void *, int); +void ssh2_transport_dialog_callback(void *, SeatPromptResult); /* Provided by transport for use in kex */ void ssh2transport_finalise_exhash(struct ssh2_transport_state *s); diff --git a/code/sshttymodes.h b/code/ssh/ttymode-list.h similarity index 100% rename from code/sshttymodes.h rename to code/ssh/ttymode-list.h diff --git a/code/ssh2userauth.c b/code/ssh/userauth2-client.c similarity index 91% rename from code/ssh2userauth.c rename to code/ssh/userauth2-client.c index 51a8ba3..3dd2e55 100644 --- a/code/ssh2userauth.c +++ b/code/ssh/userauth2-client.c @@ -7,13 +7,13 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" #ifndef NO_GSSAPI -#include "sshgssc.h" -#include "sshgss.h" +#include "gssc.h" +#include "gss.h" #endif #ifdef PUTTY_CAC @@ -49,7 +49,7 @@ struct ssh2_userauth_state { AUTH_TYPE_KEYBOARD_INTERACTIVE_QUIET } type; bool need_pw, can_pubkey, can_passwd, can_keyb_inter; - int userpass_ret; + SeatPromptResult spr; bool tried_pubkey_config, done_agent; struct ssh_connection_shared_gss_state *shgss; #ifndef NO_GSSAPI @@ -85,7 +85,6 @@ struct ssh2_userauth_state { unsigned signflags; int len; PktOut *pktout; - bool want_user_input; bool is_trivial_auth; agent_pending_query *auth_agent_query; @@ -107,8 +106,6 @@ static bool ssh2_userauth_get_specials( PacketProtocolLayer *ppl, add_special_fn_t add_special, void *ctx); static void ssh2_userauth_special_cmd(PacketProtocolLayer *ppl, SessionSpecialCode code, int arg); -static bool ssh2_userauth_want_user_input(PacketProtocolLayer *ppl); -static void ssh2_userauth_got_user_input(PacketProtocolLayer *ppl); static void ssh2_userauth_reconfigure(PacketProtocolLayer *ppl, Conf *conf); static void ssh2_userauth_agent_query(struct ssh2_userauth_state *, strbuf *); @@ -121,16 +118,12 @@ static void ssh2_userauth_add_session_id( static PktOut *ssh2_userauth_gss_packet( struct ssh2_userauth_state *s, const char *authtype); #endif -static void ssh2_userauth_antispoof_msg( - struct ssh2_userauth_state *s, const char *msg); static const PacketProtocolLayerVtable ssh2_userauth_vtable = { .free = ssh2_userauth_free, .process_queue = ssh2_userauth_process_queue, .get_specials = ssh2_userauth_get_specials, .special_cmd = ssh2_userauth_special_cmd, - .want_user_input = ssh2_userauth_want_user_input, - .got_user_input = ssh2_userauth_got_user_input, .reconfigure = ssh2_userauth_reconfigure, .queued_data_size = ssh_ppl_default_queued_data_size, .name = "ssh-userauth", @@ -202,6 +195,8 @@ static void ssh2_userauth_free(PacketProtocolLayer *ppl) sfree(s->locally_allocated_username); sfree(s->hostname); sfree(s->fullhostname); + if (s->cur_prompt) + free_prompts(s->cur_prompt); sfree(s->publickey_comment); sfree(s->publickey_algorithm); if (s->publickey_blob) @@ -446,39 +441,33 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) * it again. */ } else if ((s->username = s->default_username) == NULL) { - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = true; s->cur_prompt->from_server = false; s->cur_prompt->name = dupstr("SSH login name"); add_prompt(s->cur_prompt, dupstr("login as: "), true); - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* * seat_get_userpass_input() failed to get a username. * Terminate. */ free_prompts(s->cur_prompt); - ssh_user_close(s->ppl.ssh, "No username provided"); + s->cur_prompt = NULL; + ssh_spr_close(s->ppl.ssh, s->spr, "username prompt"); return; } sfree(s->locally_allocated_username); /* for change_username */ s->username = s->locally_allocated_username = prompt_get_result(s->cur_prompt->prompts[0]); free_prompts(s->cur_prompt); + s->cur_prompt = NULL; } else { if (seat_verbose(s->ppl.seat) || seat_interactive(s->ppl.seat)) ppl_printf("Using username \"%s\".\r\n", s->username); @@ -535,15 +524,16 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) if (bufchain_size(&s->banner) && (seat_verbose(s->ppl.seat) || seat_interactive(s->ppl.seat))) { if (s->banner_scc) { - ssh2_userauth_antispoof_msg( - s, "Pre-authentication banner message from server:"); + seat_antispoof_msg( + ppl_get_iseat(&s->ppl), + "Pre-authentication banner message from server:"); seat_set_trust_status(s->ppl.seat, false); } bool mid_line = false; while (bufchain_size(&s->banner) > 0) { ptrlen data = bufchain_prefix(&s->banner); - seat_stderr_pl(s->ppl.seat, data); + seat_banner_pl(ppl_get_iseat(&s->ppl), data); mid_line = (((const char *)data.ptr)[data.len-1] != '\n'); bufchain_consume(&s->banner, data.len); @@ -551,12 +541,13 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) bufchain_clear(&s->banner); if (mid_line) - seat_stderr_pl(s->ppl.seat, PTRLEN_LITERAL("\r\n")); + seat_banner_pl(ppl_get_iseat(&s->ppl), + PTRLEN_LITERAL("\r\n")); if (s->banner_scc) { seat_set_trust_status(s->ppl.seat, true); - ssh2_userauth_antispoof_msg( - s, "End of banner message from server"); + seat_antispoof_msg(ppl_get_iseat(&s->ppl), + "End of banner message from server"); } } @@ -797,6 +788,14 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) put_stringpl(s->pktout, ptrlen_from_strbuf( s->agent_keys[s->agent_key_index].blob)); +#ifdef PUTTY_CAC + // switch focus to agent so cred prompts focus properly + if (cert_is_capipath(s->agent_keys[s->agent_key_index].comment->s)) + { + const HWND hWindowPageant = FindWindow("Pageant", "Pageant"); + if (hWindowPageant != NULL) SetForegroundWindow(hWindowPageant); + } +#endif /* Ask agent for signature. */ agentreq = strbuf_new_for_agent_query(); put_byte(agentreq, SSH2_AGENTC_SIGN_REQUEST); @@ -926,7 +925,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) /* * Get a passphrase from the user. */ - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = false; s->cur_prompt->from_server = false; s->cur_prompt->name = dupstr("SSH key passphrase"); @@ -934,35 +933,28 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) dupprintf("Passphrase for key \"%s\": ", s->publickey_comment), false); - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, - s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* Failed to get a passphrase. Terminate. */ free_prompts(s->cur_prompt); + s->cur_prompt = NULL; ssh_bpp_queue_disconnect( s->ppl.bpp, "Unable to authenticate", SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER); - ssh_user_close(s->ppl.ssh, "User aborted at " - "passphrase prompt"); + ssh_spr_close(s->ppl.ssh, s->spr, + "passphrase prompt"); return; } passphrase = prompt_get_result(s->cur_prompt->prompts[0]); free_prompts(s->cur_prompt); + s->cur_prompt = NULL; } else { passphrase = NULL; /* no passphrase needed */ } @@ -1043,10 +1035,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) #ifdef PUTTY_CAC if (cert_is_certpath(key->comment)) { - DWORD siglen = 0; ptrlen datatosign = ptrlen_from_strbuf(sigdata); - LPBYTE sig = cert_sign(key, datatosign.ptr, datatosign.len, &siglen, s->signflags); - put_data(BinarySink_UPCAST(sigblob), sig, siglen); + cert_sign(key, datatosign.ptr, datatosign.len, s->signflags, sigblob); } else #endif // PUTTY_CAC @@ -1327,7 +1317,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) name = get_string(pktin); inst = get_string(pktin); get_string(pktin); /* skip language tag */ - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = true; s->cur_prompt->from_server = true; @@ -1382,9 +1372,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) */ if (!s->ki_printed_header && s->ki_scc && (s->num_prompts || name.len || inst.len)) { - ssh2_userauth_antispoof_msg( - s, "Keyboard-interactive authentication " - "prompts from server:"); + seat_antispoof_msg( + ppl_get_iseat(&s->ppl), "Keyboard-interactive " + "authentication prompts from server:"); s->ki_printed_header = true; seat_set_trust_status(s->ppl.seat, false); } @@ -1430,31 +1420,24 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) * Our prompts_t is fully constructed now. Get the * user's response(s). */ - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* * Failed to get responses. Terminate. */ free_prompts(s->cur_prompt); + s->cur_prompt = NULL; ssh_bpp_queue_disconnect( s->ppl.bpp, "Unable to authenticate", SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER); - ssh_user_close(s->ppl.ssh, "User aborted during " - "keyboard-interactive authentication"); + ssh_spr_close(s->ppl.ssh, s->spr, "keyboard-" + "interactive authentication prompt"); return; } @@ -1477,6 +1460,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) * when we return to the top of this while loop. */ free_prompts(s->cur_prompt); + s->cur_prompt = NULL; /* * Get the next packet in case it's another @@ -1491,8 +1475,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) */ if (s->ki_printed_header) { seat_set_trust_status(s->ppl.seat, true); - ssh2_userauth_antispoof_msg( - s, "End of keyboard-interactive prompts from server"); + seat_antispoof_msg( + ppl_get_iseat(&s->ppl), + "End of keyboard-interactive prompts from server"); } /* @@ -1509,7 +1494,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->ppl.bpp->pls->actx = SSH2_PKTCTX_PASSWORD; - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = true; s->cur_prompt->from_server = false; s->cur_prompt->name = dupstr("SSH password"); @@ -1517,31 +1502,23 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->username, s->hostname), false); - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* * Failed to get responses. Terminate. */ free_prompts(s->cur_prompt); + s->cur_prompt = NULL; ssh_bpp_queue_disconnect( s->ppl.bpp, "Unable to authenticate", SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER); - ssh_user_close(s->ppl.ssh, "User aborted during password " - "authentication"); + ssh_spr_close(s->ppl.ssh, s->spr, "password prompt"); return; } /* @@ -1550,6 +1527,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) */ s->password = prompt_get_result(s->cur_prompt->prompts[0]); free_prompts(s->cur_prompt); + s->cur_prompt = NULL; /* * Send the password packet. @@ -1604,7 +1582,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) prompt = get_string(pktin); - s->cur_prompt = new_prompts(); + s->cur_prompt = ssh_ppl_new_prompts(&s->ppl); s->cur_prompt->to_server = true; s->cur_prompt->from_server = false; s->cur_prompt->name = dupstr("New SSH password"); @@ -1635,35 +1613,27 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) * password twice. */ while (!got_new) { - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, NULL); - while (1) { - while (s->userpass_ret < 0 && - bufchain_size(s->ppl.user_input) > 0) - s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt, - s->ppl.user_input); - - if (s->userpass_ret >= 0) - break; - - s->want_user_input = true; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); + while (s->spr.kind == SPRK_INCOMPLETE) { crReturnV; - s->want_user_input = false; + s->spr = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); } - if (!s->userpass_ret) { + if (spr_is_abort(s->spr)) { /* * Failed to get responses. Terminate. */ /* burn the evidence */ free_prompts(s->cur_prompt); + s->cur_prompt = NULL; smemclr(s->password, strlen(s->password)); sfree(s->password); ssh_bpp_queue_disconnect( s->ppl.bpp, "Unable to authenticate", SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER); - ssh_user_close(s->ppl.ssh, "User aborted during " - "password changing"); + ssh_spr_close(s->ppl.ssh, s->spr, + "password-change prompt"); return; } @@ -1708,6 +1678,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) put_stringz(s->pktout, prompt_get_result_ref( s->cur_prompt->prompts[1])); free_prompts(s->cur_prompt); + s->cur_prompt = NULL; s->pktout->minlen = 256; pq_push(s->ppl.out_pq, s->pktout); ppl_logevent("Sent new password"); @@ -1947,50 +1918,9 @@ static void ssh2_userauth_special_cmd(PacketProtocolLayer *ppl, /* No specials provided by this layer. */ } -static bool ssh2_userauth_want_user_input(PacketProtocolLayer *ppl) -{ - struct ssh2_userauth_state *s = - container_of(ppl, struct ssh2_userauth_state, ppl); - return s->want_user_input; -} - -static void ssh2_userauth_got_user_input(PacketProtocolLayer *ppl) -{ - struct ssh2_userauth_state *s = - container_of(ppl, struct ssh2_userauth_state, ppl); - if (s->want_user_input) - queue_idempotent_callback(&s->ppl.ic_process_queue); -} - static void ssh2_userauth_reconfigure(PacketProtocolLayer *ppl, Conf *conf) { struct ssh2_userauth_state *s = container_of(ppl, struct ssh2_userauth_state, ppl); ssh_ppl_reconfigure(s->successor_layer, conf); } - -static void ssh2_userauth_antispoof_msg( - struct ssh2_userauth_state *s, const char *msg) -{ - strbuf *sb = strbuf_new(); - if (seat_set_trust_status(s->ppl.seat, true)) { - /* - * If the seat can directly indicate that this message is - * generated by the client, then we can just use the message - * unmodified as an unspoofable header. - */ - put_datapl(sb, ptrlen_from_asciz(msg)); - } else { - /* - * Otherwise, add enough padding around it that the server - * wouldn't be able to mimic it within our line-length - * constraint. - */ - strbuf_catf(sb, "-- %s ", msg); - while (sb->len < 78) - put_byte(sb, '-'); - } - put_datapl(sb, PTRLEN_LITERAL("\r\n")); - seat_stderr_pl(s->ppl.seat, ptrlen_from_strbuf(sb)); - strbuf_free(sb); -} diff --git a/code/ssh2userauth-server.c b/code/ssh/userauth2-server.c similarity index 97% rename from code/ssh2userauth-server.c rename to code/ssh/userauth2-server.c index cacddee..bfe258c 100644 --- a/code/ssh2userauth-server.c +++ b/code/ssh/userauth2-server.c @@ -7,14 +7,14 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" -#include "sshppl.h" +#include "bpp.h" +#include "ppl.h" #include "sshcr.h" -#include "sshserver.h" +#include "server.h" #ifndef NO_GSSAPI -#include "sshgssc.h" -#include "sshgss.h" +#include "gssc.h" +#include "gss.h" #endif struct ssh2_userauth_server_state { @@ -209,7 +209,8 @@ static void ssh2_userauth_server_process_queue(PacketProtocolLayer *ppl) if (!(s->methods & s->this_method)) goto failure; - has_signature = get_bool(pktin); + has_signature = get_bool(pktin) || + s->ssc->stunt_return_success_to_pubkey_offer; algorithm = get_string(pktin); blob = get_string(pktin); @@ -251,7 +252,8 @@ static void ssh2_userauth_server_process_queue(PacketProtocolLayer *ppl) signature = get_string(pktin); success = ssh_key_verify(key, signature, - ptrlen_from_strbuf(sigdata)); + ptrlen_from_strbuf(sigdata)) || + s->ssc->stunt_return_success_to_pubkey_offer; ssh_key_free(key); strbuf_free(sigdata); diff --git a/code/sshverstring.c b/code/ssh/verstring.c similarity index 98% rename from code/sshverstring.c rename to code/ssh/verstring.c index 8951e4c..90814bc 100644 --- a/code/sshverstring.c +++ b/code/ssh/verstring.c @@ -8,7 +8,7 @@ #include "putty.h" #include "ssh.h" -#include "sshbpp.h" +#include "bpp.h" #include "sshcr.h" #define PREFIX_MAXLEN 64 @@ -104,6 +104,14 @@ BinaryPacketProtocol *ssh_verstring_new( */ s->send_early = server_mode || !ssh_version_includes_v1(protoversion); + /* + * Override: we don't send our version string early if the server + * has a bug that will make it discard it. See for example + * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991958 + */ + if (conf_get_int(s->conf, CONF_sshbug_dropstart) == FORCE_ON) + s->send_early = false; + s->bpp.vt = &ssh_verstring_vtable; ssh_bpp_common_setup(&s->bpp); return &s->bpp; diff --git a/code/x11fwd.c b/code/ssh/x11fwd.c similarity index 52% rename from code/x11fwd.c rename to code/ssh/x11fwd.c index 86f8583..4a2073e 100644 --- a/code/x11fwd.c +++ b/code/ssh/x11fwd.c @@ -9,26 +9,9 @@ #include "putty.h" #include "ssh.h" -#include "sshchan.h" +#include "channel.h" #include "tree234.h" -static inline uint16_t GET_16BIT_X11(char endian, const void *p) -{ - return endian == 'B' ? GET_16BIT_MSB_FIRST(p) : GET_16BIT_LSB_FIRST(p); -} - -static inline void PUT_16BIT_X11(char endian, void *p, uint16_t value) -{ - if (endian == 'B') - PUT_16BIT_MSB_FIRST(p, value); - else - PUT_16BIT_LSB_FIRST(p, value); -} - -const char *const x11_authnames[] = { - "", "MIT-MAGIC-COOKIE-1", "XDM-AUTHORIZATION-1" -}; - struct XDMSeen { unsigned int time; unsigned char clientid[6]; @@ -183,181 +166,6 @@ int x11_authcmp(void *av, void *bv) } } -struct X11Display *x11_setup_display(const char *display, Conf *conf, - char **error_msg) -{ - struct X11Display *disp = snew(struct X11Display); - char *localcopy; - - *error_msg = NULL; - - if (!display || !*display) { - localcopy = platform_get_x_display(); - if (!localcopy || !*localcopy) { - sfree(localcopy); - localcopy = dupstr(":0"); /* plausible default for any platform */ - } - } else - localcopy = dupstr(display); - - /* - * Parse the display name. - * - * We expect this to have one of the following forms: - * - * - the standard X format which looks like - * [ [ protocol '/' ] host ] ':' displaynumber [ '.' screennumber ] - * (X11 also permits a double colon to indicate DECnet, but - * that's not our problem, thankfully!) - * - * - only seen in the wild on MacOS (so far): a pathname to a - * Unix-domain socket, which will typically and confusingly - * end in ":0", and which I'm currently distinguishing from - * the standard scheme by noting that it starts with '/'. - */ - if (localcopy[0] == '/') { - disp->unixsocketpath = localcopy; - disp->unixdomain = true; - disp->hostname = NULL; - disp->displaynum = -1; - disp->screennum = 0; - disp->addr = NULL; - } else { - char *colon, *dot, *slash; - char *protocol, *hostname; - - colon = host_strrchr(localcopy, ':'); - if (!colon) { - *error_msg = dupprintf("display name '%s' has no ':number'" - " suffix", localcopy); - - sfree(disp); - sfree(localcopy); - return NULL; - } - - *colon++ = '\0'; - dot = strchr(colon, '.'); - if (dot) - *dot++ = '\0'; - - disp->displaynum = atoi(colon); - if (dot) - disp->screennum = atoi(dot); - else - disp->screennum = 0; - - protocol = NULL; - hostname = localcopy; - if (colon > localcopy) { - slash = strchr(localcopy, '/'); - if (slash) { - *slash++ = '\0'; - protocol = localcopy; - hostname = slash; - } - } - - disp->hostname = *hostname ? dupstr(hostname) : NULL; - - if (protocol) - disp->unixdomain = (!strcmp(protocol, "local") || - !strcmp(protocol, "unix")); - else if (!*hostname || !strcmp(hostname, "unix")) - disp->unixdomain = platform_uses_x11_unix_by_default; - else - disp->unixdomain = false; - - if (!disp->hostname && !disp->unixdomain) - disp->hostname = dupstr("localhost"); - - disp->unixsocketpath = NULL; - disp->addr = NULL; - - sfree(localcopy); - } - - /* - * Look up the display hostname, if we need to. - */ - if (!disp->unixdomain) { - const char *err; - - disp->port = 6000 + disp->displaynum; - disp->addr = name_lookup(disp->hostname, disp->port, - &disp->realhost, conf, ADDRTYPE_UNSPEC, - NULL, NULL); - - if ((err = sk_addr_error(disp->addr)) != NULL) { - *error_msg = dupprintf("unable to resolve host name '%s' in " - "display name", disp->hostname); - - sk_addr_free(disp->addr); - sfree(disp->hostname); - sfree(disp->unixsocketpath); - sfree(disp); - return NULL; - } - } - - /* - * Try upgrading an IP-style localhost display to a Unix-socket - * display (as the standard X connection libraries do). - */ - if (!disp->unixdomain && sk_address_is_local(disp->addr)) { - SockAddr *ux = platform_get_x11_unix_address(NULL, disp->displaynum); - const char *err = sk_addr_error(ux); - if (!err) { - /* Create trial connection to see if there is a useful Unix-domain - * socket */ - Socket *s = sk_new(sk_addr_dup(ux), 0, false, false, - false, false, nullplug); - err = sk_socket_error(s); - sk_close(s); - } - if (err) { - sk_addr_free(ux); - } else { - sk_addr_free(disp->addr); - disp->unixdomain = true; - disp->addr = ux; - /* Fill in the rest in a moment */ - } - } - - if (disp->unixdomain) { - if (!disp->addr) - disp->addr = platform_get_x11_unix_address(disp->unixsocketpath, - disp->displaynum); - if (disp->unixsocketpath) - disp->realhost = dupstr(disp->unixsocketpath); - else - disp->realhost = dupprintf("unix:%d", disp->displaynum); - disp->port = 0; - } - - /* - * Fetch the local authorisation details. - */ - disp->localauthproto = X11_NO_AUTH; - disp->localauthdata = NULL; - disp->localauthdatalen = 0; - platform_get_x11_auth(disp, conf); - - return disp; -} - -void x11_free_display(struct X11Display *disp) -{ - sfree(disp->hostname); - sfree(disp->unixsocketpath); - if (disp->localauthdata) - smemclr(disp->localauthdata, disp->localauthdatalen); - sfree(disp->localauthdata); - sk_addr_free(disp->addr); - sfree(disp); -} - #define XDM_MAXSKEW 20*60 /* 20 minute clock skew should be OK */ static const char *x11_verify(unsigned long peer_ip, int peer_port, @@ -450,240 +258,6 @@ static const char *x11_verify(unsigned long peer_ip, int peer_port, return NULL; } -ptrlen BinarySource_get_string_xauth(BinarySource *src) -{ - size_t len = get_uint16(src); - return get_data(src, len); -} -#define get_string_xauth(src) \ - BinarySource_get_string_xauth(BinarySource_UPCAST(src)) - -void BinarySink_put_stringpl_xauth(BinarySink *bs, ptrlen pl) -{ - assert((pl.len >> 16) == 0); - put_uint16(bs, pl.len); - put_datapl(bs, pl); -} -#define put_stringpl_xauth(bs, ptrlen) \ - BinarySink_put_stringpl_xauth(BinarySink_UPCAST(bs),ptrlen) - -void x11_get_auth_from_authfile(struct X11Display *disp, - const char *authfilename) -{ - FILE *authfp; - char *buf; - int size; - BinarySource src[1]; - int family, protocol; - ptrlen addr, protoname, data; - char *displaynum_string; - int displaynum; - bool ideal_match = false; - char *ourhostname; - - /* A maximally sized (wildly implausible) .Xauthority record - * consists of a 16-bit integer to start with, then four strings, - * each of which has a 16-bit length field followed by that many - * bytes of data (i.e. up to 0xFFFF bytes). */ - const size_t MAX_RECORD_SIZE = 2 + 4 * (2+0xFFFF); - - /* We'll want a buffer of twice that size (see below). */ - const size_t BUF_SIZE = 2 * MAX_RECORD_SIZE; - - /* - * Normally we should look for precisely the details specified in - * `disp'. However, there's an oddity when the display is local: - * displays like "localhost:0" usually have their details stored - * in a Unix-domain-socket record (even if there isn't actually a - * real Unix-domain socket available, as with OpenSSH's proxy X11 - * server). - * - * This is apparently a fudge to get round the meaninglessness of - * "localhost" in a shared-home-directory context -- xauth entries - * for Unix-domain sockets already disambiguate this by storing - * the *local* hostname in the conveniently-blank hostname field, - * but IP "localhost" records couldn't do this. So, typically, an - * IP "localhost" entry in the auth database isn't present and if - * it were it would be ignored. - * - * However, we don't entirely trust that (say) Windows X servers - * won't rely on a straight "localhost" entry, bad idea though - * that is; so if we can't find a Unix-domain-socket entry we'll - * fall back to an IP-based entry if we can find one. - */ - bool localhost = !disp->unixdomain && sk_address_is_local(disp->addr); - - authfp = fopen(authfilename, "rb"); - if (!authfp) - return; - - ourhostname = get_hostname(); - - /* - * Allocate enough space to hold two maximally sized records, so - * that a full record can start anywhere in the first half. That - * way we avoid the accidentally-quadratic algorithm that would - * arise if we moved everything to the front of the buffer after - * consuming each record; instead, we only move everything to the - * front after our current position gets past the half-way mark. - * Before then, there's no need to move anyway; so this guarantees - * linear time, in that every byte written into this buffer moves - * at most once (because every move is from the second half of the - * buffer to the first half). - */ - buf = snewn(BUF_SIZE, char); - size = fread(buf, 1, BUF_SIZE, authfp); - BinarySource_BARE_INIT(src, buf, size); - - while (!ideal_match) { - bool match = false; - - if (src->pos >= MAX_RECORD_SIZE) { - size -= src->pos; - memcpy(buf, buf + src->pos, size); - size += fread(buf + size, 1, BUF_SIZE - size, authfp); - BinarySource_BARE_INIT(src, buf, size); - } - - family = get_uint16(src); - addr = get_string_xauth(src); - displaynum_string = mkstr(get_string_xauth(src)); - displaynum = displaynum_string[0] ? atoi(displaynum_string) : -1; - sfree(displaynum_string); - protoname = get_string_xauth(src); - data = get_string_xauth(src); - if (get_err(src)) - break; - - /* - * Now we have a full X authority record in memory. See - * whether it matches the display we're trying to - * authenticate to. - * - * The details we've just read should be interpreted as - * follows: - * - * - 'family' is the network address family used to - * connect to the display. 0 means IPv4; 6 means IPv6; - * 256 means Unix-domain sockets. - * - * - 'addr' is the network address itself. For IPv4 and - * IPv6, this is a string of binary data of the - * appropriate length (respectively 4 and 16 bytes) - * representing the address in big-endian format, e.g. - * 7F 00 00 01 means IPv4 localhost. For Unix-domain - * sockets, this is the host name of the machine on - * which the Unix-domain display resides (so that an - * .Xauthority file on a shared file system can contain - * authority entries for Unix-domain displays on - * several machines without them clashing). - * - * - 'displaynum' is the display number. An empty display - * number is a wildcard for any display number. - * - * - 'protoname' is the authorisation protocol, encoded as - * its canonical string name (i.e. "MIT-MAGIC-COOKIE-1", - * "XDM-AUTHORIZATION-1" or something we don't recognise). - * - * - 'data' is the actual authorisation data, stored in - * binary form. - */ - - if (disp->displaynum < 0 || - (displaynum >= 0 && disp->displaynum != displaynum)) - continue; /* not the one */ - - for (protocol = 1; protocol < lenof(x11_authnames); protocol++) - if (ptrlen_eq_string(protoname, x11_authnames[protocol])) - break; - if (protocol == lenof(x11_authnames)) - continue; /* don't recognise this protocol, look for another */ - - switch (family) { - case 0: /* IPv4 */ - if (!disp->unixdomain && - sk_addrtype(disp->addr) == ADDRTYPE_IPV4) { - char buf[4]; - sk_addrcopy(disp->addr, buf); - if (addr.len == 4 && !memcmp(addr.ptr, buf, 4)) { - match = true; - /* If this is a "localhost" entry, note it down - * but carry on looking for a Unix-domain entry. */ - ideal_match = !localhost; - } - } - break; - case 6: /* IPv6 */ - if (!disp->unixdomain && - sk_addrtype(disp->addr) == ADDRTYPE_IPV6) { - char buf[16]; - sk_addrcopy(disp->addr, buf); - if (addr.len == 16 && !memcmp(addr.ptr, buf, 16)) { - match = true; - ideal_match = !localhost; - } - } - break; - case 256: /* Unix-domain / localhost */ - if ((disp->unixdomain || localhost) - && ourhostname && ptrlen_eq_string(addr, ourhostname)) { - /* A matching Unix-domain socket is always the best - * match. */ - match = true; - ideal_match = true; - } - break; - } - - if (match) { - /* Current best guess -- may be overridden if !ideal_match */ - disp->localauthproto = protocol; - sfree(disp->localauthdata); /* free previous guess, if any */ - disp->localauthdata = snewn(data.len, unsigned char); - memcpy(disp->localauthdata, data.ptr, data.len); - disp->localauthdatalen = data.len; - } - } - - fclose(authfp); - smemclr(buf, 2 * MAX_RECORD_SIZE); - sfree(buf); - sfree(ourhostname); -} - -void x11_format_auth_for_authfile( - BinarySink *bs, SockAddr *addr, int display_no, - ptrlen authproto, ptrlen authdata) -{ - if (sk_address_is_special_local(addr)) { - char *ourhostname = get_hostname(); - put_uint16(bs, 256); /* indicates Unix-domain socket */ - put_stringpl_xauth(bs, ptrlen_from_asciz(ourhostname)); - sfree(ourhostname); - } else if (sk_addrtype(addr) == ADDRTYPE_IPV4) { - char ipv4buf[4]; - sk_addrcopy(addr, ipv4buf); - put_uint16(bs, 0); /* indicates IPv4 */ - put_stringpl_xauth(bs, make_ptrlen(ipv4buf, 4)); - } else if (sk_addrtype(addr) == ADDRTYPE_IPV6) { - char ipv6buf[16]; - sk_addrcopy(addr, ipv6buf); - put_uint16(bs, 6); /* indicates IPv6 */ - put_stringpl_xauth(bs, make_ptrlen(ipv6buf, 16)); - } else { - unreachable("Bad address type in x11_format_auth_for_authfile"); - } - - { - char *numberbuf = dupprintf("%d", display_no); - put_stringpl_xauth(bs, ptrlen_from_asciz(numberbuf)); - sfree(numberbuf); - } - - put_stringpl_xauth(bs, authproto); - put_stringpl_xauth(bs, authdata); -} - static void x11_log(Plug *p, PlugLogType type, SockAddr *addr, int port, const char *error_msg, int error_code) { @@ -693,13 +267,12 @@ static void x11_log(Plug *p, PlugLogType type, SockAddr *addr, int port, static void x11_send_init_error(struct X11Connection *conn, const char *err_message); -static void x11_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void x11_closing(Plug *plug, PlugCloseType type, const char *error_msg) { struct X11Connection *xconn = container_of( plug, struct X11Connection, plug); - if (error_msg) { + if (type != PLUGCLOSE_NORMAL) { /* * Socket error. If we're still at the connection setup stage, * construct an X11 error packet passing on the problem. @@ -743,24 +316,6 @@ static void x11_sent(Plug *plug, size_t bufsize) sshfwd_unthrottle(xconn->c, bufsize); } -/* - * When setting up X forwarding, we should send the screen number - * from the specified local display. This function extracts it from - * the display string. - */ -int x11_get_screen_number(char *display) -{ - int n; - - n = host_strcspn(display, ":"); - if (!display[n]) - return 0; - n = strcspn(display, "."); - if (!display[n]) - return 0; - return atoi(display + n + 1); -} - static const PlugVtable X11Connection_plugvt = { .log = x11_log, .closing = x11_closing, @@ -898,23 +453,6 @@ static void x11_send_init_error(struct X11Connection *xconn, sfree(full_message); } -static bool x11_parse_ip(const char *addr_string, unsigned long *ip) -{ - - /* - * See if we can make sense of this string as an IPv4 address, for - * XDM-AUTHORIZATION-1 purposes. - */ - int i[4]; - if (addr_string && - 4 == sscanf(addr_string, "%d.%d.%d.%d", i+0, i+1, i+2, i+3)) { - *ip = (i[0] << 24) | (i[1] << 16) | (i[2] << 8) | i[3]; - return true; - } else { - return false; - } -} - /* * Called to send data down the raw connection. */ @@ -1025,7 +563,7 @@ static size_t x11_send( xconn->s = new_connection(sk_addr_dup(xconn->disp->addr), xconn->disp->realhost, xconn->disp->port, false, true, false, false, &xconn->plug, - sshfwd_get_conf(xconn->c)); + sshfwd_get_conf(xconn->c), NULL); if ((err = sk_socket_error(xconn->s)) != NULL) { char *err_message = dupprintf("unable to connect to" " forwarded X server: %s", err); @@ -1098,104 +636,3 @@ static char *x11_log_close_msg(Channel *chan) { return dupstr("Forwarded X11 connection terminated"); } - -/* - * Utility functions used by connection sharing to convert textual - * representations of an X11 auth protocol name + hex cookie into our - * usual integer protocol id and binary auth data. - */ -int x11_identify_auth_proto(ptrlen protoname) -{ - int protocol; - - for (protocol = 1; protocol < lenof(x11_authnames); protocol++) - if (ptrlen_eq_string(protoname, x11_authnames[protocol])) - return protocol; - return -1; -} - -void *x11_dehexify(ptrlen hexpl, int *outlen) -{ - int len, i; - unsigned char *ret; - - len = hexpl.len / 2; - ret = snewn(len, unsigned char); - - for (i = 0; i < len; i++) { - char bytestr[3]; - unsigned val = 0; - bytestr[0] = ((const char *)hexpl.ptr)[2*i]; - bytestr[1] = ((const char *)hexpl.ptr)[2*i+1]; - bytestr[2] = '\0'; - sscanf(bytestr, "%x", &val); - ret[i] = val; - } - - *outlen = len; - return ret; -} - -/* - * Construct an X11 greeting packet, including making up the right - * authorisation data. - */ -void *x11_make_greeting(int endian, int protomajor, int protominor, - int auth_proto, const void *auth_data, int auth_len, - const char *peer_addr, int peer_port, - int *outlen) -{ - unsigned char *greeting; - unsigned char realauthdata[64]; - const char *authname; - const unsigned char *authdata; - int authnamelen, authnamelen_pad; - int authdatalen, authdatalen_pad; - int greeting_len; - - authname = x11_authnames[auth_proto]; - authnamelen = strlen(authname); - authnamelen_pad = (authnamelen + 3) & ~3; - - if (auth_proto == X11_MIT) { - authdata = auth_data; - authdatalen = auth_len; - } else if (auth_proto == X11_XDM && auth_len == 16) { - time_t t; - unsigned long peer_ip = 0; - - x11_parse_ip(peer_addr, &peer_ip); - - authdata = realauthdata; - authdatalen = 24; - memset(realauthdata, 0, authdatalen); - memcpy(realauthdata, auth_data, 8); - PUT_32BIT_MSB_FIRST(realauthdata+8, peer_ip); - PUT_16BIT_MSB_FIRST(realauthdata+12, peer_port); - t = time(NULL); - PUT_32BIT_MSB_FIRST(realauthdata+14, t); - - des_encrypt_xdmauth((char *)auth_data + 9, realauthdata, authdatalen); - } else { - authdata = realauthdata; - authdatalen = 0; - } - - authdatalen_pad = (authdatalen + 3) & ~3; - greeting_len = 12 + authnamelen_pad + authdatalen_pad; - - greeting = snewn(greeting_len, unsigned char); - memset(greeting, 0, greeting_len); - greeting[0] = endian; - PUT_16BIT_X11(endian, greeting+2, protomajor); - PUT_16BIT_X11(endian, greeting+4, protominor); - PUT_16BIT_X11(endian, greeting+6, authnamelen); - PUT_16BIT_X11(endian, greeting+8, authdatalen); - memcpy(greeting+12, authname, authnamelen); - memcpy(greeting+12+authnamelen_pad, authdata, authdatalen); - - smemclr(realauthdata, sizeof(realauthdata)); - - *outlen = greeting_len; - return greeting; -} diff --git a/code/sshzlib.c b/code/ssh/zlib.c similarity index 100% rename from code/sshzlib.c rename to code/ssh/zlib.c diff --git a/code/sshauxcrypt.c b/code/sshauxcrypt.c deleted file mode 100644 index 7f64b27..0000000 --- a/code/sshauxcrypt.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * sshauxcrypt.c: wrapper functions on crypto primitives for use in - * other contexts than the main SSH packet protocol, such as - * encrypting private key files and performing XDM-AUTHORIZATION-1. - * - * These all work through the standard cipher/hash/MAC APIs, so they - * don't need to live in the same actual source files as the ciphers - * they wrap, and I think it keeps things tidier to have them out of - * the way here instead. - */ - -#include "ssh.h" - -static ssh_cipher *aes256_pubkey_cipher(const void *key, const void *iv) -{ - /* - * PuTTY's own .PPK format for SSH-2 private key files is - * encrypted with 256-bit AES in CBC mode. - */ - ssh_cipher *cipher = ssh_cipher_new(&ssh_aes256_cbc); - ssh_cipher_setkey(cipher, key); - ssh_cipher_setiv(cipher, iv); - return cipher; -} - -void aes256_encrypt_pubkey(const void *key, const void *iv, void *blk, int len) -{ - ssh_cipher *c = aes256_pubkey_cipher(key, iv); - ssh_cipher_encrypt(c, blk, len); - ssh_cipher_free(c); -} - -void aes256_decrypt_pubkey(const void *key, const void *iv, void *blk, int len) -{ - ssh_cipher *c = aes256_pubkey_cipher(key, iv); - ssh_cipher_decrypt(c, blk, len); - ssh_cipher_free(c); -} - -static ssh_cipher *des3_pubkey_cipher(const void *vkey) -{ - /* - * SSH-1 private key files are encrypted with triple-DES in SSH-1 - * style (three separate CBC layers), but the same key is used for - * the first and third layers. - */ - ssh_cipher *c = ssh_cipher_new(&ssh_3des_ssh1); - uint8_t keys3[24], iv[8]; - - memcpy(keys3, vkey, 16); - memcpy(keys3 + 16, vkey, 8); - ssh_cipher_setkey(c, keys3); - smemclr(keys3, sizeof(keys3)); - - memset(iv, 0, 8); - ssh_cipher_setiv(c, iv); - - return c; -} - -void des3_decrypt_pubkey(const void *vkey, void *vblk, int len) -{ - ssh_cipher *c = des3_pubkey_cipher(vkey); - ssh_cipher_decrypt(c, vblk, len); - ssh_cipher_free(c); -} - -void des3_encrypt_pubkey(const void *vkey, void *vblk, int len) -{ - ssh_cipher *c = des3_pubkey_cipher(vkey); - ssh_cipher_encrypt(c, vblk, len); - ssh_cipher_free(c); -} - -static ssh_cipher *des3_pubkey_ossh_cipher(const void *vkey, const void *viv) -{ - /* - * OpenSSH PEM private key files are encrypted with triple-DES in - * SSH-2 style (one CBC layer), with three distinct keys, and an - * IV also generated from the passphrase. - */ - ssh_cipher *c = ssh_cipher_new(&ssh_3des_ssh2); - ssh_cipher_setkey(c, vkey); - ssh_cipher_setiv(c, viv); - return c; -} - -void des3_decrypt_pubkey_ossh(const void *vkey, const void *viv, - void *vblk, int len) -{ - ssh_cipher *c = des3_pubkey_ossh_cipher(vkey, viv); - ssh_cipher_decrypt(c, vblk, len); - ssh_cipher_free(c); -} - -void des3_encrypt_pubkey_ossh(const void *vkey, const void *viv, - void *vblk, int len) -{ - ssh_cipher *c = des3_pubkey_ossh_cipher(vkey, viv); - ssh_cipher_encrypt(c, vblk, len); - ssh_cipher_free(c); -} - -static ssh_cipher *des_xdmauth_cipher(const void *vkeydata) -{ - /* - * XDM-AUTHORIZATION-1 uses single-DES, but packs the key into 7 - * bytes, so here we have to repack it manually into the canonical - * form where it occupies 8 bytes each with the low bit unused. - */ - const unsigned char *keydata = (const unsigned char *)vkeydata; - unsigned char key[8]; - int i, nbits, j; - unsigned int bits; - - bits = 0; - nbits = 0; - j = 0; - for (i = 0; i < 8; i++) { - if (nbits < 7) { - bits = (bits << 8) | keydata[j]; - nbits += 8; - j++; - } - key[i] = (bits >> (nbits - 7)) << 1; - bits &= ~(0x7F << (nbits - 7)); - nbits -= 7; - } - - ssh_cipher *c = ssh_cipher_new(&ssh_des); - ssh_cipher_setkey(c, key); - smemclr(key, sizeof(key)); - ssh_cipher_setiv(c, key); - return c; -} - -void des_encrypt_xdmauth(const void *keydata, void *blk, int len) -{ - ssh_cipher *c = des_xdmauth_cipher(keydata); - ssh_cipher_encrypt(c, blk, len); - ssh_cipher_free(c); -} - -void des_decrypt_xdmauth(const void *keydata, void *blk, int len) -{ - ssh_cipher *c = des_xdmauth_cipher(keydata); - ssh_cipher_decrypt(c, blk, len); - ssh_cipher_free(c); -} - -void hash_simple(const ssh_hashalg *alg, ptrlen data, void *output) -{ - ssh_hash *hash = ssh_hash_new(alg); - put_datapl(hash, data); - ssh_hash_final(hash, output); -} - -void mac_simple(const ssh2_macalg *alg, ptrlen key, ptrlen data, void *output) -{ - ssh2_mac *mac = ssh2_mac_new(alg, NULL); - ssh2_mac_setkey(mac, key); - ssh2_mac_start(mac); - put_datapl(mac, data); - ssh2_mac_genresult(mac, output); - ssh2_mac_free(mac); -} diff --git a/code/sshcr.h b/code/sshcr.h index e87ce86..12bfea6 100644 --- a/code/sshcr.h +++ b/code/sshcr.h @@ -18,7 +18,6 @@ * Edit and Continue debugging feature causes their compiler to * violate ANSI C. To disable Edit and Continue debugging: * - * - right-click ssh.c in the FileView * - click Settings * - select the C/C++ tab and the General category * - under `Debug info:', select anything _other_ than `Program diff --git a/code/sshkeygen.h b/code/sshkeygen.h index 971a363..60b2e83 100644 --- a/code/sshkeygen.h +++ b/code/sshkeygen.h @@ -94,6 +94,14 @@ typedef struct MillerRabin MillerRabin; MillerRabin *miller_rabin_new(mp_int *p); void miller_rabin_free(MillerRabin *mr); +/* Perform a single Miller-Rabin test, using a specified witness value. + * Used in the test suite. */ +struct mr_result { + unsigned passed; + unsigned potential_primitive_root; +}; +struct mr_result miller_rabin_test(MillerRabin *mr, mp_int *w); + /* Perform a single Miller-Rabin test, using a random witness value. */ bool miller_rabin_test_random(MillerRabin *mr); @@ -286,7 +294,7 @@ extern const PrimeGenerationPolicy primegen_provable_maurer_complex; int rsa_generate(RSAKey *key, int bits, bool strong, PrimeGenerationContext *pgc, ProgressReceiver *prog); -int dsa_generate(struct dss_key *key, int bits, PrimeGenerationContext *pgc, +int dsa_generate(struct dsa_key *key, int bits, PrimeGenerationContext *pgc, ProgressReceiver *prog); int ecdsa_generate(struct ecdsa_key *key, int bits); int eddsa_generate(struct eddsa_key *key, int bits); diff --git a/code/sshpubk.c b/code/sshpubk.c index 641b53a..e13f8e2 100644 --- a/code/sshpubk.c +++ b/code/sshpubk.c @@ -566,10 +566,16 @@ const ssh_keyalg *const all_keyalgs[] = { &ssh_rsa, &ssh_rsa_sha256, &ssh_rsa_sha512, - &ssh_dss, + &ssh_dsa, &ssh_ecdsa_nistp256, &ssh_ecdsa_nistp384, &ssh_ecdsa_nistp521, +#ifdef PUTTY_CAC + &ssh_ecdsa_nistp256_sk, + &ssh_ecdsa_nistp384_sk, + &ssh_ecdsa_nistp521_sk, + &ssh_ecdsa_ed25519_sk, +#endif &ssh_ecdsa_ed25519, &ssh_ecdsa_ed448, }; @@ -1326,7 +1332,7 @@ bool ppk_loadpub_f(const Filename *filename, char **algorithm, BinarySink *bs, if (commentptr) { *commentptr = userkey->comment; } userkey->key->vt->public_blob(userkey->key, bs); userkey->key->vt->freekey(userkey->key); - sfree(userkey); + sfree(userkey); return true; } #endif // PUTTY_CAC @@ -1580,33 +1586,33 @@ strbuf *ppk_save_sb(ssh2_userkey *key, const char *passphrase, } strbuf *out = strbuf_new_nm(); - strbuf_catf(out, "PuTTY-User-Key-File-%u: %s\n", - params.fmt_version, ssh_key_ssh_id(key->key)); - strbuf_catf(out, "Encryption: %s\n", cipherstr); - strbuf_catf(out, "Comment: %s\n", key->comment); - strbuf_catf(out, "Public-Lines: %d\n", base64_lines(pub_blob->len)); + put_fmt(out, "PuTTY-User-Key-File-%u: %s\n", + params.fmt_version, ssh_key_ssh_id(key->key)); + put_fmt(out, "Encryption: %s\n", cipherstr); + put_fmt(out, "Comment: %s\n", key->comment); + put_fmt(out, "Public-Lines: %d\n", base64_lines(pub_blob->len)); base64_encode_s(BinarySink_UPCAST(out), pub_blob->u, pub_blob->len, 64); if (params.fmt_version == 3 && ciphertype->keylen != 0) { - strbuf_catf(out, "Key-Derivation: %s\n", - params.argon2_flavour == Argon2d ? "Argon2d" : - params.argon2_flavour == Argon2i ? "Argon2i" : "Argon2id"); - strbuf_catf(out, "Argon2-Memory: %"PRIu32"\n", params.argon2_mem); + put_fmt(out, "Key-Derivation: %s\n", + params.argon2_flavour == Argon2d ? "Argon2d" : + params.argon2_flavour == Argon2i ? "Argon2i" : "Argon2id"); + put_fmt(out, "Argon2-Memory: %"PRIu32"\n", params.argon2_mem); assert(!params.argon2_passes_auto); - strbuf_catf(out, "Argon2-Passes: %"PRIu32"\n", params.argon2_passes); - strbuf_catf(out, "Argon2-Parallelism: %"PRIu32"\n", - params.argon2_parallelism); - strbuf_catf(out, "Argon2-Salt: "); + put_fmt(out, "Argon2-Passes: %"PRIu32"\n", params.argon2_passes); + put_fmt(out, "Argon2-Parallelism: %"PRIu32"\n", + params.argon2_parallelism); + put_fmt(out, "Argon2-Salt: "); for (size_t i = 0; i < passphrase_salt->len; i++) - strbuf_catf(out, "%02x", passphrase_salt->u[i]); - strbuf_catf(out, "\n"); + put_fmt(out, "%02x", passphrase_salt->u[i]); + put_fmt(out, "\n"); } - strbuf_catf(out, "Private-Lines: %d\n", base64_lines(priv_encrypted_len)); + put_fmt(out, "Private-Lines: %d\n", base64_lines(priv_encrypted_len)); base64_encode_s(BinarySink_UPCAST(out), priv_blob_encrypted, priv_encrypted_len, 64); - strbuf_catf(out, "Private-MAC: "); + put_fmt(out, "Private-MAC: "); for (i = 0; i < macalg->len; i++) - strbuf_catf(out, "%02x", priv_mac[i]); - strbuf_catf(out, "\n"); + put_fmt(out, "%02x", priv_mac[i]); + put_fmt(out, "\n"); strbuf_free(cipher_mac_keys_blob); strbuf_free(passphrase_salt); @@ -1704,7 +1710,7 @@ char* ssh2_pubkey_openssh_str_direct(const char* comment, { return ssh2_pubkey_openssh_str_internal(comment, v_pub_blob, pub_len); } -#endif +#endif // PUTTY_CAC char *ssh2_pubkey_openssh_str(ssh2_userkey *key) { @@ -1779,7 +1785,7 @@ static void ssh2_fingerprint_blob_md5(ptrlen blob, strbuf *sb) hash_simple(&ssh_md5, blob, digest); for (unsigned i = 0; i < 16; i++) - strbuf_catf(sb, "%02x%s", digest[i], i==15 ? "" : ":"); + put_fmt(sb, "%02x%s", digest[i], i==15 ? "" : ":"); } static void ssh2_fingerprint_blob_sha256(ptrlen blob, strbuf *sb) @@ -1817,9 +1823,9 @@ char *ssh2_fingerprint_blob(ptrlen blob, FingerprintType fptype) const ssh_keyalg *alg = find_pubkey_alg_len(algname); if (alg) { int bits = ssh_key_public_bits(alg, blob); - strbuf_catf(sb, "%.*s %d ", PTRLEN_PRINTF(algname), bits); + put_fmt(sb, "%.*s %d ", PTRLEN_PRINTF(algname), bits); } else { - strbuf_catf(sb, "%.*s ", PTRLEN_PRINTF(algname)); + put_fmt(sb, "%.*s ", PTRLEN_PRINTF(algname)); } } diff --git a/code/sshsh256.c b/code/sshsh256.c deleted file mode 100644 index db1f96b..0000000 --- a/code/sshsh256.c +++ /dev/null @@ -1,940 +0,0 @@ -/* - * SHA-256 algorithm as described at - * - * http://csrc.nist.gov/cryptval/shs.html - */ - -#include "ssh.h" -#include - -/* - * Start by deciding whether we can support hardware SHA at all. - */ -#define HW_SHA256_NONE 0 -#define HW_SHA256_NI 1 -#define HW_SHA256_NEON 2 - -#ifdef _FORCE_SHA_NI -# define HW_SHA256 HW_SHA256_NI -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__x86_64__) || defined(__i386)) -# define HW_SHA256 HW_SHA256_NI -# endif -#elif defined(__GNUC__) -# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \ - (defined(__x86_64__) || defined(__i386)) -# define HW_SHA256 HW_SHA256_NI -# endif -#elif defined (_MSC_VER) -# if (defined(_M_X64) || defined(_M_IX86)) && _MSC_FULL_VER >= 150030729 -# define HW_SHA256 HW_SHA256_NI -# endif -#endif - -#ifdef _FORCE_SHA_NEON -# define HW_SHA256 HW_SHA256_NEON -#elif defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - /* Arm can potentially support both endiannesses, but this code - * hasn't been tested on anything but little. If anyone wants to - * run big-endian, they'll need to fix it first. */ -#elif defined __ARM_FEATURE_CRYPTO - /* If the Arm crypto extension is available already, we can - * support NEON SHA without having to enable anything by hand */ -# define HW_SHA256 HW_SHA256_NEON -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__aarch64__)) - /* clang can enable the crypto extension in AArch64 using - * __attribute__((target)) */ -# define HW_SHA256 HW_SHA256_NEON -# define USE_CLANG_ATTR_TARGET_AARCH64 -# endif -#elif defined _MSC_VER - /* Visual Studio supports the crypto extension when targeting - * AArch64, but as of VS2017, the AArch32 header doesn't quite - * manage it (declaring the shae/shad intrinsics without a round - * key operand). */ -# if defined _M_ARM64 -# define HW_SHA256 HW_SHA256_NEON -# if defined _M_ARM64 -# define USE_ARM64_NEON_H /* unusual header name in this case */ -# endif -# endif -#endif - -#if defined _FORCE_SOFTWARE_SHA || !defined HW_SHA256 -# undef HW_SHA256 -# define HW_SHA256 HW_SHA256_NONE -#endif - -/* - * The actual query function that asks if hardware acceleration is - * available. - */ -static bool sha256_hw_available(void); - -/* - * The top-level selection function, caching the results of - * sha256_hw_available() so it only has to run once. - */ -static bool sha256_hw_available_cached(void) -{ - static bool initialised = false; - static bool hw_available; - if (!initialised) { - hw_available = sha256_hw_available(); - initialised = true; - } - return hw_available; -} - -static ssh_hash *sha256_select(const ssh_hashalg *alg) -{ - const ssh_hashalg *real_alg = - sha256_hw_available_cached() ? &ssh_sha256_hw : &ssh_sha256_sw; - - return ssh_hash_new(real_alg); -} - -const ssh_hashalg ssh_sha256 = { - .new = sha256_select, - .hlen = 32, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-256", "dummy selector vtable"), -}; - -/* ---------------------------------------------------------------------- - * Definitions likely to be helpful to multiple implementations. - */ - -static const uint32_t sha256_initial_state[] = { - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -}; - -static const uint32_t sha256_round_constants[] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, -}; - -#define SHA256_ROUNDS 64 - -typedef struct sha256_block sha256_block; -struct sha256_block { - uint8_t block[64]; - size_t used; - uint64_t len; -}; - -static inline void sha256_block_setup(sha256_block *blk) -{ - blk->used = 0; - blk->len = 0; -} - -static inline bool sha256_block_write( - sha256_block *blk, const void **vdata, size_t *len) -{ - size_t blkleft = sizeof(blk->block) - blk->used; - size_t chunk = *len < blkleft ? *len : blkleft; - - const uint8_t *p = *vdata; - memcpy(blk->block + blk->used, p, chunk); - *vdata = p + chunk; - *len -= chunk; - blk->used += chunk; - blk->len += chunk; - - if (blk->used == sizeof(blk->block)) { - blk->used = 0; - return true; - } - - return false; -} - -static inline void sha256_block_pad(sha256_block *blk, BinarySink *bs) -{ - uint64_t final_len = blk->len << 3; - size_t pad = 1 + (63 & (55 - blk->used)); - - put_byte(bs, 0x80); - for (size_t i = 1; i < pad; i++) - put_byte(bs, 0); - put_uint64(bs, final_len); - - assert(blk->used == 0 && "Should have exactly hit a block boundary"); -} - -/* ---------------------------------------------------------------------- - * Software implementation of SHA-256. - */ - -static inline uint32_t ror(uint32_t x, unsigned y) -{ - return (x << (31 & -y)) | (x >> (31 & y)); -} - -static inline uint32_t Ch(uint32_t ctrl, uint32_t if1, uint32_t if0) -{ - return if0 ^ (ctrl & (if1 ^ if0)); -} - -static inline uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) -{ - return (x & y) | (z & (x | y)); -} - -static inline uint32_t Sigma_0(uint32_t x) -{ - return ror(x,2) ^ ror(x,13) ^ ror(x,22); -} - -static inline uint32_t Sigma_1(uint32_t x) -{ - return ror(x,6) ^ ror(x,11) ^ ror(x,25); -} - -static inline uint32_t sigma_0(uint32_t x) -{ - return ror(x,7) ^ ror(x,18) ^ (x >> 3); -} - -static inline uint32_t sigma_1(uint32_t x) -{ - return ror(x,17) ^ ror(x,19) ^ (x >> 10); -} - -static inline void sha256_sw_round( - unsigned round_index, const uint32_t *schedule, - uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, - uint32_t *e, uint32_t *f, uint32_t *g, uint32_t *h) -{ - uint32_t t1 = *h + Sigma_1(*e) + Ch(*e,*f,*g) + - sha256_round_constants[round_index] + schedule[round_index]; - - uint32_t t2 = Sigma_0(*a) + Maj(*a,*b,*c); - - *d += t1; - *h = t1 + t2; -} - -static void sha256_sw_block(uint32_t *core, const uint8_t *block) -{ - uint32_t w[SHA256_ROUNDS]; - uint32_t a,b,c,d,e,f,g,h; - - for (size_t t = 0; t < 16; t++) - w[t] = GET_32BIT_MSB_FIRST(block + 4*t); - - for (size_t t = 16; t < SHA256_ROUNDS; t++) - w[t] = sigma_1(w[t-2]) + w[t-7] + sigma_0(w[t-15]) + w[t-16]; - - a = core[0]; b = core[1]; c = core[2]; d = core[3]; - e = core[4]; f = core[5]; g = core[6]; h = core[7]; - - for (size_t t = 0; t < SHA256_ROUNDS; t += 8) { - sha256_sw_round(t+0, w, &a,&b,&c,&d,&e,&f,&g,&h); - sha256_sw_round(t+1, w, &h,&a,&b,&c,&d,&e,&f,&g); - sha256_sw_round(t+2, w, &g,&h,&a,&b,&c,&d,&e,&f); - sha256_sw_round(t+3, w, &f,&g,&h,&a,&b,&c,&d,&e); - sha256_sw_round(t+4, w, &e,&f,&g,&h,&a,&b,&c,&d); - sha256_sw_round(t+5, w, &d,&e,&f,&g,&h,&a,&b,&c); - sha256_sw_round(t+6, w, &c,&d,&e,&f,&g,&h,&a,&b); - sha256_sw_round(t+7, w, &b,&c,&d,&e,&f,&g,&h,&a); - } - - core[0] += a; core[1] += b; core[2] += c; core[3] += d; - core[4] += e; core[5] += f; core[6] += g; core[7] += h; - - smemclr(w, sizeof(w)); -} - -typedef struct sha256_sw { - uint32_t core[8]; - sha256_block blk; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha256_sw; - -static void sha256_sw_write(BinarySink *bs, const void *vp, size_t len); - -static ssh_hash *sha256_sw_new(const ssh_hashalg *alg) -{ - sha256_sw *s = snew(sha256_sw); - - s->hash.vt = alg; - BinarySink_INIT(s, sha256_sw_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -static void sha256_sw_reset(ssh_hash *hash) -{ - sha256_sw *s = container_of(hash, sha256_sw, hash); - - memcpy(s->core, sha256_initial_state, sizeof(s->core)); - sha256_block_setup(&s->blk); -} - -static void sha256_sw_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha256_sw *copy = container_of(hcopy, sha256_sw, hash); - sha256_sw *orig = container_of(horig, sha256_sw, hash); - - memcpy(copy, orig, sizeof(*copy)); - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha256_sw_free(ssh_hash *hash) -{ - sha256_sw *s = container_of(hash, sha256_sw, hash); - - smemclr(s, sizeof(*s)); - sfree(s); -} - -static void sha256_sw_write(BinarySink *bs, const void *vp, size_t len) -{ - sha256_sw *s = BinarySink_DOWNCAST(bs, sha256_sw); - - while (len > 0) - if (sha256_block_write(&s->blk, &vp, &len)) - sha256_sw_block(s->core, s->blk.block); -} - -static void sha256_sw_digest(ssh_hash *hash, uint8_t *digest) -{ - sha256_sw *s = container_of(hash, sha256_sw, hash); - - sha256_block_pad(&s->blk, BinarySink_UPCAST(s)); - for (size_t i = 0; i < 8; i++) - PUT_32BIT_MSB_FIRST(digest + 4*i, s->core[i]); -} - -const ssh_hashalg ssh_sha256_sw = { - .new = sha256_sw_new, - .reset = sha256_sw_reset, - .copyfrom = sha256_sw_copyfrom, - .digest = sha256_sw_digest, - .free = sha256_sw_free, - .hlen = 32, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-256", "unaccelerated"), -}; - -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of SHA-256 using x86 SHA-NI. - */ - -#if HW_SHA256 == HW_SHA256_NI - -/* - * Set target architecture for Clang and GCC - */ -#if defined(__clang__) || defined(__GNUC__) -# define FUNC_ISA __attribute__ ((target("sse4.1,sha"))) -#if !defined(__clang__) -# pragma GCC target("sha") -# pragma GCC target("sse4.1") -#endif -#else -# define FUNC_ISA -#endif - -#include -#include -#include -#if defined(__clang__) || defined(__GNUC__) -#include -#endif - -#if defined(__clang__) || defined(__GNUC__) -#include -#define GET_CPU_ID_0(out) \ - __cpuid(0, (out)[0], (out)[1], (out)[2], (out)[3]) -#define GET_CPU_ID_7(out) \ - __cpuid_count(7, 0, (out)[0], (out)[1], (out)[2], (out)[3]) -#else -#define GET_CPU_ID_0(out) __cpuid(out, 0) -#define GET_CPU_ID_7(out) __cpuidex(out, 7, 0) -#endif - -static bool sha256_hw_available(void) -{ - unsigned int CPUInfo[4]; - GET_CPU_ID_0(CPUInfo); - if (CPUInfo[0] < 7) - return false; - - GET_CPU_ID_7(CPUInfo); - return CPUInfo[1] & (1 << 29); /* Check SHA */ -} - -/* SHA256 implementation using new instructions - The code is based on Jeffrey Walton's SHA256 implementation: - https://github.com/noloader/SHA-Intrinsics -*/ -FUNC_ISA -static inline void sha256_ni_block(__m128i *core, const uint8_t *p) -{ - __m128i STATE0, STATE1; - __m128i MSG, TMP; - __m128i MSG0, MSG1, MSG2, MSG3; - const __m128i *block = (const __m128i *)p; - const __m128i MASK = _mm_set_epi64x( - 0x0c0d0e0f08090a0bULL, 0x0405060700010203ULL); - - /* Load initial values */ - STATE0 = core[0]; - STATE1 = core[1]; - - /* Rounds 0-3 */ - MSG = _mm_loadu_si128(block); - MSG0 = _mm_shuffle_epi8(MSG, MASK); - MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( - 0xE9B5DBA5B5C0FBCFULL, 0x71374491428A2F98ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - - /* Rounds 4-7 */ - MSG1 = _mm_loadu_si128(block + 1); - MSG1 = _mm_shuffle_epi8(MSG1, MASK); - MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( - 0xAB1C5ED5923F82A4ULL, 0x59F111F13956C25BULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG0 = _mm_sha256msg1_epu32(MSG0, MSG1); - - /* Rounds 8-11 */ - MSG2 = _mm_loadu_si128(block + 2); - MSG2 = _mm_shuffle_epi8(MSG2, MASK); - MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( - 0x550C7DC3243185BEULL, 0x12835B01D807AA98ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG1 = _mm_sha256msg1_epu32(MSG1, MSG2); - - /* Rounds 12-15 */ - MSG3 = _mm_loadu_si128(block + 3); - MSG3 = _mm_shuffle_epi8(MSG3, MASK); - MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( - 0xC19BF1749BDC06A7ULL, 0x80DEB1FE72BE5D74ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG3, MSG2, 4); - MSG0 = _mm_add_epi32(MSG0, TMP); - MSG0 = _mm_sha256msg2_epu32(MSG0, MSG3); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG2 = _mm_sha256msg1_epu32(MSG2, MSG3); - - /* Rounds 16-19 */ - MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( - 0x240CA1CC0FC19DC6ULL, 0xEFBE4786E49B69C1ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG0, MSG3, 4); - MSG1 = _mm_add_epi32(MSG1, TMP); - MSG1 = _mm_sha256msg2_epu32(MSG1, MSG0); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG3 = _mm_sha256msg1_epu32(MSG3, MSG0); - - /* Rounds 20-23 */ - MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( - 0x76F988DA5CB0A9DCULL, 0x4A7484AA2DE92C6FULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG1, MSG0, 4); - MSG2 = _mm_add_epi32(MSG2, TMP); - MSG2 = _mm_sha256msg2_epu32(MSG2, MSG1); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG0 = _mm_sha256msg1_epu32(MSG0, MSG1); - - /* Rounds 24-27 */ - MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( - 0xBF597FC7B00327C8ULL, 0xA831C66D983E5152ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG2, MSG1, 4); - MSG3 = _mm_add_epi32(MSG3, TMP); - MSG3 = _mm_sha256msg2_epu32(MSG3, MSG2); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG1 = _mm_sha256msg1_epu32(MSG1, MSG2); - - /* Rounds 28-31 */ - MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( - 0x1429296706CA6351ULL, 0xD5A79147C6E00BF3ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG3, MSG2, 4); - MSG0 = _mm_add_epi32(MSG0, TMP); - MSG0 = _mm_sha256msg2_epu32(MSG0, MSG3); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG2 = _mm_sha256msg1_epu32(MSG2, MSG3); - - /* Rounds 32-35 */ - MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( - 0x53380D134D2C6DFCULL, 0x2E1B213827B70A85ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG0, MSG3, 4); - MSG1 = _mm_add_epi32(MSG1, TMP); - MSG1 = _mm_sha256msg2_epu32(MSG1, MSG0); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG3 = _mm_sha256msg1_epu32(MSG3, MSG0); - - /* Rounds 36-39 */ - MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( - 0x92722C8581C2C92EULL, 0x766A0ABB650A7354ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG1, MSG0, 4); - MSG2 = _mm_add_epi32(MSG2, TMP); - MSG2 = _mm_sha256msg2_epu32(MSG2, MSG1); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG0 = _mm_sha256msg1_epu32(MSG0, MSG1); - - /* Rounds 40-43 */ - MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( - 0xC76C51A3C24B8B70ULL, 0xA81A664BA2BFE8A1ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG2, MSG1, 4); - MSG3 = _mm_add_epi32(MSG3, TMP); - MSG3 = _mm_sha256msg2_epu32(MSG3, MSG2); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG1 = _mm_sha256msg1_epu32(MSG1, MSG2); - - /* Rounds 44-47 */ - MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( - 0x106AA070F40E3585ULL, 0xD6990624D192E819ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG3, MSG2, 4); - MSG0 = _mm_add_epi32(MSG0, TMP); - MSG0 = _mm_sha256msg2_epu32(MSG0, MSG3); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG2 = _mm_sha256msg1_epu32(MSG2, MSG3); - - /* Rounds 48-51 */ - MSG = _mm_add_epi32(MSG0, _mm_set_epi64x( - 0x34B0BCB52748774CULL, 0x1E376C0819A4C116ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG0, MSG3, 4); - MSG1 = _mm_add_epi32(MSG1, TMP); - MSG1 = _mm_sha256msg2_epu32(MSG1, MSG0); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - MSG3 = _mm_sha256msg1_epu32(MSG3, MSG0); - - /* Rounds 52-55 */ - MSG = _mm_add_epi32(MSG1, _mm_set_epi64x( - 0x682E6FF35B9CCA4FULL, 0x4ED8AA4A391C0CB3ULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG1, MSG0, 4); - MSG2 = _mm_add_epi32(MSG2, TMP); - MSG2 = _mm_sha256msg2_epu32(MSG2, MSG1); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - - /* Rounds 56-59 */ - MSG = _mm_add_epi32(MSG2, _mm_set_epi64x( - 0x8CC7020884C87814ULL, 0x78A5636F748F82EEULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - TMP = _mm_alignr_epi8(MSG2, MSG1, 4); - MSG3 = _mm_add_epi32(MSG3, TMP); - MSG3 = _mm_sha256msg2_epu32(MSG3, MSG2); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - - /* Rounds 60-63 */ - MSG = _mm_add_epi32(MSG3, _mm_set_epi64x( - 0xC67178F2BEF9A3F7ULL, 0xA4506CEB90BEFFFAULL)); - STATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG); - MSG = _mm_shuffle_epi32(MSG, 0x0E); - STATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG); - - /* Combine state */ - core[0] = _mm_add_epi32(STATE0, core[0]); - core[1] = _mm_add_epi32(STATE1, core[1]); -} - -typedef struct sha256_ni { - /* - * These two vectors store the 8 words of the SHA-256 state, but - * not in the same order they appear in the spec: the first word - * holds A,B,E,F and the second word C,D,G,H. - */ - __m128i core[2]; - sha256_block blk; - void *pointer_to_free; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha256_ni; - -static void sha256_ni_write(BinarySink *bs, const void *vp, size_t len); - -static sha256_ni *sha256_ni_alloc(void) -{ - /* - * The __m128i variables in the context structure need to be - * 16-byte aligned, but not all malloc implementations that this - * code has to work with will guarantee to return a 16-byte - * aligned pointer. So we over-allocate, manually realign the - * pointer ourselves, and store the original one inside the - * context so we know how to free it later. - */ - void *allocation = smalloc(sizeof(sha256_ni) + 15); - uintptr_t alloc_address = (uintptr_t)allocation; - uintptr_t aligned_address = (alloc_address + 15) & ~15; - sha256_ni *s = (sha256_ni *)aligned_address; - s->pointer_to_free = allocation; - return s; -} - -static ssh_hash *sha256_ni_new(const ssh_hashalg *alg) -{ - if (!sha256_hw_available_cached()) - return NULL; - - sha256_ni *s = sha256_ni_alloc(); - - s->hash.vt = alg; - BinarySink_INIT(s, sha256_ni_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - - return &s->hash; -} - -FUNC_ISA static void sha256_ni_reset(ssh_hash *hash) -{ - sha256_ni *s = container_of(hash, sha256_ni, hash); - - /* Initialise the core vectors in their storage order */ - s->core[0] = _mm_set_epi64x( - 0x6a09e667bb67ae85ULL, 0x510e527f9b05688cULL); - s->core[1] = _mm_set_epi64x( - 0x3c6ef372a54ff53aULL, 0x1f83d9ab5be0cd19ULL); - - sha256_block_setup(&s->blk); -} - -static void sha256_ni_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha256_ni *copy = container_of(hcopy, sha256_ni, hash); - sha256_ni *orig = container_of(horig, sha256_ni, hash); - - void *ptf_save = copy->pointer_to_free; - *copy = *orig; /* structure copy */ - copy->pointer_to_free = ptf_save; - - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha256_ni_free(ssh_hash *hash) -{ - sha256_ni *s = container_of(hash, sha256_ni, hash); - - void *ptf = s->pointer_to_free; - smemclr(s, sizeof(*s)); - sfree(ptf); -} - -static void sha256_ni_write(BinarySink *bs, const void *vp, size_t len) -{ - sha256_ni *s = BinarySink_DOWNCAST(bs, sha256_ni); - - while (len > 0) - if (sha256_block_write(&s->blk, &vp, &len)) - sha256_ni_block(s->core, s->blk.block); -} - -FUNC_ISA static void sha256_ni_digest(ssh_hash *hash, uint8_t *digest) -{ - sha256_ni *s = container_of(hash, sha256_ni, hash); - - sha256_block_pad(&s->blk, BinarySink_UPCAST(s)); - - /* Rearrange the words into the output order */ - __m128i feba = _mm_shuffle_epi32(s->core[0], 0x1B); - __m128i dchg = _mm_shuffle_epi32(s->core[1], 0xB1); - __m128i dcba = _mm_blend_epi16(feba, dchg, 0xF0); - __m128i hgfe = _mm_alignr_epi8(dchg, feba, 8); - - /* Byte-swap them into the output endianness */ - const __m128i mask = _mm_setr_epi8(3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12); - dcba = _mm_shuffle_epi8(dcba, mask); - hgfe = _mm_shuffle_epi8(hgfe, mask); - - /* And store them */ - __m128i *output = (__m128i *)digest; - _mm_storeu_si128(output, dcba); - _mm_storeu_si128(output+1, hgfe); -} - -const ssh_hashalg ssh_sha256_hw = { - .new = sha256_ni_new, - .reset = sha256_ni_reset, - .copyfrom = sha256_ni_copyfrom, - .digest = sha256_ni_digest, - .free = sha256_ni_free, - .hlen = 32, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-256", "SHA-NI accelerated"), -}; - -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of SHA-256 using Arm NEON. - */ - -#elif HW_SHA256 == HW_SHA256_NEON - -/* - * Manually set the target architecture, if we decided above that we - * need to. - */ -#ifdef USE_CLANG_ATTR_TARGET_AARCH64 -/* - * A spot of cheating: redefine some ACLE feature macros before - * including arm_neon.h. Otherwise we won't get the SHA intrinsics - * defined by that header, because it will be looking at the settings - * for the whole translation unit rather than the ones we're going to - * put on some particular functions using __attribute__((target)). - */ -#define __ARM_NEON 1 -#define __ARM_FEATURE_CRYPTO 1 -#define __ARM_FEATURE_SHA2 1 -#define FUNC_ISA __attribute__ ((target("neon,crypto"))) -#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */ - -#ifndef FUNC_ISA -#define FUNC_ISA -#endif - -#ifdef USE_ARM64_NEON_H -#include -#else -#include -#endif - -static bool sha256_hw_available(void) -{ - /* - * For Arm, we delegate to a per-platform detection function (see - * explanation in sshaes.c). - */ - return platform_sha256_hw_available(); -} - -typedef struct sha256_neon_core sha256_neon_core; -struct sha256_neon_core { - uint32x4_t abcd, efgh; -}; - -FUNC_ISA -static inline uint32x4_t sha256_neon_load_input(const uint8_t *p) -{ - return vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(p))); -} - -FUNC_ISA -static inline uint32x4_t sha256_neon_schedule_update( - uint32x4_t m4, uint32x4_t m3, uint32x4_t m2, uint32x4_t m1) -{ - return vsha256su1q_u32(vsha256su0q_u32(m4, m3), m2, m1); -} - -FUNC_ISA -static inline sha256_neon_core sha256_neon_round4( - sha256_neon_core old, uint32x4_t sched, unsigned round) -{ - sha256_neon_core new; - - uint32x4_t round_input = vaddq_u32( - sched, vld1q_u32(sha256_round_constants + round)); - new.abcd = vsha256hq_u32 (old.abcd, old.efgh, round_input); - new.efgh = vsha256h2q_u32(old.efgh, old.abcd, round_input); - return new; -} - -FUNC_ISA -static inline void sha256_neon_block(sha256_neon_core *core, const uint8_t *p) -{ - uint32x4_t s0, s1, s2, s3; - sha256_neon_core cr = *core; - - s0 = sha256_neon_load_input(p); - cr = sha256_neon_round4(cr, s0, 0); - s1 = sha256_neon_load_input(p+16); - cr = sha256_neon_round4(cr, s1, 4); - s2 = sha256_neon_load_input(p+32); - cr = sha256_neon_round4(cr, s2, 8); - s3 = sha256_neon_load_input(p+48); - cr = sha256_neon_round4(cr, s3, 12); - s0 = sha256_neon_schedule_update(s0, s1, s2, s3); - cr = sha256_neon_round4(cr, s0, 16); - s1 = sha256_neon_schedule_update(s1, s2, s3, s0); - cr = sha256_neon_round4(cr, s1, 20); - s2 = sha256_neon_schedule_update(s2, s3, s0, s1); - cr = sha256_neon_round4(cr, s2, 24); - s3 = sha256_neon_schedule_update(s3, s0, s1, s2); - cr = sha256_neon_round4(cr, s3, 28); - s0 = sha256_neon_schedule_update(s0, s1, s2, s3); - cr = sha256_neon_round4(cr, s0, 32); - s1 = sha256_neon_schedule_update(s1, s2, s3, s0); - cr = sha256_neon_round4(cr, s1, 36); - s2 = sha256_neon_schedule_update(s2, s3, s0, s1); - cr = sha256_neon_round4(cr, s2, 40); - s3 = sha256_neon_schedule_update(s3, s0, s1, s2); - cr = sha256_neon_round4(cr, s3, 44); - s0 = sha256_neon_schedule_update(s0, s1, s2, s3); - cr = sha256_neon_round4(cr, s0, 48); - s1 = sha256_neon_schedule_update(s1, s2, s3, s0); - cr = sha256_neon_round4(cr, s1, 52); - s2 = sha256_neon_schedule_update(s2, s3, s0, s1); - cr = sha256_neon_round4(cr, s2, 56); - s3 = sha256_neon_schedule_update(s3, s0, s1, s2); - cr = sha256_neon_round4(cr, s3, 60); - - core->abcd = vaddq_u32(core->abcd, cr.abcd); - core->efgh = vaddq_u32(core->efgh, cr.efgh); -} - -typedef struct sha256_neon { - sha256_neon_core core; - sha256_block blk; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha256_neon; - -static void sha256_neon_write(BinarySink *bs, const void *vp, size_t len); - -static ssh_hash *sha256_neon_new(const ssh_hashalg *alg) -{ - if (!sha256_hw_available_cached()) - return NULL; - - sha256_neon *s = snew(sha256_neon); - - s->hash.vt = alg; - BinarySink_INIT(s, sha256_neon_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -static void sha256_neon_reset(ssh_hash *hash) -{ - sha256_neon *s = container_of(hash, sha256_neon, hash); - - s->core.abcd = vld1q_u32(sha256_initial_state); - s->core.efgh = vld1q_u32(sha256_initial_state + 4); - - sha256_block_setup(&s->blk); -} - -static void sha256_neon_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha256_neon *copy = container_of(hcopy, sha256_neon, hash); - sha256_neon *orig = container_of(horig, sha256_neon, hash); - - *copy = *orig; /* structure copy */ - - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha256_neon_free(ssh_hash *hash) -{ - sha256_neon *s = container_of(hash, sha256_neon, hash); - smemclr(s, sizeof(*s)); - sfree(s); -} - -static void sha256_neon_write(BinarySink *bs, const void *vp, size_t len) -{ - sha256_neon *s = BinarySink_DOWNCAST(bs, sha256_neon); - - while (len > 0) - if (sha256_block_write(&s->blk, &vp, &len)) - sha256_neon_block(&s->core, s->blk.block); -} - -static void sha256_neon_digest(ssh_hash *hash, uint8_t *digest) -{ - sha256_neon *s = container_of(hash, sha256_neon, hash); - - sha256_block_pad(&s->blk, BinarySink_UPCAST(s)); - vst1q_u8(digest, vrev32q_u8(vreinterpretq_u8_u32(s->core.abcd))); - vst1q_u8(digest + 16, vrev32q_u8(vreinterpretq_u8_u32(s->core.efgh))); -} - -const ssh_hashalg ssh_sha256_hw = { - .new = sha256_neon_new, - .reset = sha256_neon_reset, - .copyfrom = sha256_neon_copyfrom, - .digest = sha256_neon_digest, - .free = sha256_neon_free, - .hlen = 32, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-256", "NEON accelerated"), -}; - -/* ---------------------------------------------------------------------- - * Stub functions if we have no hardware-accelerated SHA-256. In this - * case, sha256_hw_new returns NULL (though it should also never be - * selected by sha256_select, so the only thing that should even be - * _able_ to call it is testcrypt). As a result, the remaining vtable - * functions should never be called at all. - */ - -#elif HW_SHA256 == HW_SHA256_NONE - -static bool sha256_hw_available(void) -{ - return false; -} - -static ssh_hash *sha256_stub_new(const ssh_hashalg *alg) -{ - return NULL; -} - -#define STUB_BODY { unreachable("Should never be called"); } - -static void sha256_stub_reset(ssh_hash *hash) STUB_BODY -static void sha256_stub_copyfrom(ssh_hash *hash, ssh_hash *orig) STUB_BODY -static void sha256_stub_free(ssh_hash *hash) STUB_BODY -static void sha256_stub_digest(ssh_hash *hash, uint8_t *digest) STUB_BODY - -const ssh_hashalg ssh_sha256_hw = { - .new = sha256_stub_new, - .reset = sha256_stub_reset, - .copyfrom = sha256_stub_copyfrom, - .digest = sha256_stub_digest, - .free = sha256_stub_free, - .hlen = 32, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-256", "!NONEXISTENT ACCELERATED VERSION!"), -}; - -#endif /* HW_SHA256 */ diff --git a/code/sshsh512.c b/code/sshsh512.c deleted file mode 100644 index cba7f38..0000000 --- a/code/sshsh512.c +++ /dev/null @@ -1,836 +0,0 @@ -/* - * SHA-512 algorithm as described at - * - * http://csrc.nist.gov/cryptval/shs.html - * - * Modifications made for SHA-384 also - */ - -#include -#include "ssh.h" - -/* - * Start by deciding whether we can support hardware SHA at all. - */ -#define HW_SHA512_NONE 0 -#define HW_SHA512_NEON 1 - -#ifdef _FORCE_SHA512_NEON -# define HW_SHA512 HW_SHA512_NEON -#elif defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - /* Arm can potentially support both endiannesses, but this code - * hasn't been tested on anything but little. If anyone wants to - * run big-endian, they'll need to fix it first. */ -#elif defined __ARM_FEATURE_SHA512 - /* If the Arm SHA-512 extension is available already, we can - * support NEON SHA without having to enable anything by hand */ -# define HW_SHA512 HW_SHA512_NEON -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__aarch64__)) - /* clang can enable the crypto extension in AArch64 using - * __attribute__((target)) */ -# define HW_SHA512 HW_SHA512_NEON -# define USE_CLANG_ATTR_TARGET_AARCH64 -# endif -#endif - -#if defined _FORCE_SOFTWARE_SHA || !defined HW_SHA512 -# undef HW_SHA512 -# define HW_SHA512 HW_SHA512_NONE -#endif - -/* - * The actual query function that asks if hardware acceleration is - * available. - */ -static bool sha512_hw_available(void); - -/* - * The top-level selection function, caching the results of - * sha512_hw_available() so it only has to run once. - */ -static bool sha512_hw_available_cached(void) -{ - static bool initialised = false; - static bool hw_available; - if (!initialised) { - hw_available = sha512_hw_available(); - initialised = true; - } - return hw_available; -} - -struct sha512_select_options { - const ssh_hashalg *hw, *sw; -}; - -static ssh_hash *sha512_select(const ssh_hashalg *alg) -{ - const struct sha512_select_options *options = - (const struct sha512_select_options *)alg->extra; - - const ssh_hashalg *real_alg = - sha512_hw_available_cached() ? options->hw : options->sw; - - return ssh_hash_new(real_alg); -} - -const struct sha512_select_options ssh_sha512_select_options = { - &ssh_sha512_hw, &ssh_sha512_sw, -}; -const struct sha512_select_options ssh_sha384_select_options = { - &ssh_sha384_hw, &ssh_sha384_sw, -}; - -const ssh_hashalg ssh_sha512 = { - .new = sha512_select, - .hlen = 64, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-512", "dummy selector vtable"), - .extra = &ssh_sha512_select_options, -}; - -const ssh_hashalg ssh_sha384 = { - .new = sha512_select, - .hlen = 48, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-384", "dummy selector vtable"), - .extra = &ssh_sha384_select_options, -}; - -/* ---------------------------------------------------------------------- - * Definitions likely to be helpful to multiple implementations. - */ - -static const uint64_t sha512_initial_state[] = { - 0x6a09e667f3bcc908ULL, - 0xbb67ae8584caa73bULL, - 0x3c6ef372fe94f82bULL, - 0xa54ff53a5f1d36f1ULL, - 0x510e527fade682d1ULL, - 0x9b05688c2b3e6c1fULL, - 0x1f83d9abfb41bd6bULL, - 0x5be0cd19137e2179ULL, -}; - -static const uint64_t sha384_initial_state[] = { - 0xcbbb9d5dc1059ed8ULL, - 0x629a292a367cd507ULL, - 0x9159015a3070dd17ULL, - 0x152fecd8f70e5939ULL, - 0x67332667ffc00b31ULL, - 0x8eb44a8768581511ULL, - 0xdb0c2e0d64f98fa7ULL, - 0x47b5481dbefa4fa4ULL, -}; - -static const uint64_t sha512_round_constants[] = { - 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, - 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, - 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, - 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, - 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, - 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, - 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, - 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, - 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, - 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, - 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, - 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, - 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, - 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, - 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, - 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, - 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, - 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, - 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, - 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, - 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, - 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, - 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, - 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, - 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, - 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, - 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, - 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, - 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, - 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, - 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, - 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, - 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, - 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, - 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, - 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, - 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, - 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, - 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, - 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL, -}; - -#define SHA512_ROUNDS 80 - -typedef struct sha512_block sha512_block; -struct sha512_block { - uint8_t block[128]; - size_t used; - uint64_t lenhi, lenlo; -}; - -static inline void sha512_block_setup(sha512_block *blk) -{ - blk->used = 0; - blk->lenhi = blk->lenlo = 0; -} - -static inline bool sha512_block_write( - sha512_block *blk, const void **vdata, size_t *len) -{ - size_t blkleft = sizeof(blk->block) - blk->used; - size_t chunk = *len < blkleft ? *len : blkleft; - - const uint8_t *p = *vdata; - memcpy(blk->block + blk->used, p, chunk); - *vdata = p + chunk; - *len -= chunk; - blk->used += chunk; - - size_t chunkbits = chunk << 3; - - blk->lenlo += chunkbits; - blk->lenhi += (blk->lenlo < chunkbits); - - if (blk->used == sizeof(blk->block)) { - blk->used = 0; - return true; - } - - return false; -} - -static inline void sha512_block_pad(sha512_block *blk, BinarySink *bs) -{ - uint64_t final_lenhi = blk->lenhi; - uint64_t final_lenlo = blk->lenlo; - size_t pad = 127 & (111 - blk->used); - - put_byte(bs, 0x80); - put_padding(bs, pad, 0); - put_uint64(bs, final_lenhi); - put_uint64(bs, final_lenlo); - - assert(blk->used == 0 && "Should have exactly hit a block boundary"); -} - -/* ---------------------------------------------------------------------- - * Software implementation of SHA-512. - */ - -static inline uint64_t ror(uint64_t x, unsigned y) -{ - return (x << (63 & -y)) | (x >> (63 & y)); -} - -static inline uint64_t Ch(uint64_t ctrl, uint64_t if1, uint64_t if0) -{ - return if0 ^ (ctrl & (if1 ^ if0)); -} - -static inline uint64_t Maj(uint64_t x, uint64_t y, uint64_t z) -{ - return (x & y) | (z & (x | y)); -} - -static inline uint64_t Sigma_0(uint64_t x) -{ - return ror(x,28) ^ ror(x,34) ^ ror(x,39); -} - -static inline uint64_t Sigma_1(uint64_t x) -{ - return ror(x,14) ^ ror(x,18) ^ ror(x,41); -} - -static inline uint64_t sigma_0(uint64_t x) -{ - return ror(x,1) ^ ror(x,8) ^ (x >> 7); -} - -static inline uint64_t sigma_1(uint64_t x) -{ - return ror(x,19) ^ ror(x,61) ^ (x >> 6); -} - -static inline void sha512_sw_round( - unsigned round_index, const uint64_t *schedule, - uint64_t *a, uint64_t *b, uint64_t *c, uint64_t *d, - uint64_t *e, uint64_t *f, uint64_t *g, uint64_t *h) -{ - uint64_t t1 = *h + Sigma_1(*e) + Ch(*e,*f,*g) + - sha512_round_constants[round_index] + schedule[round_index]; - - uint64_t t2 = Sigma_0(*a) + Maj(*a,*b,*c); - - *d += t1; - *h = t1 + t2; -} - -static void sha512_sw_block(uint64_t *core, const uint8_t *block) -{ - uint64_t w[SHA512_ROUNDS]; - uint64_t a,b,c,d,e,f,g,h; - - int t; - - for (t = 0; t < 16; t++) - w[t] = GET_64BIT_MSB_FIRST(block + 8*t); - - for (t = 16; t < SHA512_ROUNDS; t++) - w[t] = w[t-16] + w[t-7] + sigma_0(w[t-15]) + sigma_1(w[t-2]); - - a = core[0]; b = core[1]; c = core[2]; d = core[3]; - e = core[4]; f = core[5]; g = core[6]; h = core[7]; - - for (t = 0; t < SHA512_ROUNDS; t+=8) { - sha512_sw_round(t+0, w, &a,&b,&c,&d,&e,&f,&g,&h); - sha512_sw_round(t+1, w, &h,&a,&b,&c,&d,&e,&f,&g); - sha512_sw_round(t+2, w, &g,&h,&a,&b,&c,&d,&e,&f); - sha512_sw_round(t+3, w, &f,&g,&h,&a,&b,&c,&d,&e); - sha512_sw_round(t+4, w, &e,&f,&g,&h,&a,&b,&c,&d); - sha512_sw_round(t+5, w, &d,&e,&f,&g,&h,&a,&b,&c); - sha512_sw_round(t+6, w, &c,&d,&e,&f,&g,&h,&a,&b); - sha512_sw_round(t+7, w, &b,&c,&d,&e,&f,&g,&h,&a); - } - - core[0] += a; core[1] += b; core[2] += c; core[3] += d; - core[4] += e; core[5] += f; core[6] += g; core[7] += h; - - smemclr(w, sizeof(w)); -} - -typedef struct sha512_sw { - uint64_t core[8]; - sha512_block blk; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha512_sw; - -static void sha512_sw_write(BinarySink *bs, const void *vp, size_t len); - -static ssh_hash *sha512_sw_new(const ssh_hashalg *alg) -{ - sha512_sw *s = snew(sha512_sw); - - s->hash.vt = alg; - BinarySink_INIT(s, sha512_sw_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -static void sha512_sw_reset(ssh_hash *hash) -{ - sha512_sw *s = container_of(hash, sha512_sw, hash); - - /* The 'extra' field in the ssh_hashalg indicates which - * initialisation vector we're using */ - memcpy(s->core, hash->vt->extra, sizeof(s->core)); - sha512_block_setup(&s->blk); -} - -static void sha512_sw_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha512_sw *copy = container_of(hcopy, sha512_sw, hash); - sha512_sw *orig = container_of(horig, sha512_sw, hash); - - memcpy(copy, orig, sizeof(*copy)); - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha512_sw_free(ssh_hash *hash) -{ - sha512_sw *s = container_of(hash, sha512_sw, hash); - - smemclr(s, sizeof(*s)); - sfree(s); -} - -static void sha512_sw_write(BinarySink *bs, const void *vp, size_t len) -{ - sha512_sw *s = BinarySink_DOWNCAST(bs, sha512_sw); - - while (len > 0) - if (sha512_block_write(&s->blk, &vp, &len)) - sha512_sw_block(s->core, s->blk.block); -} - -static void sha512_sw_digest(ssh_hash *hash, uint8_t *digest) -{ - sha512_sw *s = container_of(hash, sha512_sw, hash); - - sha512_block_pad(&s->blk, BinarySink_UPCAST(s)); - for (size_t i = 0; i < hash->vt->hlen / 8; i++) - PUT_64BIT_MSB_FIRST(digest + 8*i, s->core[i]); -} - -const ssh_hashalg ssh_sha512_sw = { - .new = sha512_sw_new, - .reset = sha512_sw_reset, - .copyfrom = sha512_sw_copyfrom, - .digest = sha512_sw_digest, - .free = sha512_sw_free, - .hlen = 64, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-512", "unaccelerated"), - .extra = sha512_initial_state, -}; - -const ssh_hashalg ssh_sha384_sw = { - .new = sha512_sw_new, - .reset = sha512_sw_reset, - .copyfrom = sha512_sw_copyfrom, - .digest = sha512_sw_digest, - .free = sha512_sw_free, - .hlen = 48, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-384", "unaccelerated"), - .extra = sha384_initial_state, -}; - -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of SHA-512 using Arm NEON. - */ - -#if HW_SHA512 == HW_SHA512_NEON - -/* - * Manually set the target architecture, if we decided above that we - * need to. - */ -#ifdef USE_CLANG_ATTR_TARGET_AARCH64 -/* - * A spot of cheating: redefine some ACLE feature macros before - * including arm_neon.h. Otherwise we won't get the SHA intrinsics - * defined by that header, because it will be looking at the settings - * for the whole translation unit rather than the ones we're going to - * put on some particular functions using __attribute__((target)). - */ -#define __ARM_NEON 1 -#define __ARM_FEATURE_CRYPTO 1 -#define FUNC_ISA __attribute__ ((target("neon,sha3"))) -#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */ - -#ifndef FUNC_ISA -#define FUNC_ISA -#endif - -#ifdef USE_ARM64_NEON_H -#include -#else -#include -#endif - -static bool sha512_hw_available(void) -{ - /* - * For Arm, we delegate to a per-platform detection function (see - * explanation in sshaes.c). - */ - return platform_sha512_hw_available(); -} - -#if defined __clang__ -/* - * As of 2020-12-24, I've found that clang doesn't provide the SHA-512 - * NEON intrinsics. So I define my own set using inline assembler, and - * use #define to effectively rename them over the top of the standard - * names. - * - * The aim of that #define technique is that it should avoid a build - * failure if these intrinsics _are_ defined in . - * Obviously it would be better in that situation to switch back to - * using the real intrinsics, but until I see a version of clang that - * supports them, I won't know what version number to test in the - * ifdef. - */ -static inline FUNC_ISA -uint64x2_t vsha512su0q_u64_asm(uint64x2_t x, uint64x2_t y) { - __asm__("sha512su0 %0.2D,%1.2D" : "+w" (x) : "w" (y)); - return x; -} -static inline FUNC_ISA -uint64x2_t vsha512su1q_u64_asm(uint64x2_t x, uint64x2_t y, uint64x2_t z) { - __asm__("sha512su1 %0.2D,%1.2D,%2.2D" : "+w" (x) : "w" (y), "w" (z)); - return x; -} -static inline FUNC_ISA -uint64x2_t vsha512hq_u64_asm(uint64x2_t x, uint64x2_t y, uint64x2_t z) { - __asm__("sha512h %0,%1,%2.2D" : "+w" (x) : "w" (y), "w" (z)); - return x; -} -static inline FUNC_ISA -uint64x2_t vsha512h2q_u64_asm(uint64x2_t x, uint64x2_t y, uint64x2_t z) { - __asm__("sha512h2 %0,%1,%2.2D" : "+w" (x) : "w" (y), "w" (z)); - return x; -} -#undef vsha512su0q_u64 -#define vsha512su0q_u64 vsha512su0q_u64_asm -#undef vsha512su1q_u64 -#define vsha512su1q_u64 vsha512su1q_u64_asm -#undef vsha512hq_u64 -#define vsha512hq_u64 vsha512hq_u64_asm -#undef vsha512h2q_u64 -#define vsha512h2q_u64 vsha512h2q_u64_asm -#endif /* defined __clang__ */ - -typedef struct sha512_neon_core sha512_neon_core; -struct sha512_neon_core { - uint64x2_t ab, cd, ef, gh; -}; - -FUNC_ISA -static inline uint64x2_t sha512_neon_load_input(const uint8_t *p) -{ - return vreinterpretq_u64_u8(vrev64q_u8(vld1q_u8(p))); -} - -FUNC_ISA -static inline uint64x2_t sha512_neon_schedule_update( - uint64x2_t m8, uint64x2_t m7, uint64x2_t m4, uint64x2_t m3, uint64x2_t m1) -{ - /* - * vsha512su0q_u64() takes words from a long way back in the - * schedule and performs the sigma_0 half of the computation of - * the next two 64-bit message-schedule words. - * - * vsha512su1q_u64() combines the result of that with the sigma_1 - * steps, to output the finished version of those two words. The - * total amount of input data it requires fits nicely into three - * 128-bit vector registers, but one of those registers is - * misaligned compared to the 128-bit chunks that the message - * schedule is stored in. So we use vextq_u64 to make one of its - * input words out of the second half of m4 and the first half of - * m3. - */ - return vsha512su1q_u64(vsha512su0q_u64(m8, m7), m1, vextq_u64(m4, m3, 1)); -} - -FUNC_ISA -static inline void sha512_neon_round2( - unsigned round_index, uint64x2_t schedule_words, - uint64x2_t *ab, uint64x2_t *cd, uint64x2_t *ef, uint64x2_t *gh) -{ - /* - * vsha512hq_u64 performs the Sigma_1 and Ch half of the - * computation of two rounds of SHA-512 (including feeding back - * one of the outputs from the first of those half-rounds into the - * second one). - * - * vsha512h2q_u64 combines the result of that with the Sigma_0 and - * Maj steps, and outputs one 128-bit vector that replaces the gh - * piece of the input hash state, and a second that updates cd by - * addition. - * - * Similarly to vsha512su1q_u64 above, some of the input registers - * expected by these instructions are misaligned by 64 bits - * relative to the chunks we've divided the hash state into, so we - * have to start by making 'de' and 'fg' words out of our input - * cd,ef,gh, using vextq_u64. - * - * Also, one of the inputs to vsha512hq_u64 is expected to contain - * the results of summing gh + two round constants + two words of - * message schedule, but the two words of the message schedule - * have to be the opposite way round in the vector register from - * the way that vsha512su1q_u64 output them. Hence, there's - * another vextq_u64 in here that swaps the two halves of the - * initial_sum vector register. - * - * (This also means that I don't have to prepare a specially - * reordered version of the sha512_round_constants[] array: as - * long as I'm unavoidably doing a swap at run time _anyway_, I - * can load from the normally ordered version of that array, and - * just take care to fold in that data _before_ the swap rather - * than after.) - */ - - /* Load two round constants, with the first one in the low half */ - uint64x2_t round_constants = vld1q_u64( - sha512_round_constants + round_index); - - /* Add schedule words to round constants */ - uint64x2_t initial_sum = vaddq_u64(schedule_words, round_constants); - - /* Swap that sum around so the word used in the first of the two - * rounds is in the _high_ half of the vector, matching where h - * lives in the gh vector */ - uint64x2_t swapped_initial_sum = vextq_u64(initial_sum, initial_sum, 1); - - /* Add gh to that, now that they're matching ways round */ - uint64x2_t sum = vaddq_u64(swapped_initial_sum, *gh); - - /* Make the misaligned de and fg words */ - uint64x2_t de = vextq_u64(*cd, *ef, 1); - uint64x2_t fg = vextq_u64(*ef, *gh, 1); - - /* Now we're ready to put all the pieces together. The output from - * vsha512h2q_u64 can be used directly as the new gh, and the - * output from vsha512hq_u64 is simultaneously the intermediate - * value passed to h2 and the thing you have to add on to cd. */ - uint64x2_t intermed = vsha512hq_u64(sum, fg, de); - *gh = vsha512h2q_u64(intermed, *cd, *ab); - *cd = vaddq_u64(*cd, intermed); -} - -FUNC_ISA -static inline void sha512_neon_block(sha512_neon_core *core, const uint8_t *p) -{ - uint64x2_t s0, s1, s2, s3, s4, s5, s6, s7; - - uint64x2_t ab = core->ab, cd = core->cd, ef = core->ef, gh = core->gh; - - s0 = sha512_neon_load_input(p + 16*0); - sha512_neon_round2(0, s0, &ab, &cd, &ef, &gh); - s1 = sha512_neon_load_input(p + 16*1); - sha512_neon_round2(2, s1, &gh, &ab, &cd, &ef); - s2 = sha512_neon_load_input(p + 16*2); - sha512_neon_round2(4, s2, &ef, &gh, &ab, &cd); - s3 = sha512_neon_load_input(p + 16*3); - sha512_neon_round2(6, s3, &cd, &ef, &gh, &ab); - s4 = sha512_neon_load_input(p + 16*4); - sha512_neon_round2(8, s4, &ab, &cd, &ef, &gh); - s5 = sha512_neon_load_input(p + 16*5); - sha512_neon_round2(10, s5, &gh, &ab, &cd, &ef); - s6 = sha512_neon_load_input(p + 16*6); - sha512_neon_round2(12, s6, &ef, &gh, &ab, &cd); - s7 = sha512_neon_load_input(p + 16*7); - sha512_neon_round2(14, s7, &cd, &ef, &gh, &ab); - s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); - sha512_neon_round2(16, s0, &ab, &cd, &ef, &gh); - s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); - sha512_neon_round2(18, s1, &gh, &ab, &cd, &ef); - s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); - sha512_neon_round2(20, s2, &ef, &gh, &ab, &cd); - s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); - sha512_neon_round2(22, s3, &cd, &ef, &gh, &ab); - s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); - sha512_neon_round2(24, s4, &ab, &cd, &ef, &gh); - s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); - sha512_neon_round2(26, s5, &gh, &ab, &cd, &ef); - s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); - sha512_neon_round2(28, s6, &ef, &gh, &ab, &cd); - s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); - sha512_neon_round2(30, s7, &cd, &ef, &gh, &ab); - s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); - sha512_neon_round2(32, s0, &ab, &cd, &ef, &gh); - s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); - sha512_neon_round2(34, s1, &gh, &ab, &cd, &ef); - s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); - sha512_neon_round2(36, s2, &ef, &gh, &ab, &cd); - s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); - sha512_neon_round2(38, s3, &cd, &ef, &gh, &ab); - s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); - sha512_neon_round2(40, s4, &ab, &cd, &ef, &gh); - s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); - sha512_neon_round2(42, s5, &gh, &ab, &cd, &ef); - s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); - sha512_neon_round2(44, s6, &ef, &gh, &ab, &cd); - s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); - sha512_neon_round2(46, s7, &cd, &ef, &gh, &ab); - s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); - sha512_neon_round2(48, s0, &ab, &cd, &ef, &gh); - s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); - sha512_neon_round2(50, s1, &gh, &ab, &cd, &ef); - s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); - sha512_neon_round2(52, s2, &ef, &gh, &ab, &cd); - s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); - sha512_neon_round2(54, s3, &cd, &ef, &gh, &ab); - s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); - sha512_neon_round2(56, s4, &ab, &cd, &ef, &gh); - s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); - sha512_neon_round2(58, s5, &gh, &ab, &cd, &ef); - s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); - sha512_neon_round2(60, s6, &ef, &gh, &ab, &cd); - s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); - sha512_neon_round2(62, s7, &cd, &ef, &gh, &ab); - s0 = sha512_neon_schedule_update(s0, s1, s4, s5, s7); - sha512_neon_round2(64, s0, &ab, &cd, &ef, &gh); - s1 = sha512_neon_schedule_update(s1, s2, s5, s6, s0); - sha512_neon_round2(66, s1, &gh, &ab, &cd, &ef); - s2 = sha512_neon_schedule_update(s2, s3, s6, s7, s1); - sha512_neon_round2(68, s2, &ef, &gh, &ab, &cd); - s3 = sha512_neon_schedule_update(s3, s4, s7, s0, s2); - sha512_neon_round2(70, s3, &cd, &ef, &gh, &ab); - s4 = sha512_neon_schedule_update(s4, s5, s0, s1, s3); - sha512_neon_round2(72, s4, &ab, &cd, &ef, &gh); - s5 = sha512_neon_schedule_update(s5, s6, s1, s2, s4); - sha512_neon_round2(74, s5, &gh, &ab, &cd, &ef); - s6 = sha512_neon_schedule_update(s6, s7, s2, s3, s5); - sha512_neon_round2(76, s6, &ef, &gh, &ab, &cd); - s7 = sha512_neon_schedule_update(s7, s0, s3, s4, s6); - sha512_neon_round2(78, s7, &cd, &ef, &gh, &ab); - - core->ab = vaddq_u64(core->ab, ab); - core->cd = vaddq_u64(core->cd, cd); - core->ef = vaddq_u64(core->ef, ef); - core->gh = vaddq_u64(core->gh, gh); -} - -typedef struct sha512_neon { - sha512_neon_core core; - sha512_block blk; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha512_neon; - -static void sha512_neon_write(BinarySink *bs, const void *vp, size_t len); - -static ssh_hash *sha512_neon_new(const ssh_hashalg *alg) -{ - if (!sha512_hw_available_cached()) - return NULL; - - sha512_neon *s = snew(sha512_neon); - - s->hash.vt = alg; - BinarySink_INIT(s, sha512_neon_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -static void sha512_neon_reset(ssh_hash *hash) -{ - sha512_neon *s = container_of(hash, sha512_neon, hash); - const uint64_t *iv = (const uint64_t *)hash->vt->extra; - - s->core.ab = vld1q_u64(iv); - s->core.cd = vld1q_u64(iv+2); - s->core.ef = vld1q_u64(iv+4); - s->core.gh = vld1q_u64(iv+6); - - sha512_block_setup(&s->blk); -} - -static void sha512_neon_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha512_neon *copy = container_of(hcopy, sha512_neon, hash); - sha512_neon *orig = container_of(horig, sha512_neon, hash); - - *copy = *orig; /* structure copy */ - - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha512_neon_free(ssh_hash *hash) -{ - sha512_neon *s = container_of(hash, sha512_neon, hash); - smemclr(s, sizeof(*s)); - sfree(s); -} - -static void sha512_neon_write(BinarySink *bs, const void *vp, size_t len) -{ - sha512_neon *s = BinarySink_DOWNCAST(bs, sha512_neon); - - while (len > 0) - if (sha512_block_write(&s->blk, &vp, &len)) - sha512_neon_block(&s->core, s->blk.block); -} - -static void sha512_neon_digest(ssh_hash *hash, uint8_t *digest) -{ - sha512_neon *s = container_of(hash, sha512_neon, hash); - - sha512_block_pad(&s->blk, BinarySink_UPCAST(s)); - - vst1q_u8(digest, vrev64q_u8(vreinterpretq_u8_u64(s->core.ab))); - vst1q_u8(digest+16, vrev64q_u8(vreinterpretq_u8_u64(s->core.cd))); - vst1q_u8(digest+32, vrev64q_u8(vreinterpretq_u8_u64(s->core.ef))); - vst1q_u8(digest+48, vrev64q_u8(vreinterpretq_u8_u64(s->core.gh))); -} - -static void sha384_neon_digest(ssh_hash *hash, uint8_t *digest) -{ - sha512_neon *s = container_of(hash, sha512_neon, hash); - - sha512_block_pad(&s->blk, BinarySink_UPCAST(s)); - - vst1q_u8(digest, vrev64q_u8(vreinterpretq_u8_u64(s->core.ab))); - vst1q_u8(digest+16, vrev64q_u8(vreinterpretq_u8_u64(s->core.cd))); - vst1q_u8(digest+32, vrev64q_u8(vreinterpretq_u8_u64(s->core.ef))); -} - -const ssh_hashalg ssh_sha512_hw = { - .new = sha512_neon_new, - .reset = sha512_neon_reset, - .copyfrom = sha512_neon_copyfrom, - .digest = sha512_neon_digest, - .free = sha512_neon_free, - .hlen = 64, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-512", "NEON accelerated"), - .extra = sha512_initial_state, -}; - -const ssh_hashalg ssh_sha384_hw = { - .new = sha512_neon_new, - .reset = sha512_neon_reset, - .copyfrom = sha512_neon_copyfrom, - .digest = sha384_neon_digest, - .free = sha512_neon_free, - .hlen = 48, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-384", "NEON accelerated"), - .extra = sha384_initial_state, -}; - -/* ---------------------------------------------------------------------- - * Stub functions if we have no hardware-accelerated SHA-512. In this - * case, sha512_hw_new returns NULL (though it should also never be - * selected by sha512_select, so the only thing that should even be - * _able_ to call it is testcrypt). As a result, the remaining vtable - * functions should never be called at all. - */ - -#elif HW_SHA512 == HW_SHA512_NONE - -static bool sha512_hw_available(void) -{ - return false; -} - -static ssh_hash *sha512_stub_new(const ssh_hashalg *alg) -{ - return NULL; -} - -#define STUB_BODY { unreachable("Should never be called"); } - -static void sha512_stub_reset(ssh_hash *hash) STUB_BODY -static void sha512_stub_copyfrom(ssh_hash *hash, ssh_hash *orig) STUB_BODY -static void sha512_stub_free(ssh_hash *hash) STUB_BODY -static void sha512_stub_digest(ssh_hash *hash, uint8_t *digest) STUB_BODY - -const ssh_hashalg ssh_sha512_hw = { - .new = sha512_stub_new, - .reset = sha512_stub_reset, - .copyfrom = sha512_stub_copyfrom, - .digest = sha512_stub_digest, - .free = sha512_stub_free, - .hlen = 64, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-512", "!NONEXISTENT ACCELERATED VERSION!"), -}; - -const ssh_hashalg ssh_sha384_hw = { - .new = sha512_stub_new, - .reset = sha512_stub_reset, - .copyfrom = sha512_stub_copyfrom, - .digest = sha512_stub_digest, - .free = sha512_stub_free, - .hlen = 48, - .blocklen = 128, - HASHALG_NAMES_ANNOTATED("SHA-384", "!NONEXISTENT ACCELERATED VERSION!"), -}; - -#endif /* HW_SHA512 */ diff --git a/code/sshsha.c b/code/sshsha.c deleted file mode 100644 index a5e79e6..0000000 --- a/code/sshsha.c +++ /dev/null @@ -1,934 +0,0 @@ -/* - * SHA-1 algorithm as described at - * - * http://csrc.nist.gov/cryptval/shs.html - */ - -#include "ssh.h" -#include - -/* - * Start by deciding whether we can support hardware SHA at all. - */ -#define HW_SHA1_NONE 0 -#define HW_SHA1_NI 1 -#define HW_SHA1_NEON 2 - -#ifdef _FORCE_SHA_NI -# define HW_SHA1 HW_SHA1_NI -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__x86_64__) || defined(__i386)) -# define HW_SHA1 HW_SHA1_NI -# endif -#elif defined(__GNUC__) -# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \ - (defined(__x86_64__) || defined(__i386)) -# define HW_SHA1 HW_SHA1_NI -# endif -#elif defined (_MSC_VER) -# if (defined(_M_X64) || defined(_M_IX86)) && _MSC_FULL_VER >= 150030729 -# define HW_SHA1 HW_SHA1_NI -# endif -#endif - -#ifdef _FORCE_SHA_NEON -# define HW_SHA1 HW_SHA1_NEON -#elif defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - /* Arm can potentially support both endiannesses, but this code - * hasn't been tested on anything but little. If anyone wants to - * run big-endian, they'll need to fix it first. */ -#elif defined __ARM_FEATURE_CRYPTO - /* If the Arm crypto extension is available already, we can - * support NEON SHA without having to enable anything by hand */ -# define HW_SHA1 HW_SHA1_NEON -#elif defined(__clang__) -# if __has_attribute(target) && __has_include() && \ - (defined(__aarch64__)) - /* clang can enable the crypto extension in AArch64 using - * __attribute__((target)) */ -# define HW_SHA1 HW_SHA1_NEON -# define USE_CLANG_ATTR_TARGET_AARCH64 -# endif -#elif defined _MSC_VER - /* Visual Studio supports the crypto extension when targeting - * AArch64, but as of VS2017, the AArch32 header doesn't quite - * manage it (declaring the shae/shad intrinsics without a round - * key operand). */ -# if defined _M_ARM64 -# define HW_SHA1 HW_SHA1_NEON -# if defined _M_ARM64 -# define USE_ARM64_NEON_H /* unusual header name in this case */ -# endif -# endif -#endif - -#if defined _FORCE_SOFTWARE_SHA || !defined HW_SHA1 -# undef HW_SHA1 -# define HW_SHA1 HW_SHA1_NONE -#endif - -/* - * The actual query function that asks if hardware acceleration is - * available. - */ -static bool sha1_hw_available(void); - -/* - * The top-level selection function, caching the results of - * sha1_hw_available() so it only has to run once. - */ -static bool sha1_hw_available_cached(void) -{ - static bool initialised = false; - static bool hw_available; - if (!initialised) { - hw_available = sha1_hw_available(); - initialised = true; - } - return hw_available; -} - -static ssh_hash *sha1_select(const ssh_hashalg *alg) -{ - const ssh_hashalg *real_alg = - sha1_hw_available_cached() ? &ssh_sha1_hw : &ssh_sha1_sw; - - return ssh_hash_new(real_alg); -} - -const ssh_hashalg ssh_sha1 = { - .new = sha1_select, - .hlen = 20, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-1", "dummy selector vtable"), -}; - -/* ---------------------------------------------------------------------- - * Definitions likely to be helpful to multiple implementations. - */ - -static const uint32_t sha1_initial_state[] = { - 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, -}; - -#define SHA1_ROUNDS_PER_STAGE 20 -#define SHA1_STAGE0_CONSTANT 0x5a827999 -#define SHA1_STAGE1_CONSTANT 0x6ed9eba1 -#define SHA1_STAGE2_CONSTANT 0x8f1bbcdc -#define SHA1_STAGE3_CONSTANT 0xca62c1d6 -#define SHA1_ROUNDS (4 * SHA1_ROUNDS_PER_STAGE) - -typedef struct sha1_block sha1_block; -struct sha1_block { - uint8_t block[64]; - size_t used; - uint64_t len; -}; - -static inline void sha1_block_setup(sha1_block *blk) -{ - blk->used = 0; - blk->len = 0; -} - -static inline bool sha1_block_write( - sha1_block *blk, const void **vdata, size_t *len) -{ - size_t blkleft = sizeof(blk->block) - blk->used; - size_t chunk = *len < blkleft ? *len : blkleft; - - const uint8_t *p = *vdata; - memcpy(blk->block + blk->used, p, chunk); - *vdata = p + chunk; - *len -= chunk; - blk->used += chunk; - blk->len += chunk; - - if (blk->used == sizeof(blk->block)) { - blk->used = 0; - return true; - } - - return false; -} - -static inline void sha1_block_pad(sha1_block *blk, BinarySink *bs) -{ - uint64_t final_len = blk->len << 3; - size_t pad = 1 + (63 & (55 - blk->used)); - - put_byte(bs, 0x80); - for (size_t i = 1; i < pad; i++) - put_byte(bs, 0); - put_uint64(bs, final_len); - - assert(blk->used == 0 && "Should have exactly hit a block boundary"); -} - -/* ---------------------------------------------------------------------- - * Software implementation of SHA-1. - */ - -static inline uint32_t rol(uint32_t x, unsigned y) -{ - return (x << (31 & y)) | (x >> (31 & -y)); -} - -static inline uint32_t Ch(uint32_t ctrl, uint32_t if1, uint32_t if0) -{ - return if0 ^ (ctrl & (if1 ^ if0)); -} - -static inline uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) -{ - return (x & y) | (z & (x | y)); -} - -static inline uint32_t Par(uint32_t x, uint32_t y, uint32_t z) -{ - return (x ^ y ^ z); -} - -static inline void sha1_sw_round( - unsigned round_index, const uint32_t *schedule, - uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d, uint32_t *e, - uint32_t f, uint32_t constant) -{ - *e = rol(*a, 5) + f + *e + schedule[round_index] + constant; - *b = rol(*b, 30); -} - -static void sha1_sw_block(uint32_t *core, const uint8_t *block) -{ - uint32_t w[SHA1_ROUNDS]; - uint32_t a,b,c,d,e; - - for (size_t t = 0; t < 16; t++) - w[t] = GET_32BIT_MSB_FIRST(block + 4*t); - - for (size_t t = 16; t < SHA1_ROUNDS; t++) - w[t] = rol(w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16], 1); - - a = core[0]; b = core[1]; c = core[2]; d = core[3]; - e = core[4]; - - size_t t = 0; - for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { - sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Ch(b,c,d), SHA1_STAGE0_CONSTANT); - sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Ch(a,b,c), SHA1_STAGE0_CONSTANT); - sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Ch(e,a,b), SHA1_STAGE0_CONSTANT); - sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Ch(d,e,a), SHA1_STAGE0_CONSTANT); - sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Ch(c,d,e), SHA1_STAGE0_CONSTANT); - } - for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { - sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Par(b,c,d), SHA1_STAGE1_CONSTANT); - sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Par(a,b,c), SHA1_STAGE1_CONSTANT); - sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Par(e,a,b), SHA1_STAGE1_CONSTANT); - sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Par(d,e,a), SHA1_STAGE1_CONSTANT); - sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Par(c,d,e), SHA1_STAGE1_CONSTANT); - } - for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { - sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Maj(b,c,d), SHA1_STAGE2_CONSTANT); - sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Maj(a,b,c), SHA1_STAGE2_CONSTANT); - sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Maj(e,a,b), SHA1_STAGE2_CONSTANT); - sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Maj(d,e,a), SHA1_STAGE2_CONSTANT); - sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Maj(c,d,e), SHA1_STAGE2_CONSTANT); - } - for (size_t u = 0; u < SHA1_ROUNDS_PER_STAGE/5; u++) { - sha1_sw_round(t++,w, &a,&b,&c,&d,&e, Par(b,c,d), SHA1_STAGE3_CONSTANT); - sha1_sw_round(t++,w, &e,&a,&b,&c,&d, Par(a,b,c), SHA1_STAGE3_CONSTANT); - sha1_sw_round(t++,w, &d,&e,&a,&b,&c, Par(e,a,b), SHA1_STAGE3_CONSTANT); - sha1_sw_round(t++,w, &c,&d,&e,&a,&b, Par(d,e,a), SHA1_STAGE3_CONSTANT); - sha1_sw_round(t++,w, &b,&c,&d,&e,&a, Par(c,d,e), SHA1_STAGE3_CONSTANT); - } - - core[0] += a; core[1] += b; core[2] += c; core[3] += d; core[4] += e; - - smemclr(w, sizeof(w)); -} - -typedef struct sha1_sw { - uint32_t core[5]; - sha1_block blk; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha1_sw; - -static void sha1_sw_write(BinarySink *bs, const void *vp, size_t len); - -static ssh_hash *sha1_sw_new(const ssh_hashalg *alg) -{ - sha1_sw *s = snew(sha1_sw); - - s->hash.vt = alg; - BinarySink_INIT(s, sha1_sw_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -static void sha1_sw_reset(ssh_hash *hash) -{ - sha1_sw *s = container_of(hash, sha1_sw, hash); - - memcpy(s->core, sha1_initial_state, sizeof(s->core)); - sha1_block_setup(&s->blk); -} - -static void sha1_sw_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha1_sw *copy = container_of(hcopy, sha1_sw, hash); - sha1_sw *orig = container_of(horig, sha1_sw, hash); - - memcpy(copy, orig, sizeof(*copy)); - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha1_sw_free(ssh_hash *hash) -{ - sha1_sw *s = container_of(hash, sha1_sw, hash); - - smemclr(s, sizeof(*s)); - sfree(s); -} - -static void sha1_sw_write(BinarySink *bs, const void *vp, size_t len) -{ - sha1_sw *s = BinarySink_DOWNCAST(bs, sha1_sw); - - while (len > 0) - if (sha1_block_write(&s->blk, &vp, &len)) - sha1_sw_block(s->core, s->blk.block); -} - -static void sha1_sw_digest(ssh_hash *hash, uint8_t *digest) -{ - sha1_sw *s = container_of(hash, sha1_sw, hash); - - sha1_block_pad(&s->blk, BinarySink_UPCAST(s)); - for (size_t i = 0; i < 5; i++) - PUT_32BIT_MSB_FIRST(digest + 4*i, s->core[i]); -} - -const ssh_hashalg ssh_sha1_sw = { - .new = sha1_sw_new, - .reset = sha1_sw_reset, - .copyfrom = sha1_sw_copyfrom, - .digest = sha1_sw_digest, - .free = sha1_sw_free, - .hlen = 20, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-1", "unaccelerated"), -}; - -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of SHA-1 using x86 SHA-NI. - */ - -#if HW_SHA1 == HW_SHA1_NI - -/* - * Set target architecture for Clang and GCC - */ - -#if defined(__clang__) || defined(__GNUC__) -# define FUNC_ISA __attribute__ ((target("sse4.1,sha"))) -#if !defined(__clang__) -# pragma GCC target("sha") -# pragma GCC target("sse4.1") -#endif -#else -# define FUNC_ISA -#endif - -#include -#include -#include -#if defined(__clang__) || defined(__GNUC__) -#include -#endif - -#if defined(__clang__) || defined(__GNUC__) -#include -#define GET_CPU_ID_0(out) \ - __cpuid(0, (out)[0], (out)[1], (out)[2], (out)[3]) -#define GET_CPU_ID_7(out) \ - __cpuid_count(7, 0, (out)[0], (out)[1], (out)[2], (out)[3]) -#else -#define GET_CPU_ID_0(out) __cpuid(out, 0) -#define GET_CPU_ID_7(out) __cpuidex(out, 7, 0) -#endif - -static bool sha1_hw_available(void) -{ - unsigned int CPUInfo[4]; - GET_CPU_ID_0(CPUInfo); - if (CPUInfo[0] < 7) - return false; - - GET_CPU_ID_7(CPUInfo); - return CPUInfo[1] & (1 << 29); /* Check SHA */ -} - -/* SHA1 implementation using new instructions - The code is based on Jeffrey Walton's SHA1 implementation: - https://github.com/noloader/SHA-Intrinsics -*/ -FUNC_ISA -static inline void sha1_ni_block(__m128i *core, const uint8_t *p) -{ - __m128i ABCD, E0, E1, MSG0, MSG1, MSG2, MSG3; - const __m128i MASK = _mm_set_epi64x( - 0x0001020304050607ULL, 0x08090a0b0c0d0e0fULL); - - const __m128i *block = (const __m128i *)p; - - /* Load initial values */ - ABCD = core[0]; - E0 = core[1]; - - /* Rounds 0-3 */ - MSG0 = _mm_loadu_si128(block); - MSG0 = _mm_shuffle_epi8(MSG0, MASK); - E0 = _mm_add_epi32(E0, MSG0); - E1 = ABCD; - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0); - - /* Rounds 4-7 */ - MSG1 = _mm_loadu_si128(block + 1); - MSG1 = _mm_shuffle_epi8(MSG1, MASK); - E1 = _mm_sha1nexte_epu32(E1, MSG1); - E0 = ABCD; - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 0); - MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); - - /* Rounds 8-11 */ - MSG2 = _mm_loadu_si128(block + 2); - MSG2 = _mm_shuffle_epi8(MSG2, MASK); - E0 = _mm_sha1nexte_epu32(E0, MSG2); - E1 = ABCD; - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0); - MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); - MSG0 = _mm_xor_si128(MSG0, MSG2); - - /* Rounds 12-15 */ - MSG3 = _mm_loadu_si128(block + 3); - MSG3 = _mm_shuffle_epi8(MSG3, MASK); - E1 = _mm_sha1nexte_epu32(E1, MSG3); - E0 = ABCD; - MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 0); - MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); - MSG1 = _mm_xor_si128(MSG1, MSG3); - - /* Rounds 16-19 */ - E0 = _mm_sha1nexte_epu32(E0, MSG0); - E1 = ABCD; - MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0); - MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); - MSG2 = _mm_xor_si128(MSG2, MSG0); - - /* Rounds 20-23 */ - E1 = _mm_sha1nexte_epu32(E1, MSG1); - E0 = ABCD; - MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1); - MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); - MSG3 = _mm_xor_si128(MSG3, MSG1); - - /* Rounds 24-27 */ - E0 = _mm_sha1nexte_epu32(E0, MSG2); - E1 = ABCD; - MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 1); - MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); - MSG0 = _mm_xor_si128(MSG0, MSG2); - - /* Rounds 28-31 */ - E1 = _mm_sha1nexte_epu32(E1, MSG3); - E0 = ABCD; - MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1); - MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); - MSG1 = _mm_xor_si128(MSG1, MSG3); - - /* Rounds 32-35 */ - E0 = _mm_sha1nexte_epu32(E0, MSG0); - E1 = ABCD; - MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 1); - MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); - MSG2 = _mm_xor_si128(MSG2, MSG0); - - /* Rounds 36-39 */ - E1 = _mm_sha1nexte_epu32(E1, MSG1); - E0 = ABCD; - MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1); - MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); - MSG3 = _mm_xor_si128(MSG3, MSG1); - - /* Rounds 40-43 */ - E0 = _mm_sha1nexte_epu32(E0, MSG2); - E1 = ABCD; - MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2); - MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); - MSG0 = _mm_xor_si128(MSG0, MSG2); - - /* Rounds 44-47 */ - E1 = _mm_sha1nexte_epu32(E1, MSG3); - E0 = ABCD; - MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 2); - MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); - MSG1 = _mm_xor_si128(MSG1, MSG3); - - /* Rounds 48-51 */ - E0 = _mm_sha1nexte_epu32(E0, MSG0); - E1 = ABCD; - MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2); - MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); - MSG2 = _mm_xor_si128(MSG2, MSG0); - - /* Rounds 52-55 */ - E1 = _mm_sha1nexte_epu32(E1, MSG1); - E0 = ABCD; - MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 2); - MSG0 = _mm_sha1msg1_epu32(MSG0, MSG1); - MSG3 = _mm_xor_si128(MSG3, MSG1); - - /* Rounds 56-59 */ - E0 = _mm_sha1nexte_epu32(E0, MSG2); - E1 = ABCD; - MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2); - MSG1 = _mm_sha1msg1_epu32(MSG1, MSG2); - MSG0 = _mm_xor_si128(MSG0, MSG2); - - /* Rounds 60-63 */ - E1 = _mm_sha1nexte_epu32(E1, MSG3); - E0 = ABCD; - MSG0 = _mm_sha1msg2_epu32(MSG0, MSG3); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3); - MSG2 = _mm_sha1msg1_epu32(MSG2, MSG3); - MSG1 = _mm_xor_si128(MSG1, MSG3); - - /* Rounds 64-67 */ - E0 = _mm_sha1nexte_epu32(E0, MSG0); - E1 = ABCD; - MSG1 = _mm_sha1msg2_epu32(MSG1, MSG0); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 3); - MSG3 = _mm_sha1msg1_epu32(MSG3, MSG0); - MSG2 = _mm_xor_si128(MSG2, MSG0); - - /* Rounds 68-71 */ - E1 = _mm_sha1nexte_epu32(E1, MSG1); - E0 = ABCD; - MSG2 = _mm_sha1msg2_epu32(MSG2, MSG1); - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3); - MSG3 = _mm_xor_si128(MSG3, MSG1); - - /* Rounds 72-75 */ - E0 = _mm_sha1nexte_epu32(E0, MSG2); - E1 = ABCD; - MSG3 = _mm_sha1msg2_epu32(MSG3, MSG2); - ABCD = _mm_sha1rnds4_epu32(ABCD, E0, 3); - - /* Rounds 76-79 */ - E1 = _mm_sha1nexte_epu32(E1, MSG3); - E0 = ABCD; - ABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3); - - /* Combine state */ - core[0] = _mm_add_epi32(ABCD, core[0]); - core[1] = _mm_sha1nexte_epu32(E0, core[1]); -} - -typedef struct sha1_ni { - /* - * core[0] stores the first four words of the SHA-1 state. core[1] - * stores just the fifth word, in the vector lane at the highest - * address. - */ - __m128i core[2]; - sha1_block blk; - void *pointer_to_free; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha1_ni; - -static void sha1_ni_write(BinarySink *bs, const void *vp, size_t len); - -static sha1_ni *sha1_ni_alloc(void) -{ - /* - * The __m128i variables in the context structure need to be - * 16-byte aligned, but not all malloc implementations that this - * code has to work with will guarantee to return a 16-byte - * aligned pointer. So we over-allocate, manually realign the - * pointer ourselves, and store the original one inside the - * context so we know how to free it later. - */ - void *allocation = smalloc(sizeof(sha1_ni) + 15); - uintptr_t alloc_address = (uintptr_t)allocation; - uintptr_t aligned_address = (alloc_address + 15) & ~15; - sha1_ni *s = (sha1_ni *)aligned_address; - s->pointer_to_free = allocation; - return s; -} - -static ssh_hash *sha1_ni_new(const ssh_hashalg *alg) -{ - if (!sha1_hw_available_cached()) - return NULL; - - sha1_ni *s = sha1_ni_alloc(); - - s->hash.vt = alg; - BinarySink_INIT(s, sha1_ni_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -FUNC_ISA static void sha1_ni_reset(ssh_hash *hash) -{ - sha1_ni *s = container_of(hash, sha1_ni, hash); - - /* Initialise the core vectors in their storage order */ - s->core[0] = _mm_set_epi64x( - 0x67452301efcdab89ULL, 0x98badcfe10325476ULL); - s->core[1] = _mm_set_epi32(0xc3d2e1f0, 0, 0, 0); - - sha1_block_setup(&s->blk); -} - -static void sha1_ni_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha1_ni *copy = container_of(hcopy, sha1_ni, hash); - sha1_ni *orig = container_of(horig, sha1_ni, hash); - - void *ptf_save = copy->pointer_to_free; - *copy = *orig; /* structure copy */ - copy->pointer_to_free = ptf_save; - - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha1_ni_free(ssh_hash *hash) -{ - sha1_ni *s = container_of(hash, sha1_ni, hash); - - void *ptf = s->pointer_to_free; - smemclr(s, sizeof(*s)); - sfree(ptf); -} - -static void sha1_ni_write(BinarySink *bs, const void *vp, size_t len) -{ - sha1_ni *s = BinarySink_DOWNCAST(bs, sha1_ni); - - while (len > 0) - if (sha1_block_write(&s->blk, &vp, &len)) - sha1_ni_block(s->core, s->blk.block); -} - -FUNC_ISA static void sha1_ni_digest(ssh_hash *hash, uint8_t *digest) -{ - sha1_ni *s = container_of(hash, sha1_ni, hash); - - sha1_block_pad(&s->blk, BinarySink_UPCAST(s)); - - /* Rearrange the first vector into its output order */ - __m128i abcd = _mm_shuffle_epi32(s->core[0], 0x1B); - - /* Byte-swap it into the output endianness */ - const __m128i mask = _mm_setr_epi8(3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12); - abcd = _mm_shuffle_epi8(abcd, mask); - - /* And store it */ - _mm_storeu_si128((__m128i *)digest, abcd); - - /* Finally, store the leftover word */ - uint32_t e = _mm_extract_epi32(s->core[1], 3); - PUT_32BIT_MSB_FIRST(digest + 16, e); -} - -const ssh_hashalg ssh_sha1_hw = { - .new = sha1_ni_new, - .reset = sha1_ni_reset, - .copyfrom = sha1_ni_copyfrom, - .digest = sha1_ni_digest, - .free = sha1_ni_free, - .hlen = 20, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-1", "SHA-NI accelerated"), -}; - -/* ---------------------------------------------------------------------- - * Hardware-accelerated implementation of SHA-1 using Arm NEON. - */ - -#elif HW_SHA1 == HW_SHA1_NEON - -/* - * Manually set the target architecture, if we decided above that we - * need to. - */ -#ifdef USE_CLANG_ATTR_TARGET_AARCH64 -/* - * A spot of cheating: redefine some ACLE feature macros before - * including arm_neon.h. Otherwise we won't get the SHA intrinsics - * defined by that header, because it will be looking at the settings - * for the whole translation unit rather than the ones we're going to - * put on some particular functions using __attribute__((target)). - */ -#define __ARM_NEON 1 -#define __ARM_FEATURE_CRYPTO 1 -#define __ARM_FEATURE_SHA2 1 -#define FUNC_ISA __attribute__ ((target("neon,crypto"))) -#endif /* USE_CLANG_ATTR_TARGET_AARCH64 */ - -#ifndef FUNC_ISA -#define FUNC_ISA -#endif - -#ifdef USE_ARM64_NEON_H -#include -#else -#include -#endif - -static bool sha1_hw_available(void) -{ - /* - * For Arm, we delegate to a per-platform detection function (see - * explanation in sshaes.c). - */ - return platform_sha1_hw_available(); -} - -typedef struct sha1_neon_core sha1_neon_core; -struct sha1_neon_core { - uint32x4_t abcd; - uint32_t e; -}; - -FUNC_ISA -static inline uint32x4_t sha1_neon_load_input(const uint8_t *p) -{ - return vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(p))); -} - -FUNC_ISA -static inline uint32x4_t sha1_neon_schedule_update( - uint32x4_t m4, uint32x4_t m3, uint32x4_t m2, uint32x4_t m1) -{ - return vsha1su1q_u32(vsha1su0q_u32(m4, m3, m2), m1); -} - -/* - * SHA-1 has three different kinds of round, differing in whether they - * use the Ch, Maj or Par functions defined above. Each one uses a - * separate NEON instruction, so we define three inline functions for - * the different round types using this macro. - * - * The two batches of Par-type rounds also use a different constant, - * but that's passed in as an operand, so we don't need a fourth - * inline function just for that. - */ -#define SHA1_NEON_ROUND_FN(type) \ - FUNC_ISA static inline sha1_neon_core sha1_neon_round4_##type( \ - sha1_neon_core old, uint32x4_t sched, uint32x4_t constant) \ - { \ - sha1_neon_core new; \ - uint32x4_t round_input = vaddq_u32(sched, constant); \ - new.abcd = vsha1##type##q_u32(old.abcd, old.e, round_input); \ - new.e = vsha1h_u32(vget_lane_u32(vget_low_u32(old.abcd), 0)); \ - return new; \ - } -SHA1_NEON_ROUND_FN(c) -SHA1_NEON_ROUND_FN(p) -SHA1_NEON_ROUND_FN(m) - -FUNC_ISA -static inline void sha1_neon_block(sha1_neon_core *core, const uint8_t *p) -{ - uint32x4_t constant, s0, s1, s2, s3; - sha1_neon_core cr = *core; - - constant = vdupq_n_u32(SHA1_STAGE0_CONSTANT); - s0 = sha1_neon_load_input(p); - cr = sha1_neon_round4_c(cr, s0, constant); - s1 = sha1_neon_load_input(p + 16); - cr = sha1_neon_round4_c(cr, s1, constant); - s2 = sha1_neon_load_input(p + 32); - cr = sha1_neon_round4_c(cr, s2, constant); - s3 = sha1_neon_load_input(p + 48); - cr = sha1_neon_round4_c(cr, s3, constant); - s0 = sha1_neon_schedule_update(s0, s1, s2, s3); - cr = sha1_neon_round4_c(cr, s0, constant); - - constant = vdupq_n_u32(SHA1_STAGE1_CONSTANT); - s1 = sha1_neon_schedule_update(s1, s2, s3, s0); - cr = sha1_neon_round4_p(cr, s1, constant); - s2 = sha1_neon_schedule_update(s2, s3, s0, s1); - cr = sha1_neon_round4_p(cr, s2, constant); - s3 = sha1_neon_schedule_update(s3, s0, s1, s2); - cr = sha1_neon_round4_p(cr, s3, constant); - s0 = sha1_neon_schedule_update(s0, s1, s2, s3); - cr = sha1_neon_round4_p(cr, s0, constant); - s1 = sha1_neon_schedule_update(s1, s2, s3, s0); - cr = sha1_neon_round4_p(cr, s1, constant); - - constant = vdupq_n_u32(SHA1_STAGE2_CONSTANT); - s2 = sha1_neon_schedule_update(s2, s3, s0, s1); - cr = sha1_neon_round4_m(cr, s2, constant); - s3 = sha1_neon_schedule_update(s3, s0, s1, s2); - cr = sha1_neon_round4_m(cr, s3, constant); - s0 = sha1_neon_schedule_update(s0, s1, s2, s3); - cr = sha1_neon_round4_m(cr, s0, constant); - s1 = sha1_neon_schedule_update(s1, s2, s3, s0); - cr = sha1_neon_round4_m(cr, s1, constant); - s2 = sha1_neon_schedule_update(s2, s3, s0, s1); - cr = sha1_neon_round4_m(cr, s2, constant); - - constant = vdupq_n_u32(SHA1_STAGE3_CONSTANT); - s3 = sha1_neon_schedule_update(s3, s0, s1, s2); - cr = sha1_neon_round4_p(cr, s3, constant); - s0 = sha1_neon_schedule_update(s0, s1, s2, s3); - cr = sha1_neon_round4_p(cr, s0, constant); - s1 = sha1_neon_schedule_update(s1, s2, s3, s0); - cr = sha1_neon_round4_p(cr, s1, constant); - s2 = sha1_neon_schedule_update(s2, s3, s0, s1); - cr = sha1_neon_round4_p(cr, s2, constant); - s3 = sha1_neon_schedule_update(s3, s0, s1, s2); - cr = sha1_neon_round4_p(cr, s3, constant); - - core->abcd = vaddq_u32(core->abcd, cr.abcd); - core->e += cr.e; -} - -typedef struct sha1_neon { - sha1_neon_core core; - sha1_block blk; - BinarySink_IMPLEMENTATION; - ssh_hash hash; -} sha1_neon; - -static void sha1_neon_write(BinarySink *bs, const void *vp, size_t len); - -static ssh_hash *sha1_neon_new(const ssh_hashalg *alg) -{ - if (!sha1_hw_available_cached()) - return NULL; - - sha1_neon *s = snew(sha1_neon); - - s->hash.vt = alg; - BinarySink_INIT(s, sha1_neon_write); - BinarySink_DELEGATE_INIT(&s->hash, s); - return &s->hash; -} - -static void sha1_neon_reset(ssh_hash *hash) -{ - sha1_neon *s = container_of(hash, sha1_neon, hash); - - s->core.abcd = vld1q_u32(sha1_initial_state); - s->core.e = sha1_initial_state[4]; - - sha1_block_setup(&s->blk); -} - -static void sha1_neon_copyfrom(ssh_hash *hcopy, ssh_hash *horig) -{ - sha1_neon *copy = container_of(hcopy, sha1_neon, hash); - sha1_neon *orig = container_of(horig, sha1_neon, hash); - - *copy = *orig; /* structure copy */ - - BinarySink_COPIED(copy); - BinarySink_DELEGATE_INIT(©->hash, copy); -} - -static void sha1_neon_free(ssh_hash *hash) -{ - sha1_neon *s = container_of(hash, sha1_neon, hash); - smemclr(s, sizeof(*s)); - sfree(s); -} - -static void sha1_neon_write(BinarySink *bs, const void *vp, size_t len) -{ - sha1_neon *s = BinarySink_DOWNCAST(bs, sha1_neon); - - while (len > 0) - if (sha1_block_write(&s->blk, &vp, &len)) - sha1_neon_block(&s->core, s->blk.block); -} - -static void sha1_neon_digest(ssh_hash *hash, uint8_t *digest) -{ - sha1_neon *s = container_of(hash, sha1_neon, hash); - - sha1_block_pad(&s->blk, BinarySink_UPCAST(s)); - vst1q_u8(digest, vrev32q_u8(vreinterpretq_u8_u32(s->core.abcd))); - PUT_32BIT_MSB_FIRST(digest + 16, s->core.e); -} - -const ssh_hashalg ssh_sha1_hw = { - .new = sha1_neon_new, - .reset = sha1_neon_reset, - .copyfrom = sha1_neon_copyfrom, - .digest = sha1_neon_digest, - .free = sha1_neon_free, - .hlen = 20, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-1", "NEON accelerated"), -}; - -/* ---------------------------------------------------------------------- - * Stub functions if we have no hardware-accelerated SHA-1. In this - * case, sha1_hw_new returns NULL (though it should also never be - * selected by sha1_select, so the only thing that should even be - * _able_ to call it is testcrypt). As a result, the remaining vtable - * functions should never be called at all. - */ - -#elif HW_SHA1 == HW_SHA1_NONE - -static bool sha1_hw_available(void) -{ - return false; -} - -static ssh_hash *sha1_stub_new(const ssh_hashalg *alg) -{ - return NULL; -} - -#define STUB_BODY { unreachable("Should never be called"); } - -static void sha1_stub_reset(ssh_hash *hash) STUB_BODY -static void sha1_stub_copyfrom(ssh_hash *hash, ssh_hash *orig) STUB_BODY -static void sha1_stub_free(ssh_hash *hash) STUB_BODY -static void sha1_stub_digest(ssh_hash *hash, uint8_t *digest) STUB_BODY - -const ssh_hashalg ssh_sha1_hw = { - .new = sha1_stub_new, - .reset = sha1_stub_reset, - .copyfrom = sha1_stub_copyfrom, - .digest = sha1_stub_digest, - .free = sha1_stub_free, - .hlen = 20, - .blocklen = 64, - HASHALG_NAMES_ANNOTATED("SHA-1", "!NONEXISTENT ACCELERATED VERSION!"), -}; - -#endif /* HW_SHA1 */ diff --git a/code/storage.h b/code/storage.h index 6464b69..3e03181 100644 --- a/code/storage.h +++ b/code/storage.h @@ -81,8 +81,8 @@ void enum_settings_finish(settings_e *handle); * be 0 (entry matches database), 1 (entry is absent in database), * or 2 (entry exists in database and is different). */ -int verify_host_key(const char *hostname, int port, - const char *keytype, const char *key); +int check_stored_host_key(const char *hostname, int port, + const char *keytype, const char *key); /* * Write a host key into the database, overwriting any previous diff --git a/code/stubs/nocmdline.c b/code/stubs/nocmdline.c new file mode 100644 index 0000000..60e2cb6 --- /dev/null +++ b/code/stubs/nocmdline.c @@ -0,0 +1,22 @@ +/* + * nocmdline.c - stubs in applications which don't do the + * standard(ish) PuTTY tools' command-line parsing + */ + +#include +#include +#include +#include "putty.h" + +/* + * Stub version of the function in cmdline.c which provides the + * password to SSH authentication by remembering it having been passed + * as a command-line option. If we're not doing normal command-line + * handling, then there is no such option, so that function always + * returns failure. + */ +SeatPromptResult cmdline_get_passwd_input( + prompts_t *p, cmdline_get_passwd_input_state *state, bool restartable) +{ + return SPR_INCOMPLETE; +} diff --git a/code/nogss.c b/code/stubs/nogss.c similarity index 100% rename from code/nogss.c rename to code/stubs/nogss.c diff --git a/code/noprint.c b/code/stubs/noprint.c similarity index 100% rename from code/noprint.c rename to code/stubs/noprint.c diff --git a/code/norand.c b/code/stubs/norand.c similarity index 100% rename from code/norand.c rename to code/stubs/norand.c diff --git a/code/noterm.c b/code/stubs/noterm.c similarity index 54% rename from code/noterm.c rename to code/stubs/noterm.c index 4ca99fa..c2e534b 100644 --- a/code/noterm.c +++ b/code/stubs/noterm.c @@ -9,3 +9,8 @@ void term_nopaste(Terminal *term) { } + +SeatPromptResult term_get_userpass_input(Terminal *term, prompts_t *p) +{ + return SPR_SW_ABORT("No terminal to send interactive prompts to"); +} diff --git a/code/notiming.c b/code/stubs/notiming.c similarity index 100% rename from code/notiming.c rename to code/stubs/notiming.c diff --git a/code/nullplug.c b/code/stubs/nullplug.c similarity index 59% rename from code/nullplug.c rename to code/stubs/nullplug.c index 953f034..d583d15 100644 --- a/code/nullplug.c +++ b/code/stubs/nullplug.c @@ -7,27 +7,25 @@ #include "putty.h" -static void nullplug_socket_log(Plug *plug, PlugLogType type, SockAddr *addr, - int port, const char *err_msg, int err_code) +void nullplug_log(Plug *plug, PlugLogType type, SockAddr *addr, + int port, const char *err_msg, int err_code) { } -static void nullplug_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +void nullplug_closing(Plug *plug, PlugCloseType type, const char *error_msg) { } -static void nullplug_receive( - Plug *plug, int urgent, const char *data, size_t len) +void nullplug_receive(Plug *plug, int urgent, const char *data, size_t len) { } -static void nullplug_sent(Plug *plug, size_t bufsize) +void nullplug_sent(Plug *plug, size_t bufsize) { } static const PlugVtable nullplug_plugvt = { - .log = nullplug_socket_log, + .log = nullplug_log, .closing = nullplug_closing, .receive = nullplug_receive, .sent = nullplug_sent, diff --git a/code/terminal/bidi.c b/code/terminal/bidi.c new file mode 100644 index 0000000..128f84c --- /dev/null +++ b/code/terminal/bidi.c @@ -0,0 +1,3608 @@ +/* + * Implementation of the Unicode bidirectional and Arabic shaping + * algorithms for PuTTY. + * + * Original version written and kindly contributed to this code base + * by Ahmad Khalifa of Arabeyes. The bidi part was almost completely + * rewritten in 2021 by Simon Tatham to bring it up to date, but the + * shaping part is still the one by the original authors. + * + * Implementation notes: + * + * Algorithm version + * ----------------- + * + * This algorithm is up to date with Unicode Standard Annex #9 + * revision 44: + * + * https://www.unicode.org/reports/tr9/tr9-44.html + * + * and passes the full conformance test suite in Unicode 14.0.0. + * + * Paragraph and line handling + * --------------------------- + * + * The full Unicode bidi algorithm expects to receive text containing + * multiple paragraphs, together with a decision about how those + * paragraphs are broken up into lines. It calculates embedding levels + * a whole paragraph at a time without considering the line breaks, + * but then the final reordering of the text for display is done to + * each _line_ independently based on the levels computed for the text + * in that line. + * + * This algorithm omits all of that, because it's intended for use as + * a display-time transformation of a text terminal, which doesn't + * preserve enough semantic information to decide what's a paragraph + * break and what is not. So a piece of input text provided to this + * algorithm is always expected to consist of exactly one paragraph + * *and* exactly one line. + * + * Embeddings, overrides and isolates + * ---------------------------------- + * + * This implementation has full support for all the Unicode special + * control characters that modify bidi behaviour, such as + * + * U+202A LEFT-TO-RIGHT EMBEDDING + * U+202B RIGHT-TO-LEFT EMBEDDING + * U+202D LEFT-TO-RIGHT OVERRIDE + * U+202E RIGHT-TO-LEFT OVERRIDE + * U+202C POP DIRECTIONAL FORMATTING + * U+2068 FIRST STRONG ISOLATE + * U+2066 LEFT-TO-RIGHT ISOLATE + * U+2067 RIGHT-TO-LEFT ISOLATE + * U+2069 POP DIRECTIONAL ISOLATE + * + * However, at present, the terminal emulator that is a client of this + * code has no way to pass those in (because they're dropped during + * escape sequence processing and don't get stored in the terminal + * state). Nonetheless, the code is all here, so if the terminal + * emulator becomes able to record those characters at some later + * point, we'll be all set to take account of them during bidi. + * + * But the _main_ purpose of supporting the full bidi algorithm is + * simply that that's the easiest way to be sure it's correct, because + * if you support the whole thing, you can run the full conformance + * test suite. (And I don't 100% believe that restricting to the + * subset of _tests_ valid with a reduced character set will test the + * full set of _functionality_ relevant to the reduced set.) + * + * Retained formatting characters + * ------------------------------ + * + * The standard bidi algorithm, in step X9, deletes assorted + * formatting characters from the text: all the embedding and override + * section initiator characters, the Pop Directional Formatting + * character that closes one of those sections again, and any + * character labelled as Boundary Neutral. So the characters it + * returns are not a _full_ reordering of the input; some input + * characters vanish completely. + * + * This would be fine, if it were not for the fact that - as far as I + * can see - _exactly one_ Unicode code point in the discarded + * category has a wcwidth() of more than 0, namely U+00AD SOFT HYPHEN + * which is a printing character for terminal purposes but has a bidi + * class of BN. + * + * Therefore, we must implement a modified version of the algorithm, + * as described in section 5.2 of TR9, which retains those formatting + * characters so that a client can find out where they ended up in the + * reordering. + * + * Section 5.2 describes a set of modifications to the algorithm that + * are _intended_ to achieve this without changing the rest of the + * behaviour: that is, if you take the output of the modified + * algorithm and delete all the characters that the standard algorithm + * would have removed, you should end up with the remaining characters + * in the same order that the standard algorithm would have delivered. + * However, section 5.2 admits the possibility of error, and says "in + * case of any deviation the explicit algorithm is the normative + * statement for conformance". And indeed, in one or two places I + * found I had to make my own tweaks to the section 5.2 description in + * order to get the whole test suite to pass, because I think the 5.2 + * modifications if taken literally don't quite achieve that. My + * justification is that sentence of 5.2: in case of doubt, the right + * thing is to make the code behave the same as the official + * algorithm. + * + * It's possible that there might still be some undiscovered + * discrepancies between the behaviour of the standard and modified + * algorithms. So, just in case, I've kept in this code the ability to + * implement the _standard_ algorithm too! If you compile with + * -DREMOVE_FORMATTING_CHARS, this code should go back to implementing + * the literal UAX#9 bidi algorithm - so you can run your suspect + * input through both versions, making it much easier to figure out + * why they differ, and in which of the many stages of the algorithm + * the difference was introduced. + * + * However, beware that when compiling in this mode, the do_bidi + * interface to the terminal will stop working, and just abort() when + * called! The only useful thing you can do with this mode is to run + * the companion program bidi_test.c. + */ + +#include /* definition of wchar_t */ + +#include "putty.h" +#include "misc.h" +#include "bidi.h" + +typedef struct { + char type; + wchar_t form_b; +} shape_node; + +/* Kept near the actual table, for verification. */ +#define SHAPE_FIRST 0x621 +#define SHAPE_LAST (SHAPE_FIRST + lenof(shapetypes) - 1) + +static const shape_node shapetypes[] = { + /* index, Typ, Iso, Ligature Index*/ + /* 621 */ {SU, 0xFE80}, + /* 622 */ {SR, 0xFE81}, + /* 623 */ {SR, 0xFE83}, + /* 624 */ {SR, 0xFE85}, + /* 625 */ {SR, 0xFE87}, + /* 626 */ {SD, 0xFE89}, + /* 627 */ {SR, 0xFE8D}, + /* 628 */ {SD, 0xFE8F}, + /* 629 */ {SR, 0xFE93}, + /* 62A */ {SD, 0xFE95}, + /* 62B */ {SD, 0xFE99}, + /* 62C */ {SD, 0xFE9D}, + /* 62D */ {SD, 0xFEA1}, + /* 62E */ {SD, 0xFEA5}, + /* 62F */ {SR, 0xFEA9}, + /* 630 */ {SR, 0xFEAB}, + /* 631 */ {SR, 0xFEAD}, + /* 632 */ {SR, 0xFEAF}, + /* 633 */ {SD, 0xFEB1}, + /* 634 */ {SD, 0xFEB5}, + /* 635 */ {SD, 0xFEB9}, + /* 636 */ {SD, 0xFEBD}, + /* 637 */ {SD, 0xFEC1}, + /* 638 */ {SD, 0xFEC5}, + /* 639 */ {SD, 0xFEC9}, + /* 63A */ {SD, 0xFECD}, + /* 63B */ {SU, 0x0}, + /* 63C */ {SU, 0x0}, + /* 63D */ {SU, 0x0}, + /* 63E */ {SU, 0x0}, + /* 63F */ {SU, 0x0}, + /* 640 */ {SC, 0x0}, + /* 641 */ {SD, 0xFED1}, + /* 642 */ {SD, 0xFED5}, + /* 643 */ {SD, 0xFED9}, + /* 644 */ {SD, 0xFEDD}, + /* 645 */ {SD, 0xFEE1}, + /* 646 */ {SD, 0xFEE5}, + /* 647 */ {SD, 0xFEE9}, + /* 648 */ {SR, 0xFEED}, + /* 649 */ {SR, 0xFEEF}, /* SD */ + /* 64A */ {SD, 0xFEF1}, + /* 64B */ {SU, 0x0}, + /* 64C */ {SU, 0x0}, + /* 64D */ {SU, 0x0}, + /* 64E */ {SU, 0x0}, + /* 64F */ {SU, 0x0}, + /* 650 */ {SU, 0x0}, + /* 651 */ {SU, 0x0}, + /* 652 */ {SU, 0x0}, + /* 653 */ {SU, 0x0}, + /* 654 */ {SU, 0x0}, + /* 655 */ {SU, 0x0}, + /* 656 */ {SU, 0x0}, + /* 657 */ {SU, 0x0}, + /* 658 */ {SU, 0x0}, + /* 659 */ {SU, 0x0}, + /* 65A */ {SU, 0x0}, + /* 65B */ {SU, 0x0}, + /* 65C */ {SU, 0x0}, + /* 65D */ {SU, 0x0}, + /* 65E */ {SU, 0x0}, + /* 65F */ {SU, 0x0}, + /* 660 */ {SU, 0x0}, + /* 661 */ {SU, 0x0}, + /* 662 */ {SU, 0x0}, + /* 663 */ {SU, 0x0}, + /* 664 */ {SU, 0x0}, + /* 665 */ {SU, 0x0}, + /* 666 */ {SU, 0x0}, + /* 667 */ {SU, 0x0}, + /* 668 */ {SU, 0x0}, + /* 669 */ {SU, 0x0}, + /* 66A */ {SU, 0x0}, + /* 66B */ {SU, 0x0}, + /* 66C */ {SU, 0x0}, + /* 66D */ {SU, 0x0}, + /* 66E */ {SU, 0x0}, + /* 66F */ {SU, 0x0}, + /* 670 */ {SU, 0x0}, + /* 671 */ {SR, 0xFB50}, + /* 672 */ {SU, 0x0}, + /* 673 */ {SU, 0x0}, + /* 674 */ {SU, 0x0}, + /* 675 */ {SU, 0x0}, + /* 676 */ {SU, 0x0}, + /* 677 */ {SU, 0x0}, + /* 678 */ {SU, 0x0}, + /* 679 */ {SD, 0xFB66}, + /* 67A */ {SD, 0xFB5E}, + /* 67B */ {SD, 0xFB52}, + /* 67C */ {SU, 0x0}, + /* 67D */ {SU, 0x0}, + /* 67E */ {SD, 0xFB56}, + /* 67F */ {SD, 0xFB62}, + /* 680 */ {SD, 0xFB5A}, + /* 681 */ {SU, 0x0}, + /* 682 */ {SU, 0x0}, + /* 683 */ {SD, 0xFB76}, + /* 684 */ {SD, 0xFB72}, + /* 685 */ {SU, 0x0}, + /* 686 */ {SD, 0xFB7A}, + /* 687 */ {SD, 0xFB7E}, + /* 688 */ {SR, 0xFB88}, + /* 689 */ {SU, 0x0}, + /* 68A */ {SU, 0x0}, + /* 68B */ {SU, 0x0}, + /* 68C */ {SR, 0xFB84}, + /* 68D */ {SR, 0xFB82}, + /* 68E */ {SR, 0xFB86}, + /* 68F */ {SU, 0x0}, + /* 690 */ {SU, 0x0}, + /* 691 */ {SR, 0xFB8C}, + /* 692 */ {SU, 0x0}, + /* 693 */ {SU, 0x0}, + /* 694 */ {SU, 0x0}, + /* 695 */ {SU, 0x0}, + /* 696 */ {SU, 0x0}, + /* 697 */ {SU, 0x0}, + /* 698 */ {SR, 0xFB8A}, + /* 699 */ {SU, 0x0}, + /* 69A */ {SU, 0x0}, + /* 69B */ {SU, 0x0}, + /* 69C */ {SU, 0x0}, + /* 69D */ {SU, 0x0}, + /* 69E */ {SU, 0x0}, + /* 69F */ {SU, 0x0}, + /* 6A0 */ {SU, 0x0}, + /* 6A1 */ {SU, 0x0}, + /* 6A2 */ {SU, 0x0}, + /* 6A3 */ {SU, 0x0}, + /* 6A4 */ {SD, 0xFB6A}, + /* 6A5 */ {SU, 0x0}, + /* 6A6 */ {SD, 0xFB6E}, + /* 6A7 */ {SU, 0x0}, + /* 6A8 */ {SU, 0x0}, + /* 6A9 */ {SD, 0xFB8E}, + /* 6AA */ {SU, 0x0}, + /* 6AB */ {SU, 0x0}, + /* 6AC */ {SU, 0x0}, + /* 6AD */ {SD, 0xFBD3}, + /* 6AE */ {SU, 0x0}, + /* 6AF */ {SD, 0xFB92}, + /* 6B0 */ {SU, 0x0}, + /* 6B1 */ {SD, 0xFB9A}, + /* 6B2 */ {SU, 0x0}, + /* 6B3 */ {SD, 0xFB96}, + /* 6B4 */ {SU, 0x0}, + /* 6B5 */ {SU, 0x0}, + /* 6B6 */ {SU, 0x0}, + /* 6B7 */ {SU, 0x0}, + /* 6B8 */ {SU, 0x0}, + /* 6B9 */ {SU, 0x0}, + /* 6BA */ {SR, 0xFB9E}, + /* 6BB */ {SD, 0xFBA0}, + /* 6BC */ {SU, 0x0}, + /* 6BD */ {SU, 0x0}, + /* 6BE */ {SD, 0xFBAA}, + /* 6BF */ {SU, 0x0}, + /* 6C0 */ {SR, 0xFBA4}, + /* 6C1 */ {SD, 0xFBA6}, + /* 6C2 */ {SU, 0x0}, + /* 6C3 */ {SU, 0x0}, + /* 6C4 */ {SU, 0x0}, + /* 6C5 */ {SR, 0xFBE0}, + /* 6C6 */ {SR, 0xFBD9}, + /* 6C7 */ {SR, 0xFBD7}, + /* 6C8 */ {SR, 0xFBDB}, + /* 6C9 */ {SR, 0xFBE2}, + /* 6CA */ {SU, 0x0}, + /* 6CB */ {SR, 0xFBDE}, + /* 6CC */ {SD, 0xFBFC}, + /* 6CD */ {SU, 0x0}, + /* 6CE */ {SU, 0x0}, + /* 6CF */ {SU, 0x0}, + /* 6D0 */ {SU, 0x0}, + /* 6D1 */ {SU, 0x0}, + /* 6D2 */ {SR, 0xFBAE}, +}; + +/* + * Returns the bidi character type of ch. + * + * The data table in this function is constructed from the Unicode + * Character Database version 14.0.0, downloadable from unicode.org at + * the URL + * + * https://www.unicode.org/Public/14.0.0/ucd/ + * + * by the following fragment of Perl: + +perl -ne '@_=split ";"; $num = hex $_[0]; $type = $_[4];' \ + -e '$fl = ($_[1] =~ /First/ ? 1 : $_[1] =~ /Last/ ? 2 : 0);' \ + -e 'if ($type eq $runtype and ($runend == $num-1 or ' \ + -e ' ($fl==2 and $pfl==1))) {$runend = $num;} else { &reset; }' \ + -e '$pfl=$fl; END { &reset }; sub reset {' \ + -e 'printf" {0x%04x, 0x%04x, %s},\n",$runstart,$runend,$runtype' \ + -e ' if defined $runstart and $runtype ne "ON";' \ + -e '$runstart=$runend=$num; $runtype=$type;}' \ + UnicodeData.txt + + */ +unsigned char bidi_getType(int ch) +{ + static const struct { + int first, last, type; + } lookup[] = { + {0x0000, 0x0008, BN}, + {0x0009, 0x0009, S}, + {0x000a, 0x000a, B}, + {0x000b, 0x000b, S}, + {0x000c, 0x000c, WS}, + {0x000d, 0x000d, B}, + {0x000e, 0x001b, BN}, + {0x001c, 0x001e, B}, + {0x001f, 0x001f, S}, + {0x0020, 0x0020, WS}, + {0x0023, 0x0025, ET}, + {0x002b, 0x002b, ES}, + {0x002c, 0x002c, CS}, + {0x002d, 0x002d, ES}, + {0x002e, 0x002f, CS}, + {0x0030, 0x0039, EN}, + {0x003a, 0x003a, CS}, + {0x0041, 0x005a, L}, + {0x0061, 0x007a, L}, + {0x007f, 0x0084, BN}, + {0x0085, 0x0085, B}, + {0x0086, 0x009f, BN}, + {0x00a0, 0x00a0, CS}, + {0x00a2, 0x00a5, ET}, + {0x00aa, 0x00aa, L}, + {0x00ad, 0x00ad, BN}, + {0x00b0, 0x00b1, ET}, + {0x00b2, 0x00b3, EN}, + {0x00b5, 0x00b5, L}, + {0x00b9, 0x00b9, EN}, + {0x00ba, 0x00ba, L}, + {0x00c0, 0x00d6, L}, + {0x00d8, 0x00f6, L}, + {0x00f8, 0x02b8, L}, + {0x02bb, 0x02c1, L}, + {0x02d0, 0x02d1, L}, + {0x02e0, 0x02e4, L}, + {0x02ee, 0x02ee, L}, + {0x0300, 0x036f, NSM}, + {0x0370, 0x0373, L}, + {0x0376, 0x0377, L}, + {0x037a, 0x037d, L}, + {0x037f, 0x037f, L}, + {0x0386, 0x0386, L}, + {0x0388, 0x038a, L}, + {0x038c, 0x038c, L}, + {0x038e, 0x03a1, L}, + {0x03a3, 0x03f5, L}, + {0x03f7, 0x0482, L}, + {0x0483, 0x0489, NSM}, + {0x048a, 0x052f, L}, + {0x0531, 0x0556, L}, + {0x0559, 0x0589, L}, + {0x058f, 0x058f, ET}, + {0x0591, 0x05bd, NSM}, + {0x05be, 0x05be, R}, + {0x05bf, 0x05bf, NSM}, + {0x05c0, 0x05c0, R}, + {0x05c1, 0x05c2, NSM}, + {0x05c3, 0x05c3, R}, + {0x05c4, 0x05c5, NSM}, + {0x05c6, 0x05c6, R}, + {0x05c7, 0x05c7, NSM}, + {0x05d0, 0x05ea, R}, + {0x05ef, 0x05f4, R}, + {0x0600, 0x0605, AN}, + {0x0608, 0x0608, AL}, + {0x0609, 0x060a, ET}, + {0x060b, 0x060b, AL}, + {0x060c, 0x060c, CS}, + {0x060d, 0x060d, AL}, + {0x0610, 0x061a, NSM}, + {0x061b, 0x064a, AL}, + {0x064b, 0x065f, NSM}, + {0x0660, 0x0669, AN}, + {0x066a, 0x066a, ET}, + {0x066b, 0x066c, AN}, + {0x066d, 0x066f, AL}, + {0x0670, 0x0670, NSM}, + {0x0671, 0x06d5, AL}, + {0x06d6, 0x06dc, NSM}, + {0x06dd, 0x06dd, AN}, + {0x06df, 0x06e4, NSM}, + {0x06e5, 0x06e6, AL}, + {0x06e7, 0x06e8, NSM}, + {0x06ea, 0x06ed, NSM}, + {0x06ee, 0x06ef, AL}, + {0x06f0, 0x06f9, EN}, + {0x06fa, 0x070d, AL}, + {0x070f, 0x0710, AL}, + {0x0711, 0x0711, NSM}, + {0x0712, 0x072f, AL}, + {0x0730, 0x074a, NSM}, + {0x074d, 0x07a5, AL}, + {0x07a6, 0x07b0, NSM}, + {0x07b1, 0x07b1, AL}, + {0x07c0, 0x07ea, R}, + {0x07eb, 0x07f3, NSM}, + {0x07f4, 0x07f5, R}, + {0x07fa, 0x07fa, R}, + {0x07fd, 0x07fd, NSM}, + {0x07fe, 0x0815, R}, + {0x0816, 0x0819, NSM}, + {0x081a, 0x081a, R}, + {0x081b, 0x0823, NSM}, + {0x0824, 0x0824, R}, + {0x0825, 0x0827, NSM}, + {0x0828, 0x0828, R}, + {0x0829, 0x082d, NSM}, + {0x0830, 0x083e, R}, + {0x0840, 0x0858, R}, + {0x0859, 0x085b, NSM}, + {0x085e, 0x085e, R}, + {0x0860, 0x086a, AL}, + {0x0870, 0x088e, AL}, + {0x0890, 0x0891, AN}, + {0x0898, 0x089f, NSM}, + {0x08a0, 0x08c9, AL}, + {0x08ca, 0x08e1, NSM}, + {0x08e2, 0x08e2, AN}, + {0x08e3, 0x0902, NSM}, + {0x0903, 0x0939, L}, + {0x093a, 0x093a, NSM}, + {0x093b, 0x093b, L}, + {0x093c, 0x093c, NSM}, + {0x093d, 0x0940, L}, + {0x0941, 0x0948, NSM}, + {0x0949, 0x094c, L}, + {0x094d, 0x094d, NSM}, + {0x094e, 0x0950, L}, + {0x0951, 0x0957, NSM}, + {0x0958, 0x0961, L}, + {0x0962, 0x0963, NSM}, + {0x0964, 0x0980, L}, + {0x0981, 0x0981, NSM}, + {0x0982, 0x0983, L}, + {0x0985, 0x098c, L}, + {0x098f, 0x0990, L}, + {0x0993, 0x09a8, L}, + {0x09aa, 0x09b0, L}, + {0x09b2, 0x09b2, L}, + {0x09b6, 0x09b9, L}, + {0x09bc, 0x09bc, NSM}, + {0x09bd, 0x09c0, L}, + {0x09c1, 0x09c4, NSM}, + {0x09c7, 0x09c8, L}, + {0x09cb, 0x09cc, L}, + {0x09cd, 0x09cd, NSM}, + {0x09ce, 0x09ce, L}, + {0x09d7, 0x09d7, L}, + {0x09dc, 0x09dd, L}, + {0x09df, 0x09e1, L}, + {0x09e2, 0x09e3, NSM}, + {0x09e6, 0x09f1, L}, + {0x09f2, 0x09f3, ET}, + {0x09f4, 0x09fa, L}, + {0x09fb, 0x09fb, ET}, + {0x09fc, 0x09fd, L}, + {0x09fe, 0x09fe, NSM}, + {0x0a01, 0x0a02, NSM}, + {0x0a03, 0x0a03, L}, + {0x0a05, 0x0a0a, L}, + {0x0a0f, 0x0a10, L}, + {0x0a13, 0x0a28, L}, + {0x0a2a, 0x0a30, L}, + {0x0a32, 0x0a33, L}, + {0x0a35, 0x0a36, L}, + {0x0a38, 0x0a39, L}, + {0x0a3c, 0x0a3c, NSM}, + {0x0a3e, 0x0a40, L}, + {0x0a41, 0x0a42, NSM}, + {0x0a47, 0x0a48, NSM}, + {0x0a4b, 0x0a4d, NSM}, + {0x0a51, 0x0a51, NSM}, + {0x0a59, 0x0a5c, L}, + {0x0a5e, 0x0a5e, L}, + {0x0a66, 0x0a6f, L}, + {0x0a70, 0x0a71, NSM}, + {0x0a72, 0x0a74, L}, + {0x0a75, 0x0a75, NSM}, + {0x0a76, 0x0a76, L}, + {0x0a81, 0x0a82, NSM}, + {0x0a83, 0x0a83, L}, + {0x0a85, 0x0a8d, L}, + {0x0a8f, 0x0a91, L}, + {0x0a93, 0x0aa8, L}, + {0x0aaa, 0x0ab0, L}, + {0x0ab2, 0x0ab3, L}, + {0x0ab5, 0x0ab9, L}, + {0x0abc, 0x0abc, NSM}, + {0x0abd, 0x0ac0, L}, + {0x0ac1, 0x0ac5, NSM}, + {0x0ac7, 0x0ac8, NSM}, + {0x0ac9, 0x0ac9, L}, + {0x0acb, 0x0acc, L}, + {0x0acd, 0x0acd, NSM}, + {0x0ad0, 0x0ad0, L}, + {0x0ae0, 0x0ae1, L}, + {0x0ae2, 0x0ae3, NSM}, + {0x0ae6, 0x0af0, L}, + {0x0af1, 0x0af1, ET}, + {0x0af9, 0x0af9, L}, + {0x0afa, 0x0aff, NSM}, + {0x0b01, 0x0b01, NSM}, + {0x0b02, 0x0b03, L}, + {0x0b05, 0x0b0c, L}, + {0x0b0f, 0x0b10, L}, + {0x0b13, 0x0b28, L}, + {0x0b2a, 0x0b30, L}, + {0x0b32, 0x0b33, L}, + {0x0b35, 0x0b39, L}, + {0x0b3c, 0x0b3c, NSM}, + {0x0b3d, 0x0b3e, L}, + {0x0b3f, 0x0b3f, NSM}, + {0x0b40, 0x0b40, L}, + {0x0b41, 0x0b44, NSM}, + {0x0b47, 0x0b48, L}, + {0x0b4b, 0x0b4c, L}, + {0x0b4d, 0x0b4d, NSM}, + {0x0b55, 0x0b56, NSM}, + {0x0b57, 0x0b57, L}, + {0x0b5c, 0x0b5d, L}, + {0x0b5f, 0x0b61, L}, + {0x0b62, 0x0b63, NSM}, + {0x0b66, 0x0b77, L}, + {0x0b82, 0x0b82, NSM}, + {0x0b83, 0x0b83, L}, + {0x0b85, 0x0b8a, L}, + {0x0b8e, 0x0b90, L}, + {0x0b92, 0x0b95, L}, + {0x0b99, 0x0b9a, L}, + {0x0b9c, 0x0b9c, L}, + {0x0b9e, 0x0b9f, L}, + {0x0ba3, 0x0ba4, L}, + {0x0ba8, 0x0baa, L}, + {0x0bae, 0x0bb9, L}, + {0x0bbe, 0x0bbf, L}, + {0x0bc0, 0x0bc0, NSM}, + {0x0bc1, 0x0bc2, L}, + {0x0bc6, 0x0bc8, L}, + {0x0bca, 0x0bcc, L}, + {0x0bcd, 0x0bcd, NSM}, + {0x0bd0, 0x0bd0, L}, + {0x0bd7, 0x0bd7, L}, + {0x0be6, 0x0bf2, L}, + {0x0bf9, 0x0bf9, ET}, + {0x0c00, 0x0c00, NSM}, + {0x0c01, 0x0c03, L}, + {0x0c04, 0x0c04, NSM}, + {0x0c05, 0x0c0c, L}, + {0x0c0e, 0x0c10, L}, + {0x0c12, 0x0c28, L}, + {0x0c2a, 0x0c39, L}, + {0x0c3c, 0x0c3c, NSM}, + {0x0c3d, 0x0c3d, L}, + {0x0c3e, 0x0c40, NSM}, + {0x0c41, 0x0c44, L}, + {0x0c46, 0x0c48, NSM}, + {0x0c4a, 0x0c4d, NSM}, + {0x0c55, 0x0c56, NSM}, + {0x0c58, 0x0c5a, L}, + {0x0c5d, 0x0c5d, L}, + {0x0c60, 0x0c61, L}, + {0x0c62, 0x0c63, NSM}, + {0x0c66, 0x0c6f, L}, + {0x0c77, 0x0c77, L}, + {0x0c7f, 0x0c80, L}, + {0x0c81, 0x0c81, NSM}, + {0x0c82, 0x0c8c, L}, + {0x0c8e, 0x0c90, L}, + {0x0c92, 0x0ca8, L}, + {0x0caa, 0x0cb3, L}, + {0x0cb5, 0x0cb9, L}, + {0x0cbc, 0x0cbc, NSM}, + {0x0cbd, 0x0cc4, L}, + {0x0cc6, 0x0cc8, L}, + {0x0cca, 0x0ccb, L}, + {0x0ccc, 0x0ccd, NSM}, + {0x0cd5, 0x0cd6, L}, + {0x0cdd, 0x0cde, L}, + {0x0ce0, 0x0ce1, L}, + {0x0ce2, 0x0ce3, NSM}, + {0x0ce6, 0x0cef, L}, + {0x0cf1, 0x0cf2, L}, + {0x0d00, 0x0d01, NSM}, + {0x0d02, 0x0d0c, L}, + {0x0d0e, 0x0d10, L}, + {0x0d12, 0x0d3a, L}, + {0x0d3b, 0x0d3c, NSM}, + {0x0d3d, 0x0d40, L}, + {0x0d41, 0x0d44, NSM}, + {0x0d46, 0x0d48, L}, + {0x0d4a, 0x0d4c, L}, + {0x0d4d, 0x0d4d, NSM}, + {0x0d4e, 0x0d4f, L}, + {0x0d54, 0x0d61, L}, + {0x0d62, 0x0d63, NSM}, + {0x0d66, 0x0d7f, L}, + {0x0d81, 0x0d81, NSM}, + {0x0d82, 0x0d83, L}, + {0x0d85, 0x0d96, L}, + {0x0d9a, 0x0db1, L}, + {0x0db3, 0x0dbb, L}, + {0x0dbd, 0x0dbd, L}, + {0x0dc0, 0x0dc6, L}, + {0x0dca, 0x0dca, NSM}, + {0x0dcf, 0x0dd1, L}, + {0x0dd2, 0x0dd4, NSM}, + {0x0dd6, 0x0dd6, NSM}, + {0x0dd8, 0x0ddf, L}, + {0x0de6, 0x0def, L}, + {0x0df2, 0x0df4, L}, + {0x0e01, 0x0e30, L}, + {0x0e31, 0x0e31, NSM}, + {0x0e32, 0x0e33, L}, + {0x0e34, 0x0e3a, NSM}, + {0x0e3f, 0x0e3f, ET}, + {0x0e40, 0x0e46, L}, + {0x0e47, 0x0e4e, NSM}, + {0x0e4f, 0x0e5b, L}, + {0x0e81, 0x0e82, L}, + {0x0e84, 0x0e84, L}, + {0x0e86, 0x0e8a, L}, + {0x0e8c, 0x0ea3, L}, + {0x0ea5, 0x0ea5, L}, + {0x0ea7, 0x0eb0, L}, + {0x0eb1, 0x0eb1, NSM}, + {0x0eb2, 0x0eb3, L}, + {0x0eb4, 0x0ebc, NSM}, + {0x0ebd, 0x0ebd, L}, + {0x0ec0, 0x0ec4, L}, + {0x0ec6, 0x0ec6, L}, + {0x0ec8, 0x0ecd, NSM}, + {0x0ed0, 0x0ed9, L}, + {0x0edc, 0x0edf, L}, + {0x0f00, 0x0f17, L}, + {0x0f18, 0x0f19, NSM}, + {0x0f1a, 0x0f34, L}, + {0x0f35, 0x0f35, NSM}, + {0x0f36, 0x0f36, L}, + {0x0f37, 0x0f37, NSM}, + {0x0f38, 0x0f38, L}, + {0x0f39, 0x0f39, NSM}, + {0x0f3e, 0x0f47, L}, + {0x0f49, 0x0f6c, L}, + {0x0f71, 0x0f7e, NSM}, + {0x0f7f, 0x0f7f, L}, + {0x0f80, 0x0f84, NSM}, + {0x0f85, 0x0f85, L}, + {0x0f86, 0x0f87, NSM}, + {0x0f88, 0x0f8c, L}, + {0x0f8d, 0x0f97, NSM}, + {0x0f99, 0x0fbc, NSM}, + {0x0fbe, 0x0fc5, L}, + {0x0fc6, 0x0fc6, NSM}, + {0x0fc7, 0x0fcc, L}, + {0x0fce, 0x0fda, L}, + {0x1000, 0x102c, L}, + {0x102d, 0x1030, NSM}, + {0x1031, 0x1031, L}, + {0x1032, 0x1037, NSM}, + {0x1038, 0x1038, L}, + {0x1039, 0x103a, NSM}, + {0x103b, 0x103c, L}, + {0x103d, 0x103e, NSM}, + {0x103f, 0x1057, L}, + {0x1058, 0x1059, NSM}, + {0x105a, 0x105d, L}, + {0x105e, 0x1060, NSM}, + {0x1061, 0x1070, L}, + {0x1071, 0x1074, NSM}, + {0x1075, 0x1081, L}, + {0x1082, 0x1082, NSM}, + {0x1083, 0x1084, L}, + {0x1085, 0x1086, NSM}, + {0x1087, 0x108c, L}, + {0x108d, 0x108d, NSM}, + {0x108e, 0x109c, L}, + {0x109d, 0x109d, NSM}, + {0x109e, 0x10c5, L}, + {0x10c7, 0x10c7, L}, + {0x10cd, 0x10cd, L}, + {0x10d0, 0x1248, L}, + {0x124a, 0x124d, L}, + {0x1250, 0x1256, L}, + {0x1258, 0x1258, L}, + {0x125a, 0x125d, L}, + {0x1260, 0x1288, L}, + {0x128a, 0x128d, L}, + {0x1290, 0x12b0, L}, + {0x12b2, 0x12b5, L}, + {0x12b8, 0x12be, L}, + {0x12c0, 0x12c0, L}, + {0x12c2, 0x12c5, L}, + {0x12c8, 0x12d6, L}, + {0x12d8, 0x1310, L}, + {0x1312, 0x1315, L}, + {0x1318, 0x135a, L}, + {0x135d, 0x135f, NSM}, + {0x1360, 0x137c, L}, + {0x1380, 0x138f, L}, + {0x13a0, 0x13f5, L}, + {0x13f8, 0x13fd, L}, + {0x1401, 0x167f, L}, + {0x1680, 0x1680, WS}, + {0x1681, 0x169a, L}, + {0x16a0, 0x16f8, L}, + {0x1700, 0x1711, L}, + {0x1712, 0x1714, NSM}, + {0x1715, 0x1715, L}, + {0x171f, 0x1731, L}, + {0x1732, 0x1733, NSM}, + {0x1734, 0x1736, L}, + {0x1740, 0x1751, L}, + {0x1752, 0x1753, NSM}, + {0x1760, 0x176c, L}, + {0x176e, 0x1770, L}, + {0x1772, 0x1773, NSM}, + {0x1780, 0x17b3, L}, + {0x17b4, 0x17b5, NSM}, + {0x17b6, 0x17b6, L}, + {0x17b7, 0x17bd, NSM}, + {0x17be, 0x17c5, L}, + {0x17c6, 0x17c6, NSM}, + {0x17c7, 0x17c8, L}, + {0x17c9, 0x17d3, NSM}, + {0x17d4, 0x17da, L}, + {0x17db, 0x17db, ET}, + {0x17dc, 0x17dc, L}, + {0x17dd, 0x17dd, NSM}, + {0x17e0, 0x17e9, L}, + {0x180b, 0x180d, NSM}, + {0x180e, 0x180e, BN}, + {0x180f, 0x180f, NSM}, + {0x1810, 0x1819, L}, + {0x1820, 0x1878, L}, + {0x1880, 0x1884, L}, + {0x1885, 0x1886, NSM}, + {0x1887, 0x18a8, L}, + {0x18a9, 0x18a9, NSM}, + {0x18aa, 0x18aa, L}, + {0x18b0, 0x18f5, L}, + {0x1900, 0x191e, L}, + {0x1920, 0x1922, NSM}, + {0x1923, 0x1926, L}, + {0x1927, 0x1928, NSM}, + {0x1929, 0x192b, L}, + {0x1930, 0x1931, L}, + {0x1932, 0x1932, NSM}, + {0x1933, 0x1938, L}, + {0x1939, 0x193b, NSM}, + {0x1946, 0x196d, L}, + {0x1970, 0x1974, L}, + {0x1980, 0x19ab, L}, + {0x19b0, 0x19c9, L}, + {0x19d0, 0x19da, L}, + {0x1a00, 0x1a16, L}, + {0x1a17, 0x1a18, NSM}, + {0x1a19, 0x1a1a, L}, + {0x1a1b, 0x1a1b, NSM}, + {0x1a1e, 0x1a55, L}, + {0x1a56, 0x1a56, NSM}, + {0x1a57, 0x1a57, L}, + {0x1a58, 0x1a5e, NSM}, + {0x1a60, 0x1a60, NSM}, + {0x1a61, 0x1a61, L}, + {0x1a62, 0x1a62, NSM}, + {0x1a63, 0x1a64, L}, + {0x1a65, 0x1a6c, NSM}, + {0x1a6d, 0x1a72, L}, + {0x1a73, 0x1a7c, NSM}, + {0x1a7f, 0x1a7f, NSM}, + {0x1a80, 0x1a89, L}, + {0x1a90, 0x1a99, L}, + {0x1aa0, 0x1aad, L}, + {0x1ab0, 0x1ace, NSM}, + {0x1b00, 0x1b03, NSM}, + {0x1b04, 0x1b33, L}, + {0x1b34, 0x1b34, NSM}, + {0x1b35, 0x1b35, L}, + {0x1b36, 0x1b3a, NSM}, + {0x1b3b, 0x1b3b, L}, + {0x1b3c, 0x1b3c, NSM}, + {0x1b3d, 0x1b41, L}, + {0x1b42, 0x1b42, NSM}, + {0x1b43, 0x1b4c, L}, + {0x1b50, 0x1b6a, L}, + {0x1b6b, 0x1b73, NSM}, + {0x1b74, 0x1b7e, L}, + {0x1b80, 0x1b81, NSM}, + {0x1b82, 0x1ba1, L}, + {0x1ba2, 0x1ba5, NSM}, + {0x1ba6, 0x1ba7, L}, + {0x1ba8, 0x1ba9, NSM}, + {0x1baa, 0x1baa, L}, + {0x1bab, 0x1bad, NSM}, + {0x1bae, 0x1be5, L}, + {0x1be6, 0x1be6, NSM}, + {0x1be7, 0x1be7, L}, + {0x1be8, 0x1be9, NSM}, + {0x1bea, 0x1bec, L}, + {0x1bed, 0x1bed, NSM}, + {0x1bee, 0x1bee, L}, + {0x1bef, 0x1bf1, NSM}, + {0x1bf2, 0x1bf3, L}, + {0x1bfc, 0x1c2b, L}, + {0x1c2c, 0x1c33, NSM}, + {0x1c34, 0x1c35, L}, + {0x1c36, 0x1c37, NSM}, + {0x1c3b, 0x1c49, L}, + {0x1c4d, 0x1c88, L}, + {0x1c90, 0x1cba, L}, + {0x1cbd, 0x1cc7, L}, + {0x1cd0, 0x1cd2, NSM}, + {0x1cd3, 0x1cd3, L}, + {0x1cd4, 0x1ce0, NSM}, + {0x1ce1, 0x1ce1, L}, + {0x1ce2, 0x1ce8, NSM}, + {0x1ce9, 0x1cec, L}, + {0x1ced, 0x1ced, NSM}, + {0x1cee, 0x1cf3, L}, + {0x1cf4, 0x1cf4, NSM}, + {0x1cf5, 0x1cf7, L}, + {0x1cf8, 0x1cf9, NSM}, + {0x1cfa, 0x1cfa, L}, + {0x1d00, 0x1dbf, L}, + {0x1dc0, 0x1dff, NSM}, + {0x1e00, 0x1f15, L}, + {0x1f18, 0x1f1d, L}, + {0x1f20, 0x1f45, L}, + {0x1f48, 0x1f4d, L}, + {0x1f50, 0x1f57, L}, + {0x1f59, 0x1f59, L}, + {0x1f5b, 0x1f5b, L}, + {0x1f5d, 0x1f5d, L}, + {0x1f5f, 0x1f7d, L}, + {0x1f80, 0x1fb4, L}, + {0x1fb6, 0x1fbc, L}, + {0x1fbe, 0x1fbe, L}, + {0x1fc2, 0x1fc4, L}, + {0x1fc6, 0x1fcc, L}, + {0x1fd0, 0x1fd3, L}, + {0x1fd6, 0x1fdb, L}, + {0x1fe0, 0x1fec, L}, + {0x1ff2, 0x1ff4, L}, + {0x1ff6, 0x1ffc, L}, + {0x2000, 0x200a, WS}, + {0x200b, 0x200d, BN}, + {0x200e, 0x200e, L}, + {0x200f, 0x200f, R}, + {0x2028, 0x2028, WS}, + {0x2029, 0x2029, B}, + {0x202a, 0x202a, LRE}, + {0x202b, 0x202b, RLE}, + {0x202c, 0x202c, PDF}, + {0x202d, 0x202d, LRO}, + {0x202e, 0x202e, RLO}, + {0x202f, 0x202f, CS}, + {0x2030, 0x2034, ET}, + {0x2044, 0x2044, CS}, + {0x205f, 0x205f, WS}, + {0x2060, 0x2064, BN}, + {0x2066, 0x2066, LRI}, + {0x2067, 0x2067, RLI}, + {0x2068, 0x2068, FSI}, + {0x2069, 0x2069, PDI}, + {0x206a, 0x206f, BN}, + {0x2070, 0x2070, EN}, + {0x2071, 0x2071, L}, + {0x2074, 0x2079, EN}, + {0x207a, 0x207b, ES}, + {0x207f, 0x207f, L}, + {0x2080, 0x2089, EN}, + {0x208a, 0x208b, ES}, + {0x2090, 0x209c, L}, + {0x20a0, 0x20c0, ET}, + {0x20d0, 0x20f0, NSM}, + {0x2102, 0x2102, L}, + {0x2107, 0x2107, L}, + {0x210a, 0x2113, L}, + {0x2115, 0x2115, L}, + {0x2119, 0x211d, L}, + {0x2124, 0x2124, L}, + {0x2126, 0x2126, L}, + {0x2128, 0x2128, L}, + {0x212a, 0x212d, L}, + {0x212e, 0x212e, ET}, + {0x212f, 0x2139, L}, + {0x213c, 0x213f, L}, + {0x2145, 0x2149, L}, + {0x214e, 0x214f, L}, + {0x2160, 0x2188, L}, + {0x2212, 0x2212, ES}, + {0x2213, 0x2213, ET}, + {0x2336, 0x237a, L}, + {0x2395, 0x2395, L}, + {0x2488, 0x249b, EN}, + {0x249c, 0x24e9, L}, + {0x26ac, 0x26ac, L}, + {0x2800, 0x28ff, L}, + {0x2c00, 0x2ce4, L}, + {0x2ceb, 0x2cee, L}, + {0x2cef, 0x2cf1, NSM}, + {0x2cf2, 0x2cf3, L}, + {0x2d00, 0x2d25, L}, + {0x2d27, 0x2d27, L}, + {0x2d2d, 0x2d2d, L}, + {0x2d30, 0x2d67, L}, + {0x2d6f, 0x2d70, L}, + {0x2d7f, 0x2d7f, NSM}, + {0x2d80, 0x2d96, L}, + {0x2da0, 0x2da6, L}, + {0x2da8, 0x2dae, L}, + {0x2db0, 0x2db6, L}, + {0x2db8, 0x2dbe, L}, + {0x2dc0, 0x2dc6, L}, + {0x2dc8, 0x2dce, L}, + {0x2dd0, 0x2dd6, L}, + {0x2dd8, 0x2dde, L}, + {0x2de0, 0x2dff, NSM}, + {0x3000, 0x3000, WS}, + {0x3005, 0x3007, L}, + {0x3021, 0x3029, L}, + {0x302a, 0x302d, NSM}, + {0x302e, 0x302f, L}, + {0x3031, 0x3035, L}, + {0x3038, 0x303c, L}, + {0x3041, 0x3096, L}, + {0x3099, 0x309a, NSM}, + {0x309d, 0x309f, L}, + {0x30a1, 0x30fa, L}, + {0x30fc, 0x30ff, L}, + {0x3105, 0x312f, L}, + {0x3131, 0x318e, L}, + {0x3190, 0x31bf, L}, + {0x31f0, 0x321c, L}, + {0x3220, 0x324f, L}, + {0x3260, 0x327b, L}, + {0x327f, 0x32b0, L}, + {0x32c0, 0x32cb, L}, + {0x32d0, 0x3376, L}, + {0x337b, 0x33dd, L}, + {0x33e0, 0x33fe, L}, + {0x3400, 0x4dbf, L}, + {0x4e00, 0xa48c, L}, + {0xa4d0, 0xa60c, L}, + {0xa610, 0xa62b, L}, + {0xa640, 0xa66e, L}, + {0xa66f, 0xa672, NSM}, + {0xa674, 0xa67d, NSM}, + {0xa680, 0xa69d, L}, + {0xa69e, 0xa69f, NSM}, + {0xa6a0, 0xa6ef, L}, + {0xa6f0, 0xa6f1, NSM}, + {0xa6f2, 0xa6f7, L}, + {0xa722, 0xa787, L}, + {0xa789, 0xa7ca, L}, + {0xa7d0, 0xa7d1, L}, + {0xa7d3, 0xa7d3, L}, + {0xa7d5, 0xa7d9, L}, + {0xa7f2, 0xa801, L}, + {0xa802, 0xa802, NSM}, + {0xa803, 0xa805, L}, + {0xa806, 0xa806, NSM}, + {0xa807, 0xa80a, L}, + {0xa80b, 0xa80b, NSM}, + {0xa80c, 0xa824, L}, + {0xa825, 0xa826, NSM}, + {0xa827, 0xa827, L}, + {0xa82c, 0xa82c, NSM}, + {0xa830, 0xa837, L}, + {0xa838, 0xa839, ET}, + {0xa840, 0xa873, L}, + {0xa880, 0xa8c3, L}, + {0xa8c4, 0xa8c5, NSM}, + {0xa8ce, 0xa8d9, L}, + {0xa8e0, 0xa8f1, NSM}, + {0xa8f2, 0xa8fe, L}, + {0xa8ff, 0xa8ff, NSM}, + {0xa900, 0xa925, L}, + {0xa926, 0xa92d, NSM}, + {0xa92e, 0xa946, L}, + {0xa947, 0xa951, NSM}, + {0xa952, 0xa953, L}, + {0xa95f, 0xa97c, L}, + {0xa980, 0xa982, NSM}, + {0xa983, 0xa9b2, L}, + {0xa9b3, 0xa9b3, NSM}, + {0xa9b4, 0xa9b5, L}, + {0xa9b6, 0xa9b9, NSM}, + {0xa9ba, 0xa9bb, L}, + {0xa9bc, 0xa9bd, NSM}, + {0xa9be, 0xa9cd, L}, + {0xa9cf, 0xa9d9, L}, + {0xa9de, 0xa9e4, L}, + {0xa9e5, 0xa9e5, NSM}, + {0xa9e6, 0xa9fe, L}, + {0xaa00, 0xaa28, L}, + {0xaa29, 0xaa2e, NSM}, + {0xaa2f, 0xaa30, L}, + {0xaa31, 0xaa32, NSM}, + {0xaa33, 0xaa34, L}, + {0xaa35, 0xaa36, NSM}, + {0xaa40, 0xaa42, L}, + {0xaa43, 0xaa43, NSM}, + {0xaa44, 0xaa4b, L}, + {0xaa4c, 0xaa4c, NSM}, + {0xaa4d, 0xaa4d, L}, + {0xaa50, 0xaa59, L}, + {0xaa5c, 0xaa7b, L}, + {0xaa7c, 0xaa7c, NSM}, + {0xaa7d, 0xaaaf, L}, + {0xaab0, 0xaab0, NSM}, + {0xaab1, 0xaab1, L}, + {0xaab2, 0xaab4, NSM}, + {0xaab5, 0xaab6, L}, + {0xaab7, 0xaab8, NSM}, + {0xaab9, 0xaabd, L}, + {0xaabe, 0xaabf, NSM}, + {0xaac0, 0xaac0, L}, + {0xaac1, 0xaac1, NSM}, + {0xaac2, 0xaac2, L}, + {0xaadb, 0xaaeb, L}, + {0xaaec, 0xaaed, NSM}, + {0xaaee, 0xaaf5, L}, + {0xaaf6, 0xaaf6, NSM}, + {0xab01, 0xab06, L}, + {0xab09, 0xab0e, L}, + {0xab11, 0xab16, L}, + {0xab20, 0xab26, L}, + {0xab28, 0xab2e, L}, + {0xab30, 0xab69, L}, + {0xab70, 0xabe4, L}, + {0xabe5, 0xabe5, NSM}, + {0xabe6, 0xabe7, L}, + {0xabe8, 0xabe8, NSM}, + {0xabe9, 0xabec, L}, + {0xabed, 0xabed, NSM}, + {0xabf0, 0xabf9, L}, + {0xac00, 0xd7a3, L}, + {0xd7b0, 0xd7c6, L}, + {0xd7cb, 0xd7fb, L}, + {0xd800, 0xfa6d, L}, + {0xfa70, 0xfad9, L}, + {0xfb00, 0xfb06, L}, + {0xfb13, 0xfb17, L}, + {0xfb1d, 0xfb1d, R}, + {0xfb1e, 0xfb1e, NSM}, + {0xfb1f, 0xfb28, R}, + {0xfb29, 0xfb29, ES}, + {0xfb2a, 0xfb36, R}, + {0xfb38, 0xfb3c, R}, + {0xfb3e, 0xfb3e, R}, + {0xfb40, 0xfb41, R}, + {0xfb43, 0xfb44, R}, + {0xfb46, 0xfb4f, R}, + {0xfb50, 0xfbc2, AL}, + {0xfbd3, 0xfd3d, AL}, + {0xfd50, 0xfd8f, AL}, + {0xfd92, 0xfdc7, AL}, + {0xfdf0, 0xfdfc, AL}, + {0xfe00, 0xfe0f, NSM}, + {0xfe20, 0xfe2f, NSM}, + {0xfe50, 0xfe50, CS}, + {0xfe52, 0xfe52, CS}, + {0xfe55, 0xfe55, CS}, + {0xfe5f, 0xfe5f, ET}, + {0xfe62, 0xfe63, ES}, + {0xfe69, 0xfe6a, ET}, + {0xfe70, 0xfe74, AL}, + {0xfe76, 0xfefc, AL}, + {0xfeff, 0xfeff, BN}, + {0xff03, 0xff05, ET}, + {0xff0b, 0xff0b, ES}, + {0xff0c, 0xff0c, CS}, + {0xff0d, 0xff0d, ES}, + {0xff0e, 0xff0f, CS}, + {0xff10, 0xff19, EN}, + {0xff1a, 0xff1a, CS}, + {0xff21, 0xff3a, L}, + {0xff41, 0xff5a, L}, + {0xff66, 0xffbe, L}, + {0xffc2, 0xffc7, L}, + {0xffca, 0xffcf, L}, + {0xffd2, 0xffd7, L}, + {0xffda, 0xffdc, L}, + {0xffe0, 0xffe1, ET}, + {0xffe5, 0xffe6, ET}, + {0x10000, 0x1000b, L}, + {0x1000d, 0x10026, L}, + {0x10028, 0x1003a, L}, + {0x1003c, 0x1003d, L}, + {0x1003f, 0x1004d, L}, + {0x10050, 0x1005d, L}, + {0x10080, 0x100fa, L}, + {0x10100, 0x10100, L}, + {0x10102, 0x10102, L}, + {0x10107, 0x10133, L}, + {0x10137, 0x1013f, L}, + {0x1018d, 0x1018e, L}, + {0x101d0, 0x101fc, L}, + {0x101fd, 0x101fd, NSM}, + {0x10280, 0x1029c, L}, + {0x102a0, 0x102d0, L}, + {0x102e0, 0x102e0, NSM}, + {0x102e1, 0x102fb, EN}, + {0x10300, 0x10323, L}, + {0x1032d, 0x1034a, L}, + {0x10350, 0x10375, L}, + {0x10376, 0x1037a, NSM}, + {0x10380, 0x1039d, L}, + {0x1039f, 0x103c3, L}, + {0x103c8, 0x103d5, L}, + {0x10400, 0x1049d, L}, + {0x104a0, 0x104a9, L}, + {0x104b0, 0x104d3, L}, + {0x104d8, 0x104fb, L}, + {0x10500, 0x10527, L}, + {0x10530, 0x10563, L}, + {0x1056f, 0x1057a, L}, + {0x1057c, 0x1058a, L}, + {0x1058c, 0x10592, L}, + {0x10594, 0x10595, L}, + {0x10597, 0x105a1, L}, + {0x105a3, 0x105b1, L}, + {0x105b3, 0x105b9, L}, + {0x105bb, 0x105bc, L}, + {0x10600, 0x10736, L}, + {0x10740, 0x10755, L}, + {0x10760, 0x10767, L}, + {0x10780, 0x10785, L}, + {0x10787, 0x107b0, L}, + {0x107b2, 0x107ba, L}, + {0x10800, 0x10805, R}, + {0x10808, 0x10808, R}, + {0x1080a, 0x10835, R}, + {0x10837, 0x10838, R}, + {0x1083c, 0x1083c, R}, + {0x1083f, 0x10855, R}, + {0x10857, 0x1089e, R}, + {0x108a7, 0x108af, R}, + {0x108e0, 0x108f2, R}, + {0x108f4, 0x108f5, R}, + {0x108fb, 0x1091b, R}, + {0x10920, 0x10939, R}, + {0x1093f, 0x1093f, R}, + {0x10980, 0x109b7, R}, + {0x109bc, 0x109cf, R}, + {0x109d2, 0x10a00, R}, + {0x10a01, 0x10a03, NSM}, + {0x10a05, 0x10a06, NSM}, + {0x10a0c, 0x10a0f, NSM}, + {0x10a10, 0x10a13, R}, + {0x10a15, 0x10a17, R}, + {0x10a19, 0x10a35, R}, + {0x10a38, 0x10a3a, NSM}, + {0x10a3f, 0x10a3f, NSM}, + {0x10a40, 0x10a48, R}, + {0x10a50, 0x10a58, R}, + {0x10a60, 0x10a9f, R}, + {0x10ac0, 0x10ae4, R}, + {0x10ae5, 0x10ae6, NSM}, + {0x10aeb, 0x10af6, R}, + {0x10b00, 0x10b35, R}, + {0x10b40, 0x10b55, R}, + {0x10b58, 0x10b72, R}, + {0x10b78, 0x10b91, R}, + {0x10b99, 0x10b9c, R}, + {0x10ba9, 0x10baf, R}, + {0x10c00, 0x10c48, R}, + {0x10c80, 0x10cb2, R}, + {0x10cc0, 0x10cf2, R}, + {0x10cfa, 0x10cff, R}, + {0x10d00, 0x10d23, AL}, + {0x10d24, 0x10d27, NSM}, + {0x10d30, 0x10d39, AN}, + {0x10e60, 0x10e7e, AN}, + {0x10e80, 0x10ea9, R}, + {0x10eab, 0x10eac, NSM}, + {0x10ead, 0x10ead, R}, + {0x10eb0, 0x10eb1, R}, + {0x10f00, 0x10f27, R}, + {0x10f30, 0x10f45, AL}, + {0x10f46, 0x10f50, NSM}, + {0x10f51, 0x10f59, AL}, + {0x10f70, 0x10f81, R}, + {0x10f82, 0x10f85, NSM}, + {0x10f86, 0x10f89, R}, + {0x10fb0, 0x10fcb, R}, + {0x10fe0, 0x10ff6, R}, + {0x11000, 0x11000, L}, + {0x11001, 0x11001, NSM}, + {0x11002, 0x11037, L}, + {0x11038, 0x11046, NSM}, + {0x11047, 0x1104d, L}, + {0x11066, 0x1106f, L}, + {0x11070, 0x11070, NSM}, + {0x11071, 0x11072, L}, + {0x11073, 0x11074, NSM}, + {0x11075, 0x11075, L}, + {0x1107f, 0x11081, NSM}, + {0x11082, 0x110b2, L}, + {0x110b3, 0x110b6, NSM}, + {0x110b7, 0x110b8, L}, + {0x110b9, 0x110ba, NSM}, + {0x110bb, 0x110c1, L}, + {0x110c2, 0x110c2, NSM}, + {0x110cd, 0x110cd, L}, + {0x110d0, 0x110e8, L}, + {0x110f0, 0x110f9, L}, + {0x11100, 0x11102, NSM}, + {0x11103, 0x11126, L}, + {0x11127, 0x1112b, NSM}, + {0x1112c, 0x1112c, L}, + {0x1112d, 0x11134, NSM}, + {0x11136, 0x11147, L}, + {0x11150, 0x11172, L}, + {0x11173, 0x11173, NSM}, + {0x11174, 0x11176, L}, + {0x11180, 0x11181, NSM}, + {0x11182, 0x111b5, L}, + {0x111b6, 0x111be, NSM}, + {0x111bf, 0x111c8, L}, + {0x111c9, 0x111cc, NSM}, + {0x111cd, 0x111ce, L}, + {0x111cf, 0x111cf, NSM}, + {0x111d0, 0x111df, L}, + {0x111e1, 0x111f4, L}, + {0x11200, 0x11211, L}, + {0x11213, 0x1122e, L}, + {0x1122f, 0x11231, NSM}, + {0x11232, 0x11233, L}, + {0x11234, 0x11234, NSM}, + {0x11235, 0x11235, L}, + {0x11236, 0x11237, NSM}, + {0x11238, 0x1123d, L}, + {0x1123e, 0x1123e, NSM}, + {0x11280, 0x11286, L}, + {0x11288, 0x11288, L}, + {0x1128a, 0x1128d, L}, + {0x1128f, 0x1129d, L}, + {0x1129f, 0x112a9, L}, + {0x112b0, 0x112de, L}, + {0x112df, 0x112df, NSM}, + {0x112e0, 0x112e2, L}, + {0x112e3, 0x112ea, NSM}, + {0x112f0, 0x112f9, L}, + {0x11300, 0x11301, NSM}, + {0x11302, 0x11303, L}, + {0x11305, 0x1130c, L}, + {0x1130f, 0x11310, L}, + {0x11313, 0x11328, L}, + {0x1132a, 0x11330, L}, + {0x11332, 0x11333, L}, + {0x11335, 0x11339, L}, + {0x1133b, 0x1133c, NSM}, + {0x1133d, 0x1133f, L}, + {0x11340, 0x11340, NSM}, + {0x11341, 0x11344, L}, + {0x11347, 0x11348, L}, + {0x1134b, 0x1134d, L}, + {0x11350, 0x11350, L}, + {0x11357, 0x11357, L}, + {0x1135d, 0x11363, L}, + {0x11366, 0x1136c, NSM}, + {0x11370, 0x11374, NSM}, + {0x11400, 0x11437, L}, + {0x11438, 0x1143f, NSM}, + {0x11440, 0x11441, L}, + {0x11442, 0x11444, NSM}, + {0x11445, 0x11445, L}, + {0x11446, 0x11446, NSM}, + {0x11447, 0x1145b, L}, + {0x1145d, 0x1145d, L}, + {0x1145e, 0x1145e, NSM}, + {0x1145f, 0x11461, L}, + {0x11480, 0x114b2, L}, + {0x114b3, 0x114b8, NSM}, + {0x114b9, 0x114b9, L}, + {0x114ba, 0x114ba, NSM}, + {0x114bb, 0x114be, L}, + {0x114bf, 0x114c0, NSM}, + {0x114c1, 0x114c1, L}, + {0x114c2, 0x114c3, NSM}, + {0x114c4, 0x114c7, L}, + {0x114d0, 0x114d9, L}, + {0x11580, 0x115b1, L}, + {0x115b2, 0x115b5, NSM}, + {0x115b8, 0x115bb, L}, + {0x115bc, 0x115bd, NSM}, + {0x115be, 0x115be, L}, + {0x115bf, 0x115c0, NSM}, + {0x115c1, 0x115db, L}, + {0x115dc, 0x115dd, NSM}, + {0x11600, 0x11632, L}, + {0x11633, 0x1163a, NSM}, + {0x1163b, 0x1163c, L}, + {0x1163d, 0x1163d, NSM}, + {0x1163e, 0x1163e, L}, + {0x1163f, 0x11640, NSM}, + {0x11641, 0x11644, L}, + {0x11650, 0x11659, L}, + {0x11680, 0x116aa, L}, + {0x116ab, 0x116ab, NSM}, + {0x116ac, 0x116ac, L}, + {0x116ad, 0x116ad, NSM}, + {0x116ae, 0x116af, L}, + {0x116b0, 0x116b5, NSM}, + {0x116b6, 0x116b6, L}, + {0x116b7, 0x116b7, NSM}, + {0x116b8, 0x116b9, L}, + {0x116c0, 0x116c9, L}, + {0x11700, 0x1171a, L}, + {0x1171d, 0x1171f, NSM}, + {0x11720, 0x11721, L}, + {0x11722, 0x11725, NSM}, + {0x11726, 0x11726, L}, + {0x11727, 0x1172b, NSM}, + {0x11730, 0x11746, L}, + {0x11800, 0x1182e, L}, + {0x1182f, 0x11837, NSM}, + {0x11838, 0x11838, L}, + {0x11839, 0x1183a, NSM}, + {0x1183b, 0x1183b, L}, + {0x118a0, 0x118f2, L}, + {0x118ff, 0x11906, L}, + {0x11909, 0x11909, L}, + {0x1190c, 0x11913, L}, + {0x11915, 0x11916, L}, + {0x11918, 0x11935, L}, + {0x11937, 0x11938, L}, + {0x1193b, 0x1193c, NSM}, + {0x1193d, 0x1193d, L}, + {0x1193e, 0x1193e, NSM}, + {0x1193f, 0x11942, L}, + {0x11943, 0x11943, NSM}, + {0x11944, 0x11946, L}, + {0x11950, 0x11959, L}, + {0x119a0, 0x119a7, L}, + {0x119aa, 0x119d3, L}, + {0x119d4, 0x119d7, NSM}, + {0x119da, 0x119db, NSM}, + {0x119dc, 0x119df, L}, + {0x119e0, 0x119e0, NSM}, + {0x119e1, 0x119e4, L}, + {0x11a00, 0x11a00, L}, + {0x11a01, 0x11a06, NSM}, + {0x11a07, 0x11a08, L}, + {0x11a09, 0x11a0a, NSM}, + {0x11a0b, 0x11a32, L}, + {0x11a33, 0x11a38, NSM}, + {0x11a39, 0x11a3a, L}, + {0x11a3b, 0x11a3e, NSM}, + {0x11a3f, 0x11a46, L}, + {0x11a47, 0x11a47, NSM}, + {0x11a50, 0x11a50, L}, + {0x11a51, 0x11a56, NSM}, + {0x11a57, 0x11a58, L}, + {0x11a59, 0x11a5b, NSM}, + {0x11a5c, 0x11a89, L}, + {0x11a8a, 0x11a96, NSM}, + {0x11a97, 0x11a97, L}, + {0x11a98, 0x11a99, NSM}, + {0x11a9a, 0x11aa2, L}, + {0x11ab0, 0x11af8, L}, + {0x11c00, 0x11c08, L}, + {0x11c0a, 0x11c2f, L}, + {0x11c30, 0x11c36, NSM}, + {0x11c38, 0x11c3d, NSM}, + {0x11c3e, 0x11c45, L}, + {0x11c50, 0x11c6c, L}, + {0x11c70, 0x11c8f, L}, + {0x11c92, 0x11ca7, NSM}, + {0x11ca9, 0x11ca9, L}, + {0x11caa, 0x11cb0, NSM}, + {0x11cb1, 0x11cb1, L}, + {0x11cb2, 0x11cb3, NSM}, + {0x11cb4, 0x11cb4, L}, + {0x11cb5, 0x11cb6, NSM}, + {0x11d00, 0x11d06, L}, + {0x11d08, 0x11d09, L}, + {0x11d0b, 0x11d30, L}, + {0x11d31, 0x11d36, NSM}, + {0x11d3a, 0x11d3a, NSM}, + {0x11d3c, 0x11d3d, NSM}, + {0x11d3f, 0x11d45, NSM}, + {0x11d46, 0x11d46, L}, + {0x11d47, 0x11d47, NSM}, + {0x11d50, 0x11d59, L}, + {0x11d60, 0x11d65, L}, + {0x11d67, 0x11d68, L}, + {0x11d6a, 0x11d8e, L}, + {0x11d90, 0x11d91, NSM}, + {0x11d93, 0x11d94, L}, + {0x11d95, 0x11d95, NSM}, + {0x11d96, 0x11d96, L}, + {0x11d97, 0x11d97, NSM}, + {0x11d98, 0x11d98, L}, + {0x11da0, 0x11da9, L}, + {0x11ee0, 0x11ef2, L}, + {0x11ef3, 0x11ef4, NSM}, + {0x11ef5, 0x11ef8, L}, + {0x11fb0, 0x11fb0, L}, + {0x11fc0, 0x11fd4, L}, + {0x11fdd, 0x11fe0, ET}, + {0x11fff, 0x12399, L}, + {0x12400, 0x1246e, L}, + {0x12470, 0x12474, L}, + {0x12480, 0x12543, L}, + {0x12f90, 0x12ff2, L}, + {0x13000, 0x1342e, L}, + {0x13430, 0x13438, L}, + {0x14400, 0x14646, L}, + {0x16800, 0x16a38, L}, + {0x16a40, 0x16a5e, L}, + {0x16a60, 0x16a69, L}, + {0x16a6e, 0x16abe, L}, + {0x16ac0, 0x16ac9, L}, + {0x16ad0, 0x16aed, L}, + {0x16af0, 0x16af4, NSM}, + {0x16af5, 0x16af5, L}, + {0x16b00, 0x16b2f, L}, + {0x16b30, 0x16b36, NSM}, + {0x16b37, 0x16b45, L}, + {0x16b50, 0x16b59, L}, + {0x16b5b, 0x16b61, L}, + {0x16b63, 0x16b77, L}, + {0x16b7d, 0x16b8f, L}, + {0x16e40, 0x16e9a, L}, + {0x16f00, 0x16f4a, L}, + {0x16f4f, 0x16f4f, NSM}, + {0x16f50, 0x16f87, L}, + {0x16f8f, 0x16f92, NSM}, + {0x16f93, 0x16f9f, L}, + {0x16fe0, 0x16fe1, L}, + {0x16fe3, 0x16fe3, L}, + {0x16fe4, 0x16fe4, NSM}, + {0x16ff0, 0x16ff1, L}, + {0x17000, 0x187f7, L}, + {0x18800, 0x18cd5, L}, + {0x18d00, 0x18d08, L}, + {0x1aff0, 0x1aff3, L}, + {0x1aff5, 0x1affb, L}, + {0x1affd, 0x1affe, L}, + {0x1b000, 0x1b122, L}, + {0x1b150, 0x1b152, L}, + {0x1b164, 0x1b167, L}, + {0x1b170, 0x1b2fb, L}, + {0x1bc00, 0x1bc6a, L}, + {0x1bc70, 0x1bc7c, L}, + {0x1bc80, 0x1bc88, L}, + {0x1bc90, 0x1bc99, L}, + {0x1bc9c, 0x1bc9c, L}, + {0x1bc9d, 0x1bc9e, NSM}, + {0x1bc9f, 0x1bc9f, L}, + {0x1bca0, 0x1bca3, BN}, + {0x1cf00, 0x1cf2d, NSM}, + {0x1cf30, 0x1cf46, NSM}, + {0x1cf50, 0x1cfc3, L}, + {0x1d000, 0x1d0f5, L}, + {0x1d100, 0x1d126, L}, + {0x1d129, 0x1d166, L}, + {0x1d167, 0x1d169, NSM}, + {0x1d16a, 0x1d172, L}, + {0x1d173, 0x1d17a, BN}, + {0x1d17b, 0x1d182, NSM}, + {0x1d183, 0x1d184, L}, + {0x1d185, 0x1d18b, NSM}, + {0x1d18c, 0x1d1a9, L}, + {0x1d1aa, 0x1d1ad, NSM}, + {0x1d1ae, 0x1d1e8, L}, + {0x1d242, 0x1d244, NSM}, + {0x1d2e0, 0x1d2f3, L}, + {0x1d360, 0x1d378, L}, + {0x1d400, 0x1d454, L}, + {0x1d456, 0x1d49c, L}, + {0x1d49e, 0x1d49f, L}, + {0x1d4a2, 0x1d4a2, L}, + {0x1d4a5, 0x1d4a6, L}, + {0x1d4a9, 0x1d4ac, L}, + {0x1d4ae, 0x1d4b9, L}, + {0x1d4bb, 0x1d4bb, L}, + {0x1d4bd, 0x1d4c3, L}, + {0x1d4c5, 0x1d505, L}, + {0x1d507, 0x1d50a, L}, + {0x1d50d, 0x1d514, L}, + {0x1d516, 0x1d51c, L}, + {0x1d51e, 0x1d539, L}, + {0x1d53b, 0x1d53e, L}, + {0x1d540, 0x1d544, L}, + {0x1d546, 0x1d546, L}, + {0x1d54a, 0x1d550, L}, + {0x1d552, 0x1d6a5, L}, + {0x1d6a8, 0x1d6da, L}, + {0x1d6dc, 0x1d714, L}, + {0x1d716, 0x1d74e, L}, + {0x1d750, 0x1d788, L}, + {0x1d78a, 0x1d7c2, L}, + {0x1d7c4, 0x1d7cb, L}, + {0x1d7ce, 0x1d7ff, EN}, + {0x1d800, 0x1d9ff, L}, + {0x1da00, 0x1da36, NSM}, + {0x1da37, 0x1da3a, L}, + {0x1da3b, 0x1da6c, NSM}, + {0x1da6d, 0x1da74, L}, + {0x1da75, 0x1da75, NSM}, + {0x1da76, 0x1da83, L}, + {0x1da84, 0x1da84, NSM}, + {0x1da85, 0x1da8b, L}, + {0x1da9b, 0x1da9f, NSM}, + {0x1daa1, 0x1daaf, NSM}, + {0x1df00, 0x1df1e, L}, + {0x1e000, 0x1e006, NSM}, + {0x1e008, 0x1e018, NSM}, + {0x1e01b, 0x1e021, NSM}, + {0x1e023, 0x1e024, NSM}, + {0x1e026, 0x1e02a, NSM}, + {0x1e100, 0x1e12c, L}, + {0x1e130, 0x1e136, NSM}, + {0x1e137, 0x1e13d, L}, + {0x1e140, 0x1e149, L}, + {0x1e14e, 0x1e14f, L}, + {0x1e290, 0x1e2ad, L}, + {0x1e2ae, 0x1e2ae, NSM}, + {0x1e2c0, 0x1e2eb, L}, + {0x1e2ec, 0x1e2ef, NSM}, + {0x1e2f0, 0x1e2f9, L}, + {0x1e2ff, 0x1e2ff, ET}, + {0x1e7e0, 0x1e7e6, L}, + {0x1e7e8, 0x1e7eb, L}, + {0x1e7ed, 0x1e7ee, L}, + {0x1e7f0, 0x1e7fe, L}, + {0x1e800, 0x1e8c4, R}, + {0x1e8c7, 0x1e8cf, R}, + {0x1e8d0, 0x1e8d6, NSM}, + {0x1e900, 0x1e943, R}, + {0x1e944, 0x1e94a, NSM}, + {0x1e94b, 0x1e94b, R}, + {0x1e950, 0x1e959, R}, + {0x1e95e, 0x1e95f, R}, + {0x1ec71, 0x1ecb4, AL}, + {0x1ed01, 0x1ed3d, AL}, + {0x1ee00, 0x1ee03, AL}, + {0x1ee05, 0x1ee1f, AL}, + {0x1ee21, 0x1ee22, AL}, + {0x1ee24, 0x1ee24, AL}, + {0x1ee27, 0x1ee27, AL}, + {0x1ee29, 0x1ee32, AL}, + {0x1ee34, 0x1ee37, AL}, + {0x1ee39, 0x1ee39, AL}, + {0x1ee3b, 0x1ee3b, AL}, + {0x1ee42, 0x1ee42, AL}, + {0x1ee47, 0x1ee47, AL}, + {0x1ee49, 0x1ee49, AL}, + {0x1ee4b, 0x1ee4b, AL}, + {0x1ee4d, 0x1ee4f, AL}, + {0x1ee51, 0x1ee52, AL}, + {0x1ee54, 0x1ee54, AL}, + {0x1ee57, 0x1ee57, AL}, + {0x1ee59, 0x1ee59, AL}, + {0x1ee5b, 0x1ee5b, AL}, + {0x1ee5d, 0x1ee5d, AL}, + {0x1ee5f, 0x1ee5f, AL}, + {0x1ee61, 0x1ee62, AL}, + {0x1ee64, 0x1ee64, AL}, + {0x1ee67, 0x1ee6a, AL}, + {0x1ee6c, 0x1ee72, AL}, + {0x1ee74, 0x1ee77, AL}, + {0x1ee79, 0x1ee7c, AL}, + {0x1ee7e, 0x1ee7e, AL}, + {0x1ee80, 0x1ee89, AL}, + {0x1ee8b, 0x1ee9b, AL}, + {0x1eea1, 0x1eea3, AL}, + {0x1eea5, 0x1eea9, AL}, + {0x1eeab, 0x1eebb, AL}, + {0x1f100, 0x1f10a, EN}, + {0x1f110, 0x1f12e, L}, + {0x1f130, 0x1f169, L}, + {0x1f170, 0x1f1ac, L}, + {0x1f1e6, 0x1f202, L}, + {0x1f210, 0x1f23b, L}, + {0x1f240, 0x1f248, L}, + {0x1f250, 0x1f251, L}, + {0x1fbf0, 0x1fbf9, EN}, + {0x20000, 0x2a6df, L}, + {0x2a700, 0x2b738, L}, + {0x2b740, 0x2b81d, L}, + {0x2b820, 0x2cea1, L}, + {0x2ceb0, 0x2ebe0, L}, + {0x2f800, 0x2fa1d, L}, + {0x30000, 0x3134a, L}, + {0xe0001, 0xe0001, BN}, + {0xe0020, 0xe007f, BN}, + {0xe0100, 0xe01ef, NSM}, + {0xf0000, 0xffffd, L}, + {0x100000, 0x10fffd, L}, + }; + + int i, j, k; + + i = -1; + j = lenof(lookup); + + while (j - i > 1) { + k = (i + j) / 2; + if (ch < lookup[k].first) + j = k; + else if (ch > lookup[k].last) + i = k; + else + return lookup[k].type; + } + + /* + * If we reach here, the character was not in any of the + * intervals listed in the lookup table. This means we return + * ON (`Other Neutrals'). This is the appropriate code for any + * character genuinely not listed in the Unicode table, and + * also the table above has deliberately left out any + * characters _explicitly_ listed as ON (to save space!). + */ + return ON; +} + +/* + * Return the mirrored version of a glyph. + + * The data table in this function is constructed from the Unicode + * Character Database version 14.0.0, downloadable from unicode.org at + * the URL + * + * https://www.unicode.org/Public/14.0.0/ucd/ + * + * by the following fragment of Perl: + +perl -e ' + while (<<>>) { + chomp; s{\s}{}g; s{#.*$}{}; next unless /./; + @_ = split /;/, $_; + $src = hex $_[0]; $dst = hex $_[1]; + $m{$src}=$dst; $m{$dst}=$src; + } + for $src (sort {$a <=> $b} keys %m) { + printf " {0x%04x, 0x%04x},\n", $src, $m{$src}; + } +' BidiMirroring.txt + + * + * FIXME: there are also glyphs which the text rendering engine is + * supposed to display left-right reflected, since no mirrored glyph + * exists in Unicode itself to indicate the reflected form. Those are + * listed in comments in BidiMirroring.txt. Many of them are + * mathematical, e.g. the square root sign, or set difference + * operator, or integral sign. No API currently exists here to + * communicate the need for that reflected display back to the client. + */ +static unsigned mirror_glyph(unsigned int ch) +{ + static const struct { + unsigned src, dst; + } mirror_pairs[] = { + {0x0028, 0x0029}, + {0x0029, 0x0028}, + {0x003c, 0x003e}, + {0x003e, 0x003c}, + {0x005b, 0x005d}, + {0x005d, 0x005b}, + {0x007b, 0x007d}, + {0x007d, 0x007b}, + {0x00ab, 0x00bb}, + {0x00bb, 0x00ab}, + {0x0f3a, 0x0f3b}, + {0x0f3b, 0x0f3a}, + {0x0f3c, 0x0f3d}, + {0x0f3d, 0x0f3c}, + {0x169b, 0x169c}, + {0x169c, 0x169b}, + {0x2039, 0x203a}, + {0x203a, 0x2039}, + {0x2045, 0x2046}, + {0x2046, 0x2045}, + {0x207d, 0x207e}, + {0x207e, 0x207d}, + {0x208d, 0x208e}, + {0x208e, 0x208d}, + {0x2208, 0x220b}, + {0x2209, 0x220c}, + {0x220a, 0x220d}, + {0x220b, 0x2208}, + {0x220c, 0x2209}, + {0x220d, 0x220a}, + {0x2215, 0x29f5}, + {0x221f, 0x2bfe}, + {0x2220, 0x29a3}, + {0x2221, 0x299b}, + {0x2222, 0x29a0}, + {0x2224, 0x2aee}, + {0x223c, 0x223d}, + {0x223d, 0x223c}, + {0x2243, 0x22cd}, + {0x2245, 0x224c}, + {0x224c, 0x2245}, + {0x2252, 0x2253}, + {0x2253, 0x2252}, + {0x2254, 0x2255}, + {0x2255, 0x2254}, + {0x2264, 0x2265}, + {0x2265, 0x2264}, + {0x2266, 0x2267}, + {0x2267, 0x2266}, + {0x2268, 0x2269}, + {0x2269, 0x2268}, + {0x226a, 0x226b}, + {0x226b, 0x226a}, + {0x226e, 0x226f}, + {0x226f, 0x226e}, + {0x2270, 0x2271}, + {0x2271, 0x2270}, + {0x2272, 0x2273}, + {0x2273, 0x2272}, + {0x2274, 0x2275}, + {0x2275, 0x2274}, + {0x2276, 0x2277}, + {0x2277, 0x2276}, + {0x2278, 0x2279}, + {0x2279, 0x2278}, + {0x227a, 0x227b}, + {0x227b, 0x227a}, + {0x227c, 0x227d}, + {0x227d, 0x227c}, + {0x227e, 0x227f}, + {0x227f, 0x227e}, + {0x2280, 0x2281}, + {0x2281, 0x2280}, + {0x2282, 0x2283}, + {0x2283, 0x2282}, + {0x2284, 0x2285}, + {0x2285, 0x2284}, + {0x2286, 0x2287}, + {0x2287, 0x2286}, + {0x2288, 0x2289}, + {0x2289, 0x2288}, + {0x228a, 0x228b}, + {0x228b, 0x228a}, + {0x228f, 0x2290}, + {0x2290, 0x228f}, + {0x2291, 0x2292}, + {0x2292, 0x2291}, + {0x2298, 0x29b8}, + {0x22a2, 0x22a3}, + {0x22a3, 0x22a2}, + {0x22a6, 0x2ade}, + {0x22a8, 0x2ae4}, + {0x22a9, 0x2ae3}, + {0x22ab, 0x2ae5}, + {0x22b0, 0x22b1}, + {0x22b1, 0x22b0}, + {0x22b2, 0x22b3}, + {0x22b3, 0x22b2}, + {0x22b4, 0x22b5}, + {0x22b5, 0x22b4}, + {0x22b6, 0x22b7}, + {0x22b7, 0x22b6}, + {0x22b8, 0x27dc}, + {0x22c9, 0x22ca}, + {0x22ca, 0x22c9}, + {0x22cb, 0x22cc}, + {0x22cc, 0x22cb}, + {0x22cd, 0x2243}, + {0x22d0, 0x22d1}, + {0x22d1, 0x22d0}, + {0x22d6, 0x22d7}, + {0x22d7, 0x22d6}, + {0x22d8, 0x22d9}, + {0x22d9, 0x22d8}, + {0x22da, 0x22db}, + {0x22db, 0x22da}, + {0x22dc, 0x22dd}, + {0x22dd, 0x22dc}, + {0x22de, 0x22df}, + {0x22df, 0x22de}, + {0x22e0, 0x22e1}, + {0x22e1, 0x22e0}, + {0x22e2, 0x22e3}, + {0x22e3, 0x22e2}, + {0x22e4, 0x22e5}, + {0x22e5, 0x22e4}, + {0x22e6, 0x22e7}, + {0x22e7, 0x22e6}, + {0x22e8, 0x22e9}, + {0x22e9, 0x22e8}, + {0x22ea, 0x22eb}, + {0x22eb, 0x22ea}, + {0x22ec, 0x22ed}, + {0x22ed, 0x22ec}, + {0x22f0, 0x22f1}, + {0x22f1, 0x22f0}, + {0x22f2, 0x22fa}, + {0x22f3, 0x22fb}, + {0x22f4, 0x22fc}, + {0x22f6, 0x22fd}, + {0x22f7, 0x22fe}, + {0x22fa, 0x22f2}, + {0x22fb, 0x22f3}, + {0x22fc, 0x22f4}, + {0x22fd, 0x22f6}, + {0x22fe, 0x22f7}, + {0x2308, 0x2309}, + {0x2309, 0x2308}, + {0x230a, 0x230b}, + {0x230b, 0x230a}, + {0x2329, 0x232a}, + {0x232a, 0x2329}, + {0x2768, 0x2769}, + {0x2769, 0x2768}, + {0x276a, 0x276b}, + {0x276b, 0x276a}, + {0x276c, 0x276d}, + {0x276d, 0x276c}, + {0x276e, 0x276f}, + {0x276f, 0x276e}, + {0x2770, 0x2771}, + {0x2771, 0x2770}, + {0x2772, 0x2773}, + {0x2773, 0x2772}, + {0x2774, 0x2775}, + {0x2775, 0x2774}, + {0x27c3, 0x27c4}, + {0x27c4, 0x27c3}, + {0x27c5, 0x27c6}, + {0x27c6, 0x27c5}, + {0x27c8, 0x27c9}, + {0x27c9, 0x27c8}, + {0x27cb, 0x27cd}, + {0x27cd, 0x27cb}, + {0x27d5, 0x27d6}, + {0x27d6, 0x27d5}, + {0x27dc, 0x22b8}, + {0x27dd, 0x27de}, + {0x27de, 0x27dd}, + {0x27e2, 0x27e3}, + {0x27e3, 0x27e2}, + {0x27e4, 0x27e5}, + {0x27e5, 0x27e4}, + {0x27e6, 0x27e7}, + {0x27e7, 0x27e6}, + {0x27e8, 0x27e9}, + {0x27e9, 0x27e8}, + {0x27ea, 0x27eb}, + {0x27eb, 0x27ea}, + {0x27ec, 0x27ed}, + {0x27ed, 0x27ec}, + {0x27ee, 0x27ef}, + {0x27ef, 0x27ee}, + {0x2983, 0x2984}, + {0x2984, 0x2983}, + {0x2985, 0x2986}, + {0x2986, 0x2985}, + {0x2987, 0x2988}, + {0x2988, 0x2987}, + {0x2989, 0x298a}, + {0x298a, 0x2989}, + {0x298b, 0x298c}, + {0x298c, 0x298b}, + {0x298d, 0x2990}, + {0x298e, 0x298f}, + {0x298f, 0x298e}, + {0x2990, 0x298d}, + {0x2991, 0x2992}, + {0x2992, 0x2991}, + {0x2993, 0x2994}, + {0x2994, 0x2993}, + {0x2995, 0x2996}, + {0x2996, 0x2995}, + {0x2997, 0x2998}, + {0x2998, 0x2997}, + {0x299b, 0x2221}, + {0x29a0, 0x2222}, + {0x29a3, 0x2220}, + {0x29a4, 0x29a5}, + {0x29a5, 0x29a4}, + {0x29a8, 0x29a9}, + {0x29a9, 0x29a8}, + {0x29aa, 0x29ab}, + {0x29ab, 0x29aa}, + {0x29ac, 0x29ad}, + {0x29ad, 0x29ac}, + {0x29ae, 0x29af}, + {0x29af, 0x29ae}, + {0x29b8, 0x2298}, + {0x29c0, 0x29c1}, + {0x29c1, 0x29c0}, + {0x29c4, 0x29c5}, + {0x29c5, 0x29c4}, + {0x29cf, 0x29d0}, + {0x29d0, 0x29cf}, + {0x29d1, 0x29d2}, + {0x29d2, 0x29d1}, + {0x29d4, 0x29d5}, + {0x29d5, 0x29d4}, + {0x29d8, 0x29d9}, + {0x29d9, 0x29d8}, + {0x29da, 0x29db}, + {0x29db, 0x29da}, + {0x29e8, 0x29e9}, + {0x29e9, 0x29e8}, + {0x29f5, 0x2215}, + {0x29f8, 0x29f9}, + {0x29f9, 0x29f8}, + {0x29fc, 0x29fd}, + {0x29fd, 0x29fc}, + {0x2a2b, 0x2a2c}, + {0x2a2c, 0x2a2b}, + {0x2a2d, 0x2a2e}, + {0x2a2e, 0x2a2d}, + {0x2a34, 0x2a35}, + {0x2a35, 0x2a34}, + {0x2a3c, 0x2a3d}, + {0x2a3d, 0x2a3c}, + {0x2a64, 0x2a65}, + {0x2a65, 0x2a64}, + {0x2a79, 0x2a7a}, + {0x2a7a, 0x2a79}, + {0x2a7b, 0x2a7c}, + {0x2a7c, 0x2a7b}, + {0x2a7d, 0x2a7e}, + {0x2a7e, 0x2a7d}, + {0x2a7f, 0x2a80}, + {0x2a80, 0x2a7f}, + {0x2a81, 0x2a82}, + {0x2a82, 0x2a81}, + {0x2a83, 0x2a84}, + {0x2a84, 0x2a83}, + {0x2a85, 0x2a86}, + {0x2a86, 0x2a85}, + {0x2a87, 0x2a88}, + {0x2a88, 0x2a87}, + {0x2a89, 0x2a8a}, + {0x2a8a, 0x2a89}, + {0x2a8b, 0x2a8c}, + {0x2a8c, 0x2a8b}, + {0x2a8d, 0x2a8e}, + {0x2a8e, 0x2a8d}, + {0x2a8f, 0x2a90}, + {0x2a90, 0x2a8f}, + {0x2a91, 0x2a92}, + {0x2a92, 0x2a91}, + {0x2a93, 0x2a94}, + {0x2a94, 0x2a93}, + {0x2a95, 0x2a96}, + {0x2a96, 0x2a95}, + {0x2a97, 0x2a98}, + {0x2a98, 0x2a97}, + {0x2a99, 0x2a9a}, + {0x2a9a, 0x2a99}, + {0x2a9b, 0x2a9c}, + {0x2a9c, 0x2a9b}, + {0x2a9d, 0x2a9e}, + {0x2a9e, 0x2a9d}, + {0x2a9f, 0x2aa0}, + {0x2aa0, 0x2a9f}, + {0x2aa1, 0x2aa2}, + {0x2aa2, 0x2aa1}, + {0x2aa6, 0x2aa7}, + {0x2aa7, 0x2aa6}, + {0x2aa8, 0x2aa9}, + {0x2aa9, 0x2aa8}, + {0x2aaa, 0x2aab}, + {0x2aab, 0x2aaa}, + {0x2aac, 0x2aad}, + {0x2aad, 0x2aac}, + {0x2aaf, 0x2ab0}, + {0x2ab0, 0x2aaf}, + {0x2ab1, 0x2ab2}, + {0x2ab2, 0x2ab1}, + {0x2ab3, 0x2ab4}, + {0x2ab4, 0x2ab3}, + {0x2ab5, 0x2ab6}, + {0x2ab6, 0x2ab5}, + {0x2ab7, 0x2ab8}, + {0x2ab8, 0x2ab7}, + {0x2ab9, 0x2aba}, + {0x2aba, 0x2ab9}, + {0x2abb, 0x2abc}, + {0x2abc, 0x2abb}, + {0x2abd, 0x2abe}, + {0x2abe, 0x2abd}, + {0x2abf, 0x2ac0}, + {0x2ac0, 0x2abf}, + {0x2ac1, 0x2ac2}, + {0x2ac2, 0x2ac1}, + {0x2ac3, 0x2ac4}, + {0x2ac4, 0x2ac3}, + {0x2ac5, 0x2ac6}, + {0x2ac6, 0x2ac5}, + {0x2ac7, 0x2ac8}, + {0x2ac8, 0x2ac7}, + {0x2ac9, 0x2aca}, + {0x2aca, 0x2ac9}, + {0x2acb, 0x2acc}, + {0x2acc, 0x2acb}, + {0x2acd, 0x2ace}, + {0x2ace, 0x2acd}, + {0x2acf, 0x2ad0}, + {0x2ad0, 0x2acf}, + {0x2ad1, 0x2ad2}, + {0x2ad2, 0x2ad1}, + {0x2ad3, 0x2ad4}, + {0x2ad4, 0x2ad3}, + {0x2ad5, 0x2ad6}, + {0x2ad6, 0x2ad5}, + {0x2ade, 0x22a6}, + {0x2ae3, 0x22a9}, + {0x2ae4, 0x22a8}, + {0x2ae5, 0x22ab}, + {0x2aec, 0x2aed}, + {0x2aed, 0x2aec}, + {0x2aee, 0x2224}, + {0x2af7, 0x2af8}, + {0x2af8, 0x2af7}, + {0x2af9, 0x2afa}, + {0x2afa, 0x2af9}, + {0x2bfe, 0x221f}, + {0x2e02, 0x2e03}, + {0x2e03, 0x2e02}, + {0x2e04, 0x2e05}, + {0x2e05, 0x2e04}, + {0x2e09, 0x2e0a}, + {0x2e0a, 0x2e09}, + {0x2e0c, 0x2e0d}, + {0x2e0d, 0x2e0c}, + {0x2e1c, 0x2e1d}, + {0x2e1d, 0x2e1c}, + {0x2e20, 0x2e21}, + {0x2e21, 0x2e20}, + {0x2e22, 0x2e23}, + {0x2e23, 0x2e22}, + {0x2e24, 0x2e25}, + {0x2e25, 0x2e24}, + {0x2e26, 0x2e27}, + {0x2e27, 0x2e26}, + {0x2e28, 0x2e29}, + {0x2e29, 0x2e28}, + {0x2e55, 0x2e56}, + {0x2e56, 0x2e55}, + {0x2e57, 0x2e58}, + {0x2e58, 0x2e57}, + {0x2e59, 0x2e5a}, + {0x2e5a, 0x2e59}, + {0x2e5b, 0x2e5c}, + {0x2e5c, 0x2e5b}, + {0x3008, 0x3009}, + {0x3009, 0x3008}, + {0x300a, 0x300b}, + {0x300b, 0x300a}, + {0x300c, 0x300d}, + {0x300d, 0x300c}, + {0x300e, 0x300f}, + {0x300f, 0x300e}, + {0x3010, 0x3011}, + {0x3011, 0x3010}, + {0x3014, 0x3015}, + {0x3015, 0x3014}, + {0x3016, 0x3017}, + {0x3017, 0x3016}, + {0x3018, 0x3019}, + {0x3019, 0x3018}, + {0x301a, 0x301b}, + {0x301b, 0x301a}, + {0xfe59, 0xfe5a}, + {0xfe5a, 0xfe59}, + {0xfe5b, 0xfe5c}, + {0xfe5c, 0xfe5b}, + {0xfe5d, 0xfe5e}, + {0xfe5e, 0xfe5d}, + {0xfe64, 0xfe65}, + {0xfe65, 0xfe64}, + {0xff08, 0xff09}, + {0xff09, 0xff08}, + {0xff1c, 0xff1e}, + {0xff1e, 0xff1c}, + {0xff3b, 0xff3d}, + {0xff3d, 0xff3b}, + {0xff5b, 0xff5d}, + {0xff5d, 0xff5b}, + {0xff5f, 0xff60}, + {0xff60, 0xff5f}, + {0xff62, 0xff63}, + {0xff63, 0xff62}, + }; + + int i, j, k; + + i = -1; + j = lenof(mirror_pairs); + + while (j - i > 1) { + k = (i + j) / 2; + if (ch < mirror_pairs[k].src) + j = k; + else if (ch > mirror_pairs[k].src) + i = k; + else + return mirror_pairs[k].dst; + } + + return ch; +} + +/* + * Identify the bracket characters treated specially by bidi rule + * BD19, and return their paired character(s). + * + * The data table in this function is constructed from the Unicode + * Character Database version 14.0.0, downloadable from unicode.org at + * the URL + * + * https://www.unicode.org/Public/14.0.0/ucd/ + * + * by the following fragment of Perl: + +perl -e ' + open BIDIBRACKETS, "<", $ARGV[0] or die; + while () { + chomp; s{\s}{}g; s{#.*$}{}; next unless /./; + @_ = split /;/, $_; + $src = hex $_[0]; $dst = hex $_[1]; $kind = $_[2]; + $m{$src}=[$kind, $dst]; + } + open UNICODEDATA, "<", $ARGV[1] or die; + while () { + chomp; @_ = split /;/, $_; + $src = hex $_[0]; next unless defined $m{$src}; + if ($_[5] =~ /^[0-9a-f]+$/i) { + $equiv = hex $_[5]; + $e{$src} = $equiv; + $e{$equiv} = $src; + } + } + for $src (sort {$a <=> $b} keys %m) { + ($kind, $dst) = @{$m{$src}}; + $equiv = 0 + $e{$dst}; + printf " {0x%04x, {0x%04x, 0x%04x, %s}},\n", $src, $dst, $equiv, + $kind eq "c" ? "BT_CLOSE" : "BT_OPEN"; + } +' BidiBrackets.txt UnicodeData.txt + + */ +typedef enum { BT_NONE, BT_OPEN, BT_CLOSE } BracketType; +typedef struct BracketTypeData { + unsigned partner, equiv_partner; + BracketType type; +} BracketTypeData; +static BracketTypeData bracket_type(unsigned int ch) +{ + static const struct { + unsigned src; + BracketTypeData payload; + } bracket_pairs[] = { + {0x0028, {0x0029, 0x0000, BT_OPEN}}, + {0x0029, {0x0028, 0x0000, BT_CLOSE}}, + {0x005b, {0x005d, 0x0000, BT_OPEN}}, + {0x005d, {0x005b, 0x0000, BT_CLOSE}}, + {0x007b, {0x007d, 0x0000, BT_OPEN}}, + {0x007d, {0x007b, 0x0000, BT_CLOSE}}, + {0x0f3a, {0x0f3b, 0x0000, BT_OPEN}}, + {0x0f3b, {0x0f3a, 0x0000, BT_CLOSE}}, + {0x0f3c, {0x0f3d, 0x0000, BT_OPEN}}, + {0x0f3d, {0x0f3c, 0x0000, BT_CLOSE}}, + {0x169b, {0x169c, 0x0000, BT_OPEN}}, + {0x169c, {0x169b, 0x0000, BT_CLOSE}}, + {0x2045, {0x2046, 0x0000, BT_OPEN}}, + {0x2046, {0x2045, 0x0000, BT_CLOSE}}, + {0x207d, {0x207e, 0x0000, BT_OPEN}}, + {0x207e, {0x207d, 0x0000, BT_CLOSE}}, + {0x208d, {0x208e, 0x0000, BT_OPEN}}, + {0x208e, {0x208d, 0x0000, BT_CLOSE}}, + {0x2308, {0x2309, 0x0000, BT_OPEN}}, + {0x2309, {0x2308, 0x0000, BT_CLOSE}}, + {0x230a, {0x230b, 0x0000, BT_OPEN}}, + {0x230b, {0x230a, 0x0000, BT_CLOSE}}, + {0x2329, {0x232a, 0x3009, BT_OPEN}}, + {0x232a, {0x2329, 0x3008, BT_CLOSE}}, + {0x2768, {0x2769, 0x0000, BT_OPEN}}, + {0x2769, {0x2768, 0x0000, BT_CLOSE}}, + {0x276a, {0x276b, 0x0000, BT_OPEN}}, + {0x276b, {0x276a, 0x0000, BT_CLOSE}}, + {0x276c, {0x276d, 0x0000, BT_OPEN}}, + {0x276d, {0x276c, 0x0000, BT_CLOSE}}, + {0x276e, {0x276f, 0x0000, BT_OPEN}}, + {0x276f, {0x276e, 0x0000, BT_CLOSE}}, + {0x2770, {0x2771, 0x0000, BT_OPEN}}, + {0x2771, {0x2770, 0x0000, BT_CLOSE}}, + {0x2772, {0x2773, 0x0000, BT_OPEN}}, + {0x2773, {0x2772, 0x0000, BT_CLOSE}}, + {0x2774, {0x2775, 0x0000, BT_OPEN}}, + {0x2775, {0x2774, 0x0000, BT_CLOSE}}, + {0x27c5, {0x27c6, 0x0000, BT_OPEN}}, + {0x27c6, {0x27c5, 0x0000, BT_CLOSE}}, + {0x27e6, {0x27e7, 0x0000, BT_OPEN}}, + {0x27e7, {0x27e6, 0x0000, BT_CLOSE}}, + {0x27e8, {0x27e9, 0x0000, BT_OPEN}}, + {0x27e9, {0x27e8, 0x0000, BT_CLOSE}}, + {0x27ea, {0x27eb, 0x0000, BT_OPEN}}, + {0x27eb, {0x27ea, 0x0000, BT_CLOSE}}, + {0x27ec, {0x27ed, 0x0000, BT_OPEN}}, + {0x27ed, {0x27ec, 0x0000, BT_CLOSE}}, + {0x27ee, {0x27ef, 0x0000, BT_OPEN}}, + {0x27ef, {0x27ee, 0x0000, BT_CLOSE}}, + {0x2983, {0x2984, 0x0000, BT_OPEN}}, + {0x2984, {0x2983, 0x0000, BT_CLOSE}}, + {0x2985, {0x2986, 0x0000, BT_OPEN}}, + {0x2986, {0x2985, 0x0000, BT_CLOSE}}, + {0x2987, {0x2988, 0x0000, BT_OPEN}}, + {0x2988, {0x2987, 0x0000, BT_CLOSE}}, + {0x2989, {0x298a, 0x0000, BT_OPEN}}, + {0x298a, {0x2989, 0x0000, BT_CLOSE}}, + {0x298b, {0x298c, 0x0000, BT_OPEN}}, + {0x298c, {0x298b, 0x0000, BT_CLOSE}}, + {0x298d, {0x2990, 0x0000, BT_OPEN}}, + {0x298e, {0x298f, 0x0000, BT_CLOSE}}, + {0x298f, {0x298e, 0x0000, BT_OPEN}}, + {0x2990, {0x298d, 0x0000, BT_CLOSE}}, + {0x2991, {0x2992, 0x0000, BT_OPEN}}, + {0x2992, {0x2991, 0x0000, BT_CLOSE}}, + {0x2993, {0x2994, 0x0000, BT_OPEN}}, + {0x2994, {0x2993, 0x0000, BT_CLOSE}}, + {0x2995, {0x2996, 0x0000, BT_OPEN}}, + {0x2996, {0x2995, 0x0000, BT_CLOSE}}, + {0x2997, {0x2998, 0x0000, BT_OPEN}}, + {0x2998, {0x2997, 0x0000, BT_CLOSE}}, + {0x29d8, {0x29d9, 0x0000, BT_OPEN}}, + {0x29d9, {0x29d8, 0x0000, BT_CLOSE}}, + {0x29da, {0x29db, 0x0000, BT_OPEN}}, + {0x29db, {0x29da, 0x0000, BT_CLOSE}}, + {0x29fc, {0x29fd, 0x0000, BT_OPEN}}, + {0x29fd, {0x29fc, 0x0000, BT_CLOSE}}, + {0x2e22, {0x2e23, 0x0000, BT_OPEN}}, + {0x2e23, {0x2e22, 0x0000, BT_CLOSE}}, + {0x2e24, {0x2e25, 0x0000, BT_OPEN}}, + {0x2e25, {0x2e24, 0x0000, BT_CLOSE}}, + {0x2e26, {0x2e27, 0x0000, BT_OPEN}}, + {0x2e27, {0x2e26, 0x0000, BT_CLOSE}}, + {0x2e28, {0x2e29, 0x0000, BT_OPEN}}, + {0x2e29, {0x2e28, 0x0000, BT_CLOSE}}, + {0x2e55, {0x2e56, 0x0000, BT_OPEN}}, + {0x2e56, {0x2e55, 0x0000, BT_CLOSE}}, + {0x2e57, {0x2e58, 0x0000, BT_OPEN}}, + {0x2e58, {0x2e57, 0x0000, BT_CLOSE}}, + {0x2e59, {0x2e5a, 0x0000, BT_OPEN}}, + {0x2e5a, {0x2e59, 0x0000, BT_CLOSE}}, + {0x2e5b, {0x2e5c, 0x0000, BT_OPEN}}, + {0x2e5c, {0x2e5b, 0x0000, BT_CLOSE}}, + {0x3008, {0x3009, 0x232a, BT_OPEN}}, + {0x3009, {0x3008, 0x2329, BT_CLOSE}}, + {0x300a, {0x300b, 0x0000, BT_OPEN}}, + {0x300b, {0x300a, 0x0000, BT_CLOSE}}, + {0x300c, {0x300d, 0x0000, BT_OPEN}}, + {0x300d, {0x300c, 0x0000, BT_CLOSE}}, + {0x300e, {0x300f, 0x0000, BT_OPEN}}, + {0x300f, {0x300e, 0x0000, BT_CLOSE}}, + {0x3010, {0x3011, 0x0000, BT_OPEN}}, + {0x3011, {0x3010, 0x0000, BT_CLOSE}}, + {0x3014, {0x3015, 0x0000, BT_OPEN}}, + {0x3015, {0x3014, 0x0000, BT_CLOSE}}, + {0x3016, {0x3017, 0x0000, BT_OPEN}}, + {0x3017, {0x3016, 0x0000, BT_CLOSE}}, + {0x3018, {0x3019, 0x0000, BT_OPEN}}, + {0x3019, {0x3018, 0x0000, BT_CLOSE}}, + {0x301a, {0x301b, 0x0000, BT_OPEN}}, + {0x301b, {0x301a, 0x0000, BT_CLOSE}}, + {0xfe59, {0xfe5a, 0x0000, BT_OPEN}}, + {0xfe5a, {0xfe59, 0x0000, BT_CLOSE}}, + {0xfe5b, {0xfe5c, 0x0000, BT_OPEN}}, + {0xfe5c, {0xfe5b, 0x0000, BT_CLOSE}}, + {0xfe5d, {0xfe5e, 0x0000, BT_OPEN}}, + {0xfe5e, {0xfe5d, 0x0000, BT_CLOSE}}, + {0xff08, {0xff09, 0x0000, BT_OPEN}}, + {0xff09, {0xff08, 0x0000, BT_CLOSE}}, + {0xff3b, {0xff3d, 0x0000, BT_OPEN}}, + {0xff3d, {0xff3b, 0x0000, BT_CLOSE}}, + {0xff5b, {0xff5d, 0x0000, BT_OPEN}}, + {0xff5d, {0xff5b, 0x0000, BT_CLOSE}}, + {0xff5f, {0xff60, 0x0000, BT_OPEN}}, + {0xff60, {0xff5f, 0x0000, BT_CLOSE}}, + {0xff62, {0xff63, 0x0000, BT_OPEN}}, + {0xff63, {0xff62, 0x0000, BT_CLOSE}}, + }; + + int i, j, k; + + i = -1; + j = lenof(bracket_pairs); + + while (j - i > 1) { + k = (i + j) / 2; + if (ch < bracket_pairs[k].src) { + j = k; + } else if (ch > bracket_pairs[k].src) { + i = k; + } else { + return bracket_pairs[k].payload; + } + } + + static const BracketTypeData null = { 0, 0, BT_NONE }; + return null; +} + +/* + * Function exported to front ends to allow them to identify + * bidi-active characters (in case, for example, the platform's + * text display function can't conveniently be prevented from doing + * its own bidi and so special treatment is required for characters + * that would cause the bidi algorithm to activate). + * + * This function is passed a single Unicode code point, and returns + * nonzero if the presence of this code point can possibly cause + * the bidi algorithm to do any reordering. Thus, any string + * composed entirely of characters for which is_rtl() returns zero + * should be safe to pass to a bidi-active platform display + * function without fear. + * + * (is_rtl() must therefore also return true for any character + * which would be affected by Arabic shaping, but this isn't + * important because all such characters are right-to-left so it + * would have flagged them anyway.) + */ +bool is_rtl(int c) +{ + return typeIsBidiActive(bidi_getType(c)); +} + +/* The Main shaping function, and the only one to be used + * by the outside world. + * + * line: buffer to apply shaping to. this must be passed by doBidi() first + * to: output buffer for the shaped data + * count: number of characters in line + */ +int do_shape(bidi_char *line, bidi_char *to, int count) +{ + int i, tempShape; + bool ligFlag = false; + + for (i=0; i 0) switch (line[i-1].wc) { + case 0x622: + ligFlag = true; + if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) + to[i].wc = 0xFEF6; + else + to[i].wc = 0xFEF5; + break; + case 0x623: + ligFlag = true; + if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) + to[i].wc = 0xFEF8; + else + to[i].wc = 0xFEF7; + break; + case 0x625: + ligFlag = true; + if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) + to[i].wc = 0xFEFA; + else + to[i].wc = 0xFEF9; + break; + case 0x627: + ligFlag = true; + if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) + to[i].wc = 0xFEFC; + else + to[i].wc = 0xFEFB; + break; + } + if (ligFlag) { + to[i-1].wc = 0x20; + ligFlag = false; + break; + } + } + + if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) { + tempShape = (i > 0 ? STYPE(line[i-1].wc) : SU); + if ((tempShape == SR) || (tempShape == SD) || (tempShape == SC)) + to[i].wc = SMEDIAL((SISOLATED(line[i].wc))); + else + to[i].wc = SFINAL((SISOLATED(line[i].wc))); + break; + } + + tempShape = (i > 0 ? STYPE(line[i-1].wc) : SU); + if ((tempShape == SR) || (tempShape == SD) || (tempShape == SC)) + to[i].wc = SINITIAL((SISOLATED(line[i].wc))); + else + to[i].wc = SISOLATED(line[i].wc); + break; + + + } + } + return 1; +} + +typedef enum { DO_NEUTRAL, DO_LTR, DO_RTL } DirectionalOverride; + +typedef struct DSStackEntry { + /* + * An entry in the directional status stack (rule section X). + */ + unsigned char level; + bool isolate; + DirectionalOverride override; +} DSStackEntry; + +typedef struct BracketStackEntry { + /* + * An entry in the bracket-pair-tracking stack (rule BD16). + */ + unsigned ch; + size_t c; +} BracketStackEntry; + +typedef struct IsolatingRunSequence { + size_t start, end; + BidiType sos, eos, embeddingDirection; +} IsolatingRunSequence; + +#define MAX_DEPTH 125 /* specified in the standard */ + +struct BidiContext { + /* + * Storage space preserved between runs, all allocated to the same + * length (internal_array_sizes). + */ + size_t internal_array_sizes; + BidiType *types, *origTypes; + unsigned char *levels; + size_t *irsindices, *bracketpos; + bool *irsdone; + + /* + * Separately allocated with its own size field + */ + IsolatingRunSequence *irslist; + size_t irslistsize; + + /* + * Rewritten to point to the input to the currently active run of + * the bidi algorithm + */ + bidi_char *text; + size_t textlen; + + /* + * State within a run of the algorithm + */ + BidiType paragraphOverride; + DSStackEntry dsstack[MAX_DEPTH + 2]; + size_t ds_sp; + size_t overflowIsolateCount, overflowEmbeddingCount, validIsolateCount; + unsigned char paragraphLevel; + size_t *irs; + size_t irslen; + BidiType sos, eos, embeddingDirection; + BracketStackEntry bstack[63]; /* constant size specified in rule BD16 */ +}; + +BidiContext *bidi_new_context(void) +{ + BidiContext *ctx = snew(BidiContext); + memset(ctx, 0, sizeof(BidiContext)); + return ctx; +} + +void bidi_free_context(BidiContext *ctx) +{ + sfree(ctx->types); + sfree(ctx->origTypes); + sfree(ctx->levels); + sfree(ctx->irsindices); + sfree(ctx->irsdone); + sfree(ctx->bracketpos); + sfree(ctx->irslist); + sfree(ctx); +} + +static void ensure_arrays(BidiContext *ctx, size_t textlen) +{ + if (textlen <= ctx->internal_array_sizes) + return; + ctx->internal_array_sizes = textlen; + ctx->types = sresize(ctx->types, ctx->internal_array_sizes, BidiType); + ctx->origTypes = sresize(ctx->origTypes, ctx->internal_array_sizes, + BidiType); + ctx->levels = sresize(ctx->levels, ctx->internal_array_sizes, + unsigned char); + ctx->irsindices = sresize(ctx->irsindices, ctx->internal_array_sizes, + size_t); + ctx->irsdone = sresize(ctx->irsdone, ctx->internal_array_sizes, bool); + ctx->bracketpos = sresize(ctx->bracketpos, ctx->internal_array_sizes, + size_t); +} + +static void setup_types(BidiContext *ctx) +{ + for (size_t i = 0; i < ctx->textlen; i++) + ctx->types[i] = ctx->origTypes[i] = bidi_getType(ctx->text[i].wc); +} + +static bool text_needs_bidi(BidiContext *ctx) +{ + /* + * Initial optimisation: check for any bidi-active character at + * all in an input line. If there aren't any, we can skip the + * whole algorithm. + * + * Also include the paragraph override in this check! + */ + for (size_t i = 0; i < ctx->textlen; i++) + if (typeIsBidiActive(ctx->types[i])) + return true; + return typeIsBidiActive(ctx->paragraphOverride); +} + +static size_t find_matching_pdi(const BidiType *types, size_t i, size_t size) +{ + /* Assuming that types[i] is an isolate initiator, find its + * matching PDI by rule BD9. */ + unsigned counter = 1; + i++; + for (; i < size; i++) { + BidiType t = types[i]; + if (typeIsIsolateInitiator(t)) { + counter++; + } else if (t == PDI) { + counter--; + if (counter == 0) + return i; + } + } + + /* If no PDI was found, return the length of the array. */ + return size; +} + +static unsigned char rule_p2_p3(const BidiType *types, size_t size) +{ + /* + * Rule P2. Find the first strong type (L, R or AL), ignoring + * anything inside an isolated segment. + * + * Rule P3. If that type is R or AL, choose a paragraph embeddding + * level of 1, otherwise 0. + */ + for (size_t i = 0; i < size; i++) { + BidiType t = types[i]; + if (typeIsIsolateInitiator(t)) + i = find_matching_pdi(types, i, size); + else if (typeIsStrong(t)) + return (t == L ? 0 : 1); + } + + return 0; /* default if no strong type found */ +} + +static void set_paragraph_level(BidiContext *ctx) +{ + if (ctx->paragraphOverride == L) + ctx->paragraphLevel = 0; + else if (ctx->paragraphOverride == R) + ctx->paragraphLevel = 1; + else + ctx->paragraphLevel = rule_p2_p3(ctx->types, ctx->textlen); +} + +static inline unsigned char nextOddLevel(unsigned char x) { return (x+1)|1; } +static inline unsigned char nextEvenLevel(unsigned char x) { return (x|1)+1; } + +static inline void push(BidiContext *ctx, unsigned char level, + DirectionalOverride override, bool isolate) +{ + ctx->ds_sp++; + assert(ctx->ds_sp < lenof(ctx->dsstack)); + ctx->dsstack[ctx->ds_sp].level = level; + ctx->dsstack[ctx->ds_sp].override = override; + ctx->dsstack[ctx->ds_sp].isolate = isolate; +} + +static inline void pop(BidiContext *ctx) +{ + assert(ctx->ds_sp > 0); + ctx->ds_sp--; +} + +static void process_explicit_embeddings(BidiContext *ctx) +{ + /* + * Rule X1 initialisation. + */ + ctx->ds_sp = (size_t)-1; + push(ctx, ctx->paragraphLevel, DO_NEUTRAL, false); + ctx->overflowIsolateCount = 0; + ctx->overflowEmbeddingCount = 0; + ctx->validIsolateCount = 0; + + #define stk (&ctx->dsstack[ctx->ds_sp]) + + for (size_t i = 0; i < ctx->textlen; i++) { + BidiType t = ctx->types[i]; + switch (t) { + case RLE: case LRE: case RLO: case LRO: { + /* Rules X2-X5 */ + unsigned char newLevel; + DirectionalOverride override; + +#ifndef REMOVE_FORMATTING_CHARS + ctx->levels[i] = stk->level; +#endif + + switch (t) { + case RLE: /* rule X2 */ + newLevel = nextOddLevel(stk->level); + override = DO_NEUTRAL; + break; + case LRE: /* rule X3 */ + newLevel = nextEvenLevel(stk->level); + override = DO_NEUTRAL; + break; + case RLO: /* rule X4 */ + newLevel = nextOddLevel(stk->level); + override = DO_RTL; + break; + case LRO: /* rule X5 */ + newLevel = nextEvenLevel(stk->level); + override = DO_LTR; + break; + default: + unreachable("how did this get past the outer switch?"); + } + + if (newLevel <= MAX_DEPTH && + ctx->overflowIsolateCount == 0 && + ctx->overflowEmbeddingCount == 0) { + /* Embedding code is valid. Push a stack entry. */ + push(ctx, newLevel, override, false); + } else { + /* Embedding code is an overflow one. */ + if (ctx->overflowIsolateCount == 0) + ctx->overflowEmbeddingCount++; + } + break; + } + + case RLI: case LRI: case FSI: { + /* Rules X5a, X5b, X5c */ + + if (t == FSI) { + /* Rule X5c: decide whether this should be treated + * like RLI or LRI */ + size_t pdi = find_matching_pdi(ctx->types, i, ctx->textlen); + unsigned char level = rule_p2_p3(ctx->types + (i + 1), + pdi - (i + 1)); + t = (level == 1 ? RLI : LRI); + } + + ctx->levels[i] = stk->level; + if (stk->override != DO_NEUTRAL) + ctx->types[i] = (stk->override == DO_LTR ? L : + stk->override == DO_RTL ? R : t); + + unsigned char newLevel = (t == RLI ? nextOddLevel(stk->level) : + nextEvenLevel(stk->level)); + + if (newLevel <= MAX_DEPTH && + ctx->overflowIsolateCount == 0 && + ctx->overflowEmbeddingCount == 0) { + /* Isolate code is valid. Push a stack entry. */ + push(ctx, newLevel, DO_NEUTRAL, true); + ctx->validIsolateCount++; + } else { + /* Isolate code is an overflow one. */ + ctx->overflowIsolateCount++; + } + break; + } + + case PDI: { + /* Rule X6a */ + if (ctx->overflowIsolateCount > 0) { + ctx->overflowIsolateCount--; + } else if (ctx->validIsolateCount == 0) { + /* Do nothing: spurious isolate-pop */ + } else { + /* Valid isolate-pop. We expect that the stack must + * therefore contain at least one isolate==true entry, + * so pop everything up to and including it. */ + ctx->overflowEmbeddingCount = 0; + while (!stk->isolate) + pop(ctx); + pop(ctx); + ctx->validIsolateCount--; + } + ctx->levels[i] = stk->level; + if (stk->override != DO_NEUTRAL) + ctx->types[i] = (stk->override == DO_LTR ? L : R); + break; + } + + case PDF: { + /* Rule X7 */ + if (ctx->overflowIsolateCount > 0) { + /* Do nothing if we've overflowed on isolates */ + } else if (ctx->overflowEmbeddingCount > 0) { + ctx->overflowEmbeddingCount--; + } else if (ctx->ds_sp > 0 && !stk->isolate) { + pop(ctx); + } else { + /* Do nothing: spurious embedding-pop */ + } + +#ifndef REMOVE_FORMATTING_CHARS + ctx->levels[i] = stk->level; +#endif + break; + } + + case B: { + /* Rule X8: if an explicit paragraph separator appears in + * this text at all then it does not participate in any of + * the above, and just gets assigned the paragraph level. + * + * PS, it had better be right at the end of the text, + * because we have not implemented rule P1 in this code. */ + assert(i == ctx->textlen - 1); + ctx->levels[i] = ctx->paragraphLevel; + break; + } + + case BN: { + /* + * The section 5.2 adjustment to rule X6 says that we + * apply it to BN just like any other class. But I think + * this can't possibly give the same results as the + * unmodified algorithm. + * + * Proof: adding RLO BN or LRO BN at the end of a + * paragraph should not change the output of the standard + * algorithm, because the override doesn't affect the BN + * in rule X6, and then rule X9 removes both. But with the + * modified rule X6, the BN is changed into R or L, and + * then rule X9 doesn't remove it, and then you've added a + * strong type that will set eos for the level run just + * before the override. And whatever the standard + * algorithm set eos to, _one_ of these override sequences + * will disagree with it. + * + * So I think we just set the BN's level, and don't change + * its type. + */ + ctx->levels[i] = stk->level; + break; + } + + default: { + /* Rule X6. */ + ctx->levels[i] = stk->level; + if (stk->override != DO_NEUTRAL) + ctx->types[i] = (stk->override == DO_LTR ? L : R); + break; + } + } + } + + #undef stk +} + +static void remove_embedding_characters(BidiContext *ctx) +{ +#ifndef REMOVE_FORMATTING_CHARS + /* + * Rule X9, as modified by section 5.2: turn embedding (but not + * isolate) characters into BN. + */ + for (size_t i = 0; i < ctx->textlen; i++) { + BidiType t = ctx->types[i]; + if (typeIsRemovedDuringProcessing(t)) { + ctx->types[i] = BN; + + /* + * My own adjustment to the section 5.2 mods: a sequence + * of contiguous BN generated by this setup should never + * be at different levels from each other. + * + * An example where this goes wrong is if you open two + * LREs in sequence, then close them again: + * + * ... LRE LRE PDF PDF ... + * + * The initial level assignment gives level 0 to the outer + * LRE/PDF pair, and level 2 to the inner one. The + * standard algorithm would remove all four, so this + * doesn't matter, and you end up with no break in the + * surrounding level run. But if you just rewrite the + * types of all those characters to BN and leave the + * levels in that state, then the modified algorithm will + * leave the middle two BN at level 2, dividing what + * should have been a long level run at level 0 into two + * separate ones. + */ + if (i > 0 && ctx->types[i-1] == BN) + ctx->levels[i] = ctx->levels[i-1]; + } + } +#else + /* + * Rule X9, original version: completely remove embedding + * start/end characters and also boundary neutrals. + */ + size_t outpos = 0; + for (size_t i = 0; i < ctx->textlen; i++) { + BidiType t = ctx->types[i]; + if (!typeIsRemovedDuringProcessing(t)) { + ctx->text[outpos] = ctx->text[i]; + ctx->levels[outpos] = ctx->levels[i]; + ctx->types[outpos] = ctx->types[i]; + ctx->origTypes[outpos] = ctx->origTypes[i]; + outpos++; + } + } + ctx->textlen = outpos; +#endif +} + +typedef void (*irs_fn_t)(BidiContext *ctx); + +static void find_isolating_run_sequences(BidiContext *ctx, irs_fn_t process) +{ + /* + * Rule X10 / BD13. Now that we've assigned an embedding level to + * each character in the text, we have to divide the text into + * subsequences on which to do the next stage of processing. + * + * In earlier issues of the bidi algorithm, these subsequences + * were contiguous in the original text, and each one was a 'level + * run': a maximal contiguous subsequence of characters all at the + * same embedding level. + * + * But now we have isolates, and the point of an (isolate + * initiator ... PDI) sequence is that the whole sequence should + * be treated like a single BN for the purposes of formatting + * everything outside it. As a result, we now have to recombine + * our level runs into longer sequences, on the principle that if + * a level run ends with an isolate initiator, then we bring it + * together with whatever later level run starts with the matching + * PDI. + * + * These subsequences are no longer contiguous (the whole point is + * that between the isolate initiator and the PDI is some other + * text that we've skipped over). They're called 'isolating run + * sequences'. + */ + + memset(ctx->irsdone, 0, ctx->textlen); + size_t i = 0; + size_t n_irs = 0; + size_t indexpos = 0; + while (i < ctx->textlen) { + if (ctx->irsdone[i]) { + i++; + continue; + } + + /* + * Found a character not already processed. Start a new + * sequence here. + */ + sgrowarray(ctx->irslist, ctx->irslistsize, n_irs); + IsolatingRunSequence *irs = &ctx->irslist[n_irs++]; + irs->start = indexpos; + size_t j = i; + size_t irslevel = ctx->levels[i]; + while (j < ctx->textlen) { + /* + * We expect that all level runs in this sequence will be + * at the same level as each other, by construction of how + * we set up the levels from the isolates in the first + * place. + */ + assert(ctx->levels[j] == irslevel); + + do { + ctx->irsdone[j] = true; + ctx->irsindices[indexpos++] = j++; + } while (j < ctx->textlen && ctx->levels[j] == irslevel); + if (!typeIsIsolateInitiator(ctx->types[j-1])) + break; /* this IRS is ended */ + j = find_matching_pdi(ctx->types, j-1, ctx->textlen); + } + irs->end = indexpos; + + /* + * Determine the start-of-sequence and end-of-sequence types + * for this sequence. + * + * These depend on the embedding levels of surrounding text. + * But processing each run can change those levels. That's why + * we have to use a two-pass strategy here, first identifying + * all the isolating run sequences using the input level data, + * and not processing any of them until we know where they all + * are. + */ + size_t p; + unsigned char level_inside, level_outside, level_max; + + p = i; + level_inside = ctx->levels[p]; + level_outside = ctx->paragraphLevel; + while (p > 0) { + p--; + if (ctx->types[p] != BN) { + level_outside = ctx->levels[p]; + break; + } + } + level_max = max(level_inside, level_outside); + irs->sos = (level_max % 2 ? R : L); + + p = ctx->irsindices[irs->end - 1]; + level_inside = ctx->levels[p]; + level_outside = ctx->paragraphLevel; + if (typeIsIsolateInitiator(ctx->types[p])) { + /* Special case: if an isolating run sequence ends in an + * unmatched isolate initiator, then level_outside is + * taken to be the paragraph embedding level and the + * loop below is skipped. */ + } else { + while (p+1 < ctx->textlen) { + p++; + if (ctx->types[p] != BN) { + level_outside = ctx->levels[p]; + break; + } + } + } + level_max = max(level_inside, level_outside); + irs->eos = (level_max % 2 ? R : L); + + irs->embeddingDirection = (irslevel % 2 ? R : L); + + /* + * Now we've listed in ctx->irsindices[] the index of every + * character that's part of this isolating run sequence, and + * recorded an entry in irslist containing the interval of + * indices relevant to this IRS, plus its assorted metadata. + * We've also marked those locations in the input text as done + * in ctx->irsdone, so that we'll skip over them when the + * outer iteration reaches them later. + */ + } + + for (size_t k = 0; k < n_irs; k++) { + IsolatingRunSequence *irs = &ctx->irslist[k]; + ctx->irs = ctx->irsindices + irs->start; + ctx->irslen = irs->end - irs->start; + ctx->sos = irs->sos; + ctx->eos = irs->eos; + ctx->embeddingDirection = irs->embeddingDirection; + process(ctx); + } + + /* Reset irslen to 0 when we've finished. This means any other + * functions that absentmindedly try to use irslen at all will end + * up doing nothing at all, which should be easier to detect and + * debug than if they run on subtly the wrong subset of the + * text. */ + ctx->irslen = 0; +} + +static void remove_nsm(BidiContext *ctx) +{ + /* Rule W1: NSM gains the type of the previous character, or sos + * at the start of the run, with the exception that isolation + * boundaries turn into ON. */ + BidiType prevType = ctx->sos; + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (t == NSM) { + ctx->types[i] = prevType; + } else if (typeIsIsolateInitiatorOrPDI(t)) { + prevType = ON; +#ifndef REMOVE_FORMATTING_CHARS + } else if (t == BN) { + /* section 5.2 adjustment: these don't affect prevType */ +#endif + } else { + prevType = t; + } + } +} + +static void change_en_to_an(BidiContext *ctx) +{ + /* Rule W2: EN becomes AN if the previous strong type is AL. (The + * spec says that the 'previous strong type' is counted as sos at + * the start of the run, although it hardly matters, since sos + * can't be AL.) */ + BidiType prevStrongType = ctx->sos; + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (t == EN && prevStrongType == AL) { + ctx->types[i] = AN; + } else if (typeIsStrong(t)) { + prevStrongType = t; + } + } +} + +static void change_al_to_r(BidiContext *ctx) +{ + /* Rule W3: AL becomes R unconditionally. (The only difference + * between the two types was their effect on nearby numbers, which + * was dealt with in rule W2, so now we're done with the + * distinction.) */ + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + if (ctx->types[i] == AL) + ctx->types[i] = R; + } +} + +static void eliminate_separators_between_numbers(BidiContext *ctx) +{ + /* Rule W4: a single numeric separator between two numbers of the + * same type compatible with that separator takes the type of the + * number. ES is a separator type compatible only with EN; CS is a + * separator type compatible with either EN or AN. + * + * Section 5.2 adjustment: intervening BNs do not break this, so + * instead of simply looking at types[irs[c-1]] and types[irs[c+1]], + * we must track the last three indices we saw that were not BN. */ + size_t i1 = 0, i2 = 0; + BidiType t0 = ON, t1 = ON, t2 = ON; + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + +#ifndef REMOVE_FORMATTING_CHARS + if (t == BN) + continue; +#endif + + i1 = i2; i2 = i; + t0 = t1; t1 = t2; t2 = t; + if (t0 == t2 && ((t1 == ES && t0 == EN) || + (t1 == CS && (t0 == EN || t0 == AN)))) { + ctx->types[i1] = t0; + } + } +} + +static void eliminate_et_next_to_en(BidiContext *ctx) +{ + /* Rule W5: a sequence of ET adjacent to an EN take the type EN. + * This is easiest to implement with one loop in each direction. + * + * Section 5.2 adjustment: include BN with ET. (We don't need to + * #ifdef that out, because in the standard algorithm, we won't + * have any BN left in any case.) */ + + bool modifying = false; + + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (t == EN) { + modifying = true; + } else if (modifying && typeIsETOrBN(t)) { + ctx->types[i] = EN; + } else { + modifying = false; + } + } + + for (size_t c = ctx->irslen; c-- > 0 ;) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (t == EN) { + modifying = true; + } else if (modifying && typeIsETOrBN(t)) { + ctx->types[i] = EN; + } else { + modifying = false; + } + } +} + +static void eliminate_separators_and_terminators(BidiContext *ctx) +{ + /* Rule W6: all separators and terminators change to ON. + * + * (The spec is not quite clear on which bidi types are included + * in this; one assumes ES, ET and CS, but what about S? I _think_ + * the answer is that this is a rule in the W section, so it's + * implicitly supposed to only apply to types designated as weakly + * directional, so not S.) */ + +#ifndef REMOVE_FORMATTING_CHARS + /* + * Section 5.2 adjustment: this also applies to any BN adjacent on + * either side to one of these types, which is easiest to + * implement with a separate double-loop converting those to an + * arbitrary one of the affected types, say CS. + * + * This double loop can be completely skipped in the standard + * algorithm. + */ + bool modifying = false; + + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (typeIsWeakSeparatorOrTerminator(t)) { + modifying = true; + } else if (modifying && t == BN) { + ctx->types[i] = CS; + } else { + modifying = false; + } + } + + for (size_t c = ctx->irslen; c-- > 0 ;) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (typeIsWeakSeparatorOrTerminator(t)) { + modifying = true; + } else if (modifying && t == BN) { + ctx->types[i] = CS; + } else { + modifying = false; + } + } +#endif + + /* Now the main part of rule W6 */ + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (typeIsWeakSeparatorOrTerminator(t)) + ctx->types[i] = ON; + } +} + +static void change_en_to_l(BidiContext *ctx) +{ + /* Rule W7: EN becomes L if the previous strong type (or sos) is L. */ + BidiType prevStrongType = ctx->sos; + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (t == EN && prevStrongType == L) { + ctx->types[i] = L; + } else if (typeIsStrong(t)) { + prevStrongType = t; + } + } +} + +typedef void (*bracket_pair_fn)(BidiContext *ctx, size_t copen, size_t cclose); + +static void find_bracket_pairs(BidiContext *ctx, bracket_pair_fn process) +{ + const size_t NO_BRACKET = ~(size_t)0; + + /* + * Rule BD16. + */ + size_t sp = 0; + for (size_t c = 0; c < ctx->irslen; c++) + ctx->bracketpos[c] = NO_BRACKET; + + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + unsigned wc = ctx->text[i].wc; + BracketTypeData bt = bracket_type(wc); + if (bt.type == BT_OPEN) { + if (sp >= lenof(ctx->bstack)) { + /* + * Stack overflow. The spec says we simply give up at + * this point. + */ + goto found_all_pairs; + } + + ctx->bstack[sp].ch = wc; + ctx->bstack[sp].c = c; + sp++; + } else if (bt.type == BT_CLOSE) { + size_t new_sp = sp; + + /* + * Search up the stack for an entry containing a matching + * open bracket. If we find it, pop that entry and + * everything deeper, and record a matching pair. If we + * reach the bottom of the stack without finding anything, + * leave sp where it started. + */ + while (new_sp-- > 0) { + if (ctx->bstack[new_sp].ch == bt.partner || + ctx->bstack[new_sp].ch == bt.equiv_partner) { + /* Found a stack element matching this one */ + size_t cstart = ctx->bstack[new_sp].c; + ctx->bracketpos[cstart] = c; + sp = new_sp; + break; + } + } + } + } + + found_all_pairs: + for (size_t c = 0; c < ctx->irslen; c++) { + if (ctx->bracketpos[c] != NO_BRACKET) { + process(ctx, c, ctx->bracketpos[c]); + } + } +} + +static BidiType get_bracket_type(BidiContext *ctx, size_t copen, size_t cclose) +{ + /* + * Rule N0: a pair of matched brackets containing at least one + * strong type takes on the current embedding direction, unless + * all of these are true at once: + * + * (a) there are no strong types inside the brackets matching the + * current embedding direction + * (b) there _is_ at least one strong type inside the brackets + * that is _opposite_ to the current embedding direction + * (c) the strong type preceding the open bracket is also + * opposite to the current embedding direction + * + * in which case they take on the opposite direction. + * + * For these purposes, number types (EN and AN) count as R. + */ + + bool foundOppositeTypeInside = false; + for (size_t c = copen + 1; c < cclose; c++) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (typeIsStrongOrNumber(t)) { + t = t == L ? L : R; /* numbers count as R */ + if (t == ctx->embeddingDirection) { + /* Found something inside the brackets matching the + * current level, so (a) is violated. */ + return ctx->embeddingDirection; + } else { + foundOppositeTypeInside = true; + } + } + } + + if (!foundOppositeTypeInside) { + /* No strong types at all inside the brackets, so return ON to + * indicate that we're not messing with their type at all. */ + return ON; + } + + /* There was an opposite strong type in the brackets. Look + * backwards to the preceding strong type, and go with that, + * whichever it is. */ + for (size_t c = copen; c-- > 0 ;) { + size_t i = ctx->irs[c]; + BidiType t = ctx->types[i]; + if (typeIsStrongOrNumber(t)) { + t = t == L ? L : R; /* numbers count as R */ + return t; + } + } + + /* Fallback: if the preceding strong type was not found, go with + * sos. */ + return ctx->sos; +} + +static void reset_bracket_type(BidiContext *ctx, size_t c, BidiType t) +{ + /* Final bullet point of rule N0: when we change the type of a + * bracket, the same change applies to any contiguous sequence of + * characters after it whose _original_ bidi type was NSM. */ + do { + ctx->types[ctx->irs[c++]] = t; + +#ifndef REMOVE_FORMATTING_CHARS + while (c < ctx->irslen && ctx->origTypes[ctx->irs[c]] == BN) { + /* Section 5.2 adjustment: skip past BN in the process. */ + c++; + } +#endif + } while (c < ctx->irslen && ctx->origTypes[ctx->irs[c]] == NSM); +} + +static void resolve_brackets(BidiContext *ctx, size_t copen, size_t cclose) +{ + if (typeIsNeutral(ctx->types[ctx->irs[copen]]) && + typeIsNeutral(ctx->types[ctx->irs[cclose]])) { + BidiType t = get_bracket_type(ctx, copen, cclose); + if (t != ON) { + reset_bracket_type(ctx, copen, t); + reset_bracket_type(ctx, cclose, t); + } + } +} + +static void remove_ni(BidiContext *ctx) +{ + /* + * Rules N1 and N2 together: neutral or isolate characters take + * the direction of the surrounding strong text if the nearest + * strong characters on each side match, and otherwise, they take + * the embedding direction. + */ + const size_t NO_INDEX = ~(size_t)0; + BidiType prevStrongType = ctx->sos; + size_t c_ni_start = NO_INDEX; + for (size_t c = 0; c <= ctx->irslen; c++) { + BidiType t; + + if (c < ctx->irslen) { + size_t i = ctx->irs[c]; + t = ctx->types[i]; + } else { + /* One extra loop iteration, using eos to resolve the + * final sequence of NI if any */ + t = ctx->eos; + } + + if (typeIsStrongOrNumber(t)) { + t = t == L ? L : R; /* numbers count as R */ + if (c_ni_start != NO_INDEX) { + /* There are some NI we have to fix up */ + BidiType ni_type = (t == prevStrongType ? t : + ctx->embeddingDirection); + for (size_t c2 = c_ni_start; c2 < c; c2++) { + size_t i2 = ctx->irs[c2]; + BidiType t2 = ctx->types[i2]; + if (typeIsNeutralOrIsolate(t2)) + ctx->types[i2] = ni_type; + } + } + prevStrongType = t; + c_ni_start = NO_INDEX; + } else if (typeIsNeutralOrIsolate(t) && c_ni_start == NO_INDEX) { + c_ni_start = c; + } + } +} + +static void resolve_implicit_levels(BidiContext *ctx) +{ + /* Rules I1 and I2 */ + for (size_t c = 0; c < ctx->irslen; c++) { + size_t i = ctx->irs[c]; + unsigned char level = ctx->levels[i]; + BidiType t = ctx->types[i]; + if (level % 2 == 0) { + /* Rule I1 */ + if (t == R) + ctx->levels[i] += 1; + else if (t == AN || t == EN) + ctx->levels[i] += 2; + } else { + /* Rule I2 */ + if (t == L || t == AN || t == EN) + ctx->levels[i] += 1; + } + } +} + +static void process_isolating_run_sequence(BidiContext *ctx) +{ + /* Section W: resolve weak types */ + remove_nsm(ctx); + change_en_to_an(ctx); + change_al_to_r(ctx); + eliminate_separators_between_numbers(ctx); + eliminate_et_next_to_en(ctx); + eliminate_separators_and_terminators(ctx); + change_en_to_l(ctx); + + /* Section N: resolve neutral types (and isolates) */ + find_bracket_pairs(ctx, resolve_brackets); + remove_ni(ctx); + + /* Section I: resolve implicit levels */ + resolve_implicit_levels(ctx); +} + +static void reset_whitespace_and_separators(BidiContext *ctx) +{ + /* + * Rule L1: segment and paragraph separators, plus whitespace + * preceding them, all reset to the paragraph embedding level. + * This also applies to whitespace at the very end. + * + * This is done using the original types, not the versions that + * the rest of this algorithm has been merrily mutating. + */ + bool modifying = true; + for (size_t i = ctx->textlen; i-- > 0 ;) { + BidiType t = ctx->origTypes[i]; + if (typeIsSegmentOrParaSeparator(t)) { + ctx->levels[i] = ctx->paragraphLevel; + modifying = true; + } else if (modifying) { + if (typeIsWhitespaceOrIsolate(t)) { + ctx->levels[i] = ctx->paragraphLevel; + } else if (!typeIsRemovedDuringProcessing(t)) { + modifying = false; + } + } + } + +#ifndef REMOVE_FORMATTING_CHARS + /* + * Section 5.2 adjustment: types removed by rule X9 take the level + * of the character to their left. + */ + for (size_t i = 0; i < ctx->textlen; i++) { + BidiType t = ctx->origTypes[i]; + if (typeIsRemovedDuringProcessing(t)) { + /* Section 5.2 adjustment */ + ctx->levels[i] = (i > 0 ? ctx->levels[i-1] : ctx->paragraphLevel); + } + } +#endif /* ! REMOVE_FORMATTING_CHARS */ +} + +static void reverse(BidiContext *ctx, size_t start, size_t end) +{ + for (size_t i = start, j = end; i < j; i++, j--) { + bidi_char tmp = ctx->text[i]; + ctx->text[i] = ctx->text[j]; + ctx->text[j] = tmp; + } +} + +static void mirror_glyphs(BidiContext *ctx) +{ + /* + * Rule L3: any character with a mirror-image pair at an odd + * embedding level is replaced by its mirror image. + * + * This is specified in the standard as happening _after_ rule L2 + * (the actual reordering of the text). But it's much easier to + * implement it before, while our levels[] array still matches up + * to the text order. + */ + for (size_t i = 0; i < ctx->textlen; i++) { + if (ctx->levels[i] % 2) + ctx->text[i].wc = mirror_glyph(ctx->text[i].wc); + } +} + +static void reverse_sequences(BidiContext *ctx) +{ + /* + * Rule L2: every maximal contiguous sequence of characters at a + * given level or higher is reversed. + */ + unsigned level = 0; + for (size_t i = 0; i < ctx->textlen; i++) + level = max(level, ctx->levels[i]); + + for (; level >= 1; level--) { + for (size_t i = 0; i < ctx->textlen; i++) { + if (ctx->levels[i] >= level) { + size_t start = i; + while (i+1 < ctx->textlen && ctx->levels[i+1] >= level) + i++; + reverse(ctx, start, i); + } + } + } +} + +/* + * The Main Bidi Function, and the only function that should be used + * by the outside world. + * + * text: a buffer of size textlen containing text to apply the + * Bidirectional algorithm to. + */ +void do_bidi_new(BidiContext *ctx, bidi_char *text, size_t textlen) +{ + ensure_arrays(ctx, textlen); + ctx->text = text; + ctx->textlen = textlen; + setup_types(ctx); + + /* Quick initial test: see if we need to bother with any work at all */ + if (!text_needs_bidi(ctx)) + return; + + set_paragraph_level(ctx); + process_explicit_embeddings(ctx); + remove_embedding_characters(ctx); + find_isolating_run_sequences(ctx, process_isolating_run_sequence); + + /* If this implementation distinguished paragraphs from lines, + * then this would be the point where we repeat the remainder of + * the algorithm once for each line in the paragraph. */ + + reset_whitespace_and_separators(ctx); + mirror_glyphs(ctx); + reverse_sequences(ctx); +} + +size_t do_bidi_test(BidiContext *ctx, bidi_char *text, size_t textlen, + int override) +{ + ctx->paragraphOverride = (override > 0 ? L : override < 0 ? R : ON); + do_bidi_new(ctx, text, textlen); + return ctx->textlen; +} + +void do_bidi(BidiContext *ctx, bidi_char *text, size_t textlen) +{ +#ifdef REMOVE_FORMATTING_CHARACTERS + abort(); /* can't use the standard algorithm in a live terminal */ +#else + ctx->paragraphOverride = ON; + do_bidi_new(ctx, text, textlen); +#endif +} diff --git a/code/terminal/bidi.h b/code/terminal/bidi.h new file mode 100644 index 0000000..90d68e5 --- /dev/null +++ b/code/terminal/bidi.h @@ -0,0 +1,147 @@ +/* + * Header file shared between bidi.c and its tests. Not used by + * anything outside the bidi subsystem. + */ + +#ifndef PUTTY_BIDI_H +#define PUTTY_BIDI_H + +#define LMASK 0x3F /* Embedding Level mask */ +#define OMASK 0xC0 /* Override mask */ +#define OISL 0x80 /* Override is L */ +#define OISR 0x40 /* Override is R */ + +/* Shaping Helpers */ +#define STYPE(xh) ((((xh) >= SHAPE_FIRST) && ((xh) <= SHAPE_LAST)) ? \ +shapetypes[(xh)-SHAPE_FIRST].type : SU) /*))*/ +#define SISOLATED(xh) (shapetypes[(xh)-SHAPE_FIRST].form_b) +#define SFINAL(xh) ((xh)+1) +#define SINITIAL(xh) ((xh)+2) +#define SMEDIAL(ch) ((ch)+3) + +#define leastGreaterOdd(x) ( ((x)+1) | 1 ) +#define leastGreaterEven(x) ( ((x)+2) &~ 1 ) + +/* Function declarations used outside bidi.c */ +unsigned char bidi_getType(int ch); + +/* Bidi character types */ +#define BIDI_CHAR_TYPE_LIST(X) \ + X(L) \ + X(LRE) \ + X(LRO) \ + X(LRI) \ + X(R) \ + X(AL) \ + X(RLE) \ + X(RLO) \ + X(RLI) \ + X(PDF) \ + X(PDI) \ + X(FSI) \ + X(EN) \ + X(ES) \ + X(ET) \ + X(AN) \ + X(CS) \ + X(NSM) \ + X(BN) \ + X(B) \ + X(S) \ + X(WS) \ + X(ON) \ + /* end of list */ + +/* Shaping Types */ +#define SHAPING_CHAR_TYPE_LIST(X) \ + X(SL) /* Left-Joining, doesn't exist in U+0600 - U+06FF */ \ + X(SR) /* Right-Joining, ie has Isolated, Final */ \ + X(SD) /* Dual-Joining, ie has Isolated, Final, Initial, Medial */ \ + X(SU) /* Non-Joining */ \ + X(SC) /* Join-Causing, like U+0640 (TATWEEL) */ \ + /* end of list */ + +#define ENUM_DECL(name) name, +typedef enum { BIDI_CHAR_TYPE_LIST(ENUM_DECL) N_BIDI_TYPES } BidiType; +typedef enum { SHAPING_CHAR_TYPE_LIST(ENUM_DECL) N_SHAPING_TYPES } ShapingType; +#undef ENUM_DECL + +static inline bool typeIsStrong(BidiType t) +{ + return ((1< +#include + +#include "putty.h" +#include "misc.h" +#include "bidi.h" + +void out_of_memory(void) +{ + fprintf(stderr, "out of memory!\n"); + exit(2); +} + +#define TYPETONAME(X) #X, +static const char *const typenames[] = { BIDI_CHAR_TYPE_LIST(TYPETONAME) }; +#undef TYPETONAME + +int main(int argc, char **argv) +{ + int i; + + for (i = 1; i < argc; i++) { + unsigned long chr = strtoul(argv[i], NULL, 0); + int type = bidi_getType(chr); + printf("U+%04x: %s\n", (unsigned)chr, typenames[type]); + } + + return 0; +} diff --git a/code/terminal/bidi_test.c b/code/terminal/bidi_test.c new file mode 100644 index 0000000..1acd1d6 --- /dev/null +++ b/code/terminal/bidi_test.c @@ -0,0 +1,372 @@ +/* + * Test program that reads the Unicode bidi algorithm test case lists + * that form part of the Unicode Character Database: + * + * https://www.unicode.org/Public/UCD/latest/ucd/BidiTest.txt + * https://www.unicode.org/Public/UCD/latest/ucd/BidiCharacterTest.txt + */ + +#include + +#include "putty.h" +#include "misc.h" +#include "bidi.h" + +static int pass = 0, fail = 0; + +static BidiContext *ctx; + +static const char *extract_word(char **ptr) +{ + char *p = *ptr; + while (*p && isspace((unsigned char)*p)) p++; + + char *start = p; + while (*p && !isspace((unsigned char)*p)) p++; + + if (*p) { + *p++ = '\0'; + while (*p && isspace((unsigned char)*p)) p++; + } + + *ptr = p; + return start; +} + +#define TYPETONAME(X) #X, +static const char *const typenames[] = { BIDI_CHAR_TYPE_LIST(TYPETONAME) }; +#undef TYPETONAME + +static void run_test(const char *filename, unsigned lineno, + bidi_char *bcs, size_t bcs_len, + const unsigned *order, size_t order_len, + int override) +{ + size_t bcs_orig_len = bcs_len; + bidi_char *bcs_orig = snewn(bcs_orig_len, bidi_char); + if (bcs_orig_len) + memcpy(bcs_orig, bcs, bcs_orig_len * sizeof(bidi_char)); + + bcs_len = do_bidi_test(ctx, bcs, bcs_len, override); + + /* + * TR9 revision 44 rule X9 says we remove explicit embedding + * controls and BN characters. So the test cases don't list them + * in the expected outputs. Do the same to our own output - unless + * we're testing the standard version of the algorithm, in which + * case, we expect the output to be exactly as the test cases say. + */ + unsigned *our_order = snewn(bcs_len, unsigned); + size_t our_order_len = 0; + for (size_t i = 0; i < bcs_len; i++) { + BidiType t = bidi_getType(bcs[i].wc); +#ifndef REMOVE_FORMATTING_CHARS + if (typeIsRemovedDuringProcessing(t)) + continue; +#endif + our_order[our_order_len++] = bcs[i].index; + } + + bool ok = false; + if (our_order_len == order_len) { + ok = true; + for (size_t i = 0; i < our_order_len; i++) + if (our_order[i] != order[i]) + ok = false; + } + if (ok) { + pass++; + } else { + fail++; + printf("%s:%u: failed order\n", filename, lineno); + printf(" input chars:"); + for (size_t i = 0; i < bcs_orig_len; i++) + printf(" %04x", bcs_orig[i].wc); + printf("\n"); + printf(" classes: "); + for (size_t i = 0; i < bcs_orig_len; i++) + printf(" %-4s", typenames[bidi_getType(bcs_orig[i].wc)]); + printf("\n"); + printf(" para level = %s\n", + override > 0 ? "LTR" : override < 0 ? "RTL" : "auto"); + printf(" expected:"); + for (size_t i = 0; i < order_len; i++) + printf(" %u", order[i]); + printf("\n"); + printf(" got: "); + for (size_t i = 0; i < our_order_len; i++) + printf(" %u", our_order[i]); + printf("\n"); + } + + /* Put the original data back so we can re-test with another override */ + memcpy(bcs, bcs_orig, bcs_orig_len * sizeof(bidi_char)); + + sfree(bcs_orig); + sfree(our_order); +} + +static void class_test(const char *filename, FILE *fp) +{ + unsigned lineno = 0; + size_t bcs_size = 0, bcs_len = 0; + bidi_char *bcs = NULL; + size_t order_size = 0, order_len = 0; + unsigned *order = NULL; + + /* Preliminary: find a representative character of every bidi + * type. Prefer positive-width ones if available. */ + unsigned representatives[N_BIDI_TYPES]; + for (size_t i = 0; i < N_BIDI_TYPES; i++) + representatives[i] = 0; + for (unsigned uc = 1; uc < 0x110000; uc++) { + unsigned type = bidi_getType(uc); + if (!representatives[type] || + (mk_wcwidth(representatives[type]) <= 0 && mk_wcwidth(uc) > 0)) + representatives[type] = uc; + } + + while (true) { + lineno++; + char *line = chomp(fgetline(fp)); + if (!line) + break; + + /* Skip blank lines and comments */ + if (!line[0] || line[0] == '#') { + sfree(line); + continue; + } + + /* Parse @Reorder lines, which tell us the expected output + * order for all following test cases (until superseded) */ + if (strstartswith(line, "@Reorder:")) { + char *p = line; + extract_word(&p); /* eat the "@Reorder:" header itself */ + order_len = 0; + while (1) { + const char *word = extract_word(&p); + if (!*word) + break; + sgrowarray(order, order_size, order_len); + order[order_len++] = strtoul(word, NULL, 0); + } + + sfree(line); + continue; + } + + /* Skip @Levels lines, which we don't (yet?) do anything with */ + if (strstartswith(line, "@Levels:")) { + sfree(line); + continue; + } + + /* Everything remaining should be an actual test */ + char *semicolon = strchr(line, ';'); + if (!semicolon) { + printf("%s:%u: bad test line': no bitmap\n", filename, lineno); + sfree(line); + continue; + } + *semicolon++ = '\0'; + unsigned bitmask = strtoul(semicolon, NULL, 0); + char *p = line; + bcs_len = 0; + bool test_ok = true; + while (1) { + const char *word = extract_word(&p); + if (!*word) + break; + unsigned type; + for (type = 0; type < N_BIDI_TYPES; type++) + if (!strcmp(word, typenames[type])) + break; + if (type == N_BIDI_TYPES) { + printf("%s:%u: bad test line: bad bidi type '%s'\n", + filename, lineno, word); + test_ok = false; + break; + } + sgrowarray(bcs, bcs_size, bcs_len); + bcs[bcs_len].wc = representatives[type]; + bcs[bcs_len].origwc = bcs[bcs_len].wc; + bcs[bcs_len].index = bcs_len; + bcs[bcs_len].nchars = 1; + bcs_len++; + } + + if (!test_ok) { + sfree(line); + continue; + } + + if (bitmask & 1) + run_test(filename, lineno, bcs, bcs_len, order, order_len, 0); + if (bitmask & 2) + run_test(filename, lineno, bcs, bcs_len, order, order_len, +1); + if (bitmask & 4) + run_test(filename, lineno, bcs, bcs_len, order, order_len, -1); + + sfree(line); + } + + sfree(bcs); + sfree(order); +} + +static void char_test(const char *filename, FILE *fp) +{ + unsigned lineno = 0; + size_t bcs_size = 0, bcs_len = 0; + bidi_char *bcs = NULL; + size_t order_size = 0, order_len = 0; + unsigned *order = NULL; + + while (true) { + lineno++; + char *line = chomp(fgetline(fp)); + if (!line) + break; + + /* Skip blank lines and comments */ + if (!line[0] || line[0] == '#') { + sfree(line); + continue; + } + + /* Break each test line up into its main fields */ + ptrlen input_pl, para_dir_pl, order_pl; + { + ptrlen pl = ptrlen_from_asciz(line); + input_pl = ptrlen_get_word(&pl, ";"); + para_dir_pl = ptrlen_get_word(&pl, ";"); + ptrlen_get_word(&pl, ";"); /* paragraph level, which we ignore */ + ptrlen_get_word(&pl, ";"); /* embedding levels, which we ignore */ + order_pl = ptrlen_get_word(&pl, ";"); + } + + int override; + { + char *para_dir_str = mkstr(para_dir_pl); + unsigned para_dir = strtoul(para_dir_str, NULL, 0); + sfree(para_dir_str); + + override = (para_dir == 0 ? +1 : para_dir == 1 ? -1 : 0); + } + + /* Break up the input into Unicode characters */ + bcs_len = 0; + { + ptrlen pl = input_pl; + while (pl.len) { + ptrlen chr = ptrlen_get_word(&pl, " "); + char *chrstr = mkstr(chr); + sgrowarray(bcs, bcs_size, bcs_len); + bcs[bcs_len].wc = strtoul(chrstr, NULL, 16); + bcs[bcs_len].origwc = bcs[bcs_len].wc; + bcs[bcs_len].index = bcs_len; + bcs[bcs_len].nchars = 1; + bcs_len++; + sfree(chrstr); + } + } + + /* Ditto the expected output order */ + order_len = 0; + { + ptrlen pl = order_pl; + while (pl.len) { + ptrlen chr = ptrlen_get_word(&pl, " "); + char *chrstr = mkstr(chr); + sgrowarray(order, order_size, order_len); + order[order_len++] = strtoul(chrstr, NULL, 0); + sfree(chrstr); + } + } + + run_test(filename, lineno, bcs, bcs_len, order, order_len, override); + sfree(line); + } + + sfree(bcs); + sfree(order); +} + +void out_of_memory(void) +{ + fprintf(stderr, "out of memory!\n"); + exit(2); +} + +static void usage(FILE *fp) +{ + fprintf(fp, "\ +usage: bidi_test ( ( --class | --char ) infile... )...\n\ +e.g.: bidi_test --class BidiTest.txt --char BidiCharacterTest.txt\n\ +also: --help display this text\n\ +"); +} + +int main(int argc, char **argv) +{ + void (*testfn)(const char *, FILE *) = NULL; + bool doing_opts = true; + const char *filename = NULL; + bool done_something = false; + + ctx = bidi_new_context(); + + while (--argc > 0) { + const char *arg = *++argv; + if (doing_opts && arg[0] == '-' && arg[1]) { + if (!strcmp(arg, "--")) { + doing_opts = false; + } else if (!strcmp(arg, "--class")) { + testfn = class_test; + } else if (!strcmp(arg, "--char")) { + testfn = char_test; + } else if (!strcmp(arg, "--help")) { + usage(stdout); + return 0; + } else { + fprintf(stderr, "unrecognised option '%s'\n", arg); + return 1; + } + } else { + const char *filename = arg; + + if (!testfn) { + fprintf(stderr, "no mode argument provided before filename " + "'%s'\n", filename); + return 1; + } + + if (!strcmp(filename, "-")) { + testfn("", stdin); + } else { + FILE *fp = fopen(filename, "r"); + if (!fp) { + fprintf(stderr, "unable to open '%s'\n", filename); + return 1; + } + testfn(filename, fp); + fclose(fp); + } + done_something = true; + } + } + + if (!done_something) { + usage(stderr); + return 1; + } + + if (!filename) + filename = "-"; + + printf("pass %d fail %d total %d\n", pass, fail, pass + fail); + + bidi_free_context(ctx); + return fail != 0; +} diff --git a/code/terminal.c b/code/terminal/terminal.c similarity index 94% rename from code/terminal.c rename to code/terminal/terminal.c index f8f9417..59a3a96 100644 --- a/code/terminal.c +++ b/code/terminal/terminal.c @@ -98,8 +98,9 @@ static void deselect(Terminal *); static void term_print_finish(Terminal *); static void scroll(Terminal *, int, int, int, bool); static void parse_optionalrgb(optionalrgb *out, unsigned *values); -static void term_added_data(Terminal *term); +static void term_added_data(Terminal *term, bool); static void term_update_raw_mouse_mode(Terminal *term); +static void term_out_cb(void *); static termline *newtermline(Terminal *term, int cols, bool bce) { @@ -1219,6 +1220,12 @@ static void term_timer(void *ctx, unsigned long now) if (term->window_update_pending) term_update_callback(term); + + if (term->win_resize_pending == WIN_RESIZE_AWAIT_REPLY && + now == term->win_resize_timeout) { + term->win_resize_pending = WIN_RESIZE_NO; + queue_toplevel_callback(term_out_cb, term); + } } static void term_update_callback(void *ctx) @@ -1415,10 +1422,12 @@ void term_update(Terminal *term) term->win_move_pending_y); term->win_move_pending = false; } - if (term->win_resize_pending) { + if (term->win_resize_pending == WIN_RESIZE_NEED_SEND) { + term->win_resize_pending = WIN_RESIZE_AWAIT_REPLY; win_request_resize(term->win, term->win_resize_pending_w, term->win_resize_pending_h); - term->win_resize_pending = false; + term->win_resize_timeout = schedule_timer( + WIN_RESIZE_TIMEOUT, term_timer, term); } if (term->win_zorder_pending) { win_set_zorder(term->win, term->win_zorder_top); @@ -1433,11 +1442,13 @@ void term_update(Terminal *term) term->win_maximise_pending = false; } if (term->win_title_pending) { - win_set_title(term->win, term->window_title); + win_set_title(term->win, term->window_title, + term->wintitle_codepage); term->win_title_pending = false; } if (term->win_icon_title_pending) { - win_set_icon_title(term->win, term->icon_title); + win_set_icon_title(term->win, term->icon_title, + term->icontitle_codepage); term->win_icon_title_pending = false; } if (term->win_pointer_shape_pending) { @@ -1553,6 +1564,7 @@ void term_copy_stuff_from_conf(Terminal *term) term->crhaslf = conf_get_bool(term->conf, CONF_crhaslf); term->erase_to_scrollback = conf_get_bool(term->conf, CONF_erase_to_scrollback); term->funky_type = conf_get_int(term->conf, CONF_funky_type); + term->sharrow_type = conf_get_int(term->conf, CONF_sharrow_type); term->lfhascr = conf_get_bool(term->conf, CONF_lfhascr); term->logflush = conf_get_bool(term->conf, CONF_logflush); term->logtype = conf_get_int(term->conf, CONF_logtype); @@ -1670,6 +1682,7 @@ void term_reconfig(Terminal *term, Conf *conf) if (strcmp(old_title, new_title)) { sfree(term->window_title); term->window_title = dupstr(new_title); + term->wintitle_codepage = DEFAULT_CODEPAGE; term->win_title_pending = true; term_schedule_update(term); } @@ -1807,6 +1820,7 @@ void term_setup_window_titles(Terminal *term, const char *title_hostname) term->window_title = dupstr(appname); term->icon_title = dupstr(term->window_title); } + term->wintitle_codepage = term->icontitle_codepage = DEFAULT_CODEPAGE; term->win_title_pending = true; term->win_icon_title_pending = true; } @@ -1865,7 +1879,6 @@ static void palette_rebuild(Terminal *term) term->win_palette_pending_min = min_changed; term->win_palette_pending_limit = max_changed + 1; term_invalidate(term); - term_schedule_update(term); } } @@ -2033,12 +2046,13 @@ Terminal *term_init(Conf *myconf, struct unicode_data *ucsdata, TermWin *win) term->window_title = dupstr(""); term->icon_title = dupstr(""); + term->wintitle_codepage = term->icontitle_codepage = DEFAULT_CODEPAGE; term->minimised = false; term->winpos_x = term->winpos_y = 0; term->winpixsize_x = term->winpixsize_y = 0; term->win_move_pending = false; - term->win_resize_pending = false; + term->win_resize_pending = WIN_RESIZE_NO; term->win_zorder_pending = false; term->win_minimise_pending = false; term->win_maximise_pending = false; @@ -2049,6 +2063,8 @@ Terminal *term_init(Conf *myconf, struct unicode_data *ucsdata, TermWin *win) term->win_scrollbar_update_pending = false; term->win_palette_pending = false; + term->bidi_ctx = bidi_new_context(); + palette_reset(term, false); return term; @@ -2108,6 +2124,8 @@ void term_free(Terminal *term) sfree(term->window_title); sfree(term->icon_title); + bidi_free_context(term->bidi_ctx); + sfree(term); } @@ -2133,6 +2151,14 @@ void term_size(Terminal *term, int newrows, int newcols, int newsavelines) int sblen; int save_alt_which = term->alt_which; + /* If we were holding buffered terminal data because we were + * waiting for confirmation of a resize, queue a callback to start + * processing it again. */ + if (term->win_resize_pending == WIN_RESIZE_AWAIT_REPLY) { + term->win_resize_pending = WIN_RESIZE_NO; + queue_toplevel_callback(term_out_cb, term); + } + if (newrows == term->rows && newcols == term->cols && newsavelines == term->savelines) return; /* nothing to do */ @@ -2609,7 +2635,7 @@ static void scroll(Terminal *term, int topline, int botline, } resizeline(term, line, term->cols); clear_line(term, line); - check_trust_status(term, line); + line->trusted = false; addpos234(term->screen, line, botline); /* @@ -2963,6 +2989,17 @@ static void term_update_raw_mouse_mode(Terminal *term) term_schedule_update(term); } +static void term_request_resize(Terminal *term, int cols, int rows) +{ + if (term->cols == cols && term->rows == rows) + return; /* don't need to do anything */ + + term->win_resize_pending = WIN_RESIZE_NEED_SEND; + term->win_resize_pending_w = cols; + term->win_resize_pending_h = rows; + term_schedule_update(term); +} + /* * Toggle terminal mode `mode' to state `state'. (`query' indicates * whether the mode is a DEC private one or a normal one.) @@ -2986,12 +3023,8 @@ static void toggle_mode(Terminal *term, int mode, int query, bool state) break; case 3: /* DECCOLM: 80/132 columns */ deselect(term); - if (!term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = state ? 132 : 80; - term->win_resize_pending_h = term->rows; - term_schedule_update(term); - } + if (!term->no_remote_resize) + term_request_resize(term, state ? 132 : 80, term->rows); term->reset_132 = state; term->alt_t = term->marg_t = 0; term->alt_b = term->marg_b = term->rows - 1; @@ -3114,6 +3147,7 @@ static void do_osc(Terminal *term) if (!term->no_remote_wintitle) { sfree(term->icon_title); term->icon_title = dupstr(term->osc_string); + term->icontitle_codepage = term->ucsdata->line_codepage; term->win_icon_title_pending = true; term_schedule_update(term); } @@ -3125,6 +3159,7 @@ static void do_osc(Terminal *term) if (!term->no_remote_wintitle) { sfree(term->window_title); term->window_title = dupstr(term->osc_string); + term->wintitle_codepage = term->ucsdata->line_codepage; term->win_title_pending = true; term_schedule_update(term); } @@ -3456,7 +3491,7 @@ static inline void term_keyinput_internal( int true_len = len >= 0 ? len : strlen(buf); bufchain_add(&term->inbuf, buf, true_len); - term_added_data(term); + term_added_data(term, false); } if (interactive) term_bracketed_paste_stop(term); @@ -3604,31 +3639,76 @@ unsigned long term_translate( * in-memory display. There's a big state machine in here to * process escape sequences... */ -static void term_out(Terminal *term) +static void term_out(Terminal *term, bool called_from_term_data) { unsigned long c; int unget; - unsigned char localbuf[256], *chars; - size_t nchars = 0; + const unsigned char *chars; + size_t nchars_got = 0, nchars_used = 0; + + /* + * During drag-selects, we do not process terminal input, because + * the user will want the screen to hold still to be selected. + */ + if (term->selstate == DRAGGING) + return; unget = -1; chars = NULL; /* placate compiler warnings */ - while (nchars > 0 || unget != -1 || bufchain_size(&term->inbuf) > 0) { - if (unget == -1) { - if (nchars == 0) { + while (nchars_got < nchars_used || + unget != -1 || + bufchain_size(&term->inbuf) > 0) { + if (unget != -1) { + /* + * Handle a character we left in 'unget' the last time + * round this loop. This happens if a UTF-8 sequence is + * aborted early, by containing fewer continuation bytes + * than its introducer expected: the non-continuation byte + * that interrupted the sequence must now be processed + * as a fresh piece of input in its own right. + */ + c = unget; + unget = -1; + } else { + /* + * If we're waiting for a terminal resize triggered by an + * escape sequence, we defer processing the terminal + * output until we receive acknowledgment from the front + * end that the resize has happened, so that further + * output will be processed in the context of the new + * size. + * + * This test goes inside the main while-loop, so that we + * exit early if we encounter a resize escape sequence + * part way through term->inbuf. + * + * It's also in the branch of this if statement that + * doesn't deal with a character left in 'unget' by the + * previous loop iteration, because if we break out of + * this loop with an ungot character still pending, we'll + * lose it. (And in any case, if the previous thing that + * happened was a truncated UTF-8 sequence, then it won't + * have scheduled a pending resize.) + */ + if (term->win_resize_pending != WIN_RESIZE_NO) + break; + + if (nchars_got == nchars_used) { + /* Delete the previous chunk from the bufchain */ + bufchain_consume(&term->inbuf, nchars_used); + nchars_used = 0; + + if (bufchain_size(&term->inbuf) == 0) + break; /* no more data */ + ptrlen data = bufchain_prefix(&term->inbuf); - if (data.len > sizeof(localbuf)) - data.len = sizeof(localbuf); - memcpy(localbuf, data.ptr, data.len); - bufchain_consume(&term->inbuf, data.len); - nchars = data.len; - chars = localbuf; + chars = data.ptr; + nchars_got = data.len; assert(chars != NULL); - assert(nchars > 0); + assert(nchars_used < nchars_got); } - c = *chars++; - nchars--; + c = chars[nchars_used++]; /* * Optionally log the session traffic to a file. Useful for @@ -3636,9 +3716,6 @@ static void term_out(Terminal *term) */ if (term->logtype == LGTYP_DEBUG && term->logctx) logtraffic(term->logctx, (unsigned char) c, LGTYP_DEBUG); - } else { - c = unget; - unget = -1; } /* Note only VT220+ are 8-bit VT102 is seven bit, it shouldn't even @@ -3745,6 +3822,19 @@ static void term_out(Terminal *term) } break; case '\007': { /* BEL: Bell */ + if (term->termstate == SEEN_OSC || + term->termstate == SEEN_OSC_W) { + /* + * In an OSC context, BEL is one of the ways to terminate + * the whole sequence. We process it as such even if we + * haven't got into the final OSC_STRING state yet, so that + * OSC sequences without a string will be handled cleanly. + */ + do_osc(term); + term->termstate = TOPLEVEL; + break; + } + struct beeptime *newbeep; unsigned long ticks; @@ -3997,12 +4087,8 @@ static void term_out(Terminal *term) if (term->ldisc) /* cause ldisc to notice changes */ ldisc_echoedit_update(term->ldisc); if (term->reset_132) { - if (!term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = 80; - term->win_resize_pending_h = term->rows; - term_schedule_update(term); - } + if (!term->no_remote_resize) + term_request_resize(term, 80, term->rows); term->reset_132 = false; } if (term->scroll_on_disp) @@ -4637,13 +4723,8 @@ static void term_out(Terminal *term) && (term->esc_args[0] < 1 || term->esc_args[0] >= 24)) { compatibility(VT340TEXT); - if (!term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = term->cols; - term->win_resize_pending_h = - def(term->esc_args[0], 24); - term_schedule_update(term); - } + if (!term->no_remote_resize) + term_request_resize(term, term->cols, 24); deselect(term); } else if (term->esc_nargs >= 1 && term->esc_args[0] >= 1 && @@ -4701,14 +4782,12 @@ static void term_out(Terminal *term) case 8: if (term->esc_nargs >= 3 && !term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = + term_request_resize( + term, def(term->esc_args[2], - term->conf_width); - term->win_resize_pending_h = + term->conf_width), def(term->esc_args[1], - term->conf_height); - term_schedule_update(term); + term->conf_height)); } break; case 9: @@ -4823,13 +4902,11 @@ static void term_out(Terminal *term) */ compatibility(VT420); if (term->esc_nargs == 1 && term->esc_args[0] > 0) { - if (!term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = term->cols; - term->win_resize_pending_h = - def(term->esc_args[0], term->conf_height); - term_schedule_update(term); - } + if (!term->no_remote_resize) + term_request_resize( + term, + term->cols, + def(term->esc_args[0], term->conf_height)); deselect(term); } break; @@ -4841,13 +4918,11 @@ static void term_out(Terminal *term) */ compatibility(VT340TEXT); if (term->esc_nargs <= 1) { - if (!term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = - def(term->esc_args[0], term->conf_width); - term->win_resize_pending_h = term->rows; - term_schedule_update(term); - } + if (!term->no_remote_resize) + term_request_resize( + term, + def(term->esc_args[0], term->conf_width), + term->rows); deselect(term); } break; @@ -5052,13 +5127,10 @@ static void term_out(Terminal *term) * Well we should do a soft reset at this point ... */ if (!has_compat(VT420) && has_compat(VT100)) { - if (!term->no_remote_resize) { - term->win_resize_pending = true; - term->win_resize_pending_w = - term->reset_132 ? 132 : 80; - term->win_resize_pending_h = 24; - term_schedule_update(term); - } + if (!term->no_remote_resize) + term_request_resize(term, + term->reset_132 ? 132 : 80, + 24); } #endif break; @@ -5128,32 +5200,92 @@ static void term_out(Terminal *term) break; case OSC_STRING: /* - * This OSC stuff is EVIL. It takes just one character to get into - * sysline mode and it's not initially obvious how to get out. - * So I've added CR and LF as string aborts. - * This shouldn't effect compatibility as I believe embedded - * control characters are supposed to be interpreted (maybe?) - * and they don't display anything useful anyway. + * OSC sequences can be terminated or aborted in + * various ways. + * + * The official way to terminate an OSC, per written + * standards, is the String Terminator, SC. That can + * appear in a 7-bit two-character form ESC \, or as + * an 8-bit C1 control 0x9C. + * + * We only accept 0x9C in circumstances where it + * doesn't interfere with our main character set + * processing: so in ISO 8859-1, for example, the byte + * 0x9C is interpreted as ST, but in CP437 it's + * interpreted as an ordinary printing character (as + * it happens, the pound sign), because you might + * perfectly well want to put it in the window title + * like any other printing character. * - * -- RDB + * In particular, in UTF-8 mode, 0x9C is a perfectly + * valid continuation byte for an ordinary printing + * character, so we don't accept the C1 control form + * of ST unless it appears as a full UTF-8 character + * in its own right, i.e. bytes 0xC2 0x9C. + * + * BEL is also treated as a clean termination of OSC, + * which I believe was a behaviour introduced by + * xterm. + * + * To prevent run-on storage of OSC data forever if + * emission of a control sequence is interrupted, we + * also treat various control characters as illegal, + * so that they abort the OSC without processing it + * and return to TOPLEVEL state. These are CR, LF, and + * any ESC that is *not* followed by \. */ + if (c == '\012' || c == '\015') { + /* CR or LF aborts */ term->termstate = TOPLEVEL; - } else if (c == 0234 || c == '\007') { - /* - * These characters terminate the string; ST and BEL - * terminate the sequence and trigger instant - * processing of it, whereas ESC goes back to SEEN_ESC - * mode unless it is followed by \, in which case it is - * synonymous with ST in the first place. - */ + break; + } + + if (c == '\033') { + /* ESC goes into a state where we wait to see if + * the next character is \ */ + term->termstate = OSC_MAYBE_ST; + break; + } + + if (c == '\007' || (c == 0x9C && !in_utf(term) && + term->ucsdata->unitab_ctrl[c] != 0xFF)) { + /* BEL, or the C1 ST appearing as a one-byte + * encoding, cleanly terminates the OSC right here */ do_osc(term); term->termstate = TOPLEVEL; - } else if (c == '\033') - term->termstate = OSC_MAYBE_ST; - else if (term->osc_strlen < OSC_STR_MAX) + break; + } + + if (c == 0xC2 && in_utf(term)) { + /* 0xC2 is the UTF-8 character that might + * introduce the encoding of C1 ST */ + term->termstate = OSC_MAYBE_ST_UTF8; + break; + } + + /* Anything else gets added to the string */ + if (term->osc_strlen < OSC_STR_MAX) term->osc_string[term->osc_strlen++] = (char)c; break; + case OSC_MAYBE_ST_UTF8: + /* In UTF-8 mode, we've seen C2, so are we now seeing + * 9C? */ + if (c == 0x9C) { + /* Yes, so cleanly terminate the OSC */ + do_osc(term); + term->termstate = TOPLEVEL; + break; + } + /* No, so append the pending C2 byte to the OSC string + * followed by the current character, and go back to + * OSC string accumulation */ + if (term->osc_strlen < OSC_STR_MAX) + term->osc_string[term->osc_strlen++] = 0xC2; + if (term->osc_strlen < OSC_STR_MAX) + term->osc_string[term->osc_strlen++] = (char)c; + term->termstate = OSC_STRING; + break; case SEEN_OSC_P: { int max = (term->osc_strlen == 0 ? 21 : 15); int val; @@ -5468,11 +5600,22 @@ static void term_out(Terminal *term) } } + bufchain_consume(&term->inbuf, nchars_used); + + if (!called_from_term_data) + win_unthrottle(term->win, bufchain_size(&term->inbuf)); + term_print_flush(term); if (term->logflush && term->logctx) logflush(term->logctx); } +/* Wrapper on term_out with the right prototype to be a toplevel callback */ +void term_out_cb(void *ctx) +{ + term_out((Terminal *)ctx, false); +} + /* * Small subroutine to parse three consecutive escape-sequence * arguments representing a true-colour RGB triple into an @@ -5663,7 +5806,7 @@ static termchar *term_bidi_line(Terminal *term, struct termline *ldata, } if(!term->no_bidi) - do_bidi(term->wcFrom, nbc); + do_bidi(term->bidi_ctx, term->wcFrom, nbc); if(!term->no_arabicshaping) { do_shape(term->wcFrom, term->wcTo, nbc); @@ -6044,7 +6187,9 @@ static void do_paint(Terminal *term) if (!term->ucsdata->dbcs_screenfont && !dirty_line) { if (term->disptext[i]->chars[j].chr == tchar && - (term->disptext[i]->chars[j].attr &~ DATTR_MASK) == tattr) + (term->disptext[i]->chars[j].attr &~ DATTR_MASK)==tattr && + truecolour_equal( + term->disptext[i]->chars[j].truecolour, tc)) break_run = true; else if (!dirty_run && ccount == 1) break_run = true; @@ -7163,12 +7308,39 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked, * should make sure to write any pending output if one has just * finished. */ - if (term->selstate != DRAGGING) - term_out(term); + term_out(term, false); + term_schedule_update(term); +} + +void term_cancel_selection_drag(Terminal *term) +{ + /* + * In unusual circumstances, a mouse drag might be interrupted by + * something that steals the rest of the mouse gesture. An example + * is the GTK popup menu appearing. In that situation, we'll never + * receive the MA_RELEASE that finishes the DRAGGING state, which + * means terminal output could be suppressed indefinitely. Call + * this function from the front end in such situations to restore + * sensibleness. + */ + if (term->selstate == DRAGGING) + term->selstate = NO_SELECTION; + term_out(term, false); term_schedule_update(term); } -int format_arrow_key(char *buf, Terminal *term, int xkey, bool ctrl) +static int shift_bitmap(bool shift, bool ctrl, bool alt, bool *consumed_alt) +{ + int bitmap = (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0); + if (bitmap) + bitmap++; + if (alt && consumed_alt) + *consumed_alt = true; + return bitmap; +} + +int format_arrow_key(char *buf, Terminal *term, int xkey, + bool shift, bool ctrl, bool alt, bool *consumed_alt) { char *p = buf; @@ -7191,12 +7363,24 @@ int format_arrow_key(char *buf, Terminal *term, int xkey, bool ctrl) if (!term->app_keypad_keys) app_flg = 0; #endif - /* Useful mapping of Ctrl-arrows */ - if (ctrl) - app_flg = !app_flg; + + int bitmap = 0; + + /* Adjustment based on Shift, Ctrl and/or Alt */ + switch (term->sharrow_type) { + case SHARROW_APPLICATION: + if (ctrl) + app_flg = !app_flg; + break; + case SHARROW_BITMAP: + bitmap = shift_bitmap(shift, ctrl, alt, consumed_alt); + break; + } if (app_flg) p += sprintf(p, "\x1BO%c", xkey); + else if (bitmap) + p += sprintf(p, "\x1B[1;%d%c", bitmap, xkey); else p += sprintf(p, "\x1B[%c", xkey); } @@ -7205,7 +7389,7 @@ int format_arrow_key(char *buf, Terminal *term, int xkey, bool ctrl) } int format_function_key(char *buf, Terminal *term, int key_number, - bool shift, bool ctrl) + bool shift, bool ctrl, bool alt, bool *consumed_alt) { char *p = buf; @@ -7218,7 +7402,14 @@ int format_function_key(char *buf, Terminal *term, int key_number, assert(key_number > 0); assert(key_number < lenof(key_number_to_tilde_code)); - int index = (shift && key_number <= 10) ? key_number + 10 : key_number; + int index = key_number; + if (term->funky_type != FUNKY_XTERM_216 && term->funky_type != FUNKY_SCO) { + if (shift && index <= 10) { + shift = false; + index += 10; + } + } + int code = key_number_to_tilde_code[index]; if (term->funky_type == FUNKY_SCO) { @@ -7242,13 +7433,28 @@ int format_function_key(char *buf, Terminal *term, int key_number, p += sprintf(p, "\x1BO%c", code + 'P' - 11 - offt); } else if (term->funky_type == FUNKY_LINUX && code >= 11 && code <= 15) { p += sprintf(p, "\x1B[[%c", code + 'A' - 11); - } else if (term->funky_type == FUNKY_XTERM && code >= 11 && code <= 14) { + } else if ((term->funky_type == FUNKY_XTERM || + term->funky_type == FUNKY_XTERM_216) && + code >= 11 && code <= 14) { if (term->vt52_mode) p += sprintf(p, "\x1B%c", code + 'P' - 11); - else - p += sprintf(p, "\x1BO%c", code + 'P' - 11); + else { + int bitmap = 0; + if (term->funky_type == FUNKY_XTERM_216) + bitmap = shift_bitmap(shift, ctrl, alt, consumed_alt); + if (bitmap) + p += sprintf(p, "\x1B[1;%d%c", bitmap, code + 'P' - 11); + else + p += sprintf(p, "\x1BO%c", code + 'P' - 11); + } } else { - p += sprintf(p, "\x1B[%d~", code); + int bitmap = 0; + if (term->funky_type == FUNKY_XTERM_216) + bitmap = shift_bitmap(shift, ctrl, alt, consumed_alt); + if (bitmap) + p += sprintf(p, "\x1B[%d;%d~", code, bitmap); + else + p += sprintf(p, "\x1B[%d~", code); } return p - buf; @@ -7432,51 +7638,24 @@ void term_lost_clipboard_ownership(Terminal *term, int clipboard) * should make sure to write any pending output if one has just * finished. */ - if (term->selstate != DRAGGING) - term_out(term); + term_out(term, false); } -static void term_added_data(Terminal *term) +static void term_added_data(Terminal *term, bool called_from_term_data) { if (!term->in_term_out) { term->in_term_out = true; term_reset_cblink(term); - /* - * During drag-selects, we do not process terminal input, - * because the user will want the screen to hold still to - * be selected. - */ - if (term->selstate != DRAGGING) - term_out(term); + term_out(term, called_from_term_data); term->in_term_out = false; } } -size_t term_data(Terminal *term, bool is_stderr, const void *data, size_t len) +size_t term_data(Terminal *term, const void *data, size_t len) { bufchain_add(&term->inbuf, data, len); - term_added_data(term); - - /* - * term_out() always completely empties inbuf. Therefore, - * there's no reason at all to return anything other than zero - * from this function, because there _can't_ be a question of - * the remote side needing to wait until term_out() has cleared - * a backlog. - * - * This is a slightly suboptimal way to deal with SSH-2 - in - * principle, the window mechanism would allow us to continue - * to accept data on forwarded ports and X connections even - * while the terminal processing was going slowly - but we - * can't do the 100% right thing without moving the terminal - * processing into a separate thread, and that might hurt - * portability. So we manage stdout buffering the old SSH-1 way: - * if the terminal processing goes slowly, the whole SSH - * connection stops accepting data until it's ready. - * - * In practice, I can't imagine this causing serious trouble. - */ - return 0; + term_added_data(term, true); + return bufchain_size(&term->inbuf); } void term_provide_logctx(Terminal *term, LogContext *logctx) @@ -7515,21 +7694,51 @@ struct term_userpass_state { /* Tiny wrapper to make it easier to write lots of little strings */ static inline void term_write(Terminal *term, ptrlen data) { - term_data(term, false, data.ptr, data.len); + term_data(term, data.ptr, data.len); +} + +/* + * Signal that a prompts_t is done. This involves sending a + * notification to the caller, and also turning off our own callback + * that listens for more data arriving in the ldisc's input queue. + */ +static inline SeatPromptResult signal_prompts_t(Terminal *term, prompts_t *p, + SeatPromptResult spr) +{ + assert(p->callback && "Asynchronous userpass input requires a callback"); + queue_toplevel_callback(p->callback, p->callback_ctx); + if (term->ldisc) + ldisc_enable_prompt_callback(term->ldisc, NULL); + p->spr = spr; + return spr; } /* * Process some terminal data in the course of username/password * input. */ -int term_get_userpass_input(Terminal *term, prompts_t *p, bufchain *input) +SeatPromptResult term_get_userpass_input(Terminal *term, prompts_t *p) { + if (!term->ldisc) { + /* Can't handle interactive prompts without an ldisc */ + return signal_prompts_t(term, p, SPR_SW_ABORT( + "Terminal not prepared for interactive prompts")); + } + + if (p->spr.kind != SPRK_INCOMPLETE) { + /* We've already finished these prompts, so return the same + * result again */ + return p->spr; + } + struct term_userpass_state *s = (struct term_userpass_state *)p->data; + if (!s) { /* * First call. Set some stuff up. */ p->data = s = snew(struct term_userpass_state); + p->spr = SPR_INCOMPLETE; s->curr_prompt = 0; s->done_prompt = false; /* We only print the `name' caption if we have to... */ @@ -7568,12 +7777,26 @@ int term_get_userpass_input(Terminal *term, prompts_t *p, bufchain *input) /* Breaking out here ensures that the prompt is printed even * if we're now waiting for user data. */ - if (!input || !bufchain_size(input)) break; + if (!ldisc_has_input_buffered(term->ldisc)) + break; /* FIXME: should we be using local-line-editing code instead? */ - while (!finished_prompt && bufchain_size(input) > 0) { + while (!finished_prompt && ldisc_has_input_buffered(term->ldisc)) { + LdiscInputToken tok = ldisc_get_input_token(term->ldisc); + char c; - bufchain_fetch_consume(input, &c, 1); + if (tok.is_special) { + switch (tok.code) { + case SS_EOL: c = 13; break; + case SS_EC: c = 8; break; + case SS_IP: c = 3; break; + case SS_EOF: c = 3; break; + default: continue; + } + } else { + c = tok.chr; + } + switch (c) { case 10: case 13: @@ -7605,7 +7828,7 @@ int term_get_userpass_input(Terminal *term, prompts_t *p, bufchain *input) term_write(term, PTRLEN_LITERAL("\r\n")); sfree(s); p->data = NULL; - return 0; /* user abort */ + return signal_prompts_t(term, p, SPR_USER_ABORT); default: /* * This simplistic check for printability is disabled @@ -7625,11 +7848,12 @@ int term_get_userpass_input(Terminal *term, prompts_t *p, bufchain *input) } if (s->curr_prompt < p->n_prompts) { - return -1; /* more data required */ + ldisc_enable_prompt_callback(term->ldisc, p); + return SPR_INCOMPLETE; } else { sfree(s); p->data = NULL; - return +1; /* all done */ + return signal_prompts_t(term, p, SPR_OK); } } diff --git a/code/terminal.h b/code/terminal/terminal.h similarity index 86% rename from code/terminal.h rename to code/terminal/terminal.h index c463f7a..b2347f9 100644 --- a/code/terminal.h +++ b/code/terminal/terminal.h @@ -200,7 +200,7 @@ struct terminal_tag { DO_CTRLS, SEEN_OSC_P, - OSC_STRING, OSC_MAYBE_ST, + OSC_STRING, OSC_MAYBE_ST, OSC_MAYBE_ST_UTF8, VT52_ESC, VT52_Y1, VT52_Y2, @@ -317,7 +317,7 @@ struct terminal_tag { int conf_width; bool crhaslf; bool erase_to_scrollback; - int funky_type; + int funky_type, sharrow_type; bool lfhascr; bool logflush; int logtype; @@ -351,8 +351,11 @@ struct terminal_tag { int mouse_paste_clipboard; char *window_title, *icon_title; + int wintitle_codepage, icontitle_codepage; bool minimised; + BidiContext *bidi_ctx; + /* Multi-layered colour palette. The colours from Conf (plus the * default xterm-256 ones that don't have Conf ids at all) have * lowest priority, followed by platform overrides if any, @@ -378,8 +381,6 @@ struct terminal_tag { */ bool win_move_pending; int win_move_pending_x, win_move_pending_y; - bool win_resize_pending; - int win_resize_pending_w, win_resize_pending_h; bool win_zorder_pending; bool win_zorder_top; bool win_minimise_pending; @@ -393,6 +394,57 @@ struct terminal_tag { bool win_scrollbar_update_pending; bool win_palette_pending; unsigned win_palette_pending_min, win_palette_pending_limit; + + /* + * Unlike the rest of the above 'pending' flags, the one for + * window resizing has to be more complicated, because it's very + * likely that a server sending a window-resize escape sequence is + * going to follow it up immediately with further terminal output + * that draws a full-screen application expecting the terminal to + * be the new size. + * + * So, once we've requested a window resize from the TermWin, we + * have to stop processing terminal data until we get back the + * notification that our window really has changed size (or until + * we find out that it's not going to). + * + * Hence, window resizes go through a small state machine with two + * different kinds of 'pending'. NEED_SEND is the state where + * we've received an escape sequence asking for a new size but not + * yet sent it to the TermWin via win_request_resize; AWAIT_REPLY + * is the state where we've sent it to the TermWin and are + * expecting a call back to term_size(). + * + * So _both_ of those 'pending' states inhibit terminal output + * processing. + * + * (Hence, once we're in either state, we should never handle + * another resize sequence, so the only possible path through this + * state machine is to get all the way back to the ground state + * before doing anything else interesting.) + */ + enum { + WIN_RESIZE_NO, WIN_RESIZE_NEED_SEND, WIN_RESIZE_AWAIT_REPLY + } win_resize_pending; + int win_resize_pending_w, win_resize_pending_h; + + /* + * Not every frontend / TermWin implementation can be relied on + * 100% to reply to a resize request in a timely manner. (In X11 + * it's all asynchronous and goes via the window manager, and if + * your window manager is seriously unwell, you'd rather not have + * terminal windows start becoming unusable as a knock-on effect, + * since those are just the thing you might need to use for + * emergency WM maintenance!) So when we enter AWAIT_REPLY status, + * we also set a 5-second timer, after which we'll regretfully + * conclude that a resize is probably not going to happen after + * all. + * + * However, in non-emergency cases, the plan is that this + * shouldn't be needed, for one reason or another. + */ + long win_resize_timeout; + #define WIN_RESIZE_TIMEOUT (TICKSPERSEC*5) }; static inline bool in_utf(Terminal *term) diff --git a/code/test/agentmulti.py b/code/test/agentmulti.py new file mode 100644 index 0000000..019bf2b --- /dev/null +++ b/code/test/agentmulti.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +import argparse +import os +import random +import socket +import sys + +from ssh import * + +def make_connections(n): + connections = [] + + for _ in range(n): + s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + s.connect(os.environ["SSH_AUTH_SOCK"]) + connections.append(s) + + return connections + +def use_connection(s, idstring): + print("Trying {}...".format(idstring), end="") + sys.stdout.flush() + + s.send(ssh_string(ssh_byte(SSH2_AGENTC_EXTENSION) + ssh_string( + b"nonexistent-agent-extension@putty.projects.tartarus.org"))) + length = ssh_decode_uint32(s.recv(4)) + assert length < AGENT_MAX_MSGLEN + msg = s.recv(length) + msgtype = msg[0] + msgstring = ( + "SSH_AGENT_EXTENSION_FAILURE" if msgtype == SSH_AGENT_EXTENSION_FAILURE + else "SSH_AGENT_FAILURE" if msgtype == SSH_AGENT_FAILURE + else "type {:d}".format(msgtype)) + print("got", msgstring, "with {:d}-byte payload".format(len(msg)-1)) + +def randomly_use_connections(connections, iterations): + for _ in range(iterations): + index = random.randrange(0, len(connections)) + s = connections[index] + use_connection(connections[index], "#{:d}".format(index)) + +def main(): + parser = argparse.ArgumentParser( + description='Test handling of multiple agent connections.') + parser.add_argument("--nsockets", type=int, default=128, + help="Number of simultaneous connections to make.") + parser.add_argument("--ntries", type=int, default=1024, + help="Number of messages to send in total.") + args = parser.parse_args() + + connections = make_connections(args.nsockets) + randomly_use_connections(connections, args.ntries) + +if __name__ == '__main__': + main() diff --git a/code/test/cryptsuite.py b/code/test/cryptsuite.py index 757de67..4971a59 100644 --- a/code/test/cryptsuite.py +++ b/code/test/cryptsuite.py @@ -141,6 +141,14 @@ def mac_str(alg, key, message, cipher=None): def lcm(a, b): return a * b // gcd(a, b) +def get_implementations(alg): + return get_implementations_commasep(alg).decode("ASCII").split(",") + +def get_aes_impls(): + return [impl.rsplit("_", 1)[-1] + for impl in get_implementations("aes128_cbc") + if impl.startswith("aes128_cbc_")] + class MyTestBase(unittest.TestCase): "Intermediate class that adds useful helper methods." def assertEqualBin(self, x, y): @@ -1071,6 +1079,49 @@ def add(po, *args): add(po, p6, [p3,p4], 2) add(po, p, [p2,p5,p6], 2) + # Combined certificate for the moduli and generator orders of + # the three NIST curves, generated by contrib/proveprime.py + # (with some cosmetic tidying) + p256 = 2**256 - 2**224 + 2**192 + 2**96 - 1 + p384 = 2**384 - 2**128 - 2**96 + 2**32 - 1 + p521 = 2**521 - 1 + order256 = p256 - 0x4319055358e8617b0c46353d039cdaae + order384 = p384 - 0x389cb27e0bc8d21fa7e5f24cb74f58851313e696333ad68c + t = 0x5ae79787c40d069948033feb708f65a2fc44a36477663b851449048e16ec79bf6 + order521 = p521 - t + p0 = order384 // 12895580879789762060783039592702 + p1 = 1059392654943455286185473617842338478315215895509773412096307 + p2 = 55942463741690639 + p3 = 37344768852931 + p4 = order521 // 1898873518475180724503002533770555108536 + p5 = p4 // 994165722 + p6 = 144471089338257942164514676806340723 + p7 = p384 // 2054993070433694 + p8 = 1357291859799823621 + po = pockle_new() + add_small(po, 2, 3, 5, 11, 17, 19, 31, 41, 53, 67, 71, 109, 131, 149, + 157, 257, 521, 641, 1613, 2731, 3407, 6317, 8191, 8389, + 14461, 17449, 38189, 38557, 42641, 51481, 61681, 65537, + 133279, 248431, 312289, 409891, 490463, 858001, 6700417, + 187019741) + add(po, p3, [149, 11, 5, 3, 2], 3) + add(po, p2, [p3], 2) + add(po, p8, [6317, 67, 2, 2], 2) + add(po, p6, [133279, 14461, 109, 3], 7) + add(po, p1, [p2, 248431], 2) + add(po, order256, [187019741, 38189, 17449, 3407, 131, 71, 2, 2, 2, 2], + 7) + add(po, p256, [6700417, 490463, 65537, 641, 257, 17, 5, 5, 3, 2], 6) + add(po, p0, [p1], 2) + add(po, p7, [p8, 312289, 38557, 8389, 11, 2], 3) + add(po, p5, [p6, 19], 2) + add(po, order384, [p0], 2) + add(po, p384, [p7], 2) + add(po, p4, [p5], 2) + add(po, order521, [p4], 2) + add(po, p521, [858001, 409891, 61681, 51481, 42641, 8191, 2731, 1613, + 521, 157, 131, 53, 41, 31, 17, 11, 5, 5, 3, 2], 3) + def testPockleNegative(self): def add_small(po, p): self.assertEqual(pockle_add_small_prime(po, p), 'POCKLE_OK') @@ -1137,6 +1188,92 @@ def add_small(po, p): self.assertEqual(pockle_add_prime(po, 1, [2], 1), 'POCKLE_PRIME_SMALLER_THAN_2') + def testMillerRabin(self): + # A prime congruent to 3 mod 4, so M-R can only do one + # iteration: either a^{(p-1)/2} == +1, or -1. Either counts as + # a pass; the latter also means the number is potentially a + # primitive root. + n = 0xe76e6aaa42b5d7423aa4da5613eb21c3 + mr = miller_rabin_new(n) + self.assertEqual(miller_rabin_test(mr, 2), "passed+ppr") + self.assertEqual(miller_rabin_test(mr, 4), "passed") + + # The 'potential primitive root' test only means that M-R + # didn't _rule out_ the number being a primitive root, by + # finding that any of the powers _it tested_ less than n-1 + # came out to be 1. In this case, 2 really is a primitive + # root, but since 13 | n-1, the 13th powers mod n form a + # multiplicative subgroup. So 2^13 is not a primitive root, + # and yet, M-R can't tell the difference, because it only + # tried the exponent (n-1)/2, not the actual counterexample + # (n-1)/13. + self.assertEqual(miller_rabin_test(mr, 2**13), "passed+ppr") + + # A prime congruent to 1 mod a reasonably large power of 2, so + # M-R has lots of scope to have different things happen. 3 is + # a primitive root, so we expect that 3, 3^2, 3^4, ..., 3^256 + # should all pass for different reasons, with only the first + # of them returning passed+ppr. + n = 0xb1b65ebe489ff0ab4597bb67c3d22d01 + mr = miller_rabin_new(n) + w = 3 + self.assertEqual(miller_rabin_test(mr, w), "passed+ppr") + for i in range(1, 10): + w = w * w % n + self.assertEqual(miller_rabin_test(mr, w), "passed") + + # A prime with an _absurdly_ large power-of-2 factor in its + # multiplicative group. + n = 0x600000000000000000000000000000000000000000000001 + mr = miller_rabin_new(n) + w = 10 + self.assertEqual(miller_rabin_test(mr, w), "passed+ppr") + for i in range(1, 200): + w = w * w % n + self.assertEqual(miller_rabin_test(mr, w), "passed") + + # A blatantly composite number. But we still expect to see a + # pass if we give the witness 1 (which will give a maximal + # trailing string of 1s), or -1 (which will give -1 when + # raised to the maximal odd factor of n-1, or indeed any other + # odd power). + n = 0x1010101010101010101010101010101 + mr = miller_rabin_new(n) + self.assertEqual(miller_rabin_test(mr, 1), "passed") + self.assertEqual(miller_rabin_test(mr, n-1), "passed") + self.assertEqual(miller_rabin_test(mr, 2), "failed") + + # A Carmichael number, as a proper test that M-R detects + # things the Fermat test would not. + # + # (Its prime factorisation is 26823115100268314289505807 * + # 53646230200536628579011613 * 80469345300804942868517419, + # which is enough to re-check its Carmichaelness.) + n = 0xffffffffffffffffcf8032f3e044b4a8b1b1bf0b526538eae953d90f44d65511 + mr = miller_rabin_new(n) + self.assertEqual(miller_rabin_test(mr, 16), "passed") + assert(pow(2, n-1, n) == 1) # Fermat test would pass, but ... + self.assertEqual(miller_rabin_test(mr, 2), "failed") # ... this fails + + # A white-box test for the side-channel-safe M-R + # implementation, which has to check a^e against +-1 for every + # exponent e of the form floor((n-1) / power of 2), so as to + # avoid giving away exactly how many of the trailing values of + # that sequence are significant to the test. + # + # When the power of 2 is large enough that the division was + # not exact, the results of these comparisons are _not_ + # significant to the test, and we're required to ignore them! + # + # This pair of values has the property that none of the values + # legitimately computed by M-R is either +1 _or_ -1, but if + # you shift n-1 right by one too many bits (losing the lowest + # set bit of 0x6d00 to get 0x36), then _that_ power of the + # witness integer is -1. This should not cause a spurious pass. + n = 0x6d01 + mr = miller_rabin_new(n) + self.assertEqual(miller_rabin_test(mr, 0x251), "failed") + class crypt(MyTestBase): def testSSH1Fingerprint(self): # Example key and reference fingerprint value generated by @@ -1181,9 +1318,9 @@ def testAES(self): # reference implementation of AES in Python. ('Mostly' # independent in that it was written by me.) - def vector(cipher, key, iv, plaintext, ciphertext): - for suffix in "hw", "sw": - c = ssh_cipher_new("{}_{}".format(cipher, suffix)) + def vector(cipherbase, key, iv, plaintext, ciphertext): + for cipher in get_implementations(cipherbase): + c = ssh_cipher_new(cipher) if c is None: return # skip test if HW AES not available ssh_cipher_setkey(c, key) ssh_cipher_setiv(c, iv) @@ -1302,7 +1439,7 @@ def test(keylen, suffix, ivInteger): # We also test this at all three AES key lengths, in case the # core cipher routines are written separately for each one. - for suffix in "hw", "sw": + for suffix in get_aes_impls(): for keylen in [128, 192, 256]: hexTestValues = ["00000000", "00000001", "ffffffff"] for ivHexBytes in itertools.product(*([hexTestValues] * 4)): @@ -1325,7 +1462,7 @@ def testAESParallelism(self): for keylen in [128, 192, 256]: decryptions = [] - for suffix in "hw", "sw": + for suffix in get_aes_impls(): c = ssh_cipher_new("aes{:d}_cbc_{}".format(keylen, suffix)) if c is None: continue ssh_cipher_setkey(c, test_key[:keylen//8]) @@ -1493,23 +1630,11 @@ def testSSHCiphers(self): ("3des_ssh1", 24, 8, False, unhex('d5f1cc25b8fbc62de63590b9b92344adf6dd72753273ff0fb32d4dbc6af858529129f34242f3d557eed3a5c84204eb4f868474294964cf70df5d8f45dfccfc45')), ("des_cbc", 8, 8, True, unhex('051524e77fb40e109d9fffeceacf0f28c940e2f8415ddccc117020bdd2612af5036490b12085d0e46129919b8e499f51cb82a4b341d7a1a1ea3e65201ef248f6')), ("aes256_ctr", 32, 16, False, unhex('b87b35e819f60f0f398a37b05d7bcf0b04ad4ebe570bd08e8bfa8606bafb0db2cfcd82baf2ccceae5de1a3c1ae08a8b8fdd884fdc5092031ea8ce53333e62976')), - ("aes256_ctr_hw", 32, 16, False, unhex('b87b35e819f60f0f398a37b05d7bcf0b04ad4ebe570bd08e8bfa8606bafb0db2cfcd82baf2ccceae5de1a3c1ae08a8b8fdd884fdc5092031ea8ce53333e62976')), - ("aes256_ctr_sw", 32, 16, False, unhex('b87b35e819f60f0f398a37b05d7bcf0b04ad4ebe570bd08e8bfa8606bafb0db2cfcd82baf2ccceae5de1a3c1ae08a8b8fdd884fdc5092031ea8ce53333e62976')), ("aes256_cbc", 32, 16, True, unhex('381cbb2fbcc48118d0094540242bd990dd6af5b9a9890edd013d5cad2d904f34b9261c623a452f32ea60e5402919a77165df12862742f1059f8c4a862f0827c5')), - ("aes256_cbc_hw", 32, 16, True, unhex('381cbb2fbcc48118d0094540242bd990dd6af5b9a9890edd013d5cad2d904f34b9261c623a452f32ea60e5402919a77165df12862742f1059f8c4a862f0827c5')), - ("aes256_cbc_sw", 32, 16, True, unhex('381cbb2fbcc48118d0094540242bd990dd6af5b9a9890edd013d5cad2d904f34b9261c623a452f32ea60e5402919a77165df12862742f1059f8c4a862f0827c5')), ("aes192_ctr", 24, 16, False, unhex('06bcfa7ccf075d723e12b724695a571a0fad67c56287ea609c410ac12749c51bb96e27fa7e1c7ea3b14792bbbb8856efb0617ebec24a8e4a87340d820cf347b8')), - ("aes192_ctr_hw", 24, 16, False, unhex('06bcfa7ccf075d723e12b724695a571a0fad67c56287ea609c410ac12749c51bb96e27fa7e1c7ea3b14792bbbb8856efb0617ebec24a8e4a87340d820cf347b8')), - ("aes192_ctr_sw", 24, 16, False, unhex('06bcfa7ccf075d723e12b724695a571a0fad67c56287ea609c410ac12749c51bb96e27fa7e1c7ea3b14792bbbb8856efb0617ebec24a8e4a87340d820cf347b8')), ("aes192_cbc", 24, 16, True, unhex('ac97f8698170f9c05341214bd7624d5d2efef8311596163dc597d9fe6c868971bd7557389974612cbf49ea4e7cc6cc302d4cc90519478dd88a4f09b530c141f3')), - ("aes192_cbc_hw", 24, 16, True, unhex('ac97f8698170f9c05341214bd7624d5d2efef8311596163dc597d9fe6c868971bd7557389974612cbf49ea4e7cc6cc302d4cc90519478dd88a4f09b530c141f3')), - ("aes192_cbc_sw", 24, 16, True, unhex('ac97f8698170f9c05341214bd7624d5d2efef8311596163dc597d9fe6c868971bd7557389974612cbf49ea4e7cc6cc302d4cc90519478dd88a4f09b530c141f3')), ("aes128_ctr", 16, 16, False, unhex('0ad4ddfd2360ec59d77dcb9a981f92109437c68c5e7f02f92017d9f424f89ab7850473ac0e19274125e740f252c84ad1f6ad138b6020a03bdaba2f3a7378ce1e')), - ("aes128_ctr_hw", 16, 16, False, unhex('0ad4ddfd2360ec59d77dcb9a981f92109437c68c5e7f02f92017d9f424f89ab7850473ac0e19274125e740f252c84ad1f6ad138b6020a03bdaba2f3a7378ce1e')), - ("aes128_ctr_sw", 16, 16, False, unhex('0ad4ddfd2360ec59d77dcb9a981f92109437c68c5e7f02f92017d9f424f89ab7850473ac0e19274125e740f252c84ad1f6ad138b6020a03bdaba2f3a7378ce1e')), ("aes128_cbc", 16, 16, True, unhex('36de36917fb7955a711c8b0bf149b29120a77524f393ae3490f4ce5b1d5ca2a0d7064ce3c38e267807438d12c0e40cd0d84134647f9f4a5b11804a0cc5070e62')), - ("aes128_cbc_hw", 16, 16, True, unhex('36de36917fb7955a711c8b0bf149b29120a77524f393ae3490f4ce5b1d5ca2a0d7064ce3c38e267807438d12c0e40cd0d84134647f9f4a5b11804a0cc5070e62')), - ("aes128_cbc_sw", 16, 16, True, unhex('36de36917fb7955a711c8b0bf149b29120a77524f393ae3490f4ce5b1d5ca2a0d7064ce3c38e267807438d12c0e40cd0d84134647f9f4a5b11804a0cc5070e62')), ("blowfish_ctr", 32, 8, False, unhex('079daf0f859363ccf72e975764d709232ec48adc74f88ccd1f342683f0bfa89ca0e8dbfccc8d4d99005d6b61e9cc4e6eaa2fd2a8163271b94bf08ef212129f01')), ("blowfish_ssh2", 16, 8, True, unhex('e986b7b01f17dfe80ee34cac81fa029b771ec0f859ae21ae3ec3df1674bc4ceb54a184c6c56c17dd2863c3e9c068e76fd9aef5673465995f0d648b0bb848017f')), ("blowfish_ssh1", 32, 8, True, unhex('d44092a9035d895acf564ba0365d19570fbb4f125d5a4fd2a1812ee6c8a1911a51bb181fbf7d1a261253cab71ee19346eb477b3e7ecf1d95dd941e635c1a4fbf')), @@ -1517,36 +1642,37 @@ def testSSHCiphers(self): ("arcfour128", 16, None, False, unhex('fd4af54c5642cb29629e50a15d22e4944e21ffba77d0543b27590eafffe3886686d1aefae0484afc9e67edc0e67eb176bbb5340af1919ea39adfe866d066dd05')), ] - for alg, keylen, ivlen, simple_cbc, c in ciphers: - cipher = ssh_cipher_new(alg) - if cipher is None: - continue # hardware-accelerated cipher not available - - ssh_cipher_setkey(cipher, k[:keylen]) - if ivlen is not None: - ssh_cipher_setiv(cipher, iv[:ivlen]) - self.assertEqualBin(ssh_cipher_encrypt(cipher, p), c) - - ssh_cipher_setkey(cipher, k[:keylen]) - if ivlen is not None: - ssh_cipher_setiv(cipher, iv[:ivlen]) - self.assertEqualBin(ssh_cipher_decrypt(cipher, c), p) - - if simple_cbc: - # CBC ciphers (other than the three-layered CBC used - # by SSH-1 3DES) have more specific semantics for - # their IV than 'some kind of starting state for the - # cipher mode': the IV is specifically supposed to - # represent the previous block of ciphertext. So we - # can check that, by supplying the IV _as_ a - # ciphertext block via a call to decrypt(), and seeing - # if that causes our test ciphertext to decrypt the - # same way as when we provided the same IV via - # setiv(). + for algbase, keylen, ivlen, simple_cbc, c in ciphers: + for alg in get_implementations(algbase): + cipher = ssh_cipher_new(alg) + if cipher is None: + continue # hardware-accelerated cipher not available + + ssh_cipher_setkey(cipher, k[:keylen]) + if ivlen is not None: + ssh_cipher_setiv(cipher, iv[:ivlen]) + self.assertEqualBin(ssh_cipher_encrypt(cipher, p), c) + ssh_cipher_setkey(cipher, k[:keylen]) - ssh_cipher_decrypt(cipher, iv[:ivlen]) + if ivlen is not None: + ssh_cipher_setiv(cipher, iv[:ivlen]) self.assertEqualBin(ssh_cipher_decrypt(cipher, c), p) + if simple_cbc: + # CBC ciphers (other than the three-layered CBC used + # by SSH-1 3DES) have more specific semantics for + # their IV than 'some kind of starting state for the + # cipher mode': the IV is specifically supposed to + # represent the previous block of ciphertext. So we + # can check that, by supplying the IV _as_ a + # ciphertext block via a call to decrypt(), and seeing + # if that causes our test ciphertext to decrypt the + # same way as when we provided the same IV via + # setiv(). + ssh_cipher_setkey(cipher, k[:keylen]) + ssh_cipher_decrypt(cipher, iv[:ivlen]) + self.assertEqualBin(ssh_cipher_decrypt(cipher, c), p) + def testRSAKex(self): # Round-trip test of the RSA key exchange functions, plus a # hardcoded plain/ciphertext pair to guard against the @@ -1980,6 +2106,20 @@ def testArgon2(self): "aeae2a21201eef5e347de22c922192e8f46274b0c9d33e965155a91e7686" "9d530e")) + def testOpenSSHBcrypt(self): + # Test case created by making an OpenSSH private key file + # using their own ssh-keygen, then decrypting it successfully + # using PuTTYgen and printing the inputs and outputs to + # openssh_bcrypt in the process. So this output key is known + # to agree with OpenSSH's own answer. + + self.assertEqualBin( + openssh_bcrypt('test passphrase', + unhex('d0c3b40ace4afeaf8c0f81202ae36718'), + 16, 48), + unhex('d78ba86e7273de0e007ab0ba256646823d5c902bc44293ae' + '78547e9a7f629be928cc78ff78a75a4feb7aa6f125079c7d')) + def testRSAVerify(self): def blobs(n, e, d, p, q, iqmp): pubblob = ssh_string(b"ssh-rsa") + ssh2_mpint(e) + ssh2_mpint(n) @@ -2324,7 +2464,7 @@ def testRSA1LoadSave(self): class standard_test_vectors(MyTestBase): def testAES(self): def vector(cipher, key, plaintext, ciphertext): - for suffix in "hw", "sw": + for suffix in get_aes_impls(): c = ssh_cipher_new("{}_{}".format(cipher, suffix)) if c is None: return # skip test if HW AES not available ssh_cipher_setkey(c, key) @@ -2540,7 +2680,7 @@ def testHmacMD5(self): unhex('56be34521d144c88dbb8c733f0e8b3f6')) def testSHA1(self): - for hashname in ['sha1_sw', 'sha1_hw']: + for hashname in get_implementations("sha1"): if ssh_hash_new(hashname) is None: continue # skip testing of unavailable HW implementation @@ -2577,7 +2717,7 @@ def testSHA1(self): "cb0082c8f197d260991ba6a460e76e202bad27b3")) def testSHA256(self): - for hashname in ['sha256_sw', 'sha256_hw']: + for hashname in get_implementations("sha256"): if ssh_hash_new(hashname) is None: continue # skip testing of unavailable HW implementation @@ -2621,36 +2761,36 @@ def testSHA256(self): "8ad3361763f7e9b2d95f4f0da6e1ccbc")) def testSHA384(self): - for hashname in ['sha384_sw', 'sha384_hw']: + for hashname in get_implementations("sha384"): if ssh_hash_new(hashname) is None: continue # skip testing of unavailable HW implementation # Test cases from RFC 6234 section 8.5, omitting the ones # whose input is not a multiple of 8 bits - self.assertEqualBin(hash_str('sha384', "abc"), unhex( + self.assertEqualBin(hash_str(hashname, "abc"), unhex( 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded163' '1a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7')) - self.assertEqualBin(hash_str('sha384', + self.assertEqualBin(hash_str(hashname, "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"), unhex('09330c33f71147e83d192fc782cd1b4753111b173b3b05d2' '2fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039')) - self.assertEqualBin(hash_str_iter('sha384', + self.assertEqualBin(hash_str_iter(hashname, ("a" * 1000 for _ in range(1000))), unhex( '9d0e1809716474cb086e834e310a4a1ced149e9c00f24852' '7972cec5704c2a5b07b8b3dc38ecc4ebae97ddd87f3d8985')) - self.assertEqualBin(hash_str('sha384', + self.assertEqualBin(hash_str(hashname, "01234567012345670123456701234567" * 20), unhex( '2fc64a4f500ddb6828f6a3430b8dd72a368eb7f3a8322a70' 'bc84275b9c0b3ab00d27a5cc3c2d224aa6b61a0d79fb4596')) - self.assertEqualBin(hash_str('sha384', b"\xB9"), unhex( + self.assertEqualBin(hash_str(hashname, b"\xB9"), unhex( 'bc8089a19007c0b14195f4ecc74094fec64f01f90929282c' '2fb392881578208ad466828b1c6c283d2722cf0ad1ab6938')) - self.assertEqualBin(hash_str('sha384', + self.assertEqualBin(hash_str(hashname, unhex("a41c497779c0375ff10a7f4e08591739")), unhex( 'c9a68443a005812256b8ec76b00516f0dbb74fab26d66591' '3f194b6ffb0e91ea9967566b58109cbc675cc208e4c823f7')) - self.assertEqualBin(hash_str('sha384', unhex( + self.assertEqualBin(hash_str(hashname, unhex( "399669e28f6b9c6dbcbb6912ec10ffcf74790349b7dc8fbe4a8e7b3b5621" "db0f3e7dc87f823264bbe40d1811c9ea2061e1c84ad10a23fac1727e7202" "fc3f5042e6bf58cba8a2746e1f64f9b9ea352c711507053cf4e5339d5286" @@ -2663,42 +2803,42 @@ def testSHA384(self): '38e42b5c4de660f5de8fb2a5b2fbd2a3cbffd20cff1288c0')) def testSHA512(self): - for hashname in ['sha512_sw', 'sha512_hw']: + for hashname in get_implementations("sha512"): if ssh_hash_new(hashname) is None: continue # skip testing of unavailable HW implementation # Test cases from RFC 6234 section 8.5, omitting the ones # whose input is not a multiple of 8 bits - self.assertEqualBin(hash_str('sha512', "abc"), unhex( + self.assertEqualBin(hash_str(hashname, "abc"), unhex( 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55' 'd39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94f' 'a54ca49f')) - self.assertEqualBin(hash_str('sha512', + self.assertEqualBin(hash_str(hashname, "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"), unhex('8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299' 'aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26' '545e96e55b874be909')) - self.assertEqualBin(hash_str_iter('sha512', + self.assertEqualBin(hash_str_iter(hashname, ("a" * 1000 for _ in range(1000))), unhex( 'e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa9' '73ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217' 'ad8cc09b')) - self.assertEqualBin(hash_str('sha512', + self.assertEqualBin(hash_str(hashname, "01234567012345670123456701234567" * 20), unhex( '89d05ba632c699c31231ded4ffc127d5a894dad412c0e024db872d1abd2b' 'a8141a0f85072a9be1e2aa04cf33c765cb510813a39cd5a84c4acaa64d3f' '3fb7bae9')) - self.assertEqualBin(hash_str('sha512', b"\xD0"), unhex( + self.assertEqualBin(hash_str(hashname, b"\xD0"), unhex( '9992202938e882e73e20f6b69e68a0a7149090423d93c81bab3f21678d4a' 'ceeee50e4e8cafada4c85a54ea8306826c4ad6e74cece9631bfa8a549b4a' 'b3fbba15')) - self.assertEqualBin(hash_str('sha512', + self.assertEqualBin(hash_str(hashname, unhex("8d4e3c0e3889191491816e9d98bff0a0")), unhex( 'cb0b67a4b8712cd73c9aabc0b199e9269b20844afb75acbdd1c153c98289' '24c3ddedaafe669c5fdd0bc66f630f6773988213eb1b16f517ad0de4b2f0' 'c95c90f8')) - self.assertEqualBin(hash_str('sha512', unhex( + self.assertEqualBin(hash_str(hashname, unhex( "a55f20c411aad132807a502d65824e31a2305432aa3d06d3e282a8d84e0d" "e1de6974bf495469fc7f338f8054d58c26c49360c3e87af56523acf6d89d" "03e56ff2f868002bc3e431edc44df2f0223d4bb3b243586e1a7d92493669" @@ -3045,6 +3185,77 @@ def testCRC32(self): self.assertEqual(crc32_rfc1662(vec[:-4]), expected) self.assertEqual(crc32_rfc1662(vec), 0x2144DF1C) + def testHttpDigest(self): + # RFC 7616 section 3.9.1 + params = ["Mufasa", "Circle of Life", "http-auth@example.org", + "GET", "/dir/index.html", "auth", + "7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v", + "FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS", 1, + "MD5", False] + cnonce = base64.decodebytes( + b'f2/wE4q74E6zIJEtWaHKaf5wv/H5QzzpXusqGemxURZJ') + with queued_specific_random_data(cnonce): + self.assertEqual(http_digest_response(*params), + b'username="Mufasa", ' + b'realm="http-auth@example.org", ' + b'uri="/dir/index.html", ' + b'algorithm=MD5, ' + b'nonce="7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v", ' + b'nc=00000001, ' + b'cnonce="f2/wE4q74E6zIJEtWaHKaf5wv/H5QzzpXusqGemxURZJ", ' + b'qop=auth, ' + b'response="8ca523f5e9506fed4657c9700eebdbec", ' + b'opaque="FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS"') + + # And again with all the same details except the hash + params[9] = "SHA-256" + with queued_specific_random_data(cnonce): + self.assertEqual(http_digest_response(*params), + b'username="Mufasa", ' + b'realm="http-auth@example.org", ' + b'uri="/dir/index.html", ' + b'algorithm=SHA-256, ' + b'nonce="7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v", ' + b'nc=00000001, ' + b'cnonce="f2/wE4q74E6zIJEtWaHKaf5wv/H5QzzpXusqGemxURZJ", ' + b'qop=auth, ' + b'response="753927fa0e85d155564e2e272a28d1802ca10daf4496794697cf8db5856cb6c1", ' + b'opaque="FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS"') + + # RFC 7616 section 3.9.2, using SHA-512-256 (demonstrating + # that they think it's just a 256-bit truncation of SHA-512, + # and not the version defined in FIPS 180-4 which also uses + # a different initial hash state), and username hashing. + # + # We don't actually support SHA-512-256 in the top-level proxy + # client code (see the comment in proxy/cproxy.h). However, + # this internal http_digest_response function still provides + # it, simply so that we can run this test case from the RFC, + # because it's the only provided test case for username + # hashing, and this confirms that we've got the preimage right + # for the username hash. + params = ["J\u00E4s\u00F8n Doe".encode("UTF-8"), + "Secret, or not?", "api@example.org", + "GET", "/doe.json", "auth", + "5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK", + "HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS", 1, + "SHA-512-256", True] + cnonce = base64.decodebytes( + b'NTg6RKcb9boFIAS3KrFK9BGeh+iDa/sm6jUMp2wds69v') + with queued_specific_random_data(cnonce): + self.assertEqual(http_digest_response(*params), + b'username="488869477bf257147b804c45308cd62ac4e25eb717b12b298c79e62dcea254ec", ' + b'realm="api@example.org", ' + b'uri="/doe.json", ' + b'algorithm=SHA-512-256, ' + b'nonce="5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK", ' + b'nc=00000001, ' + b'cnonce="NTg6RKcb9boFIAS3KrFK9BGeh+iDa/sm6jUMp2wds69v", ' + b'qop=auth, ' + b'response="ae66e67d6b427bd3f120414a82e4acff38e8ecd9101d6c861229025f607a79dd", ' + b'opaque="HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS", ' + b'userhash=true') + if __name__ == "__main__": # Run the tests, suppressing automatic sys.exit and collecting the # unittest.TestProgram instance returned by unittest.main instead. diff --git a/code/fuzzterm.c b/code/test/fuzzterm.c similarity index 92% rename from code/fuzzterm.c rename to code/test/fuzzterm.c index f53c0a9..faea2dd 100644 --- a/code/fuzzterm.c +++ b/code/test/fuzzterm.c @@ -6,9 +6,6 @@ #include "dialog.h" #include "terminal.h" -/* For Unix in particular, but harmless if this main() is reused elsewhere */ -const bool buildinfo_gtk_relevant = false; - static const TermWinVtable fuzz_termwin_vt; int main(int argc, char **argv) @@ -37,7 +34,7 @@ int main(int argc, char **argv) #endif while (!feof(stdin)) { len = fread(blk, 1, sizeof(blk), stdin); - term_data(term, false, blk, len); + term_data(term, blk, len); } term_update(term); return 0; @@ -85,8 +82,8 @@ static void fuzz_clip_write( static void fuzz_clip_request_paste(TermWin *tw, int clipboard) {} static void fuzz_refresh(TermWin *tw) {} static void fuzz_request_resize(TermWin *tw, int w, int h) {} -static void fuzz_set_title(TermWin *tw, const char *title) {} -static void fuzz_set_icon_title(TermWin *tw, const char *icontitle) {} +static void fuzz_set_title(TermWin *tw, const char *title, int codepage) {} +static void fuzz_set_icon_title(TermWin *tw, const char *icontitle, int cp) {} static void fuzz_set_minimised(TermWin *tw, bool minimised) {} static void fuzz_set_maximised(TermWin *tw, bool maximised) {} static void fuzz_move(TermWin *tw, int x, int y) {} @@ -94,6 +91,7 @@ static void fuzz_set_zorder(TermWin *tw, bool top) {} static void fuzz_palette_set(TermWin *tw, unsigned start, unsigned ncolours, const rgb *colours) {} static void fuzz_palette_get_overrides(TermWin *tw, Terminal *term) {} +static void fuzz_unthrottle(TermWin *tw, size_t size) {} static const TermWinVtable fuzz_termwin_vt = { .setup_draw_ctx = fuzz_setup_draw_ctx, @@ -118,17 +116,23 @@ static const TermWinVtable fuzz_termwin_vt = { .set_zorder = fuzz_set_zorder, .palette_set = fuzz_palette_set, .palette_get_overrides = fuzz_palette_get_overrides, + .unthrottle = fuzz_unthrottle, }; void ldisc_send(Ldisc *ldisc, const void *buf, int len, bool interactive) {} void ldisc_echoedit_update(Ldisc *ldisc) {} +bool ldisc_has_input_buffered(Ldisc *ldisc) { return false; } +LdiscInputToken ldisc_get_input_token(Ldisc *ldisc) +{ unreachable("This fake ldisc never has any buffered input"); } +void ldisc_enable_prompt_callback(Ldisc *ldisc, prompts_t *p) +{ unreachable("This fake ldisc should never be used for user/pass prompts"); } void modalfatalbox(const char *fmt, ...) { exit(0); } void nonfatal(const char *fmt, ...) { } /* needed by timing.c */ void timer_change_notify(unsigned long next) { } -/* needed by config.c and sercfg.c */ +/* needed by config.c */ void dlg_radiobutton_set(union control *ctrl, dlgparam *dp, int whichbutton) { } int dlg_radiobutton_get(union control *ctrl, dlgparam *dp) { return 0; } @@ -169,7 +173,6 @@ bool dlg_coloursel_results(union control *ctrl, dlgparam *dp, void dlg_refresh(union control *ctrl, dlgparam *dp) { } bool dlg_is_visible(union control *ctrl, dlgparam *dp) { return false; } -const char *const appname = "FuZZterm"; const int ngsslibs = 0; const char *const gsslibnames[0] = { }; const struct keyvalwhere gsslibkeywords[0] = { }; diff --git a/code/test/list-accel.py b/code/test/list-accel.py new file mode 100644 index 0000000..af93d42 --- /dev/null +++ b/code/test/list-accel.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Simple client of the testcrypt system that reports the available +# variants of each of the crypto primitives that have hardware- +# accelerated implementations. +# +# It will report the set of primitives compiled in to testcrypt, and +# also report whether each one can be instantiated at run time. + +from testcrypt import * + +def get_implementations(alg): + return get_implementations_commasep(alg).decode("ASCII").split(",") + +def list_implementations(alg, checkfn): + print(f"Implementations of {alg}:") + for impl in get_implementations(alg): + if impl == alg: + continue + if checkfn(impl): + print(f" {impl:<32s} available") + else: + print(f" {impl:<32s} compiled in, but unavailable at run time") + +def list_cipher_implementations(alg): + list_implementations(alg, lambda impl: ssh_cipher_new(impl) is not None) + +def list_hash_implementations(alg): + list_implementations(alg, lambda impl: ssh_hash_new(impl) is not None) + +list_cipher_implementations("aes256_cbc") +list_hash_implementations("sha1") +list_hash_implementations("sha256") +list_hash_implementations("sha512") diff --git a/code/test/primegen.py b/code/test/primegen.py index 6964099..45b340f 100644 --- a/code/test/primegen.py +++ b/code/test/primegen.py @@ -18,6 +18,8 @@ def main(): dest='policy', const='provable_fast') parser.add_argument("--complex", action='store_const', dest='policy', const='provable_maurer_complex') + parser.add_argument("--probabilistic", action='store_const', + dest='policy', const='probabilistic') parser.add_argument("-q", "--quiet", action='store_true') parser.add_argument("-b", "--binary", action='store_const', dest='fmt', const='{:b}') diff --git a/code/test/sclog/CMakeLists.txt b/code/test/sclog/CMakeLists.txt deleted file mode 100644 index 6ac0ddf..0000000 --- a/code/test/sclog/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# CMake script for the 'sclog' DynamoRIO instrumentation system that -# goes with the PuTTY test binary 'testsc'. For build instructions see -# the comment at the top of testsc.c. - -cmake_minimum_required(VERSION 3.5) - -find_package(DynamoRIO) -if (NOT DynamoRIO_FOUND) - message(FATAL_ERROR "DynamoRIO not found") -endif() - -add_library(sclog SHARED sclog.c) -configure_DynamoRIO_client(sclog) -foreach(extension drmgr drsyms drreg drutil drwrap) - use_DynamoRIO_extension(sclog ${extension}) -endforeach() diff --git a/code/test/sclog/sclog.c b/code/test/sclog/sclog.c index 2d2adbf..f12a028 100644 --- a/code/test/sclog/sclog.c +++ b/code/test/sclog/sclog.c @@ -269,6 +269,38 @@ static void wrap_memset_pre(void *wrapctx, void **user_data) } } +/* + * Similarly to the above, wrap some versions of memmove. + */ +static void wrap_memmove_pre(void *wrapctx, void **user_data) +{ + uint was_already_paused = logging_paused++; + + if (outfile == INVALID_FILE || was_already_paused) + return; + + const void *daddr = drwrap_get_arg(wrapctx, 0); + const void *saddr = drwrap_get_arg(wrapctx, 1); + size_t size = (size_t)drwrap_get_arg(wrapctx, 2); + + + struct allocation *alloc; + + dr_fprintf(outfile, "memmove %"PRIuMAX" ", (uintmax_t)size); + if (!(alloc = find_allocation(daddr))) { + dr_fprintf(outfile, "to %"PRIxMAX" ", (uintmax_t)daddr); + } else { + dr_fprintf(outfile, "to allocations[%"PRIuPTR"] + %"PRIxMAX" ", + alloc->index, (uintmax_t)(daddr - alloc->start)); + } + if (!(alloc = find_allocation(saddr))) { + dr_fprintf(outfile, "from %"PRIxMAX"\n", (uintmax_t)saddr); + } else { + dr_fprintf(outfile, "from allocations[%"PRIuPTR"] + %"PRIxMAX"\n", + alloc->index, (uintmax_t)(saddr - alloc->start)); + } +} + /* * Common post-wrapper function for memset and free, whose entire * function is to unpause the logging. @@ -565,6 +597,7 @@ static void load_module( TRY_WRAP("realloc", wrap_realloc_pre, wrap_alloc_post); TRY_WRAP("free", wrap_free_pre, unpause_post); TRY_WRAP("memset", wrap_memset_pre, unpause_post); + TRY_WRAP("memmove", wrap_memmove_pre, unpause_post); /* * More strangely named versions of standard C library @@ -585,6 +618,8 @@ static void load_module( TRY_WRAP("__GI___libc_free", wrap_free_pre, unpause_post); TRY_WRAP("__memset_sse2_unaligned", wrap_memset_pre, unpause_post); TRY_WRAP("__memset_sse2", wrap_memset_pre, unpause_post); + TRY_WRAP("__memmove_avx_unaligned_erms", wrap_memmove_pre, + unpause_post); TRY_WRAP("cfree", wrap_free_pre, unpause_post); } } diff --git a/code/test/ssh.py b/code/test/ssh.py index 90eccb7..c4f2531 100644 --- a/code/test/ssh.py +++ b/code/test/ssh.py @@ -88,6 +88,7 @@ def ssh1_decode_mpint(s): SSH1_AGENTC_REMOVE_ALL_RSA_IDENTITIES = 9 SSH_AGENT_FAILURE = 5 SSH_AGENT_SUCCESS = 6 +SSH_AGENT_EXTENSION_FAILURE = 28 SSH2_AGENTC_REQUEST_IDENTITIES = 11 SSH2_AGENT_IDENTITIES_ANSWER = 12 SSH2_AGENTC_SIGN_REQUEST = 13 diff --git a/code/test/testcrypt-enum.h b/code/test/testcrypt-enum.h new file mode 100644 index 0000000..cf8f00c --- /dev/null +++ b/code/test/testcrypt-enum.h @@ -0,0 +1,144 @@ +BEGIN_ENUM_TYPE(hashalg) + ENUM_VALUE("md5", &ssh_md5) + ENUM_VALUE("sha1", &ssh_sha1) + ENUM_VALUE("sha1_sw", &ssh_sha1_sw) + ENUM_VALUE("sha256", &ssh_sha256) + ENUM_VALUE("sha384", &ssh_sha384) + ENUM_VALUE("sha512", &ssh_sha512) + ENUM_VALUE("sha256_sw", &ssh_sha256_sw) + ENUM_VALUE("sha384_sw", &ssh_sha384_sw) + ENUM_VALUE("sha512_sw", &ssh_sha512_sw) +#if HAVE_SHA_NI + ENUM_VALUE("sha1_ni", &ssh_sha1_ni) + ENUM_VALUE("sha256_ni", &ssh_sha256_ni) +#endif +#if HAVE_NEON_CRYPTO + ENUM_VALUE("sha1_neon", &ssh_sha1_neon) + ENUM_VALUE("sha256_neon", &ssh_sha256_neon) +#endif +#if HAVE_NEON_SHA512 + ENUM_VALUE("sha384_neon", &ssh_sha384_neon) + ENUM_VALUE("sha512_neon", &ssh_sha512_neon) +#endif + ENUM_VALUE("sha3_224", &ssh_sha3_224) + ENUM_VALUE("sha3_256", &ssh_sha3_256) + ENUM_VALUE("sha3_384", &ssh_sha3_384) + ENUM_VALUE("sha3_512", &ssh_sha3_512) + ENUM_VALUE("shake256_114bytes", &ssh_shake256_114bytes) + ENUM_VALUE("blake2b", &ssh_blake2b) +END_ENUM_TYPE(hashalg) + +BEGIN_ENUM_TYPE(macalg) + ENUM_VALUE("hmac_md5", &ssh_hmac_md5) + ENUM_VALUE("hmac_sha1", &ssh_hmac_sha1) + ENUM_VALUE("hmac_sha1_buggy", &ssh_hmac_sha1_buggy) + ENUM_VALUE("hmac_sha1_96", &ssh_hmac_sha1_96) + ENUM_VALUE("hmac_sha1_96_buggy", &ssh_hmac_sha1_96_buggy) + ENUM_VALUE("hmac_sha256", &ssh_hmac_sha256) + ENUM_VALUE("poly1305", &ssh2_poly1305) +END_ENUM_TYPE(macalg) + +BEGIN_ENUM_TYPE(keyalg) + ENUM_VALUE("dsa", &ssh_dsa) + ENUM_VALUE("rsa", &ssh_rsa) + ENUM_VALUE("ed25519", &ssh_ecdsa_ed25519) + ENUM_VALUE("ed448", &ssh_ecdsa_ed448) + ENUM_VALUE("p256", &ssh_ecdsa_nistp256) + ENUM_VALUE("p384", &ssh_ecdsa_nistp384) + ENUM_VALUE("p521", &ssh_ecdsa_nistp521) +END_ENUM_TYPE(keyalg) + +BEGIN_ENUM_TYPE(cipheralg) + ENUM_VALUE("3des_ctr", &ssh_3des_ssh2_ctr) + ENUM_VALUE("3des_ssh2", &ssh_3des_ssh2) + ENUM_VALUE("3des_ssh1", &ssh_3des_ssh1) + ENUM_VALUE("des_cbc", &ssh_des) + ENUM_VALUE("aes256_ctr", &ssh_aes256_sdctr) + ENUM_VALUE("aes256_cbc", &ssh_aes256_cbc) + ENUM_VALUE("aes192_ctr", &ssh_aes192_sdctr) + ENUM_VALUE("aes192_cbc", &ssh_aes192_cbc) + ENUM_VALUE("aes128_ctr", &ssh_aes128_sdctr) + ENUM_VALUE("aes128_cbc", &ssh_aes128_cbc) + ENUM_VALUE("aes256_ctr_sw", &ssh_aes256_sdctr_sw) + ENUM_VALUE("aes256_cbc_sw", &ssh_aes256_cbc_sw) + ENUM_VALUE("aes192_ctr_sw", &ssh_aes192_sdctr_sw) + ENUM_VALUE("aes192_cbc_sw", &ssh_aes192_cbc_sw) + ENUM_VALUE("aes128_ctr_sw", &ssh_aes128_sdctr_sw) + ENUM_VALUE("aes128_cbc_sw", &ssh_aes128_cbc_sw) +#if HAVE_AES_NI + ENUM_VALUE("aes256_ctr_ni", &ssh_aes256_sdctr_ni) + ENUM_VALUE("aes256_cbc_ni", &ssh_aes256_cbc_ni) + ENUM_VALUE("aes192_ctr_ni", &ssh_aes192_sdctr_ni) + ENUM_VALUE("aes192_cbc_ni", &ssh_aes192_cbc_ni) + ENUM_VALUE("aes128_ctr_ni", &ssh_aes128_sdctr_ni) + ENUM_VALUE("aes128_cbc_ni", &ssh_aes128_cbc_ni) +#endif +#if HAVE_NEON_CRYPTO + ENUM_VALUE("aes256_ctr_neon", &ssh_aes256_sdctr_neon) + ENUM_VALUE("aes256_cbc_neon", &ssh_aes256_cbc_neon) + ENUM_VALUE("aes192_ctr_neon", &ssh_aes192_sdctr_neon) + ENUM_VALUE("aes192_cbc_neon", &ssh_aes192_cbc_neon) + ENUM_VALUE("aes128_ctr_neon", &ssh_aes128_sdctr_neon) + ENUM_VALUE("aes128_cbc_neon", &ssh_aes128_cbc_neon) +#endif + ENUM_VALUE("blowfish_ctr", &ssh_blowfish_ssh2_ctr) + ENUM_VALUE("blowfish_ssh2", &ssh_blowfish_ssh2) + ENUM_VALUE("blowfish_ssh1", &ssh_blowfish_ssh1) + ENUM_VALUE("arcfour256", &ssh_arcfour256_ssh2) + ENUM_VALUE("arcfour128", &ssh_arcfour128_ssh2) + ENUM_VALUE("chacha20_poly1305", &ssh2_chacha20_poly1305) +END_ENUM_TYPE(cipheralg) + +BEGIN_ENUM_TYPE(dh_group) + ENUM_VALUE("group1", &ssh_diffiehellman_group1_sha1) + ENUM_VALUE("group14", &ssh_diffiehellman_group14_sha256) +END_ENUM_TYPE(dh_group) + +BEGIN_ENUM_TYPE(ecdh_alg) + ENUM_VALUE("curve25519", &ssh_ec_kex_curve25519) + ENUM_VALUE("curve448", &ssh_ec_kex_curve448) + ENUM_VALUE("nistp256", &ssh_ec_kex_nistp256) + ENUM_VALUE("nistp384", &ssh_ec_kex_nistp384) + ENUM_VALUE("nistp521", &ssh_ec_kex_nistp521) +END_ENUM_TYPE(ecdh_alg) + +BEGIN_ENUM_TYPE(rsaorder) + ENUM_VALUE("exponent_first", RSA_SSH1_EXPONENT_FIRST) + ENUM_VALUE("modulus_first", RSA_SSH1_MODULUS_FIRST) +END_ENUM_TYPE(rsaorder) + +BEGIN_ENUM_TYPE(primegenpolicy) + ENUM_VALUE("probabilistic", &primegen_probabilistic) + ENUM_VALUE("provable_fast", &primegen_provable_fast) + ENUM_VALUE("provable_maurer_simple", &primegen_provable_maurer_simple) + ENUM_VALUE("provable_maurer_complex", &primegen_provable_maurer_complex) +END_ENUM_TYPE(primegenpolicy) + +BEGIN_ENUM_TYPE(argon2flavour) + ENUM_VALUE("d", Argon2d) + ENUM_VALUE("i", Argon2i) + ENUM_VALUE("id", Argon2id) + /* I expect to forget which spelling I chose, so let's support many */ + ENUM_VALUE("argon2d", Argon2d) + ENUM_VALUE("argon2i", Argon2i) + ENUM_VALUE("argon2id", Argon2id) + ENUM_VALUE("Argon2d", Argon2d) + ENUM_VALUE("Argon2i", Argon2i) + ENUM_VALUE("Argon2id", Argon2id) +END_ENUM_TYPE(argon2flavour) + +BEGIN_ENUM_TYPE(fptype) + ENUM_VALUE("md5", SSH_FPTYPE_MD5) + ENUM_VALUE("sha256", SSH_FPTYPE_SHA256) +END_ENUM_TYPE(fptype) + +/* + * cproxy.h already has a list macro mapping protocol-specified + * strings to the list of HTTP Digest hash functions. Rather than + * invent a separate one for testcrypt, reuse the existing names. + */ +BEGIN_ENUM_TYPE(httpdigesthash) + #define DECL_ARRAY(id, str, alg, bits, accepted) ENUM_VALUE(str, id) + HTTP_DIGEST_HASHES(DECL_ARRAY) + #undef DECL_ARRAY +END_ENUM_TYPE(httpdigesthash) diff --git a/code/test/testcrypt-func.h b/code/test/testcrypt-func.h new file mode 100644 index 0000000..2cb0b3d --- /dev/null +++ b/code/test/testcrypt-func.h @@ -0,0 +1,539 @@ +/* + * List of functions exported by the 'testcrypt' system to provide a + * Python API for running unit tests and auxiliary programs. + * + * Each function definition in this file has the form + * + * FUNC(return-type, function-name, ...) + * + * where '...' in turn a variadic list of argument specifications of + * the form + * + * ARG(argument-type, argument-name) + * + * An empty argument list must be marked by including a + * pseudo-argument VOID: + * + * FUNC(return-type, function-name, VOID) + * + * Type names are always single identifiers, and they have some + * standard prefixes: + * + * 'val_' means that the type refers to something dynamically + * allocated, so that it has a persistent identity, needs to be freed + * when finished with (though this is done automatically by the + * testcrypt.py system via Python's reference counting), and may also + * be mutable. The argument type in C will be a pointer; in Python the + * corresponding argument will be an instance of a 'Value' object + * defined in testcrypt.py. + * + * 'opt_val_' is a modification of 'val_' to indicate that the pointer + * may be NULL. In Python this is translated by accepting (or + * returning) None as an alternative to a Value. + * + * 'out_' on an argument type indicates an additional output + * parameter. The argument type in C has an extra layer of + * indirection, e.g. an 'out_val_mpint' is an 'mpint **' instead of an + * 'mpint *', identifying a pointer variable where the returned + * pointer value will be written. In the Python API, these arguments + * do not appear in the argument list of the Python function; instead + * they cause the return value to become a tuple, with additional + * types appended. For example, a declaration like + * + * FUNC(val_foo, example, ARG(out_val_bar, bar), ARG(val_baz, baz)) + * + * would identify a function in C with the following prototype, which + * returns a 'foo *' directly and a 'bar *' by writing it through the + * provided 'bar **' pointer argument: + * + * foo *example(bar **extra_output, baz *input); + * + * and in Python this would become a function taking one argument of + * type 'baz' and returning a tuple of the form (foo, bar). + * + * 'out_' and 'opt_' can go together, if a function returns a second + * output value but it may in some cases be NULL. + * + * 'consumed_' on an argument type indicates that the C function + * receiving that argument frees it as a side effect. + * + * Any argument type which does not start 'val_' is plain old data + * with no dynamic allocation requirements. Ordinary C integers are + * sometimes handled this way (e.g. 'uint'). Other plain-data types + * are represented in Python as a string that must be one of a + * recognised set of keywords; in C these variously translate into + * enumeration types (e.g. argon2flavour, rsaorder) or pointers to + * const vtables of one kind or another (e.g. keyalg, hashalg, + * primegenpolicy). + * + * If a function definition begins with FUNC_WRAPPED rather than FUNC, + * it means that the underlying C function has a suffix "_wrapper", + * e.g. ssh_cipher_setiv_wrapper(). Those wrappers are defined in + * testcrypt.c itself, and change the API or semantics in a way that + * makes the function more Python-friendly. + */ + +/* + * mpint.h functions. + */ +FUNC(val_mpint, mp_new, ARG(uint, maxbits)) +FUNC(void, mp_clear, ARG(val_mpint, x)) +FUNC(val_mpint, mp_from_bytes_le, ARG(val_string_ptrlen, bytes)) +FUNC(val_mpint, mp_from_bytes_be, ARG(val_string_ptrlen, bytes)) +FUNC(val_mpint, mp_from_integer, ARG(uint, n)) +FUNC(val_mpint, mp_from_decimal_pl, ARG(val_string_ptrlen, decimal)) +FUNC(val_mpint, mp_from_decimal, ARG(val_string_asciz, decimal)) +FUNC(val_mpint, mp_from_hex_pl, ARG(val_string_ptrlen, hex)) +FUNC(val_mpint, mp_from_hex, ARG(val_string_asciz, hex)) +FUNC(val_mpint, mp_copy, ARG(val_mpint, x)) +FUNC(val_mpint, mp_power_2, ARG(uint, power)) +FUNC(uint, mp_get_byte, ARG(val_mpint, x), ARG(uint, byte)) +FUNC(uint, mp_get_bit, ARG(val_mpint, x), ARG(uint, bit)) +FUNC(void, mp_set_bit, ARG(val_mpint, x), ARG(uint, bit), ARG(uint, val)) +FUNC(uint, mp_max_bytes, ARG(val_mpint, x)) +FUNC(uint, mp_max_bits, ARG(val_mpint, x)) +FUNC(uint, mp_get_nbits, ARG(val_mpint, x)) +FUNC(val_string_asciz, mp_get_decimal, ARG(val_mpint, x)) +FUNC(val_string_asciz, mp_get_hex, ARG(val_mpint, x)) +FUNC(val_string_asciz, mp_get_hex_uppercase, ARG(val_mpint, x)) +FUNC(uint, mp_cmp_hs, ARG(val_mpint, a), ARG(val_mpint, b)) +FUNC(uint, mp_cmp_eq, ARG(val_mpint, a), ARG(val_mpint, b)) +FUNC(uint, mp_hs_integer, ARG(val_mpint, x), ARG(uint, n)) +FUNC(uint, mp_eq_integer, ARG(val_mpint, x), ARG(uint, n)) +FUNC(void, mp_min_into, ARG(val_mpint, dest), ARG(val_mpint, x), + ARG(val_mpint, y)) +FUNC(void, mp_max_into, ARG(val_mpint, dest), ARG(val_mpint, x), + ARG(val_mpint, y)) +FUNC(val_mpint, mp_min, ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(val_mpint, mp_max, ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(void, mp_copy_into, ARG(val_mpint, dest), ARG(val_mpint, src)) +FUNC(void, mp_select_into, ARG(val_mpint, dest), ARG(val_mpint, src0), + ARG(val_mpint, src1), ARG(uint, choose_src1)) +FUNC(void, mp_add_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(void, mp_sub_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(void, mp_mul_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(val_mpint, mp_add, ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(val_mpint, mp_sub, ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(val_mpint, mp_mul, ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(void, mp_and_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(void, mp_or_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(void, mp_xor_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(void, mp_bic_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(void, mp_copy_integer_into, ARG(val_mpint, dest), ARG(uint, n)) +FUNC(void, mp_add_integer_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(uint, n)) +FUNC(void, mp_sub_integer_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(uint, n)) +FUNC(void, mp_mul_integer_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(uint, n)) +FUNC(void, mp_cond_add_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b), ARG(uint, yes)) +FUNC(void, mp_cond_sub_into, ARG(val_mpint, dest), ARG(val_mpint, a), + ARG(val_mpint, b), ARG(uint, yes)) +FUNC(void, mp_cond_swap, ARG(val_mpint, x0), ARG(val_mpint, x1), + ARG(uint, swap)) +FUNC(void, mp_cond_clear, ARG(val_mpint, x), ARG(uint, clear)) +FUNC(void, mp_divmod_into, ARG(val_mpint, n), ARG(val_mpint, d), + ARG(opt_val_mpint, q), ARG(opt_val_mpint, r)) +FUNC(val_mpint, mp_div, ARG(val_mpint, n), ARG(val_mpint, d)) +FUNC(val_mpint, mp_mod, ARG(val_mpint, x), ARG(val_mpint, modulus)) +FUNC(val_mpint, mp_nthroot, ARG(val_mpint, y), ARG(uint, n), + ARG(opt_val_mpint, remainder)) +FUNC(void, mp_reduce_mod_2to, ARG(val_mpint, x), ARG(uint, p)) +FUNC(val_mpint, mp_invert_mod_2to, ARG(val_mpint, x), ARG(uint, p)) +FUNC(val_mpint, mp_invert, ARG(val_mpint, x), ARG(val_mpint, modulus)) +FUNC(void, mp_gcd_into, ARG(val_mpint, a), ARG(val_mpint, b), + ARG(opt_val_mpint, gcd_out), ARG(opt_val_mpint, A_out), + ARG(opt_val_mpint, B_out)) +FUNC(val_mpint, mp_gcd, ARG(val_mpint, a), ARG(val_mpint, b)) +FUNC(uint, mp_coprime, ARG(val_mpint, a), ARG(val_mpint, b)) +FUNC(val_modsqrt, modsqrt_new, ARG(val_mpint, p), + ARG(val_mpint, any_nonsquare_mod_p)) +/* The modsqrt functions' 'success' pointer becomes a second return value */ +FUNC(val_mpint, mp_modsqrt, ARG(val_modsqrt, sc), ARG(val_mpint, x), + ARG(out_uint, success)) +FUNC(val_monty, monty_new, ARG(val_mpint, modulus)) +FUNC_WRAPPED(val_mpint, monty_modulus, ARG(val_monty, mc)) +FUNC_WRAPPED(val_mpint, monty_identity, ARG(val_monty, mc)) +FUNC(void, monty_import_into, ARG(val_monty, mc), ARG(val_mpint, dest), + ARG(val_mpint, x)) +FUNC(val_mpint, monty_import, ARG(val_monty, mc), ARG(val_mpint, x)) +FUNC(void, monty_export_into, ARG(val_monty, mc), ARG(val_mpint, dest), + ARG(val_mpint, x)) +FUNC(val_mpint, monty_export, ARG(val_monty, mc), ARG(val_mpint, x)) +FUNC(void, monty_mul_into, ARG(val_monty, mc), ARG(val_mpint, dest), + ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(val_mpint, monty_add, ARG(val_monty, mc), ARG(val_mpint, x), + ARG(val_mpint, y)) +FUNC(val_mpint, monty_sub, ARG(val_monty, mc), ARG(val_mpint, x), + ARG(val_mpint, y)) +FUNC(val_mpint, monty_mul, ARG(val_monty, mc), ARG(val_mpint, x), + ARG(val_mpint, y)) +FUNC(val_mpint, monty_pow, ARG(val_monty, mc), ARG(val_mpint, base), + ARG(val_mpint, exponent)) +FUNC(val_mpint, monty_invert, ARG(val_monty, mc), ARG(val_mpint, x)) +FUNC(val_mpint, monty_modsqrt, ARG(val_modsqrt, sc), ARG(val_mpint, mx), + ARG(out_uint, success)) +FUNC(val_mpint, mp_modpow, ARG(val_mpint, base), ARG(val_mpint, exponent), + ARG(val_mpint, modulus)) +FUNC(val_mpint, mp_modmul, ARG(val_mpint, x), ARG(val_mpint, y), + ARG(val_mpint, modulus)) +FUNC(val_mpint, mp_modadd, ARG(val_mpint, x), ARG(val_mpint, y), + ARG(val_mpint, modulus)) +FUNC(val_mpint, mp_modsub, ARG(val_mpint, x), ARG(val_mpint, y), + ARG(val_mpint, modulus)) +FUNC(void, mp_lshift_safe_into, ARG(val_mpint, dest), ARG(val_mpint, x), + ARG(uint, shift)) +FUNC(void, mp_rshift_safe_into, ARG(val_mpint, dest), ARG(val_mpint, x), + ARG(uint, shift)) +FUNC(val_mpint, mp_rshift_safe, ARG(val_mpint, x), ARG(uint, shift)) +FUNC(void, mp_lshift_fixed_into, ARG(val_mpint, dest), ARG(val_mpint, x), + ARG(uint, shift)) +FUNC(void, mp_rshift_fixed_into, ARG(val_mpint, dest), ARG(val_mpint, x), + ARG(uint, shift)) +FUNC(val_mpint, mp_rshift_fixed, ARG(val_mpint, x), ARG(uint, shift)) +FUNC(val_mpint, mp_random_bits, ARG(uint, bits)) +FUNC(val_mpint, mp_random_in_range, ARG(val_mpint, lo), ARG(val_mpint, hi)) + +/* + * ecc.h functions. + */ +FUNC(val_wcurve, ecc_weierstrass_curve, ARG(val_mpint, p), ARG(val_mpint, a), + ARG(val_mpint, b), ARG(opt_val_mpint, nonsquare_mod_p)) +FUNC(val_wpoint, ecc_weierstrass_point_new_identity, ARG(val_wcurve, curve)) +FUNC(val_wpoint, ecc_weierstrass_point_new, ARG(val_wcurve, curve), + ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(val_wpoint, ecc_weierstrass_point_new_from_x, ARG(val_wcurve, curve), + ARG(val_mpint, x), ARG(uint, desired_y_parity)) +FUNC(val_wpoint, ecc_weierstrass_point_copy, ARG(val_wpoint, orig)) +FUNC(uint, ecc_weierstrass_point_valid, ARG(val_wpoint, P)) +FUNC(val_wpoint, ecc_weierstrass_add_general, ARG(val_wpoint, P), + ARG(val_wpoint, Q)) +FUNC(val_wpoint, ecc_weierstrass_add, ARG(val_wpoint, P), ARG(val_wpoint, Q)) +FUNC(val_wpoint, ecc_weierstrass_double, ARG(val_wpoint, P)) +FUNC(val_wpoint, ecc_weierstrass_multiply, ARG(val_wpoint, B), + ARG(val_mpint, n)) +FUNC(uint, ecc_weierstrass_is_identity, ARG(val_wpoint, P)) +/* The output pointers in get_affine all become extra output values */ +FUNC(void, ecc_weierstrass_get_affine, ARG(val_wpoint, P), + ARG(out_val_mpint, x), ARG(out_val_mpint, y)) +FUNC(val_mcurve, ecc_montgomery_curve, ARG(val_mpint, p), ARG(val_mpint, a), + ARG(val_mpint, b)) +FUNC(val_mpoint, ecc_montgomery_point_new, ARG(val_mcurve, curve), + ARG(val_mpint, x)) +FUNC(val_mpoint, ecc_montgomery_point_copy, ARG(val_mpoint, orig)) +FUNC(val_mpoint, ecc_montgomery_diff_add, ARG(val_mpoint, P), + ARG(val_mpoint, Q), ARG(val_mpoint, PminusQ)) +FUNC(val_mpoint, ecc_montgomery_double, ARG(val_mpoint, P)) +FUNC(val_mpoint, ecc_montgomery_multiply, ARG(val_mpoint, B), ARG(val_mpint, n)) +FUNC(void, ecc_montgomery_get_affine, ARG(val_mpoint, P), ARG(out_val_mpint, x)) +FUNC(boolean, ecc_montgomery_is_identity, ARG(val_mpoint, P)) +FUNC(val_ecurve, ecc_edwards_curve, ARG(val_mpint, p), ARG(val_mpint, d), + ARG(val_mpint, a), ARG(opt_val_mpint, nonsquare_mod_p)) +FUNC(val_epoint, ecc_edwards_point_new, ARG(val_ecurve, curve), + ARG(val_mpint, x), ARG(val_mpint, y)) +FUNC(val_epoint, ecc_edwards_point_new_from_y, ARG(val_ecurve, curve), + ARG(val_mpint, y), ARG(uint, desired_x_parity)) +FUNC(val_epoint, ecc_edwards_point_copy, ARG(val_epoint, orig)) +FUNC(val_epoint, ecc_edwards_add, ARG(val_epoint, P), ARG(val_epoint, Q)) +FUNC(val_epoint, ecc_edwards_multiply, ARG(val_epoint, B), ARG(val_mpint, n)) +FUNC(uint, ecc_edwards_eq, ARG(val_epoint, P), ARG(val_epoint, Q)) +FUNC(void, ecc_edwards_get_affine, ARG(val_epoint, P), ARG(out_val_mpint, x), + ARG(out_val_mpint, y)) + +/* + * The ssh_hash abstraction. Note the 'consumed', indicating that + * ssh_hash_final puts its input ssh_hash beyond use. + * + * ssh_hash_update is an invention of testcrypt, handled in the real C + * API by the hash object also functioning as a BinarySink. + */ +FUNC(opt_val_hash, ssh_hash_new, ARG(hashalg, alg)) +FUNC(void, ssh_hash_reset, ARG(val_hash, h)) +FUNC(val_hash, ssh_hash_copy, ARG(val_hash, orig)) +FUNC_WRAPPED(val_string, ssh_hash_digest, ARG(val_hash, h)) +FUNC_WRAPPED(val_string, ssh_hash_final, ARG(consumed_val_hash, h)) +FUNC(void, ssh_hash_update, ARG(val_hash, h), ARG(val_string_ptrlen, data)) + +FUNC(opt_val_hash, blake2b_new_general, ARG(uint, hashlen)) + +/* + * The ssh2_mac abstraction. Note the optional ssh_cipher parameter + * to ssh2_mac_new. Also, again, I've invented an ssh2_mac_update so + * you can put data into the MAC. + */ +FUNC(val_mac, ssh2_mac_new, ARG(macalg, alg), ARG(opt_val_cipher, cipher)) +FUNC(void, ssh2_mac_setkey, ARG(val_mac, m), ARG(val_string_ptrlen, key)) +FUNC(void, ssh2_mac_start, ARG(val_mac, m)) +FUNC(void, ssh2_mac_update, ARG(val_mac, m), ARG(val_string_ptrlen, data)) +FUNC_WRAPPED(val_string, ssh2_mac_genresult, ARG(val_mac, m)) +FUNC(val_string_asciz_const, ssh2_mac_text_name, ARG(val_mac, m)) + +/* + * The ssh_key abstraction. All the uses of BinarySink and + * BinarySource in parameters are replaced with ordinary strings for + * the testing API: new_priv_openssh just takes a string input, and + * all the functions that output key and signature blobs do it by + * returning a string. + */ +FUNC(val_key, ssh_key_new_pub, ARG(keyalg, alg), ARG(val_string_ptrlen, pub)) +FUNC(opt_val_key, ssh_key_new_priv, ARG(keyalg, alg), + ARG(val_string_ptrlen, pub), ARG(val_string_ptrlen, priv)) +FUNC(opt_val_key, ssh_key_new_priv_openssh, ARG(keyalg, alg), + ARG(val_string_binarysource, src)) +FUNC(opt_val_string_asciz, ssh_key_invalid, ARG(val_key, key), ARG(uint, flags)) +FUNC(void, ssh_key_sign, ARG(val_key, key), ARG(val_string_ptrlen, data), + ARG(uint, flags), ARG(out_val_string_binarysink, sig)) +FUNC(boolean, ssh_key_verify, ARG(val_key, key), ARG(val_string_ptrlen, sig), + ARG(val_string_ptrlen, data)) +FUNC(void, ssh_key_public_blob, ARG(val_key, key), + ARG(out_val_string_binarysink, blob)) +FUNC(void, ssh_key_private_blob, ARG(val_key, key), + ARG(out_val_string_binarysink, blob)) +FUNC(void, ssh_key_openssh_blob, ARG(val_key, key), + ARG(out_val_string_binarysink, blob)) +FUNC(val_string_asciz, ssh_key_cache_str, ARG(val_key, key)) +FUNC(val_keycomponents, ssh_key_components, ARG(val_key, key)) +FUNC(uint, ssh_key_public_bits, ARG(keyalg, self), ARG(val_string_ptrlen, blob)) + +/* + * Accessors to retrieve the innards of a 'key_components'. + */ +FUNC(uint, key_components_count, ARG(val_keycomponents, kc)) +FUNC(opt_val_string_asciz_const, key_components_nth_name, + ARG(val_keycomponents, kc), ARG(uint, n)) +FUNC(opt_val_string_asciz_const, key_components_nth_str, + ARG(val_keycomponents, kc), ARG(uint, n)) +FUNC(opt_val_mpint, key_components_nth_mp, ARG(val_keycomponents, kc), + ARG(uint, n)) + +/* + * The ssh_cipher abstraction. The in-place encrypt and decrypt + * functions are wrapped to replace them with versions that take one + * string and return a separate string. + */ +FUNC(opt_val_cipher, ssh_cipher_new, ARG(cipheralg, alg)) +FUNC_WRAPPED(void, ssh_cipher_setiv, ARG(val_cipher, c), + ARG(val_string_ptrlen, iv)) +FUNC_WRAPPED(void, ssh_cipher_setkey, ARG(val_cipher, c), + ARG(val_string_ptrlen, key)) +FUNC_WRAPPED(val_string, ssh_cipher_encrypt, ARG(val_cipher, c), + ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, ssh_cipher_decrypt, ARG(val_cipher, c), + ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, ssh_cipher_encrypt_length, ARG(val_cipher, c), + ARG(val_string_ptrlen, blk), ARG(uint, seq)) +FUNC_WRAPPED(val_string, ssh_cipher_decrypt_length, ARG(val_cipher, c), + ARG(val_string_ptrlen, blk), ARG(uint, seq)) + +/* + * Integer Diffie-Hellman. + */ +FUNC(val_dh, dh_setup_group, ARG(dh_group, group)) +FUNC(val_dh, dh_setup_gex, ARG(val_mpint, p), ARG(val_mpint, g)) +FUNC(uint, dh_modulus_bit_size, ARG(val_dh, ctx)) +FUNC(val_mpint, dh_create_e, ARG(val_dh, ctx)) +FUNC_WRAPPED(boolean, dh_validate_f, ARG(val_dh, ctx), ARG(val_mpint, f)) +FUNC(val_mpint, dh_find_K, ARG(val_dh, ctx), ARG(val_mpint, f)) + +/* + * Elliptic-curve Diffie-Hellman. + */ +FUNC(val_ecdh, ssh_ecdhkex_newkey, ARG(ecdh_alg, alg)) +FUNC(void, ssh_ecdhkex_getpublic, ARG(val_ecdh, key), + ARG(out_val_string_binarysink, pub)) +FUNC(opt_val_mpint, ssh_ecdhkex_getkey, ARG(val_ecdh, key), + ARG(val_string_ptrlen, pub)) + +/* + * RSA key exchange, and also the BinarySource get function + * get_ssh1_rsa_priv_agent, which is a convenient way to make an + * RSAKey for RSA kex testing purposes. + */ +FUNC(val_rsakex, ssh_rsakex_newkey, ARG(val_string_ptrlen, data)) +FUNC(uint, ssh_rsakex_klen, ARG(val_rsakex, key)) +FUNC(val_string, ssh_rsakex_encrypt, ARG(val_rsakex, key), ARG(hashalg, h), + ARG(val_string_ptrlen, plaintext)) +FUNC(opt_val_mpint, ssh_rsakex_decrypt, ARG(val_rsakex, key), ARG(hashalg, h), + ARG(val_string_ptrlen, ciphertext)) +FUNC(val_rsakex, get_rsa_ssh1_priv_agent, ARG(val_string_binarysource, src)) + +/* + * Bare RSA keys as used in SSH-1. The construction API functions + * write into an existing RSAKey object, so I've invented an 'rsa_new' + * function to make one in the first place. + */ +FUNC(val_rsa, rsa_new, VOID) +FUNC(void, get_rsa_ssh1_pub, ARG(val_string_binarysource, src), + ARG(val_rsa, key), ARG(rsaorder, order)) +FUNC(void, get_rsa_ssh1_priv, ARG(val_string_binarysource, src), + ARG(val_rsa, key)) +FUNC_WRAPPED(opt_val_string, rsa_ssh1_encrypt, ARG(val_string_ptrlen, data), + ARG(val_rsa, key)) +FUNC(val_mpint, rsa_ssh1_decrypt, ARG(val_mpint, input), ARG(val_rsa, key)) +FUNC_WRAPPED(val_string, rsa_ssh1_decrypt_pkcs1, ARG(val_mpint, input), + ARG(val_rsa, key)) +FUNC(val_string_asciz, rsastr_fmt, ARG(val_rsa, key)) +FUNC(val_string_asciz, rsa_ssh1_fingerprint, ARG(val_rsa, key)) +FUNC(void, rsa_ssh1_public_blob, ARG(out_val_string_binarysink, blob), + ARG(val_rsa, key), ARG(rsaorder, order)) +FUNC(int, rsa_ssh1_public_blob_len, ARG(val_string_ptrlen, data)) +FUNC(void, rsa_ssh1_private_blob_agent, ARG(out_val_string_binarysink, blob), + ARG(val_rsa, key)) + +/* + * The PRNG type. Similarly to hashes and MACs, I've invented an extra + * function prng_seed_update for putting seed data into the PRNG's + * exposed BinarySink. + */ +FUNC(val_prng, prng_new, ARG(hashalg, hashalg)) +FUNC(void, prng_seed_begin, ARG(val_prng, pr)) +FUNC(void, prng_seed_update, ARG(val_prng, pr), ARG(val_string_ptrlen, data)) +FUNC(void, prng_seed_finish, ARG(val_prng, pr)) +FUNC_WRAPPED(val_string, prng_read, ARG(val_prng, pr), ARG(uint, size)) +FUNC(void, prng_add_entropy, ARG(val_prng, pr), ARG(uint, source_id), + ARG(val_string_ptrlen, data)) + +/* + * Key load/save functions, or rather, the BinarySource / strbuf API + * that sits just inside the file I/O versions. + */ +FUNC(boolean, ppk_encrypted_s, ARG(val_string_binarysource, src), + ARG(out_opt_val_string_asciz, comment)) +FUNC(boolean, rsa1_encrypted_s, ARG(val_string_binarysource, src), + ARG(out_opt_val_string_asciz, comment)) +FUNC(boolean, ppk_loadpub_s, ARG(val_string_binarysource, src), + ARG(out_opt_val_string_asciz, algorithm), + ARG(out_val_string_binarysink, blob), + ARG(out_opt_val_string_asciz, comment), + ARG(out_opt_val_string_asciz_const, error)) +FUNC(int, rsa1_loadpub_s, ARG(val_string_binarysource, src), + ARG(out_val_string_binarysink, blob), + ARG(out_opt_val_string_asciz, comment), + ARG(out_opt_val_string_asciz_const, error)) +FUNC_WRAPPED(opt_val_key, ppk_load_s, ARG(val_string_binarysource, src), + ARG(out_opt_val_string_asciz, comment), + ARG(opt_val_string_asciz, passphrase), + ARG(out_opt_val_string_asciz_const, error)) +FUNC_WRAPPED(int, rsa1_load_s, ARG(val_string_binarysource, src), + ARG(val_rsa, key), ARG(out_opt_val_string_asciz, comment), + ARG(opt_val_string_asciz, passphrase), + ARG(out_opt_val_string_asciz_const, error)) +FUNC_WRAPPED(val_string, ppk_save_sb, ARG(val_key, key), + ARG(opt_val_string_asciz, comment), + ARG(opt_val_string_asciz, passphrase), ARG(uint, fmt_version), + ARG(argon2flavour, flavour), ARG(uint, mem), ARG(uint, passes), + ARG(uint, parallel)) +FUNC_WRAPPED(val_string, rsa1_save_sb, ARG(val_rsa, key), + ARG(opt_val_string_asciz, comment), + ARG(opt_val_string_asciz, passphrase)) + +FUNC(val_string_asciz, ssh2_fingerprint_blob, ARG(val_string_ptrlen, blob), + ARG(fptype, fptype)) + +/* + * Password hashing. + */ +FUNC_WRAPPED(val_string, argon2, ARG(argon2flavour, flavour), ARG(uint, mem), + ARG(uint, passes), ARG(uint, parallel), ARG(uint, taglen), + ARG(val_string_ptrlen, P), ARG(val_string_ptrlen, S), + ARG(val_string_ptrlen, K), ARG(val_string_ptrlen, X)) +FUNC(val_string, argon2_long_hash, ARG(uint, length), + ARG(val_string_ptrlen, data)) +FUNC_WRAPPED(val_string, openssh_bcrypt, ARG(val_string_ptrlen, passphrase), + ARG(val_string_ptrlen, salt), ARG(uint, rounds), + ARG(uint, outbytes)) + +/* + * Key generation functions. + */ +FUNC_WRAPPED(val_key, rsa_generate, ARG(uint, bits), ARG(boolean, strong), + ARG(val_pgc, pgc)) +FUNC_WRAPPED(val_key, dsa_generate, ARG(uint, bits), ARG(val_pgc, pgc)) +FUNC_WRAPPED(opt_val_key, ecdsa_generate, ARG(uint, bits)) +FUNC_WRAPPED(opt_val_key, eddsa_generate, ARG(uint, bits)) +FUNC(val_rsa, rsa1_generate, ARG(uint, bits), ARG(boolean, strong), + ARG(val_pgc, pgc)) +FUNC(val_pgc, primegen_new_context, ARG(primegenpolicy, policy)) +FUNC_WRAPPED(opt_val_mpint, primegen_generate, ARG(val_pgc, ctx), + ARG(consumed_val_pcs, pcs)) +FUNC(val_string, primegen_mpu_certificate, ARG(val_pgc, ctx), ARG(val_mpint, p)) +FUNC(val_pcs, pcs_new, ARG(uint, bits)) +FUNC(val_pcs, pcs_new_with_firstbits, ARG(uint, bits), ARG(uint, first), + ARG(uint, nfirst)) +FUNC(void, pcs_require_residue, ARG(val_pcs, s), ARG(val_mpint, mod), + ARG(val_mpint, res)) +FUNC(void, pcs_require_residue_1, ARG(val_pcs, s), ARG(val_mpint, mod)) +FUNC(void, pcs_require_residue_1_mod_prime, ARG(val_pcs, s), + ARG(val_mpint, mod)) +FUNC(void, pcs_avoid_residue_small, ARG(val_pcs, s), ARG(uint, mod), + ARG(uint, res)) +FUNC(void, pcs_try_sophie_germain, ARG(val_pcs, s)) +FUNC(void, pcs_set_oneshot, ARG(val_pcs, s)) +FUNC(void, pcs_ready, ARG(val_pcs, s)) +FUNC(void, pcs_inspect, ARG(val_pcs, pcs), ARG(out_val_mpint, limit_out), + ARG(out_val_mpint, factor_out), ARG(out_val_mpint, addend_out)) +FUNC(val_mpint, pcs_generate, ARG(val_pcs, s)) +FUNC(val_pockle, pockle_new, VOID) +FUNC(uint, pockle_mark, ARG(val_pockle, pockle)) +FUNC(void, pockle_release, ARG(val_pockle, pockle), ARG(uint, mark)) +FUNC(pocklestatus, pockle_add_small_prime, ARG(val_pockle, pockle), + ARG(val_mpint, p)) +FUNC_WRAPPED(pocklestatus, pockle_add_prime, ARG(val_pockle, pockle), + ARG(val_mpint, p), ARG(mpint_list, factors), + ARG(val_mpint, witness)) +FUNC(val_string, pockle_mpu, ARG(val_pockle, pockle), ARG(val_mpint, p)) +FUNC(val_millerrabin, miller_rabin_new, ARG(val_mpint, p)) +FUNC(mr_result, miller_rabin_test, ARG(val_millerrabin, mr), ARG(val_mpint, w)) + +/* + * Miscellaneous. + */ +FUNC(val_wpoint, ecdsa_public, ARG(val_mpint, private_key), ARG(keyalg, alg)) +FUNC(val_epoint, eddsa_public, ARG(val_mpint, private_key), ARG(keyalg, alg)) +FUNC_WRAPPED(val_string, des_encrypt_xdmauth, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, des_decrypt_xdmauth, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, des3_encrypt_pubkey, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, des3_decrypt_pubkey, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, des3_encrypt_pubkey_ossh, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, iv), ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, des3_decrypt_pubkey_ossh, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, iv), ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, aes256_encrypt_pubkey, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, iv), ARG(val_string_ptrlen, blk)) +FUNC_WRAPPED(val_string, aes256_decrypt_pubkey, ARG(val_string_ptrlen, key), + ARG(val_string_ptrlen, iv), ARG(val_string_ptrlen, blk)) +FUNC(uint, crc32_rfc1662, ARG(val_string_ptrlen, data)) +FUNC(uint, crc32_ssh1, ARG(val_string_ptrlen, data)) +FUNC(uint, crc32_update, ARG(uint, crc_input), ARG(val_string_ptrlen, data)) +FUNC(boolean, crcda_detect, ARG(val_string_ptrlen, packet), + ARG(val_string_ptrlen, iv)) +FUNC(val_string, get_implementations_commasep, ARG(val_string_ptrlen, alg)) +FUNC(void, http_digest_response, ARG(out_val_string_binarysink, response), + ARG(val_string_ptrlen, username), ARG(val_string_ptrlen, password), + ARG(val_string_ptrlen, realm), ARG(val_string_ptrlen, method), + ARG(val_string_ptrlen, uri), ARG(val_string_ptrlen, qop), + ARG(val_string_ptrlen, nonce), ARG(val_string_ptrlen, opaque), + ARG(uint, nonce_count), ARG(httpdigesthash, hash), + ARG(boolean, hash_username)) + +/* + * These functions aren't part of PuTTY's own API, but are additions + * by testcrypt itself for administrative purposes. + */ +FUNC(void, random_queue, ARG(val_string_ptrlen, data)) +FUNC(uint, random_queue_len, VOID) +FUNC(void, random_make_prng, ARG(hashalg, hashalg), + ARG(val_string_ptrlen, seed)) +FUNC(void, random_clear, VOID) diff --git a/code/testcrypt.c b/code/test/testcrypt.c similarity index 65% rename from code/testcrypt.c rename to code/test/testcrypt.c index 6762775..5e0b73d 100644 --- a/code/testcrypt.c +++ b/code/test/testcrypt.c @@ -34,7 +34,8 @@ #include "sshkeygen.h" #include "misc.h" #include "mpint.h" -#include "ecc.h" +#include "crypto/ecc.h" +#include "proxy/cproxy.h" static NORETURN PRINTF_LIKE(1, 2) void fatal_error(const char *p, ...) { @@ -49,13 +50,6 @@ static NORETURN PRINTF_LIKE(1, 2) void fatal_error(const char *p, ...) void out_of_memory(void) { fatal_error("out of memory"); } -/* For platforms where getticks is defined within this code base */ -unsigned long (getticks)(void) -{ unreachable("this is a stub needed to link, and should never be called"); } - -FILE *f_open(const struct Filename *fn, char const *mode, bool private) -{ unreachable("f_open should never be called by this test program"); } - static bool old_keyfile_warning_given; void old_keyfile_warning(void) { old_keyfile_warning_given = true; } @@ -101,6 +95,7 @@ uint64_t prng_reseed_time_ms(void) X(pcs, PrimeCandidateSource *, pcs_free(v)) \ X(pgc, PrimeGenerationContext *, primegen_free_context(v)) \ X(pockle, Pockle *, pockle_free(v)) \ + X(millerrabin, MillerRabin *, miller_rabin_free(v)) \ /* end of list */ typedef struct Value Value; @@ -205,251 +200,65 @@ static ptrlen get_word(BinarySource *in) return toret; } -static const ssh_hashalg *get_hashalg(BinarySource *in) -{ - static const struct { - const char *key; - const ssh_hashalg *value; - } algs[] = { - {"md5", &ssh_md5}, - {"sha1", &ssh_sha1}, - {"sha1_sw", &ssh_sha1_sw}, - {"sha1_hw", &ssh_sha1_hw}, - {"sha256", &ssh_sha256}, - {"sha256_sw", &ssh_sha256_sw}, - {"sha256_hw", &ssh_sha256_hw}, - {"sha384", &ssh_sha384}, - {"sha384_sw", &ssh_sha384_sw}, - {"sha384_hw", &ssh_sha384_hw}, - {"sha512", &ssh_sha512}, - {"sha512_sw", &ssh_sha512_sw}, - {"sha512_hw", &ssh_sha512_hw}, - {"sha3_224", &ssh_sha3_224}, - {"sha3_256", &ssh_sha3_256}, - {"sha3_384", &ssh_sha3_384}, - {"sha3_512", &ssh_sha3_512}, - {"shake256_114bytes", &ssh_shake256_114bytes}, - {"blake2b", &ssh_blake2b}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("hashalg '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static const ssh2_macalg *get_macalg(BinarySource *in) -{ - static const struct { - const char *key; - const ssh2_macalg *value; - } algs[] = { - {"hmac_md5", &ssh_hmac_md5}, - {"hmac_sha1", &ssh_hmac_sha1}, - {"hmac_sha1_buggy", &ssh_hmac_sha1_buggy}, - {"hmac_sha1_96", &ssh_hmac_sha1_96}, - {"hmac_sha1_96_buggy", &ssh_hmac_sha1_96_buggy}, - {"hmac_sha256", &ssh_hmac_sha256}, - {"poly1305", &ssh2_poly1305}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("macalg '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static const ssh_keyalg *get_keyalg(BinarySource *in) -{ - static const struct { - const char *key; - const ssh_keyalg *value; - } algs[] = { - {"dsa", &ssh_dss}, - {"rsa", &ssh_rsa}, - {"ed25519", &ssh_ecdsa_ed25519}, - {"ed448", &ssh_ecdsa_ed448}, - {"p256", &ssh_ecdsa_nistp256}, - {"p384", &ssh_ecdsa_nistp384}, - {"p521", &ssh_ecdsa_nistp521}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("keyalg '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static const ssh_cipheralg *get_cipheralg(BinarySource *in) -{ - static const struct { - const char *key; - const ssh_cipheralg *value; - } algs[] = { - {"3des_ctr", &ssh_3des_ssh2_ctr}, - {"3des_ssh2", &ssh_3des_ssh2}, - {"3des_ssh1", &ssh_3des_ssh1}, - {"des_cbc", &ssh_des}, - {"aes256_ctr", &ssh_aes256_sdctr}, - {"aes256_ctr_hw", &ssh_aes256_sdctr_hw}, - {"aes256_ctr_sw", &ssh_aes256_sdctr_sw}, - {"aes256_cbc", &ssh_aes256_cbc}, - {"aes256_cbc_hw", &ssh_aes256_cbc_hw}, - {"aes256_cbc_sw", &ssh_aes256_cbc_sw}, - {"aes192_ctr", &ssh_aes192_sdctr}, - {"aes192_ctr_hw", &ssh_aes192_sdctr_hw}, - {"aes192_ctr_sw", &ssh_aes192_sdctr_sw}, - {"aes192_cbc", &ssh_aes192_cbc}, - {"aes192_cbc_hw", &ssh_aes192_cbc_hw}, - {"aes192_cbc_sw", &ssh_aes192_cbc_sw}, - {"aes128_ctr", &ssh_aes128_sdctr}, - {"aes128_ctr_hw", &ssh_aes128_sdctr_hw}, - {"aes128_ctr_sw", &ssh_aes128_sdctr_sw}, - {"aes128_cbc", &ssh_aes128_cbc}, - {"aes128_cbc_hw", &ssh_aes128_cbc_hw}, - {"aes128_cbc_sw", &ssh_aes128_cbc_sw}, - {"blowfish_ctr", &ssh_blowfish_ssh2_ctr}, - {"blowfish_ssh2", &ssh_blowfish_ssh2}, - {"blowfish_ssh1", &ssh_blowfish_ssh1}, - {"arcfour256", &ssh_arcfour256_ssh2}, - {"arcfour128", &ssh_arcfour128_ssh2}, - {"chacha20_poly1305", &ssh2_chacha20_poly1305}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("cipheralg '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static const ssh_kex *get_dh_group(BinarySource *in) -{ - static const struct { - const char *key; - const ssh_kexes *value; - } algs[] = { - {"group1", &ssh_diffiehellman_group1}, - {"group14", &ssh_diffiehellman_group14}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value->list[0]; - - fatal_error("dh_group '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static const ssh_kex *get_ecdh_alg(BinarySource *in) -{ - static const struct { - const char *key; - const ssh_kex *value; - } algs[] = { - {"curve25519", &ssh_ec_kex_curve25519}, - {"curve448", &ssh_ec_kex_curve448}, - {"nistp256", &ssh_ec_kex_nistp256}, - {"nistp384", &ssh_ec_kex_nistp384}, - {"nistp521", &ssh_ec_kex_nistp521}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("ecdh_alg '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static RsaSsh1Order get_rsaorder(BinarySource *in) -{ - static const struct { - const char *key; - RsaSsh1Order value; - } orders[] = { - {"exponent_first", RSA_SSH1_EXPONENT_FIRST}, - {"modulus_first", RSA_SSH1_MODULUS_FIRST}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(orders); i++) - if (ptrlen_eq_string(name, orders[i].key)) - return orders[i].value; - - fatal_error("rsaorder '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static const PrimeGenerationPolicy *get_primegenpolicy(BinarySource *in) -{ - static const struct { - const char *key; - const PrimeGenerationPolicy *value; - } algs[] = { - {"probabilistic", &primegen_probabilistic}, - {"provable_fast", &primegen_provable_fast}, - {"provable_maurer_simple", &primegen_provable_maurer_simple}, - {"provable_maurer_complex", &primegen_provable_maurer_complex}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("primegenpolicy '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static Argon2Flavour get_argon2flavour(BinarySource *in) -{ - static const struct { - const char *key; - Argon2Flavour value; - } algs[] = { - {"d", Argon2d}, - {"i", Argon2i}, - {"id", Argon2id}, - /* I expect to forget which spelling I chose, so let's support many */ - {"argon2d", Argon2d}, - {"argon2i", Argon2i}, - {"argon2id", Argon2id}, - {"Argon2d", Argon2d}, - {"Argon2i", Argon2i}, - {"Argon2id", Argon2id}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(algs); i++) - if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value; - - fatal_error("Argon2 flavour '%.*s': not found", PTRLEN_PRINTF(name)); -} - -static FingerprintType get_fptype(BinarySource *in) -{ - static const struct { - const char *key; - FingerprintType value; - } ids[] = { - {"md5", SSH_FPTYPE_MD5}, - {"sha256", SSH_FPTYPE_SHA256}, - }; - - ptrlen name = get_word(in); - for (size_t i = 0; i < lenof(ids); i++) - if (ptrlen_eq_string(name, ids[i].key)) - return ids[i].value; - - fatal_error("fingerprint type '%.*s': not found", PTRLEN_PRINTF(name)); -} +typedef uintmax_t TD_uint; +typedef bool TD_boolean; +typedef ptrlen TD_val_string_ptrlen; +typedef char *TD_val_string_asciz; +typedef BinarySource *TD_val_string_binarysource; +typedef unsigned *TD_out_uint; +typedef BinarySink *TD_out_val_string_binarysink; +typedef const char *TD_opt_val_string_asciz; +typedef char **TD_out_val_string_asciz; +typedef char **TD_out_opt_val_string_asciz; +typedef const char **TD_out_opt_val_string_asciz_const; +typedef ssh_hash *TD_consumed_val_hash; +typedef const ssh_hashalg *TD_hashalg; +typedef const ssh2_macalg *TD_macalg; +typedef const ssh_keyalg *TD_keyalg; +typedef const ssh_cipheralg *TD_cipheralg; +typedef const ssh_kex *TD_dh_group; +typedef const ssh_kex *TD_ecdh_alg; +typedef RsaSsh1Order TD_rsaorder; +typedef key_components *TD_keycomponents; +typedef const PrimeGenerationPolicy *TD_primegenpolicy; +typedef struct mpint_list TD_mpint_list; +typedef PockleStatus TD_pocklestatus; +typedef struct mr_result TD_mr_result; +typedef Argon2Flavour TD_argon2flavour; +typedef FingerprintType TD_fptype; +typedef HttpDigestHash TD_httpdigesthash; + +#define BEGIN_ENUM_TYPE(name) \ + static bool enum_translate_##name(ptrlen valname, TD_##name *out) { \ + static const struct { \ + const char *key; \ + TD_##name value; \ + } mapping[] = { +#define ENUM_VALUE(name, value) {name, value}, +#define END_ENUM_TYPE(name) \ + }; \ + for (size_t i = 0; i < lenof(mapping); i++) \ + if (ptrlen_eq_string(valname, mapping[i].key)) { \ + if (out) \ + *out = mapping[i].value; \ + return true; \ + } \ + return false; \ + } \ + \ + static TD_##name get_##name(BinarySource *in) { \ + ptrlen valname = get_word(in); \ + TD_##name out; \ + if (enum_translate_##name(valname, &out)) \ + return out; \ + else \ + fatal_error("%s '%.*s': not found", \ + #name, PTRLEN_PRINTF(valname)); \ + } +#include "testcrypt-enum.h" +#undef BEGIN_ENUM_TYPE +#undef ENUM_VALUE +#undef END_ENUM_TYPE static uintmax_t get_uint(BinarySource *in) { @@ -580,7 +389,7 @@ static struct mpint_list get_mpint_list(BinarySource *in) static void finaliser_return_uint(strbuf *out, void *ctx) { unsigned *uval = (unsigned *)ctx; - strbuf_catf(out, "%u\n", *uval); + put_fmt(out, "%u\n", *uval); sfree(uval); } @@ -608,7 +417,7 @@ static void finaliser_return_opt_string_asciz(strbuf *out, void *ctx) char *val = *valp; sfree(valp); if (!val) - strbuf_catf(out, "NULL\n"); + put_fmt(out, "NULL\n"); else return_val_string_asciz(out, val); } @@ -627,7 +436,7 @@ static void finaliser_return_opt_string_asciz_const(strbuf *out, void *ctx) const char *val = *valp; sfree(valp); if (!val) - strbuf_catf(out, "NULL\n"); + put_fmt(out, "NULL\n"); else return_val_string_asciz_const(out, val); } @@ -664,29 +473,29 @@ GET_CONSUMED_FN(pcs) static void return_int(strbuf *out, intmax_t u) { - strbuf_catf(out, "%"PRIdMAX"\n", u); + put_fmt(out, "%"PRIdMAX"\n", u); } static void return_uint(strbuf *out, uintmax_t u) { - strbuf_catf(out, "0x%"PRIXMAX"\n", u); + put_fmt(out, "0x%"PRIXMAX"\n", u); } static void return_boolean(strbuf *out, bool b) { - strbuf_catf(out, "%s\n", b ? "true" : "false"); + put_fmt(out, "%s\n", b ? "true" : "false"); } static void return_pocklestatus(strbuf *out, PockleStatus status) { switch (status) { default: - strbuf_catf(out, "POCKLE_BAD_STATUS_VALUE\n"); + put_fmt(out, "POCKLE_BAD_STATUS_VALUE\n"); break; #define STATUS_CASE(id) \ case id: \ - strbuf_catf(out, "%s\n", #id); \ + put_fmt(out, "%s\n", #id); \ break; POCKLE_STATUSES(STATUS_CASE); @@ -696,6 +505,16 @@ static void return_pocklestatus(strbuf *out, PockleStatus status) } } +static void return_mr_result(strbuf *out, struct mr_result result) +{ + if (!result.passed) + put_fmt(out, "failed\n"); + else if (!result.potential_primitive_root) + put_fmt(out, "passed\n"); + else + put_fmt(out, "passed+ppr\n"); +} + static void return_val_string_asciz_const(strbuf *out, const char *s) { strbuf *sb = strbuf_new(); @@ -713,7 +532,7 @@ static void return_val_string_asciz(strbuf *out, char *s) static void return_opt_##type_name(strbuf *out, c_type ptr) \ { \ if (!ptr) \ - strbuf_catf(out, "NULL\n"); \ + put_fmt(out, "NULL\n"); \ else \ return_##type_name(out, ptr); \ } @@ -728,7 +547,7 @@ NULLABLE_RETURN_WRAPPER(val_mpint, mp_int *) static void handle_hello(BinarySource *in, strbuf *out) { - strbuf_catf(out, "hello, world\n"); + put_fmt(out, "hello, world\n"); } static void rsa_free(RSAKey *rsa) @@ -781,7 +600,7 @@ static void handle_getstring(BinarySource *in, strbuf *out) if (c > ' ' && c < 0x7F && c != '%') { put_byte(out, c); } else { - strbuf_catf(out, "%%%02X", 0xFFU & (unsigned)c); + put_fmt(out, "%%%02X", 0xFFU & (unsigned)c); } } put_byte(out, '\n'); @@ -800,10 +619,29 @@ static void handle_mp_dump(BinarySource *in, strbuf *out) { mp_int *mp = get_val_mpint(in); for (size_t i = mp_max_bytes(mp); i-- > 0 ;) - strbuf_catf(out, "%02X", mp_get_byte(mp, i)); + put_fmt(out, "%02X", mp_get_byte(mp, i)); put_byte(out, '\n'); } +static void handle_checkenum(BinarySource *in, strbuf *out) +{ + ptrlen type = get_word(in); + ptrlen value = get_word(in); + bool ok = false; + + #define BEGIN_ENUM_TYPE(name) \ + if (ptrlen_eq_string(type, #name)) \ + ok = enum_translate_##name(value, NULL); + #define ENUM_VALUE(name, value) + #define END_ENUM_TYPE(name) + #include "testcrypt-enum.h" + #undef BEGIN_ENUM_TYPE + #undef ENUM_VALUE + #undef END_ENUM_TYPE + + put_dataz(out, ok ? "ok\n" : "bad\n"); +} + static void random_queue(ptrlen pl) { bufchain_add(&random_data_queue, pl.ptr, pl.len); @@ -838,13 +676,11 @@ mp_int *monty_identity_wrapper(MontyContext *mc) { return mp_copy(monty_identity(mc)); } -#define monty_identity monty_identity_wrapper mp_int *monty_modulus_wrapper(MontyContext *mc) { return mp_copy(monty_modulus(mc)); } -#define monty_modulus monty_modulus_wrapper strbuf *ssh_hash_digest_wrapper(ssh_hash *h) { @@ -853,8 +689,6 @@ strbuf *ssh_hash_digest_wrapper(ssh_hash *h) ssh_hash_digest(h, p); return sb; } -#undef ssh_hash_digest -#define ssh_hash_digest ssh_hash_digest_wrapper strbuf *ssh_hash_final_wrapper(ssh_hash *h) { @@ -863,18 +697,14 @@ strbuf *ssh_hash_final_wrapper(ssh_hash *h) ssh_hash_final(h, p); return sb; } -#undef ssh_hash_final -#define ssh_hash_final ssh_hash_final_wrapper -void ssh_cipher_setiv_wrapper(ssh_cipher *c, ptrlen key) +void ssh_cipher_setiv_wrapper(ssh_cipher *c, ptrlen iv) { - if (key.len != ssh_cipher_alg(c)->blksize) + if (iv.len != ssh_cipher_alg(c)->blksize) fatal_error("ssh_cipher_setiv: needs exactly %d bytes", ssh_cipher_alg(c)->blksize); - ssh_cipher_setiv(c, key.ptr); + ssh_cipher_setiv(c, iv.ptr); } -#undef ssh_cipher_setiv -#define ssh_cipher_setiv ssh_cipher_setiv_wrapper void ssh_cipher_setkey_wrapper(ssh_cipher *c, ptrlen key) { @@ -883,8 +713,6 @@ void ssh_cipher_setkey_wrapper(ssh_cipher *c, ptrlen key) ssh_cipher_alg(c)->padded_keybytes); ssh_cipher_setkey(c, key.ptr); } -#undef ssh_cipher_setkey -#define ssh_cipher_setkey ssh_cipher_setkey_wrapper strbuf *ssh_cipher_encrypt_wrapper(ssh_cipher *c, ptrlen input) { @@ -896,8 +724,6 @@ strbuf *ssh_cipher_encrypt_wrapper(ssh_cipher *c, ptrlen input) ssh_cipher_encrypt(c, sb->u, sb->len); return sb; } -#undef ssh_cipher_encrypt -#define ssh_cipher_encrypt ssh_cipher_encrypt_wrapper strbuf *ssh_cipher_decrypt_wrapper(ssh_cipher *c, ptrlen input) { @@ -909,8 +735,6 @@ strbuf *ssh_cipher_decrypt_wrapper(ssh_cipher *c, ptrlen input) ssh_cipher_decrypt(c, sb->u, sb->len); return sb; } -#undef ssh_cipher_decrypt -#define ssh_cipher_decrypt ssh_cipher_decrypt_wrapper strbuf *ssh_cipher_encrypt_length_wrapper(ssh_cipher *c, ptrlen input, unsigned long seq) @@ -922,8 +746,6 @@ strbuf *ssh_cipher_encrypt_length_wrapper(ssh_cipher *c, ptrlen input, ssh_cipher_encrypt_length(c, sb->u, sb->len, seq); return sb; } -#undef ssh_cipher_encrypt_length -#define ssh_cipher_encrypt_length ssh_cipher_encrypt_length_wrapper strbuf *ssh_cipher_decrypt_length_wrapper(ssh_cipher *c, ptrlen input, unsigned long seq) @@ -935,8 +757,6 @@ strbuf *ssh_cipher_decrypt_length_wrapper(ssh_cipher *c, ptrlen input, ssh_cipher_decrypt_length(c, sb->u, sb->len, seq); return sb; } -#undef ssh_cipher_decrypt_length -#define ssh_cipher_decrypt_length ssh_cipher_decrypt_length_wrapper strbuf *ssh2_mac_genresult_wrapper(ssh2_mac *m) { @@ -945,14 +765,11 @@ strbuf *ssh2_mac_genresult_wrapper(ssh2_mac *m) ssh2_mac_genresult(m, u); return sb; } -#undef ssh2_mac_genresult -#define ssh2_mac_genresult ssh2_mac_genresult_wrapper bool dh_validate_f_wrapper(dh_ctx *dh, mp_int *f) { return dh_validate_f(dh, f) == NULL; } -#define dh_validate_f dh_validate_f_wrapper void ssh_hash_update(ssh_hash *h, ptrlen pl) { @@ -984,7 +801,6 @@ strbuf *rsa_ssh1_encrypt_wrapper(ptrlen input, RSAKey *key) } return sb; } -#define rsa_ssh1_encrypt rsa_ssh1_encrypt_wrapper strbuf *rsa_ssh1_decrypt_pkcs1_wrapper(mp_int *input, RSAKey *key) { @@ -994,7 +810,6 @@ strbuf *rsa_ssh1_decrypt_pkcs1_wrapper(mp_int *input, RSAKey *key) strbuf_clear(sb); return sb; } -#define rsa_ssh1_decrypt_pkcs1 rsa_ssh1_decrypt_pkcs1_wrapper strbuf *des_encrypt_xdmauth_wrapper(ptrlen key, ptrlen data) { @@ -1007,7 +822,6 @@ strbuf *des_encrypt_xdmauth_wrapper(ptrlen key, ptrlen data) des_encrypt_xdmauth(key.ptr, sb->u, sb->len); return sb; } -#define des_encrypt_xdmauth des_encrypt_xdmauth_wrapper strbuf *des_decrypt_xdmauth_wrapper(ptrlen key, ptrlen data) { @@ -1020,7 +834,6 @@ strbuf *des_decrypt_xdmauth_wrapper(ptrlen key, ptrlen data) des_decrypt_xdmauth(key.ptr, sb->u, sb->len); return sb; } -#define des_decrypt_xdmauth des_decrypt_xdmauth_wrapper strbuf *des3_encrypt_pubkey_wrapper(ptrlen key, ptrlen data) { @@ -1033,7 +846,6 @@ strbuf *des3_encrypt_pubkey_wrapper(ptrlen key, ptrlen data) des3_encrypt_pubkey(key.ptr, sb->u, sb->len); return sb; } -#define des3_encrypt_pubkey des3_encrypt_pubkey_wrapper strbuf *des3_decrypt_pubkey_wrapper(ptrlen key, ptrlen data) { @@ -1046,7 +858,6 @@ strbuf *des3_decrypt_pubkey_wrapper(ptrlen key, ptrlen data) des3_decrypt_pubkey(key.ptr, sb->u, sb->len); return sb; } -#define des3_decrypt_pubkey des3_decrypt_pubkey_wrapper strbuf *des3_encrypt_pubkey_ossh_wrapper(ptrlen key, ptrlen iv, ptrlen data) { @@ -1061,7 +872,6 @@ strbuf *des3_encrypt_pubkey_ossh_wrapper(ptrlen key, ptrlen iv, ptrlen data) des3_encrypt_pubkey_ossh(key.ptr, iv.ptr, sb->u, sb->len); return sb; } -#define des3_encrypt_pubkey_ossh des3_encrypt_pubkey_ossh_wrapper strbuf *des3_decrypt_pubkey_ossh_wrapper(ptrlen key, ptrlen iv, ptrlen data) { @@ -1076,7 +886,6 @@ strbuf *des3_decrypt_pubkey_ossh_wrapper(ptrlen key, ptrlen iv, ptrlen data) des3_decrypt_pubkey_ossh(key.ptr, iv.ptr, sb->u, sb->len); return sb; } -#define des3_decrypt_pubkey_ossh des3_decrypt_pubkey_ossh_wrapper strbuf *aes256_encrypt_pubkey_wrapper(ptrlen key, ptrlen iv, ptrlen data) { @@ -1091,7 +900,6 @@ strbuf *aes256_encrypt_pubkey_wrapper(ptrlen key, ptrlen iv, ptrlen data) aes256_encrypt_pubkey(key.ptr, iv.ptr, sb->u, sb->len); return sb; } -#define aes256_encrypt_pubkey aes256_encrypt_pubkey_wrapper strbuf *aes256_decrypt_pubkey_wrapper(ptrlen key, ptrlen iv, ptrlen data) { @@ -1106,7 +914,6 @@ strbuf *aes256_decrypt_pubkey_wrapper(ptrlen key, ptrlen iv, ptrlen data) aes256_decrypt_pubkey(key.ptr, iv.ptr, sb->u, sb->len); return sb; } -#define aes256_decrypt_pubkey aes256_decrypt_pubkey_wrapper strbuf *prng_read_wrapper(prng *pr, size_t size) { @@ -1114,7 +921,6 @@ strbuf *prng_read_wrapper(prng *pr, size_t size) prng_read(pr, strbuf_append(sb, size), size); return sb; } -#define prng_read prng_read_wrapper void prng_seed_update(prng *pr, ptrlen data) { @@ -1150,7 +956,6 @@ ssh_key *ppk_load_s_wrapper(BinarySource *src, char **comment, sfree(uk); return toret; } -#define ppk_load_s ppk_load_s_wrapper int rsa1_load_s_wrapper(BinarySource *src, RSAKey *rsa, char **comment, const char *passphrase, const char **errorstr) @@ -1160,7 +965,6 @@ int rsa1_load_s_wrapper(BinarySource *src, RSAKey *rsa, char **comment, rsa->comment = NULL; return toret; } -#define rsa1_load_s rsa1_load_s_wrapper strbuf *ppk_save_sb_wrapper( ssh_key *key, const char *comment, const char *passphrase, @@ -1187,7 +991,6 @@ strbuf *ppk_save_sb_wrapper( sfree(uk.comment); return toret; } -#define ppk_save_sb ppk_save_sb_wrapper strbuf *rsa1_save_sb_wrapper(RSAKey *key, const char *comment, const char *passphrase) @@ -1198,7 +1001,6 @@ strbuf *rsa1_save_sb_wrapper(RSAKey *key, const char *comment, key->comment = NULL; return toret; } -#define rsa1_save_sb rsa1_save_sb_wrapper #define return_void(out, expression) (expression) @@ -1209,7 +1011,6 @@ mp_int *primegen_generate_wrapper( { return primegen_generate(ctx, pcs, &null_progress); } -#define primegen_generate primegen_generate_wrapper RSAKey *rsa1_generate(int bits, bool strong, PrimeGenerationContext *pgc) { @@ -1224,15 +1025,13 @@ ssh_key *rsa_generate_wrapper(int bits, bool strong, { return &rsa1_generate(bits, strong, pgc)->sshk; } -#define rsa_generate rsa_generate_wrapper ssh_key *dsa_generate_wrapper(int bits, PrimeGenerationContext *pgc) { - struct dss_key *dsskey = snew(struct dss_key); - dsa_generate(dsskey, bits, pgc, &null_progress); - return &dsskey->sshk; + struct dsa_key *dsakey = snew(struct dsa_key); + dsa_generate(dsakey, bits, pgc, &null_progress); + return &dsakey->sshk; } -#define dsa_generate dsa_generate_wrapper ssh_key *ecdsa_generate_wrapper(int bits) { @@ -1243,7 +1042,6 @@ ssh_key *ecdsa_generate_wrapper(int bits) } return &ek->sshk; } -#define ecdsa_generate ecdsa_generate_wrapper ssh_key *eddsa_generate_wrapper(int bits) { @@ -1254,7 +1052,6 @@ ssh_key *eddsa_generate_wrapper(int bits) } return &ek->sshk; } -#define eddsa_generate eddsa_generate_wrapper size_t key_components_count(key_components *kc) { return kc->ncomponents; } const char *key_components_nth_name(key_components *kc, size_t n) @@ -1280,7 +1077,6 @@ PockleStatus pockle_add_prime_wrapper(Pockle *pockle, mp_int *p, { return pockle_add_prime(pockle, p, mpl.integers, mpl.n, witness); } -#define pockle_add_prime pockle_add_prime_wrapper strbuf *argon2_wrapper(Argon2Flavour flavour, uint32_t mem, uint32_t passes, uint32_t parallel, uint32_t taglen, @@ -1290,7 +1086,47 @@ strbuf *argon2_wrapper(Argon2Flavour flavour, uint32_t mem, uint32_t passes, argon2(flavour, mem, passes, parallel, taglen, P, S, K, X, out); return out; } -#define argon2 argon2_wrapper + +strbuf *openssh_bcrypt_wrapper(ptrlen passphrase, ptrlen salt, + unsigned rounds, unsigned outbytes) +{ + strbuf *out = strbuf_new(); + openssh_bcrypt(passphrase, salt, rounds, + strbuf_append(out, outbytes), outbytes); + return out; +} + +strbuf *get_implementations_commasep(ptrlen alg) +{ + strbuf *out = strbuf_new(); + put_datapl(out, alg); + + if (ptrlen_startswith(alg, PTRLEN_LITERAL("aes"), NULL)) { + put_fmt(out, ",%.*s_sw", PTRLEN_PRINTF(alg)); +#if HAVE_AES_NI + put_fmt(out, ",%.*s_ni", PTRLEN_PRINTF(alg)); +#endif +#if HAVE_NEON_CRYPTO + put_fmt(out, ",%.*s_neon", PTRLEN_PRINTF(alg)); +#endif + } else if (ptrlen_startswith(alg, PTRLEN_LITERAL("sha256"), NULL) || + ptrlen_startswith(alg, PTRLEN_LITERAL("sha1"), NULL)) { + put_fmt(out, ",%.*s_sw", PTRLEN_PRINTF(alg)); +#if HAVE_SHA_NI + put_fmt(out, ",%.*s_ni", PTRLEN_PRINTF(alg)); +#endif +#if HAVE_NEON_CRYPTO + put_fmt(out, ",%.*s_neon", PTRLEN_PRINTF(alg)); +#endif + } else if (ptrlen_startswith(alg, PTRLEN_LITERAL("sha512"), NULL)) { + put_fmt(out, ",%.*s_sw", PTRLEN_PRINTF(alg)); +#if HAVE_NEON_SHA512 + put_fmt(out, ",%.*s_neon", PTRLEN_PRINTF(alg)); +#endif + } + + return out; +} #define OPTIONAL_PTR_FUNC(type) \ typedef TD_val_##type TD_opt_val_##type; \ @@ -1304,147 +1140,218 @@ OPTIONAL_PTR_FUNC(cipher) OPTIONAL_PTR_FUNC(mpint) OPTIONAL_PTR_FUNC(string) -typedef uintmax_t TD_uint; -typedef bool TD_boolean; -typedef ptrlen TD_val_string_ptrlen; -typedef char *TD_val_string_asciz; -typedef BinarySource *TD_val_string_binarysource; -typedef unsigned *TD_out_uint; -typedef BinarySink *TD_out_val_string_binarysink; -typedef const char *TD_opt_val_string_asciz; -typedef char **TD_out_val_string_asciz; -typedef char **TD_out_opt_val_string_asciz; -typedef const char **TD_out_opt_val_string_asciz_const; -typedef ssh_hash *TD_consumed_val_hash; -typedef const ssh_hashalg *TD_hashalg; -typedef const ssh2_macalg *TD_macalg; -typedef const ssh_keyalg *TD_keyalg; -typedef const ssh_cipheralg *TD_cipheralg; -typedef const ssh_kex *TD_dh_group; -typedef const ssh_kex *TD_ecdh_alg; -typedef RsaSsh1Order TD_rsaorder; -typedef key_components *TD_keycomponents; -typedef const PrimeGenerationPolicy *TD_primegenpolicy; -typedef struct mpint_list TD_mpint_list; -typedef PockleStatus TD_pocklestatus; -typedef Argon2Flavour TD_argon2flavour; -typedef FingerprintType TD_fptype; - -#define FUNC0(rettype, function) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - return_##rettype(out, function()); \ - } - -#define FUNC1(rettype, function, type1) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - return_##rettype(out, function(arg1)); \ - } - -#define FUNC2(rettype, function, type1, type2) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - return_##rettype(out, function(arg1, arg2)); \ - } - -#define FUNC3(rettype, function, type1, type2, type3) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - return_##rettype(out, function(arg1, arg2, arg3)); \ - } - -#define FUNC4(rettype, function, type1, type2, type3, type4) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - TD_##type4 arg4 = get_##type4(in); \ - return_##rettype(out, function(arg1, arg2, arg3, arg4)); \ - } - -#define FUNC5(rettype, function, type1, type2, type3, type4, type5) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - TD_##type4 arg4 = get_##type4(in); \ - TD_##type5 arg5 = get_##type5(in); \ - return_##rettype(out, function(arg1, arg2, arg3, arg4, arg5)); \ - } - -#define FUNC6(rettype, function, type1, type2, type3, type4, type5, \ - type6) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - TD_##type4 arg4 = get_##type4(in); \ - TD_##type5 arg5 = get_##type5(in); \ - TD_##type6 arg6 = get_##type6(in); \ - return_##rettype(out, function(arg1, arg2, arg3, arg4, arg5, \ - arg6)); \ - } - -#define FUNC7(rettype, function, type1, type2, type3, type4, type5, \ - type6, type7) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - TD_##type4 arg4 = get_##type4(in); \ - TD_##type5 arg5 = get_##type5(in); \ - TD_##type6 arg6 = get_##type6(in); \ - TD_##type7 arg7 = get_##type7(in); \ - return_##rettype(out, function(arg1, arg2, arg3, arg4, arg5, \ - arg6, arg7)); \ - } +/* + * HERE BE DRAGONS: the horrible C preprocessor business that reads + * testcrypt-func.h and generates a marshalling wrapper for each + * exported function. + * + * In an ideal world, we would start from a specification like this in + * testcrypt-func.h + * + * FUNC(val_foo, example, ARG(val_bar, bar), ARG(uint, n)) + * + * and generate a wrapper function looking like this: + * + * static void handle_example(BinarySource *in, strbuf *out) { + * TD_val_bar bar = get_val_bar(in); + * TD_uint n = get_uint(in); + * return_val_foo(out, example(bar, n)); + * } + * + * which would read the marshalled form of each function argument in + * turn from the input BinarySource via the get_() function + * family defined in this file; assign each argument to a local + * variable; call the underlying C function with all those arguments; + * and then call a function of the return_() family to marshal + * the output value into the output strbuf to be sent to standard + * output. + * + * With a more general macro processor such as m4, or custom code in + * Perl or Python, or a helper program like llvm-tblgen, we could just + * do that directly, reading function specifications from + * testcrypt-func.h and writing out exactly the above. But we don't + * have a fully general macro processor (since everything in that + * category introduces an extra build dependency that's awkward on + * plain Windows, or requires compiling and running a helper program + * which is awkward in a cross-compile). We only have cpp. And in cpp, + * a macro can't expand one of its arguments differently in two parts + * of its own expansion. So we have to be more clever. + * + * In place of the above code, I instead generate three successive + * declarations for each function. In simplified form they would look + * like this: + * + * typedef struct ARGS_example { + * TD_val_bar bar; + * TD_uint n; + * } ARGS_example; + * + * static inline ARGS_example get_args_example(BinarySource *in) { + * ARGS_example args; + * args.bar = get_val_bar(in); + * args.n = get_uint(in); + * return args; + * } + * + * static void handle_example(BinarySource *in, strbuf *out) { + * ARGS_example args = get_args_example(in); + * return_val_foo(out, example(args.bar, args.n)); + * } + * + * Each of these mentions the arguments and their types just _once_, + * so each one can be generated by a single expansion of the FUNC(...) + * specification in testcrypt-func.h, with FUNC and ARG and VOID + * defined to appropriate values. + * + * Or ... *nearly*. In fact, I left out several details there, but + * it's a good starting point to understand the full version. + * + * To begin with, several of the variable names shown above are + * actually named with an ugly leading underscore, to minimise the + * chance of them colliding with real parameter names. (You could + * easily imagine 'out' being the name of a parameter to one of the + * wrapped functions.) Also, we memset the whole structure to zero at + * the start of get_args_example() to avoid compiler warnings about + * uninitialised stuff, and insert a precautionary '(void)args;' in + * handle_example to avoid a similar warning about _unused_ stuff. + * + * The big problem is the commas that have to appear between arguments + * in the final call to the actual C function. Those can't be + * generated by expanding the ARG macro itself, or you'd get one too + * many - either a leading comma or a trailing comma. Trailing commas + * are legal in a Python function call, but unfortunately C is not yet + * so enlightened. (C permits a trailing comma in a struct or array + * initialiser, and is coming round to it in enums, but hasn't yet + * seen the light about function calls or function prototypes.) + * + * So the commas must appear _between_ ARG(...) specifiers. And that + * means they unavoidably appear in _every_ expansion of FUNC() (or + * rather, every expansion that uses the variadic argument list at + * all). Therefore, we need to ensure they're harmless in the other + * two functions as well. + * + * In the get_args_example() function above, there's no real problem. + * The list of assignments can perfectly well be separated by commas + * instead of semicolons, so that it becomes a single expression- + * statement instead of a sequence of them; the comma operator still + * defines a sequence point, so it's fine. + * + * But what about the structure definition of ARGS_example? + * + * To get round that, we fill the structure with pointless extra + * cruft, in the form of an extra 'int' field before and after each + * actually useful argument field. So the real structure definition + * ends up looking more like this: + * + * typedef struct ARGS_example { + * int _predummy_bar; + * TD_val_bar bar; + * int _postdummy_bar, _predummy_n; + * TD_uint n; + * int _postdummy_n; + * } ARGS_example; + * + * Those extra 'int' fields are ignored completely at run time. They + * might cause a runtime space cost if the struct doesn't get + * completely optimised away when get_args_example is inlined into + * handle_example, but even if so, that's OK, this is a test program + * whose memory usage isn't critical. The real point is that, in + * between each pair of real arguments, there's a declaration + * containing *two* int variables, and in between them is the vital + * comma that we need! + * + * So in that pass through testcrypt-func.h, the ARG(type, name) macro + * has to expand to the weird piece of text + * + * _predummy_name; // terminating the previous int declaration + * TD_type name; // declaring the thing we actually wanted + * int _postdummy_name // new declaration ready to see a comma + * + * so that a comma-separated list of pieces of expansion like that + * will fall into just the right form to be the core of the above + * expanded structure definition. Then we just need to put in the + * 'int' after the open brace, and the ';' before the closing brace, + * and we've got everything we need to make it all syntactically legal. + * + * Finally, what if a wrapped function has _no_ arguments? Two out of + * three uses of the argument list here need some kind of special case + * for that. That's why you have to write 'VOID' explicitly in an + * empty argument list in testcrypt-func.h: we make VOID expand to + * whatever is needed to avoid a syntax error in that special case. + */ -#define FUNC8(rettype, function, type1, type2, type3, type4, type5, \ - type6, type7, type8) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - TD_##type4 arg4 = get_##type4(in); \ - TD_##type5 arg5 = get_##type5(in); \ - TD_##type6 arg6 = get_##type6(in); \ - TD_##type7 arg7 = get_##type7(in); \ - TD_##type8 arg8 = get_##type8(in); \ - return_##rettype(out, function(arg1, arg2, arg3, arg4, arg5, \ - arg6, arg7, arg8)); \ +/* + * Workarounds for an awkwardness in Visual Studio's preprocessor, + * which disagrees with everyone else about what happens if you expand + * __VA_ARGS__ into the argument list of another macro. gcc and clang + * will treat the commas expanding from __VA_ARGS__ as argument + * separators, whereas VS will make them all part of a single argument + * to the secondary macro. We want the former behaviour, so we use + * the following workaround to enforce it. + * + * Each of these JUXTAPOSE macros simply places its arguments side by + * side. But the arguments are macro-expanded before JUXTAPOSE is + * called at all, so we can do this: + * + * JUXTAPOSE(macroname, (__VA_ARGS__)) + * -> JUXTAPOSE(macroname, (foo, bar, baz)) + * -> macroname (foo, bar, baz) + * + * and this preliminary expansion causes the commas to be treated + * normally by the time VS gets round to expanding the inner macro. + * + * We need two differently named JUXTAPOSE macros, because we have to + * do this trick twice: once to turn FUNC and FUNC_WRAPPED in + * testcrypt-funcs.h into the underlying common FUNC_INNER, and again + * to expand the final function call. And you can't expand a macro + * inside text expanded from the _same_ macro, so we have to do the + * outer and inner instances of this trick using macros of different + * names. + */ +#define JUXTAPOSE1(first, second) first second +#define JUXTAPOSE2(first, second) first second + +#define FUNC(outtype, fname, ...) \ + JUXTAPOSE1(FUNC_INNER, (outtype, fname, fname, __VA_ARGS__)) +#define FUNC_WRAPPED(outtype, fname, ...) \ + JUXTAPOSE1(FUNC_INNER, (outtype, fname, fname##_wrapper, __VA_ARGS__)) + +#define ARG(type, arg) _predummy_##arg; TD_##type arg; int _postdummy_##arg +#define VOID _voiddummy +#define FUNC_INNER(outtype, fname, realname, ...) \ + typedef struct ARGS_##fname { \ + int __VA_ARGS__; \ + } ARGS_##fname; +#include "testcrypt-func.h" +#undef FUNC_INNER +#undef ARG +#undef VOID + +#define ARG(type, arg) _args.arg = get_##type(_in) +#define VOID ((void)0) +#define FUNC_INNER(outtype, fname, realname, ...) \ + static inline ARGS_##fname get_args_##fname(BinarySource *_in) { \ + ARGS_##fname _args; \ + memset(&_args, 0, sizeof(_args)); \ + __VA_ARGS__; \ + return _args; \ } - -#define FUNC9(rettype, function, type1, type2, type3, type4, type5, \ - type6, type7, type8, type9) \ - static void handle_##function(BinarySource *in, strbuf *out) { \ - TD_##type1 arg1 = get_##type1(in); \ - TD_##type2 arg2 = get_##type2(in); \ - TD_##type3 arg3 = get_##type3(in); \ - TD_##type4 arg4 = get_##type4(in); \ - TD_##type5 arg5 = get_##type5(in); \ - TD_##type6 arg6 = get_##type6(in); \ - TD_##type7 arg7 = get_##type7(in); \ - TD_##type8 arg8 = get_##type8(in); \ - TD_##type9 arg9 = get_##type9(in); \ - return_##rettype(out, function(arg1, arg2, arg3, arg4, arg5, \ - arg6, arg7, arg8, arg9)); \ +#include "testcrypt-func.h" +#undef FUNC_INNER +#undef ARG +#undef VOID + +#define ARG(type, arg) _args.arg +#define VOID +#define FUNC_INNER(outtype, fname, realname, ...) \ + static void handle_##fname(BinarySource *_in, strbuf *_out) { \ + ARGS_##fname _args = get_args_##fname(_in); \ + (void)_args; /* suppress warning if no actual arguments */ \ + return_##outtype(_out, JUXTAPOSE2(realname, (__VA_ARGS__))); \ } - -#include "testcrypt.h" - -#undef FUNC9 -#undef FUNC8 -#undef FUNC7 -#undef FUNC6 -#undef FUNC5 -#undef FUNC4 -#undef FUNC3 -#undef FUNC2 -#undef FUNC1 -#undef FUNC0 +#include "testcrypt-func.h" +#undef FUNC_INNER +#undef ARG static void process_line(BinarySource *in, strbuf *out) { @@ -1464,31 +1371,18 @@ static void process_line(BinarySource *in, strbuf *out) DISPATCH_COMMAND(getstring); DISPATCH_COMMAND(mp_literal); DISPATCH_COMMAND(mp_dump); + DISPATCH_COMMAND(checkenum); #undef DISPATCH_COMMAND -#define FUNC0(ret,fn) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC1(ret,fn,x) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC2(ret,fn,x,y) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC3(ret,fn,x,y,z) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC4(ret,fn,x,y,z,v) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC5(ret,fn,x,y,z,v,w) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC6(ret,fn,x,y,z,v,w,u) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC7(ret,fn,x,y,z,v,w,u,t) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC8(ret,fn,x,y,z,v,w,u,t,s) DISPATCH_INTERNAL(#fn,handle_##fn); -#define FUNC9(ret,fn,x,y,z,v,w,u,t,s,r) DISPATCH_INTERNAL(#fn,handle_##fn); - -#include "testcrypt.h" - -#undef FUNC9 -#undef FUNC8 -#undef FUNC7 -#undef FUNC6 -#undef FUNC5 -#undef FUNC4 -#undef FUNC3 -#undef FUNC2 -#undef FUNC1 -#undef FUNC0 +#define FUNC_INNER(outtype, fname, realname, ...) \ + DISPATCH_INTERNAL(#fname,handle_##fname); +#define ARG1(type, arg) +#define ARGN(type, arg) +#define VOID +#include "testcrypt-func.h" +#undef FUNC_INNER +#undef ARG +#undef VOID #undef DISPATCH_INTERNAL diff --git a/code/test/testcrypt.py b/code/test/testcrypt.py index 686302c..6119644 100644 --- a/code/test/testcrypt.py +++ b/code/test/testcrypt.py @@ -3,6 +3,7 @@ import numbers import subprocess import re +import string import struct from binascii import hexlify @@ -102,6 +103,8 @@ def check_return_status(self): } method_lists = {t: [] for t in method_prefixes} +checked_enum_values = {} + class Value(object): def __init__(self, typename, ident): self._typename = typename @@ -148,7 +151,7 @@ def marshal_string(val): else "%{:02x}".format(b) for b in val) -def make_argword(arg, argtype, fnname, argindex, to_preserve): +def make_argword(arg, argtype, fnname, argindex, argname, to_preserve): typename, consumed = argtype if typename.startswith("opt_"): if arg is None: @@ -165,8 +168,8 @@ def make_argword(arg, argtype, fnname, argindex, to_preserve): if isinstance(arg, Value): if arg._typename != typename: raise TypeError( - "{}() argument {:d} should be {} ({} given)".format( - fnname, argindex, typename, arg._typename)) + "{}() argument #{:d} ({}) should be {} ({} given)".format( + fnname, argindex, argname, typename, arg._typename)) ident = arg._ident if consumed: arg._consumed() @@ -178,20 +181,26 @@ def make_argword(arg, argtype, fnname, argindex, to_preserve): if typename in { "hashalg", "macalg", "keyalg", "cipheralg", "dh_group", "ecdh_alg", "rsaorder", "primegenpolicy", - "argon2flavour", "fptype"}: + "argon2flavour", "fptype", "httpdigesthash"}: arg = coerce_to_bytes(arg) if isinstance(arg, bytes) and b" " not in arg: - return arg + dictkey = (typename, arg) + if dictkey not in checked_enum_values: + retwords = childprocess.funcall("checkenum", [typename, arg]) + assert len(retwords) == 1 + checked_enum_values[dictkey] = (retwords[0] == b"ok") + if checked_enum_values[dictkey]: + return arg if typename == "mpint_list": sublist = [make_argword(len(arg), ("uint", False), - fnname, argindex, to_preserve)] + fnname, argindex, argname, to_preserve)] for val in arg: sublist.append(make_argword(val, ("val_mpint", False), - fnname, argindex, to_preserve)) + fnname, argindex, argname, to_preserve)) return b" ".join(coerce_to_bytes(sub) for sub in sublist) raise TypeError( - "Can't convert {}() argument {:d} to {} (value was {!r})".format( - fnname, argindex, typename, arg)) + "Can't convert {}() argument #{:d} ({}) to {} (value was {!r})".format( + fnname, argindex, argname, typename, arg)) def unpack_string(identifier): retwords = childprocess.funcall("getstring", [identifier]) @@ -235,7 +244,7 @@ def make_retval(rettype, word, unpack_strings): elif rettype == "boolean": assert word == b"true" or word == b"false" return word == b"true" - elif rettype == "pocklestatus": + elif rettype in {"pocklestatus", "mr_result"}: return word.decode("ASCII") raise TypeError("Can't deal with return value {!r} of type {!r}" .format(word, rettype)) @@ -246,12 +255,20 @@ def make_retvals(rettypes, retwords, unpack_strings=True): for rettype, word in zip(rettypes, retwords)] class Function(object): - def __init__(self, fnname, rettypes, argtypes): + def __init__(self, fnname, rettypes, retnames, argtypes, argnames): self.fnname = fnname self.rettypes = rettypes + self.retnames = retnames self.argtypes = argtypes + self.argnames = argnames def __repr__(self): - return "".format(self.fnname) + return " ({})>".format( + self.fnname, + ", ".join(("consumed " if c else "")+t+" "+n + for (t,c),n in zip(self.argtypes, self.argnames)), + ", ".join((t+" "+n if n is not None else t) + for t,n in zip(self.rettypes, self.retnames)), + ) def __call__(self, *args): if len(args) != len(self.argtypes): raise TypeError( @@ -260,7 +277,8 @@ def __call__(self, *args): to_preserve = [] retwords = childprocess.funcall( self.fnname, [make_argword(args[i], self.argtypes[i], - self.fnname, i, to_preserve) + self.fnname, i, self.argnames[i], + to_preserve) for i in range(len(args))]) retvals = make_retvals(self.rettypes, retwords) if len(retvals) == 0: @@ -269,10 +287,94 @@ def __call__(self, *args): return retvals[0] return tuple(retvals) -def _setup(scope): - header_file = os.path.join(putty_srcdir, "testcrypt.h") +def _lex_testcrypt_header(header): + pat = re.compile( + # Skip any combination of whitespace and comments + '(?:{})*'.format('|'.join(( + '[ \t\n]', # whitespace + '/\\*(?:.|\n)*?\\*/', # C90-style /* ... */ comment, ended eagerly + '//[^\n]*\n', # C99-style comment to end-of-line + ))) + + # And then match a token + '({})'.format('|'.join(( + # Punctuation + '\(', + '\)', + ',', + # Identifier + '[A-Za-z_][A-Za-z0-9_]*', + # End of string + '$', + ))) + ) + + pos = 0 + end = len(header) + while pos < end: + m = pat.match(header, pos) + assert m is not None, ( + "Failed to lex testcrypt-func.h at byte position {:d}".format(pos)) + + pos = m.end() + tok = m.group(1) + if len(tok) == 0: + assert pos == end, ( + "Empty token should only be returned at end of string") + yield tok, m.start(1) + +def _parse_testcrypt_header(tokens): + def is_id(tok): + return tok[0] in string.ascii_letters+"_" + def expect(what, why, eof_ok=False): + tok, pos = next(tokens) + if tok == '' and eof_ok: + return None + if hasattr(what, '__call__'): + description = lambda: "" + ok = what(tok) + elif isinstance(what, set): + description = lambda: " or ".join("'"+x+"' " for x in sorted(what)) + ok = tok in what + else: + description = lambda: "'"+what+"' " + ok = tok == what + if not ok: + sys.exit("testcrypt-func.h:{:d}: expected {}{}".format( + pos, description(), why)) + return tok - linere = re.compile(r'^FUNC\d+\((.*)\)$') + while True: + tok = expect({"FUNC", "FUNC_WRAPPED"}, + "at start of function specification", eof_ok=True) + if tok is None: + break + + expect("(", "after FUNC") + rettype = expect(is_id, "return type") + expect(",", "after return type") + funcname = expect(is_id, "function name") + expect(",", "after function name") + args = [] + firstargkind = expect({"ARG", "VOID"}, "at start of argument list") + if firstargkind == "VOID": + expect(")", "after VOID") + else: + while True: + # Every time we come back to the top of this loop, we've + # just seen 'ARG' + expect("(", "after ARG") + argtype = expect(is_id, "argument type") + expect(",", "after argument type") + argname = expect(is_id, "argument name") + args.append((argtype, argname)) + expect(")", "at end of ARG") + punct = expect({",", ")"}, "after argument") + if punct == ")": + break + expect("ARG", "to begin next argument") + yield funcname, rettype, args + +def _setup(scope): valprefix = "val_" outprefix = "out_" optprefix = "opt_" @@ -288,36 +390,40 @@ def trim_argtype(arg): arg = arg[:arg.index("_", len(valprefix))] return arg - with open(header_file) as f: - for line in iter(f.readline, ""): - line = line.rstrip("\r\n").replace(" ", "") - m = linere.match(line) - if m is not None: - words = m.group(1).split(",") - function = words[1] - rettypes = [] - argtypes = [] - argsconsumed = [] - if words[0] != "void": - rettypes.append(trim_argtype(words[0])) - for arg in words[2:]: - if arg.startswith(outprefix): - rettypes.append(trim_argtype(arg[len(outprefix):])) - else: - consumed = False - if arg.startswith(consprefix): - arg = arg[len(consprefix):] - consumed = True - arg = trim_argtype(arg) - argtypes.append((arg, consumed)) - func = Function(function, rettypes, argtypes) - scope[function] = func - if len(argtypes) > 0: - t = argtypes[0][0] - if (t in method_prefixes and - function.startswith(method_prefixes[t])): - methodname = function[len(method_prefixes[t]):] - method_lists[t].append((methodname, func)) + with open(os.path.join(putty_srcdir, "test", "testcrypt-func.h")) as f: + header = f.read() + tokens = _lex_testcrypt_header(header) + for function, rettype, arglist in _parse_testcrypt_header(tokens): + rettypes = [] + retnames = [] + if rettype != "void": + rettypes.append(trim_argtype(rettype)) + retnames.append(None) + + argtypes = [] + argnames = [] + argsconsumed = [] + for arg, argname in arglist: + if arg.startswith(outprefix): + rettypes.append(trim_argtype(arg[len(outprefix):])) + retnames.append(argname) + else: + consumed = False + if arg.startswith(consprefix): + arg = arg[len(consprefix):] + consumed = True + arg = trim_argtype(arg) + argtypes.append((arg, consumed)) + argnames.append(argname) + func = Function(function, rettypes, retnames, + argtypes, argnames) + scope[function] = func + if len(argtypes) > 0: + t = argtypes[0][0] + if (t in method_prefixes and + function.startswith(method_prefixes[t])): + methodname = function[len(method_prefixes[t]):] + method_lists[t].append((methodname, func)) _setup(globals()) del _setup diff --git a/code/testsc.c b/code/test/testsc.c similarity index 93% rename from code/testsc.c rename to code/test/testsc.c index f04f718..c902966 100644 --- a/code/testsc.c +++ b/code/test/testsc.c @@ -77,9 +77,10 @@ #include "defs.h" #include "putty.h" #include "ssh.h" +#include "sshkeygen.h" #include "misc.h" #include "mpint.h" -#include "ecc.h" +#include "crypto/ecc.h" static NORETURN PRINTF_LIKE(1, 2) void fatal_error(const char *p, ...) { @@ -93,13 +94,6 @@ static NORETURN PRINTF_LIKE(1, 2) void fatal_error(const char *p, ...) } void out_of_memory(void) { fatal_error("out of memory"); } -FILE *f_open(const Filename *filename, char const *mode, bool is_private) -{ unreachable("this is a stub needed to link, and should never be called"); } -void old_keyfile_warning(void) -{ unreachable("this is a stub needed to link, and should never be called"); } -/* For platforms where getticks is defined within this code base */ -unsigned long (getticks)(void) -{ unreachable("this is a stub needed to link, and should never be called"); } /* * A simple deterministic PRNG, without any of the Fortuna @@ -137,6 +131,31 @@ void random_read(void *vbuf, size_t size) } } +struct random_state { + const char *seedstr; + uint64_t counter; + size_t limit; + uint8_t buf[MAX_HASH_LEN]; +}; + +static struct random_state random_get_state(void) +{ + struct random_state st; + st.seedstr = random_seedstr; + st.counter = random_counter; + st.limit = random_buf_limit; + memcpy(st.buf, random_buf, sizeof(st.buf)); + return st; +} + +static void random_set_state(struct random_state st) +{ + random_seedstr = st.seedstr; + random_counter = st.counter; + random_buf_limit = st.limit; + memcpy(random_buf, st.buf, sizeof(random_buf)); +} + /* * Macro that defines a function, and also a volatile function pointer * pointing to it. Callers indirect through the function pointer @@ -223,6 +242,31 @@ VOLATILE_WRAPPED_DEFN(static, size_t, looplimit, (size_t x)) return x; } +#if HAVE_AES_NI +#define CIPHERS_AES_NI(X, Y) \ + X(Y, ssh_aes256_sdctr_ni) \ + X(Y, ssh_aes256_cbc_ni) \ + X(Y, ssh_aes192_sdctr_ni) \ + X(Y, ssh_aes192_cbc_ni) \ + X(Y, ssh_aes128_sdctr_ni) \ + X(Y, ssh_aes128_cbc_ni) \ + /* end of list */ +#else +#define CIPHERS_AES_NI(X, Y) +#endif +#if HAVE_NEON_CRYPTO +#define CIPHERS_AES_NEON(X, Y) \ + X(Y, ssh_aes256_sdctr_neon) \ + X(Y, ssh_aes256_cbc_neon) \ + X(Y, ssh_aes192_sdctr_neon) \ + X(Y, ssh_aes192_cbc_neon) \ + X(Y, ssh_aes128_sdctr_neon) \ + X(Y, ssh_aes128_cbc_neon) \ + /* end of list */ +#else +#define CIPHERS_AES_NEON(X, Y) +#endif + /* Ciphers that we expect to pass this test. Blowfish and Arcfour are * intentionally omitted, because we already know they don't. */ #define CIPHERS(X, Y) \ @@ -232,23 +276,19 @@ VOLATILE_WRAPPED_DEFN(static, size_t, looplimit, (size_t x)) X(Y, ssh_des) \ X(Y, ssh_des_sshcom_ssh2) \ X(Y, ssh_aes256_sdctr) \ - X(Y, ssh_aes256_sdctr_hw) \ - X(Y, ssh_aes256_sdctr_sw) \ X(Y, ssh_aes256_cbc) \ - X(Y, ssh_aes256_cbc_hw) \ - X(Y, ssh_aes256_cbc_sw) \ X(Y, ssh_aes192_sdctr) \ - X(Y, ssh_aes192_sdctr_hw) \ - X(Y, ssh_aes192_sdctr_sw) \ X(Y, ssh_aes192_cbc) \ - X(Y, ssh_aes192_cbc_hw) \ - X(Y, ssh_aes192_cbc_sw) \ X(Y, ssh_aes128_sdctr) \ - X(Y, ssh_aes128_sdctr_hw) \ - X(Y, ssh_aes128_sdctr_sw) \ X(Y, ssh_aes128_cbc) \ - X(Y, ssh_aes128_cbc_hw) \ + X(Y, ssh_aes256_sdctr_sw) \ + X(Y, ssh_aes256_cbc_sw) \ + X(Y, ssh_aes192_sdctr_sw) \ + X(Y, ssh_aes192_cbc_sw) \ + X(Y, ssh_aes128_sdctr_sw) \ X(Y, ssh_aes128_cbc_sw) \ + CIPHERS_AES_NI(X, Y) \ + CIPHERS_AES_NEON(X, Y) \ X(Y, ssh2_chacha20_poly1305) \ /* end of list */ @@ -265,16 +305,35 @@ VOLATILE_WRAPPED_DEFN(static, size_t, looplimit, (size_t x)) #define MAC_TESTLIST(X, name) X(mac_ ## name) +#if HAVE_SHA_NI +#define HASH_SHA_NI(X, Y) X(Y, ssh_sha256_ni) X(Y, ssh_sha1_ni) +#else +#define HASH_SHA_NI(X, Y) +#endif +#if HAVE_NEON_CRYPTO +#define HASH_SHA_NEON(X, Y) X(Y, ssh_sha256_neon) X(Y, ssh_sha1_neon) +#else +#define HASH_SHA_NEON(X, Y) +#endif +#if HAVE_NEON_SHA512 +#define HASH_SHA512_NEON(X, Y) X(Y, ssh_sha384_neon) X(Y, ssh_sha512_neon) +#else +#define HASH_SHA512_NEON(X, Y) +#endif + #define HASHES(X, Y) \ X(Y, ssh_md5) \ X(Y, ssh_sha1) \ - X(Y, ssh_sha1_hw) \ X(Y, ssh_sha1_sw) \ X(Y, ssh_sha256) \ - X(Y, ssh_sha256_hw) \ X(Y, ssh_sha256_sw) \ X(Y, ssh_sha384) \ X(Y, ssh_sha512) \ + X(Y, ssh_sha384_sw) \ + X(Y, ssh_sha512_sw) \ + HASH_SHA_NI(X, Y) \ + HASH_SHA_NEON(X, Y) \ + HASH_SHA512_NEON(X, Y) \ X(Y, ssh_sha3_224) \ X(Y, ssh_sha3_256) \ X(Y, ssh_sha3_384) \ @@ -331,6 +390,7 @@ VOLATILE_WRAPPED_DEFN(static, size_t, looplimit, (size_t x)) MACS(MAC_TESTLIST, X) \ HASHES(HASH_TESTLIST, X) \ X(argon2) \ + X(primegen_probabilistic) \ /* end of list */ static void test_mp_get_nbits(void) @@ -1443,6 +1503,54 @@ static void test_argon2(void) strbuf_free(outdata); } +static void test_primegen(const PrimeGenerationPolicy *policy) +{ + static ProgressReceiver null_progress = { .vt = &null_progress_vt }; + + PrimeGenerationContext *pgc = primegen_new_context(policy); + + init_smallprimes(); + mp_int *pcopy = mp_new(128); + + for (size_t i = 0; i < looplimit(2); i++) { + while (true) { + struct random_state st = random_get_state(); + + PrimeCandidateSource *pcs = pcs_new(128); + pcs_set_oneshot(pcs); + pcs_ready(pcs); + mp_int *p = primegen_generate(pgc, pcs, &null_progress); + + if (p) { + mp_copy_into(pcopy, p); + sfree(p); + + random_set_state(st); + + log_start(); + PrimeCandidateSource *pcs = pcs_new(128); + pcs_set_oneshot(pcs); + pcs_ready(pcs); + mp_int *q = primegen_generate(pgc, pcs, &null_progress); + log_end(); + + assert(q); + assert(mp_cmp_eq(pcopy, q)); + mp_free(q); + break; + } + } + } + + mp_free(pcopy); + primegen_free_context(pgc); +} + +static void test_primegen_probabilistic(void) +{ + test_primegen(&primegen_probabilistic); +} + static const struct test tests[] = { #define STRUCT_TEST(X) { #X, test_##X }, TESTLIST(STRUCT_TEST) diff --git a/code/testzlib.c b/code/test/testzlib.c similarity index 97% rename from code/testzlib.c rename to code/test/testzlib.c index 0e7b424..0ef4ef1 100644 --- a/code/testzlib.c +++ b/code/test/testzlib.c @@ -1,5 +1,5 @@ /* - * Main program to compile sshzlib.c into a zlib decoding tool. + * Main program to compile ssh/zlib.c into a zlib decoding tool. * * This is potentially a handy tool in its own right for picking apart * Zip files or PDFs or PNGs, because it accepts the bare Deflate diff --git a/code/testcrypt.h b/code/testcrypt.h deleted file mode 100644 index 298abc0..0000000 --- a/code/testcrypt.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - * mpint.h functions. - */ -FUNC1(val_mpint, mp_new, uint) -FUNC1(void, mp_clear, val_mpint) -FUNC1(val_mpint, mp_from_bytes_le, val_string_ptrlen) -FUNC1(val_mpint, mp_from_bytes_be, val_string_ptrlen) -FUNC1(val_mpint, mp_from_integer, uint) -FUNC1(val_mpint, mp_from_decimal_pl, val_string_ptrlen) -FUNC1(val_mpint, mp_from_decimal, val_string_asciz) -FUNC1(val_mpint, mp_from_hex_pl, val_string_ptrlen) -FUNC1(val_mpint, mp_from_hex, val_string_asciz) -FUNC1(val_mpint, mp_copy, val_mpint) -FUNC1(val_mpint, mp_power_2, uint) -FUNC2(uint, mp_get_byte, val_mpint, uint) -FUNC2(uint, mp_get_bit, val_mpint, uint) -FUNC3(void, mp_set_bit, val_mpint, uint, uint) -FUNC1(uint, mp_max_bytes, val_mpint) -FUNC1(uint, mp_max_bits, val_mpint) -FUNC1(uint, mp_get_nbits, val_mpint) -FUNC1(val_string_asciz, mp_get_decimal, val_mpint) -FUNC1(val_string_asciz, mp_get_hex, val_mpint) -FUNC1(val_string_asciz, mp_get_hex_uppercase, val_mpint) -FUNC2(uint, mp_cmp_hs, val_mpint, val_mpint) -FUNC2(uint, mp_cmp_eq, val_mpint, val_mpint) -FUNC2(uint, mp_hs_integer, val_mpint, uint) -FUNC2(uint, mp_eq_integer, val_mpint, uint) -FUNC3(void, mp_min_into, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_max_into, val_mpint, val_mpint, val_mpint) -FUNC2(val_mpint, mp_min, val_mpint, val_mpint) -FUNC2(val_mpint, mp_max, val_mpint, val_mpint) -FUNC2(void, mp_copy_into, val_mpint, val_mpint) -FUNC4(void, mp_select_into, val_mpint, val_mpint, val_mpint, uint) -FUNC3(void, mp_add_into, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_sub_into, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_mul_into, val_mpint, val_mpint, val_mpint) -FUNC2(val_mpint, mp_add, val_mpint, val_mpint) -FUNC2(val_mpint, mp_sub, val_mpint, val_mpint) -FUNC2(val_mpint, mp_mul, val_mpint, val_mpint) -FUNC3(void, mp_and_into, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_or_into, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_xor_into, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_bic_into, val_mpint, val_mpint, val_mpint) -FUNC2(void, mp_copy_integer_into, val_mpint, uint) -FUNC3(void, mp_add_integer_into, val_mpint, val_mpint, uint) -FUNC3(void, mp_sub_integer_into, val_mpint, val_mpint, uint) -FUNC3(void, mp_mul_integer_into, val_mpint, val_mpint, uint) -FUNC4(void, mp_cond_add_into, val_mpint, val_mpint, val_mpint, uint) -FUNC4(void, mp_cond_sub_into, val_mpint, val_mpint, val_mpint, uint) -FUNC3(void, mp_cond_swap, val_mpint, val_mpint, uint) -FUNC2(void, mp_cond_clear, val_mpint, uint) -FUNC4(void, mp_divmod_into, val_mpint, val_mpint, opt_val_mpint, opt_val_mpint) -FUNC2(val_mpint, mp_div, val_mpint, val_mpint) -FUNC2(val_mpint, mp_mod, val_mpint, val_mpint) -FUNC3(val_mpint, mp_nthroot, val_mpint, uint, opt_val_mpint) -FUNC2(void, mp_reduce_mod_2to, val_mpint, uint) -FUNC2(val_mpint, mp_invert_mod_2to, val_mpint, uint) -FUNC2(val_mpint, mp_invert, val_mpint, val_mpint) -FUNC5(void, mp_gcd_into, val_mpint, val_mpint, opt_val_mpint, opt_val_mpint, opt_val_mpint) -FUNC2(val_mpint, mp_gcd, val_mpint, val_mpint) -FUNC2(uint, mp_coprime, val_mpint, val_mpint) -FUNC2(val_modsqrt, modsqrt_new, val_mpint, val_mpint) -/* The modsqrt functions' 'success' pointer becomes a second return value */ -FUNC3(val_mpint, mp_modsqrt, val_modsqrt, val_mpint, out_uint) -FUNC1(val_monty, monty_new, val_mpint) -FUNC1(val_mpint, monty_modulus, val_monty) -FUNC1(val_mpint, monty_identity, val_monty) -FUNC3(void, monty_import_into, val_monty, val_mpint, val_mpint) -FUNC2(val_mpint, monty_import, val_monty, val_mpint) -FUNC3(void, monty_export_into, val_monty, val_mpint, val_mpint) -FUNC2(val_mpint, monty_export, val_monty, val_mpint) -FUNC4(void, monty_mul_into, val_monty, val_mpint, val_mpint, val_mpint) -FUNC3(val_mpint, monty_add, val_monty, val_mpint, val_mpint) -FUNC3(val_mpint, monty_sub, val_monty, val_mpint, val_mpint) -FUNC3(val_mpint, monty_mul, val_monty, val_mpint, val_mpint) -FUNC3(val_mpint, monty_pow, val_monty, val_mpint, val_mpint) -FUNC2(val_mpint, monty_invert, val_monty, val_mpint) -FUNC3(val_mpint, monty_modsqrt, val_modsqrt, val_mpint, out_uint) -FUNC3(val_mpint, mp_modpow, val_mpint, val_mpint, val_mpint) -FUNC3(val_mpint, mp_modmul, val_mpint, val_mpint, val_mpint) -FUNC3(val_mpint, mp_modadd, val_mpint, val_mpint, val_mpint) -FUNC3(val_mpint, mp_modsub, val_mpint, val_mpint, val_mpint) -FUNC3(void, mp_lshift_safe_into, val_mpint, val_mpint, uint) -FUNC3(void, mp_rshift_safe_into, val_mpint, val_mpint, uint) -FUNC2(val_mpint, mp_rshift_safe, val_mpint, uint) -FUNC3(void, mp_lshift_fixed_into, val_mpint, val_mpint, uint) -FUNC3(void, mp_rshift_fixed_into, val_mpint, val_mpint, uint) -FUNC2(val_mpint, mp_rshift_fixed, val_mpint, uint) -FUNC1(val_mpint, mp_random_bits, uint) -FUNC2(val_mpint, mp_random_in_range, val_mpint, val_mpint) - -/* - * ecc.h functions. - */ -FUNC4(val_wcurve, ecc_weierstrass_curve, val_mpint, val_mpint, val_mpint, opt_val_mpint) -FUNC1(val_wpoint, ecc_weierstrass_point_new_identity, val_wcurve) -FUNC3(val_wpoint, ecc_weierstrass_point_new, val_wcurve, val_mpint, val_mpint) -FUNC3(val_wpoint, ecc_weierstrass_point_new_from_x, val_wcurve, val_mpint, uint) -FUNC1(val_wpoint, ecc_weierstrass_point_copy, val_wpoint) -FUNC1(uint, ecc_weierstrass_point_valid, val_wpoint) -FUNC2(val_wpoint, ecc_weierstrass_add_general, val_wpoint, val_wpoint) -FUNC2(val_wpoint, ecc_weierstrass_add, val_wpoint, val_wpoint) -FUNC1(val_wpoint, ecc_weierstrass_double, val_wpoint) -FUNC2(val_wpoint, ecc_weierstrass_multiply, val_wpoint, val_mpint) -FUNC1(uint, ecc_weierstrass_is_identity, val_wpoint) -/* The output pointers in get_affine all become extra output values */ -FUNC3(void, ecc_weierstrass_get_affine, val_wpoint, out_val_mpint, out_val_mpint) -FUNC3(val_mcurve, ecc_montgomery_curve, val_mpint, val_mpint, val_mpint) -FUNC2(val_mpoint, ecc_montgomery_point_new, val_mcurve, val_mpint) -FUNC1(val_mpoint, ecc_montgomery_point_copy, val_mpoint) -FUNC3(val_mpoint, ecc_montgomery_diff_add, val_mpoint, val_mpoint, val_mpoint) -FUNC1(val_mpoint, ecc_montgomery_double, val_mpoint) -FUNC2(val_mpoint, ecc_montgomery_multiply, val_mpoint, val_mpint) -FUNC2(void, ecc_montgomery_get_affine, val_mpoint, out_val_mpint) -FUNC1(boolean, ecc_montgomery_is_identity, val_mpoint) -FUNC4(val_ecurve, ecc_edwards_curve, val_mpint, val_mpint, val_mpint, opt_val_mpint) -FUNC3(val_epoint, ecc_edwards_point_new, val_ecurve, val_mpint, val_mpint) -FUNC3(val_epoint, ecc_edwards_point_new_from_y, val_ecurve, val_mpint, uint) -FUNC1(val_epoint, ecc_edwards_point_copy, val_epoint) -FUNC2(val_epoint, ecc_edwards_add, val_epoint, val_epoint) -FUNC2(val_epoint, ecc_edwards_multiply, val_epoint, val_mpint) -FUNC2(uint, ecc_edwards_eq, val_epoint, val_epoint) -FUNC3(void, ecc_edwards_get_affine, val_epoint, out_val_mpint, out_val_mpint) - -/* - * The ssh_hash abstraction. Note the 'consumed', indicating that - * ssh_hash_final puts its input ssh_hash beyond use. - * - * ssh_hash_update is an invention of testcrypt, handled in the real C - * API by the hash object also functioning as a BinarySink. - */ -FUNC1(opt_val_hash, ssh_hash_new, hashalg) -FUNC1(void, ssh_hash_reset, val_hash) -FUNC1(val_hash, ssh_hash_copy, val_hash) -FUNC1(val_string, ssh_hash_digest, val_hash) -FUNC1(val_string, ssh_hash_final, consumed_val_hash) -FUNC2(void, ssh_hash_update, val_hash, val_string_ptrlen) - -FUNC1(opt_val_hash, blake2b_new_general, uint) - -/* - * The ssh2_mac abstraction. Note the optional ssh_cipher parameter - * to ssh2_mac_new. Also, again, I've invented an ssh2_mac_update so - * you can put data into the MAC. - */ -FUNC2(val_mac, ssh2_mac_new, macalg, opt_val_cipher) -FUNC2(void, ssh2_mac_setkey, val_mac, val_string_ptrlen) -FUNC1(void, ssh2_mac_start, val_mac) -FUNC2(void, ssh2_mac_update, val_mac, val_string_ptrlen) -FUNC1(val_string, ssh2_mac_genresult, val_mac) -FUNC1(val_string_asciz_const, ssh2_mac_text_name, val_mac) - -/* - * The ssh_key abstraction. All the uses of BinarySink and - * BinarySource in parameters are replaced with ordinary strings for - * the testing API: new_priv_openssh just takes a string input, and - * all the functions that output key and signature blobs do it by - * returning a string. - */ -FUNC2(val_key, ssh_key_new_pub, keyalg, val_string_ptrlen) -FUNC3(opt_val_key, ssh_key_new_priv, keyalg, val_string_ptrlen, val_string_ptrlen) -FUNC2(opt_val_key, ssh_key_new_priv_openssh, keyalg, val_string_binarysource) -FUNC2(opt_val_string_asciz, ssh_key_invalid, val_key, uint) -FUNC4(void, ssh_key_sign, val_key, val_string_ptrlen, uint, out_val_string_binarysink) -FUNC3(boolean, ssh_key_verify, val_key, val_string_ptrlen, val_string_ptrlen) -FUNC2(void, ssh_key_public_blob, val_key, out_val_string_binarysink) -FUNC2(void, ssh_key_private_blob, val_key, out_val_string_binarysink) -FUNC2(void, ssh_key_openssh_blob, val_key, out_val_string_binarysink) -FUNC1(val_string_asciz, ssh_key_cache_str, val_key) -FUNC1(val_keycomponents, ssh_key_components, val_key) -FUNC2(uint, ssh_key_public_bits, keyalg, val_string_ptrlen) - -/* - * Accessors to retrieve the innards of a 'key_components'. - */ -FUNC1(uint, key_components_count, val_keycomponents) -FUNC2(opt_val_string_asciz_const, key_components_nth_name, val_keycomponents, uint) -FUNC2(opt_val_string_asciz_const, key_components_nth_str, val_keycomponents, uint) -FUNC2(opt_val_mpint, key_components_nth_mp, val_keycomponents, uint) - -/* - * The ssh_cipher abstraction. The in-place encrypt and decrypt - * functions are wrapped to replace them with versions that take one - * string and return a separate string. - */ -FUNC1(opt_val_cipher, ssh_cipher_new, cipheralg) -FUNC2(void, ssh_cipher_setiv, val_cipher, val_string_ptrlen) -FUNC2(void, ssh_cipher_setkey, val_cipher, val_string_ptrlen) -FUNC2(val_string, ssh_cipher_encrypt, val_cipher, val_string_ptrlen) -FUNC2(val_string, ssh_cipher_decrypt, val_cipher, val_string_ptrlen) -FUNC3(val_string, ssh_cipher_encrypt_length, val_cipher, val_string_ptrlen, uint) -FUNC3(val_string, ssh_cipher_decrypt_length, val_cipher, val_string_ptrlen, uint) - -/* - * Integer Diffie-Hellman. - */ -FUNC1(val_dh, dh_setup_group, dh_group) -FUNC2(val_dh, dh_setup_gex, val_mpint, val_mpint) -FUNC1(uint, dh_modulus_bit_size, val_dh) -FUNC2(val_mpint, dh_create_e, val_dh, uint) -FUNC2(boolean, dh_validate_f, val_dh, val_mpint) -FUNC2(val_mpint, dh_find_K, val_dh, val_mpint) - -/* - * Elliptic-curve Diffie-Hellman. - */ -FUNC1(val_ecdh, ssh_ecdhkex_newkey, ecdh_alg) -FUNC2(void, ssh_ecdhkex_getpublic, val_ecdh, out_val_string_binarysink) -FUNC2(opt_val_mpint, ssh_ecdhkex_getkey, val_ecdh, val_string_ptrlen) - -/* - * RSA key exchange, and also the BinarySource get function - * get_ssh1_rsa_priv_agent, which is a convenient way to make an - * RSAKey for RSA kex testing purposes. - */ -FUNC1(val_rsakex, ssh_rsakex_newkey, val_string_ptrlen) -FUNC1(uint, ssh_rsakex_klen, val_rsakex) -FUNC3(val_string, ssh_rsakex_encrypt, val_rsakex, hashalg, val_string_ptrlen) -FUNC3(opt_val_mpint, ssh_rsakex_decrypt, val_rsakex, hashalg, val_string_ptrlen) -FUNC1(val_rsakex, get_rsa_ssh1_priv_agent, val_string_binarysource) - -/* - * Bare RSA keys as used in SSH-1. The construction API functions - * write into an existing RSAKey object, so I've invented an 'rsa_new' - * function to make one in the first place. - */ -FUNC0(val_rsa, rsa_new) -FUNC3(void, get_rsa_ssh1_pub, val_string_binarysource, val_rsa, rsaorder) -FUNC2(void, get_rsa_ssh1_priv, val_string_binarysource, val_rsa) -FUNC2(opt_val_string, rsa_ssh1_encrypt, val_string_ptrlen, val_rsa) -FUNC2(val_mpint, rsa_ssh1_decrypt, val_mpint, val_rsa) -FUNC2(val_string, rsa_ssh1_decrypt_pkcs1, val_mpint, val_rsa) -FUNC1(val_string_asciz, rsastr_fmt, val_rsa) -FUNC1(val_string_asciz, rsa_ssh1_fingerprint, val_rsa) -FUNC3(void, rsa_ssh1_public_blob, out_val_string_binarysink, val_rsa, rsaorder) -FUNC1(int, rsa_ssh1_public_blob_len, val_string_ptrlen) -FUNC2(void, rsa_ssh1_private_blob_agent, out_val_string_binarysink, val_rsa) - -/* - * The PRNG type. Similarly to hashes and MACs, I've invented an extra - * function prng_seed_update for putting seed data into the PRNG's - * exposed BinarySink. - */ -FUNC1(val_prng, prng_new, hashalg) -FUNC1(void, prng_seed_begin, val_prng) -FUNC2(void, prng_seed_update, val_prng, val_string_ptrlen) -FUNC1(void, prng_seed_finish, val_prng) -FUNC2(val_string, prng_read, val_prng, uint) -FUNC3(void, prng_add_entropy, val_prng, uint, val_string_ptrlen) - -/* - * Key load/save functions, or rather, the BinarySource / strbuf API - * that sits just inside the file I/O versions. - */ -FUNC2(boolean, ppk_encrypted_s, val_string_binarysource, out_opt_val_string_asciz) -FUNC2(boolean, rsa1_encrypted_s, val_string_binarysource, out_opt_val_string_asciz) -FUNC5(boolean, ppk_loadpub_s, val_string_binarysource, out_opt_val_string_asciz, out_val_string_binarysink, out_opt_val_string_asciz, out_opt_val_string_asciz_const) -FUNC4(int, rsa1_loadpub_s, val_string_binarysource, out_val_string_binarysink, out_opt_val_string_asciz, out_opt_val_string_asciz_const) -FUNC4(opt_val_key, ppk_load_s, val_string_binarysource, out_opt_val_string_asciz, opt_val_string_asciz, out_opt_val_string_asciz_const) -FUNC5(int, rsa1_load_s, val_string_binarysource, val_rsa, out_opt_val_string_asciz, opt_val_string_asciz, out_opt_val_string_asciz_const) -FUNC8(val_string, ppk_save_sb, val_key, opt_val_string_asciz, opt_val_string_asciz, uint, argon2flavour, uint, uint, uint) -FUNC3(val_string, rsa1_save_sb, val_rsa, opt_val_string_asciz, opt_val_string_asciz) - -FUNC2(val_string_asciz, ssh2_fingerprint_blob, val_string_ptrlen, fptype) - -/* - * Password hashing. - */ -FUNC9(val_string, argon2, argon2flavour, uint, uint, uint, uint, val_string_ptrlen, val_string_ptrlen, val_string_ptrlen, val_string_ptrlen) -FUNC2(val_string, argon2_long_hash, uint, val_string_ptrlen) - -/* - * Key generation functions. - */ -FUNC3(val_key, rsa_generate, uint, boolean, val_pgc) -FUNC2(val_key, dsa_generate, uint, val_pgc) -FUNC1(opt_val_key, ecdsa_generate, uint) -FUNC1(opt_val_key, eddsa_generate, uint) -FUNC3(val_rsa, rsa1_generate, uint, boolean, val_pgc) -FUNC1(val_pgc, primegen_new_context, primegenpolicy) -FUNC2(opt_val_mpint, primegen_generate, val_pgc, consumed_val_pcs) -FUNC2(val_string, primegen_mpu_certificate, val_pgc, val_mpint) -FUNC1(val_pcs, pcs_new, uint) -FUNC3(val_pcs, pcs_new_with_firstbits, uint, uint, uint) -FUNC3(void, pcs_require_residue, val_pcs, val_mpint, val_mpint) -FUNC2(void, pcs_require_residue_1, val_pcs, val_mpint) -FUNC2(void, pcs_require_residue_1_mod_prime, val_pcs, val_mpint) -FUNC3(void, pcs_avoid_residue_small, val_pcs, uint, uint) -FUNC1(void, pcs_try_sophie_germain, val_pcs) -FUNC1(void, pcs_set_oneshot, val_pcs) -FUNC1(void, pcs_ready, val_pcs) -FUNC4(void, pcs_inspect, val_pcs, out_val_mpint, out_val_mpint, out_val_mpint) -FUNC1(val_mpint, pcs_generate, val_pcs) -FUNC0(val_pockle, pockle_new) -FUNC1(uint, pockle_mark, val_pockle) -FUNC2(void, pockle_release, val_pockle, uint) -FUNC2(pocklestatus, pockle_add_small_prime, val_pockle, val_mpint) -FUNC4(pocklestatus, pockle_add_prime, val_pockle, val_mpint, mpint_list, val_mpint) -FUNC2(val_string, pockle_mpu, val_pockle, val_mpint) - -/* - * Miscellaneous. - */ -FUNC2(val_wpoint, ecdsa_public, val_mpint, keyalg) -FUNC2(val_epoint, eddsa_public, val_mpint, keyalg) -FUNC2(val_string, des_encrypt_xdmauth, val_string_ptrlen, val_string_ptrlen) -FUNC2(val_string, des_decrypt_xdmauth, val_string_ptrlen, val_string_ptrlen) -FUNC2(val_string, des3_encrypt_pubkey, val_string_ptrlen, val_string_ptrlen) -FUNC2(val_string, des3_decrypt_pubkey, val_string_ptrlen, val_string_ptrlen) -FUNC3(val_string, des3_encrypt_pubkey_ossh, val_string_ptrlen, val_string_ptrlen, val_string_ptrlen) -FUNC3(val_string, des3_decrypt_pubkey_ossh, val_string_ptrlen, val_string_ptrlen, val_string_ptrlen) -FUNC3(val_string, aes256_encrypt_pubkey, val_string_ptrlen, val_string_ptrlen, val_string_ptrlen) -FUNC3(val_string, aes256_decrypt_pubkey, val_string_ptrlen, val_string_ptrlen, val_string_ptrlen) -FUNC1(uint, crc32_rfc1662, val_string_ptrlen) -FUNC1(uint, crc32_ssh1, val_string_ptrlen) -FUNC2(uint, crc32_update, uint, val_string_ptrlen) -FUNC2(boolean, crcda_detect, val_string_ptrlen, val_string_ptrlen) - -/* - * These functions aren't part of PuTTY's own API, but are additions - * by testcrypt itself for administrative purposes. - */ -FUNC1(void, random_queue, val_string_ptrlen) -FUNC0(uint, random_queue_len) -FUNC2(void, random_make_prng, hashalg, val_string_ptrlen) -FUNC0(void, random_clear) diff --git a/code/unix/CMakeLists.txt b/code/unix/CMakeLists.txt new file mode 100644 index 0000000..c2d5e2e --- /dev/null +++ b/code/unix/CMakeLists.txt @@ -0,0 +1,211 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +add_sources_from_current_dir(utils + utils/arm_arch_queries.c + utils/block_signal.c + utils/cloexec.c + utils/dputs.c + utils/filename.c + utils/fontspec.c + utils/getticks.c + utils/get_username.c + utils/keysym_to_unicode.c + utils/make_dir_and_check_ours.c + utils/make_dir_path.c + utils/make_spr_sw_abort_errno.c + utils/nonblock.c + utils/open_for_write_would_lose_data.c + utils/pgp_fingerprints.c + utils/pollwrap.c + utils/signal.c + utils/x11_ignore_error.c + # We want the ISO C implementation of ltime(), because we don't have + # a local better alternative + ../utils/ltime.c) +# Compiled icon pixmap files +add_library(puttyxpms STATIC + putty-xpm.c + putty-config-xpm.c) +add_library(ptermxpms STATIC + pterm-xpm.c + pterm-config-xpm.c) +add_sources_from_current_dir(eventloop + cliloop.c uxsel.c) +add_sources_from_current_dir(console + console.c) +add_sources_from_current_dir(settings + storage.c) +add_sources_from_current_dir(network + network.c fd-socket.c agent-socket.c peerinfo.c local-proxy.c x11.c) +add_sources_from_current_dir(sshcommon + noise.c) +add_sources_from_current_dir(sshclient + gss.c agent-client.c sharing.c) +add_sources_from_current_dir(sshserver + sftpserver.c procnet.c) +add_sources_from_current_dir(sftpclient + sftp.c) +add_sources_from_current_dir(otherbackends + serial.c) +add_sources_from_current_dir(agent + agent-client.c) + +add_executable(fuzzterm + ${CMAKE_SOURCE_DIR}/test/fuzzterm.c + ${CMAKE_SOURCE_DIR}/logging.c + ${CMAKE_SOURCE_DIR}/stubs/noprint.c + unicode.c + no-gtk.c) +be_list(fuzzterm FuZZterm) +add_dependencies(fuzzterm generated_licence_h) +target_link_libraries(fuzzterm + guiterminal eventloop charset settings utils) + +add_executable(osxlaunch + osxlaunch.c) + +add_sources_from_current_dir(plink no-gtk.c) +add_sources_from_current_dir(pscp no-gtk.c) +add_sources_from_current_dir(psftp no-gtk.c) +add_sources_from_current_dir(psocks no-gtk.c) + +add_executable(psusan + psusan.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + ${CMAKE_SOURCE_DIR}/ssh/scpserver.c + no-gtk.c + pty.c) +be_list(psusan psusan) +target_link_libraries(psusan + eventloop sshserver keygen settings network crypto utils) +installed_program(psusan) + +add_library(puttygen-common OBJECT + ${CMAKE_SOURCE_DIR}/stubs/notiming.c + keygen-noise.c + no-gtk.c + noise.c + storage.c + ${CMAKE_SOURCE_DIR}/sshpubk.c + ${CMAKE_SOURCE_DIR}/sshrand.c) + +add_executable(puttygen + ${CMAKE_SOURCE_DIR}/cmdgen.c + $) +target_link_libraries(puttygen keygen console crypto utils) +installed_program(puttygen) + +add_executable(cgtest + ${CMAKE_SOURCE_DIR}/cgtest.c + $) +target_link_libraries(cgtest keygen console crypto utils) + +add_executable(testsc + ${CMAKE_SOURCE_DIR}/test/testsc.c) +target_link_libraries(testsc keygen crypto utils) + +add_executable(testzlib + ${CMAKE_SOURCE_DIR}/test/testzlib.c + ${CMAKE_SOURCE_DIR}/ssh/zlib.c) +target_link_libraries(testzlib utils) + +add_executable(uppity + uppity.c + ${CMAKE_SOURCE_DIR}/ssh/scpserver.c + no-gtk.c + pty.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c) +be_list(uppity Uppity) +target_link_libraries(uppity + eventloop sshserver keygen settings network crypto utils) + +if(GTK_FOUND) + add_sources_from_current_dir(utils + utils/align_label_left.c + utils/buildinfo_gtk_version.c + utils/get_label_text_dimensions.c + utils/get_x11_display.c + utils/our_dialog.c + utils/string_width.c + columns.c) + add_sources_from_current_dir(guiterminal + window.c unifont.c dialog.c config-gtk.c gtk-common.c config-unix.c unicode.c printing.c) + add_dependencies(guiterminal generated_licence_h) # dialog.c uses licence.h + + add_executable(pageant + pageant.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + askpass.c + x11.c + noise.c + ${CMAKE_SOURCE_DIR}/ssh/x11fwd.c + ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c) + be_list(pageant Pageant) + target_link_libraries(pageant + eventloop console agent settings network crypto utils + ${GTK_LIBRARIES}) + installed_program(pageant) + + add_executable(pterm + pterm.c + main-gtk-simple.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c + pty.c) + be_list(pterm pterm) + target_link_libraries(pterm + guiterminal eventloop settings charset utils ptermxpms + ${GTK_LIBRARIES} ${X11_LIBRARIES}) + installed_program(pterm) + + if(GTK_VERSION GREATER_EQUAL 3) + add_executable(ptermapp + pterm.c + main-gtk-application.c + ${CMAKE_SOURCE_DIR}/stubs/nocmdline.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c + pty.c) + be_list(ptermapp pterm) + target_link_libraries(ptermapp + guiterminal eventloop settings charset utils ptermxpms + ${GTK_LIBRARIES} ${X11_LIBRARIES}) + endif() + + add_executable(putty + putty.c + main-gtk-simple.c) + be_list(putty PuTTY SSH SERIAL OTHERBACKENDS) + target_link_libraries(putty + guiterminal eventloop sshclient otherbackends settings + network crypto charset utils puttyxpms + ${GTK_LIBRARIES} ${X11_LIBRARIES}) + set_target_properties(putty + PROPERTIES LINK_INTERFACE_MULTIPLICITY 2) + installed_program(putty) + + if(GTK_VERSION GREATER_EQUAL 3) + add_executable(puttyapp + putty.c + main-gtk-application.c + ${CMAKE_SOURCE_DIR}/stubs/nocmdline.c) + be_list(puttyapp PuTTY SSH SERIAL OTHERBACKENDS) + target_link_libraries(puttyapp + guiterminal eventloop sshclient otherbackends settings + network crypto charset utils puttyxpms + ${GTK_LIBRARIES} ${X11_LIBRARIES}) + endif() + + add_executable(puttytel + putty.c + main-gtk-simple.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + ${CMAKE_SOURCE_DIR}/stubs/norand.c + ${CMAKE_SOURCE_DIR}/proxy/nocproxy.c + ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c) + be_list(puttytel PuTTYtel SERIAL OTHERBACKENDS) + target_link_libraries(puttytel + guiterminal eventloop otherbackends settings network charset utils + puttyxpms + ${GTK_LIBRARIES} ${X11_LIBRARIES}) +endif() diff --git a/code/unix/Makefile.gtk b/code/unix/Makefile.gtk deleted file mode 100644 index 0d7c3a1..0000000 --- a/code/unix/Makefile.gtk +++ /dev/null @@ -1,1838 +0,0 @@ -# Makefile for putty under X/GTK and Unix. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. -# -# Extra options you can set: -# -# - COMPAT=-DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=-DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=-DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=-DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=-DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=-DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=-DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=-DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=-DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=-DMSVC4 (Windows only) -# - RCFL=-DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need -DNO_SECURITY and -DNO_MULTIMON. -# -# - COMPAT=-DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=-DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=-DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=-DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=-DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. - -# You can define this path to point at your tools if you need to -# TOOLPATH = /opt/gcc/bin -CC = $(TOOLPATH)cc -# If necessary set the path to krb5-config here -KRB5CONFIG=krb5-config -# You can manually set this to `gtk-config' or `pkg-config gtk+-1.2' -# (depending on what works on your system) if you want to enforce -# building with GTK 1.2, or you can set it to `pkg-config gtk+-2.0 x11' -# if you want to enforce 2.0. The default is to try 2.0 and fall back -# to 1.2 if it isn't found. -GTK_CONFIG = sh -c 'pkg-config gtk+-3.0 x11 $$0 2>/dev/null || pkg-config gtk+-2.0 x11 $$0 2>/dev/null || gtk-config $$0' - --include Makefile.local - -unexport CFLAGS # work around a weird issue with krb5-config - -CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g -I.././ -I../charset/ -I../windows/ \ - -I../unix/ $(shell $(GTK_CONFIG) --cflags) -D _FILE_OFFSET_BITS=64 -XLDFLAGS = $(LDFLAGS) $(shell $(GTK_CONFIG) --libs) -ULDFLAGS = $(LDFLAGS) -ifeq (,$(findstring NO_GSSAPI,$(COMPAT))) -ifeq (,$(findstring STATIC_GSSAPI,$(COMPAT))) -XLDFLAGS+= -ldl -ULDFLAGS+= -ldl -else -CFLAGS+= -DNO_LIBDL $(shell $(KRB5CONFIG) --cflags gssapi) -XLDFLAGS+= $(shell $(KRB5CONFIG) --libs gssapi) -ULDFLAGS+= $(shell $(KRB5CONFIG) --libs gssapi) -endif -endif -INSTALL=install -INSTALL_PROGRAM=$(INSTALL) -INSTALL_DATA=$(INSTALL) -prefix=/usr/local -exec_prefix=$(prefix) -bindir=$(exec_prefix)/bin -mandir=$(prefix)/man -man1dir=$(mandir)/man1 - - -.SUFFIXES: - - -all: cgtest fuzzterm osxlaunch pageant plink pscp psftp psocks psusan pterm \ - ptermapp putty puttyapp puttygen puttytel testcrypt testsc \ - testzlib uppity - -cgtest: cgtest.o conf.o console.o ecc.o import.o marshal.o memory.o \ - millerrabin.o misc.o mpint.o mpunsafe.o notiming.o pockle.o \ - primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o - $(CC) -o $@ cgtest.o conf.o console.o ecc.o import.o marshal.o \ - memory.o millerrabin.o misc.o mpint.o mpunsafe.o notiming.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o \ - $(ULDFLAGS) - -fuzzterm: be_none.o callback.o conf.o config.o dialog.o fromucs.o fuzzterm.o \ - localenc.o logging.o macenc.o marshal.o memory.o mimeenc.o \ - minibidi.o misc.o miscucs.o sbcs.o sbcsdat.o settings.o \ - slookup.o stripctrl.o terminal.o time.o timing.o toucs.o \ - tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxnogtk.o \ - uxprint.o uxstore.o uxucs.o version.o wcwidth.o xenc.o - $(CC) -o $@ be_none.o callback.o conf.o config.o dialog.o fromucs.o \ - fuzzterm.o localenc.o logging.o macenc.o marshal.o memory.o \ - mimeenc.o minibidi.o misc.o miscucs.o sbcs.o sbcsdat.o \ - settings.o slookup.o stripctrl.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxnogtk.o \ - uxprint.o uxstore.o uxucs.o version.o wcwidth.o xenc.o \ - $(ULDFLAGS) - -osxlaunch: osxlaunch.o - $(CC) -o $@ osxlaunch.o $(ULDFLAGS) - -pageant: aqsync.o be_misc.o be_none.o callback.o conf.o console.o ecc.o \ - errsock.o gtkask.o gtkmisc.o logging.o marshal.o memory.o \ - misc.o mpint.o nocproxy.o nogss.o nullplug.o pageant.o \ - proxy.o settings.o sshaes.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshdes.o sshdss.o sshecc.o sshhmac.o sshmd5.o \ - sshprng.o sshpubk.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o stripctrl.o time.o timing.o tree234.o utils.o \ - ux_x11.o uxagentc.o uxagentsock.o uxcliloop.o uxcons.o \ - uxfdsock.o uxmisc.o uxnet.o uxnoise.o uxpeer.o uxpgnt.o \ - uxpoll.o uxproxy.o uxsel.o uxsignal.o uxstore.o uxutils.o \ - version.o wcwidth.o x11fwd.o - $(CC) -o $@ aqsync.o be_misc.o be_none.o callback.o conf.o console.o \ - ecc.o errsock.o gtkask.o gtkmisc.o logging.o marshal.o \ - memory.o misc.o mpint.o nocproxy.o nogss.o nullplug.o \ - pageant.o proxy.o settings.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshblake2.o sshdes.o sshdss.o sshecc.o \ - sshhmac.o sshmd5.o sshprng.o sshpubk.o sshrsa.o sshsh256.o \ - sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o timing.o \ - tree234.o utils.o ux_x11.o uxagentc.o uxagentsock.o \ - uxcliloop.o uxcons.o uxfdsock.o uxmisc.o uxnet.o uxnoise.o \ - uxpeer.o uxpgnt.o uxpoll.o uxproxy.o uxsel.o uxsignal.o \ - uxstore.o uxutils.o version.o wcwidth.o x11fwd.o $(XLDFLAGS) - -plink: agentf.o aqsync.o be_all_s.o be_misc.o callback.o clicons.o cmdline.o \ - conf.o console.o cproxy.o ecc.o errsock.o ldisc.o logging.o \ - mainchan.o marshal.o memory.o misc.o mpint.o noterm.o \ - nullplug.o pgssapi.o pinger.o portfwd.o proxy.o raw.o \ - rlogin.o sessprep.o settings.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o supdup.o telnet.o time.o timing.o tree234.o \ - utils.o ux_x11.o uxagentc.o uxcliloop.o uxcons.o uxfdsock.o \ - uxgss.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o uxpeer.o \ - uxplink.o uxpoll.o uxproxy.o uxsel.o uxser.o uxshare.o \ - uxsignal.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o - $(CC) -o $@ agentf.o aqsync.o be_all_s.o be_misc.o callback.o \ - clicons.o cmdline.o conf.o console.o cproxy.o ecc.o \ - errsock.o ldisc.o logging.o mainchan.o marshal.o memory.o \ - misc.o mpint.o noterm.o nullplug.o pgssapi.o pinger.o \ - portfwd.o proxy.o raw.o rlogin.o sessprep.o settings.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o supdup.o \ - telnet.o time.o timing.o tree234.o utils.o ux_x11.o \ - uxagentc.o uxcliloop.o uxcons.o uxfdsock.o uxgss.o uxmisc.o \ - uxnet.o uxnogtk.o uxnoise.o uxpeer.o uxplink.o uxpoll.o \ - uxproxy.o uxsel.o uxser.o uxshare.o uxsignal.o uxstore.o \ - uxutils.o version.o wcwidth.o wildcard.o x11fwd.o \ - $(ULDFLAGS) - -pscp: agentf.o aqsync.o be_misc.o be_ssh.o callback.o clicons.o cmdline.o \ - conf.o console.o cproxy.o ecc.o errsock.o logging.o \ - mainchan.o marshal.o memory.o misc.o mpint.o nullplug.o \ - pgssapi.o pinger.o portfwd.o proxy.o pscp.o psftpcommon.o \ - settings.o sftp.o sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o time.o timing.o tree234.o utils.o uxagentc.o \ - uxcliloop.o uxcons.o uxfdsock.o uxgss.o uxmisc.o uxnet.o \ - uxnogtk.o uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxsel.o \ - uxsftp.o uxshare.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o - $(CC) -o $@ agentf.o aqsync.o be_misc.o be_ssh.o callback.o \ - clicons.o cmdline.o conf.o console.o cproxy.o ecc.o \ - errsock.o logging.o mainchan.o marshal.o memory.o misc.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - pscp.o psftpcommon.o settings.o sftp.o sftpcommon.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o uxagentc.o uxcliloop.o uxcons.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o \ - uxpeer.o uxpoll.o uxproxy.o uxsel.o uxsftp.o uxshare.o \ - uxstore.o uxutils.o version.o wcwidth.o wildcard.o x11fwd.o \ - $(ULDFLAGS) - -psftp: agentf.o aqsync.o be_misc.o be_ssh.o callback.o clicons.o cmdline.o \ - conf.o console.o cproxy.o ecc.o errsock.o logging.o \ - mainchan.o marshal.o memory.o misc.o mpint.o nullplug.o \ - pgssapi.o pinger.o portfwd.o proxy.o psftp.o psftpcommon.o \ - settings.o sftp.o sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o time.o timing.o tree234.o utils.o uxagentc.o \ - uxcliloop.o uxcons.o uxfdsock.o uxgss.o uxmisc.o uxnet.o \ - uxnogtk.o uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxsel.o \ - uxsftp.o uxshare.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o - $(CC) -o $@ agentf.o aqsync.o be_misc.o be_ssh.o callback.o \ - clicons.o cmdline.o conf.o console.o cproxy.o ecc.o \ - errsock.o logging.o mainchan.o marshal.o memory.o misc.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - psftp.o psftpcommon.o settings.o sftp.o sftpcommon.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o uxagentc.o uxcliloop.o uxcons.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o \ - uxpeer.o uxpoll.o uxproxy.o uxsel.o uxsftp.o uxshare.o \ - uxstore.o uxutils.o version.o wcwidth.o wildcard.o x11fwd.o \ - $(ULDFLAGS) - -psocks: be_misc.o callback.o conf.o console.o errsock.o logging.o marshal.o \ - memory.o misc.o nocproxy.o norand.o portfwd.o proxy.o \ - psocks.o sshutils.o stripctrl.o time.o timing.o tree234.o \ - utils.o uxcliloop.o uxcons.o uxfdsock.o uxmisc.o uxnet.o \ - uxnogtk.o uxpeer.o uxpoll.o uxproxy.o uxsel.o uxsignal.o \ - uxsocks.o version.o wcwidth.o - $(CC) -o $@ be_misc.o callback.o conf.o console.o errsock.o \ - logging.o marshal.o memory.o misc.o nocproxy.o norand.o \ - portfwd.o proxy.o psocks.o sshutils.o stripctrl.o time.o \ - timing.o tree234.o utils.o uxcliloop.o uxcons.o uxfdsock.o \ - uxmisc.o uxnet.o uxnogtk.o uxpeer.o uxpoll.o uxproxy.o \ - uxsel.o uxsignal.o uxsocks.o version.o wcwidth.o $(ULDFLAGS) - -psusan: be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o errsock.o \ - logging.o marshal.o memory.o millerrabin.o misc.o mpint.o \ - mpunsafe.o nogss.o nullplug.o pgssapi.o pockle.o portfwd.o \ - primecandidate.o procnet.o proxy.o scpserver.o sesschan.o \ - settings.o sftpcommon.o sftpserver.o smallprimes.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-server.o \ - ssh1login-server.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-server.o ssh2kex-server.o \ - ssh2transhk.o ssh2transport.o ssh2userauth-server.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshserver.o sshsh256.o sshsh512.o sshsha.o sshsha3.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o ux_x11.o uxagentsock.o \ - uxcliloop.o uxfdsock.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o \ - uxpeer.o uxpoll.o uxproxy.o uxpsusan.o uxpty.o uxsel.o \ - uxsftpserver.o uxsignal.o uxstore.o uxutils.o version.o \ - wcwidth.o wildcard.o x11fwd.o - $(CC) -o $@ be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o \ - errsock.o logging.o marshal.o memory.o millerrabin.o misc.o \ - mpint.o mpunsafe.o nogss.o nullplug.o pgssapi.o pockle.o \ - portfwd.o primecandidate.o procnet.o proxy.o scpserver.o \ - sesschan.o settings.o sftpcommon.o sftpserver.o \ - smallprimes.o ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-server.o ssh1login-server.o ssh2bpp.o \ - ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-server.o ssh2kex-server.o ssh2transhk.o \ - ssh2transport.o ssh2userauth-server.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprime.o \ - sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o sshserver.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o sshutils.o \ - sshverstring.o sshzlib.o stripctrl.o time.o timing.o \ - tree234.o utils.o ux_x11.o uxagentsock.o uxcliloop.o \ - uxfdsock.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o uxpeer.o \ - uxpoll.o uxproxy.o uxpsusan.o uxpty.o uxsel.o uxsftpserver.o \ - uxsignal.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o $(ULDFLAGS) - -pterm: be_none.o callback.o cmdline.o conf.o config.o dialog.o fromucs.o \ - gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o gtkmain.o \ - gtkmisc.o gtkwin.o ldisc.o localenc.o logging.o macenc.o \ - marshal.o memory.o mimeenc.o minibidi.o misc.o miscucs.o \ - nocproxy.o nogss.o sbcs.o sbcsdat.o sessprep.o settings.o \ - slookup.o stripctrl.o terminal.o time.o timing.o toucs.o \ - tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxprint.o \ - uxpterm.o uxpty.o uxsel.o uxsignal.o uxstore.o uxucs.o \ - version.o wcwidth.o x11misc.o xenc.o xkeysym.o xpmptcfg.o \ - xpmpterm.o - $(CC) -o $@ be_none.o callback.o cmdline.o conf.o config.o dialog.o \ - fromucs.o gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o \ - gtkmain.o gtkmisc.o gtkwin.o ldisc.o localenc.o logging.o \ - macenc.o marshal.o memory.o mimeenc.o minibidi.o misc.o \ - miscucs.o nocproxy.o nogss.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o stripctrl.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxprint.o \ - uxpterm.o uxpty.o uxsel.o uxsignal.o uxstore.o uxucs.o \ - version.o wcwidth.o x11misc.o xenc.o xkeysym.o xpmptcfg.o \ - xpmpterm.o $(XLDFLAGS) - -ptermapp: be_none.o callback.o conf.o config.o dialog.o fromucs.o gtkapp.o \ - gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o gtkmisc.o \ - gtkwin.o ldisc.o localenc.o logging.o macenc.o marshal.o \ - memory.o mimeenc.o minibidi.o misc.o miscucs.o nocmdline.o \ - nocproxy.o nogss.o sbcs.o sbcsdat.o sessprep.o settings.o \ - slookup.o stripctrl.o terminal.o time.o timing.o toucs.o \ - tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxprint.o \ - uxpterm.o uxpty.o uxsel.o uxsignal.o uxstore.o uxucs.o \ - version.o wcwidth.o x11misc.o xenc.o xkeysym.o xpmptcfg.o \ - xpmpterm.o - $(CC) -o $@ be_none.o callback.o conf.o config.o dialog.o fromucs.o \ - gtkapp.o gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o \ - gtkmisc.o gtkwin.o ldisc.o localenc.o logging.o macenc.o \ - marshal.o memory.o mimeenc.o minibidi.o misc.o miscucs.o \ - nocmdline.o nocproxy.o nogss.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o stripctrl.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxprint.o \ - uxpterm.o uxpty.o uxsel.o uxsignal.o uxstore.o uxucs.o \ - version.o wcwidth.o x11misc.o xenc.o xkeysym.o xpmptcfg.o \ - xpmpterm.o $(XLDFLAGS) - -putty: agentf.o aqsync.o be_all_s.o be_misc.o callback.o cmdline.o conf.o \ - config.o cproxy.o dialog.o ecc.o errsock.o fromucs.o \ - gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o gtkmain.o \ - gtkmisc.o gtkwin.o ldisc.o localenc.o logging.o macenc.o \ - mainchan.o marshal.o memory.o mimeenc.o minibidi.o misc.o \ - miscucs.o mpint.o nullplug.o pgssapi.o pinger.o portfwd.o \ - proxy.o raw.o rlogin.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o supdup.o telnet.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o ux_x11.o uxagentc.o uxcfg.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnoise.o uxpeer.o \ - uxpoll.o uxprint.o uxproxy.o uxputty.o uxsel.o uxser.o \ - uxshare.o uxsignal.o uxstore.o uxucs.o uxutils.o version.o \ - wcwidth.o wildcard.o x11fwd.o x11misc.o xenc.o xkeysym.o \ - xpmpucfg.o xpmputty.o - $(CC) -o $@ agentf.o aqsync.o be_all_s.o be_misc.o callback.o \ - cmdline.o conf.o config.o cproxy.o dialog.o ecc.o errsock.o \ - fromucs.o gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o \ - gtkmain.o gtkmisc.o gtkwin.o ldisc.o localenc.o logging.o \ - macenc.o mainchan.o marshal.o memory.o mimeenc.o minibidi.o \ - misc.o miscucs.o mpint.o nullplug.o pgssapi.o pinger.o \ - portfwd.o proxy.o raw.o rlogin.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o supdup.o telnet.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o ux_x11.o uxagentc.o uxcfg.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnoise.o uxpeer.o \ - uxpoll.o uxprint.o uxproxy.o uxputty.o uxsel.o uxser.o \ - uxshare.o uxsignal.o uxstore.o uxucs.o uxutils.o version.o \ - wcwidth.o wildcard.o x11fwd.o x11misc.o xenc.o xkeysym.o \ - xpmpucfg.o xpmputty.o $(XLDFLAGS) - -puttyapp: agentf.o aqsync.o be_all_s.o be_misc.o callback.o conf.o config.o \ - cproxy.o dialog.o ecc.o errsock.o fromucs.o gtkapp.o \ - gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o gtkmisc.o \ - gtkwin.o ldisc.o localenc.o logging.o macenc.o mainchan.o \ - marshal.o memory.o mimeenc.o minibidi.o misc.o miscucs.o \ - mpint.o nocmdline.o nullplug.o pgssapi.o pinger.o portfwd.o \ - proxy.o raw.o rlogin.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o supdup.o telnet.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o ux_x11.o uxagentc.o uxcfg.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnoise.o uxpeer.o \ - uxpoll.o uxprint.o uxproxy.o uxputty.o uxsel.o uxser.o \ - uxshare.o uxsignal.o uxstore.o uxucs.o uxutils.o version.o \ - wcwidth.o wildcard.o x11fwd.o x11misc.o xenc.o xkeysym.o \ - xpmpucfg.o xpmputty.o - $(CC) -o $@ agentf.o aqsync.o be_all_s.o be_misc.o callback.o conf.o \ - config.o cproxy.o dialog.o ecc.o errsock.o fromucs.o \ - gtkapp.o gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o gtkfont.o \ - gtkmisc.o gtkwin.o ldisc.o localenc.o logging.o macenc.o \ - mainchan.o marshal.o memory.o mimeenc.o minibidi.o misc.o \ - miscucs.o mpint.o nocmdline.o nullplug.o pgssapi.o pinger.o \ - portfwd.o proxy.o raw.o rlogin.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o supdup.o telnet.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o ux_x11.o uxagentc.o uxcfg.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnoise.o uxpeer.o \ - uxpoll.o uxprint.o uxproxy.o uxputty.o uxsel.o uxser.o \ - uxshare.o uxsignal.o uxstore.o uxucs.o uxutils.o version.o \ - wcwidth.o wildcard.o x11fwd.o x11misc.o xenc.o xkeysym.o \ - xpmpucfg.o xpmputty.o $(XLDFLAGS) - -puttygen: cmdgen.o conf.o console.o ecc.o import.o marshal.o memory.o \ - millerrabin.o misc.o mpint.o mpunsafe.o notiming.o pockle.o \ - primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o - $(CC) -o $@ cmdgen.o conf.o console.o ecc.o import.o marshal.o \ - memory.o millerrabin.o misc.o mpint.o mpunsafe.o notiming.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o \ - $(ULDFLAGS) - -puttytel: be_misc.o be_nos_s.o callback.o cmdline.o conf.o config.o dialog.o \ - errsock.o fromucs.o gtkcfg.o gtkcols.o gtkcomm.o gtkdlg.o \ - gtkfont.o gtkmain.o gtkmisc.o gtkwin.o ldisc.o localenc.o \ - logging.o macenc.o marshal.o memory.o mimeenc.o minibidi.o \ - misc.o miscucs.o nocproxy.o nogss.o norand.o pinger.o \ - proxy.o raw.o rlogin.o sbcs.o sbcsdat.o sessprep.o \ - settings.o slookup.o stripctrl.o supdup.o telnet.o \ - terminal.o time.o timing.o toucs.o tree234.o utf8.o utils.o \ - uxcfg.o uxfdsock.o uxmisc.o uxnet.o uxpeer.o uxpoll.o \ - uxprint.o uxproxy.o uxputty.o uxsel.o uxser.o uxsignal.o \ - uxstore.o uxucs.o uxutils.o version.o wcwidth.o x11misc.o \ - xenc.o xkeysym.o xpmpucfg.o xpmputty.o - $(CC) -o $@ be_misc.o be_nos_s.o callback.o cmdline.o conf.o \ - config.o dialog.o errsock.o fromucs.o gtkcfg.o gtkcols.o \ - gtkcomm.o gtkdlg.o gtkfont.o gtkmain.o gtkmisc.o gtkwin.o \ - ldisc.o localenc.o logging.o macenc.o marshal.o memory.o \ - mimeenc.o minibidi.o misc.o miscucs.o nocproxy.o nogss.o \ - norand.o pinger.o proxy.o raw.o rlogin.o sbcs.o sbcsdat.o \ - sessprep.o settings.o slookup.o stripctrl.o supdup.o \ - telnet.o terminal.o time.o timing.o toucs.o tree234.o utf8.o \ - utils.o uxcfg.o uxfdsock.o uxmisc.o uxnet.o uxpeer.o \ - uxpoll.o uxprint.o uxproxy.o uxputty.o uxsel.o uxser.o \ - uxsignal.o uxstore.o uxucs.o uxutils.o version.o wcwidth.o \ - x11misc.o xenc.o xkeysym.o xpmpucfg.o xpmputty.o $(XLDFLAGS) - -testcrypt: ecc.o marshal.o memory.o millerrabin.o mpint.o mpunsafe.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o sshdssg.o \ - sshecc.o sshecdsag.o sshhmac.o sshmd5.o sshprime.o sshprng.o \ - sshpubk.o sshrsa.o sshrsag.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o testcrypt.o tree234.o utils.o uxutils.o - $(CC) -o $@ ecc.o marshal.o memory.o millerrabin.o mpint.o \ - mpunsafe.o pockle.o primecandidate.o smallprimes.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o sshprime.o \ - sshprng.o sshpubk.o sshrsa.o sshrsag.o sshsh256.o sshsh512.o \ - sshsha.o sshsha3.o testcrypt.o tree234.o utils.o uxutils.o \ - $(ULDFLAGS) - -testsc: ecc.o marshal.o memory.o mpint.o sshaes.o ssharcf.o sshargon2.o \ - sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshhmac.o \ - sshmac.o sshmd5.o sshpubk.o sshrsa.o sshsh256.o sshsh512.o \ - sshsha.o sshsha3.o testsc.o tree234.o utils.o uxutils.o \ - wildcard.o - $(CC) -o $@ ecc.o marshal.o memory.o mpint.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o \ - sshhmac.o sshmac.o sshmd5.o sshpubk.o sshrsa.o sshsh256.o \ - sshsh512.o sshsha.o sshsha3.o testsc.o tree234.o utils.o \ - uxutils.o wildcard.o $(ULDFLAGS) - -testzlib: marshal.o memory.o sshzlib.o testzlib.o utils.o - $(CC) -o $@ marshal.o memory.o sshzlib.o testzlib.o utils.o \ - $(ULDFLAGS) - -uppity: be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o errsock.o \ - logging.o marshal.o memory.o millerrabin.o misc.o mpint.o \ - mpunsafe.o nullplug.o pgssapi.o pockle.o portfwd.o \ - primecandidate.o procnet.o proxy.o scpserver.o sesschan.o \ - settings.o sftpcommon.o sftpserver.o smallprimes.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-server.o \ - ssh1login-server.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-server.o ssh2kex-server.o \ - ssh2transhk.o ssh2transport.o ssh2userauth-server.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshserver.o sshsh256.o sshsh512.o sshsha.o sshsha3.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o ux_x11.o uxagentsock.o \ - uxcliloop.o uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o \ - uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxpty.o uxsel.o \ - uxserver.o uxsftpserver.o uxsignal.o uxstore.o uxutils.o \ - version.o wcwidth.o wildcard.o x11fwd.o - $(CC) -o $@ be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o \ - errsock.o logging.o marshal.o memory.o millerrabin.o misc.o \ - mpint.o mpunsafe.o nullplug.o pgssapi.o pockle.o portfwd.o \ - primecandidate.o procnet.o proxy.o scpserver.o sesschan.o \ - settings.o sftpcommon.o sftpserver.o smallprimes.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-server.o \ - ssh1login-server.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-server.o ssh2kex-server.o \ - ssh2transhk.o ssh2transport.o ssh2userauth-server.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshserver.o sshsh256.o sshsh512.o sshsha.o sshsha3.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o ux_x11.o uxagentsock.o \ - uxcliloop.o uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o \ - uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxpty.o uxsel.o \ - uxserver.o uxsftpserver.o uxsignal.o uxstore.o uxutils.o \ - version.o wcwidth.o wildcard.o x11fwd.o $(ULDFLAGS) - -agentf.o: ../agentf.c ../putty.h ../ssh.h ../pageant.h ../sshchan.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../agentf.c -aqsync.o: ../aqsync.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../aqsync.c -be_all_s.o: ../be_all_s.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_all_s.c -be_misc.o: ../be_misc.c ../putty.h ../network.h ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_misc.c -be_none.o: ../be_none.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_none.c -be_nos_s.o: ../be_nos_s.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_nos_s.c -be_ssh.o: ../be_ssh.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_ssh.c -callback.o: ../callback.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../callback.c -cgtest.o: ../cgtest.c ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cgtest.c -clicons.o: ../clicons.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../clicons.c -cmdgen.o: ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h ../mpint.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cmdgen.c -cmdline.o: ../cmdline.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cmdline.c -conf.o: ../conf.c ../tree234.h ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../conf.c -config.o: ../config.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../config.c -console.o: ../console.c ../putty.h ../misc.h ../console.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../console.c -cproxy.o: ../cproxy.c ../putty.h ../ssh.h ../network.h ../proxy.h \ - ../marshal.h ../defs.h ../puttyps.h ../misc.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cproxy.c -dialog.o: ../dialog.c ../putty.h ../dialog.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../dialog.c -ecc.o: ../ecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ecc.c -errsock.o: ../errsock.c ../tree234.h ../putty.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../errsock.c -fromucs.o: ../charset/fromucs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/fromucs.c -fuzzterm.o: ../fuzzterm.c ../putty.h ../dialog.h ../terminal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../fuzzterm.c -gtkapp.o: ../unix/gtkapp.c ../putty.h ../unix/gtkmisc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkapp.c -gtkask.o: ../unix/gtkask.c ../defs.h ../unix/gtkfont.h ../unix/gtkcompat.h \ - ../unix/gtkmisc.h ../putty.h ../ssh.h ../misc.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkask.c -gtkcfg.o: ../unix/gtkcfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcfg.c -gtkcols.o: ../unix/gtkcols.c ../defs.h ../unix/gtkcompat.h ../unix/gtkcols.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcols.c -gtkcomm.o: ../unix/gtkcomm.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcomm.c -gtkdlg.o: ../unix/gtkdlg.c ../putty.h ../unix/gtkcompat.h ../unix/gtkcols.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../storage.h ../dialog.h ../tree234.h ../licence.h ../ssh.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkdlg.c -gtkfont.o: ../unix/gtkfont.c ../putty.h ../unix/gtkfont.h \ - ../unix/gtkcompat.h ../unix/gtkmisc.h ../tree234.h \ - ../unix/x11misc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkfont.c -gtkmain.o: ../unix/gtkmain.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkmain.c -gtkmisc.o: ../unix/gtkmisc.c ../putty.h ../unix/gtkcompat.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkmisc.c -gtkwin.o: ../unix/gtkwin.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkwin.c -import.o: ../import.c ../putty.h ../ssh.h ../mpint.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../import.c -ldisc.o: ../ldisc.c ../putty.h ../terminal.h ../ldisc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ldisc.c -localenc.o: ../charset/localenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/localenc.c -logging.o: ../logging.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../logging.c -macenc.o: ../charset/macenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/macenc.c -mainchan.o: ../mainchan.c ../putty.h ../ssh.h ../sshppl.h ../sshchan.h \ - ../sshsignals.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mainchan.c -marshal.o: ../marshal.c ../marshal.h ../misc.h ../defs.h ../puttymem.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../marshal.c -memory.o: ../memory.c ../defs.h ../puttymem.h ../misc.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../memory.c -millerrabin.o: ../millerrabin.c ../ssh.h ../sshkeygen.h ../mpint.h \ - ../mpunsafe.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../millerrabin.c -mimeenc.o: ../charset/mimeenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/mimeenc.c -minibidi.o: ../minibidi.c ../putty.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../minibidi.c -misc.o: ../misc.c ../defs.h ../putty.h ../misc.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../misc.c -miscucs.o: ../miscucs.c ../putty.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../miscucs.c -mpint.o: ../mpint.c ../defs.h ../misc.h ../puttymem.h ../mpint.h \ - ../mpint_i.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mpint.c -mpunsafe.o: ../mpunsafe.c ../defs.h ../misc.h ../puttymem.h ../mpint.h \ - ../mpint_i.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mpunsafe.c -nocmdline.o: ../nocmdline.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nocmdline.c -nocproxy.o: ../nocproxy.c ../putty.h ../network.h ../proxy.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nocproxy.c -nogss.o: ../nogss.c ../putty.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nogss.c -norand.o: ../norand.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../norand.c -noterm.o: ../noterm.c ../putty.h ../terminal.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../noterm.c -notiming.o: ../notiming.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../notiming.c -nullplug.o: ../nullplug.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nullplug.c -osxlaunch.o: ../unix/osxlaunch.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/osxlaunch.c -pageant.o: ../pageant.c ../putty.h ../mpint.h ../ssh.h ../sshcr.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pageant.c -pgssapi.o: ../pgssapi.c ../putty.h ../pgssapi.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pgssapi.c -pinger.o: ../pinger.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pinger.c -pockle.o: ../pockle.c ../ssh.h ../sshkeygen.h ../mpint.h ../mpunsafe.h \ - ../tree234.h ../puttymem.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pockle.c -portfwd.o: ../portfwd.c ../putty.h ../ssh.h ../sshchan.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../portfwd.c -primecandidate.o: ../primecandidate.c ../ssh.h ../mpint.h ../mpunsafe.h \ - ../sshkeygen.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../primecandidate.c -procnet.o: ../unix/procnet.c ../misc.h ../defs.h ../puttymem.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/procnet.c -proxy.o: ../proxy.c ../putty.h ../network.h ../proxy.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../proxy.c -pscp.o: ../pscp.c ../putty.h ../psftp.h ../ssh.h ../sftp.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pscp.c -psftp.o: ../psftp.c ../putty.h ../psftp.h ../storage.h ../ssh.h ../sftp.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psftp.c -psftpcommon.o: ../psftpcommon.c ../putty.h ../sftp.h ../psftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psftpcommon.c -psocks.o: ../psocks.c ../putty.h ../misc.h ../ssh.h ../sshchan.h ../psocks.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psocks.c -raw.o: ../raw.c ../putty.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../raw.c -rlogin.o: ../rlogin.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../rlogin.c -sbcs.o: ../charset/sbcs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/sbcs.c -sbcsdat.o: ../charset/sbcsdat.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/sbcsdat.c -scpserver.o: ../scpserver.c ../putty.h ../ssh.h ../sshcr.h ../sshchan.h \ - ../sftp.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../scpserver.c -sesschan.o: ../sesschan.c ../putty.h ../ssh.h ../sshchan.h ../sshserver.h \ - ../sftp.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sesschan.c -sessprep.o: ../sessprep.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sessprep.c -settings.o: ../settings.c ../putty.h ../storage.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../settings.c -sftp.o: ../sftp.c ../misc.h ../tree234.h ../sftp.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftp.c -sftpcommon.o: ../sftpcommon.c ../misc.h ../sftp.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftpcommon.c -sftpserver.o: ../sftpserver.c ../putty.h ../ssh.h ../sftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftpserver.c -sizetip.o: ../windows/sizetip.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/sizetip.c -slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \ - ../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/slookup.c -smallprimes.o: ../smallprimes.c ../ssh.h ../sshkeygen.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../smallprimes.c -ssh.o: ../ssh.c ../putty.h ../pageant.h ../tree234.h ../storage.h \ - ../marshal.h ../ssh.h ../sshcr.h ../sshbpp.h ../sshppl.h \ - ../sshchan.h ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh.c -ssh1bpp.o: ../ssh1bpp.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1bpp.c -ssh1censor.o: ../ssh1censor.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1censor.c -ssh1connection.o: ../ssh1connection.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshcr.h ../ssh1connection.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection.c -ssh1connection-client.o: ../ssh1connection-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection-client.c -ssh1connection-server.o: ../ssh1connection-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection-server.c -ssh1login.o: ../ssh1login.c ../putty.h ../ssh.h ../mpint.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1login.c -ssh1login-server.o: ../ssh1login-server.c ../putty.h ../mpint.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshkeygen.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1login-server.c -ssh2bpp.o: ../ssh2bpp.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2bpp.c -ssh2bpp-bare.o: ../ssh2bpp-bare.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2bpp-bare.c -ssh2censor.o: ../ssh2censor.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2censor.c -ssh2connection.o: ../ssh2connection.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshcr.h ../ssh2connection.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection.c -ssh2connection-client.o: ../ssh2connection-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection-client.c -ssh2connection-server.o: ../ssh2connection-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection-server.c -ssh2kex-client.o: ../ssh2kex-client.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../storage.h ../ssh2transport.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../sshgssc.h ../sshgss.h \ - ../windows/winstuff.h ../unix/unix.h ../pgssapi.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2kex-client.c -ssh2kex-server.o: ../ssh2kex-server.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshserver.h ../sshkeygen.h \ - ../storage.h ../ssh2transport.h ../mpint.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../sshgssc.h ../sshgss.h ../windows/winstuff.h \ - ../unix/unix.h ../pgssapi.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2kex-server.c -ssh2transhk.o: ../ssh2transhk.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2transhk.c -ssh2transport.o: ../ssh2transport.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshserver.h ../storage.h \ - ../ssh2transport.h ../mpint.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h ../sshgssc.h \ - ../sshgss.h ../windows/winstuff.h ../unix/unix.h \ - ../pgssapi.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2transport.c -ssh2userauth.o: ../ssh2userauth.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshgssc.h ../sshgss.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2userauth.c -ssh2userauth-server.o: ../ssh2userauth-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../pgssapi.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2userauth-server.c -sshaes.o: ../sshaes.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshaes.c -ssharcf.o: ../ssharcf.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssharcf.c -sshargon2.o: ../sshargon2.c ../putty.h ../ssh.h ../marshal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshargon2.c -sshauxcrypt.o: ../sshauxcrypt.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshauxcrypt.c -sshbcrypt.o: ../sshbcrypt.c ../ssh.h ../sshblowf.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshbcrypt.c -sshblake2.o: ../sshblake2.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshblake2.c -sshblowf.o: ../sshblowf.c ../ssh.h ../sshblowf.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshblowf.c -sshccp.o: ../sshccp.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshccp.c -sshcommon.o: ../sshcommon.c ../putty.h ../mpint.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshttymodes.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcommon.c -sshcrc.o: ../sshcrc.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcrc.c -sshcrcda.o: ../sshcrcda.c ../misc.h ../ssh.h ../defs.h ../puttymem.h \ - ../marshal.h ../tree234.h ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcrcda.c -sshdes.o: ../sshdes.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdes.c -sshdh.o: ../sshdh.c ../ssh.h ../misc.h ../mpint.h ../puttymem.h ../tree234.h \ - ../network.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdh.c -sshdss.o: ../sshdss.c ../ssh.h ../mpint.h ../misc.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdss.c -sshdssg.o: ../sshdssg.c ../misc.h ../ssh.h ../sshkeygen.h ../mpint.h \ - ../defs.h ../puttymem.h ../marshal.h ../tree234.h \ - ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdssg.c -sshecc.o: ../sshecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshecc.c -sshecdsag.o: ../sshecdsag.c ../ssh.h ../sshkeygen.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshecdsag.c -sshgssc.o: ../sshgssc.c ../putty.h ../sshgssc.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../pgssapi.h ../sshgss.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshgssc.c -sshhmac.o: ../sshhmac.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshhmac.c -sshmac.o: ../sshmac.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshmac.c -sshmd5.o: ../sshmd5.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshmd5.c -sshprime.o: ../sshprime.c ../ssh.h ../mpint.h ../mpunsafe.h ../sshkeygen.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshprime.c -sshprng.o: ../sshprng.c ../putty.h ../ssh.h ../mpint_i.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshprng.c -sshpubk.o: ../sshpubk.c ../putty.h ../mpint.h ../ssh.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshpubk.c -sshrand.o: ../sshrand.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrand.c -sshrsa.o: ../sshrsa.c ../ssh.h ../mpint.h ../misc.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrsa.c -sshrsag.o: ../sshrsag.c ../ssh.h ../sshkeygen.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrsag.c -sshserver.o: ../sshserver.c ../putty.h ../ssh.h ../sshbpp.h ../sshppl.h \ - ../sshchan.h ../sshserver.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshserver.c -sshsh256.o: ../sshsh256.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsh256.c -sshsh512.o: ../sshsh512.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsh512.c -sshsha.o: ../sshsha.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsha.c -sshsha3.o: ../sshsha3.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsha3.c -sshshare.o: ../sshshare.c ../putty.h ../tree234.h ../ssh.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshshare.c -sshutils.o: ../sshutils.c ../putty.h ../ssh.h ../sshchan.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshutils.c -sshverstring.o: ../sshverstring.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshverstring.c -sshzlib.o: ../sshzlib.c ../defs.h ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshzlib.c -stripctrl.o: ../stripctrl.c ../putty.h ../terminal.h ../misc.h ../marshal.h \ - ../defs.h ../puttyps.h ../network.h ../sshsignals.h \ - ../tree234.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../stripctrl.c -supdup.o: ../supdup.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../supdup.c -telnet.o: ../telnet.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../telnet.c -terminal.o: ../terminal.c ../putty.h ../terminal.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../terminal.c -testcrypt.o: ../testcrypt.c ../defs.h ../ssh.h ../sshkeygen.h ../misc.h \ - ../mpint.h ../ecc.h ../testcrypt.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testcrypt.c -testsc.o: ../testsc.c ../defs.h ../putty.h ../ssh.h ../misc.h ../mpint.h \ - ../ecc.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testsc.c -testzlib.o: ../testzlib.c ../defs.h ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testzlib.c -time.o: ../time.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../time.c -timing.o: ../timing.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../timing.c -toucs.o: ../charset/toucs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/toucs.c -tree234.o: ../tree234.c ../defs.h ../tree234.h ../puttymem.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../tree234.c -utf8.o: ../charset/utf8.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/utf8.c -utils.o: ../utils.c ../defs.h ../misc.h ../ssh.h ../puttymem.h ../marshal.h \ - ../tree234.h ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../utils.c -ux_x11.o: ../unix/ux_x11.c ../putty.h ../ssh.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/ux_x11.c -uxagentc.o: ../unix/uxagentc.c ../putty.h ../misc.h ../tree234.h \ - ../puttymem.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxagentc.c -uxagentsock.o: ../unix/uxagentsock.c ../putty.h ../ssh.h ../misc.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxagentsock.c -uxcfg.o: ../unix/uxcfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcfg.c -uxcliloop.o: ../unix/uxcliloop.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcliloop.c -uxcons.o: ../unix/uxcons.c ../putty.h ../storage.h ../ssh.h ../console.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcons.c -uxfdsock.o: ../unix/uxfdsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxfdsock.c -uxgen.o: ../unix/uxgen.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxgen.c -uxgss.o: ../unix/uxgss.c ../putty.h ../pgssapi.h ../sshgss.h ../sshgssc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxgss.c -uxmisc.o: ../unix/uxmisc.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxmisc.c -uxnet.o: ../unix/uxnet.c ../putty.h ../network.h ../tree234.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnet.c -uxnogtk.o: ../unix/uxnogtk.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnogtk.c -uxnoise.o: ../unix/uxnoise.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnoise.c -uxpeer.o: ../unix/uxpeer.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpeer.c -uxpgnt.o: ../unix/uxpgnt.c ../putty.h ../ssh.h ../misc.h ../pageant.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpgnt.c -uxplink.o: ../unix/uxplink.c ../putty.h ../ssh.h ../storage.h ../tree234.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxplink.c -uxpoll.o: ../unix/uxpoll.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpoll.c -uxprint.o: ../unix/uxprint.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxprint.c -uxproxy.o: ../unix/uxproxy.c ../tree234.h ../putty.h ../network.h ../proxy.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxproxy.c -uxpsusan.o: ../unix/uxpsusan.c ../putty.h ../mpint.h ../ssh.h ../sshserver.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpsusan.c -uxpterm.o: ../unix/uxpterm.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpterm.c -uxpty.o: ../unix/uxpty.c ../putty.h ../ssh.h ../sshserver.h ../tree234.h \ - ../sshttymodes.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpty.c -uxputty.o: ../unix/uxputty.c ../putty.h ../ssh.h ../storage.h \ - ../unix/gtkcompat.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxputty.c -uxsel.o: ../unix/uxsel.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsel.c -uxser.o: ../unix/uxser.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxser.c -uxserver.o: ../unix/uxserver.c ../putty.h ../mpint.h ../ssh.h ../sshserver.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxserver.c -uxsftp.o: ../unix/uxsftp.c ../putty.h ../ssh.h ../psftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsftp.c -uxsftpserver.o: ../unix/uxsftpserver.c ../putty.h ../ssh.h ../sshserver.h \ - ../sftp.h ../tree234.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsftpserver.c -uxshare.o: ../unix/uxshare.c ../tree234.h ../putty.h ../network.h ../proxy.h \ - ../ssh.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxshare.c -uxsignal.o: ../unix/uxsignal.c ../defs.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsignal.c -uxsocks.o: ../unix/uxsocks.c ../putty.h ../ssh.h ../psocks.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsocks.c -uxstore.o: ../unix/uxstore.c ../putty.h ../storage.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxstore.c -uxucs.o: ../unix/uxucs.c ../putty.h ../charset/charset.h ../terminal.h \ - ../misc.h ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxucs.c -uxutils.o: ../unix/uxutils.c ../putty.h ../ssh.h ../unix/uxutils.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxutils.c -version.o: ../version.c ../putty.h ../ssh.h ../empty.h ../version.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../version.c -wcwidth.o: ../wcwidth.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../wcwidth.c -wildcard.o: ../wildcard.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../wildcard.c -wincapi.o: ../windows/wincapi.c ../putty.h ../ssh.h ../windows/wincapi.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincapi.c -wincfg.o: ../windows/wincfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincfg.c -wincliloop.o: ../windows/wincliloop.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincliloop.c -wincons.o: ../windows/wincons.c ../putty.h ../storage.h ../ssh.h \ - ../console.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincons.c -winctrls.o: ../windows/winctrls.c ../putty.h ../misc.h ../dialog.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winctrls.c -windefs.o: ../windows/windefs.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/windefs.c -windlg.o: ../windows/windlg.c ../putty.h ../ssh.h ../windows/win_res.h \ - ../windows/winseat.h ../storage.h ../dialog.h ../licence.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/windlg.c -window.o: ../windows/window.c ../putty.h ../terminal.h ../storage.h \ - ../windows/win_res.h ../windows/winsecur.h \ - ../windows/winseat.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/window.c -wingss.o: ../windows/wingss.c ../putty.h ../pgssapi.h ../sshgss.h \ - ../sshgssc.h ../misc.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wingss.c -winhandl.o: ../windows/winhandl.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhandl.c -winhelp.o: ../windows/winhelp.c ../putty.h ../windows/win_res.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhelp.c -winhsock.o: ../windows/winhsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhsock.c -winjump.o: ../windows/winjump.c ../putty.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winjump.c -winmisc.o: ../windows/winmisc.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winmisc.c -winmiscs.o: ../windows/winmiscs.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winmiscs.c -winnet.o: ../windows/winnet.c ../putty.h ../network.h ../tree234.h ../ssh.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnet.c -winnohlp.o: ../windows/winnohlp.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnohlp.c -winnoise.o: ../windows/winnoise.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnoise.c -winnojmp.o: ../windows/winnojmp.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnojmp.c -winnpc.o: ../windows/winnpc.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnpc.c -winnps.o: ../windows/winnps.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnps.c -winpgen.o: ../windows/winpgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../licence.h ../windows/winsecur.h ../windows/puttygen-rc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgen.c -winpgnt.o: ../windows/winpgnt.c ../putty.h ../ssh.h ../misc.h ../tree234.h \ - ../windows/winsecur.h ../windows/wincapi.h ../pageant.h \ - ../licence.h ../windows/pageant-rc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgnt.c -winpgntc.o: ../windows/winpgntc.c ../putty.h ../pageant.h \ - ../windows/winsecur.h ../windows/wincapi.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgntc.c -winplink.o: ../windows/winplink.c ../putty.h ../storage.h ../tree234.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winplink.c -winprint.o: ../windows/winprint.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winprint.c -winproxy.o: ../windows/winproxy.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winproxy.c -winsecur.o: ../windows/winsecur.c ../putty.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsecur.c -winselcli.o: ../windows/winselcli.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winselcli.c -winselgui.o: ../windows/winselgui.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winselgui.c -winser.o: ../windows/winser.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winser.c -winsftp.o: ../windows/winsftp.c ../putty.h ../psftp.h ../ssh.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsftp.c -winshare.o: ../windows/winshare.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/wincapi.h \ - ../windows/winsecur.h ../noshare.c ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winshare.c -winsocks.o: ../windows/winsocks.c ../putty.h ../ssh.h ../psocks.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsocks.c -winstore.o: ../windows/winstore.c ../putty.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winstore.c -wintime.o: ../windows/wintime.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wintime.c -winucs.o: ../windows/winucs.c ../putty.h ../terminal.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winucs.c -winutils.o: ../windows/winutils.c ../putty.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winutils.c -winx11.o: ../windows/winx11.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winx11.c -x11fwd.o: ../x11fwd.c ../putty.h ../ssh.h ../sshchan.h ../tree234.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../x11fwd.c -x11misc.o: ../unix/x11misc.c ../putty.h ../unix/x11misc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/x11misc.c -xenc.o: ../charset/xenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/xenc.c -xkeysym.o: ../unix/xkeysym.c ../misc.h ../defs.h ../puttymem.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xkeysym.c -xpmptcfg.o: ../unix/xpmptcfg.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmptcfg.c -xpmpterm.o: ../unix/xpmpterm.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmpterm.c -xpmpucfg.o: ../unix/xpmpucfg.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmpucfg.c -xpmputty.o: ../unix/xpmputty.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmputty.c - -install: - mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) - $(INSTALL_PROGRAM) -m 755 pageant $(DESTDIR)$(bindir)/pageant - $(INSTALL_PROGRAM) -m 755 plink $(DESTDIR)$(bindir)/plink - $(INSTALL_PROGRAM) -m 755 pscp $(DESTDIR)$(bindir)/pscp - $(INSTALL_PROGRAM) -m 755 psftp $(DESTDIR)$(bindir)/psftp - $(INSTALL_PROGRAM) -m 755 pterm $(DESTDIR)$(bindir)/pterm - if test -n "$(UTMP_GROUP)"; then \ - chgrp $(UTMP_GROUP) $(DESTDIR)$(bindir)/pterm && \ - chmod 2755 $(DESTDIR)$(bindir)/pterm; \ - elif test -n "$(UTMP_USER)"; then \ - chown $(UTMP_USER) $(DESTDIR)$(bindir)/pterm && \ - chmod 4755 $(DESTDIR)$(bindir)/pterm; \ - fi - $(INSTALL_PROGRAM) -m 755 putty $(DESTDIR)$(bindir)/putty - $(INSTALL_PROGRAM) -m 755 puttygen $(DESTDIR)$(bindir)/puttygen - $(INSTALL_PROGRAM) -m 755 puttytel $(DESTDIR)$(bindir)/puttytel - $(INSTALL_DATA) -m 644 ../doc/pageant.1 $(DESTDIR)$(man1dir)/pageant.1 - $(INSTALL_DATA) -m 644 ../doc/plink.1 $(DESTDIR)$(man1dir)/plink.1 - $(INSTALL_DATA) -m 644 ../doc/pscp.1 $(DESTDIR)$(man1dir)/pscp.1 - $(INSTALL_DATA) -m 644 ../doc/psftp.1 $(DESTDIR)$(man1dir)/psftp.1 - $(INSTALL_DATA) -m 644 ../doc/pterm.1 $(DESTDIR)$(man1dir)/pterm.1 - $(INSTALL_DATA) -m 644 ../doc/putty.1 $(DESTDIR)$(man1dir)/putty.1 - $(INSTALL_DATA) -m 644 ../doc/puttygen.1 $(DESTDIR)$(man1dir)/puttygen.1 - $(INSTALL_DATA) -m 644 ../doc/puttytel.1 $(DESTDIR)$(man1dir)/puttytel.1 - -install-strip: - $(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" - -clean: - rm -f *.o cgtest fuzzterm osxlaunch pageant plink pscp psftp psocks psusan pterm ptermapp putty puttyapp puttygen puttytel testcrypt testsc testzlib uppity - -FORCE: diff --git a/code/unix/Makefile.ux b/code/unix/Makefile.ux deleted file mode 100644 index 6cd66c6..0000000 --- a/code/unix/Makefile.ux +++ /dev/null @@ -1,1602 +0,0 @@ -# Makefile for putty under Unix. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. -# -# Extra options you can set: -# -# - COMPAT=-DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=-DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=-DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=-DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=-DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=-DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=-DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=-DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=-DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=-DMSVC4 (Windows only) -# - RCFL=-DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need -DNO_SECURITY and -DNO_MULTIMON. -# -# - COMPAT=-DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=-DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=-DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=-DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=-DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. - -# You can define this path to point at your tools if you need to -# TOOLPATH = /opt/gcc/bin -CC = $(TOOLPATH)cc - --include Makefile.local - -unexport CFLAGS # work around a weird issue with krb5-config - -CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g -I.././ -I../charset/ -I../windows/ \ - -I../unix/ -D _FILE_OFFSET_BITS=64 -ULDFLAGS = $(LDFLAGS) -INSTALL=install -INSTALL_PROGRAM=$(INSTALL) -INSTALL_DATA=$(INSTALL) -prefix=/usr/local -exec_prefix=$(prefix) -bindir=$(exec_prefix)/bin -mandir=$(prefix)/man -man1dir=$(mandir)/man1 - - -.SUFFIXES: - - -all: cgtest fuzzterm osxlaunch plink pscp psftp psocks psusan puttygen \ - testcrypt testsc testzlib uppity - -cgtest: cgtest.o conf.o console.o ecc.o import.o marshal.o memory.o \ - millerrabin.o misc.o mpint.o mpunsafe.o notiming.o pockle.o \ - primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o - $(CC) -o $@ cgtest.o conf.o console.o ecc.o import.o marshal.o \ - memory.o millerrabin.o misc.o mpint.o mpunsafe.o notiming.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o \ - $(ULDFLAGS) - -fuzzterm: be_none.o callback.o conf.o config.o dialog.o fromucs.o fuzzterm.o \ - localenc.o logging.o macenc.o marshal.o memory.o mimeenc.o \ - minibidi.o misc.o miscucs.o sbcs.o sbcsdat.o settings.o \ - slookup.o stripctrl.o terminal.o time.o timing.o toucs.o \ - tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxnogtk.o \ - uxprint.o uxstore.o uxucs.o version.o wcwidth.o xenc.o - $(CC) -o $@ be_none.o callback.o conf.o config.o dialog.o fromucs.o \ - fuzzterm.o localenc.o logging.o macenc.o marshal.o memory.o \ - mimeenc.o minibidi.o misc.o miscucs.o sbcs.o sbcsdat.o \ - settings.o slookup.o stripctrl.o terminal.o time.o timing.o \ - toucs.o tree234.o utf8.o utils.o uxcfg.o uxmisc.o uxnogtk.o \ - uxprint.o uxstore.o uxucs.o version.o wcwidth.o xenc.o \ - $(ULDFLAGS) - -osxlaunch: osxlaunch.o - $(CC) -o $@ osxlaunch.o $(ULDFLAGS) - -plink: agentf.o aqsync.o be_all_s.o be_misc.o callback.o clicons.o cmdline.o \ - conf.o console.o cproxy.o ecc.o errsock.o ldisc.o logging.o \ - mainchan.o marshal.o memory.o misc.o mpint.o noterm.o \ - nullplug.o pgssapi.o pinger.o portfwd.o proxy.o raw.o \ - rlogin.o sessprep.o settings.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o supdup.o telnet.o time.o timing.o tree234.o \ - utils.o ux_x11.o uxagentc.o uxcliloop.o uxcons.o uxfdsock.o \ - uxgss.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o uxpeer.o \ - uxplink.o uxpoll.o uxproxy.o uxsel.o uxser.o uxshare.o \ - uxsignal.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o - $(CC) -o $@ agentf.o aqsync.o be_all_s.o be_misc.o callback.o \ - clicons.o cmdline.o conf.o console.o cproxy.o ecc.o \ - errsock.o ldisc.o logging.o mainchan.o marshal.o memory.o \ - misc.o mpint.o noterm.o nullplug.o pgssapi.o pinger.o \ - portfwd.o proxy.o raw.o rlogin.o sessprep.o settings.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o supdup.o \ - telnet.o time.o timing.o tree234.o utils.o ux_x11.o \ - uxagentc.o uxcliloop.o uxcons.o uxfdsock.o uxgss.o uxmisc.o \ - uxnet.o uxnogtk.o uxnoise.o uxpeer.o uxplink.o uxpoll.o \ - uxproxy.o uxsel.o uxser.o uxshare.o uxsignal.o uxstore.o \ - uxutils.o version.o wcwidth.o wildcard.o x11fwd.o \ - $(ULDFLAGS) - -pscp: agentf.o aqsync.o be_misc.o be_ssh.o callback.o clicons.o cmdline.o \ - conf.o console.o cproxy.o ecc.o errsock.o logging.o \ - mainchan.o marshal.o memory.o misc.o mpint.o nullplug.o \ - pgssapi.o pinger.o portfwd.o proxy.o pscp.o psftpcommon.o \ - settings.o sftp.o sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o time.o timing.o tree234.o utils.o uxagentc.o \ - uxcliloop.o uxcons.o uxfdsock.o uxgss.o uxmisc.o uxnet.o \ - uxnogtk.o uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxsel.o \ - uxsftp.o uxshare.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o - $(CC) -o $@ agentf.o aqsync.o be_misc.o be_ssh.o callback.o \ - clicons.o cmdline.o conf.o console.o cproxy.o ecc.o \ - errsock.o logging.o mainchan.o marshal.o memory.o misc.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - pscp.o psftpcommon.o settings.o sftp.o sftpcommon.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o uxagentc.o uxcliloop.o uxcons.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o \ - uxpeer.o uxpoll.o uxproxy.o uxsel.o uxsftp.o uxshare.o \ - uxstore.o uxutils.o version.o wcwidth.o wildcard.o x11fwd.o \ - $(ULDFLAGS) - -psftp: agentf.o aqsync.o be_misc.o be_ssh.o callback.o clicons.o cmdline.o \ - conf.o console.o cproxy.o ecc.o errsock.o logging.o \ - mainchan.o marshal.o memory.o misc.o mpint.o nullplug.o \ - pgssapi.o pinger.o portfwd.o proxy.o psftp.o psftpcommon.o \ - settings.o sftp.o sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o time.o timing.o tree234.o utils.o uxagentc.o \ - uxcliloop.o uxcons.o uxfdsock.o uxgss.o uxmisc.o uxnet.o \ - uxnogtk.o uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxsel.o \ - uxsftp.o uxshare.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o - $(CC) -o $@ agentf.o aqsync.o be_misc.o be_ssh.o callback.o \ - clicons.o cmdline.o conf.o console.o cproxy.o ecc.o \ - errsock.o logging.o mainchan.o marshal.o memory.o misc.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - psftp.o psftpcommon.o settings.o sftp.o sftpcommon.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o uxagentc.o uxcliloop.o uxcons.o \ - uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o \ - uxpeer.o uxpoll.o uxproxy.o uxsel.o uxsftp.o uxshare.o \ - uxstore.o uxutils.o version.o wcwidth.o wildcard.o x11fwd.o \ - $(ULDFLAGS) - -psocks: be_misc.o callback.o conf.o console.o errsock.o logging.o marshal.o \ - memory.o misc.o nocproxy.o norand.o portfwd.o proxy.o \ - psocks.o sshutils.o stripctrl.o time.o timing.o tree234.o \ - utils.o uxcliloop.o uxcons.o uxfdsock.o uxmisc.o uxnet.o \ - uxnogtk.o uxpeer.o uxpoll.o uxproxy.o uxsel.o uxsignal.o \ - uxsocks.o version.o wcwidth.o - $(CC) -o $@ be_misc.o callback.o conf.o console.o errsock.o \ - logging.o marshal.o memory.o misc.o nocproxy.o norand.o \ - portfwd.o proxy.o psocks.o sshutils.o stripctrl.o time.o \ - timing.o tree234.o utils.o uxcliloop.o uxcons.o uxfdsock.o \ - uxmisc.o uxnet.o uxnogtk.o uxpeer.o uxpoll.o uxproxy.o \ - uxsel.o uxsignal.o uxsocks.o version.o wcwidth.o $(ULDFLAGS) - -psusan: be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o errsock.o \ - logging.o marshal.o memory.o millerrabin.o misc.o mpint.o \ - mpunsafe.o nogss.o nullplug.o pgssapi.o pockle.o portfwd.o \ - primecandidate.o procnet.o proxy.o scpserver.o sesschan.o \ - settings.o sftpcommon.o sftpserver.o smallprimes.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-server.o \ - ssh1login-server.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-server.o ssh2kex-server.o \ - ssh2transhk.o ssh2transport.o ssh2userauth-server.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshserver.o sshsh256.o sshsh512.o sshsha.o sshsha3.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o ux_x11.o uxagentsock.o \ - uxcliloop.o uxfdsock.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o \ - uxpeer.o uxpoll.o uxproxy.o uxpsusan.o uxpty.o uxsel.o \ - uxsftpserver.o uxsignal.o uxstore.o uxutils.o version.o \ - wcwidth.o wildcard.o x11fwd.o - $(CC) -o $@ be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o \ - errsock.o logging.o marshal.o memory.o millerrabin.o misc.o \ - mpint.o mpunsafe.o nogss.o nullplug.o pgssapi.o pockle.o \ - portfwd.o primecandidate.o procnet.o proxy.o scpserver.o \ - sesschan.o settings.o sftpcommon.o sftpserver.o \ - smallprimes.o ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-server.o ssh1login-server.o ssh2bpp.o \ - ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-server.o ssh2kex-server.o ssh2transhk.o \ - ssh2transport.o ssh2userauth-server.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprime.o \ - sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o sshserver.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o sshutils.o \ - sshverstring.o sshzlib.o stripctrl.o time.o timing.o \ - tree234.o utils.o ux_x11.o uxagentsock.o uxcliloop.o \ - uxfdsock.o uxmisc.o uxnet.o uxnogtk.o uxnoise.o uxpeer.o \ - uxpoll.o uxproxy.o uxpsusan.o uxpty.o uxsel.o uxsftpserver.o \ - uxsignal.o uxstore.o uxutils.o version.o wcwidth.o \ - wildcard.o x11fwd.o $(ULDFLAGS) - -puttygen: cmdgen.o conf.o console.o ecc.o import.o marshal.o memory.o \ - millerrabin.o misc.o mpint.o mpunsafe.o notiming.o pockle.o \ - primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o - $(CC) -o $@ cmdgen.o conf.o console.o ecc.o import.o marshal.o \ - memory.o millerrabin.o misc.o mpint.o mpunsafe.o notiming.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o time.o \ - tree234.o utils.o uxcons.o uxgen.o uxmisc.o uxnogtk.o \ - uxnoise.o uxpoll.o uxstore.o uxutils.o version.o wcwidth.o \ - $(ULDFLAGS) - -testcrypt: ecc.o marshal.o memory.o millerrabin.o mpint.o mpunsafe.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o sshdssg.o \ - sshecc.o sshecdsag.o sshhmac.o sshmd5.o sshprime.o sshprng.o \ - sshpubk.o sshrsa.o sshrsag.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o testcrypt.o tree234.o utils.o uxutils.o - $(CC) -o $@ ecc.o marshal.o memory.o millerrabin.o mpint.o \ - mpunsafe.o pockle.o primecandidate.o smallprimes.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o sshprime.o \ - sshprng.o sshpubk.o sshrsa.o sshrsag.o sshsh256.o sshsh512.o \ - sshsha.o sshsha3.o testcrypt.o tree234.o utils.o uxutils.o \ - $(ULDFLAGS) - -testsc: ecc.o marshal.o memory.o mpint.o sshaes.o ssharcf.o sshargon2.o \ - sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshhmac.o \ - sshmac.o sshmd5.o sshpubk.o sshrsa.o sshsh256.o sshsh512.o \ - sshsha.o sshsha3.o testsc.o tree234.o utils.o uxutils.o \ - wildcard.o - $(CC) -o $@ ecc.o marshal.o memory.o mpint.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o \ - sshhmac.o sshmac.o sshmd5.o sshpubk.o sshrsa.o sshsh256.o \ - sshsh512.o sshsha.o sshsha3.o testsc.o tree234.o utils.o \ - uxutils.o wildcard.o $(ULDFLAGS) - -testzlib: marshal.o memory.o sshzlib.o testzlib.o utils.o - $(CC) -o $@ marshal.o memory.o sshzlib.o testzlib.o utils.o \ - $(ULDFLAGS) - -uppity: be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o errsock.o \ - logging.o marshal.o memory.o millerrabin.o misc.o mpint.o \ - mpunsafe.o nullplug.o pgssapi.o pockle.o portfwd.o \ - primecandidate.o procnet.o proxy.o scpserver.o sesschan.o \ - settings.o sftpcommon.o sftpserver.o smallprimes.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-server.o \ - ssh1login-server.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-server.o ssh2kex-server.o \ - ssh2transhk.o ssh2transport.o ssh2userauth-server.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshserver.o sshsh256.o sshsh512.o sshsha.o sshsha3.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o ux_x11.o uxagentsock.o \ - uxcliloop.o uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o \ - uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxpty.o uxsel.o \ - uxserver.o uxsftpserver.o uxsignal.o uxstore.o uxutils.o \ - version.o wcwidth.o wildcard.o x11fwd.o - $(CC) -o $@ be_misc.o be_none.o callback.o conf.o cproxy.o ecc.o \ - errsock.o logging.o marshal.o memory.o millerrabin.o misc.o \ - mpint.o mpunsafe.o nullplug.o pgssapi.o pockle.o portfwd.o \ - primecandidate.o procnet.o proxy.o scpserver.o sesschan.o \ - settings.o sftpcommon.o sftpserver.o smallprimes.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-server.o \ - ssh1login-server.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-server.o ssh2kex-server.o \ - ssh2transhk.o ssh2transport.o ssh2userauth-server.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshserver.o sshsh256.o sshsh512.o sshsha.o sshsha3.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o time.o \ - timing.o tree234.o utils.o ux_x11.o uxagentsock.o \ - uxcliloop.o uxfdsock.o uxgss.o uxmisc.o uxnet.o uxnogtk.o \ - uxnoise.o uxpeer.o uxpoll.o uxproxy.o uxpty.o uxsel.o \ - uxserver.o uxsftpserver.o uxsignal.o uxstore.o uxutils.o \ - version.o wcwidth.o wildcard.o x11fwd.o $(ULDFLAGS) - -agentf.o: ../agentf.c ../putty.h ../ssh.h ../pageant.h ../sshchan.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../agentf.c -aqsync.o: ../aqsync.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../aqsync.c -be_all_s.o: ../be_all_s.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_all_s.c -be_misc.o: ../be_misc.c ../putty.h ../network.h ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_misc.c -be_none.o: ../be_none.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_none.c -be_nos_s.o: ../be_nos_s.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_nos_s.c -be_ssh.o: ../be_ssh.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_ssh.c -callback.o: ../callback.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../callback.c -cgtest.o: ../cgtest.c ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cgtest.c -clicons.o: ../clicons.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../clicons.c -cmdgen.o: ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h ../mpint.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cmdgen.c -cmdline.o: ../cmdline.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cmdline.c -conf.o: ../conf.c ../tree234.h ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../conf.c -config.o: ../config.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../config.c -console.o: ../console.c ../putty.h ../misc.h ../console.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../console.c -cproxy.o: ../cproxy.c ../putty.h ../ssh.h ../network.h ../proxy.h \ - ../marshal.h ../defs.h ../puttyps.h ../misc.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cproxy.c -dialog.o: ../dialog.c ../putty.h ../dialog.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../dialog.c -ecc.o: ../ecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ecc.c -errsock.o: ../errsock.c ../tree234.h ../putty.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../errsock.c -fromucs.o: ../charset/fromucs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/fromucs.c -fuzzterm.o: ../fuzzterm.c ../putty.h ../dialog.h ../terminal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../fuzzterm.c -gtkapp.o: ../unix/gtkapp.c ../putty.h ../unix/gtkmisc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkapp.c -gtkask.o: ../unix/gtkask.c ../defs.h ../unix/gtkfont.h ../unix/gtkcompat.h \ - ../unix/gtkmisc.h ../putty.h ../ssh.h ../misc.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkask.c -gtkcfg.o: ../unix/gtkcfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcfg.c -gtkcols.o: ../unix/gtkcols.c ../defs.h ../unix/gtkcompat.h ../unix/gtkcols.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcols.c -gtkcomm.o: ../unix/gtkcomm.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcomm.c -gtkdlg.o: ../unix/gtkdlg.c ../putty.h ../unix/gtkcompat.h ../unix/gtkcols.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../storage.h ../dialog.h ../tree234.h ../licence.h ../ssh.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkdlg.c -gtkfont.o: ../unix/gtkfont.c ../putty.h ../unix/gtkfont.h \ - ../unix/gtkcompat.h ../unix/gtkmisc.h ../tree234.h \ - ../unix/x11misc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkfont.c -gtkmain.o: ../unix/gtkmain.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkmain.c -gtkmisc.o: ../unix/gtkmisc.c ../putty.h ../unix/gtkcompat.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkmisc.c -gtkwin.o: ../unix/gtkwin.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkwin.c -import.o: ../import.c ../putty.h ../ssh.h ../mpint.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../import.c -ldisc.o: ../ldisc.c ../putty.h ../terminal.h ../ldisc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ldisc.c -localenc.o: ../charset/localenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/localenc.c -logging.o: ../logging.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../logging.c -macenc.o: ../charset/macenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/macenc.c -mainchan.o: ../mainchan.c ../putty.h ../ssh.h ../sshppl.h ../sshchan.h \ - ../sshsignals.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mainchan.c -marshal.o: ../marshal.c ../marshal.h ../misc.h ../defs.h ../puttymem.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../marshal.c -memory.o: ../memory.c ../defs.h ../puttymem.h ../misc.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../memory.c -millerrabin.o: ../millerrabin.c ../ssh.h ../sshkeygen.h ../mpint.h \ - ../mpunsafe.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../millerrabin.c -mimeenc.o: ../charset/mimeenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/mimeenc.c -minibidi.o: ../minibidi.c ../putty.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../minibidi.c -misc.o: ../misc.c ../defs.h ../putty.h ../misc.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../misc.c -miscucs.o: ../miscucs.c ../putty.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../miscucs.c -mpint.o: ../mpint.c ../defs.h ../misc.h ../puttymem.h ../mpint.h \ - ../mpint_i.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mpint.c -mpunsafe.o: ../mpunsafe.c ../defs.h ../misc.h ../puttymem.h ../mpint.h \ - ../mpint_i.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mpunsafe.c -nocmdline.o: ../nocmdline.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nocmdline.c -nocproxy.o: ../nocproxy.c ../putty.h ../network.h ../proxy.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nocproxy.c -nogss.o: ../nogss.c ../putty.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nogss.c -norand.o: ../norand.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../norand.c -noterm.o: ../noterm.c ../putty.h ../terminal.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../noterm.c -notiming.o: ../notiming.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../notiming.c -nullplug.o: ../nullplug.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nullplug.c -osxlaunch.o: ../unix/osxlaunch.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/osxlaunch.c -pageant.o: ../pageant.c ../putty.h ../mpint.h ../ssh.h ../sshcr.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pageant.c -pgssapi.o: ../pgssapi.c ../putty.h ../pgssapi.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pgssapi.c -pinger.o: ../pinger.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pinger.c -pockle.o: ../pockle.c ../ssh.h ../sshkeygen.h ../mpint.h ../mpunsafe.h \ - ../tree234.h ../puttymem.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pockle.c -portfwd.o: ../portfwd.c ../putty.h ../ssh.h ../sshchan.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../portfwd.c -primecandidate.o: ../primecandidate.c ../ssh.h ../mpint.h ../mpunsafe.h \ - ../sshkeygen.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../primecandidate.c -procnet.o: ../unix/procnet.c ../misc.h ../defs.h ../puttymem.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/procnet.c -proxy.o: ../proxy.c ../putty.h ../network.h ../proxy.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../proxy.c -pscp.o: ../pscp.c ../putty.h ../psftp.h ../ssh.h ../sftp.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pscp.c -psftp.o: ../psftp.c ../putty.h ../psftp.h ../storage.h ../ssh.h ../sftp.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psftp.c -psftpcommon.o: ../psftpcommon.c ../putty.h ../sftp.h ../psftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psftpcommon.c -psocks.o: ../psocks.c ../putty.h ../misc.h ../ssh.h ../sshchan.h ../psocks.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psocks.c -raw.o: ../raw.c ../putty.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../raw.c -rlogin.o: ../rlogin.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../rlogin.c -sbcs.o: ../charset/sbcs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/sbcs.c -sbcsdat.o: ../charset/sbcsdat.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/sbcsdat.c -scpserver.o: ../scpserver.c ../putty.h ../ssh.h ../sshcr.h ../sshchan.h \ - ../sftp.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../scpserver.c -sesschan.o: ../sesschan.c ../putty.h ../ssh.h ../sshchan.h ../sshserver.h \ - ../sftp.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sesschan.c -sessprep.o: ../sessprep.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sessprep.c -settings.o: ../settings.c ../putty.h ../storage.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../settings.c -sftp.o: ../sftp.c ../misc.h ../tree234.h ../sftp.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftp.c -sftpcommon.o: ../sftpcommon.c ../misc.h ../sftp.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftpcommon.c -sftpserver.o: ../sftpserver.c ../putty.h ../ssh.h ../sftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftpserver.c -sizetip.o: ../windows/sizetip.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/sizetip.c -slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \ - ../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/slookup.c -smallprimes.o: ../smallprimes.c ../ssh.h ../sshkeygen.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../smallprimes.c -ssh.o: ../ssh.c ../putty.h ../pageant.h ../tree234.h ../storage.h \ - ../marshal.h ../ssh.h ../sshcr.h ../sshbpp.h ../sshppl.h \ - ../sshchan.h ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh.c -ssh1bpp.o: ../ssh1bpp.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1bpp.c -ssh1censor.o: ../ssh1censor.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1censor.c -ssh1connection.o: ../ssh1connection.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshcr.h ../ssh1connection.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection.c -ssh1connection-client.o: ../ssh1connection-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection-client.c -ssh1connection-server.o: ../ssh1connection-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection-server.c -ssh1login.o: ../ssh1login.c ../putty.h ../ssh.h ../mpint.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1login.c -ssh1login-server.o: ../ssh1login-server.c ../putty.h ../mpint.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshkeygen.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1login-server.c -ssh2bpp.o: ../ssh2bpp.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2bpp.c -ssh2bpp-bare.o: ../ssh2bpp-bare.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2bpp-bare.c -ssh2censor.o: ../ssh2censor.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2censor.c -ssh2connection.o: ../ssh2connection.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshcr.h ../ssh2connection.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection.c -ssh2connection-client.o: ../ssh2connection-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection-client.c -ssh2connection-server.o: ../ssh2connection-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection-server.c -ssh2kex-client.o: ../ssh2kex-client.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../storage.h ../ssh2transport.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../sshgssc.h ../sshgss.h \ - ../windows/winstuff.h ../unix/unix.h ../pgssapi.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2kex-client.c -ssh2kex-server.o: ../ssh2kex-server.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshserver.h ../sshkeygen.h \ - ../storage.h ../ssh2transport.h ../mpint.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../sshgssc.h ../sshgss.h ../windows/winstuff.h \ - ../unix/unix.h ../pgssapi.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2kex-server.c -ssh2transhk.o: ../ssh2transhk.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2transhk.c -ssh2transport.o: ../ssh2transport.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshserver.h ../storage.h \ - ../ssh2transport.h ../mpint.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h ../sshgssc.h \ - ../sshgss.h ../windows/winstuff.h ../unix/unix.h \ - ../pgssapi.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2transport.c -ssh2userauth.o: ../ssh2userauth.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshgssc.h ../sshgss.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2userauth.c -ssh2userauth-server.o: ../ssh2userauth-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../pgssapi.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2userauth-server.c -sshaes.o: ../sshaes.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshaes.c -ssharcf.o: ../ssharcf.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssharcf.c -sshargon2.o: ../sshargon2.c ../putty.h ../ssh.h ../marshal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshargon2.c -sshauxcrypt.o: ../sshauxcrypt.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshauxcrypt.c -sshbcrypt.o: ../sshbcrypt.c ../ssh.h ../sshblowf.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshbcrypt.c -sshblake2.o: ../sshblake2.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshblake2.c -sshblowf.o: ../sshblowf.c ../ssh.h ../sshblowf.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshblowf.c -sshccp.o: ../sshccp.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshccp.c -sshcommon.o: ../sshcommon.c ../putty.h ../mpint.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshttymodes.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcommon.c -sshcrc.o: ../sshcrc.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcrc.c -sshcrcda.o: ../sshcrcda.c ../misc.h ../ssh.h ../defs.h ../puttymem.h \ - ../marshal.h ../tree234.h ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcrcda.c -sshdes.o: ../sshdes.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdes.c -sshdh.o: ../sshdh.c ../ssh.h ../misc.h ../mpint.h ../puttymem.h ../tree234.h \ - ../network.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdh.c -sshdss.o: ../sshdss.c ../ssh.h ../mpint.h ../misc.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdss.c -sshdssg.o: ../sshdssg.c ../misc.h ../ssh.h ../sshkeygen.h ../mpint.h \ - ../defs.h ../puttymem.h ../marshal.h ../tree234.h \ - ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdssg.c -sshecc.o: ../sshecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshecc.c -sshecdsag.o: ../sshecdsag.c ../ssh.h ../sshkeygen.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshecdsag.c -sshgssc.o: ../sshgssc.c ../putty.h ../sshgssc.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../pgssapi.h ../sshgss.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshgssc.c -sshhmac.o: ../sshhmac.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshhmac.c -sshmac.o: ../sshmac.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshmac.c -sshmd5.o: ../sshmd5.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshmd5.c -sshprime.o: ../sshprime.c ../ssh.h ../mpint.h ../mpunsafe.h ../sshkeygen.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshprime.c -sshprng.o: ../sshprng.c ../putty.h ../ssh.h ../mpint_i.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshprng.c -sshpubk.o: ../sshpubk.c ../putty.h ../mpint.h ../ssh.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshpubk.c -sshrand.o: ../sshrand.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrand.c -sshrsa.o: ../sshrsa.c ../ssh.h ../mpint.h ../misc.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrsa.c -sshrsag.o: ../sshrsag.c ../ssh.h ../sshkeygen.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrsag.c -sshserver.o: ../sshserver.c ../putty.h ../ssh.h ../sshbpp.h ../sshppl.h \ - ../sshchan.h ../sshserver.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshserver.c -sshsh256.o: ../sshsh256.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsh256.c -sshsh512.o: ../sshsh512.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsh512.c -sshsha.o: ../sshsha.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsha.c -sshsha3.o: ../sshsha3.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsha3.c -sshshare.o: ../sshshare.c ../putty.h ../tree234.h ../ssh.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshshare.c -sshutils.o: ../sshutils.c ../putty.h ../ssh.h ../sshchan.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshutils.c -sshverstring.o: ../sshverstring.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshverstring.c -sshzlib.o: ../sshzlib.c ../defs.h ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshzlib.c -stripctrl.o: ../stripctrl.c ../putty.h ../terminal.h ../misc.h ../marshal.h \ - ../defs.h ../puttyps.h ../network.h ../sshsignals.h \ - ../tree234.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../stripctrl.c -supdup.o: ../supdup.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../supdup.c -telnet.o: ../telnet.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../telnet.c -terminal.o: ../terminal.c ../putty.h ../terminal.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../terminal.c -testcrypt.o: ../testcrypt.c ../defs.h ../ssh.h ../sshkeygen.h ../misc.h \ - ../mpint.h ../ecc.h ../testcrypt.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testcrypt.c -testsc.o: ../testsc.c ../defs.h ../putty.h ../ssh.h ../misc.h ../mpint.h \ - ../ecc.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testsc.c -testzlib.o: ../testzlib.c ../defs.h ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testzlib.c -time.o: ../time.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../time.c -timing.o: ../timing.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../timing.c -toucs.o: ../charset/toucs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/toucs.c -tree234.o: ../tree234.c ../defs.h ../tree234.h ../puttymem.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../tree234.c -utf8.o: ../charset/utf8.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/utf8.c -utils.o: ../utils.c ../defs.h ../misc.h ../ssh.h ../puttymem.h ../marshal.h \ - ../tree234.h ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../utils.c -ux_x11.o: ../unix/ux_x11.c ../putty.h ../ssh.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/ux_x11.c -uxagentc.o: ../unix/uxagentc.c ../putty.h ../misc.h ../tree234.h \ - ../puttymem.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxagentc.c -uxagentsock.o: ../unix/uxagentsock.c ../putty.h ../ssh.h ../misc.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxagentsock.c -uxcfg.o: ../unix/uxcfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcfg.c -uxcliloop.o: ../unix/uxcliloop.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcliloop.c -uxcons.o: ../unix/uxcons.c ../putty.h ../storage.h ../ssh.h ../console.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcons.c -uxfdsock.o: ../unix/uxfdsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxfdsock.c -uxgen.o: ../unix/uxgen.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxgen.c -uxgss.o: ../unix/uxgss.c ../putty.h ../pgssapi.h ../sshgss.h ../sshgssc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxgss.c -uxmisc.o: ../unix/uxmisc.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxmisc.c -uxnet.o: ../unix/uxnet.c ../putty.h ../network.h ../tree234.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnet.c -uxnogtk.o: ../unix/uxnogtk.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnogtk.c -uxnoise.o: ../unix/uxnoise.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnoise.c -uxpeer.o: ../unix/uxpeer.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpeer.c -uxpgnt.o: ../unix/uxpgnt.c ../putty.h ../ssh.h ../misc.h ../pageant.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpgnt.c -uxplink.o: ../unix/uxplink.c ../putty.h ../ssh.h ../storage.h ../tree234.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxplink.c -uxpoll.o: ../unix/uxpoll.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpoll.c -uxprint.o: ../unix/uxprint.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxprint.c -uxproxy.o: ../unix/uxproxy.c ../tree234.h ../putty.h ../network.h ../proxy.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxproxy.c -uxpsusan.o: ../unix/uxpsusan.c ../putty.h ../mpint.h ../ssh.h ../sshserver.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpsusan.c -uxpterm.o: ../unix/uxpterm.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpterm.c -uxpty.o: ../unix/uxpty.c ../putty.h ../ssh.h ../sshserver.h ../tree234.h \ - ../sshttymodes.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpty.c -uxputty.o: ../unix/uxputty.c ../putty.h ../ssh.h ../storage.h \ - ../unix/gtkcompat.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxputty.c -uxsel.o: ../unix/uxsel.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsel.c -uxser.o: ../unix/uxser.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxser.c -uxserver.o: ../unix/uxserver.c ../putty.h ../mpint.h ../ssh.h ../sshserver.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxserver.c -uxsftp.o: ../unix/uxsftp.c ../putty.h ../ssh.h ../psftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsftp.c -uxsftpserver.o: ../unix/uxsftpserver.c ../putty.h ../ssh.h ../sshserver.h \ - ../sftp.h ../tree234.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsftpserver.c -uxshare.o: ../unix/uxshare.c ../tree234.h ../putty.h ../network.h ../proxy.h \ - ../ssh.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxshare.c -uxsignal.o: ../unix/uxsignal.c ../defs.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsignal.c -uxsocks.o: ../unix/uxsocks.c ../putty.h ../ssh.h ../psocks.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsocks.c -uxstore.o: ../unix/uxstore.c ../putty.h ../storage.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxstore.c -uxucs.o: ../unix/uxucs.c ../putty.h ../charset/charset.h ../terminal.h \ - ../misc.h ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxucs.c -uxutils.o: ../unix/uxutils.c ../putty.h ../ssh.h ../unix/uxutils.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxutils.c -version.o: ../version.c ../putty.h ../ssh.h ../empty.h ../version.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../version.c -wcwidth.o: ../wcwidth.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../wcwidth.c -wildcard.o: ../wildcard.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../wildcard.c -wincapi.o: ../windows/wincapi.c ../putty.h ../ssh.h ../windows/wincapi.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincapi.c -wincfg.o: ../windows/wincfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincfg.c -wincliloop.o: ../windows/wincliloop.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincliloop.c -wincons.o: ../windows/wincons.c ../putty.h ../storage.h ../ssh.h \ - ../console.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincons.c -winctrls.o: ../windows/winctrls.c ../putty.h ../misc.h ../dialog.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winctrls.c -windefs.o: ../windows/windefs.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/windefs.c -windlg.o: ../windows/windlg.c ../putty.h ../ssh.h ../windows/win_res.h \ - ../windows/winseat.h ../storage.h ../dialog.h ../licence.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/windlg.c -window.o: ../windows/window.c ../putty.h ../terminal.h ../storage.h \ - ../windows/win_res.h ../windows/winsecur.h \ - ../windows/winseat.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/window.c -wingss.o: ../windows/wingss.c ../putty.h ../pgssapi.h ../sshgss.h \ - ../sshgssc.h ../misc.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wingss.c -winhandl.o: ../windows/winhandl.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhandl.c -winhelp.o: ../windows/winhelp.c ../putty.h ../windows/win_res.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhelp.c -winhsock.o: ../windows/winhsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhsock.c -winjump.o: ../windows/winjump.c ../putty.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winjump.c -winmisc.o: ../windows/winmisc.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winmisc.c -winmiscs.o: ../windows/winmiscs.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winmiscs.c -winnet.o: ../windows/winnet.c ../putty.h ../network.h ../tree234.h ../ssh.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnet.c -winnohlp.o: ../windows/winnohlp.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnohlp.c -winnoise.o: ../windows/winnoise.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnoise.c -winnojmp.o: ../windows/winnojmp.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnojmp.c -winnpc.o: ../windows/winnpc.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnpc.c -winnps.o: ../windows/winnps.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnps.c -winpgen.o: ../windows/winpgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../licence.h ../windows/winsecur.h ../windows/puttygen-rc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgen.c -winpgnt.o: ../windows/winpgnt.c ../putty.h ../ssh.h ../misc.h ../tree234.h \ - ../windows/winsecur.h ../windows/wincapi.h ../pageant.h \ - ../licence.h ../windows/pageant-rc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgnt.c -winpgntc.o: ../windows/winpgntc.c ../putty.h ../pageant.h \ - ../windows/winsecur.h ../windows/wincapi.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgntc.c -winplink.o: ../windows/winplink.c ../putty.h ../storage.h ../tree234.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winplink.c -winprint.o: ../windows/winprint.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winprint.c -winproxy.o: ../windows/winproxy.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winproxy.c -winsecur.o: ../windows/winsecur.c ../putty.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsecur.c -winselcli.o: ../windows/winselcli.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winselcli.c -winselgui.o: ../windows/winselgui.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winselgui.c -winser.o: ../windows/winser.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winser.c -winsftp.o: ../windows/winsftp.c ../putty.h ../psftp.h ../ssh.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsftp.c -winshare.o: ../windows/winshare.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/wincapi.h \ - ../windows/winsecur.h ../noshare.c ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winshare.c -winsocks.o: ../windows/winsocks.c ../putty.h ../ssh.h ../psocks.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsocks.c -winstore.o: ../windows/winstore.c ../putty.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winstore.c -wintime.o: ../windows/wintime.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wintime.c -winucs.o: ../windows/winucs.c ../putty.h ../terminal.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winucs.c -winutils.o: ../windows/winutils.c ../putty.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winutils.c -winx11.o: ../windows/winx11.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winx11.c -x11fwd.o: ../x11fwd.c ../putty.h ../ssh.h ../sshchan.h ../tree234.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../x11fwd.c -x11misc.o: ../unix/x11misc.c ../putty.h ../unix/x11misc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/x11misc.c -xenc.o: ../charset/xenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/xenc.c -xkeysym.o: ../unix/xkeysym.c ../misc.h ../defs.h ../puttymem.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xkeysym.c -xpmptcfg.o: ../unix/xpmptcfg.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmptcfg.c -xpmpterm.o: ../unix/xpmpterm.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmpterm.c -xpmpucfg.o: ../unix/xpmpucfg.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmpucfg.c -xpmputty.o: ../unix/xpmputty.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmputty.c - - -clean: - rm -f *.o cgtest fuzzterm osxlaunch plink pscp psftp psocks psusan puttygen testcrypt testsc testzlib uppity - -FORCE: diff --git a/code/unix/uxagentc.c b/code/unix/agent-client.c similarity index 100% rename from code/unix/uxagentc.c rename to code/unix/agent-client.c diff --git a/code/unix/uxagentsock.c b/code/unix/agent-socket.c similarity index 100% rename from code/unix/uxagentsock.c rename to code/unix/agent-socket.c diff --git a/code/unix/gtkask.c b/code/unix/askpass.c similarity index 99% rename from code/unix/gtkask.c rename to code/unix/askpass.c index 4e95ba1..841912d 100644 --- a/code/unix/gtkask.c +++ b/code/unix/askpass.c @@ -15,7 +15,7 @@ #endif #include "defs.h" -#include "gtkfont.h" +#include "unifont.h" #include "gtkcompat.h" #include "gtkmisc.h" diff --git a/code/unix/uxcliloop.c b/code/unix/cliloop.c similarity index 100% rename from code/unix/uxcliloop.c rename to code/unix/cliloop.c diff --git a/code/unix/gtkcols.c b/code/unix/columns.c similarity index 97% rename from code/unix/gtkcols.c rename to code/unix/columns.c index 35c0287..a1049b4 100644 --- a/code/unix/gtkcols.c +++ b/code/unix/columns.c @@ -1,12 +1,12 @@ /* - * gtkcols.c - implementation of the `Columns' GTK layout container. + * columns.c - implementation of the `Columns' GTK layout container. */ #include #include #include "defs.h" #include "gtkcompat.h" -#include "gtkcols.h" +#include "columns.h" #if GTK_CHECK_VERSION(2,0,0) /* The "focus" method lives in GtkWidget from GTK 2 onwards, but it @@ -358,6 +358,9 @@ static void columns_remove(GtkContainer *container, GtkWidget *widget) gtk_widget_queue_resize(GTK_WIDGET(container)); } + if (cols->vexpand == child) + cols->vexpand = NULL; + g_free(child); if (was_visible) gtk_widget_queue_resize(GTK_WIDGET(container)); @@ -555,6 +558,18 @@ void columns_taborder_last(Columns *cols, GtkWidget *widget) } } +void columns_vexpand(Columns *cols, GtkWidget *widget) +{ + g_return_if_fail(cols != NULL); + g_return_if_fail(IS_COLUMNS(cols)); + g_return_if_fail(widget != NULL); + + ColumnsChild *child = columns_find_child(cols, widget); + g_return_if_fail(child != NULL); + + cols->vexpand = child; +} + /* * Override GtkContainer's focus movement so the user can * explicitly specify the tab order. @@ -873,7 +888,14 @@ static void columns_alloc_vert(Columns *cols, gint ourheight, { ColumnsChild *child; GList *children; - gint i, ncols, colspan, *colypos, realheight, fakeheight; + gint i, ncols, colspan, *colypos, realheight, fakeheight, vexpand_extra; + + if (cols->vexpand) { + gint minheight = columns_compute_height(cols, get_height); + vexpand_extra = ourheight - minheight; + } else { + vexpand_extra = 0; + } ncols = 1; /* As in size_request, colypos is the lowest y reached in each column. */ @@ -900,7 +922,10 @@ static void columns_alloc_vert(Columns *cols, gint ourheight, if (!gtk_widget_get_visible(child->widget)) continue; - realheight = fakeheight = get_height(child); + realheight = get_height(child); + if (child == cols->vexpand) + realheight += vexpand_extra; + fakeheight = realheight; if (child->same_height_as) { gint childheight2 = get_height(child->same_height_as); if (fakeheight < childheight2) diff --git a/code/unix/gtkcols.h b/code/unix/columns.h similarity index 93% rename from code/unix/gtkcols.h rename to code/unix/columns.h index e589cf7..d2d58c4 100644 --- a/code/unix/gtkcols.h +++ b/code/unix/columns.h @@ -1,5 +1,5 @@ /* - * gtkcols.h - header file for a columns-based widget container + * columns.h - header file for a columns-based widget container * capable of supporting the PuTTY portable dialog box layout * mechanism. */ @@ -30,6 +30,7 @@ struct Columns_tag { /* private after here */ GList *children; /* this holds ColumnsChild structures */ GList *taborder; /* this just holds GtkWidgets */ + ColumnsChild *vexpand; gint spacing; }; @@ -57,6 +58,7 @@ void columns_add(Columns *cols, GtkWidget *child, void columns_taborder_last(Columns *cols, GtkWidget *child); void columns_force_left_align(Columns *cols, GtkWidget *child); void columns_force_same_height(Columns *cols, GtkWidget *ch1, GtkWidget *ch2); +void columns_vexpand(Columns *cols, GtkWidget *child); #ifdef __cplusplus } diff --git a/code/unix/gtkcfg.c b/code/unix/config-gtk.c similarity index 98% rename from code/unix/gtkcfg.c rename to code/unix/config-gtk.c index 93c48ce..52e6e18 100644 --- a/code/unix/gtkcfg.c +++ b/code/unix/config-gtk.c @@ -1,5 +1,5 @@ /* - * gtkcfg.c - the GTK-specific parts of the PuTTY configuration + * config-gtk.c - the GTK-specific parts of the PuTTY configuration * box. */ diff --git a/code/unix/uxcfg.c b/code/unix/config-unix.c similarity index 93% rename from code/unix/uxcfg.c rename to code/unix/config-unix.c index 8397a0a..ee1b953 100644 --- a/code/unix/uxcfg.c +++ b/code/unix/config-unix.c @@ -1,5 +1,5 @@ /* - * uxcfg.c - the Unix-specific parts of the PuTTY configuration + * config-unix.c - the Unix-specific parts of the PuTTY configuration * box. */ @@ -51,6 +51,8 @@ void unix_setup_config_box(struct controlbox *b, bool midsession, int protocol) c->radio.buttondata = sresize(c->radio.buttondata, c->radio.nbuttons, intorptr); c->radio.buttondata[c->radio.nbuttons-1] = I(PROXY_CMD); + if (c->radio.ncolumns < 4) + c->radio.ncolumns = 4; break; } } diff --git a/code/unix/configure b/code/unix/configure deleted file mode 100644 index b2b033d..0000000 --- a/code/unix/configure +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -$(echo "$0" | sed '$s!configure$!../configure!') "$@" diff --git a/code/unix/uxcons.c b/code/unix/console.c similarity index 81% rename from code/unix/uxcons.c rename to code/unix/console.c index 90e73a9..cc6c985 100644 --- a/code/unix/uxcons.c +++ b/code/unix/console.c @@ -1,6 +1,6 @@ /* - * uxcons.c: various interactive-prompt routines shared between the - * Unix console PuTTY tools + * unix/console.c: various interactive-prompt routines shared between + * the Unix console PuTTY tools */ #include @@ -102,43 +102,39 @@ static int block_and_read(int fd, void *buf, size_t len) return ret; } -int console_verify_ssh_host_key( +SeatPromptResult console_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **fingerprints, - void (*callback)(void *ctx, int result), void *ctx) + char *keystr, const char *keydisp, char **fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { - int ret; - char line[32]; struct termios cf; - const char *common_fmt, *intro, *prompt; - - /* - * Verify the key. - */ - ret = verify_host_key(host, port, keytype, keystr); + char *common; + const char *intro, *prompt; - if (ret == 0) /* success - key matched OK */ - return 1; + FingerprintType fptype_default = + ssh2_pick_default_fingerprint(fingerprints); - premsg(&cf); - if (ret == 2) { /* key was different */ - common_fmt = hk_wrongmsg_common_fmt; + if (mismatch) { /* key was different */ + common = hk_wrongmsg_common(host, port, keytype, + fingerprints[fptype_default]); intro = hk_wrongmsg_interactive_intro; prompt = hk_wrongmsg_interactive_prompt; } else { /* key was absent */ - common_fmt = hk_absentmsg_common_fmt; + common = hk_absentmsg_common(host, port, keytype, + fingerprints[fptype_default]); intro = hk_absentmsg_interactive_intro; prompt = hk_absentmsg_interactive_prompt; } - FingerprintType fptype_default = - ssh2_pick_default_fingerprint(fingerprints); + premsg(&cf); + fputs(common, stderr); + sfree(common); - fprintf(stderr, common_fmt, keytype, fingerprints[fptype_default]); if (console_batch_mode) { fputs(console_abandoned_msg, stderr); - return 0; + postmsg(&cf); + return SPR_SW_ABORT("Cannot confirm a host key in batch mode"); } fputs(intro, stderr); @@ -177,17 +173,17 @@ int console_verify_ssh_host_key( if (line[0] == 'y' || line[0] == 'Y') store_host_key(host, port, keytype, keystr); postmsg(&cf); - return 1; + return SPR_OK; } else { fputs(console_abandoned_msg, stderr); postmsg(&cf); - return 0; + return SPR_USER_ABORT; } } -int console_confirm_weak_crypto_primitive( +SeatPromptResult console_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { char line[32]; struct termios cf; @@ -198,7 +194,8 @@ int console_confirm_weak_crypto_primitive( if (console_batch_mode) { fputs(console_abandoned_msg, stderr); postmsg(&cf); - return 0; + return SPR_SW_ABORT("Cannot confirm a weak crypto primitive " + "in batch mode"); } fputs(console_continue_prompt, stderr); @@ -218,17 +215,17 @@ int console_confirm_weak_crypto_primitive( if (line[0] == 'y' || line[0] == 'Y') { postmsg(&cf); - return 1; + return SPR_OK; } else { fputs(console_abandoned_msg, stderr); postmsg(&cf); - return 0; + return SPR_USER_ABORT; } } -int console_confirm_weak_cached_hostkey( +SeatPromptResult console_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { char line[32]; struct termios cf; @@ -239,7 +236,8 @@ int console_confirm_weak_cached_hostkey( if (console_batch_mode) { fputs(console_abandoned_msg, stderr); postmsg(&cf); - return 0; + return SPR_SW_ABORT("Cannot confirm a weak cached host key " + "in batch mode"); } fputs(console_continue_prompt, stderr); @@ -259,11 +257,11 @@ int console_confirm_weak_cached_hostkey( if (line[0] == 'y' || line[0] == 'Y') { postmsg(&cf); - return 1; + return SPR_OK; } else { fputs(console_abandoned_msg, stderr); postmsg(&cf); - return 0; + return SPR_USER_ABORT; } } @@ -321,21 +319,22 @@ int console_askappend(LogPolicy *lp, Filename *filename, } bool console_antispoof_prompt = true; -bool console_set_trust_status(Seat *seat, bool trusted) + +void console_set_trust_status(Seat *seat, bool trusted) +{ + /* Do nothing in response to a change of trust status, because + * there's nothing we can do in a console environment. However, + * the query function below will make a fiddly decision about + * whether to tell the backend to enable fallback handling. */ +} + +bool console_can_set_trust_status(Seat *seat) { - if (console_batch_mode || !is_interactive() || !console_antispoof_prompt) { + if (console_batch_mode) { /* * In batch mode, we don't need to worry about the server * mimicking our interactive authentication, because the user * already knows not to expect any. - * - * If standard input isn't connected to a terminal, likewise, - * because even if the server did send a spoof authentication - * prompt, the user couldn't respond to it via the terminal - * anyway. - * - * We also vacuously return success if the user has purposely - * disabled the antispoof prompt. */ return true; } @@ -343,6 +342,23 @@ bool console_set_trust_status(Seat *seat, bool trusted) return false; } +bool console_has_mixed_input_stream(Seat *seat) +{ + if (!is_interactive() || !console_antispoof_prompt) { + /* + * If standard input isn't connected to a terminal, then even + * if the server did send a spoof authentication prompt, the + * user couldn't respond to it via the terminal anyway. + * + * We also pretend this is true if the user has purposely + * disabled the antispoof prompt. + */ + return false; + } + + return true; +} + /* * Warn about the obsolescent key file format. * @@ -429,7 +445,7 @@ static void console_write(FILE *outfp, ptrlen data) fflush(outfp); } -int console_get_userpass_input(prompts_t *p) +SeatPromptResult console_get_userpass_input(prompts_t *p) { size_t curr_prompt; FILE *outfp = NULL; @@ -445,7 +461,8 @@ int console_get_userpass_input(prompts_t *p) } if (p->n_prompts && console_batch_mode) - return 0; + return SPR_SW_ABORT("Cannot answer interactive prompts " + "in batch mode"); console_open(&outfp, &infd); @@ -484,14 +501,26 @@ int console_get_userpass_input(prompts_t *p) console_write(outfp, ptrlen_from_asciz(pr->prompt)); bool failed = false; + SeatPromptResult spr; while (1) { size_t toread = 65536; size_t prev_result_len = pr->result->len; void *ptr = strbuf_append(pr->result, toread); int ret = read(infd, ptr, toread); - if (ret <= 0) { + if (ret == 0) { + /* Regard EOF on the terminal as a deliberate user-abort */ + failed = true; + spr = SPR_USER_ABORT; + break; + } + + if (ret < 0) { + /* Any other failure to read from the terminal is treated as + * an unexpected error and reported to the user. */ failed = true; + spr = make_spr_sw_abort_errno( + "Error reading from terminal", errno); break; } @@ -507,13 +536,13 @@ int console_get_userpass_input(prompts_t *p) if (failed) { console_close(outfp, infd); - return 0; /* failure due to read error */ + return spr; } } console_close(outfp, infd); - return 1; /* success */ + return SPR_OK; } bool is_interactive(void) diff --git a/code/unix/gtkdlg.c b/code/unix/dialog.c similarity index 97% rename from code/unix/gtkdlg.c rename to code/unix/dialog.c index 8e7421d..7d1514f 100644 --- a/code/unix/gtkdlg.c +++ b/code/unix/dialog.c @@ -1,5 +1,5 @@ /* - * gtkdlg.c - GTK implementation of the PuTTY configuration box. + * dialog.c - GTK implementation of the PuTTY configuration box. */ #include @@ -16,8 +16,8 @@ #include "putty.h" #include "gtkcompat.h" -#include "gtkcols.h" -#include "gtkfont.h" +#include "columns.h" +#include "unifont.h" #include "gtkmisc.h" #ifndef NOT_X_WINDOWS @@ -1787,7 +1787,7 @@ static void filefont_clicked(GtkButton *button, gpointer data) #else /* !GTK_CHECK_VERSION(2,0,0) */ /* - * Use the unifontsel code provided in gtkfont.c. + * Use the unifontsel code provided in unifont.c. */ unifontsel *fontsel = unifontsel_new("Select a font"); @@ -3448,13 +3448,13 @@ GtkWidget *create_message_box( NULL /* action_postproc */, NULL /* postproc_ctx */); } -struct verify_ssh_host_key_dialog_ctx { +struct confirm_ssh_host_key_dialog_ctx { char *host; int port; char *keytype; char *keystr; char *more_info; - void (*callback)(void *callback_ctx, int result); + void (*callback)(void *callback_ctx, SeatPromptResult result); void *callback_ctx; Seat *seat; @@ -3462,13 +3462,13 @@ struct verify_ssh_host_key_dialog_ctx { GtkWidget *more_info_dialog; }; -static void verify_ssh_host_key_result_callback(void *vctx, int result) +static void confirm_ssh_host_key_result_callback(void *vctx, int result) { - struct verify_ssh_host_key_dialog_ctx *ctx = - (struct verify_ssh_host_key_dialog_ctx *)vctx; + struct confirm_ssh_host_key_dialog_ctx *ctx = + (struct confirm_ssh_host_key_dialog_ctx *)vctx; if (result >= 0) { - int logical_result; + SeatPromptResult logical_result; /* * Convert the dialog-box return value (one of three @@ -3478,11 +3478,11 @@ static void verify_ssh_host_key_result_callback(void *vctx, int result) */ if (result == 2) { store_host_key(ctx->host, ctx->port, ctx->keytype, ctx->keystr); - logical_result = 1; /* continue with connection */ + logical_result = SPR_OK; } else if (result == 1) { - logical_result = 1; /* continue with connection */ + logical_result = SPR_OK; } else { - logical_result = 0; /* do not continue with connection */ + logical_result = SPR_USER_ABORT; } ctx->callback(ctx->callback_ctx, logical_result); @@ -3518,16 +3518,16 @@ static GtkWidget *add_more_info_button(GtkWidget *w, void *vctx) static void more_info_closed(void *vctx, int result) { - struct verify_ssh_host_key_dialog_ctx *ctx = - (struct verify_ssh_host_key_dialog_ctx *)vctx; + struct confirm_ssh_host_key_dialog_ctx *ctx = + (struct confirm_ssh_host_key_dialog_ctx *)vctx; ctx->more_info_dialog = NULL; } static void more_info_button_clicked(GtkButton *button, gpointer vctx) { - struct verify_ssh_host_key_dialog_ctx *ctx = - (struct verify_ssh_host_key_dialog_ctx *)vctx; + struct confirm_ssh_host_key_dialog_ctx *ctx = + (struct confirm_ssh_host_key_dialog_ctx *)vctx; if (ctx->more_info_dialog) return; @@ -3539,16 +3539,18 @@ static void more_info_button_clicked(GtkButton *button, gpointer vctx) &buttons_ok, more_info_closed, ctx); } -int gtk_seat_verify_ssh_host_key( +SeatPromptResult gtk_seat_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **fingerprints, - void (*callback)(void *ctx, int result), void *ctx) + char *keystr, const char *keydisp, char **fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { static const char absenttxt[] = - "The server's host key is not cached. You have no guarantee " - "that the server is the computer you think it is.\n" - "The server's %s key fingerprint is:\n" - "%s\n" + "The host key is not cached for this server:\n\n" + "%s (port %d)\n\n" + "You have no guarantee that the server is the computer " + "you think it is.\n" + "The server's %s key fingerprint is:\n\n" + "%s\n\n" "If you trust this host, press \"Accept\" to add the key to " "PuTTY's cache and carry on connecting.\n" "If you want to carry on connecting just once, without " @@ -3557,12 +3559,14 @@ int gtk_seat_verify_ssh_host_key( "connection."; static const char wrongtxt[] = "WARNING - POTENTIAL SECURITY BREACH!\n" - "The server's host key does not match the one PuTTY has " - "cached. This means that either the server administrator " - "has changed the host key, or you have actually connected " + "The host key does not match the one PuTTY has cached " + "for this server:\n\n" + "%s (port %d)\n\n" + "This means that either the server administrator has " + "changed the host key, or you have actually connected " "to another computer pretending to be the server.\n" - "The new %s key fingerprint is:\n" - "%s\n" + "The new %s key fingerprint is:\n\n" + "%s\n\n" "If you were expecting this change and trust the new key, " "press \"Accept\" to update PuTTY's cache and continue connecting.\n" "If you want to carry on connecting but without updating " @@ -3580,25 +3584,16 @@ int gtk_seat_verify_ssh_host_key( }; char *text; - int ret; - struct verify_ssh_host_key_dialog_ctx *result_ctx; + struct confirm_ssh_host_key_dialog_ctx *result_ctx; GtkWidget *mainwin, *msgbox; - /* - * Verify the key. - */ - ret = verify_host_key(host, port, keytype, keystr); - - if (ret == 0) /* success - key matched OK */ - return 1; - FingerprintType fptype_default = ssh2_pick_default_fingerprint(fingerprints); - text = dupprintf((ret == 2 ? wrongtxt : absenttxt), keytype, - fingerprints[fptype_default]); + text = dupprintf((mismatch ? wrongtxt : absenttxt), host, port, + keytype, fingerprints[fptype_default]); - result_ctx = snew(struct verify_ssh_host_key_dialog_ctx); + result_ctx = snew(struct confirm_ssh_host_key_dialog_ctx); result_ctx->callback = callback; result_ctx->callback_ctx = ctx; result_ctx->host = dupstr(host); @@ -3612,7 +3607,7 @@ int gtk_seat_verify_ssh_host_key( msgbox = create_message_box_general( mainwin, "PuTTY Security Alert", text, string_width(fingerprints[fptype_default]), true, - &buttons_hostkey, verify_ssh_host_key_result_callback, result_ctx, + &buttons_hostkey, confirm_ssh_host_key_result_callback, result_ctx, add_more_info_button, &more_info_button); result_ctx->main_dialog = msgbox; @@ -3620,12 +3615,12 @@ int gtk_seat_verify_ssh_host_key( strbuf *sb = strbuf_new(); if (fingerprints[SSH_FPTYPE_SHA256]) - strbuf_catf(sb, "SHA256 fingerprint: %s\n", - fingerprints[SSH_FPTYPE_SHA256]); + put_fmt(sb, "SHA256 fingerprint: %s\n", + fingerprints[SSH_FPTYPE_SHA256]); if (fingerprints[SSH_FPTYPE_MD5]) - strbuf_catf(sb, "MD5 fingerprint: %s\n", - fingerprints[SSH_FPTYPE_MD5]); - strbuf_catf(sb, "Full text of host's public key:"); + put_fmt(sb, "MD5 fingerprint: %s\n", + fingerprints[SSH_FPTYPE_MD5]); + put_fmt(sb, "Full text of host's public key:"); /* We have to manually wrap the public key, or else the GtkLabel * will resize itself to accommodate the longest word, which will * lead to a hilariously wide message box. */ @@ -3646,25 +3641,28 @@ int gtk_seat_verify_ssh_host_key( sfree(text); - return -1; /* dialog still in progress */ + return SPR_INCOMPLETE; /* dialog still in progress */ } -struct simple_prompt_result_ctx { - void (*callback)(void *callback_ctx, int result); +struct simple_prompt_result_spr_ctx { + void (*callback)(void *callback_ctx, SeatPromptResult spr); void *callback_ctx; Seat *seat; enum DialogSlot dialog_slot; }; -static void simple_prompt_result_callback(void *vctx, int result) +static void simple_prompt_result_spr_callback(void *vctx, int result) { - struct simple_prompt_result_ctx *ctx = - (struct simple_prompt_result_ctx *)vctx; + struct simple_prompt_result_spr_ctx *ctx = + (struct simple_prompt_result_spr_ctx *)vctx; unregister_dialog(ctx->seat, ctx->dialog_slot); - if (result >= 0) - ctx->callback(ctx->callback_ctx, result); + if (result == 0) + ctx->callback(ctx->callback_ctx, SPR_USER_ABORT); + else if (result > 0) + ctx->callback(ctx->callback_ctx, SPR_OK); + /* if <0, we're cleaning up for some other reason */ /* * Clean up this context structure, whether or not a result was @@ -3677,9 +3675,9 @@ static void simple_prompt_result_callback(void *vctx, int result) * Ask whether the selected algorithm is acceptable (since it was * below the configured 'warn' threshold). */ -int gtk_seat_confirm_weak_crypto_primitive( +SeatPromptResult gtk_seat_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { static const char msg[] = "The first %s supported by the server is " @@ -3687,12 +3685,12 @@ int gtk_seat_confirm_weak_crypto_primitive( "Continue with connection?"; char *text; - struct simple_prompt_result_ctx *result_ctx; + struct simple_prompt_result_spr_ctx *result_ctx; GtkWidget *mainwin, *msgbox; text = dupprintf(msg, algtype, algname); - result_ctx = snew(struct simple_prompt_result_ctx); + result_ctx = snew(struct simple_prompt_result_spr_ctx); result_ctx->callback = callback; result_ctx->callback_ctx = ctx; result_ctx->seat = seat; @@ -3702,17 +3700,17 @@ int gtk_seat_confirm_weak_crypto_primitive( msgbox = create_message_box( mainwin, "PuTTY Security Alert", text, string_width("Reasonably long line of text as a width template"), - false, &buttons_yn, simple_prompt_result_callback, result_ctx); + false, &buttons_yn, simple_prompt_result_spr_callback, result_ctx); register_dialog(seat, result_ctx->dialog_slot, msgbox); sfree(text); - return -1; /* dialog still in progress */ + return SPR_INCOMPLETE; } -int gtk_seat_confirm_weak_cached_hostkey( +SeatPromptResult gtk_seat_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { static const char msg[] = "The first host key type we have stored for this server\n" @@ -3723,12 +3721,12 @@ int gtk_seat_confirm_weak_cached_hostkey( "Continue with connection?"; char *text; - struct simple_prompt_result_ctx *result_ctx; + struct simple_prompt_result_spr_ctx *result_ctx; GtkWidget *mainwin, *msgbox; text = dupprintf(msg, algname, betteralgs); - result_ctx = snew(struct simple_prompt_result_ctx); + result_ctx = snew(struct simple_prompt_result_spr_ctx); result_ctx->callback = callback; result_ctx->callback_ctx = ctx; result_ctx->seat = seat; @@ -3739,12 +3737,12 @@ int gtk_seat_confirm_weak_cached_hostkey( mainwin, "PuTTY Security Alert", text, string_width("is ecdsa-nistp521, which is below the configured" " warning threshold."), - false, &buttons_yn, simple_prompt_result_callback, result_ctx); + false, &buttons_yn, simple_prompt_result_spr_callback, result_ctx); register_dialog(seat, result_ctx->dialog_slot, msgbox); sfree(text); - return -1; /* dialog still in progress */ + return SPR_INCOMPLETE; } void old_keyfile_warning(void) @@ -3948,12 +3946,12 @@ static void eventlog_list_handler(union control *ctrl, dlgparam *dp, strbuf_clear(es->seldata); for (i = 0; i < es->ninitial; i++) { if (dlg_listbox_issel(ctrl, dp, i)) - strbuf_catf(es->seldata, "%s\n", es->events_initial[i]); + put_fmt(es->seldata, "%s\n", es->events_initial[i]); } for (i = 0; i < es->ncircular; i++) { if (dlg_listbox_issel(ctrl, dp, es->ninitial + i)) { int j = (es->circular_first + i) % LOGEVENT_CIRCULAR_MAX; - strbuf_catf(es->seldata, "%s\n", es->events_circular[j]); + put_fmt(es->seldata, "%s\n", es->events_circular[j]); } } @@ -4055,6 +4053,10 @@ void showeventlog(eventlog_stuff *es, void *parentwin) "QUITE LONG 'COS SSH LOG ENTRIES ARE WIDE"), -1); our_dialog_add_to_content_area(GTK_WINDOW(window), w1, true, true, 0); + { + struct uctrl *uc = dlg_find_byctrl(&es->dp, es->listctrl); + columns_vexpand(COLUMNS(w1), uc->toplevel); + } gtk_widget_show(w1); es->dp.data = es; @@ -4150,6 +4152,30 @@ void logevent_dlg(eventlog_stuff *es, const char *string) } } +struct simple_prompt_result_int_ctx { + void (*callback)(void *callback_ctx, int result); + void *callback_ctx; + Seat *seat; + enum DialogSlot dialog_slot; +}; + +static void simple_prompt_result_int_callback(void *vctx, int result) +{ + struct simple_prompt_result_int_ctx *ctx = + (struct simple_prompt_result_int_ctx *)vctx; + + unregister_dialog(ctx->seat, ctx->dialog_slot); + + if (result >= 0) + ctx->callback(ctx->callback_ctx, result); + + /* + * Clean up this context structure, whether or not a result was + * ever actually delivered from the dialog box. + */ + sfree(ctx); +} + int gtkdlg_askappend(Seat *seat, Filename *filename, void (*callback)(void *ctx, int result), void *ctx) { @@ -4169,13 +4195,13 @@ int gtkdlg_askappend(Seat *seat, Filename *filename, char *message; char *mbtitle; - struct simple_prompt_result_ctx *result_ctx; + struct simple_prompt_result_int_ctx *result_ctx; GtkWidget *mainwin, *msgbox; message = dupprintf(msgtemplate, FILENAME_MAX, filename->path); mbtitle = dupprintf("%s Log to File", appname); - result_ctx = snew(struct simple_prompt_result_ctx); + result_ctx = snew(struct simple_prompt_result_int_ctx); result_ctx->callback = callback; result_ctx->callback_ctx = ctx; result_ctx->seat = seat; @@ -4185,7 +4211,7 @@ int gtkdlg_askappend(Seat *seat, Filename *filename, msgbox = create_message_box( mainwin, mbtitle, message, string_width("LINE OF TEXT SUITABLE FOR THE ASKAPPEND WIDTH"), - false, &buttons_append, simple_prompt_result_callback, result_ctx); + false, &buttons_append, simple_prompt_result_int_callback, result_ctx); register_dialog(seat, result_ctx->dialog_slot, msgbox); sfree(message); diff --git a/code/unix/uxfdsock.c b/code/unix/fd-socket.c similarity index 82% rename from code/unix/uxfdsock.c rename to code/unix/fd-socket.c index 7697d99..036979d 100644 --- a/code/unix/uxfdsock.c +++ b/code/unix/fd-socket.c @@ -1,5 +1,5 @@ /* - * uxfdsock.c: implementation of Socket that just talks to two + * fd-socket.c: implementation of Socket that just talks to two * existing input and output file descriptors. */ @@ -14,7 +14,8 @@ #include "network.h" typedef struct FdSocket { - int outfd, infd, inerrfd; + int outfd, infd, inerrfd; /* >= 0 if socket is open */ + DeferredSocketOpener *opener; /* non-NULL if not opened yet */ bufchain pending_output_data; bufchain pending_input_data; @@ -23,6 +24,8 @@ typedef struct FdSocket { int pending_error; + SockAddr *addr; + int port; Plug *plug; Socket sock; @@ -113,6 +116,9 @@ static void fdsocket_close(Socket *s) { FdSocket *fds = container_of(s, FdSocket, sock); + if (fds->opener) + deferred_socket_opener_free(fds->opener); + if (fds->outfd >= 0) { del234(fdsocket_by_outfd, fds); uxsel_del(fds->outfd); @@ -134,6 +140,9 @@ static void fdsocket_close(Socket *s) bufchain_clear(&fds->pending_input_data); bufchain_clear(&fds->pending_output_data); + if (fds->addr) + sk_addr_free(fds->addr); + delete_callbacks_for_context(fds); sfree(fds); @@ -153,14 +162,16 @@ static void fdsocket_error_callback(void *vs) /* * An error has occurred on this socket. Pass it to the plug. */ - plug_closing(fds->plug, strerror(fds->pending_error), - fds->pending_error, 0); + plug_closing_errno(fds->plug, fds->pending_error); } static int fdsocket_try_send(FdSocket *fds) { int sent = 0; + if (fds->opener) + return sent; + while (bufchain_size(&fds->pending_output_data) > 0) { ssize_t ret; @@ -260,15 +271,16 @@ static void fdsocket_select_result_input(int fd, int event) if (retd > 0) { plug_receive(fds->plug, 0, buf, retd); } else { - if (retd < 0) { - plug_closing(fds->plug, strerror(errno), errno, 0); - } else { - plug_closing(fds->plug, NULL, 0, 0); - } del234(fdsocket_by_infd, fds); uxsel_del(fds->infd); close(fds->infd); fds->infd = -1; + + if (retd < 0) { + plug_closing_errno(fds->plug, errno); + } else { + plug_closing_normal(fds->plug); + } } } @@ -314,24 +326,27 @@ static const SocketVtable FdSocket_sockvt = { .peer_info = NULL, }; -Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug) +static void fdsocket_connect_success_callback(void *ctx) { - FdSocket *fds; + FdSocket *fds = (FdSocket *)ctx; + plug_log(fds->plug, PLUGLOG_CONNECT_SUCCESS, fds->addr, fds->port, + NULL, 0); +} - fds = snew(FdSocket); - fds->sock.vt = &FdSocket_sockvt; - fds->plug = plug; - fds->outgoingeof = EOF_NO; - fds->pending_error = 0; +void setup_fd_socket(Socket *s, int infd, int outfd, int inerrfd) +{ + FdSocket *fds = container_of(s, FdSocket, sock); + assert(fds->sock.vt == &FdSocket_sockvt); + + if (fds->opener) { + deferred_socket_opener_free(fds->opener); + fds->opener = NULL; + } fds->infd = infd; fds->outfd = outfd; fds->inerrfd = inerrfd; - bufchain_init(&fds->pending_input_data); - bufchain_init(&fds->pending_output_data); - psb_init(&fds->psb); - if (fds->outfd >= 0) { if (!fdsocket_by_outfd) fdsocket_by_outfd = newtree234(fdsocket_outfd_cmp); @@ -353,5 +368,43 @@ Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug) uxsel_set(fds->inerrfd, SELECT_R, fdsocket_select_result_input_error); } + queue_toplevel_callback(fdsocket_connect_success_callback, fds); +} + +static FdSocket *make_fd_socket_internal(SockAddr *addr, int port, Plug *plug) +{ + FdSocket *fds; + + fds = snew(FdSocket); + fds->sock.vt = &FdSocket_sockvt; + fds->addr = addr; + fds->port = port; + fds->plug = plug; + fds->outgoingeof = EOF_NO; + fds->pending_error = 0; + + fds->opener = NULL; + fds->infd = fds->outfd = fds->inerrfd = -1; + + bufchain_init(&fds->pending_input_data); + bufchain_init(&fds->pending_output_data); + psb_init(&fds->psb); + + return fds; +} + +Socket *make_fd_socket(int infd, int outfd, int inerrfd, + SockAddr *addr, int port, Plug *plug) +{ + FdSocket *fds = make_fd_socket_internal(addr, port, plug); + setup_fd_socket(&fds->sock, infd, outfd, inerrfd); + return &fds->sock; +} + +Socket *make_deferred_fd_socket(DeferredSocketOpener *opener, + SockAddr *addr, int port, Plug *plug) +{ + FdSocket *fds = make_fd_socket_internal(addr, port, plug); + fds->opener = opener; return &fds->sock; } diff --git a/code/unix/uxgss.c b/code/unix/gss.c similarity index 97% rename from code/unix/uxgss.c rename to code/unix/gss.c index 2d71c54..cd9971c 100644 --- a/code/unix/uxgss.c +++ b/code/unix/gss.c @@ -1,12 +1,12 @@ #include "putty.h" #ifndef NO_GSSAPI -#include "pgssapi.h" -#include "sshgss.h" -#include "sshgssc.h" +#include "ssh/pgssapi.h" +#include "ssh/gss.h" +#include "ssh/gssc.h" /* Unix code to set up the GSSAPI library list. */ -#if !defined NO_LIBDL && !defined NO_GSSAPI +#if !defined NO_LIBDL && !defined STATIC_GSSAPI && !defined NO_GSSAPI const int ngsslibs = 4; const char *const gsslibnames[4] = { diff --git a/code/unix/gtkcomm.c b/code/unix/gtk-common.c similarity index 97% rename from code/unix/gtkcomm.c rename to code/unix/gtk-common.c index fa52bfb..9d48e88 100644 --- a/code/unix/gtkcomm.c +++ b/code/unix/gtk-common.c @@ -1,5 +1,5 @@ /* - * gtkcomm.c: machinery in the GTK front end which is common to all + * gtk-common.c: machinery in the GTK front end which is common to all * programs that run a session in a terminal window, and also common * across all _sessions_ rather than specific to one session. (Timers, * uxsel etc.) @@ -34,7 +34,7 @@ #include "putty.h" #include "terminal.h" #include "gtkcompat.h" -#include "gtkfont.h" +#include "unifont.h" #include "gtkmisc.h" #ifndef NOT_X_WINDOWS @@ -44,8 +44,6 @@ #include #endif -#define CAT2(x,y) x ## y -#define CAT(x,y) CAT2(x,y) #define ASSERT(x) enum {CAT(assertion_,__LINE__) = 1 / (x)} #if GTK_CHECK_VERSION(2,0,0) @@ -88,6 +86,8 @@ gboolean fd_input_func(GIOChannel *source, GIOCondition condition, if (condition & G_IO_OUT) select_result(sourcefd, SELECT_W); + run_toplevel_callbacks(); + return true; } #else @@ -99,6 +99,8 @@ void fd_input_func(gpointer data, gint sourcefd, GdkInputCondition condition) select_result(sourcefd, SELECT_R); if (condition & GDK_INPUT_WRITE) select_result(sourcefd, SELECT_W); + + run_toplevel_callbacks(); } #endif diff --git a/code/unix/uxgen.c b/code/unix/keygen-noise.c similarity index 94% rename from code/unix/uxgen.c rename to code/unix/keygen-noise.c index da5e8f0..ab7de68 100644 --- a/code/unix/uxgen.c +++ b/code/unix/keygen-noise.c @@ -1,5 +1,5 @@ /* - * uxgen.c: Unix implementation of get_heavy_noise() from cmdgen.c. + * keygen-noise.c: Unix implementation of get_heavy_noise() from cmdgen.c. */ #include diff --git a/code/unix/local-proxy.c b/code/unix/local-proxy.c new file mode 100644 index 0000000..92f2a50 --- /dev/null +++ b/code/unix/local-proxy.c @@ -0,0 +1,98 @@ +/* + * local-proxy.c: Unix implementation of platform_new_connection(), + * supporting an OpenSSH-like proxy command. + */ + +#include +#include +#include +#include +#include + +#include "tree234.h" +#include "putty.h" +#include "network.h" +#include "proxy/proxy.h" + +char *platform_setup_local_proxy(Socket *socket, const char *cmd) +{ + /* + * Create the pipes to the proxy command, and spawn the proxy + * command process. + */ + int to_cmd_pipe[2], from_cmd_pipe[2], cmd_err_pipe[2]; + if (pipe(to_cmd_pipe) < 0 || + pipe(from_cmd_pipe) < 0 || + pipe(cmd_err_pipe) < 0) { + return dupprintf("pipe: %s", strerror(errno)); + } + cloexec(to_cmd_pipe[1]); + cloexec(from_cmd_pipe[0]); + cloexec(cmd_err_pipe[0]); + + int pid = fork(); + if (pid == 0) { + close(0); + close(1); + dup2(to_cmd_pipe[0], 0); + dup2(from_cmd_pipe[1], 1); + close(to_cmd_pipe[0]); + close(from_cmd_pipe[1]); + dup2(cmd_err_pipe[1], 2); + noncloexec(0); + noncloexec(1); + execl("/bin/sh", "sh", "-c", cmd, (void *)NULL); + _exit(255); + } + + if (pid < 0) { + return dupprintf("fork: %s", strerror(errno)); + } + + close(to_cmd_pipe[0]); + close(from_cmd_pipe[1]); + close(cmd_err_pipe[1]); + + setup_fd_socket(socket, from_cmd_pipe[0], to_cmd_pipe[1], cmd_err_pipe[0]); + + return NULL; +} + +Socket *platform_new_connection(SockAddr *addr, const char *hostname, + int port, bool privport, + bool oobinline, bool nodelay, bool keepalive, + Plug *plug, Conf *conf, Interactor *itr) +{ + switch (conf_get_int(conf, CONF_proxy_type)) { + case PROXY_CMD: { + DeferredSocketOpener *opener = local_proxy_opener( + addr, port, plug, conf, itr); + Socket *socket = make_deferred_fd_socket(opener, addr, port, plug); + local_proxy_opener_set_socket(opener, socket); + return socket; + } + + case PROXY_FUZZ: { + char *cmd = format_telnet_command(addr, port, conf, NULL); + int outfd = open("/dev/null", O_WRONLY); + if (outfd == -1) { + sfree(cmd); + return new_error_socket_fmt( + plug, "/dev/null: %s", strerror(errno)); + } + int infd = open(cmd, O_RDONLY); + if (infd == -1) { + Socket *toret = new_error_socket_fmt( + plug, "%s: %s", cmd, strerror(errno)); + sfree(cmd); + close(outfd); + return toret; + } + sfree(cmd); + return make_fd_socket(infd, outfd, -1, addr, port, plug); + } + + default: + return NULL; + } +} diff --git a/code/unix/gtkapp.c b/code/unix/main-gtk-application.c similarity index 89% rename from code/unix/gtkapp.c rename to code/unix/main-gtk-application.c index e7f49df..963c93f 100644 --- a/code/unix/gtkapp.c +++ b/code/unix/main-gtk-application.c @@ -1,6 +1,7 @@ /* - * gtkapp.c: a top-level front end to GUI PuTTY and pterm, using - * GtkApplication. Suitable for OS X. Currently unfinished. + * main-gtk-application.c: a top-level front end to GUI PuTTY and + * pterm, using GtkApplication. Suitable for OS X. Currently + * unfinished. * * (You could run it on ordinary Linux GTK too, in principle, but I * don't think it would be particularly useful to do so, even once @@ -9,17 +10,10 @@ /* -To build on OS X, you will need a build environment with GTK 3 and -gtk-mac-bundler, and also Halibut on the path (to build the man pages, -without which the standard Makefile will complain). Then, from a clean -checkout, do this: - -./mkfiles.pl -U --with-quartz -make -C icons icns -make -C doc -make - -and you should get unix/PuTTY.app and unix/PTerm.app as output. +Building this for OS X is currently broken, because the new +CMake-based build system doesn't support it yet. Probably what needs +doing is to add it back in to unix/CMakeLists.txt under a condition +like if(CMAKE_SYSTEM_NAME MATCHES "Darwin"). */ @@ -91,21 +85,8 @@ char *x_get_default(const char *key) { return NULL; } const bool buildinfo_gtk_relevant = true; #if !GTK_CHECK_VERSION(3,0,0) -/* This front end only works in GTK 3. If that's not what we've got, - * it's easier to just turn this program into a trivial stub by ifdef - * in the source than it is to remove it in the makefile edifice. */ -int main(int argc, char **argv) -{ - fprintf(stderr, "GtkApplication frontend doesn't work pre-GTK3\n"); - return 1; -} -GtkWidget *make_gtk_toplevel_window(GtkFrontend *frontend) { return NULL; } -void launch_duplicate_session(Conf *conf) {} -void launch_new_session(void) {} -void launch_saved_session(const char *str) {} -void session_window_closed(void) {} -void window_setup_error(const char *errmsg) {} -#else /* GTK_CHECK_VERSION(3,0,0) */ +#error This front end only works in GTK 3 +#endif static void startup(GApplication *app, gpointer user_data) { @@ -343,5 +324,3 @@ int main(int argc, char **argv) return status; } - -#endif /* GTK_CHECK_VERSION(3,0,0) */ diff --git a/code/unix/gtkmain.c b/code/unix/main-gtk-simple.c similarity index 99% rename from code/unix/gtkmain.c rename to code/unix/main-gtk-simple.c index ec8f7da..e52a18d 100644 --- a/code/unix/gtkmain.c +++ b/code/unix/main-gtk-simple.c @@ -1,7 +1,7 @@ /* - * gtkmain.c: the common main-program code between the straight-up - * Unix PuTTY and pterm, which they do not share with the - * multi-session gtkapp.c. + * main-gtk-simple.c: the common main-program code between the + * straight-up Unix PuTTY and pterm, which they do not share with the + * multi-session main-gtk-application.c. */ #define _GNU_SOURCE @@ -33,7 +33,7 @@ #include "putty.h" #include "terminal.h" #include "gtkcompat.h" -#include "gtkfont.h" +#include "unifont.h" #include "gtkmisc.h" #ifndef NOT_X_WINDOWS diff --git a/code/unix/uxnet.c b/code/unix/network.c similarity index 98% rename from code/unix/uxnet.c rename to code/unix/network.c index bd6ebb1..0f15796 100644 --- a/code/unix/uxnet.c +++ b/code/unix/network.c @@ -232,9 +232,9 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami ret->superfamily = IP; if (ret->ais->ai_canonname != NULL) - strbuf_catf(realhost, "%s", ret->ais->ai_canonname); + put_fmt(realhost, "%s", ret->ais->ai_canonname); else - strbuf_catf(realhost, "%s", host); + put_fmt(realhost, "%s", host); #else if ((a = inet_addr(host)) == (unsigned long)(in_addr_t)(-1)) { /* @@ -258,7 +258,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami } /* This way we are always sure the h->h_name is valid :) */ strbuf_clear(realhost); - strbuf_catf(realhost, "%s", h->h_name); + put_fmt(realhost, "%s", h->h_name); for (n = 0; h->h_addr_list[n]; n++); ret->addresses = snewn(n, unsigned long); ret->naddresses = n; @@ -273,7 +273,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami */ ret->superfamily = IP; strbuf_clear(realhost); - strbuf_catf(realhost, "%s", host); + put_fmt(realhost, "%s", host); ret->addresses = snew(unsigned long); ret->naddresses = 1; ret->addresses[0] = ntohl(a); @@ -1084,6 +1084,14 @@ void *sk_getxdmdata(Socket *sock, int *lenp) return buf; } +void plug_closing_errno(Plug *plug, int error) +{ + PlugCloseType type = PLUGCLOSE_ERROR; + if (error == EPIPE) + type = PLUGCLOSE_BROKEN_PIPE; + plug_closing(plug, type, strerror(error)); +} + /* * Deal with socket errors detected in try_send(). */ @@ -1101,7 +1109,7 @@ static void socket_error_callback(void *vs) /* * An error has occurred on this socket. Pass it to the plug. */ - plug_closing(s->plug, strerror(s->pending_error), s->pending_error, 0); + plug_closing_errno(s->plug, s->pending_error); } /* @@ -1295,10 +1303,10 @@ static void net_select_result(int fd, int event) */ ret = recv(s->s, buf, sizeof(buf), MSG_OOB); noise_ultralight(NOISE_SOURCE_IOLEN, ret); - if (ret <= 0) { - plug_closing(s->plug, - ret == 0 ? "Internal networking trouble" : - strerror(errno), errno, 0); + if (ret == 0) { + plug_closing_error(s->plug, "Internal networking trouble"); + } else if (ret < 0) { + plug_closing_errno(s->plug, errno); } else { /* * Receiving actual data on a socket means we can @@ -1384,11 +1392,11 @@ static void net_select_result(int fd, int event) } } if (ret < 0) { - plug_closing(s->plug, strerror(errno), errno, 0); + plug_closing_errno(s->plug, errno); } else if (0 == ret) { s->incomingeof = true; /* stop trying to read now */ uxsel_tell(s); - plug_closing(s->plug, NULL, 0, 0); + plug_closing_normal(s->plug); } else { /* * Receiving actual data on a socket means we can @@ -1438,7 +1446,7 @@ static void net_select_result(int fd, int event) err = try_connect(s); } if (err) { - plug_closing(s->plug, strerror(err), err, 0); + plug_closing_errno(s->plug, err); return; /* socket is now presumably defunct */ } if (!s->connected) @@ -1591,7 +1599,7 @@ static void uxsel_tell(NetSocket *s) uxsel_set(s->s, rwx, net_select_result); } -int net_service_lookup(char *service) +int net_service_lookup(const char *service) { struct servent *se; se = getservbyname(service, NULL); diff --git a/code/unix/uxnogtk.c b/code/unix/no-gtk.c similarity index 63% rename from code/unix/uxnogtk.c rename to code/unix/no-gtk.c index c9028eb..12565a1 100644 --- a/code/unix/uxnogtk.c +++ b/code/unix/no-gtk.c @@ -1,5 +1,5 @@ /* - * uxnogtk.c: link into non-GUI Unix programs so that they can tell + * no-gtk.c: link into non-GUI Unix programs so that they can tell * buildinfo about a lack of GTK. */ diff --git a/code/unix/uxnoise.c b/code/unix/noise.c similarity index 100% rename from code/unix/uxnoise.c rename to code/unix/noise.c diff --git a/code/unix/uxpgnt.c b/code/unix/pageant.c similarity index 95% rename from code/unix/uxpgnt.c rename to code/unix/pageant.c index 21087d6..5db797a 100644 --- a/code/unix/uxpgnt.c +++ b/code/unix/pageant.c @@ -90,7 +90,7 @@ static int make_pipe_to_askpass(const char *msg) cloexec(pipefds[1]); /* - * See comment in fork_and_exec_self() in gtkmain.c. + * See comment in fork_and_exec_self() in main-gtk-simple.c. */ execv("/proc/self/exe", (char **)args); execvp(progname, (char **)args); @@ -206,7 +206,7 @@ static void usage(void) printf(" --public-openssh, -L print public keys in OpenSSH format\n"); printf(" -d delete key(s) from the agent\n"); printf(" -D delete all keys from the agent\n"); - printf(" -r re-encrypt keys in the agent (forget cleartext\n"); + printf(" -r re-encrypt keys in the agent (forget cleartext)\n"); printf(" -R re-encrypt all possible keys in the agent\n"); printf("Other options:\n"); printf(" -v verbose mode (in agent mode)\n"); @@ -235,41 +235,8 @@ void keylist_update(void) #define PAGEANT_DIR_PREFIX "/tmp/pageant" -const char *const appname = "Pageant"; - static bool time_to_die = false; -/* Stub functions to permit linking against x11fwd.c. These never get - * used, because in LIFE_X11 mode we connect to the X server using a - * straightforward Socket and don't try to create an ersatz SSH - * forwarding too. */ -void chan_remotely_opened_confirmation(Channel *chan) { } -void chan_remotely_opened_failure(Channel *chan, const char *err) { } -bool chan_default_want_close(Channel *chan, bool s, bool r) { return false; } -bool chan_no_exit_status(Channel *ch, int s) { return false; } -bool chan_no_exit_signal(Channel *ch, ptrlen s, bool c, ptrlen m) -{ return false; } -bool chan_no_exit_signal_numeric(Channel *ch, int s, bool c, ptrlen m) -{ return false; } -bool chan_no_run_shell(Channel *chan) { return false; } -bool chan_no_run_command(Channel *chan, ptrlen command) { return false; } -bool chan_no_run_subsystem(Channel *chan, ptrlen subsys) { return false; } -bool chan_no_enable_x11_forwarding( - Channel *chan, bool oneshot, ptrlen authproto, ptrlen authdata, - unsigned screen_number) { return false; } -bool chan_no_enable_agent_forwarding(Channel *chan) { return false; } -bool chan_no_allocate_pty( - Channel *chan, ptrlen termtype, unsigned width, unsigned height, - unsigned pixwidth, unsigned pixheight, struct ssh_ttymodes modes) -{ return false; } -bool chan_no_set_env(Channel *chan, ptrlen var, ptrlen value) { return false; } -bool chan_no_send_break(Channel *chan, unsigned length) { return false; } -bool chan_no_send_signal(Channel *chan, ptrlen signame) { return false; } -bool chan_no_change_window_size( - Channel *chan, unsigned width, unsigned height, - unsigned pixwidth, unsigned pixheight) { return false; } -void chan_no_request_response(Channel *chan, bool success) {} - /* * These functions are part of the plug for our connection to the X * display, so they do get called. They needn't actually do anything, @@ -280,8 +247,7 @@ static void x11_log(Plug *p, PlugLogType type, SockAddr *addr, int port, const char *error_msg, int error_code) {} static void x11_receive(Plug *plug, int urgent, const char *data, size_t len) {} static void x11_sent(Plug *plug, size_t bufsize) {} -static void x11_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void x11_closing(Plug *plug, PlugCloseType type, const char *error_msg) { time_to_die = true; } @@ -471,19 +437,23 @@ static FingerprintType key_list_fptype = SSH_FPTYPE_DEFAULT; static char *askpass_tty(const char *prompt) { - int ret; prompts_t *p = new_prompts(); p->to_server = false; p->from_server = false; p->name = dupstr("Pageant passphrase prompt"); add_prompt(p, dupcat(prompt, ": "), false); - ret = console_get_userpass_input(p); - assert(ret >= 0); + SeatPromptResult spr = console_get_userpass_input(p); + assert(spr.kind != SPRK_INCOMPLETE); - if (!ret) { - perror("pageant: unable to read passphrase"); + if (spr.kind == SPRK_USER_ABORT) { free_prompts(p); return NULL; + } else if (spr.kind == SPRK_SW_ABORT) { + free_prompts(p); + char *err = spr_get_error_message(spr); + fprintf(stderr, "pageant: unable to read passphrase: %s", err); + sfree(err); + return NULL; } else { char *passphrase = prompt_get_result(p->prompts[0]); free_prompts(p); @@ -1220,7 +1190,8 @@ void run_agent(FILE *logfp, const char *symlink_path) conn->plug.vt = &X11Connection_plugvt; s = new_connection(sk_addr_dup(disp->addr), disp->realhost, disp->port, - false, true, false, false, &conn->plug, conf); + false, true, false, false, &conn->plug, conf, + NULL); if ((err = sk_socket_error(s)) != NULL) { fprintf(stderr, "pageant: unable to connect to X server: %s", err); exit(1); diff --git a/code/unix/uxpeer.c b/code/unix/peerinfo.c similarity index 77% rename from code/unix/uxpeer.c rename to code/unix/peerinfo.c index 4ad2632..11f0329 100644 --- a/code/unix/uxpeer.c +++ b/code/unix/peerinfo.c @@ -3,11 +3,11 @@ * appropriate autoconfery. */ -#ifdef HAVE_CONFIG_H -# include "uxconfig.h" /* leading space prevents mkfiles.pl trying to follow */ +#if HAVE_CMAKE_H +#include "cmake.h" #endif -#ifdef HAVE_SO_PEERCRED +#if HAVE_SO_PEERCRED #define _GNU_SOURCE #include #endif @@ -18,7 +18,7 @@ bool so_peercred(int fd, int *pid, int *uid, int *gid) { -#ifdef HAVE_SO_PEERCRED +#if HAVE_SO_PEERCRED struct ucred cr; socklen_t crlen = sizeof(cr); if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) == 0) { diff --git a/code/unix/unix.h b/code/unix/platform.h similarity index 87% rename from code/unix/unix.h rename to code/unix/platform.h index 2c0664b..7cdf4d1 100644 --- a/code/unix/unix.h +++ b/code/unix/platform.h @@ -1,9 +1,9 @@ -#ifndef PUTTY_UNIX_H -#define PUTTY_UNIX_H +/* + * unix/platform.h: Unix-specific inter-module stuff. + */ -#ifdef HAVE_CONFIG_H -# include "uxconfig.h" /* Space to hide it from mkfiles.pl */ -#endif +#ifndef PUTTY_UNIX_PLATFORM_H +#define PUTTY_UNIX_PLATFORM_H #include /* for FILENAME_MAX */ #include /* C99 int types */ @@ -67,7 +67,7 @@ struct FontSpec *fontspec_new(const char *name); extern const struct BackendVtable pty_backend; -#define BROKEN_PIPE_ERROR_CODE EPIPE /* used in sshshare.c */ +#define BROKEN_PIPE_ERROR_CODE EPIPE /* used in ssh/sharing.c */ /* * Under GTK, we send MA_CLICK _and_ MA_2CLK, or MA_CLICK _and_ @@ -143,7 +143,7 @@ unsigned long getticks(void); #define NAMED_CLIPBOARDS #endif -/* The per-session frontend structure managed by gtkwin.c */ +/* The per-session frontend structure managed by window.c */ typedef struct GtkFrontend GtkFrontend; /* Callback when a dialog box finishes, and a no-op implementation of it */ @@ -154,7 +154,7 @@ void trivial_post_dialog_fn(void *vctx, int result); void initial_config_box(Conf *conf, post_dialog_fn_t after, void *afterctx); void new_session_window(Conf *conf, const char *geometry_string); -/* Defined in gtkmain.c */ +/* Defined in main-gtk-*.c */ void launch_duplicate_session(Conf *conf); void launch_new_session(void); void launch_saved_session(const char *str); @@ -166,10 +166,11 @@ GtkWidget *make_gtk_toplevel_window(GtkFrontend *frontend); const struct BackendVtable *select_backend(Conf *conf); -/* Defined in gtkcomm.c */ +/* Defined in gtk-common.c */ void gtkcomm_setup(void); -/* Used to pass application-menu operations from gtkapp.c to gtkwin.c */ +/* Used to pass application-menu operations from + * main-gtk-application.c to window.c */ enum MenuAction { MA_COPY, MA_PASTE, MA_COPY_ALL, MA_DUPLICATE_SESSION, MA_RESTART_SESSION, MA_CHANGE_SETTINGS, MA_CLEAR_SCROLLBACK, @@ -184,7 +185,7 @@ extern const char *const *const main_icon[]; extern const char *const *const cfg_icon[]; extern const int n_main_icon, n_cfg_icon; -/* Things gtkdlg.c needs from gtkwin.c */ +/* Things dialog.c needs from window.c */ #ifdef MAY_REFER_TO_GTK_IN_HEADERS enum DialogSlot { DIALOG_SLOT_RECONFIGURE, @@ -202,7 +203,7 @@ void set_window_icon(GtkWidget *window, const char *const *const *icon, extern GdkAtom compound_text_atom; #endif -/* Things gtkwin.c needs from gtkdlg.c */ +/* Things window.c needs from dialog.c */ #ifdef MAY_REFER_TO_GTK_IN_HEADERS GtkWidget *create_config_box(const char *title, Conf *conf, bool midsession, int protcfginfo, @@ -217,16 +218,16 @@ void showeventlog(eventlog_stuff *estuff, void *parentwin); void logevent_dlg(eventlog_stuff *estuff, const char *string); int gtkdlg_askappend(Seat *seat, Filename *filename, void (*callback)(void *ctx, int result), void *ctx); -int gtk_seat_verify_ssh_host_key( +SeatPromptResult gtk_seat_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **fingerprints, - void (*callback)(void *ctx, int result), void *ctx); -int gtk_seat_confirm_weak_crypto_primitive( + char *keystr, const char *keydisp, char **fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); +SeatPromptResult gtk_seat_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx); -int gtk_seat_confirm_weak_cached_hostkey( + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); +SeatPromptResult gtk_seat_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx); + void (*callback)(void *ctx, SeatPromptResult result), void *ctx); #ifdef MAY_REFER_TO_GTK_IN_HEADERS struct message_box_button { const char *title; @@ -245,16 +246,16 @@ GtkWidget *create_message_box( post_dialog_fn_t after, void *afterctx); #endif -/* gtkwin.c needs this special function in xkeysym.c */ +/* window.c needs this special function in utils */ int keysym_to_unicode(int keysym); -/* Things uxstore.c needs from gtkwin.c */ +/* Things storage.c needs from window.c */ char *x_get_default(const char *key); -/* Things uxstore.c provides to gtkwin.c */ +/* Things storage.c provides to window.c */ void provide_xrm_string(const char *string, const char *progname); -/* Function that {gtkapp,gtkmain}.c needs from ux{pterm,putty}.c. Does +/* Function that main-gtk-*.c needs from {pterm,putty}.c. Does * early process setup that varies between applications (e.g. * pty_pre_init or sk_init), and is passed a boolean by the caller * indicating whether this is an OS X style multi-session monolithic @@ -283,12 +284,12 @@ extern const bool use_pty_argv; * OS X environment munging: this is the prefix we expect to find on * environment variable names that were changed by osxlaunch. * Extracted from the command line of the OS X pterm main binary, and - * used in uxpty.c to restore the original environment before + * used in pty.c to restore the original environment before * launching its subprocess. */ extern char *pty_osx_envrestore_prefix; -/* Things provided by uxcons.c */ +/* Things provided by console.c */ struct termios; void stderr_tty_init(void); /* call at startup if stderr might be a tty */ void premsg(struct termios *); @@ -308,12 +309,12 @@ int next_fd(int *state, int *rwx); uxsel_id *uxsel_input_add(int fd, int rwx); /* returns an id */ void uxsel_input_remove(uxsel_id *id); -/* uxcfg.c */ +/* config-unix.c */ struct controlbox; void unix_setup_config_box( struct controlbox *b, bool midsession, int protocol); -/* gtkcfg.c */ +/* config-gtk.c */ void gtk_setup_config_box( struct controlbox *b, bool midsession, void *window); @@ -335,7 +336,7 @@ void gtk_setup_config_box( void (*putty_signal(int sig, void (*func)(int)))(int); void block_signal(int sig, bool block_it); -/* uxmisc.c */ +/* utils */ void cloexec(int); void noncloexec(int); bool nonblock(int); @@ -346,12 +347,11 @@ char *make_dir_path(const char *path, mode_t mode); /* * Exports from unicode.c. */ -struct unicode_data; bool init_ucs(struct unicode_data *ucsdata, char *line_codepage, bool utf8_override, int font_charset, int vtmode); /* - * Spare functions exported directly from uxnet.c. + * Spare functions exported directly from network.c. */ void *sk_getxdmdata(Socket *sock, int *lenp); int sk_net_get_fd(Socket *sock); @@ -368,19 +368,23 @@ Socket *new_unix_listener(SockAddr *listenaddr, Plug *plug); } while (0) /* - * Exports from uxser.c. + * Exports from serial.c. */ extern const struct BackendVtable serial_backend; /* - * uxpeer.c, wrapping getsockopt(SO_PEERCRED). + * peerinfo.c, wrapping getsockopt(SO_PEERCRED). */ bool so_peercred(int fd, int *pid, int *uid, int *gid); /* - * uxfdsock.c. + * fd-socket.c. */ -Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug); +Socket *make_fd_socket(int infd, int outfd, int inerrfd, + SockAddr *addr, int port, Plug *plug); +Socket *make_deferred_fd_socket(DeferredSocketOpener *opener, + SockAddr *addr, int port, Plug *plug); +void setup_fd_socket(Socket *s, int infd, int outfd, int inerrfd); /* * Default font setting, which can vary depending on NOT_X_WINDOWS. @@ -392,7 +396,7 @@ Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug); #endif /* - * uxpty.c. + * pty.c. */ void pty_pre_init(void); /* pty+utmp setup before dropping privilege */ /* Pass in the argv[] for an instance of the pty backend created by @@ -402,7 +406,7 @@ void pty_pre_init(void); /* pty+utmp setup before dropping privilege */ extern char **pty_argv; /* - * gtkask.c. + * askpass.c. */ char *gtk_askpass_main(const char *display, const char *wintitle, const char *prompt, bool *success); @@ -418,12 +422,12 @@ static inline bool sk_peer_trusted(Socket *sock) } /* - * uxsftpserver.c. + * sftpserver.c. */ extern const SftpServerVtable unix_live_sftpserver_vt; /* - * uxpoll.c. + * utils/pollwrap.c. */ typedef struct pollwrapper pollwrapper; pollwrapper *pollwrap_new(void); @@ -442,7 +446,7 @@ static inline bool pollwrap_check_fd_rwx(pollwrapper *pw, int fd, int rwx) } /* - * uxcliloop.c. + * cliloop.c. */ typedef bool (*cliloop_pw_setup_t)(void *ctx, pollwrapper *pw); typedef void (*cliloop_pw_check_t)(void *ctx, pollwrapper *pw); @@ -457,4 +461,9 @@ bool cliloop_no_pw_setup(void *ctx, pollwrapper *pw); void cliloop_no_pw_check(void *ctx, pollwrapper *pw); bool cliloop_always_continue(void *ctx, bool, bool); -#endif /* PUTTY_UNIX_H */ +/* network.c: network error reporting helper taking an OS error code */ +void plug_closing_errno(Plug *plug, int error); + +SeatPromptResult make_spr_sw_abort_errno(const char *prefix, int errno_value); + +#endif /* PUTTY_UNIX_PLATFORM_H */ diff --git a/code/unix/uxplink.c b/code/unix/plink.c similarity index 96% rename from code/unix/uxplink.c rename to code/unix/plink.c index 240783f..9e109f0 100644 --- a/code/unix/uxplink.c +++ b/code/unix/plink.c @@ -352,8 +352,9 @@ size_t try_output(bool is_stderr) } static size_t plink_output( - Seat *seat, bool is_stderr, const void *data, size_t len) + Seat *seat, SeatOutputType type, const void *data, size_t len) { + bool is_stderr = type != SEAT_OUTPUT_STDOUT; assert(is_stderr || outgoingeof == EOF_NO); BinarySink *bs = is_stderr ? stderr_bs : stdout_bs; @@ -370,13 +371,18 @@ static bool plink_eof(Seat *seat) return false; /* do not respond to incoming EOF with outgoing */ } -static int plink_get_userpass_input(Seat *seat, prompts_t *p, bufchain *input) +static SeatPromptResult plink_get_userpass_input(Seat *seat, prompts_t *p) { - int ret; - ret = cmdline_get_passwd_input(p); - if (ret == -1) - ret = console_get_userpass_input(p); - return ret; + /* Plink doesn't support Restart Session, so we can just have a + * single static cmdline_get_passwd_input_state that's never reset */ + static cmdline_get_passwd_input_state cmdline_state = + CMDLINE_GET_PASSWD_INPUT_STATE_INIT; + + SeatPromptResult spr; + spr = cmdline_get_passwd_input(p, &cmdline_state, false); + if (spr.kind == SPRK_INCOMPLETE) + spr = console_get_userpass_input(p); + return spr; } static bool plink_seat_interactive(Seat *seat) @@ -389,13 +395,17 @@ static bool plink_seat_interactive(Seat *seat) static const SeatVtable plink_seat_vt = { .output = plink_output, .eof = plink_eof, + .sent = nullseat_sent, + .banner = nullseat_banner_to_stderr, .get_userpass_input = plink_get_userpass_input, + .notify_session_started = nullseat_notify_session_started, .notify_remote_exit = nullseat_notify_remote_exit, + .notify_remote_disconnect = nullseat_notify_remote_disconnect, .connection_fatal = console_connection_fatal, .update_specials_menu = nullseat_update_specials_menu, .get_ttymode = plink_get_ttymode, .set_busy_status = nullseat_set_busy_status, - .verify_ssh_host_key = console_verify_ssh_host_key, + .confirm_ssh_host_key = console_confirm_ssh_host_key, .confirm_weak_crypto_primitive = console_confirm_weak_crypto_primitive, .confirm_weak_cached_hostkey = console_confirm_weak_cached_hostkey, .is_utf8 = nullseat_is_never_utf8, @@ -405,6 +415,8 @@ static const SeatVtable plink_seat_vt = { .get_window_pixel_size = nullseat_get_window_pixel_size, .stripctrl_new = console_stripctrl_new, .set_trust_status = console_set_trust_status, + .can_set_trust_status = console_can_set_trust_status, + .has_mixed_input_stream = console_has_mixed_input_stream, .verbose = cmdline_seat_verbose, .interactive = plink_seat_interactive, .get_cursor_position = nullseat_get_cursor_position, @@ -511,7 +523,7 @@ static void usage(void) printf(" -sercfg configuration-string (e.g. 19200,8,n,1,X)\n"); printf(" Specify the serial configuration (serial only)\n"); printf("The following options only apply to SSH connections:\n"); - printf(" -pw passw login with specified password\n"); + printf(" -pwfile file login with password read from specified file\n"); printf(" -D [listen-IP:]listen-port\n"); printf(" Dynamic SOCKS-based port forwarding\n"); printf(" -L [listen-IP:]listen-port:host:port\n"); @@ -738,7 +750,7 @@ int main(int argc, char **argv) --argc; /* Explicitly pass "plink" in place of appname for * error reporting purposes. appname will have been - * set by be_foo.c to something more generic, probably + * set by be_list.c to something more generic, probably * "PuTTY". */ provide_xrm_string(*++argv, "plink"); } @@ -767,7 +779,7 @@ int main(int argc, char **argv) while (argc > 0) { if (cmdbuf->len > 0) put_byte(cmdbuf, ' '); /* add space separator */ - put_datapl(cmdbuf, ptrlen_from_asciz(p)); + put_dataz(cmdbuf, p); if (--argc > 0) p = *++argv; } @@ -830,7 +842,7 @@ int main(int argc, char **argv) if (backvt->flags & BACKEND_NEEDS_TERMINAL) { fprintf(stderr, "Plink doesn't support %s, which needs terminal emulation\n", - backvt->displayname); + backvt->displayname_lc); return 1; } @@ -907,7 +919,7 @@ int main(int argc, char **argv) if (just_test_share_exists) { if (!backvt->test_for_upstream) { fprintf(stderr, "Connection sharing not supported for this " - "connection type (%s)'\n", backvt->displayname); + "connection type (%s)'\n", backvt->displayname_lc); return 1; } if (backvt->test_for_upstream(conf_get_str(conf, CONF_host), diff --git a/code/unix/uxprint.c b/code/unix/printing.c similarity index 90% rename from code/unix/uxprint.c rename to code/unix/printing.c index 3de6d21..416db39 100644 --- a/code/unix/uxprint.c +++ b/code/unix/printing.c @@ -46,8 +46,8 @@ void printer_finish_job(printer_job *pj) /* * There's no sensible way to enumerate printers under Unix, since * practically any valid Unix command is a valid printer :-) So - * these are useless stub functions, and uxcfg.c will disable the - * drop-down list in the printer configurer. + * these are useless stub functions, and config-unix.c will disable + * the drop-down list in the printer configurer. */ printer_enum *printer_start_enum(int *nprinters_ptr) { *nprinters_ptr = 0; diff --git a/code/unix/procnet.c b/code/unix/procnet.c index 43b1f05..0937395 100644 --- a/code/unix/procnet.c +++ b/code/unix/procnet.c @@ -170,8 +170,8 @@ static char *format_sockaddr(const void *addr, int family) const uint32_t *addrwords = (const uint32_t *)a->sin6_addr.s6_addr; for (int i = 0; i < 4; i++) - strbuf_catf(sb, "%08X", addrwords[i]); - strbuf_catf(sb, ":%04X", ntohs(a->sin6_port)); + put_fmt(sb, "%08X", addrwords[i]); + put_fmt(sb, ":%04X", ntohs(a->sin6_port)); return strbuf_to_str(sb); } else { diff --git a/code/unix/uxsocks.c b/code/unix/psocks.c similarity index 98% rename from code/unix/uxsocks.c rename to code/unix/psocks.c index 91613af..748790b 100644 --- a/code/unix/uxsocks.c +++ b/code/unix/psocks.c @@ -15,8 +15,6 @@ #include "ssh.h" #include "psocks.h" -const bool buildinfo_gtk_relevant = false; - typedef struct PsocksDataSinkPopen { stdio_sink sink[2]; PsocksDataSink pds; diff --git a/code/unix/uxpsusan.c b/code/unix/psusan.c similarity index 97% rename from code/unix/uxpsusan.c rename to code/unix/psusan.c index c60728c..1d5816d 100644 --- a/code/unix/uxpsusan.c +++ b/code/unix/psusan.c @@ -39,9 +39,7 @@ #include "putty.h" #include "mpint.h" #include "ssh.h" -#include "sshserver.h" - -const char *const appname = "psusan"; +#include "ssh/server.h" void modalfatalbox(const char *p, ...) { @@ -273,10 +271,11 @@ static void server_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, log_to_stderr(-1, error_msg); } -static void server_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void server_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { - log_to_stderr(-1, error_msg); + if (type != PLUGCLOSE_NORMAL) + log_to_stderr(-1, error_msg); } static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) @@ -411,7 +410,7 @@ int main(int argc, char **argv) } else { struct server_instance *inst; Plug *plug = server_conn_plug(&scfg, &inst); - ssh_server_start(plug, make_fd_socket(0, 1, -1, plug)); + ssh_server_start(plug, make_fd_socket(0, 1, -1, NULL, 0, plug)); log_to_stderr(inst->id, "running directly on stdio"); } diff --git a/code/unix/xpmptcfg.c b/code/unix/pterm-config-xpm.c similarity index 100% rename from code/unix/xpmptcfg.c rename to code/unix/pterm-config-xpm.c diff --git a/code/unix/xpmpterm.c b/code/unix/pterm-xpm.c similarity index 100% rename from code/unix/xpmpterm.c rename to code/unix/pterm-xpm.c diff --git a/code/unix/uxpterm.c b/code/unix/pterm.c similarity index 92% rename from code/unix/uxpterm.c rename to code/unix/pterm.c index b18e344..87dd3e9 100644 --- a/code/unix/uxpterm.c +++ b/code/unix/pterm.c @@ -7,7 +7,6 @@ #include "putty.h" -const char *const appname = "pterm"; const bool use_event_log = false; /* pterm doesn't need it */ const bool new_session = false, saved_sessions = false; /* or these */ const bool dup_check_launchable = false; /* no need to check host name @@ -16,7 +15,7 @@ const bool use_pty_argv = true; const unsigned cmdline_tooltype = TOOLTYPE_NONNETWORK; -/* gtkwin.c will call this, and in pterm it's not needed */ +/* window.c will call this, and in pterm it's not needed */ void noise_ultralight(NoiseSourceId id, unsigned long data) { } const struct BackendVtable *select_backend(Conf *conf) diff --git a/code/unix/uxpty.c b/code/unix/pty.c similarity index 97% rename from code/unix/uxpty.c rename to code/unix/pty.c index bfd0de5..625f1bb 100644 --- a/code/unix/uxpty.c +++ b/code/unix/pty.c @@ -13,7 +13,9 @@ #include #include #include +#if HAVE_UTMP_H #include +#endif #include #include #include @@ -25,7 +27,7 @@ #include "putty.h" #include "ssh.h" -#include "sshserver.h" /* to check the prototypes of server-needed things */ +#include "ssh/server.h" /* to check the prototypes of server-needed things */ #include "tree234.h" #ifndef OMIT_UTMP @@ -49,20 +51,6 @@ #endif #endif -/* - * Set up a default for vaguely sane systems. The idea is that if - * OMIT_UTMP is not defined, then at least one of the symbols which - * enable particular forms of utmp processing should be, if only so - * that a link error can warn you that you should have defined - * OMIT_UTMP if you didn't want any. Currently HAVE_PUTUTLINE is - * the only such symbol. - */ -#ifndef OMIT_UTMP -#if !defined HAVE_PUTUTLINE -#define HAVE_PUTUTLINE -#endif -#endif - typedef struct Pty Pty; /* @@ -85,6 +73,7 @@ struct Pty { int master_i, master_o, master_e; Seat *seat; + size_t output_backlog; char name[FILENAME_MAX]; pid_t child_pid; int term_width, term_height; @@ -95,6 +84,8 @@ struct Pty { Backend backend; }; +#define PTY_MAX_BACKLOG 32768 + /* * We store all the (active) PtyFd structures in a tree sorted by fd, * so that when we get an uxsel notification we know which backend @@ -198,7 +189,7 @@ static void pty_try_write(Pty *pty); #ifndef OMIT_UTMP static void setup_utmp(char *ttyname, char *location) { -#ifdef HAVE_LASTLOG +#if HAVE_LASTLOG struct lastlog lastlog_entry; FILE *lastlog; #endif @@ -235,9 +226,13 @@ static void setup_utmp(char *ttyname, char *location) pututxline(&utmp_entry); endutxent(); +#if HAVE_UPDWTMPX + /* Reportedly, AIX 5.1 has and pututxline(), but no + * updwtmpx(). */ updwtmpx(WTMPX_FILE, &utmp_entry); +#endif -#ifdef HAVE_LASTLOG +#if HAVE_LASTLOG memset(&lastlog_entry, 0, sizeof(lastlog_entry)); strncpy(lastlog_entry.ll_line, ttyname+5, lenof(lastlog_entry.ll_line)); strncpy(lastlog_entry.ll_host, location, lenof(lastlog_entry.ll_host)); @@ -266,7 +261,9 @@ static void cleanup_utmp(void) utmp_entry.ut_tv.tv_sec = tv.tv_sec; utmp_entry.ut_tv.tv_usec = tv.tv_usec; +#if HAVE_UPDWTMPX updwtmpx(WTMPX_FILE, &utmp_entry); +#endif memset(utmp_entry.ut_line, 0, lenof(utmp_entry.ut_line)); utmp_entry.ut_tv.tv_sec = 0; @@ -371,7 +368,7 @@ static void pty_open_master(Pty *pty) #endif ; -#ifdef HAVE_POSIX_OPENPT +#if HAVE_POSIX_OPENPT #ifdef SET_NONBLOCK_VIA_OPENPT /* * OS X, as of 10.10 at least, doesn't permit me to set O_NONBLOCK @@ -422,6 +419,7 @@ static void pty_open_master(Pty *pty) static Pty *new_pty_struct(void) { Pty *pty = snew(Pty); + memset(pty, 0, sizeof(Pty)); pty->conf = NULL; pty->pending_eof = false; bufchain_init(&pty->output_data); @@ -567,7 +565,7 @@ void pty_pre_init(void) /* Drop privs. */ { -#ifndef HAVE_NO_SETRESUID +#if HAVE_SETRESUID && HAVE_SETRESGID int gid = getgid(), uid = getuid(); int setresgid(gid_t, gid_t, gid_t); int setresuid(uid_t, uid_t, uid_t); @@ -596,6 +594,7 @@ void pty_pre_init(void) } static void pty_try_wait(void); +static void pty_uxsel_setup(Pty *pty); static void pty_real_select_result(Pty *pty, int fd, int event, int status) { @@ -680,7 +679,9 @@ static void pty_real_select_result(Pty *pty, int fd, int event, int status) perror("read pty master"); exit(1); } else if (ret > 0) { - seat_output(pty->seat, !is_stdout, buf, ret); + pty->output_backlog = seat_output( + pty->seat, !is_stdout, buf, ret); + pty_uxsel_setup(pty); } } else if (event == SELECT_W) { /* @@ -717,7 +718,7 @@ static void pty_real_select_result(Pty *pty, int fd, int event, int status) "\r\n[pterm: process terminated with exit code %d]\r\n", WEXITSTATUS(pty->exit_code)); } else if (WIFSIGNALED(pty->exit_code)) { -#ifdef HAVE_NO_STRSIGNAL +#if !HAVE_STRSIGNAL message = dupprintf( "\r\n[pterm: process terminated on signal %d]\r\n", WTERMSIG(pty->exit_code)); @@ -782,8 +783,10 @@ static void pty_uxsel_setup_fd(Pty *pty, int fd) if (fd < 0) return; - /* read from standard output and standard error pipes */ - if (pty->master_o == fd || pty->master_e == fd) + /* read from standard output and standard error pipes, assuming + * we're not too backlogged */ + if ((pty->master_o == fd || pty->master_e == fd) && + pty->output_backlog < PTY_MAX_BACKLOG) rwx |= SELECT_R; /* write to standard input pipe if we have any data */ if (pty->master_i == fd && bufchain_size(&pty->output_data)) @@ -838,7 +841,7 @@ static void copy_ttymodes_into_termios( } #define TTYMODES_LOCAL_ONLY /* omit any that this platform doesn't know */ -#include "sshttymodes.h" +#include "ssh/ttymode-list.h" #undef TTYMODES_LOCAL_ONLY #undef TTYMODE_CHAR @@ -1375,17 +1378,15 @@ static void pty_try_write(Pty *pty) /* * Called to send data down the pty. */ -static size_t pty_send(Backend *be, const char *buf, size_t len) +static void pty_send(Backend *be, const char *buf, size_t len) { Pty *pty = container_of(be, Pty, backend); if (pty->master_i < 0 || pty->pending_eof) - return 0; /* ignore all writes if fd closed */ + return; /* ignore all writes if fd closed */ bufchain_add(&pty->output_data, buf, len); pty_try_write(pty); - - return bufchain_size(&pty->output_data); } static void pty_close(Pty *pty) @@ -1422,8 +1423,8 @@ static void pty_close(Pty *pty) */ static size_t pty_sendbuffer(Backend *be) { - /* Pty *pty = container_of(be, Pty, backend); */ - return 0; + Pty *pty = container_of(be, Pty, backend); + return bufchain_size(&pty->output_data); } /* @@ -1478,7 +1479,7 @@ static void pty_special(Backend *be, SessionSpecialCode code, int arg) #define SIGNAL_SUB(name) if (code == SS_SIG ## name) sig = SIG ## name; #define SIGNAL_MAIN(name, text) SIGNAL_SUB(name) #define SIGNALS_LOCAL_ONLY - #include "sshsignals.h" + #include "ssh/signal-list.h" #undef SIGNAL_SUB #undef SIGNAL_MAIN #undef SIGNALS_LOCAL_ONLY @@ -1523,8 +1524,9 @@ static bool pty_sendok(Backend *be) static void pty_unthrottle(Backend *be, size_t backlog) { - /* Pty *pty = container_of(be, Pty, backend); */ - /* do nothing */ + Pty *pty = container_of(be, Pty, backend); + pty->output_backlog = backlog; + pty_uxsel_setup(pty); } static bool pty_ldisc(Backend *be, int option) @@ -1574,7 +1576,7 @@ ptrlen pty_backend_exit_signame(Backend *be, char **aux_msg) } #define SIGNAL_MAIN(s, desc) SIGNAL_SUB(s) #define SIGNALS_LOCAL_ONLY - #include "sshsignals.h" + #include "ssh/signal-list.h" #undef SIGNAL_MAIN #undef SIGNAL_SUB #undef SIGNALS_LOCAL_ONLY @@ -1607,6 +1609,7 @@ const BackendVtable pty_backend = { .unthrottle = pty_unthrottle, .cfg_info = pty_cfg_info, .id = "pty", - .displayname = "pty", + .displayname_tc = "pty", + .displayname_lc = "pty", .protocol = -1, }; diff --git a/code/unix/xpmpucfg.c b/code/unix/putty-config-xpm.c similarity index 100% rename from code/unix/xpmpucfg.c rename to code/unix/putty-config-xpm.c diff --git a/code/unix/xpmputty.c b/code/unix/putty-xpm.c similarity index 100% rename from code/unix/xpmputty.c rename to code/unix/putty-xpm.c diff --git a/code/unix/uxputty.c b/code/unix/putty.c similarity index 97% rename from code/unix/uxputty.c rename to code/unix/putty.c index 7a80808..a96217e 100644 --- a/code/unix/uxputty.c +++ b/code/unix/putty.c @@ -19,7 +19,7 @@ #include "gtkcompat.h" /* - * Stubs to avoid uxpty.c needing to be linked in. + * Stubs to avoid pty.c needing to be linked in. */ const bool use_pty_argv = false; char **pty_argv; /* never used */ diff --git a/code/unix/uxser.c b/code/unix/serial.c similarity index 98% rename from code/unix/uxser.c rename to code/unix/serial.c index d4a1e0b..1e20dd2 100644 --- a/code/unix/uxser.c +++ b/code/unix/serial.c @@ -294,6 +294,7 @@ static char *serial_init(const BackendVtable *vt, Seat *seat, seat_set_trust_status(seat, false); serial = snew(Serial); + memset(serial, 0, sizeof(Serial)); serial->backend.vt = vt; *backend_handle = &serial->backend; @@ -454,23 +455,22 @@ static void serial_try_write(Serial *serial) bufchain_consume(&serial->output_data, ret); } + seat_sent(serial->seat, bufchain_size(&serial->output_data)); serial_uxsel_setup(serial); } /* * Called to send data down the serial connection. */ -static size_t serial_send(Backend *be, const char *buf, size_t len) +static void serial_send(Backend *be, const char *buf, size_t len) { Serial *serial = container_of(be, Serial, backend); if (serial->fd < 0) - return 0; + return; bufchain_add(&serial->output_data, buf, len); serial_try_write(serial); - - return bufchain_size(&serial->output_data); } /* @@ -584,7 +584,8 @@ const BackendVtable serial_backend = { .unthrottle = serial_unthrottle, .cfg_info = serial_cfg_info, .id = "serial", - .displayname = "Serial", + .displayname_tc = "Serial", + .displayname_lc = "serial", .protocol = PROT_SERIAL, .serial_parity_mask = ((1 << SER_PAR_NONE) | (1 << SER_PAR_ODD) | diff --git a/code/unix/uxsftp.c b/code/unix/sftp.c similarity index 95% rename from code/unix/uxsftp.c rename to code/unix/sftp.c index 89a81c9..9d099f5 100644 --- a/code/unix/uxsftp.c +++ b/code/unix/sftp.c @@ -1,5 +1,5 @@ /* - * uxsftp.c: the Unix-specific parts of PSFTP and PSCP. + * sftp.c: the Unix-specific parts of PSFTP and PSCP. */ #include @@ -63,13 +63,19 @@ Filename *platform_default_filename(const char *name) return filename_from_str(""); } -int filexfer_get_userpass_input(Seat *seat, prompts_t *p, bufchain *input) +SeatPromptResult filexfer_get_userpass_input(Seat *seat, prompts_t *p) { - int ret; - ret = cmdline_get_passwd_input(p); - if (ret == -1) - ret = console_get_userpass_input(p); - return ret; + /* The file transfer tools don't support Restart Session, so we + * can just have a single static cmdline_get_passwd_input_state + * that's never reset */ + static cmdline_get_passwd_input_state cmdline_state = + CMDLINE_GET_PASSWD_INPUT_STATE_INIT; + + SeatPromptResult spr; + spr = cmdline_get_passwd_input(p, &cmdline_state, false); + if (spr.kind == SPRK_INCOMPLETE) + spr = console_get_userpass_input(p); + return spr; } /* diff --git a/code/unix/uxsftpserver.c b/code/unix/sftpserver.c similarity index 99% rename from code/unix/uxsftpserver.c rename to code/unix/sftpserver.c index acefe9b..7257c5c 100644 --- a/code/unix/uxsftpserver.c +++ b/code/unix/sftpserver.c @@ -20,8 +20,8 @@ #include "putty.h" #include "ssh.h" -#include "sshserver.h" -#include "sftp.h" +#include "ssh/server.h" +#include "ssh/sftp.h" #include "tree234.h" typedef struct UnixSftpServer UnixSftpServer; diff --git a/code/unix/uxshare.c b/code/unix/sharing.c similarity index 99% rename from code/unix/uxshare.c rename to code/unix/sharing.c index f1ef201..8db2d71 100644 --- a/code/unix/uxshare.c +++ b/code/unix/sharing.c @@ -16,7 +16,7 @@ #include "tree234.h" #include "putty.h" #include "network.h" -#include "proxy.h" +#include "proxy/proxy.h" #include "ssh.h" #define CONNSHARE_SOCKETDIR_PREFIX "/tmp/putty-connshare" @@ -297,7 +297,7 @@ int platform_ssh_share(const char *pi_name, Conf *conf, if (can_downstream) { retsock = new_connection(unix_sock_addr(sockname), "", 0, false, true, false, false, - downplug, conf); + downplug, conf, NULL); if (sk_socket_error(retsock) == NULL) { sfree(*logtext); *logtext = sockname; diff --git a/code/unix/uxstore.c b/code/unix/storage.c similarity index 97% rename from code/unix/uxstore.c rename to code/unix/storage.c index 9db713d..c61fb52 100644 --- a/code/unix/uxstore.c +++ b/code/unix/storage.c @@ -1,5 +1,5 @@ /* - * uxstore.c: Unix-specific implementation of the interface defined + * storage.c: Unix-specific implementation of the interface defined * in storage.h. */ @@ -173,7 +173,7 @@ static char *make_filename(int index, const char *subname) if (index == INDEX_SESSION) { strbuf *sb = strbuf_new(); tmp = make_filename(INDEX_SESSIONDIR, NULL); - strbuf_catf(sb, "%s/", tmp); + put_fmt(sb, "%s/", tmp); sfree(tmp); make_session_filename(subname, sb); return strbuf_to_str(sb); @@ -557,7 +557,7 @@ bool enum_settings_next(settings_e *handle, strbuf *out) fullpath = strbuf_new(); char *sessiondir = make_filename(INDEX_SESSIONDIR, NULL); - put_datapl(fullpath, ptrlen_from_asciz(sessiondir)); + put_dataz(fullpath, sessiondir); sfree(sessiondir); put_byte(fullpath, '/'); @@ -565,7 +565,7 @@ bool enum_settings_next(settings_e *handle, strbuf *out) while ( (de = readdir(handle->dp)) != NULL ) { strbuf_shrink_to(fullpath, baselen); - put_datapl(fullpath, ptrlen_from_asciz(de->d_name)); + put_dataz(fullpath, de->d_name); if (stat(fullpath->s, &st) < 0 || !S_ISREG(st.st_mode)) continue; /* try another one */ @@ -595,8 +595,8 @@ void enum_settings_finish(settings_e *handle) * * rsa@22:foovax.example.org 0x23,0x293487364395345345....2343 */ -int verify_host_key(const char *hostname, int port, - const char *keytype, const char *key) +int check_stored_host_key(const char *hostname, int port, + const char *keytype, const char *key) { FILE *fp; char *filename; @@ -668,10 +668,10 @@ bool have_ssh_host_key(const char *hostname, int port, const char *keytype) { /* - * If we have a host key, verify_host_key will return 0 or 2. + * If we have a host key, check_stored_host_key will return 0 or 2. * If we don't have one, it'll return 1. */ - return verify_host_key(hostname, port, keytype, "") != 1; + return check_stored_host_key(hostname, port, keytype, "") != 1; } void store_host_key(const char *hostname, int port, diff --git a/code/unix/uxucs.c b/code/unix/unicode.c similarity index 98% rename from code/unix/uxucs.c rename to code/unix/unicode.c index c1d76a4..4eaa45f 100644 --- a/code/unix/uxucs.c +++ b/code/unix/unicode.c @@ -31,6 +31,8 @@ int mb_to_wc(int codepage, int flags, const char *mbstr, int mblen, memset(&state, 0, sizeof state); while (mblen > 0) { + if (n >= wclen) + return n; size_t i = mbrtowc(wcstr+n, mbstr, (size_t)mblen, &state); if (i == (size_t)-1 || i == (size_t)-2) break; @@ -44,6 +46,8 @@ int mb_to_wc(int codepage, int flags, const char *mbstr, int mblen, int n = 0; while (mblen > 0) { + if (n >= wclen) + return n; wcstr[n] = 0xD800 | (mbstr[0] & 0xFF); n++; mbstr++; diff --git a/code/unix/gtkfont.c b/code/unix/unifont.c similarity index 99% rename from code/unix/gtkfont.c rename to code/unix/unifont.c index b910d14..62445db 100644 --- a/code/unix/gtkfont.c +++ b/code/unix/unifont.c @@ -21,7 +21,7 @@ #define MAY_REFER_TO_GTK_IN_HEADERS #include "putty.h" -#include "gtkfont.h" +#include "unifont.h" #include "gtkcompat.h" #include "gtkmisc.h" #include "tree234.h" @@ -1904,19 +1904,19 @@ static void pangofont_enum_fonts(GtkWidget *widget, fontsel_add_entry callback, /* Weight: normal, then lighter, then bolder */ if (weight <= PANGO_WEIGHT_NORMAL) weight = PANGO_WEIGHT_NORMAL - weight; - strbuf_catf(buf, "%4d", weight); + put_fmt(buf, "%4d", weight); - strbuf_catf(buf, " %2d", - pango_font_description_get_style(desc)); + put_fmt(buf, " %2d", + pango_font_description_get_style(desc)); int stretch = pango_font_description_get_stretch(desc); /* Stretch: closer to normal sorts earlier */ stretch = 2 * abs(PANGO_STRETCH_NORMAL - stretch) + (stretch < PANGO_STRETCH_NORMAL); - strbuf_catf(buf, " %2d", stretch); + put_fmt(buf, " %2d", stretch); - strbuf_catf(buf, " %2d", - pango_font_description_get_variant(desc)); + put_fmt(buf, " %2d", + pango_font_description_get_variant(desc)); stylekey = strbuf_to_str(buf); } diff --git a/code/unix/gtkfont.h b/code/unix/unifont.h similarity index 97% rename from code/unix/gtkfont.h rename to code/unix/unifont.h index e43a748..c0f0112 100644 --- a/code/unix/gtkfont.h +++ b/code/unix/unifont.h @@ -1,5 +1,5 @@ /* - * Header file for gtkfont.c. Has to be separate from unix.h + * Header file for unifont.c. Has to be separate from unix.h * because it depends on GTK data types, hence can't be included * from cross-platform code (which doesn't go near GTK). */ @@ -47,10 +47,10 @@ #endif /* - * Exports from gtkfont.c. + * Exports from unifont.c. */ typedef struct UnifontVtable UnifontVtable; /* contents internal to - * gtkfont.c */ + * unifont.c */ typedef struct unifont { const struct UnifontVtable *vt; /* diff --git a/code/unix/uxserver.c b/code/unix/uppity.c similarity index 71% rename from code/unix/uxserver.c rename to code/unix/uppity.c index 448c651..84d332c 100644 --- a/code/unix/uxserver.c +++ b/code/unix/uppity.c @@ -41,9 +41,7 @@ #include "putty.h" #include "mpint.h" #include "ssh.h" -#include "sshserver.h" - -const char *const appname = "uppity"; +#include "ssh/server.h" void modalfatalbox(const char *p, ...) { @@ -110,6 +108,8 @@ void make_unix_sftp_filehandle_key(void *data, size_t size) static bool verbose; +struct server_config; + struct AuthPolicyShared { struct AuthPolicy_ssh1_pubkey *ssh1keys; struct AuthPolicy_ssh2_pubkey *ssh2keys; @@ -124,12 +124,34 @@ struct server_instance { unsigned id; AuthPolicy ap; LogPolicy logpolicy; + struct server_config *cfg; }; +struct server_config { + unsigned config_id; + + Conf *conf; + const SshServerConfig *ssc; + + ssh_key **hostkeys; + int nhostkeys; + + RSAKey *hostkey1; + + unsigned auth_methods; + + struct AuthPolicyShared *ap_shared; + + Socket *listening_socket; + Plug listening_plug; +}; + +static unsigned next_id = 0; + static void log_to_stderr(unsigned id, const char *msg) { if (id != (unsigned)-1) - fprintf(stderr, "#%u: ", id); + fprintf(stderr, "conn#%u: ", id); fputs(msg, stderr); fputc('\n', stderr); fflush(stderr); @@ -175,11 +197,16 @@ struct AuthPolicy_ssh2_pubkey { unsigned auth_methods(AuthPolicy *ap) { - return (AUTHMETHOD_PUBLICKEY | AUTHMETHOD_PASSWORD | AUTHMETHOD_KBDINT | - AUTHMETHOD_TIS | AUTHMETHOD_CRYPTOCARD); + struct server_instance *inst = container_of( + ap, struct server_instance, ap); + return inst->cfg->auth_methods; } bool auth_none(AuthPolicy *ap, ptrlen username) { + struct server_instance *inst = container_of( + ap, struct server_instance, ap); + if (inst->cfg->auth_methods & AUTHMETHOD_NONE) + return true; return false; } int auth_password(AuthPolicy *ap, ptrlen username, ptrlen password, @@ -249,13 +276,21 @@ AuthKbdInt *auth_kbdint_prompts(AuthPolicy *ap, ptrlen username) aki->prompts[1].prompt = dupstr("Silent prompt: "); aki->prompts[1].echo = false; return aki; - case 1: + case 1: { + struct server_instance *inst = container_of( + ap, struct server_instance, ap); aki = snew(AuthKbdInt); - aki->title = dupstr("Zero-prompt step"); - aki->instruction = dupstr("Shouldn't see any prompts this time"); + if (inst->cfg->ssc->stunt_allow_trivial_ki_auth) { + aki->title = dupstr(""); + aki->instruction = dupstr(""); + } else { + aki->title = dupstr("Zero-prompt step"); + aki->instruction = dupstr("Shouldn't see any prompts this time"); + } aki->nprompts = 0; aki->prompts = NULL; return aki; + } default: ap->kbdint_state = 0; return NULL; @@ -310,7 +345,7 @@ static void show_help(FILE *fp) { safety_warning(fp); fputs("\n" - "usage: uppity [options]\n" + "usage: uppity [options] [--and ...]\n" "options: --listen [PORT|PATH] listen to a port on localhost, or Unix socket\n" " --listen-once (with --listen) stop after one " "connection\n" @@ -340,6 +375,10 @@ static void show_help(FILE *fp) "s->c compression types\n" " --ssh1-ciphers STR override list of SSH-1 ciphers\n" " --ssh1-no-compression forbid compression in SSH-1\n" + " --deny-auth METHOD forbid a userauth method\n" + " --allow-auth METHOD allow a userauth method\n" + " (METHOD = none/password/publickey/kbdint/tis/" + "cryptocard)\n" " --exitsignum send buggy numeric \"exit-signal\" " "message\n" " --verbose print event log messages to standard " @@ -347,6 +386,7 @@ static void show_help(FILE *fp) " --sshlog FILE write SSH packet log to FILE\n" " --sshrawlog FILE write SSH packets + raw data log" " to FILE\n" + " --and run a separate server on another port\n" "also: uppity --help show this text\n" " uppity --version show version information\n" "\n", fp); @@ -416,23 +456,6 @@ static bool longoptnoarg(const char *arg, const char *expected) return false; } -struct server_config { - Conf *conf; - const SshServerConfig *ssc; - - ssh_key **hostkeys; - int nhostkeys; - - RSAKey *hostkey1; - - struct AuthPolicyShared *ap_shared; - - unsigned next_id; - - Socket *listening_socket; - Plug listening_plug; -}; - static Plug *server_conn_plug( struct server_config *cfg, struct server_instance **inst_out) { @@ -440,9 +463,12 @@ static Plug *server_conn_plug( memset(inst, 0, sizeof(*inst)); - inst->id = cfg->next_id++; + inst->id = next_id++; inst->ap.shared = cfg->ap_shared; + if (cfg->ssc->stunt_allow_trivial_ki_auth) + inst->ap.kbdint_state = 1; inst->logpolicy.vt = &server_logpolicy_vt; + inst->cfg = cfg; if (inst_out) *inst_out = inst; @@ -458,10 +484,11 @@ static void server_log(Plug *plug, PlugLogType type, SockAddr *addr, int port, log_to_stderr((unsigned)-1, error_msg); } -static void server_closing(Plug *plug, const char *error_msg, int error_code, - bool calling_back) +static void server_closing(Plug *plug, PlugCloseType type, + const char *error_msg) { - log_to_stderr((unsigned)-1, error_msg); + if (type != PLUGCLOSE_NORMAL) + log_to_stderr((unsigned)-1, error_msg); } static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) @@ -480,7 +507,7 @@ static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) cfg->listening_socket = NULL; } - unsigned old_next_id = cfg->next_id; + unsigned old_next_id = next_id; Plug *plug = server_conn_plug(cfg, &inst); s = constructor(ctx, plug); @@ -490,15 +517,17 @@ static int server_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx) SocketPeerInfo *pi = sk_peer_info(s); if (pi->addressfamily != ADDRTYPE_LOCAL && !sk_peer_trusted(s)) { - fprintf(stderr, "rejected connection from %s (untrustworthy peer)\n", - pi->log_text); + fprintf(stderr, "rejected connection to serv#%u " + "from %s (untrustworthy peer)\n", + cfg->config_id, pi->log_text); sk_free_peer_info(pi); sk_close(s); - cfg->next_id = old_next_id; + next_id = old_next_id; return 1; } - char *msg = dupprintf("new connection from %s", pi->log_text); + char *msg = dupprintf("new connection to serv#%u from %s", + cfg->config_id, pi->log_text); log_to_stderr(inst->id, msg); sfree(msg); sk_free_peer_info(pi); @@ -514,29 +543,112 @@ static const PlugVtable server_plugvt = { .accepting = server_accepting, }; -int main(int argc, char **argv) -{ - int listen_port = -1; - const char *listen_socket = NULL; - - ssh_key **hostkeys = NULL; - size_t nhostkeys = 0, hostkeysize = 0; - RSAKey *hostkey1 = NULL; +static unsigned auth_method_from_name(const char *name) +{ + if (!strcmp(name, "none")) + return AUTHMETHOD_NONE; + if (!strcmp(name, "tis")) + return AUTHMETHOD_TIS; + if (!strcmp(name, "cryptocard") || !strcmp(name, "ccard")) + return AUTHMETHOD_CRYPTOCARD; + if (!strcmp(name, "keyboard-interactive") || !strcmp(name, "k-i") || + !strcmp(name, "kbdint") || !strcmp(name, "ki")) + return AUTHMETHOD_KBDINT; + if (!strcmp(name, "publickey") || !strcmp(name, "pubkey") || + !strcmp(name, "pk")) + return AUTHMETHOD_PUBLICKEY; + if (!strcmp(name, "password") || !strcmp(name, "pw")) + return AUTHMETHOD_PASSWORD; + return 0; +} +struct cmdline_instance { + int listen_port; + const char *listen_socket; + ssh_key **hostkeys; + size_t nhostkeys, hostkeysize; + RSAKey *hostkey1; + unsigned auth_methods; struct AuthPolicyShared aps; SshServerConfig ssc; + Conf *conf; +}; + +static void init_cmdline_instance(struct cmdline_instance *ci) +{ + ci->listen_port = -1; + ci->listen_socket = NULL; - Conf *conf = make_ssh_server_conf(); + ci->hostkeys = NULL; + ci->nhostkeys = ci->hostkeysize = 0; + ci->hostkey1 = NULL; - aps.ssh1keys = NULL; - aps.ssh2keys = NULL; + ci->conf = make_ssh_server_conf(); - memset(&ssc, 0, sizeof(ssc)); + ci->aps.ssh1keys = NULL; + ci->aps.ssh2keys = NULL; - ssc.application_name = "Uppity"; - ssc.session_starting_dir = getenv("HOME"); - ssc.ssh1_cipher_mask = SSH1_SUPPORTED_CIPHER_MASK; - ssc.ssh1_allow_compression = true; + memset(&ci->ssc, 0, sizeof(ci->ssc)); + + ci->ssc.application_name = "Uppity"; + ci->ssc.session_starting_dir = getenv("HOME"); + ci->ssc.ssh1_cipher_mask = SSH1_SUPPORTED_CIPHER_MASK; + ci->ssc.ssh1_allow_compression = true; + + ci->auth_methods = (AUTHMETHOD_PUBLICKEY | AUTHMETHOD_PASSWORD | + AUTHMETHOD_KBDINT | AUTHMETHOD_TIS | + AUTHMETHOD_CRYPTOCARD); +} + +static void cmdline_instance_start(struct cmdline_instance *ci) +{ + static unsigned next_server_config_id = 0; + + struct server_config *scfg = snew(struct server_config); + scfg->config_id = next_server_config_id++; + scfg->conf = ci->conf; + scfg->ssc = &ci->ssc; + scfg->hostkeys = ci->hostkeys; + scfg->nhostkeys = ci->nhostkeys; + scfg->hostkey1 = ci->hostkey1; + scfg->ap_shared = &ci->aps; + scfg->auth_methods = ci->auth_methods; + + if (ci->listen_port >= 0 || ci->listen_socket) { + listening = true; + scfg->listening_plug.vt = &server_plugvt; + char *msg; + if (ci->listen_port >= 0) { + scfg->listening_socket = sk_newlistener( + NULL, ci->listen_port, &scfg->listening_plug, true, + ADDRTYPE_UNSPEC); + msg = dupprintf("serv#%u: listening on port %d", + scfg->config_id, ci->listen_port); + } else { + SockAddr *addr = unix_sock_addr(ci->listen_socket); + scfg->listening_socket = new_unix_listener( + addr, &scfg->listening_plug); + msg = dupprintf("serv#%u: listening on Unix socket %s", + scfg->config_id, ci->listen_socket); + } + + log_to_stderr(-1, msg); + sfree(msg); + } else { + struct server_instance *inst; + Plug *plug = server_conn_plug(scfg, &inst); + ssh_server_start(plug, make_fd_socket(0, 1, -1, NULL, 0, plug)); + log_to_stderr(inst->id, "speaking SSH on stdio"); + } +} + +int main(int argc, char **argv) +{ + size_t ninstances = 0, instancessize = 8; + struct cmdline_instance *instances = snewn( + instancessize, struct cmdline_instance); + struct cmdline_instance *ci = &instances[ninstances++]; + init_cmdline_instance(ci); if (argc <= 1) { /* @@ -560,13 +672,17 @@ int main(int argc, char **argv) show_version_and_exit(); } else if (longoptnoarg(arg, "--verbose") || !strcmp(arg, "-v")) { verbose = true; + } else if (longoptnoarg(arg, "--and")) { + sgrowarray(instances, instancessize, ninstances); + ci = &instances[ninstances++]; + init_cmdline_instance(ci); } else if (longoptarg(arg, "--listen", &val, &argc, &argv)) { if (val[0] == '/') { - listen_port = -1; - listen_socket = val; + ci->listen_port = -1; + ci->listen_socket = val; } else { - listen_port = atoi(val); - listen_socket = NULL; + ci->listen_port = atoi(val); + ci->listen_socket = NULL; } } else if (!strcmp(arg, "--listen-once")) { listen_once = true; @@ -598,24 +714,24 @@ int main(int argc, char **argv) sfree(uk->comment); sfree(uk); - for (int i = 0; i < nhostkeys; i++) - if (ssh_key_alg(hostkeys[i]) == ssh_key_alg(key)) { + for (int i = 0; i < ci->nhostkeys; i++) + if (ssh_key_alg(ci->hostkeys[i]) == ssh_key_alg(key)) { fprintf(stderr, "%s: host key '%s' duplicates key " "type %s\n", appname, val, ssh_key_alg(key)->ssh_id); exit(1); } - sgrowarray(hostkeys, hostkeysize, nhostkeys); - hostkeys[nhostkeys++] = key; + sgrowarray(ci->hostkeys, ci->hostkeysize, ci->nhostkeys); + ci->hostkeys[ci->nhostkeys++] = key; } else if (keytype == SSH_KEYTYPE_SSH1) { - if (hostkey1) { + if (ci->hostkey1) { fprintf(stderr, "%s: host key '%s' is a redundant " "SSH-1 host key\n", appname, val); exit(1); } - hostkey1 = snew(RSAKey); - if (!rsa1_load_f(keyfile, hostkey1, NULL, &error)) { + ci->hostkey1 = snew(RSAKey); + if (!rsa1_load_f(keyfile, ci->hostkey1, NULL, &error)) { fprintf(stderr, "%s: unable to load host key '%s': " "%s\n", appname, val, error); exit(1); @@ -641,19 +757,19 @@ int main(int argc, char **argv) exit(1); } - if (ssc.rsa_kex_key) { - freersakey(ssc.rsa_kex_key); + if (ci->ssc.rsa_kex_key) { + freersakey(ci->ssc.rsa_kex_key); } else { - ssc.rsa_kex_key = snew(RSAKey); + ci->ssc.rsa_kex_key = snew(RSAKey); } - if (!rsa1_load_f(keyfile, ssc.rsa_kex_key, NULL, &error)) { + if (!rsa1_load_f(keyfile, ci->ssc.rsa_kex_key, NULL, &error)) { fprintf(stderr, "%s: unable to load RSA kex key '%s': " "%s\n", appname, val, error); exit(1); } - ssc.rsa_kex_key->sshk.vt = &ssh_rsa; + ci->ssc.rsa_kex_key->sshk.vt = &ssh_rsa; } else if (longoptarg(arg, "--userkey", &val, &argc, &argv)) { Filename *keyfile; int keytype; @@ -680,8 +796,8 @@ int main(int argc, char **argv) memcpy(blob, sb->u, sb->len); node->public_blob = make_ptrlen(blob, sb->len); - node->next = aps.ssh2keys; - aps.ssh2keys = node; + node->next = ci->aps.ssh2keys; + ci->aps.ssh2keys = node; strbuf_free(sb); } else if (keytype == SSH_KEYTYPE_SSH1_PUBLIC) { @@ -700,8 +816,8 @@ int main(int argc, char **argv) BinarySource_BARE_INIT(src, sb->u, sb->len); get_rsa_ssh1_pub(src, &node->key, RSA_SSH1_EXPONENT_FIRST); - node->next = aps.ssh1keys; - aps.ssh1keys = node; + node->next = ci->aps.ssh1keys; + ci->aps.ssh1keys = node; strbuf_free(sb); } else { @@ -723,27 +839,43 @@ int main(int argc, char **argv) exit(1); } fclose(fp); - ssc.banner = ptrlen_from_strbuf(sb); + ci->ssc.banner = ptrlen_from_strbuf(sb); } else if (longoptarg(arg, "--bannertext", &val, &argc, &argv)) { - ssc.banner = ptrlen_from_asciz(val); + ci->ssc.banner = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--sessiondir", &val, &argc, &argv)) { - ssc.session_starting_dir = val; + ci->ssc.session_starting_dir = val; } else if (longoptarg(arg, "--kexinit-kex", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_KEX] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_KEX] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-hostkey", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_HOSTKEY] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_HOSTKEY] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-cscipher", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_CSCIPHER] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_CSCIPHER] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-csmac", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_CSMAC] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_CSMAC] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-cscomp", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_CSCOMP] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_CSCOMP] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-sccipher", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_SCCIPHER] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_SCCIPHER] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-scmac", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_SCMAC] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_SCMAC] = ptrlen_from_asciz(val); } else if (longoptarg(arg, "--kexinit-sccomp", &val, &argc, &argv)) { - ssc.kex_override[KEXLIST_SCCOMP] = ptrlen_from_asciz(val); + ci->ssc.kex_override[KEXLIST_SCCOMP] = ptrlen_from_asciz(val); + } else if (longoptarg(arg, "--allow-auth", &val, &argc, &argv)) { + unsigned method = auth_method_from_name(val); + if (!method) { + fprintf(stderr, "%s: unrecognised auth method '%s'\n", + appname, val); + exit(1); + } + ci->auth_methods |= method; + } else if (longoptarg(arg, "--deny-auth", &val, &argc, &argv)) { + unsigned method = auth_method_from_name(val); + if (!method) { + fprintf(stderr, "%s: unrecognised auth method '%s'\n", + appname, val); + exit(1); + } + ci->auth_methods &= ~method; } else if (longoptarg(arg, "--ssh1-ciphers", &val, &argc, &argv)) { ptrlen list = ptrlen_from_asciz(val); ptrlen word; @@ -762,39 +894,59 @@ int main(int argc, char **argv) appname, PTRLEN_PRINTF(word)); exit(1); } - ssc.ssh1_cipher_mask = mask; + ci->ssc.ssh1_cipher_mask = mask; } else if (longoptnoarg(arg, "--ssh1-no-compression")) { - ssc.ssh1_allow_compression = false; + ci->ssc.ssh1_allow_compression = false; } else if (longoptnoarg(arg, "--exitsignum")) { - ssc.exit_signal_numeric = true; + ci->ssc.exit_signal_numeric = true; } else if (longoptarg(arg, "--sshlog", &val, &argc, &argv) || longoptarg(arg, "-sshlog", &val, &argc, &argv)) { Filename *logfile = filename_from_str(val); - conf_set_filename(conf, CONF_logfilename, logfile); + conf_set_filename(ci->conf, CONF_logfilename, logfile); filename_free(logfile); - conf_set_int(conf, CONF_logtype, LGTYP_PACKETS); - conf_set_int(conf, CONF_logxfovr, LGXF_OVR); + conf_set_int(ci->conf, CONF_logtype, LGTYP_PACKETS); + conf_set_int(ci->conf, CONF_logxfovr, LGXF_OVR); } else if (longoptarg(arg, "--sshrawlog", &val, &argc, &argv) || longoptarg(arg, "-sshrawlog", &val, &argc, &argv)) { Filename *logfile = filename_from_str(val); - conf_set_filename(conf, CONF_logfilename, logfile); + conf_set_filename(ci->conf, CONF_logfilename, logfile); filename_free(logfile); - conf_set_int(conf, CONF_logtype, LGTYP_SSHRAW); - conf_set_int(conf, CONF_logxfovr, LGXF_OVR); + conf_set_int(ci->conf, CONF_logtype, LGTYP_SSHRAW); + conf_set_int(ci->conf, CONF_logxfovr, LGXF_OVR); } else if (!strcmp(arg, "--pretend-to-accept-any-pubkey")) { - ssc.stunt_pretend_to_accept_any_pubkey = true; + ci->ssc.stunt_pretend_to_accept_any_pubkey = true; } else if (!strcmp(arg, "--open-unconditional-agent-socket")) { - ssc.stunt_open_unconditional_agent_socket = true; + ci->ssc.stunt_open_unconditional_agent_socket = true; + } else if (!strcmp(arg, "--allow-none-auth")) { + /* backwards-compatibility synonym for --allow-auth=none */ + ci->auth_methods |= AUTHMETHOD_NONE; + } else if (!strcmp(arg, "--allow-trivial-ki-auth")) { + ci->ssc.stunt_allow_trivial_ki_auth = true; + } else if (!strcmp(arg, "--return-success-to-pubkey-offer")) { + ci->ssc.stunt_return_success_to_pubkey_offer = true; } else { fprintf(stderr, "%s: unrecognised option '%s'\n", appname, arg); exit(1); } } - if (nhostkeys == 0 && !hostkey1) { - fprintf(stderr, "%s: specify at least one host key\n", appname); + if (ninstances > 1 && listen_once) { + fprintf(stderr, "%s: cannot listen once only with multiple server " + "instances\n", appname); exit(1); } + for (size_t i = 0; i < ninstances; i++) { + ci = &instances[i]; + if (ci->nhostkeys == 0 && !ci->hostkey1) { + fprintf(stderr, "%s: specify at least one host key\n", appname); + exit(1); + } + if (ninstances > 1 && !(ci->listen_port >= 0 || ci->listen_socket)) { + fprintf(stderr, "%s: cannot talk to stdio with multiple server " + "instances\n", appname); + exit(1); + } + } random_ref(); @@ -807,41 +959,8 @@ int main(int argc, char **argv) sk_init(); uxsel_init(); - struct server_config scfg; - scfg.conf = conf; - scfg.ssc = &ssc; - scfg.hostkeys = hostkeys; - scfg.nhostkeys = nhostkeys; - scfg.hostkey1 = hostkey1; - scfg.ap_shared = &aps; - scfg.next_id = 0; - - if (listen_port >= 0 || listen_socket) { - listening = true; - scfg.listening_plug.vt = &server_plugvt; - char *msg; - if (listen_port >= 0) { - scfg.listening_socket = sk_newlistener( - NULL, listen_port, &scfg.listening_plug, true, - ADDRTYPE_UNSPEC); - msg = dupprintf("%s: listening on port %d", - appname, listen_port); - } else { - SockAddr *addr = unix_sock_addr(listen_socket); - scfg.listening_socket = new_unix_listener( - addr, &scfg.listening_plug); - msg = dupprintf("%s: listening on Unix socket %s", - appname, listen_socket); - } - - log_to_stderr(-1, msg); - sfree(msg); - } else { - struct server_instance *inst; - Plug *plug = server_conn_plug(&scfg, &inst); - ssh_server_start(plug, make_fd_socket(0, 1, -1, plug)); - log_to_stderr(inst->id, "speaking SSH on stdio"); - } + for (size_t i = 0; i < ninstances; i++) + cmdline_instance_start(&instances[i]); cli_main_loop(cliloop_no_pw_setup, cliloop_no_pw_check, cliloop_always_continue, NULL); diff --git a/code/unix/utils/align_label_left.c b/code/unix/utils/align_label_left.c new file mode 100644 index 0000000..eaae01a --- /dev/null +++ b/code/unix/utils/align_label_left.c @@ -0,0 +1,20 @@ +/* + * Helper function to align the text in a GtkLabel to the left, which + * has to be done in several different ways depending on GTK version. + */ + +#include +#include "putty.h" +#include "gtkcompat.h" +#include "gtkmisc.h" + +void align_label_left(GtkLabel *label) +{ +#if GTK_CHECK_VERSION(3,16,0) + gtk_label_set_xalign(label, 0.0); +#elif GTK_CHECK_VERSION(3,14,0) + gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START); +#else + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); +#endif +} diff --git a/code/unix/uxutils.c b/code/unix/utils/arm_arch_queries.c similarity index 66% rename from code/unix/uxutils.c rename to code/unix/utils/arm_arch_queries.c index 3a04c1b..cc3e412 100644 --- a/code/unix/uxutils.c +++ b/code/unix/utils/arm_arch_queries.c @@ -1,11 +1,16 @@ +/* + * Unix implementation of the OS query functions that detect Arm + * architecture extensions. + */ + #include "putty.h" #include "ssh.h" -#include "uxutils.h" +#include "utils/arm_arch_queries.h" #if defined __arm__ || defined __aarch64__ -bool platform_aes_hw_available(void) +bool platform_aes_neon_available(void) { #if defined HWCAP_AES return getauxval(AT_HWCAP) & HWCAP_AES; @@ -21,7 +26,7 @@ bool platform_aes_hw_available(void) #endif } -bool platform_sha256_hw_available(void) +bool platform_sha256_neon_available(void) { #if defined HWCAP_SHA2 return getauxval(AT_HWCAP) & HWCAP_SHA2; @@ -35,7 +40,7 @@ bool platform_sha256_hw_available(void) #endif } -bool platform_sha1_hw_available(void) +bool platform_sha1_neon_available(void) { #if defined HWCAP_SHA1 return getauxval(AT_HWCAP) & HWCAP_SHA1; @@ -49,7 +54,7 @@ bool platform_sha1_hw_available(void) #endif } -bool platform_sha512_hw_available(void) +bool platform_sha512_neon_available(void) { #if defined HWCAP_SHA512 return getauxval(AT_HWCAP) & HWCAP_SHA512; @@ -62,4 +67,14 @@ bool platform_sha512_hw_available(void) #endif } +#else /* defined __arm__ || defined __aarch64__ */ + +/* + * Include _something_ in this file to prevent an annoying compiler + * warning, and to avoid having to condition out this file in + * CMakeLists. It's in a library, so this variable shouldn't end up in + * any actual program, because nothing will refer to it. + */ +const int arm_arch_queries_dummy_variable = 0; + #endif /* defined __arm__ || defined __aarch64__ */ diff --git a/code/unix/uxutils.h b/code/unix/utils/arm_arch_queries.h similarity index 81% rename from code/unix/uxutils.h rename to code/unix/utils/arm_arch_queries.h index c9acff5..bd05568 100644 --- a/code/unix/uxutils.h +++ b/code/unix/utils/arm_arch_queries.h @@ -1,5 +1,5 @@ /* - * uxutils.h: header included only by uxutils.c. + * Header included only by arm_arch_queries.c. * * The only reason this is a header file instead of a source file is * so that I can define 'static inline' functions which may or may not @@ -7,32 +7,32 @@ * to use them in the subsequent source file. */ -#ifndef PUTTY_UXUTILS_H -#define PUTTY_UXUTILS_H +#ifndef PUTTY_ARM_ARCH_QUERIES_H +#define PUTTY_ARM_ARCH_QUERIES_H #if defined __APPLE__ -#ifdef HAVE_SYS_SYSCTL_H +#if HAVE_SYS_SYSCTL_H #include #endif #endif /* defined __APPLE__ */ #if defined __arm__ || defined __aarch64__ -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_AUXV_H +#if HAVE_SYS_AUXV_H #include #endif -#ifdef HAVE_ASM_HWCAP_H +#if HAVE_ASM_HWCAP_H #include #endif -#if defined HAVE_GETAUXVAL +#if HAVE_GETAUXVAL /* No code needed: getauxval has just the API we want already */ -#elif defined HAVE_ELF_AUX_INFO +#elif HAVE_ELF_AUX_INFO /* Implement the simple getauxval API in terms of FreeBSD elf_aux_info */ static inline u_long getauxval(int which) { @@ -51,7 +51,7 @@ static inline u_long getauxval(int which) { return 0; } #if defined __APPLE__ static inline bool test_sysctl_flag(const char *flagname) { -#ifdef HAVE_SYSCTLBYNAME +#if HAVE_SYSCTLBYNAME int value; size_t size = sizeof(value); return (sysctlbyname(flagname, &value, &size, NULL, 0) == 0 && @@ -62,4 +62,4 @@ static inline bool test_sysctl_flag(const char *flagname) } #endif /* defined __APPLE__ */ -#endif /* PUTTY_UXUTILS_H */ +#endif /* PUTTY_ARM_ARCH_QUERIES_H */ diff --git a/code/unix/utils/block_signal.c b/code/unix/utils/block_signal.c new file mode 100644 index 0000000..918e63a --- /dev/null +++ b/code/unix/utils/block_signal.c @@ -0,0 +1,21 @@ +/* + * Handy function to block or unblock a signal, which does all the + * messing about with sigset_t for you. + */ + +#include +#include + +#include "defs.h" + +void block_signal(int sig, bool block_it) +{ + sigset_t ss; + + sigemptyset(&ss); + sigaddset(&ss, sig); + if(sigprocmask(block_it ? SIG_BLOCK : SIG_UNBLOCK, &ss, 0) < 0) { + perror("sigprocmask"); + exit(1); + } +} diff --git a/code/unix/utils/buildinfo_gtk_version.c b/code/unix/utils/buildinfo_gtk_version.c new file mode 100644 index 0000000..a2ec187 --- /dev/null +++ b/code/unix/utils/buildinfo_gtk_version.c @@ -0,0 +1,14 @@ +/* + * Return the version of GTK we were compiled against, for buildinfo. + */ + +#include +#include "putty.h" +#include "gtkcompat.h" +#include "gtkmisc.h" + +char *buildinfo_gtk_version(void) +{ + return dupprintf("%d.%d.%d", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); +} diff --git a/code/unix/utils/cloexec.c b/code/unix/utils/cloexec.c new file mode 100644 index 0000000..2fc2228 --- /dev/null +++ b/code/unix/utils/cloexec.c @@ -0,0 +1,49 @@ +/* + * Set and clear the FD_CLOEXEC fcntl option on a file descriptor. + * + * We don't realistically expect these operations to fail (the most + * plausible error condition is EBADF, but we always believe ourselves + * to be passing a valid fd so even that's an assertion-fail sort of + * response), so we don't make any effort to return sensible error + * codes to the caller - we just log to standard error and die + * unceremoniously. + */ + +#include +#include +#include +#include + +#include + +#include "putty.h" + +void cloexec(int fd) +{ + int fdflags; + + fdflags = fcntl(fd, F_GETFD); + if (fdflags < 0) { + fprintf(stderr, "%d: fcntl(F_GETFD): %s\n", fd, strerror(errno)); + exit(1); + } + if (fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC) < 0) { + fprintf(stderr, "%d: fcntl(F_SETFD): %s\n", fd, strerror(errno)); + exit(1); + } +} + +void noncloexec(int fd) +{ + int fdflags; + + fdflags = fcntl(fd, F_GETFD); + if (fdflags < 0) { + fprintf(stderr, "%d: fcntl(F_GETFD): %s\n", fd, strerror(errno)); + exit(1); + } + if (fcntl(fd, F_SETFD, fdflags & ~FD_CLOEXEC) < 0) { + fprintf(stderr, "%d: fcntl(F_SETFD): %s\n", fd, strerror(errno)); + exit(1); + } +} diff --git a/code/unix/utils/dputs.c b/code/unix/utils/dputs.c new file mode 100644 index 0000000..97a275e --- /dev/null +++ b/code/unix/utils/dputs.c @@ -0,0 +1,24 @@ +/* + * Implementation of dputs() for Unix. + * + * The debug messages are written to standard output, and also into a + * file called debug.log. + */ + +#include + +#include "putty.h" + +static FILE *debug_fp = NULL; + +void dputs(const char *buf) +{ + if (!debug_fp) { + debug_fp = fopen("debug.log", "w"); + } + + if (write(1, buf, strlen(buf)) < 0) {} /* 'error check' to placate gcc */ + + fputs(buf, debug_fp); + fflush(debug_fp); +} diff --git a/code/unix/utils/filename.c b/code/unix/utils/filename.c new file mode 100644 index 0000000..208483d --- /dev/null +++ b/code/unix/utils/filename.c @@ -0,0 +1,72 @@ +/* + * Implementation of Filename for Unix, including f_open(). + */ + +#include +#include + +#include "putty.h" + +Filename *filename_from_str(const char *str) +{ + Filename *ret = snew(Filename); + ret->path = dupstr(str); + return ret; +} + +Filename *filename_copy(const Filename *fn) +{ + return filename_from_str(fn->path); +} + +const char *filename_to_str(const Filename *fn) +{ + return fn->path; +} + +bool filename_equal(const Filename *f1, const Filename *f2) +{ + return !strcmp(f1->path, f2->path); +} + +bool filename_is_null(const Filename *fn) +{ + return !fn->path[0]; +} + +void filename_free(Filename *fn) +{ + sfree(fn->path); + sfree(fn); +} + +void filename_serialise(BinarySink *bs, const Filename *f) +{ + put_asciz(bs, f->path); +} +Filename *filename_deserialise(BinarySource *src) +{ + return filename_from_str(get_asciz(src)); +} + +char filename_char_sanitise(char c) +{ + if (c == '/') + return '.'; + return c; +} + +FILE *f_open(const Filename *filename, char const *mode, bool is_private) +{ + if (!is_private) { + return fopen(filename->path, mode); + } else { + int fd; + assert(mode[0] == 'w'); /* is_private is meaningless for read, + and tricky for append */ + fd = open(filename->path, O_WRONLY | O_CREAT | O_TRUNC, 0600); + if (fd < 0) + return NULL; + return fdopen(fd, mode); + } +} diff --git a/code/unix/utils/fontspec.c b/code/unix/utils/fontspec.c new file mode 100644 index 0000000..7c5a0a2 --- /dev/null +++ b/code/unix/utils/fontspec.c @@ -0,0 +1,35 @@ +/* + * Implementation of FontSpec for Unix. This is more or less + * degenerate - on this platform a font specification is just a + * string. + */ + +#include "putty.h" + +FontSpec *fontspec_new(const char *name) +{ + FontSpec *f = snew(FontSpec); + f->name = dupstr(name); + return f; +} + +FontSpec *fontspec_copy(const FontSpec *f) +{ + return fontspec_new(f->name); +} + +void fontspec_free(FontSpec *f) +{ + sfree(f->name); + sfree(f); +} + +void fontspec_serialise(BinarySink *bs, FontSpec *f) +{ + put_asciz(bs, f->name); +} + +FontSpec *fontspec_deserialise(BinarySource *src) +{ + return fontspec_new(get_asciz(src)); +} diff --git a/code/unix/utils/get_label_text_dimensions.c b/code/unix/utils/get_label_text_dimensions.c new file mode 100644 index 0000000..fe1c13a --- /dev/null +++ b/code/unix/utils/get_label_text_dimensions.c @@ -0,0 +1,42 @@ +/* + * Determine the dimensions of a piece of text in the standard + * font used in GTK interface elements like labels. We do this by + * instantiating an actual GtkLabel, and then querying its size. + */ + +#include +#include "putty.h" +#include "gtkcompat.h" +#include "gtkmisc.h" + +void get_label_text_dimensions(const char *text, int *width, int *height) +{ + GtkWidget *label = gtk_label_new(text); + + /* + * GTK2 and GTK3 require us to query the size completely + * differently. I'm sure there ought to be an easier approach than + * the way I'm doing this in GTK3, too! + */ +#if GTK_CHECK_VERSION(3,0,0) + PangoLayout *layout = gtk_label_get_layout(GTK_LABEL(label)); + PangoRectangle logrect; + pango_layout_get_extents(layout, NULL, &logrect); + if (width) + *width = logrect.width / PANGO_SCALE; + if (height) + *height = logrect.height / PANGO_SCALE; +#else + GtkRequisition req; + gtk_widget_size_request(label, &req); + if (width) + *width = req.width; + if (height) + *height = req.height; +#endif + + g_object_ref_sink(G_OBJECT(label)); +#if GTK_CHECK_VERSION(2,10,0) + g_object_unref(label); +#endif +} diff --git a/code/unix/utils/get_username.c b/code/unix/utils/get_username.c new file mode 100644 index 0000000..61e259c --- /dev/null +++ b/code/unix/utils/get_username.c @@ -0,0 +1,52 @@ +/* + * Implementation of get_username() for Unix. + */ + +#include +#include + +#include "putty.h" + +char *get_username(void) +{ + struct passwd *p; + uid_t uid = getuid(); + char *user, *ret = NULL; + + /* + * First, find who we think we are using getlogin. If this + * agrees with our uid, we'll go along with it. This should + * allow sharing of uids between several login names whilst + * coping correctly with people who have su'ed. + */ + user = getlogin(); +#if HAVE_SETPWENT + setpwent(); +#endif + if (user) + p = getpwnam(user); + else + p = NULL; + if (p && p->pw_uid == uid) { + /* + * The result of getlogin() really does correspond to + * our uid. Fine. + */ + ret = user; + } else { + /* + * If that didn't work, for whatever reason, we'll do + * the simpler version: look up our uid in the password + * file and map it straight to a name. + */ + p = getpwuid(uid); + if (!p) + return NULL; + ret = p->pw_name; + } +#if HAVE_ENDPWENT + endpwent(); +#endif + + return dupstr(ret); +} diff --git a/code/unix/utils/get_x11_display.c b/code/unix/utils/get_x11_display.c new file mode 100644 index 0000000..d9462c2 --- /dev/null +++ b/code/unix/utils/get_x11_display.c @@ -0,0 +1,34 @@ +/* + * Return the Xlib 'Display *' underlying our GTK environment, if any. + */ + +#include +#include "putty.h" +#include "gtkcompat.h" +#include "gtkmisc.h" + +#ifndef NOT_X_WINDOWS + +#include +#include + +Display *get_x11_display(void) +{ +#if GTK_CHECK_VERSION(3,0,0) + if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) + return NULL; +#endif + return GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); +} + +#else + +/* + * Include _something_ in this file to prevent an annoying compiler + * warning, and to avoid having to condition out this file in + * CMakeLists. It's in a library, so this variable shouldn't end up in + * any actual program, because nothing will refer to it. + */ +const int get_x11_display_dummy_variable = 0; + +#endif diff --git a/code/unix/utils/getticks.c b/code/unix/utils/getticks.c new file mode 100644 index 0000000..9d16981 --- /dev/null +++ b/code/unix/utils/getticks.c @@ -0,0 +1,33 @@ +/* + * Implement getticks() for Unix. + */ + +#include +#include + +#include "putty.h" + +unsigned long getticks(void) +{ + /* + * We want to use milliseconds rather than the microseconds or + * nanoseconds given by the underlying clock functions, because we + * need a decent number of them to fit into a 32-bit word so it + * can be used for keepalives. + */ +#if HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC + { + /* Use CLOCK_MONOTONIC if available, so as to be unconfused if + * the system clock changes. */ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) + return ts.tv_sec * TICKSPERSEC + + ts.tv_nsec / (1000000000 / TICKSPERSEC); + } +#endif + { + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * TICKSPERSEC + tv.tv_usec / (1000000 / TICKSPERSEC); + } +} diff --git a/code/unix/xkeysym.c b/code/unix/utils/keysym_to_unicode.c similarity index 99% rename from code/unix/xkeysym.c rename to code/unix/utils/keysym_to_unicode.c index aa9f953..37e419f 100644 --- a/code/unix/xkeysym.c +++ b/code/unix/utils/keysym_to_unicode.c @@ -1,5 +1,5 @@ /* - * xkeysym.c: mapping from X keysyms to Unicode values + * Map X keysyms to Unicode values. * * The basic idea of this is shamelessly cribbed from xterm. The * actual character data is generated from Markus Kuhn's proposed diff --git a/code/unix/utils/make_dir_and_check_ours.c b/code/unix/utils/make_dir_and_check_ours.c new file mode 100644 index 0000000..cab4dc2 --- /dev/null +++ b/code/unix/utils/make_dir_and_check_ours.c @@ -0,0 +1,60 @@ +/* + * Create a directory accessible only to us, and then check afterwards + * that we really did end up with a directory with the right ownership + * and permissions. + * + * The idea is that this is a directory in which we're about to create + * something sensitive, like a listening Unix-domain socket for SSH + * connection sharing or an SSH agent. We want to be protected against + * somebody else previously having created the directory in a way + * that's writable to us, and thus manipulating us into creating the + * actual socket in a directory they can see so that they can connect + * to it and (say) use our authenticated SSH sessions. + * + * NOTE: The strategy used in this function is not safe if the enemy + * has unrestricted write access to the containing directory. In that + * case, they could move our directory out of the way and make a new + * one, after this function returns and before we create our socket + * (or whatever) inside it. + * + * But this should be OK for temp directories (which modify the + * default world-write behaviour by also setting the 't' bit, + * preventing people from renaming or deleting things in there that + * they don't own). And of course it's also safe if the directory is + * writable only by our _own_ uid. + */ + +#include +#include + +#include +#include +#include + +#include "putty.h" + +char *make_dir_and_check_ours(const char *dirname) +{ + struct stat st; + + /* + * Create the directory. We might have created it before, so + * EEXIST is an OK error; but anything else is doom. + */ + if (mkdir(dirname, 0700) < 0 && errno != EEXIST) + return dupprintf("%s: mkdir: %s", dirname, strerror(errno)); + + /* + * Stat the directory and check its ownership and permissions. + */ + if (stat(dirname, &st) < 0) + return dupprintf("%s: stat: %s", dirname, strerror(errno)); + if (st.st_uid != getuid()) + return dupprintf("%s: directory owned by uid %d, not by us", + dirname, st.st_uid); + if ((st.st_mode & 077) != 0) + return dupprintf("%s: directory has overgenerous permissions %03o" + " (expected 700)", dirname, st.st_mode & 0777); + + return NULL; +} diff --git a/code/unix/utils/make_dir_path.c b/code/unix/utils/make_dir_path.c new file mode 100644 index 0000000..4d212fe --- /dev/null +++ b/code/unix/utils/make_dir_path.c @@ -0,0 +1,39 @@ +/* + * Make a path of subdirectories, tolerating EEXIST at every step. + */ + +#include +#include + +#include +#include +#include + +#include "putty.h" + +char *make_dir_path(const char *path, mode_t mode) +{ + int pos = 0; + char *prefix; + + while (1) { + pos += strcspn(path + pos, "/"); + + if (pos > 0) { + prefix = dupprintf("%.*s", pos, path); + + if (mkdir(prefix, mode) < 0 && errno != EEXIST) { + char *ret = dupprintf("%s: mkdir: %s", + prefix, strerror(errno)); + sfree(prefix); + return ret; + } + + sfree(prefix); + } + + if (!path[pos]) + return NULL; + pos += strspn(path + pos, "/"); + } +} diff --git a/code/unix/utils/make_spr_sw_abort_errno.c b/code/unix/utils/make_spr_sw_abort_errno.c new file mode 100644 index 0000000..57f58c2 --- /dev/null +++ b/code/unix/utils/make_spr_sw_abort_errno.c @@ -0,0 +1,22 @@ +/* + * Constructor function for a SeatPromptResult of the 'software abort' + * category, whose error message includes the translation of an OS + * error code. + */ + +#include "putty.h" + +static void spr_errno_errfn(SeatPromptResult spr, BinarySink *bs) +{ + put_fmt(bs, "%s: %s", spr.errdata_lit, strerror(spr.errdata_u)); +} + +SeatPromptResult make_spr_sw_abort_errno(const char *prefix, int errno_value) +{ + SeatPromptResult spr; + spr.kind = SPRK_SW_ABORT; + spr.errfn = spr_errno_errfn; + spr.errdata_lit = prefix; + spr.errdata_u = errno_value; + return spr; +} diff --git a/code/unix/utils/nonblock.c b/code/unix/utils/nonblock.c new file mode 100644 index 0000000..cece206 --- /dev/null +++ b/code/unix/utils/nonblock.c @@ -0,0 +1,55 @@ +/* + * Set and clear the O_NONBLOCK fcntl option on an open file. + * + * We don't realistically expect these operations to fail (the most + * plausible error condition is EBADF, but we always believe ourselves + * to be passing a valid fd so even that's an assertion-fail sort of + * response), so we don't make any effort to return sensible error + * codes to the caller - we just log to standard error and die + * unceremoniously. + * + * Returns the previous state of O_NONBLOCK. + */ + +#include +#include +#include +#include + +#include + +#include "putty.h" + +bool nonblock(int fd) +{ + int fdflags; + + fdflags = fcntl(fd, F_GETFL); + if (fdflags < 0) { + fprintf(stderr, "%d: fcntl(F_GETFL): %s\n", fd, strerror(errno)); + exit(1); + } + if (fcntl(fd, F_SETFL, fdflags | O_NONBLOCK) < 0) { + fprintf(stderr, "%d: fcntl(F_SETFL): %s\n", fd, strerror(errno)); + exit(1); + } + + return fdflags & O_NONBLOCK; +} + +bool no_nonblock(int fd) +{ + int fdflags; + + fdflags = fcntl(fd, F_GETFL); + if (fdflags < 0) { + fprintf(stderr, "%d: fcntl(F_GETFL): %s\n", fd, strerror(errno)); + exit(1); + } + if (fcntl(fd, F_SETFL, fdflags & ~O_NONBLOCK) < 0) { + fprintf(stderr, "%d: fcntl(F_SETFL): %s\n", fd, strerror(errno)); + exit(1); + } + + return fdflags & O_NONBLOCK; +} diff --git a/code/unix/utils/open_for_write_would_lose_data.c b/code/unix/utils/open_for_write_would_lose_data.c new file mode 100644 index 0000000..46e695f --- /dev/null +++ b/code/unix/utils/open_for_write_would_lose_data.c @@ -0,0 +1,44 @@ +/* + * Unix implementation of open_for_write_would_lose_data(). + */ + +#include +#include + +#include "putty.h" + +bool open_for_write_would_lose_data(const Filename *fn) +{ + struct stat st; + + if (stat(fn->path, &st) < 0) { + /* + * If the file doesn't even exist, we obviously want to return + * false. If we failed to stat it for any other reason, + * ignoring the precise error code and returning false still + * doesn't seem too unreasonable, because then we'll try to + * open the file for writing and report _that_ error, which is + * likely to be more to the point. + */ + return false; + } + + /* + * OK, something exists at this pathname and we've found out + * something about it. But an open-for-write will only + * destructively truncate it if it's a regular file with nonzero + * size. If it's empty, or some other kind of special thing like a + * character device (e.g. /dev/tty) or a named pipe, then opening + * it for write is already non-destructive and it's pointless and + * annoying to warn about it just because the same file can be + * opened for reading. (Indeed, if it's a named pipe, opening it + * for reading actually _causes inconvenience_ in its own right, + * even before the question of whether it gives misleading + * information.) + */ + if (S_ISREG(st.st_mode) && st.st_size > 0) { + return true; + } + + return false; +} diff --git a/code/unix/gtkmisc.c b/code/unix/utils/our_dialog.c similarity index 68% rename from code/unix/gtkmisc.c rename to code/unix/utils/our_dialog.c index c0c9682..5b9995d 100644 --- a/code/unix/gtkmisc.c +++ b/code/unix/utils/our_dialog.c @@ -1,80 +1,4 @@ /* - * Miscellaneous GTK helper functions. - */ - -#include -#include -#include -#include - -#include -#if !GTK_CHECK_VERSION(3,0,0) -#include -#endif - -#include "putty.h" -#include "gtkcompat.h" - -#ifndef NOT_X_WINDOWS -#include -#include -#endif - -void get_label_text_dimensions(const char *text, int *width, int *height) -{ - /* - * Determine the dimensions of a piece of text in the standard - * font used in GTK interface elements like labels. We do this by - * instantiating an actual GtkLabel, and then querying its size. - * - * But GTK2 and GTK3 require us to query the size completely - * differently. I'm sure there ought to be an easier approach than - * the way I'm doing this in GTK3, too! - */ - GtkWidget *label = gtk_label_new(text); - -#if GTK_CHECK_VERSION(3,0,0) - PangoLayout *layout = gtk_label_get_layout(GTK_LABEL(label)); - PangoRectangle logrect; - pango_layout_get_extents(layout, NULL, &logrect); - if (width) - *width = logrect.width / PANGO_SCALE; - if (height) - *height = logrect.height / PANGO_SCALE; -#else - GtkRequisition req; - gtk_widget_size_request(label, &req); - if (width) - *width = req.width; - if (height) - *height = req.height; -#endif - - g_object_ref_sink(G_OBJECT(label)); -#if GTK_CHECK_VERSION(2,10,0) - g_object_unref(label); -#endif -} - -int string_width(const char *text) -{ - int ret; - get_label_text_dimensions(text, &ret, NULL); - return ret; -} - -void align_label_left(GtkLabel *label) -{ -#if GTK_CHECK_VERSION(3,16,0) - gtk_label_set_xalign(label, 0.0); -#elif GTK_CHECK_VERSION(3,14,0) - gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START); -#else - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); -#endif -} - -/* ---------------------------------------------------------------------- * Functions to arrange controls in a basically dialog-like window. * * The best method for doing this has varied wildly with versions of @@ -108,6 +32,11 @@ void align_label_left(GtkLabel *label) * vbox. */ +#include +#include "putty.h" +#include "gtkcompat.h" +#include "gtkmisc.h" + GtkWidget *our_dialog_new(void) { #if GTK_CHECK_VERSION(3,0,0) @@ -204,20 +133,3 @@ void our_dialog_add_to_content_area(GtkWindow *dlg, GtkWidget *w, w, expand, fill, padding); #endif } - -char *buildinfo_gtk_version(void) -{ - return dupprintf("%d.%d.%d", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); -} - -#ifndef NOT_X_WINDOWS -Display *get_x11_display(void) -{ -#if GTK_CHECK_VERSION(3,0,0) - if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) - return NULL; -#endif - return GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); -} -#endif diff --git a/code/unix/utils/pgp_fingerprints.c b/code/unix/utils/pgp_fingerprints.c new file mode 100644 index 0000000..9fb6bf4 --- /dev/null +++ b/code/unix/utils/pgp_fingerprints.c @@ -0,0 +1,23 @@ +/* + * Display the fingerprints of the PGP Master Keys to the user. + * + * (This is in its own file rather than in console.c, because it's + * appropriate even for Unix GUI apps.) + */ + +#include "putty.h" + +void pgp_fingerprints(void) +{ + fputs("These are the fingerprints of the PuTTY PGP Master Keys. They can\n" + "be used to establish a trust path from this executable to another\n" + "one. See the manual for more information.\n" + "(Note: these fingerprints have nothing to do with SSH!)\n" + "\n" + "PuTTY Master Key as of " PGP_MASTER_KEY_YEAR + " (" PGP_MASTER_KEY_DETAILS "):\n" + " " PGP_MASTER_KEY_FP "\n\n" + "Previous Master Key (" PGP_PREV_MASTER_KEY_YEAR + ", " PGP_PREV_MASTER_KEY_DETAILS "):\n" + " " PGP_PREV_MASTER_KEY_FP "\n", stdout); +} diff --git a/code/unix/uxpoll.c b/code/unix/utils/pollwrap.c similarity index 81% rename from code/unix/uxpoll.c rename to code/unix/utils/pollwrap.c index 474926b..51121e3 100644 --- a/code/unix/uxpoll.c +++ b/code/unix/utils/pollwrap.c @@ -1,3 +1,24 @@ +/* + * Wrapper system around poll() that lets me treat it more or less + * like select(), but avoiding the inherent limitation of select() + * that it can't handle the full range of fds that are capable of + * existing. + * + * The pollwrapper structure contains the 'struct pollfd' array passed + * to poll() itself, and also a tree234 that maps each fd to its + * location in the list, which makes it convenient to add or remove + * individual fds from the system or change what events you're + * watching for on them. So the API is _shaped_ basically like select, + * even if none of the details are identical: from outside this + * module, a pollwrapper can be used wherever you'd otherwise have had + * an fd_set. + * + * Also, this module translate between the simple select r/w/x + * classification and the richer poll flags. We have to stick to r/w/x + * in this code base, because it ports to other systems where that's + * all you get. + */ + /* On some systems this is needed to get poll.h to define eg.. POLLRDNORM */ #define _XOPEN_SOURCE diff --git a/code/unix/utils/signal.c b/code/unix/utils/signal.c new file mode 100644 index 0000000..a56fe6b --- /dev/null +++ b/code/unix/utils/signal.c @@ -0,0 +1,30 @@ +/* + * PuTTY's wrapper on signal(2). + * + * Calling signal() is non-portable, as it varies in meaning between + * platforms and depending on feature macros, and has stupid semantics + * at least some of the time. + * + * This function provides the same interface as the libc function, but + * provides consistent semantics. It assumes POSIX semantics for + * sigaction() (so you might need to do some more work if you port to + * something ancient like SunOS 4). + */ + +#include + +#include "defs.h" + +void (*putty_signal(int sig, void (*func)(int)))(int) +{ + struct sigaction sa; + struct sigaction old; + + sa.sa_handler = func; + if(sigemptyset(&sa.sa_mask) < 0) + return SIG_ERR; + sa.sa_flags = SA_RESTART; + if(sigaction(sig, &sa, &old) < 0) + return SIG_ERR; + return old.sa_handler; +} diff --git a/code/unix/utils/string_width.c b/code/unix/utils/string_width.c new file mode 100644 index 0000000..c944308 --- /dev/null +++ b/code/unix/utils/string_width.c @@ -0,0 +1,18 @@ +/* + * Return the width of a string in the font used in GTK controls. Used + * as a means of picking a sensible size for dialog boxes and pieces + * of them, in a way that should adapt sensibly to changes in font and + * resolution. + */ + +#include +#include "putty.h" +#include "gtkcompat.h" +#include "gtkmisc.h" + +int string_width(const char *text) +{ + int ret; + get_label_text_dimensions(text, &ret, NULL); + return ret; +} diff --git a/code/unix/x11misc.c b/code/unix/utils/x11_ignore_error.c similarity index 84% rename from code/unix/x11misc.c rename to code/unix/utils/x11_ignore_error.c index e1fd190..a4165ab 100644 --- a/code/unix/x11misc.c +++ b/code/unix/utils/x11_ignore_error.c @@ -1,5 +1,7 @@ /* - * x11misc.c: miscellaneous stuff for dealing directly with X servers. + * Error handling mechanism which permits us to ignore specific X11 + * errors from particular requests. We maintain a list of upcoming + * potential error events that we want to not treat as fatal errors. */ #include @@ -18,12 +20,6 @@ #include "x11misc.h" -/* ---------------------------------------------------------------------- - * Error handling mechanism which permits us to ignore specific X11 - * errors from particular requests. We maintain a list of upcoming - * potential error events that we want to not treat as fatal errors. - */ - static int (*orig_x11_error_handler)(Display *thisdisp, XErrorEvent *err); struct x11_err_to_ignore { @@ -79,5 +75,14 @@ void x11_ignore_error(Display *disp, unsigned char errcode) nerrs++; } -#endif +#else /* NOT_X_WINDOWS */ + +/* + * Include _something_ in this file to prevent an annoying compiler + * warning, and to avoid having to condition out this file in + * CMakeLists. It's in a library, so this variable shouldn't end up in + * any actual program, because nothing will refer to it. + */ +const int x11_ignore_error_dummy_variable = 0; +#endif /* NOT_X_WINDOWS */ diff --git a/code/unix/uxmisc.c b/code/unix/uxmisc.c deleted file mode 100644 index 57df7b7..0000000 --- a/code/unix/uxmisc.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * PuTTY miscellaneous Unix stuff - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "putty.h" - -unsigned long getticks(void) -{ - /* - * We want to use milliseconds rather than the microseconds or - * nanoseconds given by the underlying clock functions, because we - * need a decent number of them to fit into a 32-bit word so it - * can be used for keepalives. - */ -#if defined HAVE_CLOCK_GETTIME && defined HAVE_DECL_CLOCK_MONOTONIC - { - /* Use CLOCK_MONOTONIC if available, so as to be unconfused if - * the system clock changes. */ - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) - return ts.tv_sec * TICKSPERSEC + - ts.tv_nsec / (1000000000 / TICKSPERSEC); - } -#endif - { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * TICKSPERSEC + tv.tv_usec / (1000000 / TICKSPERSEC); - } -} - -Filename *filename_from_str(const char *str) -{ - Filename *ret = snew(Filename); - ret->path = dupstr(str); - return ret; -} - -Filename *filename_copy(const Filename *fn) -{ - return filename_from_str(fn->path); -} - -const char *filename_to_str(const Filename *fn) -{ - return fn->path; -} - -bool filename_equal(const Filename *f1, const Filename *f2) -{ - return !strcmp(f1->path, f2->path); -} - -bool filename_is_null(const Filename *fn) -{ - return !fn->path[0]; -} - -void filename_free(Filename *fn) -{ - sfree(fn->path); - sfree(fn); -} - -void filename_serialise(BinarySink *bs, const Filename *f) -{ - put_asciz(bs, f->path); -} -Filename *filename_deserialise(BinarySource *src) -{ - return filename_from_str(get_asciz(src)); -} - -char filename_char_sanitise(char c) -{ - if (c == '/') - return '.'; - return c; -} - -#ifdef DEBUG -static FILE *debug_fp = NULL; - -void dputs(const char *buf) -{ - if (!debug_fp) { - debug_fp = fopen("debug.log", "w"); - } - - if (write(1, buf, strlen(buf)) < 0) {} /* 'error check' to placate gcc */ - - fputs(buf, debug_fp); - fflush(debug_fp); -} -#endif - -char *get_username(void) -{ - struct passwd *p; - uid_t uid = getuid(); - char *user, *ret = NULL; - - /* - * First, find who we think we are using getlogin. If this - * agrees with our uid, we'll go along with it. This should - * allow sharing of uids between several login names whilst - * coping correctly with people who have su'ed. - */ - user = getlogin(); -#if HAVE_SETPWENT - setpwent(); -#endif - if (user) - p = getpwnam(user); - else - p = NULL; - if (p && p->pw_uid == uid) { - /* - * The result of getlogin() really does correspond to - * our uid. Fine. - */ - ret = user; - } else { - /* - * If that didn't work, for whatever reason, we'll do - * the simpler version: look up our uid in the password - * file and map it straight to a name. - */ - p = getpwuid(uid); - if (!p) - return NULL; - ret = p->pw_name; - } -#if HAVE_ENDPWENT - endpwent(); -#endif - - return dupstr(ret); -} - -/* - * Display the fingerprints of the PGP Master Keys to the user. - * (This is here rather than in uxcons because it's appropriate even for - * Unix GUI apps.) - */ -void pgp_fingerprints(void) -{ - fputs("These are the fingerprints of the PuTTY PGP Master Keys. They can\n" - "be used to establish a trust path from this executable to another\n" - "one. See the manual for more information.\n" - "(Note: these fingerprints have nothing to do with SSH!)\n" - "\n" - "PuTTY Master Key as of " PGP_MASTER_KEY_YEAR - " (" PGP_MASTER_KEY_DETAILS "):\n" - " " PGP_MASTER_KEY_FP "\n\n" - "Previous Master Key (" PGP_PREV_MASTER_KEY_YEAR - ", " PGP_PREV_MASTER_KEY_DETAILS "):\n" - " " PGP_PREV_MASTER_KEY_FP "\n", stdout); -} - -/* - * Set and clear fcntl options on a file descriptor. We don't - * realistically expect any of these operations to fail (the most - * plausible error condition is EBADF, but we always believe ourselves - * to be passing a valid fd so even that's an assertion-fail sort of - * response), so we don't make any effort to return sensible error - * codes to the caller - we just log to standard error and die - * unceremoniously. However, nonblock and no_nonblock do return the - * previous state of O_NONBLOCK. - */ -void cloexec(int fd) { - int fdflags; - - fdflags = fcntl(fd, F_GETFD); - if (fdflags < 0) { - fprintf(stderr, "%d: fcntl(F_GETFD): %s\n", fd, strerror(errno)); - exit(1); - } - if (fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC) < 0) { - fprintf(stderr, "%d: fcntl(F_SETFD): %s\n", fd, strerror(errno)); - exit(1); - } -} -void noncloexec(int fd) { - int fdflags; - - fdflags = fcntl(fd, F_GETFD); - if (fdflags < 0) { - fprintf(stderr, "%d: fcntl(F_GETFD): %s\n", fd, strerror(errno)); - exit(1); - } - if (fcntl(fd, F_SETFD, fdflags & ~FD_CLOEXEC) < 0) { - fprintf(stderr, "%d: fcntl(F_SETFD): %s\n", fd, strerror(errno)); - exit(1); - } -} -bool nonblock(int fd) { - int fdflags; - - fdflags = fcntl(fd, F_GETFL); - if (fdflags < 0) { - fprintf(stderr, "%d: fcntl(F_GETFL): %s\n", fd, strerror(errno)); - exit(1); - } - if (fcntl(fd, F_SETFL, fdflags | O_NONBLOCK) < 0) { - fprintf(stderr, "%d: fcntl(F_SETFL): %s\n", fd, strerror(errno)); - exit(1); - } - - return fdflags & O_NONBLOCK; -} -bool no_nonblock(int fd) { - int fdflags; - - fdflags = fcntl(fd, F_GETFL); - if (fdflags < 0) { - fprintf(stderr, "%d: fcntl(F_GETFL): %s\n", fd, strerror(errno)); - exit(1); - } - if (fcntl(fd, F_SETFL, fdflags & ~O_NONBLOCK) < 0) { - fprintf(stderr, "%d: fcntl(F_SETFL): %s\n", fd, strerror(errno)); - exit(1); - } - - return fdflags & O_NONBLOCK; -} - -FILE *f_open(const Filename *filename, char const *mode, bool is_private) -{ - if (!is_private) { - return fopen(filename->path, mode); - } else { - int fd; - assert(mode[0] == 'w'); /* is_private is meaningless for read, - and tricky for append */ - fd = open(filename->path, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (fd < 0) - return NULL; - return fdopen(fd, mode); - } -} - -FontSpec *fontspec_new(const char *name) -{ - FontSpec *f = snew(FontSpec); - f->name = dupstr(name); - return f; -} -FontSpec *fontspec_copy(const FontSpec *f) -{ - return fontspec_new(f->name); -} -void fontspec_free(FontSpec *f) -{ - sfree(f->name); - sfree(f); -} -void fontspec_serialise(BinarySink *bs, FontSpec *f) -{ - put_asciz(bs, f->name); -} -FontSpec *fontspec_deserialise(BinarySource *src) -{ - return fontspec_new(get_asciz(src)); -} - -char *make_dir_and_check_ours(const char *dirname) -{ - struct stat st; - - /* - * Create the directory. We might have created it before, so - * EEXIST is an OK error; but anything else is doom. - */ - if (mkdir(dirname, 0700) < 0 && errno != EEXIST) - return dupprintf("%s: mkdir: %s", dirname, strerror(errno)); - - /* - * Now check that that directory is _owned by us_ and not writable - * by anybody else. This protects us against somebody else - * previously having created the directory in a way that's - * writable to us, and thus manipulating us into creating the - * actual socket in a directory they can see so that they can - * connect to it and use our authenticated SSH sessions. - */ - if (stat(dirname, &st) < 0) - return dupprintf("%s: stat: %s", dirname, strerror(errno)); - if (st.st_uid != getuid()) - return dupprintf("%s: directory owned by uid %d, not by us", - dirname, st.st_uid); - if ((st.st_mode & 077) != 0) - return dupprintf("%s: directory has overgenerous permissions %03o" - " (expected 700)", dirname, st.st_mode & 0777); - - return NULL; -} - -char *make_dir_path(const char *path, mode_t mode) -{ - int pos = 0; - char *prefix; - - while (1) { - pos += strcspn(path + pos, "/"); - - if (pos > 0) { - prefix = dupprintf("%.*s", pos, path); - - if (mkdir(prefix, mode) < 0 && errno != EEXIST) { - char *ret = dupprintf("%s: mkdir: %s", - prefix, strerror(errno)); - sfree(prefix); - return ret; - } - - sfree(prefix); - } - - if (!path[pos]) - return NULL; - pos += strspn(path + pos, "/"); - } -} - -bool open_for_write_would_lose_data(const Filename *fn) -{ - struct stat st; - - if (stat(fn->path, &st) < 0) { - /* - * If the file doesn't even exist, we obviously want to return - * false. If we failed to stat it for any other reason, - * ignoring the precise error code and returning false still - * doesn't seem too unreasonable, because then we'll try to - * open the file for writing and report _that_ error, which is - * likely to be more to the point. - */ - return false; - } - - /* - * OK, something exists at this pathname and we've found out - * something about it. But an open-for-write will only - * destructively truncate it if it's a regular file with nonzero - * size. If it's empty, or some other kind of special thing like a - * character device (e.g. /dev/tty) or a named pipe, then opening - * it for write is already non-destructive and it's pointless and - * annoying to warn about it just because the same file can be - * opened for reading. (Indeed, if it's a named pipe, opening it - * for reading actually _causes inconvenience_ in its own right, - * even before the question of whether it gives misleading - * information.) - */ - if (S_ISREG(st.st_mode) && st.st_size > 0) { - return true; - } - - return false; -} diff --git a/code/unix/uxproxy.c b/code/unix/uxproxy.c deleted file mode 100644 index 0a637bd..0000000 --- a/code/unix/uxproxy.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * uxproxy.c: Unix implementation of platform_new_connection(), - * supporting an OpenSSH-like proxy command. - */ - -#include -#include -#include -#include -#include - -#include "tree234.h" -#include "putty.h" -#include "network.h" -#include "proxy.h" - -Socket *platform_new_connection(SockAddr *addr, const char *hostname, - int port, bool privport, - bool oobinline, bool nodelay, bool keepalive, - Plug *plug, Conf *conf) -{ - char *cmd; - - int to_cmd_pipe[2], from_cmd_pipe[2], cmd_err_pipe[2], pid, proxytype; - int infd, outfd, inerrfd; - - proxytype = conf_get_int(conf, CONF_proxy_type); - if (proxytype != PROXY_CMD && proxytype != PROXY_FUZZ) - return NULL; - - if (proxytype == PROXY_CMD) { - cmd = format_telnet_command(addr, port, conf); - - { - char *logmsg = dupprintf("Starting local proxy command: %s", cmd); - plug_log(plug, PLUGLOG_PROXY_MSG, NULL, 0, logmsg, 0); - sfree(logmsg); - } - - /* - * Create the pipes to the proxy command, and spawn the proxy - * command process. - */ - if (pipe(to_cmd_pipe) < 0 || - pipe(from_cmd_pipe) < 0 || - pipe(cmd_err_pipe) < 0) { - sfree(cmd); - return new_error_socket_fmt(plug, "pipe: %s", strerror(errno)); - } - cloexec(to_cmd_pipe[1]); - cloexec(from_cmd_pipe[0]); - cloexec(cmd_err_pipe[0]); - - pid = fork(); - if (pid == 0) { - close(0); - close(1); - dup2(to_cmd_pipe[0], 0); - dup2(from_cmd_pipe[1], 1); - close(to_cmd_pipe[0]); - close(from_cmd_pipe[1]); - dup2(cmd_err_pipe[1], 2); - noncloexec(0); - noncloexec(1); - execl("/bin/sh", "sh", "-c", cmd, (void *)NULL); - _exit(255); - } - - sfree(cmd); - - if (pid < 0) - return new_error_socket_fmt(plug, "fork: %s", strerror(errno)); - - close(to_cmd_pipe[0]); - close(from_cmd_pipe[1]); - close(cmd_err_pipe[1]); - - outfd = to_cmd_pipe[1]; - infd = from_cmd_pipe[0]; - inerrfd = cmd_err_pipe[0]; - } else { - cmd = format_telnet_command(addr, port, conf); - outfd = open("/dev/null", O_WRONLY); - if (outfd == -1) { - sfree(cmd); - return new_error_socket_fmt( - plug, "/dev/null: %s", strerror(errno)); - } - infd = open(cmd, O_RDONLY); - if (infd == -1) { - Socket *toret = new_error_socket_fmt( - plug, "%s: %s", cmd, strerror(errno)); - sfree(cmd); - close(outfd); - return toret; - } - sfree(cmd); - inerrfd = -1; - } - - /* We are responsible for this and don't need it any more */ - sk_addr_free(addr); - - return make_fd_socket(infd, outfd, inerrfd, plug); -} diff --git a/code/unix/uxsel.c b/code/unix/uxsel.c index eb3abed..18d512a 100644 --- a/code/unix/uxsel.c +++ b/code/unix/uxsel.c @@ -2,10 +2,10 @@ * uxsel.c * * This module is a sort of all-purpose interchange for file - * descriptors. At one end it talks to uxnet.c and pty.c and + * descriptors. At one end it talks to network.c and pty.c and * anything else which might have one or more fds that need * select() or poll()-type things doing to them during an extended - * program run; at the other end it talks to pterm.c or uxplink.c or + * program run; at the other end it talks to window.c or plink.c or * anything else which might have its own means of actually doing * those select()-type things. */ diff --git a/code/unix/uxsignal.c b/code/unix/uxsignal.c deleted file mode 100644 index d75cce4..0000000 --- a/code/unix/uxsignal.c +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include - -#include "defs.h" - -/* - * Calling signal() is non-portable, as it varies in meaning - * between platforms and depending on feature macros, and has - * stupid semantics at least some of the time. - * - * This function provides the same interface as the libc function, - * but provides consistent semantics. It assumes POSIX semantics - * for sigaction() (so you might need to do some more work if you - * port to something ancient like SunOS 4) - */ -void (*putty_signal(int sig, void (*func)(int)))(int) { - struct sigaction sa; - struct sigaction old; - - sa.sa_handler = func; - if(sigemptyset(&sa.sa_mask) < 0) - return SIG_ERR; - sa.sa_flags = SA_RESTART; - if(sigaction(sig, &sa, &old) < 0) - return SIG_ERR; - return old.sa_handler; -} - -void block_signal(int sig, bool block_it) -{ - sigset_t ss; - - sigemptyset(&ss); - sigaddset(&ss, sig); - if(sigprocmask(block_it ? SIG_BLOCK : SIG_UNBLOCK, &ss, 0) < 0) { - perror("sigprocmask"); - exit(1); - } -} - -/* -Local Variables: -c-basic-offset:4 -comment-column:40 -End: -*/ diff --git a/code/unix/gtkwin.c b/code/unix/window.c similarity index 95% rename from code/unix/gtkwin.c rename to code/unix/window.c index 61e7718..173943c 100644 --- a/code/unix/gtkwin.c +++ b/code/unix/window.c @@ -1,5 +1,5 @@ /* - * gtkwin.c: the main code that runs a PuTTY terminal emulator and + * window.c: the main code that runs a PuTTY terminal emulator and * backend in a GTK window. */ @@ -32,7 +32,7 @@ #include "putty.h" #include "terminal.h" #include "gtkcompat.h" -#include "gtkfont.h" +#include "unifont.h" #include "gtkmisc.h" #ifndef NOT_X_WINDOWS @@ -89,6 +89,7 @@ struct GtkFrontend { gboolean sbar_visible; gboolean drawing_area_got_size, drawing_area_realised; gboolean drawing_area_setup_needed; + bool drawing_area_setup_called; GtkBox *hbox; GtkAdjustment *sbar_adjust; GtkWidget *menu, *specialsmenu, *specialsitem1, *specialsitem2, @@ -159,6 +160,7 @@ struct GtkFrontend { Ldisc *ldisc; Backend *backend; Terminal *term; + cmdline_get_passwd_input_state cmdline_get_passwd_state; LogContext *logctx; bool exited; struct unicode_data ucsdata; @@ -318,11 +320,18 @@ static char *gtk_seat_get_ttymode(Seat *seat, const char *mode) return term_get_ttymode(inst->term, mode); } -static size_t gtk_seat_output(Seat *seat, bool is_stderr, +static size_t gtk_seat_output(Seat *seat, SeatOutputType type, const void *data, size_t len) { GtkFrontend *inst = container_of(seat, GtkFrontend, seat); - return term_data(inst->term, is_stderr, data, len); + return term_data(inst->term, data, len); +} + +static void gtkwin_unthrottle(TermWin *win, size_t bufsize) +{ + GtkFrontend *inst = container_of(win, GtkFrontend, termwin); + if (inst->backend) + backend_unthrottle(inst->backend, bufsize); } static bool gtk_seat_eof(Seat *seat) @@ -331,15 +340,14 @@ static bool gtk_seat_eof(Seat *seat) return true; /* do respond to incoming EOF with outgoing */ } -static int gtk_seat_get_userpass_input(Seat *seat, prompts_t *p, - bufchain *input) +static SeatPromptResult gtk_seat_get_userpass_input(Seat *seat, prompts_t *p) { GtkFrontend *inst = container_of(seat, GtkFrontend, seat); - int ret; - ret = cmdline_get_passwd_input(p); - if (ret == -1) - ret = term_get_userpass_input(inst->term, p, input); - return ret; + SeatPromptResult spr; + spr = cmdline_get_passwd_input(p, &inst->cmdline_get_passwd_state, true); + if (spr.kind == SPRK_INCOMPLETE) + spr = term_get_userpass_input(inst->term, p); + return spr; } static bool gtk_seat_is_utf8(Seat *seat) @@ -383,19 +391,24 @@ static const char *gtk_seat_get_x_display(Seat *seat); #ifndef NOT_X_WINDOWS static bool gtk_seat_get_windowid(Seat *seat, long *id); #endif -static bool gtk_seat_set_trust_status(Seat *seat, bool trusted); +static void gtk_seat_set_trust_status(Seat *seat, bool trusted); +static bool gtk_seat_can_set_trust_status(Seat *seat); static bool gtk_seat_get_cursor_position(Seat *seat, int *x, int *y); static const SeatVtable gtk_seat_vt = { .output = gtk_seat_output, .eof = gtk_seat_eof, + .sent = nullseat_sent, + .banner = nullseat_banner_to_stderr, .get_userpass_input = gtk_seat_get_userpass_input, + .notify_session_started = nullseat_notify_session_started, .notify_remote_exit = gtk_seat_notify_remote_exit, + .notify_remote_disconnect = nullseat_notify_remote_disconnect, .connection_fatal = gtk_seat_connection_fatal, .update_specials_menu = gtk_seat_update_specials_menu, .get_ttymode = gtk_seat_get_ttymode, .set_busy_status = gtk_seat_set_busy_status, - .verify_ssh_host_key = gtk_seat_verify_ssh_host_key, + .confirm_ssh_host_key = gtk_seat_confirm_ssh_host_key, .confirm_weak_crypto_primitive = gtk_seat_confirm_weak_crypto_primitive, .confirm_weak_cached_hostkey = gtk_seat_confirm_weak_cached_hostkey, .is_utf8 = gtk_seat_is_utf8, @@ -409,6 +422,8 @@ static const SeatVtable gtk_seat_vt = { .get_window_pixel_size = gtk_seat_get_window_pixel_size, .stripctrl_new = gtk_seat_stripctrl_new, .set_trust_status = gtk_seat_set_trust_status, + .can_set_trust_status = gtk_seat_can_set_trust_status, + .has_mixed_input_stream = nullseat_has_mixed_input_stream_yes, .verbose = nullseat_verbose_yes, .interactive = nullseat_interactive_yes, .get_cursor_position = gtk_seat_get_cursor_position, @@ -645,12 +660,13 @@ gint delete_window(GtkWidget *widget, GdkEvent *event, GtkFrontend *inst) } #if GTK_CHECK_VERSION(2,0,0) -static void window_state_event(GtkWidget *widget, GdkEventWindowState *event, - gpointer user_data) +static gboolean window_state_event( + GtkWidget *widget, GdkEventWindowState *event, gpointer user_data) { GtkFrontend *inst = (GtkFrontend *)user_data; term_notify_minimised( inst->term, event->new_window_state & GDK_WINDOW_STATE_ICONIFIED); + return false; } #endif @@ -693,7 +709,6 @@ static void draw_backing_rect(GtkFrontend *inst); static void drawing_area_setup(GtkFrontend *inst, int width, int height) { int w, h, new_scale; - bool need_size = false; /* * See if the terminal size has changed. @@ -709,11 +724,7 @@ static void drawing_area_setup(GtkFrontend *inst, int width, int height) conf_set_int(inst->conf, CONF_width, inst->width); conf_set_int(inst->conf, CONF_height, inst->height); /* - * We'll need to tell terminal.c about the resize below. - */ - need_size = true; - /* - * And we must refresh the window's backing image. + * We must refresh the window's backing image. */ inst->drawing_area_setup_needed = true; } @@ -726,19 +737,30 @@ static void drawing_area_setup(GtkFrontend *inst, int width, int height) new_scale = 1; #endif - int new_backing_w = w * inst->font_width + 2*inst->window_border; - int new_backing_h = h * inst->font_height + 2*inst->window_border; - new_backing_w *= new_scale; - new_backing_h *= new_scale; + int new_backing_w = width * new_scale; + int new_backing_h = height * new_scale; if (inst->backing_w != new_backing_w || inst->backing_h != new_backing_h) inst->drawing_area_setup_needed = true; /* - * This event might be spurious; some GTK setups have been known - * to call it when nothing at all has changed. Check if we have - * any reason to proceed. + * GTK will sometimes send us configure events when nothing about + * the window size has actually changed. In some situations this + * can happen quite often, so it's a worthwhile optimisation to + * detect that situation and avoid the expensive reinitialisation + * of the backing surface / image, and so on. + * + * However, we must still communicate to the terminal that we + * received a resize event, because sometimes a trivial resize + * event (to the same size we already were) is a signal from the + * window system that a _nontrivial_ resize we recently asked for + * has failed to happen. */ + + inst->drawing_area_setup_called = true; + if (inst->term) + term_size(inst->term, h, w, conf_get_int(inst->conf, CONF_savelines)); + if (!inst->drawing_area_setup_needed) return; @@ -769,10 +791,6 @@ static void drawing_area_setup(GtkFrontend *inst, int width, int height) draw_backing_rect(inst); - if (need_size && inst->term) { - term_size(inst->term, h, w, conf_get_int(inst->conf, CONF_savelines)); - } - if (inst->term) term_invalidate(inst->term); @@ -799,6 +817,14 @@ static void drawing_area_setup_simple(GtkFrontend *inst) drawing_area_setup(inst, alloc.width, alloc.height); } +static void drawing_area_setup_cb(void *vctx) +{ + GtkFrontend *inst = (GtkFrontend *)vctx; + + if (!inst->drawing_area_setup_called) + drawing_area_setup_simple(inst); +} + static void area_realised(GtkWidget *widget, GtkFrontend *inst) { inst->drawing_area_realised = true; @@ -837,6 +863,10 @@ static gboolean window_configured( term_notify_window_pos(inst->term, event->x, event->y); term_notify_window_size_pixels( inst->term, event->width, event->height); + if (inst->drawing_area_realised && inst->drawing_area_got_size) { + inst->drawing_area_setup_called = false; + queue_toplevel_callback(drawing_area_setup_cb, inst); + } } return false; } @@ -1804,6 +1834,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) switch (event->keyval) { int fkey_number; + bool consumed_meta_key; + case GDK_KEY_F1: fkey_number = 1; goto numbered_function_key; case GDK_KEY_F2: fkey_number = 2; goto numbered_function_key; case GDK_KEY_F3: fkey_number = 3; goto numbered_function_key; @@ -1825,9 +1857,14 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) case GDK_KEY_F19: fkey_number = 19; goto numbered_function_key; case GDK_KEY_F20: fkey_number = 20; goto numbered_function_key; numbered_function_key: + consumed_meta_key = false; end = 1 + format_function_key(output+1, inst->term, fkey_number, event->state & GDK_SHIFT_MASK, - event->state & GDK_CONTROL_MASK); + event->state & GDK_CONTROL_MASK, + event->state & inst->meta_mod_mask, + &consumed_meta_key); + if (consumed_meta_key) + start = 1; /* supersedes the usual prefixing of Esc */ #ifdef KEY_EVENT_DIAGNOSTICS debug(" - function key F%d", fkey_number); #endif @@ -1871,8 +1908,14 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) case GDK_KEY_Begin: case GDK_KEY_KP_Begin: xkey = 'G'; goto arrow_key; arrow_key: + consumed_meta_key = false; end = 1 + format_arrow_key(output+1, inst->term, xkey, - event->state & GDK_CONTROL_MASK); + event->state & GDK_SHIFT_MASK, + event->state & GDK_CONTROL_MASK, + event->state & inst->meta_mod_mask, + &consumed_meta_key); + if (consumed_meta_key) + start = 1; /* supersedes the usual prefixing of Esc */ #ifdef KEY_EVENT_DIAGNOSTICS debug(" - arrow key"); #endif @@ -2120,6 +2163,8 @@ static gboolean button_internal(GtkFrontend *inst, GdkEventButton *event) } if (event->button == 3 && ctrl) { + /* Just in case this happened in mid-select */ + term_cancel_selection_drag(inst->term); #if GTK_CHECK_VERSION(3,22,0) gtk_menu_popup_at_pointer(GTK_MENU(inst->menu), (GdkEvent *)event); #else @@ -2430,10 +2475,62 @@ static void compute_whole_window_size(GtkFrontend *inst, int *wpix, int *hpix); #endif +static void gtkwin_deny_term_resize(void *vctx) +{ + GtkFrontend *inst = (GtkFrontend *)vctx; + drawing_area_setup_simple(inst); +} + static void gtkwin_request_resize(TermWin *tw, int w, int h) { GtkFrontend *inst = container_of(tw, GtkFrontend, termwin); +#if GTK_CHECK_VERSION(2,0,0) + /* + * Initial check: don't even try to resize a window if it's in one + * of the states that make that impossible. This includes being + * maximised; being full-screen (if we ever implement that); or + * being in various tiled states. + * + * On X11, the effect of trying to resize the window when it can't + * be resized should be that the window manager sends us a + * synthetic ConfigureNotify event restating our existing size + * (ICCCM section 4.1.5 "Configuring the Window"). That's awkward + * to deal with, but not impossible; so for X11 alone, we might + * not bother with this check. + * + * (In any case, X11 has other reasons why a window resize might + * be rejected, which this enumeration can't be aware of in any + * case. For example, if your window manager is a tiling one, then + * all your windows are _de facto_ tiled, but not _de jure_ in a + * way that GDK will know about. So we have to handle those + * synthetic ConfigureNotifies in any case.) + * + * On Wayland, as of GTK 3.24.20, the effects are much worse: it + * looks to me as if GTK stops ever sending us "draw" events, or + * even a size_allocate, so the display locks up completely until + * you toggle the maximised state of the window by some other + * means. So it's worth checking! + */ + GdkWindow *gdkwin = gtk_widget_get_window(inst->window); + if (gdkwin) { + GdkWindowState state = gdk_window_get_state(gdkwin); + if (state & (GDK_WINDOW_STATE_MAXIMIZED | + GDK_WINDOW_STATE_FULLSCREEN | +#if GTK_CHECK_VERSION(3,0,0) + GDK_WINDOW_STATE_TILED | + GDK_WINDOW_STATE_TOP_TILED | + GDK_WINDOW_STATE_RIGHT_TILED | + GDK_WINDOW_STATE_BOTTOM_TILED | + GDK_WINDOW_STATE_LEFT_TILED | +#endif + 0)) { + queue_toplevel_callback(gtkwin_deny_term_resize, inst); + return; + } + } +#endif + #if !GTK_CHECK_VERSION(3,0,0) int large_x, large_y; @@ -3096,7 +3193,7 @@ static void selection_received(GtkWidget *widget, GtkSelectionData *seldata, text = retrieve_cutbuffer(inst, &length); if (length == 0) return; - /* Xterm is rumoured to expect Latin-1, though I havn't checked the + /* Xterm is rumoured to expect Latin-1, though I haven't checked the * source, so use that as a de-facto standard. */ charset = CS_ISO8859_1; free_required = true; @@ -3244,19 +3341,31 @@ static void set_window_titles(GtkFrontend *inst) inst->icontitle); } -static void gtkwin_set_title(TermWin *tw, const char *title) +static void gtkwin_set_title(TermWin *tw, const char *title, int codepage) { GtkFrontend *inst = container_of(tw, GtkFrontend, termwin); sfree(inst->wintitle); - inst->wintitle = dupstr(title); + if (codepage != CP_UTF8) { + wchar_t *title_w = dup_mb_to_wc(codepage, 0, title); + inst->wintitle = encode_wide_string_as_utf8(title_w); + sfree(title_w); + } else { + inst->wintitle = dupstr(title); + } set_window_titles(inst); } -static void gtkwin_set_icon_title(TermWin *tw, const char *title) +static void gtkwin_set_icon_title(TermWin *tw, const char *title, int codepage) { GtkFrontend *inst = container_of(tw, GtkFrontend, termwin); sfree(inst->icontitle); - inst->icontitle = dupstr(title); + if (codepage != CP_UTF8) { + wchar_t *title_w = dup_mb_to_wc(codepage, 0, title); + inst->icontitle = encode_wide_string_as_utf8(title_w); + sfree(title_w); + } else { + inst->icontitle = dupstr(title); + } set_window_titles(inst); } @@ -3646,16 +3755,12 @@ static void draw_stretch_after(GtkFrontend *inst, int x, int y, static void draw_backing_rect(GtkFrontend *inst) { - int w, h; - if (!win_setup_draw_ctx(&inst->termwin)) return; - w = inst->width * inst->font_width + 2*inst->window_border; - h = inst->height * inst->font_height + 2*inst->window_border; draw_set_colour(inst, 258, false); - draw_rectangle(inst, true, 0, 0, w, h); - draw_update(inst, 0, 0, w, h); + draw_rectangle(inst, true, 0, 0, inst->backing_w, inst->backing_h); + draw_update(inst, 0, 0, inst->backing_w, inst->backing_h); win_free_draw_ctx(&inst->termwin); } @@ -4333,7 +4438,7 @@ static void compute_geom_hints(GtkFrontend *inst, GdkGeometry *geom) #if GTK_CHECK_VERSION(3,0,0) /* - * And if we're running a gtkapp.c based program and + * And if we're running a main-gtk-application.c based program and * GtkApplicationWindow has given us a menu bar inside the window, * then we must take that into account as well. * @@ -4378,6 +4483,35 @@ static void compute_geom_hints(GtkFrontend *inst, GdkGeometry *geom) void set_geom_hints(GtkFrontend *inst) { + /* + * 2021-12-20: I've found that on Ubuntu 20.04 Wayland (using GTK + * 3.24.20), setting geometry hints causes the window size to come + * out wrong. As far as I can tell, that's because the GDK Wayland + * backend internally considers windows to be a lot larger than + * their obvious display size (*even* considering visible window + * furniture like title bars), with an extra margin on every side + * to account for surrounding effects like shadows. And the + * geometry hints like base size and resize increment are applied + * to that larger size rather than the more obvious 'client area' + * size. So when we ask for a window of exactly the size we want, + * it gets modified by GDK based on the geometry hints, but + * applying this extra margin, which causes the size to be a + * little bit too small. + * + * I don't know how you can sensibly find out the size of that + * margin. If I did, I could account for it in the geometry hints. + * But I also see that gtk_window_set_geometry_hints is removed in + * GTK 4, which suggests that probably doing a lot of hard work to + * fix this is not the way forward. + * + * So instead, I simply avoid setting geometry hints at all on any + * GDK backend other than X11, and hopefully that's a workaround. + */ +#if GTK_CHECK_VERSION(3,0,0) && !defined NOT_X_WINDOWS + if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) + return; +#endif + const struct BackendVtable *vt; GdkGeometry geom; gint flags = GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | GDK_HINT_RESIZE_INC; @@ -4390,8 +4524,8 @@ void set_geom_hints(GtkFrontend *inst) if (vt && vt->flags & BACKEND_RESIZE_FORBIDDEN) { /* Window resizing forbidden. Set both minimum and maximum * dimensions to be the initial size. */ - geom.min_width = inst->width*inst->font_width + 2*inst->window_border; - geom.min_height = inst->height*inst->font_height + 2*inst->window_border; + geom.min_width = geom.base_width + geom.width_inc * inst->width; + geom.min_height = geom.base_height + geom.height_inc * inst->height; geom.max_width = geom.min_width; geom.max_height = geom.min_height; flags |= GDK_HINT_MAX_SIZE; @@ -4972,6 +5106,8 @@ static void start_backend(GtkFrontend *inst) const struct BackendVtable *vt; char *error, *realhost; + inst->cmdline_get_passwd_state = cmdline_get_passwd_input_state_new; + vt = select_backend(inst->conf); seat_set_trust_status(&inst->seat, true); @@ -5053,6 +5189,7 @@ static const TermWinVtable gtk_termwin_vt = { .set_zorder = gtkwin_set_zorder, .palette_set = gtkwin_palette_set, .palette_get_overrides = gtkwin_palette_get_overrides, + .unthrottle = gtkwin_unthrottle, }; void new_session_window(Conf *conf, const char *geometry_string) @@ -5161,6 +5298,14 @@ void new_session_window(Conf *conf, const char *geometry_string) } } +#if GTK_CHECK_VERSION(2,0,0) + { + const BackendVtable *vt = select_backend(inst->conf); + if (vt && vt->flags & BACKEND_RESIZE_FORBIDDEN) + gtk_window_set_resizable(GTK_WINDOW(inst->window), false); + } +#endif + inst->width = conf_get_int(inst->conf, CONF_width); inst->height = conf_get_int(inst->conf, CONF_height); cache_conf_values(inst); @@ -5413,10 +5558,14 @@ void new_session_window(Conf *conf, const char *geometry_string) ldisc_echoedit_update(inst->ldisc); /* cause ldisc to notice changes */ } -static bool gtk_seat_set_trust_status(Seat *seat, bool trusted) +static void gtk_seat_set_trust_status(Seat *seat, bool trusted) { GtkFrontend *inst = container_of(seat, GtkFrontend, seat); term_set_trust_status(inst->term, trusted); +} + +static bool gtk_seat_can_set_trust_status(Seat *seat) +{ return true; } diff --git a/code/unix/ux_x11.c b/code/unix/x11.c similarity index 87% rename from code/unix/ux_x11.c rename to code/unix/x11.c index 7a0c221..710ff84 100644 --- a/code/unix/ux_x11.c +++ b/code/unix/x11.c @@ -1,5 +1,5 @@ /* - * ux_x11.c: fetch local auth data for X forwarding. + * x11.c: fetch local auth data for X forwarding. */ #include @@ -88,7 +88,20 @@ int platform_make_x11_server(Plug *plug, const char *progname, int mindisp, sk_close(sockets[nsockets]); } - if (!strcmp(err, strerror(EADDRINUSE))) /* yuck! */ + /* + * If we weren't able to bind to this port because it's in use + * by another program, go round this loop and try again. But + * for any other reason, give up completely and return failure + * to our caller. + * + * sk_socket_error currently has no machine-readable component + * (it would need a cross-platform abstraction of the socket + * error types we care about, plus translation from each OS + * error enumeration into that). So we use the disgusting + * approach of a string compare between the error string and + * the one EADDRINUSE would have given :-( + */ + if (strcmp(err, strerror(EADDRINUSE))) goto out; } diff --git a/code/unix/x11misc.h b/code/unix/x11misc.h index 159d422..5f5a2d2 100644 --- a/code/unix/x11misc.h +++ b/code/unix/x11misc.h @@ -7,14 +7,8 @@ #ifndef NOT_X_WINDOWS -/* - * x11misc.c. - */ +/* Defined in unix/utils */ void x11_ignore_error(Display *disp, unsigned char errcode); - -/* - * gtkmisc.c - */ Display *get_x11_display(void); #endif diff --git a/code/utils.c b/code/utils.c deleted file mode 100644 index 30b326e..0000000 --- a/code/utils.c +++ /dev/null @@ -1,1122 +0,0 @@ -/* - * Platform-independent utility routines used throughout this code base. - * - * This file is linked into stand-alone test utilities which only want - * to include the things they really need, so functions in here should - * avoid depending on any functions outside it. Utility routines that - * are more tightly integrated into the main code should live in - * misc.c. - */ - -#include -#include -#include -#include -#include -#include - -#include "defs.h" -#include "misc.h" -#include "ssh.h" - -/* - * Parse a string block size specification. This is approximately a - * subset of the block size specs supported by GNU fileutils: - * "nk" = n kilobytes - * "nM" = n megabytes - * "nG" = n gigabytes - * All numbers are decimal, and suffixes refer to powers of two. - * Case-insensitive. - */ -unsigned long parse_blocksize(const char *bs) -{ - char *suf; - unsigned long r = strtoul(bs, &suf, 10); - if (*suf != '\0') { - while (*suf && isspace((unsigned char)*suf)) suf++; - switch (*suf) { - case 'k': case 'K': - r *= 1024ul; - break; - case 'm': case 'M': - r *= 1024ul * 1024ul; - break; - case 'g': case 'G': - r *= 1024ul * 1024ul * 1024ul; - break; - case '\0': - default: - break; - } - } - return r; -} - -/* - * Parse a ^C style character specification. - * Returns NULL in `next' if we didn't recognise it as a control character, - * in which case `c' should be ignored. - * The precise current parsing is an oddity inherited from the terminal - * answerback-string parsing code. All sequences start with ^; all except - * ^<123> are two characters. The ones that are worth keeping are probably: - * ^? 127 - * ^@A-Z[\]^_ 0-31 - * a-z 1-26 - * specified by number (decimal, 0octal, 0xHEX) - * ~ ^ escape - */ -char ctrlparse(char *s, char **next) -{ - char c = 0; - if (*s != '^') { - *next = NULL; - } else { - s++; - if (*s == '\0') { - *next = NULL; - } else if (*s == '<') { - s++; - c = (char)strtol(s, next, 0); - if ((*next == s) || (**next != '>')) { - c = 0; - *next = NULL; - } else - (*next)++; - } else if (*s >= 'a' && *s <= 'z') { - c = (*s - ('a' - 1)); - *next = s+1; - } else if ((*s >= '@' && *s <= '_') || *s == '?' || (*s & 0x80)) { - c = ('@' ^ *s); - *next = s+1; - } else if (*s == '~') { - c = '^'; - *next = s+1; - } - } - return c; -} - -/* - * Find a character in a string, unless it's a colon contained within - * square brackets. Used for untangling strings of the form - * 'host:port', where host can be an IPv6 literal. - * - * We provide several variants of this function, with semantics like - * various standard string.h functions. - */ -static const char *host_strchr_internal(const char *s, const char *set, - bool first) -{ - int brackets = 0; - const char *ret = NULL; - - while (1) { - if (!*s) - return ret; - - if (*s == '[') - brackets++; - else if (*s == ']' && brackets > 0) - brackets--; - else if (brackets && *s == ':') - /* never match */ ; - else if (strchr(set, *s)) { - ret = s; - if (first) - return ret; - } - - s++; - } -} -size_t host_strcspn(const char *s, const char *set) -{ - const char *answer = host_strchr_internal(s, set, true); - if (answer) - return answer - s; - else - return strlen(s); -} -char *host_strchr(const char *s, int c) -{ - char set[2]; - set[0] = c; - set[1] = '\0'; - return (char *) host_strchr_internal(s, set, true); -} -char *host_strrchr(const char *s, int c) -{ - char set[2]; - set[0] = c; - set[1] = '\0'; - return (char *) host_strchr_internal(s, set, false); -} - -#ifdef TEST_HOST_STRFOO -int main(void) -{ - int passes = 0, fails = 0; - -#define TEST1(func, string, arg2, suffix, result) do \ - { \ - const char *str = string; \ - unsigned ret = func(string, arg2) suffix; \ - if (ret == result) { \ - passes++; \ - } else { \ - printf("fail: %s(%s,%s)%s = %u, expected %u\n", \ - #func, #string, #arg2, #suffix, ret, \ - (unsigned)result); \ - fails++; \ - } \ -} while (0) - - TEST1(host_strchr, "[1:2:3]:4:5", ':', -str, 7); - TEST1(host_strrchr, "[1:2:3]:4:5", ':', -str, 9); - TEST1(host_strcspn, "[1:2:3]:4:5", "/:",, 7); - TEST1(host_strchr, "[1:2:3]", ':', == NULL, 1); - TEST1(host_strrchr, "[1:2:3]", ':', == NULL, 1); - TEST1(host_strcspn, "[1:2:3]", "/:",, 7); - TEST1(host_strcspn, "[1:2/3]", "/:",, 4); - TEST1(host_strcspn, "[1:2:3]/", "/:",, 7); - - printf("passed %d failed %d total %d\n", passes, fails, passes+fails); - return fails != 0 ? 1 : 0; -} - -/* Stubs to stop the rest of this module causing compile failures. */ -static NORETURN void fatal_error(const char *p, ...) -{ - va_list ap; - fprintf(stderr, "host_string_test: "); - va_start(ap, p); - vfprintf(stderr, p, ap); - va_end(ap); - fputc('\n', stderr); - exit(1); -} - -void out_of_memory(void) { fatal_error("out of memory"); } - -#endif /* TEST_HOST_STRFOO */ - -/* - * Trim square brackets off the outside of an IPv6 address literal. - * Leave all other strings unchanged. Returns a fresh dynamically - * allocated string. - */ -char *host_strduptrim(const char *s) -{ - if (s[0] == '[') { - const char *p = s+1; - int colons = 0; - while (*p && *p != ']') { - if (isxdigit((unsigned char)*p)) - /* OK */; - else if (*p == ':') - colons++; - else - break; - p++; - } - if (*p == '%') { - /* - * This delimiter character introduces an RFC 4007 scope - * id suffix (e.g. suffixing the address literal with - * %eth1 or %2 or some such). There's no syntax - * specification for the scope id, so just accept anything - * except the closing ]. - */ - p += strcspn(p, "]"); - } - if (*p == ']' && !p[1] && colons > 1) { - /* - * This looks like an IPv6 address literal (hex digits and - * at least two colons, plus optional scope id, contained - * in square brackets). Trim off the brackets. - */ - return dupprintf("%.*s", (int)(p - (s+1)), s+1); - } - } - - /* - * Any other shape of string is simply duplicated. - */ - return dupstr(s); -} - -/* ---------------------------------------------------------------------- - * String handling routines. - */ - -char *dupstr(const char *s) -{ - char *p = NULL; - if (s) { - int len = strlen(s); - p = snewn(len + 1, char); - strcpy(p, s); - } - return p; -} - -/* Allocate the concatenation of N strings. Terminate arg list with NULL. */ -char *dupcat_fn(const char *s1, ...) -{ - int len; - char *p, *q, *sn; - va_list ap; - - len = strlen(s1); - va_start(ap, s1); - while (1) { - sn = va_arg(ap, char *); - if (!sn) - break; - len += strlen(sn); - } - va_end(ap); - - p = snewn(len + 1, char); - strcpy(p, s1); - q = p + strlen(p); - - va_start(ap, s1); - while (1) { - sn = va_arg(ap, char *); - if (!sn) - break; - strcpy(q, sn); - q += strlen(q); - } - va_end(ap); - - return p; -} - -void burnstr(char *string) /* sfree(str), only clear it first */ -{ - if (string) { - smemclr(string, strlen(string)); - sfree(string); - } -} - -int string_length_for_printf(size_t s) -{ - /* Truncate absurdly long strings (should one show up) to fit - * within a positive 'int', which is what the "%.*s" format will - * expect. */ - if (s > INT_MAX) - return INT_MAX; - return s; -} - -/* Work around lack of va_copy in old MSC */ -#if defined _MSC_VER && !defined va_copy -#define va_copy(a, b) TYPECHECK( \ - (va_list *)0 == &(a) && (va_list *)0 == &(b), \ - memcpy(&a, &b, sizeof(va_list))) -#endif - -/* Also lack of vsnprintf before VS2015 */ -#if defined _WINDOWS && \ - !defined __MINGW32__ && \ - !defined __WINE__ && \ - _MSC_VER < 1900 -#define vsnprintf _vsnprintf -#endif - -/* - * Do an sprintf(), but into a custom-allocated buffer. - * - * Currently I'm doing this via vsnprintf. This has worked so far, - * but it's not good, because vsnprintf is not available on all - * platforms. There's an ifdef to use `_vsnprintf', which seems - * to be the local name for it on Windows. Other platforms may - * lack it completely, in which case it'll be time to rewrite - * this function in a totally different way. - * - * The only `properly' portable solution I can think of is to - * implement my own format string scanner, which figures out an - * upper bound for the length of each formatting directive, - * allocates the buffer as it goes along, and calls sprintf() to - * actually process each directive. If I ever need to actually do - * this, some caveats: - * - * - It's very hard to find a reliable upper bound for - * floating-point values. %f, in particular, when supplied with - * a number near to the upper or lower limit of representable - * numbers, could easily take several hundred characters. It's - * probably feasible to predict this statically using the - * constants in , or even to predict it dynamically by - * looking at the exponent of the specific float provided, but - * it won't be fun. - * - * - Don't forget to _check_, after calling sprintf, that it's - * used at most the amount of space we had available. - * - * - Fault any formatting directive we don't fully understand. The - * aim here is to _guarantee_ that we never overflow the buffer, - * because this is a security-critical function. If we see a - * directive we don't know about, we should panic and die rather - * than run any risk. - */ -static char *dupvprintf_inner(char *buf, size_t oldlen, size_t *sizeptr, - const char *fmt, va_list ap) -{ - size_t size = *sizeptr; - sgrowarrayn_nm(buf, size, oldlen, 512); - - while (1) { - va_list aq; - va_copy(aq, ap); - int len = vsnprintf(buf + oldlen, size - oldlen, fmt, aq); - va_end(aq); - - if (len >= 0 && len < size) { - /* This is the C99-specified criterion for snprintf to have - * been completely successful. */ - *sizeptr = size; - return buf; - } else if (len > 0) { - /* This is the C99 error condition: the returned length is - * the required buffer size not counting the NUL. */ - sgrowarrayn_nm(buf, size, oldlen + 1, len); - } else { - /* This is the pre-C99 glibc error condition: <0 means the - * buffer wasn't big enough, so we enlarge it a bit and hope. */ - sgrowarray_nm(buf, size, size); - } - } -} - -char *dupvprintf(const char *fmt, va_list ap) -{ - size_t size = 0; - return dupvprintf_inner(NULL, 0, &size, fmt, ap); -} -char *dupprintf(const char *fmt, ...) -{ - char *ret; - va_list ap; - va_start(ap, fmt); - ret = dupvprintf(fmt, ap); - va_end(ap); - return ret; -} - -struct strbuf_impl { - size_t size; - struct strbuf visible; - bool nm; /* true if we insist on non-moving buffer resizes */ -}; - -#define STRBUF_SET_UPTR(buf) \ - ((buf)->visible.u = (unsigned char *)(buf)->visible.s) -#define STRBUF_SET_PTR(buf, ptr) \ - ((buf)->visible.s = (ptr), STRBUF_SET_UPTR(buf)) - -void *strbuf_append(strbuf *buf_o, size_t len) -{ - struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); - char *toret; - sgrowarray_general( - buf->visible.s, buf->size, buf->visible.len + 1, len, buf->nm); - STRBUF_SET_UPTR(buf); - toret = buf->visible.s + buf->visible.len; - buf->visible.len += len; - buf->visible.s[buf->visible.len] = '\0'; - return toret; -} - -void strbuf_shrink_to(strbuf *buf, size_t new_len) -{ - assert(new_len <= buf->len); - buf->len = new_len; - buf->s[buf->len] = '\0'; -} - -void strbuf_shrink_by(strbuf *buf, size_t amount_to_remove) -{ - assert(amount_to_remove <= buf->len); - buf->len -= amount_to_remove; - buf->s[buf->len] = '\0'; -} - -bool strbuf_chomp(strbuf *buf, char char_to_remove) -{ - if (buf->len > 0 && buf->s[buf->len-1] == char_to_remove) { - strbuf_shrink_by(buf, 1); - return true; - } - return false; -} - -static void strbuf_BinarySink_write( - BinarySink *bs, const void *data, size_t len) -{ - strbuf *buf_o = BinarySink_DOWNCAST(bs, strbuf); - memcpy(strbuf_append(buf_o, len), data, len); -} - -static strbuf *strbuf_new_general(bool nm) -{ - struct strbuf_impl *buf = snew(struct strbuf_impl); - BinarySink_INIT(&buf->visible, strbuf_BinarySink_write); - buf->visible.len = 0; - buf->size = 512; - buf->nm = nm; - STRBUF_SET_PTR(buf, snewn(buf->size, char)); - *buf->visible.s = '\0'; - return &buf->visible; -} -strbuf *strbuf_new(void) { return strbuf_new_general(false); } -strbuf *strbuf_new_nm(void) { return strbuf_new_general(true); } -void strbuf_free(strbuf *buf_o) -{ - struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); - if (buf->visible.s) { - smemclr(buf->visible.s, buf->size); - sfree(buf->visible.s); - } - sfree(buf); -} -char *strbuf_to_str(strbuf *buf_o) -{ - struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); - char *ret = buf->visible.s; - sfree(buf); - return ret; -} -void strbuf_catfv(strbuf *buf_o, const char *fmt, va_list ap) -{ - struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); - STRBUF_SET_PTR(buf, dupvprintf_inner(buf->visible.s, buf->visible.len, - &buf->size, fmt, ap)); - buf->visible.len += strlen(buf->visible.s + buf->visible.len); -} -void strbuf_catf(strbuf *buf_o, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - strbuf_catfv(buf_o, fmt, ap); - va_end(ap); -} - -strbuf *strbuf_new_for_agent_query(void) -{ - strbuf *buf = strbuf_new(); - strbuf_append(buf, 4); - return buf; -} -void strbuf_finalise_agent_query(strbuf *buf_o) -{ - struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); - assert(buf->visible.len >= 5); - PUT_32BIT_MSB_FIRST(buf->visible.u, buf->visible.len - 4); -} - -/* - * Read an entire line of text from a file. Return a buffer - * malloced to be as big as necessary (caller must free). - */ -char *fgetline(FILE *fp) -{ - char *ret = snewn(512, char); - size_t size = 512, len = 0; - while (fgets(ret + len, size - len, fp)) { - len += strlen(ret + len); - if (len > 0 && ret[len-1] == '\n') - break; /* got a newline, we're done */ - sgrowarrayn_nm(ret, size, len, 512); - } - if (len == 0) { /* first fgets returned NULL */ - sfree(ret); - return NULL; - } - ret[len] = '\0'; - return ret; -} - -/* - * Read an entire file into a BinarySink. - */ -bool read_file_into(BinarySink *bs, FILE *fp) -{ - char buf[4096]; - while (1) { - size_t retd = fread(buf, 1, sizeof(buf), fp); - if (retd == 0) - return !ferror(fp); - put_data(bs, buf, retd); - } -} - -/* - * Perl-style 'chomp', for a line we just read with fgetline. Unlike - * Perl chomp, however, we're deliberately forgiving of strange - * line-ending conventions. Also we forgive NULL on input, so you can - * just write 'line = chomp(fgetline(fp));' and not bother checking - * for NULL until afterwards. - */ -char *chomp(char *str) -{ - if (str) { - int len = strlen(str); - while (len > 0 && (str[len-1] == '\r' || str[len-1] == '\n')) - len--; - str[len] = '\0'; - } - return str; -} - -/* ---------------------------------------------------------------------- - * Core base64 encoding and decoding routines. - */ - -void base64_encode_atom(const unsigned char *data, int n, char *out) -{ - static const char base64_chars[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - unsigned word; - - word = data[0] << 16; - if (n > 1) - word |= data[1] << 8; - if (n > 2) - word |= data[2]; - out[0] = base64_chars[(word >> 18) & 0x3F]; - out[1] = base64_chars[(word >> 12) & 0x3F]; - if (n > 1) - out[2] = base64_chars[(word >> 6) & 0x3F]; - else - out[2] = '='; - if (n > 2) - out[3] = base64_chars[word & 0x3F]; - else - out[3] = '='; -} - -int base64_decode_atom(const char *atom, unsigned char *out) -{ - int vals[4]; - int i, v, len; - unsigned word; - char c; - - for (i = 0; i < 4; i++) { - c = atom[i]; - if (c >= 'A' && c <= 'Z') - v = c - 'A'; - else if (c >= 'a' && c <= 'z') - v = c - 'a' + 26; - else if (c >= '0' && c <= '9') - v = c - '0' + 52; - else if (c == '+') - v = 62; - else if (c == '/') - v = 63; - else if (c == '=') - v = -1; - else - return 0; /* invalid atom */ - vals[i] = v; - } - - if (vals[0] == -1 || vals[1] == -1) - return 0; - if (vals[2] == -1 && vals[3] != -1) - return 0; - - if (vals[3] != -1) - len = 3; - else if (vals[2] != -1) - len = 2; - else - len = 1; - - word = ((vals[0] << 18) | - (vals[1] << 12) | ((vals[2] & 0x3F) << 6) | (vals[3] & 0x3F)); - out[0] = (word >> 16) & 0xFF; - if (len > 1) - out[1] = (word >> 8) & 0xFF; - if (len > 2) - out[2] = word & 0xFF; - return len; -} - -/* ---------------------------------------------------------------------- - * Generic routines to deal with send buffers: a linked list of - * smallish blocks, with the operations - * - * - add an arbitrary amount of data to the end of the list - * - remove the first N bytes from the list - * - return a (pointer,length) pair giving some initial data in - * the list, suitable for passing to a send or write system - * call - * - retrieve a larger amount of initial data from the list - * - return the current size of the buffer chain in bytes - */ - -#define BUFFER_MIN_GRANULE 512 - -struct bufchain_granule { - struct bufchain_granule *next; - char *bufpos, *bufend, *bufmax; -}; - -static void uninitialised_queue_idempotent_callback(IdempotentCallback *ic) -{ - unreachable("bufchain callback used while uninitialised"); -} - -void bufchain_init(bufchain *ch) -{ - ch->head = ch->tail = NULL; - ch->buffersize = 0; - ch->ic = NULL; - ch->queue_idempotent_callback = uninitialised_queue_idempotent_callback; -} - -void bufchain_clear(bufchain *ch) -{ - struct bufchain_granule *b; - while (ch->head) { - b = ch->head; - ch->head = ch->head->next; - smemclr(b, sizeof(*b)); - sfree(b); - } - ch->tail = NULL; - ch->buffersize = 0; -} - -size_t bufchain_size(bufchain *ch) -{ - return ch->buffersize; -} - -void bufchain_set_callback_inner( - bufchain *ch, IdempotentCallback *ic, - void (*queue_idempotent_callback)(IdempotentCallback *ic)) -{ - ch->queue_idempotent_callback = queue_idempotent_callback; - ch->ic = ic; -} - -void bufchain_add(bufchain *ch, const void *data, size_t len) -{ - const char *buf = (const char *)data; - - if (len == 0) return; - - ch->buffersize += len; - - while (len > 0) { - if (ch->tail && ch->tail->bufend < ch->tail->bufmax) { - size_t copylen = min(len, ch->tail->bufmax - ch->tail->bufend); - memcpy(ch->tail->bufend, buf, copylen); - buf += copylen; - len -= copylen; - ch->tail->bufend += copylen; - } - if (len > 0) { - size_t grainlen = - max(sizeof(struct bufchain_granule) + len, BUFFER_MIN_GRANULE); - struct bufchain_granule *newbuf; - newbuf = smalloc(grainlen); - newbuf->bufpos = newbuf->bufend = - (char *)newbuf + sizeof(struct bufchain_granule); - newbuf->bufmax = (char *)newbuf + grainlen; - newbuf->next = NULL; - if (ch->tail) - ch->tail->next = newbuf; - else - ch->head = newbuf; - ch->tail = newbuf; - } - } - - if (ch->ic) - ch->queue_idempotent_callback(ch->ic); -} - -void bufchain_consume(bufchain *ch, size_t len) -{ - struct bufchain_granule *tmp; - - assert(ch->buffersize >= len); - while (len > 0) { - int remlen = len; - assert(ch->head != NULL); - if (remlen >= ch->head->bufend - ch->head->bufpos) { - remlen = ch->head->bufend - ch->head->bufpos; - tmp = ch->head; - ch->head = tmp->next; - if (!ch->head) - ch->tail = NULL; - smemclr(tmp, sizeof(*tmp)); - sfree(tmp); - } else - ch->head->bufpos += remlen; - ch->buffersize -= remlen; - len -= remlen; - } -} - -ptrlen bufchain_prefix(bufchain *ch) -{ - return make_ptrlen(ch->head->bufpos, ch->head->bufend - ch->head->bufpos); -} - -void bufchain_fetch(bufchain *ch, void *data, size_t len) -{ - struct bufchain_granule *tmp; - char *data_c = (char *)data; - - tmp = ch->head; - - assert(ch->buffersize >= len); - while (len > 0) { - int remlen = len; - - assert(tmp != NULL); - if (remlen >= tmp->bufend - tmp->bufpos) - remlen = tmp->bufend - tmp->bufpos; - memcpy(data_c, tmp->bufpos, remlen); - - tmp = tmp->next; - len -= remlen; - data_c += remlen; - } -} - -void bufchain_fetch_consume(bufchain *ch, void *data, size_t len) -{ - bufchain_fetch(ch, data, len); - bufchain_consume(ch, len); -} - -bool bufchain_try_fetch_consume(bufchain *ch, void *data, size_t len) -{ - if (ch->buffersize >= len) { - bufchain_fetch_consume(ch, data, len); - return true; - } else { - return false; - } -} - -size_t bufchain_fetch_consume_up_to(bufchain *ch, void *data, size_t len) -{ - if (len > ch->buffersize) - len = ch->buffersize; - if (len) - bufchain_fetch_consume(ch, data, len); - return len; -} - -/* ---------------------------------------------------------------------- - * Debugging routines. - */ - -#ifdef DEBUG -extern void dputs(const char *); /* defined in per-platform *misc.c */ - -void debug_printf(const char *fmt, ...) -{ - char *buf; - va_list ap; - - va_start(ap, fmt); - buf = dupvprintf(fmt, ap); - dputs(buf); - sfree(buf); - va_end(ap); -} - -void debug_memdump(const void *buf, int len, bool L) -{ - int i; - const unsigned char *p = buf; - char foo[17]; - if (L) { - int delta; - debug_printf("\t%d (0x%x) bytes:\n", len, len); - delta = 15 & (uintptr_t)p; - p -= delta; - len += delta; - } - for (; 0 < len; p += 16, len -= 16) { - dputs(" "); - if (L) - debug_printf("%p: ", p); - strcpy(foo, "................"); /* sixteen dots */ - for (i = 0; i < 16 && i < len; ++i) { - if (&p[i] < (unsigned char *) buf) { - dputs(" "); /* 3 spaces */ - foo[i] = ' '; - } else { - debug_printf("%c%2.2x", - &p[i] != (unsigned char *) buf - && i % 4 ? '.' : ' ', p[i] - ); - if (p[i] >= ' ' && p[i] <= '~') - foo[i] = (char) p[i]; - } - } - foo[i] = '\0'; - debug_printf("%*s%s\n", (16 - i) * 3 + 2, "", foo); - } -} - -#endif /* def DEBUG */ - -#ifndef PLATFORM_HAS_SMEMCLR -/* - * Securely wipe memory. - * - * The actual wiping is no different from what memset would do: the - * point of 'securely' is to try to be sure over-clever compilers - * won't optimise away memsets on variables that are about to be freed - * or go out of scope. See - * https://buildsecurityin.us-cert.gov/bsi-rules/home/g1/771-BSI.html - * - * Some platforms (e.g. Windows) may provide their own version of this - * function. - */ -void smemclr(void *b, size_t n) { - volatile char *vp; - - if (b && n > 0) { - /* - * Zero out the memory. - */ - memset(b, 0, n); - - /* - * Perform a volatile access to the object, forcing the - * compiler to admit that the previous memset was important. - * - * This while loop should in practice run for zero iterations - * (since we know we just zeroed the object out), but in - * theory (as far as the compiler knows) it might range over - * the whole object. (If we had just written, say, '*vp = - * *vp;', a compiler could in principle have 'helpfully' - * optimised the memset into only zeroing out the first byte. - * This should be robust.) - */ - vp = b; - while (*vp) vp++; - } -} -#endif - -bool smemeq(const void *av, const void *bv, size_t len) -{ - const unsigned char *a = (const unsigned char *)av; - const unsigned char *b = (const unsigned char *)bv; - unsigned val = 0; - - while (len-- > 0) { - val |= *a++ ^ *b++; - } - /* Now val is 0 iff we want to return 1, and in the range - * 0x01..0xFF iff we want to return 0. So subtracting from 0x100 - * will clear bit 8 iff we want to return 0, and leave it set iff - * we want to return 1, so then we can just shift down. */ - return (0x100 - val) >> 8; -} - -int nullstrcmp(const char *a, const char *b) -{ - if (a == NULL && b == NULL) - return 0; - if (a == NULL) - return -1; - if (b == NULL) - return +1; - return strcmp(a, b); -} - -bool ptrlen_eq_string(ptrlen pl, const char *str) -{ - size_t len = strlen(str); - return (pl.len == len && !memcmp(pl.ptr, str, len)); -} - -bool ptrlen_eq_ptrlen(ptrlen pl1, ptrlen pl2) -{ - return (pl1.len == pl2.len && !memcmp(pl1.ptr, pl2.ptr, pl1.len)); -} - -int ptrlen_strcmp(ptrlen pl1, ptrlen pl2) -{ - size_t minlen = pl1.len < pl2.len ? pl1.len : pl2.len; - if (minlen) { /* tolerate plX.ptr==NULL as long as plX.len==0 */ - int cmp = memcmp(pl1.ptr, pl2.ptr, minlen); - if (cmp) - return cmp; - } - return pl1.len < pl2.len ? -1 : pl1.len > pl2.len ? +1 : 0; -} - -bool ptrlen_startswith(ptrlen whole, ptrlen prefix, ptrlen *tail) -{ - if (whole.len >= prefix.len && - !memcmp(whole.ptr, prefix.ptr, prefix.len)) { - if (tail) { - tail->ptr = (const char *)whole.ptr + prefix.len; - tail->len = whole.len - prefix.len; - } - return true; - } - return false; -} - -bool ptrlen_endswith(ptrlen whole, ptrlen suffix, ptrlen *tail) -{ - if (whole.len >= suffix.len && - !memcmp((char *)whole.ptr + (whole.len - suffix.len), - suffix.ptr, suffix.len)) { - if (tail) { - tail->ptr = whole.ptr; - tail->len = whole.len - suffix.len; - } - return true; - } - return false; -} - -ptrlen ptrlen_get_word(ptrlen *input, const char *separators) -{ - const char *p = input->ptr, *end = p + input->len; - ptrlen toret; - - while (p < end && strchr(separators, *p)) - p++; - toret.ptr = p; - while (p < end && !strchr(separators, *p)) - p++; - toret.len = p - (const char *)toret.ptr; - - size_t to_consume = p - (const char *)input->ptr; - assert(to_consume <= input->len); - input->ptr = (const char *)input->ptr + to_consume; - input->len -= to_consume; - - return toret; -} - -char *mkstr(ptrlen pl) -{ - char *p = snewn(pl.len + 1, char); - memcpy(p, pl.ptr, pl.len); - p[pl.len] = '\0'; - return p; -} - -bool strstartswith(const char *s, const char *t) -{ - return !strncmp(s, t, strlen(t)); -} - -bool strendswith(const char *s, const char *t) -{ - size_t slen = strlen(s), tlen = strlen(t); - return slen >= tlen && !strcmp(s + (slen - tlen), t); -} - -size_t encode_utf8(void *output, unsigned long ch) -{ - unsigned char *start = (unsigned char *)output, *p = start; - - if (ch < 0x80) { - *p++ = ch; - } else if (ch < 0x800) { - *p++ = 0xC0 | (ch >> 6); - *p++ = 0x80 | (ch & 0x3F); - } else if (ch < 0x10000) { - *p++ = 0xE0 | (ch >> 12); - *p++ = 0x80 | ((ch >> 6) & 0x3F); - *p++ = 0x80 | (ch & 0x3F); - } else { - *p++ = 0xF0 | (ch >> 18); - *p++ = 0x80 | ((ch >> 12) & 0x3F); - *p++ = 0x80 | ((ch >> 6) & 0x3F); - *p++ = 0x80 | (ch & 0x3F); - } - return p - start; -} - -void write_c_string_literal(FILE *fp, ptrlen str) -{ - for (const char *p = str.ptr; p < (const char *)str.ptr + str.len; p++) { - char c = *p; - - if (c == '\n') - fputs("\\n", fp); - else if (c == '\r') - fputs("\\r", fp); - else if (c == '\t') - fputs("\\t", fp); - else if (c == '\b') - fputs("\\b", fp); - else if (c == '\\') - fputs("\\\\", fp); - else if (c == '"') - fputs("\\\"", fp); - else if (c >= 32 && c <= 126) - fputc(c, fp); - else - fprintf(fp, "\\%03o", (unsigned char)c); - } -} - -void memxor(uint8_t *out, const uint8_t *in1, const uint8_t *in2, size_t size) -{ - switch (size & 15) { - case 0: - while (size >= 16) { - size -= 16; - *out++ = *in1++ ^ *in2++; - case 15: *out++ = *in1++ ^ *in2++; - case 14: *out++ = *in1++ ^ *in2++; - case 13: *out++ = *in1++ ^ *in2++; - case 12: *out++ = *in1++ ^ *in2++; - case 11: *out++ = *in1++ ^ *in2++; - case 10: *out++ = *in1++ ^ *in2++; - case 9: *out++ = *in1++ ^ *in2++; - case 8: *out++ = *in1++ ^ *in2++; - case 7: *out++ = *in1++ ^ *in2++; - case 6: *out++ = *in1++ ^ *in2++; - case 5: *out++ = *in1++ ^ *in2++; - case 4: *out++ = *in1++ ^ *in2++; - case 3: *out++ = *in1++ ^ *in2++; - case 2: *out++ = *in1++ ^ *in2++; - case 1: *out++ = *in1++ ^ *in2++; - } - } -} - -FingerprintType ssh2_pick_fingerprint( - char **fingerprints, FingerprintType preferred_type) -{ - /* - * Keys are either SSH-2, in which case we have all fingerprint - * types, or SSH-1, in which case we have only MD5. So we return - * the default type if we can, or MD5 if that's all we have; no - * need for a fully general preference-list system. - */ - FingerprintType fptype = fingerprints[preferred_type] ? - preferred_type : SSH_FPTYPE_MD5; - assert(fingerprints[fptype]); - return fptype; -} - -FingerprintType ssh2_pick_default_fingerprint(char **fingerprints) -{ - return ssh2_pick_fingerprint(fingerprints, SSH_FPTYPE_DEFAULT); -} diff --git a/code/utils/CMakeLists.txt b/code/utils/CMakeLists.txt new file mode 100644 index 0000000..2e1296e --- /dev/null +++ b/code/utils/CMakeLists.txt @@ -0,0 +1,68 @@ +add_sources_from_current_dir(utils + antispoof.c + backend_socket_log.c + base64_decode_atom.c + base64_encode_atom.c + bufchain.c + buildinfo.c + burnstr.c + chomp.c + cmdline_get_passwd_input_state_new.c + conf.c + conf_dest.c + conf_launchable.c + ctrlparse.c + debug.c + decode_utf8.c + decode_utf8_to_wchar.c + default_description.c + dupcat.c + dupprintf.c + dupstr.c + dup_mb_to_wc.c + dup_wc_to_mb.c + encode_utf8.c + encode_wide_string_as_utf8.c + fgetline.c + host_strchr.c + host_strchr_internal.c + host_strcspn.c + host_strduptrim.c + host_strrchr.c + log_proxy_stderr.c + make_spr_sw_abort_static.c + marshal.c + memory.c + memxor.c + null_lp.c + nullseat.c + nullstrcmp.c + out_of_memory.c + parse_blocksize.c + prompts.c + ptrlen.c + read_file_into.c + seat_connection_fatal.c + sessprep.c + sk_free_peer_info.c + smemclr.c + smemeq.c + spr_get_error_message.c + ssh2_pick_fingerprint.c + sshutils.c + strbuf.c + string_length_for_printf.c + stripctrl.c + tempseat.c + tree234.c + validate_manual_hostkey.c + version.c + wcwidth.c + wildcard.c + write_c_string_literal.c + x11authfile.c + x11authnames.c + x11_dehexify.c + x11_identify_auth_proto.c + x11_make_greeting.c + x11_parse_ip.c) diff --git a/code/utils/antispoof.c b/code/utils/antispoof.c new file mode 100644 index 0000000..6435944 --- /dev/null +++ b/code/utils/antispoof.c @@ -0,0 +1,28 @@ +#include "putty.h" +#include "misc.h" + +void seat_antispoof_msg(InteractionReadySeat iseat, const char *msg) +{ + strbuf *sb = strbuf_new(); + seat_set_trust_status(iseat.seat, true); + if (seat_can_set_trust_status(iseat.seat)) { + /* + * If the seat can directly indicate that this message is + * generated by the client, then we can just use the message + * unmodified as an unspoofable header. + */ + put_dataz(sb, msg); + } else if (*msg) { + /* + * Otherwise, add enough padding around it that the server + * wouldn't be able to mimic it within our line-length + * constraint. + */ + put_fmt(sb, "-- %s ", msg); + while (sb->len < 78) + put_byte(sb, '-'); + } + put_datapl(sb, PTRLEN_LITERAL("\r\n")); + seat_banner_pl(iseat, ptrlen_from_strbuf(sb)); + strbuf_free(sb); +} diff --git a/code/utils/backend_socket_log.c b/code/utils/backend_socket_log.c new file mode 100644 index 0000000..783cca3 --- /dev/null +++ b/code/utils/backend_socket_log.c @@ -0,0 +1,62 @@ +#include +#include + +#include "putty.h" +#include "network.h" + +void backend_socket_log(Seat *seat, LogContext *logctx, + PlugLogType type, SockAddr *addr, int port, + const char *error_msg, int error_code, Conf *conf, + bool session_started) +{ + char addrbuf[256], *msg; + + switch (type) { + case PLUGLOG_CONNECT_TRYING: + sk_getaddr(addr, addrbuf, lenof(addrbuf)); + if (sk_addr_needs_port(addr)) { + msg = dupprintf("Connecting to %s port %d", addrbuf, port); + } else { + msg = dupprintf("Connecting to %s", addrbuf); + } + break; + case PLUGLOG_CONNECT_FAILED: + sk_getaddr(addr, addrbuf, lenof(addrbuf)); + msg = dupprintf("Failed to connect to %s: %s", addrbuf, error_msg); + break; + case PLUGLOG_CONNECT_SUCCESS: + if (addr) + sk_getaddr(addr, addrbuf, lenof(addrbuf)); + else /* fallback if address unavailable */ + sprintf(addrbuf, "remote host"); + msg = dupprintf("Connected to %s", addrbuf); + break; + case PLUGLOG_PROXY_MSG: { + /* Proxy-related log messages have their own identifying + * prefix already, put on by our caller. */ + int len, log_to_term; + + /* Suffix \r\n temporarily, so we can log to the terminal. */ + msg = dupprintf("%s\r\n", error_msg); + len = strlen(msg); + assert(len >= 2); + + log_to_term = conf_get_int(conf, CONF_proxy_log_to_term); + if (log_to_term == AUTO) + log_to_term = session_started ? FORCE_OFF : FORCE_ON; + if (log_to_term == FORCE_ON) + seat_stderr(seat, msg, len); + + msg[len-2] = '\0'; /* remove the \r\n again */ + break; + } + default: + msg = NULL; /* shouldn't happen, but placate optimiser */ + break; + } + + if (msg) { + logevent(logctx, msg); + sfree(msg); + } +} diff --git a/code/utils/base64_decode_atom.c b/code/utils/base64_decode_atom.c new file mode 100644 index 0000000..2a98150 --- /dev/null +++ b/code/utils/base64_decode_atom.c @@ -0,0 +1,54 @@ +/* + * Core routine to decode a single atomic base64 chunk. + */ + +#include "defs.h" +#include "misc.h" + +int base64_decode_atom(const char *atom, unsigned char *out) +{ + int vals[4]; + int i, v, len; + unsigned word; + char c; + + for (i = 0; i < 4; i++) { + c = atom[i]; + if (c >= 'A' && c <= 'Z') + v = c - 'A'; + else if (c >= 'a' && c <= 'z') + v = c - 'a' + 26; + else if (c >= '0' && c <= '9') + v = c - '0' + 52; + else if (c == '+') + v = 62; + else if (c == '/') + v = 63; + else if (c == '=') + v = -1; + else + return 0; /* invalid atom */ + vals[i] = v; + } + + if (vals[0] == -1 || vals[1] == -1) + return 0; + if (vals[2] == -1 && vals[3] != -1) + return 0; + + if (vals[3] != -1) + len = 3; + else if (vals[2] != -1) + len = 2; + else + len = 1; + + word = ((vals[0] << 18) | + (vals[1] << 12) | ((vals[2] & 0x3F) << 6) | (vals[3] & 0x3F)); + out[0] = (word >> 16) & 0xFF; + if (len > 1) + out[1] = (word >> 8) & 0xFF; + if (len > 2) + out[2] = word & 0xFF; + return len; +} diff --git a/code/utils/base64_encode_atom.c b/code/utils/base64_encode_atom.c new file mode 100644 index 0000000..c33476f --- /dev/null +++ b/code/utils/base64_encode_atom.c @@ -0,0 +1,30 @@ +/* + * Core routine to encode a single atomic base64 chunk. + */ + +#include "defs.h" +#include "misc.h" + +void base64_encode_atom(const unsigned char *data, int n, char *out) +{ + static const char base64_chars[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + unsigned word; + + word = data[0] << 16; + if (n > 1) + word |= data[1] << 8; + if (n > 2) + word |= data[2]; + out[0] = base64_chars[(word >> 18) & 0x3F]; + out[1] = base64_chars[(word >> 12) & 0x3F]; + if (n > 1) + out[2] = base64_chars[(word >> 6) & 0x3F]; + else + out[2] = '='; + if (n > 2) + out[3] = base64_chars[word & 0x3F]; + else + out[3] = '='; +} diff --git a/code/utils/bufchain.c b/code/utils/bufchain.c new file mode 100644 index 0000000..9b02c65 --- /dev/null +++ b/code/utils/bufchain.c @@ -0,0 +1,193 @@ +/* + * Generic routines to deal with send buffers: a linked list of + * smallish blocks, with the operations + * + * - add an arbitrary amount of data to the end of the list + * - remove the first N bytes from the list + * - return a (pointer,length) pair giving some initial data in + * the list, suitable for passing to a send or write system + * call + * - retrieve a larger amount of initial data from the list + * - return the current size of the buffer chain in bytes + */ + +#include "defs.h" +#include "misc.h" + +#define BUFFER_MIN_GRANULE 512 + +struct bufchain_granule { + struct bufchain_granule *next; + char *bufpos, *bufend, *bufmax; +}; + +static void uninitialised_queue_idempotent_callback(IdempotentCallback *ic) +{ + unreachable("bufchain callback used while uninitialised"); +} + +void bufchain_init(bufchain *ch) +{ + ch->head = ch->tail = NULL; + ch->buffersize = 0; + ch->ic = NULL; + ch->queue_idempotent_callback = uninitialised_queue_idempotent_callback; +} + +void bufchain_clear(bufchain *ch) +{ + struct bufchain_granule *b; + while (ch->head) { + b = ch->head; + ch->head = ch->head->next; + smemclr(b, sizeof(*b)); + sfree(b); + } + ch->tail = NULL; + ch->buffersize = 0; +} + +size_t bufchain_size(bufchain *ch) +{ + return ch->buffersize; +} + +void bufchain_set_callback_inner( + bufchain *ch, IdempotentCallback *ic, + void (*queue_idempotent_callback)(IdempotentCallback *ic)) +{ + ch->queue_idempotent_callback = queue_idempotent_callback; + ch->ic = ic; +} + +void bufchain_add(bufchain *ch, const void *data, size_t len) +{ + const char *buf = (const char *)data; + + if (len == 0) return; + + ch->buffersize += len; + + while (len > 0) { + if (ch->tail && ch->tail->bufend < ch->tail->bufmax) { + size_t copylen = min(len, ch->tail->bufmax - ch->tail->bufend); + memcpy(ch->tail->bufend, buf, copylen); + buf += copylen; + len -= copylen; + ch->tail->bufend += copylen; + } + if (len > 0) { + size_t grainlen = + max(sizeof(struct bufchain_granule) + len, BUFFER_MIN_GRANULE); + struct bufchain_granule *newbuf; + newbuf = smalloc(grainlen); + newbuf->bufpos = newbuf->bufend = + (char *)newbuf + sizeof(struct bufchain_granule); + newbuf->bufmax = (char *)newbuf + grainlen; + newbuf->next = NULL; + if (ch->tail) + ch->tail->next = newbuf; + else + ch->head = newbuf; + ch->tail = newbuf; + } + } + + if (ch->ic) + ch->queue_idempotent_callback(ch->ic); +} + +void bufchain_consume(bufchain *ch, size_t len) +{ + struct bufchain_granule *tmp; + + assert(ch->buffersize >= len); + while (len > 0) { + int remlen = len; + assert(ch->head != NULL); + if (remlen >= ch->head->bufend - ch->head->bufpos) { + remlen = ch->head->bufend - ch->head->bufpos; + tmp = ch->head; + ch->head = tmp->next; + if (!ch->head) + ch->tail = NULL; + smemclr(tmp, sizeof(*tmp)); + sfree(tmp); + } else + ch->head->bufpos += remlen; + ch->buffersize -= remlen; + len -= remlen; + } +} + +ptrlen bufchain_prefix(bufchain *ch) +{ + return make_ptrlen(ch->head->bufpos, ch->head->bufend - ch->head->bufpos); +} + +void bufchain_fetch(bufchain *ch, void *data, size_t len) +{ + struct bufchain_granule *tmp; + char *data_c = (char *)data; + + tmp = ch->head; + + assert(ch->buffersize >= len); + while (len > 0) { + int remlen = len; + + assert(tmp != NULL); + if (remlen >= tmp->bufend - tmp->bufpos) + remlen = tmp->bufend - tmp->bufpos; + memcpy(data_c, tmp->bufpos, remlen); + + tmp = tmp->next; + len -= remlen; + data_c += remlen; + } +} + +void bufchain_fetch_consume(bufchain *ch, void *data, size_t len) +{ + bufchain_fetch(ch, data, len); + bufchain_consume(ch, len); +} + +bool bufchain_try_fetch(bufchain *ch, void *data, size_t len) +{ + if (ch->buffersize >= len) { + bufchain_fetch(ch, data, len); + return true; + } else { + return false; + } +} + +bool bufchain_try_consume(bufchain *ch, size_t len) +{ + if (ch->buffersize >= len) { + bufchain_consume(ch, len); + return true; + } else { + return false; + } +} + +bool bufchain_try_fetch_consume(bufchain *ch, void *data, size_t len) +{ + if (ch->buffersize >= len) { + bufchain_fetch_consume(ch, data, len); + return true; + } else { + return false; + } +} + +size_t bufchain_fetch_consume_up_to(bufchain *ch, void *data, size_t len) +{ + if (len > ch->buffersize) + len = ch->buffersize; + if (len) + bufchain_fetch_consume(ch, data, len); + return len; +} diff --git a/code/utils/buildinfo.c b/code/utils/buildinfo.c new file mode 100644 index 0000000..060e6d5 --- /dev/null +++ b/code/utils/buildinfo.c @@ -0,0 +1,162 @@ +/* + * Return a string describing everything we know about how this + * particular binary was built: from what source, for what target + * platform, using what tools, with what settings, etc. + */ + +#include "putty.h" + +char *buildinfo(const char *newline) +{ + strbuf *buf = strbuf_new(); + + put_fmt(buf, "Build platform: %d-bit %s", + (int)(CHAR_BIT * sizeof(void *)), BUILDINFO_PLATFORM); + +#ifdef __clang_version__ +#define FOUND_COMPILER + put_fmt(buf, "%sCompiler: clang %s", newline, __clang_version__); +#elif defined __GNUC__ && defined __VERSION__ +#define FOUND_COMPILER + put_fmt(buf, "%sCompiler: gcc %s", newline, __VERSION__); +#endif + +#if defined _MSC_VER +#ifndef FOUND_COMPILER +#define FOUND_COMPILER + put_fmt(buf, "%sCompiler: ", newline); +#else + put_fmt(buf, ", emulating "); +#endif + put_fmt(buf, "Visual Studio"); + +#if 0 + /* + * List of _MSC_VER values and their translations taken from + * https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros + * + * The pointless #if 0 branch containing this comment is there so + * that every real clause can start with #elif and there's no + * anomalous first clause. That way the patch looks nicer when you + * add extra ones. + * + * Mostly you can tell the version just from _MSC_VER, but in some + * cases, two different compiler versions have the same _MSC_VER + * value, and have to be distinguished by _MSC_FULL_VER. + */ +#elif PUTTY_CAC && _MSC_VER == 1930 + put_fmt(buf, " 2022 (17.0)"); +#elif PUTTY_CAC && _MSC_VER == 1931 + put_fmt(buf, " 2022 (17.1)"); +#elif PUTTY_CAC && _MSC_VER == 1932 + put_fmt(buf, " 2022 (17.2)"); +#elif _MSC_VER == 1929 && _MSC_FULL_VER >= 192930100 + put_fmt(buf, " 2019 (16.11)"); +#elif _MSC_VER == 1929 + put_fmt(buf, " 2019 (16.10)"); +#elif _MSC_VER == 1928 && _MSC_FULL_VER >= 192829500 + put_fmt(buf, " 2019 (16.9)"); +#elif _MSC_VER == 1928 + put_fmt(buf, " 2019 (16.8)"); +#elif _MSC_VER == 1927 + put_fmt(buf, " 2019 (16.7)"); +#elif _MSC_VER == 1926 + put_fmt(buf, " 2019 (16.6)"); +#elif _MSC_VER == 1925 + put_fmt(buf, " 2019 (16.5)"); +#elif _MSC_VER == 1924 + put_fmt(buf, " 2019 (16.4)"); +#elif _MSC_VER == 1923 + put_fmt(buf, " 2019 (16.3)"); +#elif _MSC_VER == 1922 + put_fmt(buf, " 2019 (16.2)"); +#elif _MSC_VER == 1921 + put_fmt(buf, " 2019 (16.1)"); +#elif _MSC_VER == 1920 + put_fmt(buf, " 2019 (16.0)"); +#elif _MSC_VER == 1916 + put_fmt(buf, " 2017 version 15.9"); +#elif _MSC_VER == 1915 + put_fmt(buf, " 2017 version 15.8"); +#elif _MSC_VER == 1914 + put_fmt(buf, " 2017 version 15.7"); +#elif _MSC_VER == 1913 + put_fmt(buf, " 2017 version 15.6"); +#elif _MSC_VER == 1912 + put_fmt(buf, " 2017 version 15.5"); +#elif _MSC_VER == 1911 + put_fmt(buf, " 2017 version 15.3"); +#elif _MSC_VER == 1910 + put_fmt(buf, " 2017 RTW (15.0)"); +#elif _MSC_VER == 1900 + put_fmt(buf, " 2015 (14.0)"); +#elif _MSC_VER == 1800 + put_fmt(buf, " 2013 (12.0)"); +#elif _MSC_VER == 1700 + put_fmt(buf, " 2012 (11.0)"); +#elif _MSC_VER == 1600 + put_fmt(buf, " 2010 (10.0)"); +#elif _MSC_VER == 1500 + put_fmt(buf, " 2008 (9.0)"); +#elif _MSC_VER == 1400 + put_fmt(buf, " 2005 (8.0)"); +#elif _MSC_VER == 1310 + put_fmt(buf, " .NET 2003 (7.1)"); +#elif _MSC_VER == 1300 + put_fmt(buf, " .NET 2002 (7.0)"); +#elif _MSC_VER == 1200 + put_fmt(buf, " 6.0"); +#else + put_fmt(buf, ", unrecognised version"); +#endif + put_fmt(buf, ", _MSC_VER=%d", (int)_MSC_VER); +#ifdef _MSC_FULL_VER + put_fmt(buf, ", _MSC_FULL_VER=%d", (int)_MSC_FULL_VER); +#endif +#endif + +#ifdef BUILDINFO_GTK + { + char *gtk_buildinfo = buildinfo_gtk_version(); + if (gtk_buildinfo) { + put_fmt(buf, "%sCompiled against GTK version %s", + newline, gtk_buildinfo); + sfree(gtk_buildinfo); + } + } +#endif +#if defined _WINDOWS + { + int echm = has_embedded_chm(); + if (echm >= 0) + put_fmt(buf, "%sEmbedded HTML Help file: %s", newline, + echm ? "yes" : "no"); + } +#endif + +#if defined _WINDOWS && defined MINEFIELD + put_fmt(buf, "%sBuild option: MINEFIELD", newline); +#endif +#ifdef NO_IPV6 + put_fmt(buf, "%sBuild option: NO_IPV6", newline); +#endif +#ifdef NO_GSSAPI + put_fmt(buf, "%sBuild option: NO_GSSAPI", newline); +#endif +#ifdef STATIC_GSSAPI + put_fmt(buf, "%sBuild option: STATIC_GSSAPI", newline); +#endif +#ifdef UNPROTECT + put_fmt(buf, "%sBuild option: UNPROTECT", newline); +#endif +#ifdef FUZZING + put_fmt(buf, "%sBuild option: FUZZING", newline); +#endif +#ifdef DEBUG + put_fmt(buf, "%sBuild option: DEBUG", newline); +#endif + + put_fmt(buf, "%sSource commit: %s", newline, commitid); + + return strbuf_to_str(buf); +} diff --git a/code/utils/burnstr.c b/code/utils/burnstr.c new file mode 100644 index 0000000..33214d8 --- /dev/null +++ b/code/utils/burnstr.c @@ -0,0 +1,15 @@ +/* + * 'Burn' a dynamically allocated string, in the sense of destroying + * it beyond recovery: overwrite it with zeroes and then free it. + */ + +#include "defs.h" +#include "misc.h" + +void burnstr(char *string) +{ + if (string) { + smemclr(string, strlen(string)); + sfree(string); + } +} diff --git a/code/utils/chomp.c b/code/utils/chomp.c new file mode 100644 index 0000000..866fc65 --- /dev/null +++ b/code/utils/chomp.c @@ -0,0 +1,26 @@ +/* + * Perl-style 'chomp', for a line we just read with fgetline. + * + * Unlike Perl chomp, however, we're deliberately forgiving of strange + * line-ending conventions. + * + * Also we forgive NULL on input, so you can just write 'line = + * chomp(fgetline(fp));' and not bother checking for NULL until + * afterwards. + */ + +#include + +#include "defs.h" +#include "misc.h" + +char *chomp(char *str) +{ + if (str) { + int len = strlen(str); + while (len > 0 && (str[len-1] == '\r' || str[len-1] == '\n')) + len--; + str[len] = '\0'; + } + return str; +} diff --git a/code/utils/cmdline_get_passwd_input_state_new.c b/code/utils/cmdline_get_passwd_input_state_new.c new file mode 100644 index 0000000..cd39bfa --- /dev/null +++ b/code/utils/cmdline_get_passwd_input_state_new.c @@ -0,0 +1,9 @@ +/* + * A preinitialised cmdline_get_passwd_input_state which makes it easy + * to assign by structure copy. + */ + +#include "putty.h" + +const cmdline_get_passwd_input_state cmdline_get_passwd_input_state_new = + CMDLINE_GET_PASSWD_INPUT_STATE_INIT; diff --git a/code/conf.c b/code/utils/conf.c similarity index 100% rename from code/conf.c rename to code/utils/conf.c diff --git a/code/utils/conf_dest.c b/code/utils/conf_dest.c new file mode 100644 index 0000000..13e4ce6 --- /dev/null +++ b/code/utils/conf_dest.c @@ -0,0 +1,15 @@ +/* + * Decide whether the 'host name' or 'serial line' field of a Conf is + * important, based on which protocol it has selected. + */ + +#include "putty.h" + +char const *conf_dest(Conf *conf) +{ + if (conf_get_int(conf, CONF_protocol) == PROT_SERIAL) + return conf_get_str(conf, CONF_serline); + else + return conf_get_str(conf, CONF_host); +} + diff --git a/code/utils/conf_launchable.c b/code/utils/conf_launchable.c new file mode 100644 index 0000000..904ade6 --- /dev/null +++ b/code/utils/conf_launchable.c @@ -0,0 +1,14 @@ +/* + * Determine whether or not a Conf represents a session which can + * sensibly be launched right now. + */ + +#include "putty.h" + +bool conf_launchable(Conf *conf) +{ + if (conf_get_int(conf, CONF_protocol) == PROT_SERIAL) + return conf_get_str(conf, CONF_serline)[0] != 0; + else + return conf_get_str(conf, CONF_host)[0] != 0; +} diff --git a/code/utils/ctrlparse.c b/code/utils/ctrlparse.c new file mode 100644 index 0000000..86f8790 --- /dev/null +++ b/code/utils/ctrlparse.c @@ -0,0 +1,49 @@ +/* + * Parse a ^C style character specification. + * Returns NULL in `next' if we didn't recognise it as a control character, + * in which case `c' should be ignored. + * The precise current parsing is an oddity inherited from the terminal + * answerback-string parsing code. All sequences start with ^; all except + * ^<123> are two characters. The ones that are worth keeping are probably: + * ^? 127 + * ^@A-Z[\]^_ 0-31 + * a-z 1-26 + * specified by number (decimal, 0octal, 0xHEX) + * ~ ^ escape + */ + +#include + +#include "defs.h" +#include "misc.h" + +char ctrlparse(char *s, char **next) +{ + char c = 0; + if (*s != '^') { + *next = NULL; + } else { + s++; + if (*s == '\0') { + *next = NULL; + } else if (*s == '<') { + s++; + c = (char)strtol(s, next, 0); + if ((*next == s) || (**next != '>')) { + c = 0; + *next = NULL; + } else + (*next)++; + } else if (*s >= 'a' && *s <= 'z') { + c = (*s - ('a' - 1)); + *next = s+1; + } else if ((*s >= '@' && *s <= '_') || *s == '?' || (*s & 0x80)) { + c = ('@' ^ *s); + *next = s+1; + } else if (*s == '~') { + c = '^'; + *next = s+1; + } + } + return c; +} diff --git a/code/utils/debug.c b/code/utils/debug.c new file mode 100644 index 0000000..806b250 --- /dev/null +++ b/code/utils/debug.c @@ -0,0 +1,56 @@ +/* + * Debugging routines used by the debug() macros, at least if you + * compiled with -DDEBUG (aka the PUTTY_DEBUG cmake option) so that + * those macros don't optimise down to nothing. + */ + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +void debug_printf(const char *fmt, ...) +{ + char *buf; + va_list ap; + + va_start(ap, fmt); + buf = dupvprintf(fmt, ap); + dputs(buf); + sfree(buf); + va_end(ap); +} + +void debug_memdump(const void *buf, int len, bool L) +{ + int i; + const unsigned char *p = buf; + char foo[17]; + if (L) { + int delta; + debug_printf("\t%d (0x%x) bytes:\n", len, len); + delta = 15 & (uintptr_t)p; + p -= delta; + len += delta; + } + for (; 0 < len; p += 16, len -= 16) { + dputs(" "); + if (L) + debug_printf("%p: ", p); + strcpy(foo, "................"); /* sixteen dots */ + for (i = 0; i < 16 && i < len; ++i) { + if (&p[i] < (unsigned char *) buf) { + dputs(" "); /* 3 spaces */ + foo[i] = ' '; + } else { + debug_printf("%c%2.2x", + &p[i] != (unsigned char *) buf + && i % 4 ? '.' : ' ', p[i] + ); + if (p[i] >= ' ' && p[i] <= '~') + foo[i] = (char) p[i]; + } + } + foo[i] = '\0'; + debug_printf("%*s%s\n", (16 - i) * 3 + 2, "", foo); + } +} diff --git a/code/utils/decode_utf8.c b/code/utils/decode_utf8.c new file mode 100644 index 0000000..c8dbec7 --- /dev/null +++ b/code/utils/decode_utf8.c @@ -0,0 +1,178 @@ +/* + * Decode a single UTF-8 character. + */ + +#include "putty.h" +#include "misc.h" + +unsigned long decode_utf8(const char **utf8) +{ + unsigned char c = (unsigned char)*(*utf8)++; + + /* One-byte cases. */ + if (c < 0x80) { + return c; + } else if (c < 0xC0) { + return 0xFFFD; /* spurious continuation byte */ + } + + unsigned long wc, min; + size_t ncont; + if (c < 0xE0) { + wc = c & 0x1F; ncont = 1; min = 0x80; + } else if (c < 0xF0) { + wc = c & 0x0F; ncont = 2; min = 0x800; + } else if (c < 0xF8) { + wc = c & 0x07; ncont = 3; min = 0x10000; + } else if (c < 0xFC) { + wc = c & 0x03; ncont = 4; min = 0x200000; + } else if (c < 0xFE) { + wc = c & 0x01; ncont = 5; min = 0x4000000; + } else { + return 0xFFFD; /* FE or FF illegal bytes */ + } + + while (ncont-- > 0) { + unsigned char cont = (unsigned char)**utf8; + if (!(0x80 <= cont && cont < 0xC0)) + return 0xFFFD; /* short sequence */ + (*utf8)++; + + wc = (wc << 6) | (cont & 0x3F); + } + + if (wc < min) + return 0xFFFD; /* overlong encoding */ + if (0xD800 <= wc && wc < 0xE000) + return 0xFFFD; /* UTF-8 encoding of surrogate */ + if (wc > 0x10FFFF) + return 0xFFFD; /* outside Unicode range */ + return wc; +} + +#ifdef TEST + +#include + +bool dotest(const char *file, int line, const char *input, + const unsigned long *chars, size_t nchars) +{ + const char *start = input; + const char *end = input + strlen(input) + 1; + size_t noutput = 0; + + printf("%s:%d: test start\n", file, line); + + while (input < end) { + const char *before = input; + unsigned long wc = decode_utf8(&input); + + printf("%s:%d in+%"SIZEu" out+%"SIZEu":", + file, line, (size_t)(before-start), noutput); + while (before < input) + printf(" %02x", (unsigned)(unsigned char)(*before++)); + printf(" -> U-%08lx\n", wc); + + if (noutput >= nchars) { + printf("%s:%d: FAIL: expected no further output\n", file, line); + return false; + } + + if (chars[noutput] != wc) { + printf("%s:%d: FAIL: expected U-%08lx\n", + file, line, chars[noutput]); + return false; + } + + noutput++; + } + + if (noutput < nchars) { + printf("%s:%d: FAIL: expected further output\n", file, line); + return false; + } + + printf("%s:%d: pass\n", file, line); + return true; +} + +#define DOTEST(input, ...) do { \ + static const unsigned long chars[] = { __VA_ARGS__, 0 }; \ + ntest++; \ + if (dotest(__FILE__, __LINE__, input, chars, lenof(chars))) \ + npass++; \ + } while (0) + +int main(void) +{ + int ntest = 0, npass = 0; + + DOTEST("\xCE\xBA\xE1\xBD\xB9\xCF\x83\xCE\xBC\xCE\xB5", + 0x03BA, 0x1F79, 0x03C3, 0x03BC, 0x03B5); + + /* First sequence of each length (not counting NUL, which is + * tested anyway by the string-termination handling in every test) */ + DOTEST("\xC2\x80", 0x0080); + DOTEST("\xE0\xA0\x80", 0x0800); + DOTEST("\xF0\x90\x80\x80", 0x00010000); + DOTEST("\xF8\x88\x80\x80\x80", 0xFFFD); /* would be 0x00200000 */ + DOTEST("\xFC\x84\x80\x80\x80\x80", 0xFFFD); /* would be 0x04000000 */ + + /* Last sequence of each length */ + DOTEST("\x7F", 0x007F); + DOTEST("\xDF\xBF", 0x07FF); + DOTEST("\xEF\xBF\xBF", 0xFFFF); + DOTEST("\xF7\xBF\xBF\xBF", 0xFFFD); /* would be 0x001FFFFF */ + DOTEST("\xFB\xBF\xBF\xBF\xBF", 0xFFFD); /* would be 0x03FFFFFF */ + DOTEST("\xFD\xBF\xBF\xBF\xBF\xBF", 0xFFFD); /* would be 0x7FFFFFFF */ + + /* Endpoints of the surrogate range */ + DOTEST("\xED\x9F\xBF", 0xD7FF); + DOTEST("\xED\xA0\x00", 0xFFFD); /* would be 0xD800 */ + DOTEST("\xED\xBF\xBF", 0xFFFD); /* would be 0xDFFF */ + DOTEST("\xEE\x80\x80", 0xE000); + + /* REPLACEMENT CHARACTER itself */ + DOTEST("\xEF\xBF\xBD", 0xFFFD); + + /* Endpoints of the legal Unicode range */ + DOTEST("\xF4\x8F\xBF\xBF", 0x0010FFFF); + DOTEST("\xF4\x90\x80\x80", 0xFFFD); /* would be 0x00110000 */ + + /* Spurious continuation bytes, each shown as a separate failure */ + DOTEST("\x80 \x81\x82 \xBD\xBE\xBF", + 0xFFFD, 0x0020, 0xFFFD, 0xFFFD, 0x0020, 0xFFFD, 0xFFFD, 0xFFFD); + + /* Truncated sequences, each shown as just one failure */ + DOTEST("\xC2\xE0\xA0\xF0\x90\x80\xF8\x88\x80\x80\xFC\x84\x80\x80\x80", + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD); + DOTEST("\xC2 \xE0\xA0 \xF0\x90\x80 \xF8\x88\x80\x80 \xFC\x84\x80\x80\x80", + 0xFFFD, 0x0020, 0xFFFD, 0x0020, 0xFFFD, 0x0020, 0xFFFD, 0x0020, + 0xFFFD); + + /* Illegal bytes */ + DOTEST("\xFE\xFF", 0xFFFD, 0xFFFD); + + /* Overlong sequences */ + DOTEST("\xC1\xBF", 0xFFFD); + DOTEST("\xE0\x9F\xBF", 0xFFFD); + DOTEST("\xF0\x8F\xBF\xBF", 0xFFFD); + DOTEST("\xF8\x87\xBF\xBF\xBF", 0xFFFD); + DOTEST("\xFC\x83\xBF\xBF\xBF\xBF", 0xFFFD); + + DOTEST("\xC0\x80", 0xFFFD); + DOTEST("\xE0\x80\x80", 0xFFFD); + DOTEST("\xF0\x80\x80\x80", 0xFFFD); + DOTEST("\xF8\x80\x80\x80\x80", 0xFFFD); + DOTEST("\xFC\x80\x80\x80\x80\x80", 0xFFFD); + + printf("%d tests %d passed", ntest, npass); + if (npass < ntest) { + printf(" %d FAILED\n", ntest-npass); + return 1; + } else { + printf("\n"); + return 0; + } +} +#endif diff --git a/code/utils/decode_utf8_to_wchar.c b/code/utils/decode_utf8_to_wchar.c new file mode 100644 index 0000000..97a8321 --- /dev/null +++ b/code/utils/decode_utf8_to_wchar.c @@ -0,0 +1,20 @@ +/* + * Decode a single UTF-8 character to the platform's local wchar_t. + */ + +#include "putty.h" +#include "misc.h" + +size_t decode_utf8_to_wchar(const char **utf8, wchar_t *out) +{ + size_t outlen = 0; + unsigned wc = decode_utf8(utf8); + if (sizeof(wchar_t) > 2 || wc < 0x10000) { + out[outlen++] = wc; + } else { + unsigned wcoff = wc - 0x10000; + out[outlen++] = 0xD800 | (0x3FF & (wcoff >> 10)); + out[outlen++] = 0xDC00 | (0x3FF & wcoff); + } + return outlen; +} diff --git a/code/utils/default_description.c b/code/utils/default_description.c new file mode 100644 index 0000000..e0695ee --- /dev/null +++ b/code/utils/default_description.c @@ -0,0 +1,22 @@ +/* + * Construct a description string for a backend to use as + * backend_description(), or a plug as plug_description(). + * + * For some backends this will be overridden: e.g. SSH prefers to + * think in terms of _logical_ host names (i.e. the one associated + * with the host key) rather than the physical details of where you're + * connecting to. But this default is good for simpler backends. + */ + +#include "putty.h" + +char *default_description(const BackendVtable *backvt, + const char *host, int port) +{ + const char *be_name = backvt->displayname_lc; + + if (backvt->default_port && port == backvt->default_port) + return dupprintf("%s connection to %s", be_name, host); + else + return dupprintf("%s connection to %s port %d", be_name, host, port); +} diff --git a/code/miscucs.c b/code/utils/dup_mb_to_wc.c similarity index 79% rename from code/miscucs.c rename to code/utils/dup_mb_to_wc.c index 7785f9b..c3f17ab 100644 --- a/code/miscucs.c +++ b/code/utils/dup_mb_to_wc.c @@ -1,7 +1,8 @@ /* - * Centralised Unicode-related helper functions, separate from misc.c - * so that they can be omitted from tools that aren't including - * Unicode handling. + * dup_mb_to_wc: memory-allocating wrapper on mb_to_wc. + * + * Also dup_mb_to_wc_c: same but you already know the length of the + * string. */ #include "putty.h" diff --git a/code/utils/dup_wc_to_mb.c b/code/utils/dup_wc_to_mb.c new file mode 100644 index 0000000..e91a891 --- /dev/null +++ b/code/utils/dup_wc_to_mb.c @@ -0,0 +1,39 @@ +/* + * dup_wc_to_mb: memory-allocating wrapper on wc_to_mb. + * + * Also dup_wc_to_mb_c: same but you already know the length of the + * string. + */ + +#include + +#include "putty.h" +#include "misc.h" + +char *dup_wc_to_mb_c(int codepage, int flags, const wchar_t *string, int len, + const char *defchr, struct unicode_data *ucsdata) +{ + size_t outsize = len+1; + char *out = snewn(outsize, char); + + while (true) { + size_t outlen = wc_to_mb(codepage, flags, string, len, out, outsize, + defchr, ucsdata); + /* We can only be sure we've consumed the whole input if the + * output is not within a multibyte-character-length of the + * end of the buffer! */ + if (outlen < outsize && outsize - outlen > MB_LEN_MAX) { + out[outlen] = '\0'; + return out; + } + + sgrowarray(out, outsize, outsize); + } +} + +char *dup_wc_to_mb(int codepage, int flags, const wchar_t *string, + const char *defchr, struct unicode_data *ucsdata) +{ + return dup_wc_to_mb_c(codepage, flags, string, wcslen(string), + defchr, ucsdata); +} diff --git a/code/utils/dupcat.c b/code/utils/dupcat.c new file mode 100644 index 0000000..ddd6599 --- /dev/null +++ b/code/utils/dupcat.c @@ -0,0 +1,48 @@ +/* + * Implementation function behind dupcat() in misc.h. + * + * This function is called with an arbitrary number of 'const char *' + * parameters, of which the last one is a null pointer. The wrapper + * macro puts on the null pointer itself, so normally callers don't + * have to. + */ + +#include +#include + +#include "defs.h" +#include "misc.h" + +char *dupcat_fn(const char *s1, ...) +{ + int len; + char *p, *q, *sn; + va_list ap; + + len = strlen(s1); + va_start(ap, s1); + while (1) { + sn = va_arg(ap, char *); + if (!sn) + break; + len += strlen(sn); + } + va_end(ap); + + p = snewn(len + 1, char); + strcpy(p, s1); + q = p + strlen(p); + + va_start(ap, s1); + while (1) { + sn = va_arg(ap, char *); + if (!sn) + break; + strcpy(q, sn); + q += strlen(q); + } + va_end(ap); + + return p; +} + diff --git a/code/utils/dupprintf.c b/code/utils/dupprintf.c new file mode 100644 index 0000000..aa9f330 --- /dev/null +++ b/code/utils/dupprintf.c @@ -0,0 +1,100 @@ +/* + * Do an sprintf(), but into a custom-allocated buffer. + * + * Currently I'm doing this via vsnprintf. This has worked so far, + * but it's not good, because vsnprintf is not available on all + * platforms. There's an ifdef to use `_vsnprintf', which seems + * to be the local name for it on Windows. Other platforms may + * lack it completely, in which case it'll be time to rewrite + * this function in a totally different way. + * + * The only `properly' portable solution I can think of is to + * implement my own format string scanner, which figures out an + * upper bound for the length of each formatting directive, + * allocates the buffer as it goes along, and calls sprintf() to + * actually process each directive. If I ever need to actually do + * this, some caveats: + * + * - It's very hard to find a reliable upper bound for + * floating-point values. %f, in particular, when supplied with + * a number near to the upper or lower limit of representable + * numbers, could easily take several hundred characters. It's + * probably feasible to predict this statically using the + * constants in , or even to predict it dynamically by + * looking at the exponent of the specific float provided, but + * it won't be fun. + * + * - Don't forget to _check_, after calling sprintf, that it's + * used at most the amount of space we had available. + * + * - Fault any formatting directive we don't fully understand. The + * aim here is to _guarantee_ that we never overflow the buffer, + * because this is a security-critical function. If we see a + * directive we don't know about, we should panic and die rather + * than run any risk. + */ + +#include + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +/* Work around lack of va_copy in old MSC */ +#if defined _MSC_VER && !defined va_copy +#define va_copy(a, b) TYPECHECK( \ + (va_list *)0 == &(a) && (va_list *)0 == &(b), \ + memcpy(&a, &b, sizeof(va_list))) +#endif + +/* Also lack of vsnprintf before VS2015 */ +#if defined _WINDOWS && \ + !defined __MINGW32__ && \ + !defined __WINE__ && \ + _MSC_VER < 1900 +#define vsnprintf _vsnprintf +#endif + +char *dupvprintf_inner(char *buf, size_t oldlen, size_t *sizeptr, + const char *fmt, va_list ap) +{ + size_t size = *sizeptr; + sgrowarrayn_nm(buf, size, oldlen, 512); + + while (1) { + va_list aq; + va_copy(aq, ap); + int len = vsnprintf(buf + oldlen, size - oldlen, fmt, aq); + va_end(aq); + + if (len >= 0 && len < size) { + /* This is the C99-specified criterion for snprintf to have + * been completely successful. */ + *sizeptr = size; + return buf; + } else if (len > 0) { + /* This is the C99 error condition: the returned length is + * the required buffer size not counting the NUL. */ + sgrowarrayn_nm(buf, size, oldlen + 1, len); + } else { + /* This is the pre-C99 glibc error condition: <0 means the + * buffer wasn't big enough, so we enlarge it a bit and hope. */ + sgrowarray_nm(buf, size, size); + } + } +} + +char *dupvprintf(const char *fmt, va_list ap) +{ + size_t size = 0; + return dupvprintf_inner(NULL, 0, &size, fmt, ap); +} +char *dupprintf(const char *fmt, ...) +{ + char *ret; + va_list ap; + va_start(ap, fmt); + ret = dupvprintf(fmt, ap); + va_end(ap); + return ret; +} diff --git a/code/utils/dupstr.c b/code/utils/dupstr.c new file mode 100644 index 0000000..fd79583 --- /dev/null +++ b/code/utils/dupstr.c @@ -0,0 +1,19 @@ +/* + * Allocate a duplicate of an ordinary C NUL-terminated string. + */ + +#include + +#include "defs.h" +#include "misc.h" + +char *dupstr(const char *s) +{ + char *p = NULL; + if (s) { + int len = strlen(s); + p = snewn(len + 1, char); + strcpy(p, s); + } + return p; +} diff --git a/code/utils/encode_utf8.c b/code/utils/encode_utf8.c new file mode 100644 index 0000000..731ab92 --- /dev/null +++ b/code/utils/encode_utf8.c @@ -0,0 +1,29 @@ +/* + * Encode a single code point as UTF-8. + */ + +#include "defs.h" +#include "misc.h" + +size_t encode_utf8(void *output, unsigned long ch) +{ + unsigned char *start = (unsigned char *)output, *p = start; + + if (ch < 0x80) { + *p++ = ch; + } else if (ch < 0x800) { + *p++ = 0xC0 | (ch >> 6); + *p++ = 0x80 | (ch & 0x3F); + } else if (ch < 0x10000) { + *p++ = 0xE0 | (ch >> 12); + *p++ = 0x80 | ((ch >> 6) & 0x3F); + *p++ = 0x80 | (ch & 0x3F); + } else { + assert(ch <= 0x10FFFF); + *p++ = 0xF0 | (ch >> 18); + *p++ = 0x80 | ((ch >> 12) & 0x3F); + *p++ = 0x80 | ((ch >> 6) & 0x3F); + *p++ = 0x80 | (ch & 0x3F); + } + return p - start; +} diff --git a/code/utils/encode_wide_string_as_utf8.c b/code/utils/encode_wide_string_as_utf8.c new file mode 100644 index 0000000..870903d --- /dev/null +++ b/code/utils/encode_wide_string_as_utf8.c @@ -0,0 +1,25 @@ +/* + * Encode a string of wchar_t as UTF-8. + */ + +#include "putty.h" +#include "misc.h" + +char *encode_wide_string_as_utf8(const wchar_t *ws) +{ + strbuf *sb = strbuf_new(); + while (*ws) { + unsigned long ch = *ws++; + if (sizeof(wchar_t) == 2 && IS_HIGH_SURROGATE(ch) && + IS_LOW_SURROGATE(*ws)) { + ch = FROM_SURROGATES(ch, *ws); + ws++; + } else if (IS_SURROGATE(ch)) { + ch = 0xfffd; /* illegal UTF-16 -> REPLACEMENT CHARACTER */ + } + char utf8[6]; + size_t size = encode_utf8(utf8, ch); + put_data(sb, utf8, size); + } + return strbuf_to_str(sb); +} diff --git a/code/utils/fgetline.c b/code/utils/fgetline.c new file mode 100644 index 0000000..2bb580f --- /dev/null +++ b/code/utils/fgetline.c @@ -0,0 +1,25 @@ +/* + * Read an entire line of text from a file. Return a buffer + * malloced to be as big as necessary (caller must free). + */ + +#include "defs.h" +#include "misc.h" + +char *fgetline(FILE *fp) +{ + char *ret = snewn(512, char); + size_t size = 512, len = 0; + while (fgets(ret + len, size - len, fp)) { + len += strlen(ret + len); + if (len > 0 && ret[len-1] == '\n') + break; /* got a newline, we're done */ + sgrowarrayn_nm(ret, size, len, 512); + } + if (len == 0) { /* first fgets returned NULL */ + sfree(ret); + return NULL; + } + ret[len] = '\0'; + return ret; +} diff --git a/code/utils/host_strchr.c b/code/utils/host_strchr.c new file mode 100644 index 0000000..363a915 --- /dev/null +++ b/code/utils/host_strchr.c @@ -0,0 +1,18 @@ +/* + * strchr-like wrapper around host_strchr_internal. + */ + +#include +#include + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +char *host_strchr(const char *s, int c) +{ + char set[2]; + set[0] = c; + set[1] = '\0'; + return (char *) host_strchr_internal(s, set, true); +} diff --git a/code/utils/host_strchr_internal.c b/code/utils/host_strchr_internal.c new file mode 100644 index 0000000..f995b53 --- /dev/null +++ b/code/utils/host_strchr_internal.c @@ -0,0 +1,80 @@ +/* + * Find a character in a string, unless it's a colon contained within + * square brackets. Used for untangling strings of the form + * 'host:port', where host can be an IPv6 literal. + * + * This internal function provides an API that's a bit like strchr (in + * that it returns a pointer to the character it found, or NULL), and + * a bit like strcspn (in that you can give it a set of characters to + * look for, not just one). Also it has an option to return the first + * or last character it finds. Other functions in the utils directory + * provide wrappers on it with APIs more like familiar + * functions. + */ + +#include +#include + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +const char *host_strchr_internal(const char *s, const char *set, bool first) +{ + int brackets = 0; + const char *ret = NULL; + + while (1) { + if (!*s) + return ret; + + if (*s == '[') + brackets++; + else if (*s == ']' && brackets > 0) + brackets--; + else if (brackets && *s == ':') + /* never match */ ; + else if (strchr(set, *s)) { + ret = s; + if (first) + return ret; + } + + s++; + } +} + +#ifdef TEST + +int main(void) +{ + int passes = 0, fails = 0; + +#define TEST1(func, string, arg2, suffix, result) do \ + { \ + const char *str = string; \ + unsigned ret = func(str, arg2) suffix; \ + if (ret == result) { \ + passes++; \ + } else { \ + printf("fail: %s(%s,%s)%s = %u, expected %u\n", \ + #func, #string, #arg2, #suffix, ret, \ + (unsigned)result); \ + fails++; \ + } \ +} while (0) + + TEST1(host_strchr, "[1:2:3]:4:5", ':', -str, 7); + TEST1(host_strrchr, "[1:2:3]:4:5", ':', -str, 9); + TEST1(host_strcspn, "[1:2:3]:4:5", "/:",, 7); + TEST1(host_strchr, "[1:2:3]", ':', == NULL, 1); + TEST1(host_strrchr, "[1:2:3]", ':', == NULL, 1); + TEST1(host_strcspn, "[1:2:3]", "/:",, 7); + TEST1(host_strcspn, "[1:2/3]", "/:",, 4); + TEST1(host_strcspn, "[1:2:3]/", "/:",, 7); + + printf("passed %d failed %d total %d\n", passes, fails, passes+fails); + return fails != 0 ? 1 : 0; +} + +#endif /* TEST */ diff --git a/code/utils/host_strcspn.c b/code/utils/host_strcspn.c new file mode 100644 index 0000000..958f47f --- /dev/null +++ b/code/utils/host_strcspn.c @@ -0,0 +1,19 @@ +/* + * strcspn-like wrapper around host_strchr_internal. + */ + +#include +#include + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +size_t host_strcspn(const char *s, const char *set) +{ + const char *answer = host_strchr_internal(s, set, true); + if (answer) + return answer - s; + else + return strlen(s); +} diff --git a/code/utils/host_strduptrim.c b/code/utils/host_strduptrim.c new file mode 100644 index 0000000..94492e6 --- /dev/null +++ b/code/utils/host_strduptrim.c @@ -0,0 +1,51 @@ +/* + * Trim square brackets off the outside of an IPv6 address literal. + * Leave all other strings unchanged. Returns a fresh dynamically + * allocated string. + */ + +#include +#include + +#include "defs.h" +#include "misc.h" + +char *host_strduptrim(const char *s) +{ + if (s[0] == '[') { + const char *p = s+1; + int colons = 0; + while (*p && *p != ']') { + if (isxdigit((unsigned char)*p)) + /* OK */; + else if (*p == ':') + colons++; + else + break; + p++; + } + if (*p == '%') { + /* + * This delimiter character introduces an RFC 4007 scope + * id suffix (e.g. suffixing the address literal with + * %eth1 or %2 or some such). There's no syntax + * specification for the scope id, so just accept anything + * except the closing ]. + */ + p += strcspn(p, "]"); + } + if (*p == ']' && !p[1] && colons > 1) { + /* + * This looks like an IPv6 address literal (hex digits and + * at least two colons, plus optional scope id, contained + * in square brackets). Trim off the brackets. + */ + return dupprintf("%.*s", (int)(p - (s+1)), s+1); + } + } + + /* + * Any other shape of string is simply duplicated. + */ + return dupstr(s); +} diff --git a/code/utils/host_strrchr.c b/code/utils/host_strrchr.c new file mode 100644 index 0000000..a1dd4c9 --- /dev/null +++ b/code/utils/host_strrchr.c @@ -0,0 +1,18 @@ +/* + * strchr-like wrapper around host_strchr_internal. + */ + +#include +#include + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +char *host_strrchr(const char *s, int c) +{ + char set[2]; + set[0] = c; + set[1] = '\0'; + return (char *) host_strchr_internal(s, set, false); +} diff --git a/code/be_misc.c b/code/utils/log_proxy_stderr.c similarity index 61% rename from code/be_misc.c rename to code/utils/log_proxy_stderr.c index 7f50a64..90025e0 100644 --- a/code/be_misc.c +++ b/code/utils/log_proxy_stderr.c @@ -1,67 +1,9 @@ -/* - * be_misc.c: helper functions shared between main network backends. - */ - #include #include #include "putty.h" #include "network.h" -void backend_socket_log(Seat *seat, LogContext *logctx, - PlugLogType type, SockAddr *addr, int port, - const char *error_msg, int error_code, Conf *conf, - bool session_started) -{ - char addrbuf[256], *msg; - - switch (type) { - case PLUGLOG_CONNECT_TRYING: - sk_getaddr(addr, addrbuf, lenof(addrbuf)); - if (sk_addr_needs_port(addr)) { - msg = dupprintf("Connecting to %s port %d", addrbuf, port); - } else { - msg = dupprintf("Connecting to %s", addrbuf); - } - break; - case PLUGLOG_CONNECT_FAILED: - sk_getaddr(addr, addrbuf, lenof(addrbuf)); - msg = dupprintf("Failed to connect to %s: %s", addrbuf, error_msg); - break; - case PLUGLOG_CONNECT_SUCCESS: - sk_getaddr(addr, addrbuf, lenof(addrbuf)); - msg = dupprintf("Connected to %s", addrbuf); - break; - case PLUGLOG_PROXY_MSG: { - /* Proxy-related log messages have their own identifying - * prefix already, put on by our caller. */ - int len, log_to_term; - - /* Suffix \r\n temporarily, so we can log to the terminal. */ - msg = dupprintf("%s\r\n", error_msg); - len = strlen(msg); - assert(len >= 2); - - log_to_term = conf_get_int(conf, CONF_proxy_log_to_term); - if (log_to_term == AUTO) - log_to_term = session_started ? FORCE_OFF : FORCE_ON; - if (log_to_term == FORCE_ON) - seat_stderr(seat, msg, len); - - msg[len-2] = '\0'; /* remove the \r\n again */ - break; - } - default: - msg = NULL; /* shouldn't happen, but placate optimiser */ - break; - } - - if (msg) { - logevent(logctx, msg); - sfree(msg); - } -} - void psb_init(ProxyStderrBuf *psb) { psb->size = 0; diff --git a/code/time.c b/code/utils/ltime.c similarity index 100% rename from code/time.c rename to code/utils/ltime.c diff --git a/code/utils/make_spr_sw_abort_static.c b/code/utils/make_spr_sw_abort_static.c new file mode 100644 index 0000000..f9eac59 --- /dev/null +++ b/code/utils/make_spr_sw_abort_static.c @@ -0,0 +1,21 @@ +/* + * Constructor function for a SeatPromptResult of the 'software abort' + * category, whose error message is in the simplest possible form of a + * static string constant. + */ + +#include "putty.h" + +static void spr_static_errfn(SeatPromptResult spr, BinarySink *bs) +{ + put_dataz(bs, spr.errdata_lit); +} + +SeatPromptResult make_spr_sw_abort_static(const char *str) +{ + SeatPromptResult spr; + spr.kind = SPRK_SW_ABORT; + spr.errfn = spr_static_errfn; + spr.errdata_lit = str; + return spr; +} diff --git a/code/marshal.c b/code/utils/marshal.c similarity index 93% rename from code/marshal.c rename to code/utils/marshal.c index ff9bb85..534ecf5 100644 --- a/code/marshal.c +++ b/code/utils/marshal.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -78,7 +79,7 @@ void BinarySink_put_stringz(BinarySink *bs, const char *str) BinarySink_put_string(bs, str, strlen(str)); } -void BinarySink_put_stringsb(BinarySink *bs, struct strbuf *buf) +void BinarySink_put_stringsb(BinarySink *bs, strbuf *buf) { BinarySink_put_string(bs, buf->s, buf->len); strbuf_free(buf); @@ -99,6 +100,25 @@ bool BinarySink_put_pstring(BinarySink *bs, const char *str) return true; } +void BinarySink_put_fmtv(BinarySink *bs, const char *fmt, va_list ap) +{ + if (bs->writefmtv) { + bs->writefmtv(bs, fmt, ap); + } else { + char *str = dupvprintf(fmt, ap); + bs->write(bs, str, strlen(str)); + burnstr(str); + } +} + +void BinarySink_put_fmt(BinarySink *bs, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + BinarySink_put_fmtv(bs, fmt, ap); + va_end(ap); +} + /* ---------------------------------------------------------------------- */ static bool BinarySource_data_avail(BinarySource *src, size_t wanted) diff --git a/code/memory.c b/code/utils/memory.c similarity index 100% rename from code/memory.c rename to code/utils/memory.c diff --git a/code/utils/memxor.c b/code/utils/memxor.c new file mode 100644 index 0000000..4fd41f4 --- /dev/null +++ b/code/utils/memxor.c @@ -0,0 +1,34 @@ +/* + * XOR two pieces of memory, copying the result into a third, which + * may precisely alias one of the input pair (but no guarantees if it + * partially overlaps). + */ + +#include "defs.h" +#include "misc.h" + +void memxor(uint8_t *out, const uint8_t *in1, const uint8_t *in2, size_t size) +{ + switch (size & 15) { + case 0: + while (size >= 16) { + size -= 16; + *out++ = *in1++ ^ *in2++; + case 15: *out++ = *in1++ ^ *in2++; + case 14: *out++ = *in1++ ^ *in2++; + case 13: *out++ = *in1++ ^ *in2++; + case 12: *out++ = *in1++ ^ *in2++; + case 11: *out++ = *in1++ ^ *in2++; + case 10: *out++ = *in1++ ^ *in2++; + case 9: *out++ = *in1++ ^ *in2++; + case 8: *out++ = *in1++ ^ *in2++; + case 7: *out++ = *in1++ ^ *in2++; + case 6: *out++ = *in1++ ^ *in2++; + case 5: *out++ = *in1++ ^ *in2++; + case 4: *out++ = *in1++ ^ *in2++; + case 3: *out++ = *in1++ ^ *in2++; + case 2: *out++ = *in1++ ^ *in2++; + case 1: *out++ = *in1++ ^ *in2++; + } + } +} diff --git a/code/utils/null_lp.c b/code/utils/null_lp.c new file mode 100644 index 0000000..193c339 --- /dev/null +++ b/code/utils/null_lp.c @@ -0,0 +1,8 @@ +/* + * Stub methods usable by LogPolicy implementations. + */ + +#include "putty.h" + +bool null_lp_verbose_no(LogPolicy *lp) { return false; } +bool null_lp_verbose_yes(LogPolicy *lp) { return true; } diff --git a/code/utils/nullseat.c b/code/utils/nullseat.c new file mode 100644 index 0000000..ba09839 --- /dev/null +++ b/code/utils/nullseat.c @@ -0,0 +1,54 @@ +/* + * Stub methods usable by Seat implementations. + */ + +#include "putty.h" + +size_t nullseat_output( + Seat *seat, SeatOutputType type, const void *data, size_t len) {return 0;} +bool nullseat_eof(Seat *seat) { return true; } +void nullseat_sent(Seat *seat, size_t bufsize) {} +size_t nullseat_banner(Seat *seat, const void *data, size_t len) {return 0;} +size_t nullseat_banner_to_stderr(Seat *seat, const void *data, size_t len) +{ return seat_output(seat, SEAT_OUTPUT_STDERR, data, len); } +SeatPromptResult nullseat_get_userpass_input(Seat *seat, prompts_t *p) +{ return SPR_SW_ABORT("this seat can't handle interactive prompts"); } +void nullseat_notify_session_started(Seat *seat) {} +void nullseat_notify_remote_exit(Seat *seat) {} +void nullseat_notify_remote_disconnect(Seat *seat) {} +void nullseat_connection_fatal(Seat *seat, const char *message) {} +void nullseat_update_specials_menu(Seat *seat) {} +char *nullseat_get_ttymode(Seat *seat, const char *mode) { return NULL; } +void nullseat_set_busy_status(Seat *seat, BusyStatus status) {} +SeatPromptResult nullseat_confirm_ssh_host_key( + Seat *seat, const char *host, int port, const char *keytype, + char *keystr, const char *keydisp, char **key_fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ return SPR_SW_ABORT("this seat can't handle interactive prompts"); } +SeatPromptResult nullseat_confirm_weak_crypto_primitive( + Seat *seat, const char *algtype, const char *algname, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ return SPR_SW_ABORT("this seat can't handle interactive prompts"); } +SeatPromptResult nullseat_confirm_weak_cached_hostkey( + Seat *seat, const char *algname, const char *betteralgs, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ return SPR_SW_ABORT("this seat can't handle interactive prompts"); } +bool nullseat_is_never_utf8(Seat *seat) { return false; } +bool nullseat_is_always_utf8(Seat *seat) { return true; } +void nullseat_echoedit_update(Seat *seat, bool echoing, bool editing) {} +const char *nullseat_get_x_display(Seat *seat) { return NULL; } +bool nullseat_get_windowid(Seat *seat, long *id_out) { return false; } +bool nullseat_get_window_pixel_size( + Seat *seat, int *width, int *height) { return false; } +StripCtrlChars *nullseat_stripctrl_new( + Seat *seat, BinarySink *bs_out, SeatInteractionContext sic) {return NULL;} +void nullseat_set_trust_status(Seat *seat, bool trusted) {} +bool nullseat_can_set_trust_status_yes(Seat *seat) { return true; } +bool nullseat_can_set_trust_status_no(Seat *seat) { return false; } +bool nullseat_has_mixed_input_stream_yes(Seat *seat) { return true; } +bool nullseat_has_mixed_input_stream_no(Seat *seat) { return false; } +bool nullseat_verbose_no(Seat *seat) { return false; } +bool nullseat_verbose_yes(Seat *seat) { return true; } +bool nullseat_interactive_no(Seat *seat) { return false; } +bool nullseat_interactive_yes(Seat *seat) { return true; } +bool nullseat_get_cursor_position(Seat *seat, int *x, int *y) { return false; } diff --git a/code/utils/nullstrcmp.c b/code/utils/nullstrcmp.c new file mode 100644 index 0000000..a9e50f4 --- /dev/null +++ b/code/utils/nullstrcmp.c @@ -0,0 +1,21 @@ +/* + * Compare two strings, just like strcmp, except that we tolerate null + * pointers as a legal input, and define them to compare before any + * non-null string (even the empty string). + */ + +#include + +#include "defs.h" +#include "misc.h" + +int nullstrcmp(const char *a, const char *b) +{ + if (a == NULL && b == NULL) + return 0; + if (a == NULL) + return -1; + if (b == NULL) + return +1; + return strcmp(a, b); +} diff --git a/code/utils/out_of_memory.c b/code/utils/out_of_memory.c new file mode 100644 index 0000000..1c9cb25 --- /dev/null +++ b/code/utils/out_of_memory.c @@ -0,0 +1,11 @@ +/* + * Standard implementation of the out_of_memory function called by our + * malloc wrappers. + */ + +#include "putty.h" + +void out_of_memory(void) +{ + modalfatalbox("Out of memory"); +} diff --git a/code/utils/parse_blocksize.c b/code/utils/parse_blocksize.c new file mode 100644 index 0000000..3d55927 --- /dev/null +++ b/code/utils/parse_blocksize.c @@ -0,0 +1,40 @@ +/* + * Parse a string block size specification. This is approximately a + * subset of the block size specs supported by GNU fileutils: + * "nk" = n kilobytes + * "nM" = n megabytes + * "nG" = n gigabytes + * All numbers are decimal, and suffixes refer to powers of two. + * Case-insensitive. + */ + +#include +#include +#include + +#include "defs.h" +#include "misc.h" + +unsigned long parse_blocksize(const char *bs) +{ + char *suf; + unsigned long r = strtoul(bs, &suf, 10); + if (*suf != '\0') { + while (*suf && isspace((unsigned char)*suf)) suf++; + switch (*suf) { + case 'k': case 'K': + r *= 1024ul; + break; + case 'm': case 'M': + r *= 1024ul * 1024ul; + break; + case 'g': case 'G': + r *= 1024ul * 1024ul * 1024ul; + break; + case '\0': + default: + break; + } + } + return r; +} diff --git a/code/utils/prompts.c b/code/utils/prompts.c new file mode 100644 index 0000000..d082333 --- /dev/null +++ b/code/utils/prompts.c @@ -0,0 +1,69 @@ +/* + * Functions for making, destroying, and manipulating prompts_t + * structures. + */ + +#include "putty.h" + +prompts_t *new_prompts(void) +{ + prompts_t *p = snew(prompts_t); + p->prompts = NULL; + p->n_prompts = p->prompts_size = 0; + p->data = NULL; + p->spr = SPR_INCOMPLETE; + p->to_server = true; /* to be on the safe side */ + p->name = p->instruction = NULL; + p->name_reqd = p->instr_reqd = false; + p->callback = NULL; + p->callback_ctx = NULL; + p->ldisc_ptr_to_us = NULL; + return p; +} + +void add_prompt(prompts_t *p, char *promptstr, bool echo) +{ + prompt_t *pr = snew(prompt_t); + pr->prompt = promptstr; + pr->echo = echo; + pr->result = strbuf_new_nm(); + sgrowarray(p->prompts, p->prompts_size, p->n_prompts); + p->prompts[p->n_prompts++] = pr; +} + +void prompt_set_result(prompt_t *pr, const char *newstr) +{ + strbuf_clear(pr->result); + put_dataz(pr->result, newstr); +} + +const char *prompt_get_result_ref(prompt_t *pr) +{ + return pr->result->s; +} + +char *prompt_get_result(prompt_t *pr) +{ + return dupstr(pr->result->s); +} + +void free_prompts(prompts_t *p) +{ + size_t i; + + /* If an Ldisc currently knows about us, tell it to forget us, so + * it won't dereference a stale pointer later. */ + if (p->ldisc_ptr_to_us) + *p->ldisc_ptr_to_us = NULL; + + for (i=0; i < p->n_prompts; i++) { + prompt_t *pr = p->prompts[i]; + strbuf_free(pr->result); + sfree(pr->prompt); + sfree(pr); + } + sfree(p->prompts); + sfree(p->name); + sfree(p->instruction); + sfree(p); +} diff --git a/code/utils/ptrlen.c b/code/utils/ptrlen.c new file mode 100644 index 0000000..7d4e12e --- /dev/null +++ b/code/utils/ptrlen.c @@ -0,0 +1,94 @@ +/* + * Functions to deal with ptrlens. + */ + +#include "defs.h" +#include "misc.h" + +bool ptrlen_eq_string(ptrlen pl, const char *str) +{ + size_t len = strlen(str); + return (pl.len == len && !memcmp(pl.ptr, str, len)); +} + +bool ptrlen_eq_ptrlen(ptrlen pl1, ptrlen pl2) +{ + return (pl1.len == pl2.len && !memcmp(pl1.ptr, pl2.ptr, pl1.len)); +} + +int ptrlen_strcmp(ptrlen pl1, ptrlen pl2) +{ + size_t minlen = pl1.len < pl2.len ? pl1.len : pl2.len; + if (minlen) { /* tolerate plX.ptr==NULL as long as plX.len==0 */ + int cmp = memcmp(pl1.ptr, pl2.ptr, minlen); + if (cmp) + return cmp; + } + return pl1.len < pl2.len ? -1 : pl1.len > pl2.len ? +1 : 0; +} + +bool ptrlen_startswith(ptrlen whole, ptrlen prefix, ptrlen *tail) +{ + if (whole.len >= prefix.len && + !memcmp(whole.ptr, prefix.ptr, prefix.len)) { + if (tail) { + tail->ptr = (const char *)whole.ptr + prefix.len; + tail->len = whole.len - prefix.len; + } + return true; + } + return false; +} + +bool ptrlen_endswith(ptrlen whole, ptrlen suffix, ptrlen *tail) +{ + if (whole.len >= suffix.len && + !memcmp((char *)whole.ptr + (whole.len - suffix.len), + suffix.ptr, suffix.len)) { + if (tail) { + tail->ptr = whole.ptr; + tail->len = whole.len - suffix.len; + } + return true; + } + return false; +} + +ptrlen ptrlen_get_word(ptrlen *input, const char *separators) +{ + const char *p = input->ptr, *end = p + input->len; + ptrlen toret; + + while (p < end && strchr(separators, *p)) + p++; + toret.ptr = p; + while (p < end && !strchr(separators, *p)) + p++; + toret.len = p - (const char *)toret.ptr; + + size_t to_consume = p - (const char *)input->ptr; + assert(to_consume <= input->len); + input->ptr = (const char *)input->ptr + to_consume; + input->len -= to_consume; + + return toret; +} + +char *mkstr(ptrlen pl) +{ + char *p = snewn(pl.len + 1, char); + memcpy(p, pl.ptr, pl.len); + p[pl.len] = '\0'; + return p; +} + +bool strstartswith(const char *s, const char *t) +{ + return !strncmp(s, t, strlen(t)); +} + +bool strendswith(const char *s, const char *t) +{ + size_t slen = strlen(s), tlen = strlen(t); + return slen >= tlen && !strcmp(s + (slen - tlen), t); +} diff --git a/code/utils/read_file_into.c b/code/utils/read_file_into.c new file mode 100644 index 0000000..5956948 --- /dev/null +++ b/code/utils/read_file_into.c @@ -0,0 +1,19 @@ +/* + * Read an entire file into a BinarySink. + */ + +#include + +#include "defs.h" +#include "misc.h" + +bool read_file_into(BinarySink *bs, FILE *fp) +{ + char buf[4096]; + while (1) { + size_t retd = fread(buf, 1, sizeof(buf), fp); + if (retd == 0) + return !ferror(fp); + put_data(bs, buf, retd); + } +} diff --git a/code/utils/seat_connection_fatal.c b/code/utils/seat_connection_fatal.c new file mode 100644 index 0000000..9b0186b --- /dev/null +++ b/code/utils/seat_connection_fatal.c @@ -0,0 +1,20 @@ +/* + * Wrapper function for the connection_fatal() method of a Seat, + * providing printf-style formatting. + */ + +#include "putty.h" + +void seat_connection_fatal(Seat *seat, const char *fmt, ...) +{ + va_list ap; + char *msg; + + va_start(ap, fmt); + msg = dupvprintf(fmt, ap); + va_end(ap); + + seat->vt->connection_fatal(seat, msg); + sfree(msg); /* if we return */ +} + diff --git a/code/sessprep.c b/code/utils/sessprep.c similarity index 100% rename from code/sessprep.c rename to code/utils/sessprep.c diff --git a/code/utils/sk_free_peer_info.c b/code/utils/sk_free_peer_info.c new file mode 100644 index 0000000..a66e09d --- /dev/null +++ b/code/utils/sk_free_peer_info.c @@ -0,0 +1,14 @@ +/* + * Free a SocketPeerInfo, and everything that dangles off it. + */ + +#include "putty.h" + +void sk_free_peer_info(SocketPeerInfo *pi) +{ + if (pi) { + sfree((char *)pi->addr_text); + sfree((char *)pi->log_text); + sfree(pi); + } +} diff --git a/code/utils/smemclr.c b/code/utils/smemclr.c new file mode 100644 index 0000000..5503bdc --- /dev/null +++ b/code/utils/smemclr.c @@ -0,0 +1,52 @@ +/* + * Securely wipe memory. + * + * The actual wiping is no different from what memset would do: the + * point of 'securely' is to try to be sure over-clever compilers + * won't optimise away memsets on variables that are about to be freed + * or go out of scope. See + * https://buildsecurityin.us-cert.gov/bsi-rules/home/g1/771-BSI.html + */ + +#include "defs.h" +#include "misc.h" + +/* + * Trivial function that is given a pointer to some memory and ignores + * it. + */ +static void no_op(void *ptr, size_t size) {} + +/* + * Function pointer that is given a pointer to some memory, and from + * the compiler's point of view, _might_ read it, or otherwise depend + * on its contents. + * + * In fact, this function pointer always points to no_op() above. But + * because the pointer itself is volatile-qualified, the compiler + * isn't allowed to optimise based on the assumption that that will + * always be the case. So it has to call through the function pointer + * anyway, on the basis that it _might_ have magically changed at run + * time into a pointer to some completely arbitrary function. And + * therefore it must also avoid optimising away any observable effect + * beforehand that a completely arbitrary function might depend on - + * such as the zeroing of our memory region. + */ +static void (*const volatile maybe_read)(void *ptr, size_t size) = no_op; + +void smemclr(void *b, size_t n) +{ + if (b && n > 0) { + /* + * Zero out the memory. + */ + memset(b, 0, n); + + /* + * Call the above function pointer, which (for all the + * compiler knows) might check that we've really zeroed the + * memory. + */ + maybe_read(b, n); + } +} diff --git a/code/utils/smemeq.c b/code/utils/smemeq.c new file mode 100644 index 0000000..2692d13 --- /dev/null +++ b/code/utils/smemeq.c @@ -0,0 +1,25 @@ +/* + * Compare two fixed-size regions of memory, in a crypto-safe way, + * i.e. without timing or cache side channels indicating anything + * about what the answer was or where the first difference (if any) + * might have been. + */ + +#include "defs.h" +#include "misc.h" + +bool smemeq(const void *av, const void *bv, size_t len) +{ + const unsigned char *a = (const unsigned char *)av; + const unsigned char *b = (const unsigned char *)bv; + unsigned val = 0; + + while (len-- > 0) { + val |= *a++ ^ *b++; + } + /* Now val is 0 iff we want to return 1, and in the range + * 0x01..0xFF iff we want to return 0. So subtracting from 0x100 + * will clear bit 8 iff we want to return 0, and leave it set iff + * we want to return 1, so then we can just shift down. */ + return (0x100 - val) >> 8; +} diff --git a/code/utils/spr_get_error_message.c b/code/utils/spr_get_error_message.c new file mode 100644 index 0000000..b9f81a4 --- /dev/null +++ b/code/utils/spr_get_error_message.c @@ -0,0 +1,13 @@ +/* + * Construct the error message from a SeatPromptResult, and return it + * in a dynamically allocated string. + */ + +#include "putty.h" + +char *spr_get_error_message(SeatPromptResult spr) +{ + strbuf *sb = strbuf_new(); + spr.errfn(spr, BinarySink_UPCAST(sb)); + return strbuf_to_str(sb); +} diff --git a/code/utils/ssh2_pick_fingerprint.c b/code/utils/ssh2_pick_fingerprint.c new file mode 100644 index 0000000..f81b2f1 --- /dev/null +++ b/code/utils/ssh2_pick_fingerprint.c @@ -0,0 +1,27 @@ +/* + * Choose an SSH-2 fingerprint type, out of an array of possible ones. + */ + +#include "defs.h" +#include "misc.h" +#include "ssh.h" + +FingerprintType ssh2_pick_fingerprint( + char **fingerprints, FingerprintType preferred_type) +{ + /* + * Keys are either SSH-2, in which case we have all fingerprint + * types, or SSH-1, in which case we have only MD5. So we return + * the default type if we can, or MD5 if that's all we have; no + * need for a fully general preference-list system. + */ + FingerprintType fptype = fingerprints[preferred_type] ? + preferred_type : SSH_FPTYPE_MD5; + assert(fingerprints[fptype]); + return fptype; +} + +FingerprintType ssh2_pick_default_fingerprint(char **fingerprints) +{ + return ssh2_pick_fingerprint(fingerprints, SSH_FPTYPE_DEFAULT); +} diff --git a/code/sshutils.c b/code/utils/sshutils.c similarity index 99% rename from code/sshutils.c rename to code/utils/sshutils.c index 1ee3342..49e8221 100644 --- a/code/sshutils.c +++ b/code/utils/sshutils.c @@ -8,7 +8,7 @@ #include "putty.h" #include "ssh.h" -#include "sshchan.h" +#include "ssh/channel.h" /* ---------------------------------------------------------------------- * Centralised standard methods for other channel implementations to diff --git a/code/utils/strbuf.c b/code/utils/strbuf.c new file mode 100644 index 0000000..636467a --- /dev/null +++ b/code/utils/strbuf.c @@ -0,0 +1,114 @@ +/* + * Functions to work with strbufs. + */ + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +struct strbuf_impl { + size_t size; + struct strbuf visible; + bool nm; /* true if we insist on non-moving buffer resizes */ +}; + +#define STRBUF_SET_UPTR(buf) \ + ((buf)->visible.u = (unsigned char *)(buf)->visible.s) +#define STRBUF_SET_PTR(buf, ptr) \ + ((buf)->visible.s = (ptr), STRBUF_SET_UPTR(buf)) + +void *strbuf_append(strbuf *buf_o, size_t len) +{ + struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); + char *toret; + sgrowarray_general( + buf->visible.s, buf->size, buf->visible.len + 1, len, buf->nm); + STRBUF_SET_UPTR(buf); + toret = buf->visible.s + buf->visible.len; + buf->visible.len += len; + buf->visible.s[buf->visible.len] = '\0'; + return toret; +} + +void strbuf_shrink_to(strbuf *buf, size_t new_len) +{ + assert(new_len <= buf->len); + buf->len = new_len; + buf->s[buf->len] = '\0'; +} + +void strbuf_shrink_by(strbuf *buf, size_t amount_to_remove) +{ + assert(amount_to_remove <= buf->len); + buf->len -= amount_to_remove; + buf->s[buf->len] = '\0'; +} + +bool strbuf_chomp(strbuf *buf, char char_to_remove) +{ + if (buf->len > 0 && buf->s[buf->len-1] == char_to_remove) { + strbuf_shrink_by(buf, 1); + return true; + } + return false; +} + +static void strbuf_BinarySink_write( + BinarySink *bs, const void *data, size_t len) +{ + strbuf *buf_o = BinarySink_DOWNCAST(bs, strbuf); + memcpy(strbuf_append(buf_o, len), data, len); +} + +static void strbuf_BinarySink_writefmtv( + BinarySink *bs, const char *fmt, va_list ap) +{ + strbuf *buf_o = BinarySink_DOWNCAST(bs, strbuf); + struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); + STRBUF_SET_PTR(buf, dupvprintf_inner(buf->visible.s, buf->visible.len, + &buf->size, fmt, ap)); + buf->visible.len += strlen(buf->visible.s + buf->visible.len); +} + +static strbuf *strbuf_new_general(bool nm) +{ + struct strbuf_impl *buf = snew(struct strbuf_impl); + BinarySink_INIT(&buf->visible, strbuf_BinarySink_write); + buf->visible.binarysink_->writefmtv = strbuf_BinarySink_writefmtv; + buf->visible.len = 0; + buf->size = 512; + buf->nm = nm; + STRBUF_SET_PTR(buf, snewn(buf->size, char)); + *buf->visible.s = '\0'; + return &buf->visible; +} +strbuf *strbuf_new(void) { return strbuf_new_general(false); } +strbuf *strbuf_new_nm(void) { return strbuf_new_general(true); } +void strbuf_free(strbuf *buf_o) +{ + struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); + if (buf->visible.s) { + smemclr(buf->visible.s, buf->size); + sfree(buf->visible.s); + } + sfree(buf); +} +char *strbuf_to_str(strbuf *buf_o) +{ + struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); + char *ret = buf->visible.s; + sfree(buf); + return ret; +} +strbuf *strbuf_new_for_agent_query(void) +{ + strbuf *buf = strbuf_new(); + strbuf_append(buf, 4); + return buf; +} +void strbuf_finalise_agent_query(strbuf *buf_o) +{ + struct strbuf_impl *buf = container_of(buf_o, struct strbuf_impl, visible); + assert(buf->visible.len >= 5); + PUT_32BIT_MSB_FIRST(buf->visible.u, buf->visible.len - 4); +} diff --git a/code/utils/string_length_for_printf.c b/code/utils/string_length_for_printf.c new file mode 100644 index 0000000..8b45531 --- /dev/null +++ b/code/utils/string_length_for_printf.c @@ -0,0 +1,21 @@ +/* + * Convert a size_t value to int, by saturating it at INT_MAX. Useful + * if you want to use the printf idiom "%.*s", where the '*' precision + * specifier expects an int in the variadic argument list, but what + * you have is not an int but a size_t. This method of converting to + * int will at least do something _safe_ with overlong values, even if + * (due to the limitation of printf itself) the whole string still + * won't be printed. + */ + +#include + +#include "defs.h" +#include "misc.h" + +int string_length_for_printf(size_t s) +{ + if (s > INT_MAX) + return INT_MAX; + return s; +} diff --git a/code/stripctrl.c b/code/utils/stripctrl.c similarity index 99% rename from code/stripctrl.c rename to code/utils/stripctrl.c index 58289b1..d723a07 100644 --- a/code/stripctrl.c +++ b/code/utils/stripctrl.c @@ -305,7 +305,7 @@ static void stripctrl_locale_BinarySink_write( container_of(sccpub, StripCtrlCharsImpl, public); const char *p = (const char *)vp; - const char *previous_locale = setlocale(LC_CTYPE, NULL); + char *previous_locale = dupstr(setlocale(LC_CTYPE, NULL)); setlocale(LC_CTYPE, ""); /* @@ -391,6 +391,7 @@ static void stripctrl_locale_BinarySink_write( out: setlocale(LC_CTYPE, previous_locale); + sfree(previous_locale); } static void stripctrl_term_BinarySink_write( diff --git a/code/utils/tempseat.c b/code/utils/tempseat.c new file mode 100644 index 0000000..785c00c --- /dev/null +++ b/code/utils/tempseat.c @@ -0,0 +1,418 @@ +/* + * Implementation of the Seat trait that buffers output and other + * events until it can give them back to a real Seat. + * + * This is used by the SSH proxying code, which temporarily takes over + * the real user-facing Seat so that it can issue host key warnings, + * password prompts etc for the proxy SSH connection. While it's got + * the real Seat, it gives the primary connection's backend one of + * these temporary Seats in the interim, so that if the backend wants + * to send some kind of initial output, or start by reconfiguring the + * trust status, or what have you, then it can do that without having + * to keep careful track of the fact that its Seat is out on loan. + */ + +#include "putty.h" + +struct output_chunk { + struct output_chunk *next; + SeatOutputType type; + size_t size; +}; + +typedef struct TempSeat TempSeat; +struct TempSeat { + Seat *realseat; + + /* + * Single bufchain to hold all the buffered output, regardless of + * its type. + */ + bufchain output; + + /* + * List of pieces of that bufchain that are intended for one or + * another output destination + */ + struct output_chunk *outchunk_head, *outchunk_tail; + + bool seen_session_started; + bool seen_remote_exit; + bool seen_remote_disconnect; + bool seen_update_specials_menu; + bool seen_echoedit_update, echoing, editing; + bool seen_trust_status, trusted; + + Seat seat; +}; + +/* ---------------------------------------------------------------------- + * Methods we can usefully buffer, and pass their results on to the + * real Seat in tempseat_flush(). + */ + +static size_t tempseat_output(Seat *seat, SeatOutputType type, + const void *data, size_t len) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + + bufchain_add(&ts->output, data, len); + + if (!(ts->outchunk_tail && ts->outchunk_tail->type == type)) { + struct output_chunk *new_chunk = snew(struct output_chunk); + + new_chunk->type = type; + new_chunk->size = 0; + + new_chunk->next = NULL; + if (ts->outchunk_tail) + ts->outchunk_tail->next = new_chunk; + else + ts->outchunk_head = new_chunk; + ts->outchunk_tail = new_chunk; + } + ts->outchunk_tail->size += len; + + return bufchain_size(&ts->output); +} + +static void tempseat_notify_session_started(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + ts->seen_session_started = true; +} + +static void tempseat_notify_remote_exit(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + ts->seen_remote_exit = true; +} + +static void tempseat_notify_remote_disconnect(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + ts->seen_remote_disconnect = true; +} + +static void tempseat_update_specials_menu(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + ts->seen_update_specials_menu = true; +} + +static void tempseat_echoedit_update(Seat *seat, bool echoing, bool editing) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + ts->seen_echoedit_update = true; + ts->echoing = echoing; + ts->editing = editing; +} + +static void tempseat_set_trust_status(Seat *seat, bool trusted) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + ts->seen_trust_status = true; + ts->trusted = trusted; +} + +/* ---------------------------------------------------------------------- + * Methods we can safely pass straight on to the real Seat, usually + * (but not in every case) because they're read-only queries. + */ + +static char *tempseat_get_ttymode(Seat *seat, const char *mode) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_get_ttymode(ts->realseat, mode); +} + +static void tempseat_set_busy_status(Seat *seat, BusyStatus status) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + /* + * set_busy_status is generally called when something is about to + * do some single-threaded, event-loop blocking computation. This + * _shouldn't_ happen in a backend while it's waiting for a + * network connection to be made, but if for some reason it were + * to, there's no reason we can't just pass this straight to the + * real seat, because we expect that it will mark itself busy, + * compute, and mark itself unbusy, all between yields to the + * event loop that might give whatever else is using the real Seat + * an opportunity to do anything. + */ + seat_set_busy_status(ts->realseat, status); +} + +static bool tempseat_is_utf8(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_is_utf8(ts->realseat); +} + +static const char *tempseat_get_x_display(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_get_x_display(ts->realseat); +} + +static bool tempseat_get_windowid(Seat *seat, long *id_out) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_get_windowid(ts->realseat, id_out); +} + +static bool tempseat_get_window_pixel_size(Seat *seat, int *width, int *height) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_get_window_pixel_size(ts->realseat, width, height); +} + +static StripCtrlChars *tempseat_stripctrl_new( + Seat *seat, BinarySink *bs_out, SeatInteractionContext sic) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_stripctrl_new(ts->realseat, bs_out, sic); +} + +static bool tempseat_verbose(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_verbose(ts->realseat); +} + +static bool tempseat_interactive(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_interactive(ts->realseat); +} + +static bool tempseat_get_cursor_position(Seat *seat, int *x, int *y) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_get_cursor_position(ts->realseat, x, y); +} + +static bool tempseat_can_set_trust_status(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_can_set_trust_status(ts->realseat); +} + +static bool tempseat_has_mixed_input_stream(Seat *seat) +{ + TempSeat *ts = container_of(seat, TempSeat, seat); + return seat_has_mixed_input_stream(ts->realseat); +} + +/* ---------------------------------------------------------------------- + * Methods that should never be called on a TempSeat, so we can put an + * unreachable() in them. + * + * A backend in possession of a TempSeat ought to be sitting and + * patiently waiting for a network connection attempt to either + * succeed or fail. And it should be aware of the possibility that the + * proxy setup code to which it has lent the real Seat might need to + * present interactive prompts - that's the whole point of lending out + * the Seat in the first place - so it absolutely shouldn't get any + * ideas about issuing some kind of prompt of its own while it waits + * for the network connection. + */ + +static SeatPromptResult tempseat_get_userpass_input(Seat *seat, prompts_t *p) +{ + /* + * Interactive prompts of this nature are a thing that a backend + * MUST NOT do while not in possession of the real Seat, because + * the whole point of temporarily lending the real Seat to + * something else is that so it can have a clear field to do + * interactive stuff of its own while making a network connection. + */ + unreachable("get_userpass_input should never be called on TempSeat"); +} + +static size_t tempseat_banner(Seat *seat, const void *data, size_t len) +{ + unreachable("banner should never be called on TempSeat"); +} + +static SeatPromptResult tempseat_confirm_ssh_host_key( + Seat *seat, const char *host, int port, const char *keytype, + char *keystr, const char *keydisp, char **key_fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ + unreachable("confirm_ssh_host_key should never be called on TempSeat"); +} + +static SeatPromptResult tempseat_confirm_weak_crypto_primitive( + Seat *seat, const char *algtype, const char *algname, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ + unreachable("confirm_weak_crypto_primitive " + "should never be called on TempSeat"); +} + +static SeatPromptResult tempseat_confirm_weak_cached_hostkey( + Seat *seat, const char *algname, const char *betteralgs, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) +{ + unreachable("confirm_weak_cached_hostkey " + "should never be called on TempSeat"); +} + +static void tempseat_connection_fatal(Seat *seat, const char *message) +{ + /* + * Fatal errors are another thing a backend should not have any + * reason to encounter while waiting to hear back about its + * network connection setup. + * + * Also, if a backend _did_ call this, it would be hellish to + * unpick all the error handling. Just passing on the fatal error + * to the real Seat wouldn't be good enough: what about freeing + * all the various things that are confusingly holding pointers to + * each other? Better to leave this as an assertion-failure level + * issue, so that if it does ever happen by accident, we'll know + * it's a bug. + */ + unreachable("connection_fatal should never be called on TempSeat"); +} + +static bool tempseat_eof(Seat *seat) +{ + /* + * EOF is _very nearly_ something that we could buffer, and pass + * on to the real Seat at flush time. The only difficulty is that + * sometimes the front end wants to respond to an incoming EOF by + * instructing the back end to send an outgoing one, which it does + * by returning a bool from its eof method. + * + * So we'd have to arrange that tempseat_flush caught that return + * value and passed it on to the calling backend. And then every + * backend would have to deal with tempseat_flush maybe returning + * it an 'actually, please start closing down now' indication, + * which could only happen _in theory_, if it had for some reason + * called seat_eof on the TempSeat. + * + * But in fact, we don't expect back ends to call seat_eof on the + * TempSeat in the first place, so all of that effort would be a + * total waste. Hence, we'll put EOF in the category of things we + * expect backends never to do while the real Seat is out on loan. + */ + unreachable("eof should never be called on TempSeat"); +} + +/* ---------------------------------------------------------------------- + * Done with the TempSeat methods. Here's the vtable definition and + * the main setup/teardown code. + */ + +static const struct SeatVtable tempseat_vt = { + .output = tempseat_output, + .eof = tempseat_eof, + .sent = nullseat_sent, + .banner = tempseat_banner, + .get_userpass_input = tempseat_get_userpass_input, + .notify_session_started = tempseat_notify_session_started, + .notify_remote_exit = tempseat_notify_remote_exit, + .notify_remote_disconnect = tempseat_notify_remote_disconnect, + .connection_fatal = tempseat_connection_fatal, + .update_specials_menu = tempseat_update_specials_menu, + .get_ttymode = tempseat_get_ttymode, + .set_busy_status = tempseat_set_busy_status, + .confirm_ssh_host_key = tempseat_confirm_ssh_host_key, + .confirm_weak_crypto_primitive = tempseat_confirm_weak_crypto_primitive, + .confirm_weak_cached_hostkey = tempseat_confirm_weak_cached_hostkey, + .is_utf8 = tempseat_is_utf8, + .echoedit_update = tempseat_echoedit_update, + .get_x_display = tempseat_get_x_display, + .get_windowid = tempseat_get_windowid, + .get_window_pixel_size = tempseat_get_window_pixel_size, + .stripctrl_new = tempseat_stripctrl_new, + .set_trust_status = tempseat_set_trust_status, + .can_set_trust_status = tempseat_can_set_trust_status, + .has_mixed_input_stream = tempseat_has_mixed_input_stream, + .verbose = tempseat_verbose, + .interactive = tempseat_interactive, + .get_cursor_position = tempseat_get_cursor_position, +}; + +Seat *tempseat_new(Seat *realseat) +{ + TempSeat *ts = snew(TempSeat); + memset(ts, 0, sizeof(*ts)); + ts->seat.vt = &tempseat_vt; + + ts->realseat = realseat; + bufchain_init(&ts->output); + ts->outchunk_head = ts->outchunk_tail = NULL; + + return &ts->seat; +} + +bool is_tempseat(Seat *seat) +{ + return seat->vt == &tempseat_vt; +} + +Seat *tempseat_get_real(Seat *seat) +{ + assert(seat->vt == &tempseat_vt); + TempSeat *ts = container_of(seat, TempSeat, seat); + return ts->realseat; +} + +void tempseat_free(Seat *seat) +{ + assert(seat->vt == &tempseat_vt); + TempSeat *ts = container_of(seat, TempSeat, seat); + bufchain_clear(&ts->output); + while (ts->outchunk_head) { + struct output_chunk *chunk = ts->outchunk_head; + ts->outchunk_head = chunk->next; + sfree(chunk); + } + sfree(ts); +} + +void tempseat_flush(Seat *seat) +{ + assert(seat->vt == &tempseat_vt); + TempSeat *ts = container_of(seat, TempSeat, seat); + + /* Empty the output bufchains into the real seat, taking care to + * preserve both separation and interleaving */ + while (bufchain_size(&ts->output)) { + ptrlen pl = bufchain_prefix(&ts->output); + + assert(ts->outchunk_head); + struct output_chunk *chunk = ts->outchunk_head; + + if (pl.len > chunk->size) + pl.len = chunk->size; + + seat_output(ts->realseat, chunk->type, pl.ptr, pl.len); + bufchain_consume(&ts->output, pl.len); + chunk->size -= pl.len; + if (chunk->size == 0) { + ts->outchunk_head = chunk->next; + sfree(chunk); + } + } + + /* That should have exactly emptied the output chunk list too */ + assert(!ts->outchunk_head); + + /* Pass on any other kinds of event we've buffered */ + if (ts->seen_session_started) + seat_notify_session_started(ts->realseat); + if (ts->seen_remote_exit) + seat_notify_remote_exit(ts->realseat); + if (ts->seen_remote_disconnect) + seat_notify_remote_disconnect(ts->realseat); + if (ts->seen_update_specials_menu) + seat_update_specials_menu(ts->realseat); + if (ts->seen_echoedit_update) + seat_echoedit_update(ts->realseat, ts->echoing, ts->editing); + if (ts->seen_trust_status) + seat_set_trust_status(ts->realseat, ts->trusted); +} diff --git a/code/tree234.c b/code/utils/tree234.c similarity index 95% rename from code/tree234.c rename to code/utils/tree234.c index a590382..83683f1 100644 --- a/code/tree234.c +++ b/code/utils/tree234.c @@ -31,17 +31,16 @@ #include "defs.h" #include "tree234.h" +#include "puttymem.h" #ifdef TEST -#define LOG(x) (printf x) -#define snew(type) ((type *)malloc(sizeof(type))) -#define snewn(n, type) ((type *)malloc((n) * sizeof(type))) -#define sresize(ptr, n, type) \ - ((type *)realloc(sizeof((type *)0 == (ptr)) ? (ptr) : (ptr), \ - (n) * sizeof(type))) -#define sfree(ptr) free(ptr) +static int verbose = 0; +#define LOG(x) do \ + { \ + if (verbose > 2) \ + printf x; \ + } while (0) #else -#include "puttymem.h" #define LOG(x) #endif @@ -616,7 +615,7 @@ void search234_start(search234_state *state, tree234 *t) { state->_node = t->root; state->_base = 0; /* index of first element in this node's subtree */ - state->_last = -1; /* indicate that this node is not previously visted */ + state->_last = -1; /* indicate that this node is not previously visited */ search234_step(state, 0); } void search234_step(search234_state *state, int direction) @@ -1151,7 +1150,7 @@ int chknode(chkctx * ctx, int level, node234 * node, * nelems should be at least 1. */ if (nelems == 0) { - error("node %p: no elems", node, nkids); + error("node %p: no elems", node); } /* @@ -1173,7 +1172,7 @@ int chknode(chkctx * ctx, int level, node234 * node, (i + 1 == nelems ? highbound : node->elems[i + 1]); if (lower && higher && cmp(lower, higher) >= 0) { error("node %p: kid comparison [%d=%s,%d=%s] failed", - node, i, lower, i + 1, higher); + node, i, (char *)lower, i + 1, (char *)higher); } } } @@ -1223,9 +1222,10 @@ void verify(void) if (tree->root) { if (tree->root->parent != NULL) error("root->parent is %p should be null", tree->root->parent); - chknode(&ctx, 0, tree->root, NULL, NULL); + chknode(ctx, 0, tree->root, NULL, NULL); } - printf("tree depth: %d\n", ctx->treedepth); + if (verbose) + printf("tree depth: %d\n", ctx->treedepth); /* * Enumerate the tree and ensure it matches up to the array. */ @@ -1234,7 +1234,7 @@ void verify(void) error("tree contains more than %d elements", arraylen); if (array[i] != p) error("enum at position %d: array says %s, tree says %s", - i, array[i], p); + i, (char *)array[i], (char *)p); } if (ctx->elemcount != i) { error("tree really contains %d elements, enum gave %d", @@ -1379,7 +1379,7 @@ char *strings[] = { #define NSTR lenof(strings) -int findtest(void) +void findtest(void) { const static int rels[] = { REL234_EQ, REL234_GE, REL234_LE, REL234_LT, REL234_GT @@ -1444,17 +1444,16 @@ int findtest(void) p, relnames[j], realret, index, index, realret2); } } -#if 0 - printf("find(\"%s\",%s) gave %s(%d)\n", p, relnames[j], - realret, index); -#endif + if (verbose) + printf("find(\"%s\",%s) gave %s(%d)\n", p, relnames[j], + realret, index); } } realret = findrelpos234(tree, NULL, NULL, REL234_GT, &index); if (arraylen && (realret != array[0] || index != 0)) { error("find(NULL,GT) gave %s(%d) should be %s(0)", - realret, index, array[0]); + realret, index, (char *)array[0]); } else if (!arraylen && (realret != NULL)) { error("find(NULL,GT) gave %s(%d) should be NULL", realret, index); } @@ -1463,7 +1462,7 @@ int findtest(void) if (arraylen && (realret != array[arraylen - 1] || index != arraylen - 1)) { error("find(NULL,LT) gave %s(%d) should be %s(0)", realret, index, - array[arraylen - 1]); + (char *)array[arraylen - 1]); } else if (!arraylen && (realret != NULL)) { error("find(NULL,LT) gave %s(%d) should be NULL", realret, index); } @@ -1483,9 +1482,10 @@ void searchtest_recurse(search234_state ss, int lo, int hi, error("search234(%s) gave index %d should be %d", directionbuf, ss.index, lo); } else { - printf("%*ssearch234(%s) gave NULL,%d\n", - (int)(directionptr-directionbuf) * 2, "", directionbuf, - ss.index); + if (verbose) + printf("%*ssearch234(%s) gave NULL,%d\n", + (int)(directionptr-directionbuf) * 2, "", directionbuf, + ss.index); } } else if (lo == hi) { error("search234(%s) gave %s for empty interval [%d,%d)", @@ -1500,9 +1500,10 @@ void searchtest_recurse(search234_state ss, int lo, int hi, } else { search234_state next; - printf("%*ssearch234(%s) gave %s,%d\n", - (int)(directionptr-directionbuf) * 2, "", directionbuf, - (char *)ss.element, ss.index); + if (verbose) + printf("%*ssearch234(%s) gave %s,%d\n", + (int)(directionptr-directionbuf) * 2, "", directionbuf, + (char *)ss.element, ss.index); next = ss; search234_step(&next, -1); @@ -1525,23 +1526,42 @@ void searchtest(void) int n; search234_state ss; - printf("beginning searchtest:"); + if (verbose) + printf("beginning searchtest:"); for (n = 0; (p = index234(tree, n)) != NULL; n++) { expected[n] = p; - printf(" %d=%s", n, p); + if (verbose) + printf(" %d=%s", n, p); } - printf(" count=%d\n", n); + if (verbose) + printf(" count=%d\n", n); search234_start(&ss, tree); searchtest_recurse(ss, 0, n, expected, directionbuf, directionbuf); } -int main(void) +void out_of_memory(void) +{ + fprintf(stderr, "out of memory!\n"); + exit(2); +} + +int main(int argc, char **argv) { int in[NSTR]; int i, j, k; unsigned seed = 0; + for (i = 1; i < argc; i++) { + char *arg = argv[i]; + if (!strcmp(arg, "-v")) { + verbose++; + } else { + fprintf(stderr, "unrecognised option '%s'\n", arg); + return 1; + } + } + for (i = 0; i < NSTR; i++) in[i] = 0; array = NULL; @@ -1554,13 +1574,16 @@ int main(void) for (i = 0; i < 10000; i++) { j = randomnumber(&seed); j %= NSTR; - printf("trial: %d\n", i); + if (verbose) + printf("trial: %d\n", i); if (in[j]) { - printf("deleting %s (%d)\n", strings[j], j); + if (verbose) + printf("deleting %s (%d)\n", strings[j], j); deltest(strings[j]); in[j] = 0; } else { - printf("adding %s (%d)\n", strings[j], j); + if (verbose) + printf("adding %s (%d)\n", strings[j], j); addtest(strings[j]); in[j] = 1; } @@ -1587,20 +1610,24 @@ int main(void) cmp = NULL; verify(); for (i = 0; i < 1000; i++) { - printf("trial: %d\n", i); + if (verbose) + printf("trial: %d\n", i); j = randomnumber(&seed); j %= NSTR; k = randomnumber(&seed); k %= count234(tree) + 1; - printf("adding string %s at index %d\n", strings[j], k); + if (verbose) + printf("adding string %s at index %d\n", strings[j], k); addpostest(strings[j], k); } while (count234(tree) > 0) { - printf("cleanup: tree size %d\n", count234(tree)); + if (verbose) + printf("cleanup: tree size %d\n", count234(tree)); j = randomnumber(&seed); j %= count234(tree); - printf("deleting string %s from index %d\n", - (const char *)array[j], j); + if (verbose) + printf("deleting string %s from index %d\n", + (const char *)array[j], j); delpostest(j); } @@ -1608,4 +1635,4 @@ int main(void) return (n_errors != 0); } -#endif +#endif /* TEST */ diff --git a/code/utils/utils.h b/code/utils/utils.h new file mode 100644 index 0000000..ea4cda0 --- /dev/null +++ b/code/utils/utils.h @@ -0,0 +1,12 @@ +/* + * Internal header to the utils subdirectory, for definitions shared + * between the library implementations but not intended to be exposed + * further than that. + */ + +void dputs(const char *); + +char *dupvprintf_inner(char *buf, size_t oldlen, size_t *sizeptr, + const char *fmt, va_list ap); + +const char *host_strchr_internal(const char *s, const char *set, bool first); diff --git a/code/utils/validate_manual_hostkey.c b/code/utils/validate_manual_hostkey.c new file mode 100644 index 0000000..7c5d1b8 --- /dev/null +++ b/code/utils/validate_manual_hostkey.c @@ -0,0 +1,121 @@ +/* + * Validate a manual host key specification (either entered in the + * GUI, or via -hostkey). If valid, we return true, and update 'key' + * to contain a canonicalised version of the key string in 'key' + * (which is guaranteed to take up at most as much space as the + * original version), suitable for putting into the Conf. If not + * valid, we return false. + */ + +#include +#include + +#include "putty.h" +#include "misc.h" + +#define BASE64_CHARS_NOEQ \ + "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/" +#define BASE64_CHARS_ALL BASE64_CHARS_NOEQ "=" + +bool validate_manual_hostkey(char *key) +{ + char *p, *q, *r, *s; + + /* + * Step through the string word by word, looking for a word that's + * in one of the formats we like. + */ + p = key; + while ((p += strspn(p, " \t"))[0]) { + q = p; + p += strcspn(p, " \t"); + if (*p) *p++ = '\0'; + + /* + * Now q is our word. + */ + + if (strstartswith(q, "SHA256:")) { + /* Test for a valid SHA256 key fingerprint. */ + r = q + 7; + if (strspn(r, BASE64_CHARS_NOEQ) == 43) { + memmove(key, q, 50); /* 7-char prefix + 43-char base64 */ + key[50] = '\0'; + return true; + } + } + + r = q; + if (strstartswith(r, "MD5:")) + r += 4; + if (strlen(r) == 16*3 - 1 && + r[strspn(r, "0123456789abcdefABCDEF:")] == 0) { + /* + * Test for a valid MD5 key fingerprint. Check the colons + * are in the right places, and if so, return the same + * fingerprint canonicalised into lowercase. + */ + int i; + for (i = 0; i < 16; i++) + if (r[3*i] == ':' || r[3*i+1] == ':') + goto not_fingerprint; /* sorry */ + for (i = 0; i < 15; i++) + if (r[3*i+2] != ':') + goto not_fingerprint; /* sorry */ + for (i = 0; i < 16*3 - 1; i++) + key[i] = tolower(r[i]); + key[16*3 - 1] = '\0'; + return true; + } + not_fingerprint:; + + /* + * Before we check for a public-key blob, trim newlines out of + * the middle of the word, in case someone's managed to paste + * in a public-key blob _with_ them. + */ + for (r = s = q; *r; r++) + if (*r != '\n' && *r != '\r') + *s++ = *r; + *s = '\0'; + + if (strlen(q) % 4 == 0 && strlen(q) > 2*4 && + q[strspn(q, BASE64_CHARS_ALL)] == 0) { + /* + * Might be a base64-encoded SSH-2 public key blob. Check + * that it starts with a sensible algorithm string. No + * canonicalisation is necessary for this string type. + * + * The algorithm string must be at most 64 characters long + * (RFC 4251 section 6). + */ + unsigned char decoded[6]; + unsigned alglen; + int minlen; + int len = 0; + + len += base64_decode_atom(q, decoded+len); + if (len < 3) + goto not_ssh2_blob; /* sorry */ + len += base64_decode_atom(q+4, decoded+len); + if (len < 4) + goto not_ssh2_blob; /* sorry */ + + alglen = GET_32BIT_MSB_FIRST(decoded); + if (alglen > 64) + goto not_ssh2_blob; /* sorry */ + + minlen = ((alglen + 4) + 2) / 3; + if (strlen(q) < minlen) + goto not_ssh2_blob; /* sorry */ + + size_t base64_len = strspn(q, BASE64_CHARS_ALL); + memmove(key, q, base64_len); + key[base64_len] = '\0'; + return true; + } + not_ssh2_blob:; + } + + return false; +} diff --git a/code/version.c b/code/utils/version.c similarity index 85% rename from code/version.c rename to code/utils/version.c index 620879c..edc4da9 100644 --- a/code/version.c +++ b/code/utils/version.c @@ -11,15 +11,10 @@ #include "putty.h" #include "ssh.h" -#ifdef SOURCE_COMMIT -#include "empty.h" -#endif - #include "version.h" const char ver[] = TEXTVER; const char sshver[] = SSHVER; -const char commitid[] = SOURCE_COMMIT; /* * SSH local version string MUST be under 40 characters. Here's a diff --git a/code/wcwidth.c b/code/utils/wcwidth.c similarity index 58% rename from code/wcwidth.c rename to code/utils/wcwidth.c index 6468fed..7705d98 100644 --- a/code/wcwidth.c +++ b/code/utils/wcwidth.c @@ -124,62 +124,386 @@ static bool bisearch(unsigned int ucs, const struct interval *table, int max) { int mk_wcwidth(unsigned int ucs) { /* sorted list of non-overlapping intervals of non-spacing characters */ - /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ + /* generated by the following Perl + * from the Unicode 14.0.0 data files available at: + * https://www.unicode.org/Public/14.0.0/ucd/ + +open DATA, "<", "UnicodeData.txt" || die "$!"; +while () { + @fields = split /;/; + $chr = hex $fields[0]; + $cat = $fields[2]; + $include = ($cat eq "Me" || $cat eq "Mn" || $cat eq "Cf"); + $include = 0 if ($chr == 0x00AD); + $include = 1 if (0x1160 <= $chr && $chr <= 0x11FF); + $include = 1 if ($chr == 0x200B); + $chrs{$chr} = $include; +} +close DATA; +for ($chr = 0; $chr < 0x110000; $chr++) { + if ($chrs{$chr}) { + $start = $chr; + $chr++ while $chrs{$chr}; + printf " { 0x%04X, 0x%04X },\n", $start, $chr-1; + } +} + + */ static const struct interval combining[] = { - { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, - { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, - { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, - { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, - { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, - { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, - { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, - { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, - { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, - { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, - { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, - { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, - { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, - { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, - { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, - { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, - { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, - { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, - { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, - { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, - { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, - { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, - { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, - { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, - { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, - { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, - { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, - { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, - { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, - { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, - { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, - { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, - { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, - { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, - { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, - { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, - { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, - { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, - { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, - { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, - { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, - { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, - { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, - { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, - { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, - { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, - { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, - { 0xE0100, 0xE01EF } + { 0x0300, 0x036F }, + { 0x0483, 0x0489 }, + { 0x0591, 0x05BD }, + { 0x05BF, 0x05BF }, + { 0x05C1, 0x05C2 }, + { 0x05C4, 0x05C5 }, + { 0x05C7, 0x05C7 }, + { 0x0600, 0x0605 }, + { 0x0610, 0x061A }, + { 0x061C, 0x061C }, + { 0x064B, 0x065F }, + { 0x0670, 0x0670 }, + { 0x06D6, 0x06DD }, + { 0x06DF, 0x06E4 }, + { 0x06E7, 0x06E8 }, + { 0x06EA, 0x06ED }, + { 0x070F, 0x070F }, + { 0x0711, 0x0711 }, + { 0x0730, 0x074A }, + { 0x07A6, 0x07B0 }, + { 0x07EB, 0x07F3 }, + { 0x07FD, 0x07FD }, + { 0x0816, 0x0819 }, + { 0x081B, 0x0823 }, + { 0x0825, 0x0827 }, + { 0x0829, 0x082D }, + { 0x0859, 0x085B }, + { 0x0890, 0x0891 }, + { 0x0898, 0x089F }, + { 0x08CA, 0x0902 }, + { 0x093A, 0x093A }, + { 0x093C, 0x093C }, + { 0x0941, 0x0948 }, + { 0x094D, 0x094D }, + { 0x0951, 0x0957 }, + { 0x0962, 0x0963 }, + { 0x0981, 0x0981 }, + { 0x09BC, 0x09BC }, + { 0x09C1, 0x09C4 }, + { 0x09CD, 0x09CD }, + { 0x09E2, 0x09E3 }, + { 0x09FE, 0x09FE }, + { 0x0A01, 0x0A02 }, + { 0x0A3C, 0x0A3C }, + { 0x0A41, 0x0A42 }, + { 0x0A47, 0x0A48 }, + { 0x0A4B, 0x0A4D }, + { 0x0A51, 0x0A51 }, + { 0x0A70, 0x0A71 }, + { 0x0A75, 0x0A75 }, + { 0x0A81, 0x0A82 }, + { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, + { 0x0AC7, 0x0AC8 }, + { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, + { 0x0AFA, 0x0AFF }, + { 0x0B01, 0x0B01 }, + { 0x0B3C, 0x0B3C }, + { 0x0B3F, 0x0B3F }, + { 0x0B41, 0x0B44 }, + { 0x0B4D, 0x0B4D }, + { 0x0B55, 0x0B56 }, + { 0x0B62, 0x0B63 }, + { 0x0B82, 0x0B82 }, + { 0x0BC0, 0x0BC0 }, + { 0x0BCD, 0x0BCD }, + { 0x0C00, 0x0C00 }, + { 0x0C04, 0x0C04 }, + { 0x0C3C, 0x0C3C }, + { 0x0C3E, 0x0C40 }, + { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, + { 0x0C55, 0x0C56 }, + { 0x0C62, 0x0C63 }, + { 0x0C81, 0x0C81 }, + { 0x0CBC, 0x0CBC }, + { 0x0CBF, 0x0CBF }, + { 0x0CC6, 0x0CC6 }, + { 0x0CCC, 0x0CCD }, + { 0x0CE2, 0x0CE3 }, + { 0x0D00, 0x0D01 }, + { 0x0D3B, 0x0D3C }, + { 0x0D41, 0x0D44 }, + { 0x0D4D, 0x0D4D }, + { 0x0D62, 0x0D63 }, + { 0x0D81, 0x0D81 }, + { 0x0DCA, 0x0DCA }, + { 0x0DD2, 0x0DD4 }, + { 0x0DD6, 0x0DD6 }, + { 0x0E31, 0x0E31 }, + { 0x0E34, 0x0E3A }, + { 0x0E47, 0x0E4E }, + { 0x0EB1, 0x0EB1 }, + { 0x0EB4, 0x0EBC }, + { 0x0EC8, 0x0ECD }, + { 0x0F18, 0x0F19 }, + { 0x0F35, 0x0F35 }, + { 0x0F37, 0x0F37 }, + { 0x0F39, 0x0F39 }, + { 0x0F71, 0x0F7E }, + { 0x0F80, 0x0F84 }, + { 0x0F86, 0x0F87 }, + { 0x0F8D, 0x0F97 }, + { 0x0F99, 0x0FBC }, + { 0x0FC6, 0x0FC6 }, + { 0x102D, 0x1030 }, + { 0x1032, 0x1037 }, + { 0x1039, 0x103A }, + { 0x103D, 0x103E }, + { 0x1058, 0x1059 }, + { 0x105E, 0x1060 }, + { 0x1071, 0x1074 }, + { 0x1082, 0x1082 }, + { 0x1085, 0x1086 }, + { 0x108D, 0x108D }, + { 0x109D, 0x109D }, + { 0x1160, 0x11FF }, + { 0x135D, 0x135F }, + { 0x1712, 0x1714 }, + { 0x1732, 0x1733 }, + { 0x1752, 0x1753 }, + { 0x1772, 0x1773 }, + { 0x17B4, 0x17B5 }, + { 0x17B7, 0x17BD }, + { 0x17C6, 0x17C6 }, + { 0x17C9, 0x17D3 }, + { 0x17DD, 0x17DD }, + { 0x180B, 0x180F }, + { 0x1885, 0x1886 }, + { 0x18A9, 0x18A9 }, + { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, + { 0x1932, 0x1932 }, + { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, + { 0x1A1B, 0x1A1B }, + { 0x1A56, 0x1A56 }, + { 0x1A58, 0x1A5E }, + { 0x1A60, 0x1A60 }, + { 0x1A62, 0x1A62 }, + { 0x1A65, 0x1A6C }, + { 0x1A73, 0x1A7C }, + { 0x1A7F, 0x1A7F }, + { 0x1AB0, 0x1ACE }, + { 0x1B00, 0x1B03 }, + { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, + { 0x1B3C, 0x1B3C }, + { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, + { 0x1B80, 0x1B81 }, + { 0x1BA2, 0x1BA5 }, + { 0x1BA8, 0x1BA9 }, + { 0x1BAB, 0x1BAD }, + { 0x1BE6, 0x1BE6 }, + { 0x1BE8, 0x1BE9 }, + { 0x1BED, 0x1BED }, + { 0x1BEF, 0x1BF1 }, + { 0x1C2C, 0x1C33 }, + { 0x1C36, 0x1C37 }, + { 0x1CD0, 0x1CD2 }, + { 0x1CD4, 0x1CE0 }, + { 0x1CE2, 0x1CE8 }, + { 0x1CED, 0x1CED }, + { 0x1CF4, 0x1CF4 }, + { 0x1CF8, 0x1CF9 }, + { 0x1DC0, 0x1DFF }, + { 0x200B, 0x200F }, + { 0x202A, 0x202E }, + { 0x2060, 0x2064 }, + { 0x2066, 0x206F }, + { 0x20D0, 0x20F0 }, + { 0x2CEF, 0x2CF1 }, + { 0x2D7F, 0x2D7F }, + { 0x2DE0, 0x2DFF }, + { 0x302A, 0x302D }, + { 0x3099, 0x309A }, + { 0xA66F, 0xA672 }, + { 0xA674, 0xA67D }, + { 0xA69E, 0xA69F }, + { 0xA6F0, 0xA6F1 }, + { 0xA802, 0xA802 }, + { 0xA806, 0xA806 }, + { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, + { 0xA82C, 0xA82C }, + { 0xA8C4, 0xA8C5 }, + { 0xA8E0, 0xA8F1 }, + { 0xA8FF, 0xA8FF }, + { 0xA926, 0xA92D }, + { 0xA947, 0xA951 }, + { 0xA980, 0xA982 }, + { 0xA9B3, 0xA9B3 }, + { 0xA9B6, 0xA9B9 }, + { 0xA9BC, 0xA9BD }, + { 0xA9E5, 0xA9E5 }, + { 0xAA29, 0xAA2E }, + { 0xAA31, 0xAA32 }, + { 0xAA35, 0xAA36 }, + { 0xAA43, 0xAA43 }, + { 0xAA4C, 0xAA4C }, + { 0xAA7C, 0xAA7C }, + { 0xAAB0, 0xAAB0 }, + { 0xAAB2, 0xAAB4 }, + { 0xAAB7, 0xAAB8 }, + { 0xAABE, 0xAABF }, + { 0xAAC1, 0xAAC1 }, + { 0xAAEC, 0xAAED }, + { 0xAAF6, 0xAAF6 }, + { 0xABE5, 0xABE5 }, + { 0xABE8, 0xABE8 }, + { 0xABED, 0xABED }, + { 0xFB1E, 0xFB1E }, + { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE2F }, + { 0xFEFF, 0xFEFF }, + { 0xFFF9, 0xFFFB }, + { 0x101FD, 0x101FD }, + { 0x102E0, 0x102E0 }, + { 0x10376, 0x1037A }, + { 0x10A01, 0x10A03 }, + { 0x10A05, 0x10A06 }, + { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, + { 0x10A3F, 0x10A3F }, + { 0x10AE5, 0x10AE6 }, + { 0x10D24, 0x10D27 }, + { 0x10EAB, 0x10EAC }, + { 0x10F46, 0x10F50 }, + { 0x10F82, 0x10F85 }, + { 0x11001, 0x11001 }, + { 0x11038, 0x11046 }, + { 0x11070, 0x11070 }, + { 0x11073, 0x11074 }, + { 0x1107F, 0x11081 }, + { 0x110B3, 0x110B6 }, + { 0x110B9, 0x110BA }, + { 0x110BD, 0x110BD }, + { 0x110C2, 0x110C2 }, + { 0x110CD, 0x110CD }, + { 0x11100, 0x11102 }, + { 0x11127, 0x1112B }, + { 0x1112D, 0x11134 }, + { 0x11173, 0x11173 }, + { 0x11180, 0x11181 }, + { 0x111B6, 0x111BE }, + { 0x111C9, 0x111CC }, + { 0x111CF, 0x111CF }, + { 0x1122F, 0x11231 }, + { 0x11234, 0x11234 }, + { 0x11236, 0x11237 }, + { 0x1123E, 0x1123E }, + { 0x112DF, 0x112DF }, + { 0x112E3, 0x112EA }, + { 0x11300, 0x11301 }, + { 0x1133B, 0x1133C }, + { 0x11340, 0x11340 }, + { 0x11366, 0x1136C }, + { 0x11370, 0x11374 }, + { 0x11438, 0x1143F }, + { 0x11442, 0x11444 }, + { 0x11446, 0x11446 }, + { 0x1145E, 0x1145E }, + { 0x114B3, 0x114B8 }, + { 0x114BA, 0x114BA }, + { 0x114BF, 0x114C0 }, + { 0x114C2, 0x114C3 }, + { 0x115B2, 0x115B5 }, + { 0x115BC, 0x115BD }, + { 0x115BF, 0x115C0 }, + { 0x115DC, 0x115DD }, + { 0x11633, 0x1163A }, + { 0x1163D, 0x1163D }, + { 0x1163F, 0x11640 }, + { 0x116AB, 0x116AB }, + { 0x116AD, 0x116AD }, + { 0x116B0, 0x116B5 }, + { 0x116B7, 0x116B7 }, + { 0x1171D, 0x1171F }, + { 0x11722, 0x11725 }, + { 0x11727, 0x1172B }, + { 0x1182F, 0x11837 }, + { 0x11839, 0x1183A }, + { 0x1193B, 0x1193C }, + { 0x1193E, 0x1193E }, + { 0x11943, 0x11943 }, + { 0x119D4, 0x119D7 }, + { 0x119DA, 0x119DB }, + { 0x119E0, 0x119E0 }, + { 0x11A01, 0x11A0A }, + { 0x11A33, 0x11A38 }, + { 0x11A3B, 0x11A3E }, + { 0x11A47, 0x11A47 }, + { 0x11A51, 0x11A56 }, + { 0x11A59, 0x11A5B }, + { 0x11A8A, 0x11A96 }, + { 0x11A98, 0x11A99 }, + { 0x11C30, 0x11C36 }, + { 0x11C38, 0x11C3D }, + { 0x11C3F, 0x11C3F }, + { 0x11C92, 0x11CA7 }, + { 0x11CAA, 0x11CB0 }, + { 0x11CB2, 0x11CB3 }, + { 0x11CB5, 0x11CB6 }, + { 0x11D31, 0x11D36 }, + { 0x11D3A, 0x11D3A }, + { 0x11D3C, 0x11D3D }, + { 0x11D3F, 0x11D45 }, + { 0x11D47, 0x11D47 }, + { 0x11D90, 0x11D91 }, + { 0x11D95, 0x11D95 }, + { 0x11D97, 0x11D97 }, + { 0x11EF3, 0x11EF4 }, + { 0x13430, 0x13438 }, + { 0x16AF0, 0x16AF4 }, + { 0x16B30, 0x16B36 }, + { 0x16F4F, 0x16F4F }, + { 0x16F8F, 0x16F92 }, + { 0x16FE4, 0x16FE4 }, + { 0x1BC9D, 0x1BC9E }, + { 0x1BCA0, 0x1BCA3 }, + { 0x1CF00, 0x1CF2D }, + { 0x1CF30, 0x1CF46 }, + { 0x1D167, 0x1D169 }, + { 0x1D173, 0x1D182 }, + { 0x1D185, 0x1D18B }, + { 0x1D1AA, 0x1D1AD }, + { 0x1D242, 0x1D244 }, + { 0x1DA00, 0x1DA36 }, + { 0x1DA3B, 0x1DA6C }, + { 0x1DA75, 0x1DA75 }, + { 0x1DA84, 0x1DA84 }, + { 0x1DA9B, 0x1DA9F }, + { 0x1DAA1, 0x1DAAF }, + { 0x1E000, 0x1E006 }, + { 0x1E008, 0x1E018 }, + { 0x1E01B, 0x1E021 }, + { 0x1E023, 0x1E024 }, + { 0x1E026, 0x1E02A }, + { 0x1E130, 0x1E136 }, + { 0x1E2AE, 0x1E2AE }, + { 0x1E2EC, 0x1E2EF }, + { 0x1E8D0, 0x1E8D6 }, + { 0x1E944, 0x1E94A }, + { 0xE0001, 0xE0001 }, + { 0xE0020, 0xE007F }, + { 0xE0100, 0xE01EF }, }; /* A sorted list of intervals of double-width characters generated by: * https://raw.githubusercontent.com/GNOME/glib/37d4c2941bd0326b8b6e6bb22c81bd424fcc040b/glib/gen-unicode-tables.pl - * from the Unicode 9.0.0 data files available at: - * https://www.unicode.org/Public/13.0.0/ucd/ + * from the Unicode 14.0.0 data files available at: + * https://www.unicode.org/Public/14.0.0/ucd/ */ static const struct interval wide[] = { {0x1100, 0x115F}, @@ -246,7 +570,10 @@ int mk_wcwidth(unsigned int ucs) {0x17000, 0x187F7}, {0x18800, 0x18CD5}, {0x18D00, 0x18D08}, - {0x1B000, 0x1B11E}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, {0x1B150, 0x1B152}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, @@ -281,21 +608,23 @@ int mk_wcwidth(unsigned int ucs) {0x1F6CC, 0x1F6CC}, {0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D7}, + {0x1F6DD, 0x1F6DF}, {0x1F6EB, 0x1F6EC}, {0x1F6F4, 0x1F6FC}, {0x1F7E0, 0x1F7EB}, + {0x1F7F0, 0x1F7F0}, {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, - {0x1F947, 0x1F978}, - {0x1F97A, 0x1F9CB}, - {0x1F9CD, 0x1F9FF}, + {0x1F947, 0x1F9FF}, {0x1FA70, 0x1FA74}, - {0x1FA78, 0x1FA7A}, + {0x1FA78, 0x1FA7C}, {0x1FA80, 0x1FA86}, - {0x1FA90, 0x1FAA8}, - {0x1FAB0, 0x1FAB6}, - {0x1FAC0, 0x1FAC2}, - {0x1FAD0, 0x1FAD6}, + {0x1FA90, 0x1FAAC}, + {0x1FAB0, 0x1FABA}, + {0x1FAC0, 0x1FAC5}, + {0x1FAD0, 0x1FAD9}, + {0x1FAE0, 0x1FAE7}, + {0x1FAF0, 0x1FAF6}, {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, }; diff --git a/code/wildcard.c b/code/utils/wildcard.c similarity index 99% rename from code/wildcard.c rename to code/utils/wildcard.c index 697feb9..255cc53 100644 --- a/code/wildcard.c +++ b/code/utils/wildcard.c @@ -344,7 +344,7 @@ bool wc_unescape(char *output, const char *wildcard) return true; /* it's clean */ } -#ifdef TESTMODE +#ifdef TEST struct test { const char *wildcard; @@ -483,4 +483,4 @@ int main(void) return 0; } -#endif +#endif /* TEST */ diff --git a/code/utils/write_c_string_literal.c b/code/utils/write_c_string_literal.c new file mode 100644 index 0000000..e8b2f53 --- /dev/null +++ b/code/utils/write_c_string_literal.c @@ -0,0 +1,39 @@ +/* + * Write data to a file or BinarySink in the form of a C string + * literal, with any non-printable-ASCII character escaped + * appropriately. + */ + +#include "defs.h" +#include "misc.h" + +void BinarySink_put_c_string_literal(BinarySink *bs, ptrlen str) +{ + for (const char *p = str.ptr; p < (const char *)str.ptr + str.len; p++) { + char c = *p; + + if (c == '\n') + put_datalit(bs, "\\n"); + else if (c == '\r') + put_datalit(bs, "\\r"); + else if (c == '\t') + put_datalit(bs, "\\t"); + else if (c == '\b') + put_datalit(bs, "\\b"); + else if (c == '\\') + put_datalit(bs, "\\\\"); + else if (c == '"') + put_datalit(bs, "\\\""); + else if (c >= 32 && c <= 126) + put_byte(bs, c); + else + put_fmt(bs, "\\%03o", (unsigned)c & 0xFFU); + } +} + +void write_c_string_literal(FILE *fp, ptrlen str) +{ + stdio_sink s; + stdio_sink_init(&s, fp); + put_c_string_literal(&s, str); +} diff --git a/code/utils/x11_dehexify.c b/code/utils/x11_dehexify.c new file mode 100644 index 0000000..13ffb0d --- /dev/null +++ b/code/utils/x11_dehexify.c @@ -0,0 +1,28 @@ +/* + * Utility function to convert a textual representation of an X11 + * auth hex cookie into binary auth data. + */ + +#include "putty.h" + +void *x11_dehexify(ptrlen hexpl, int *outlen) +{ + int len, i; + unsigned char *ret; + + len = hexpl.len / 2; + ret = snewn(len, unsigned char); + + for (i = 0; i < len; i++) { + char bytestr[3]; + unsigned val = 0; + bytestr[0] = ((const char *)hexpl.ptr)[2*i]; + bytestr[1] = ((const char *)hexpl.ptr)[2*i+1]; + bytestr[2] = '\0'; + sscanf(bytestr, "%x", &val); + ret[i] = val; + } + + *outlen = len; + return ret; +} diff --git a/code/utils/x11_identify_auth_proto.c b/code/utils/x11_identify_auth_proto.c new file mode 100644 index 0000000..14075a3 --- /dev/null +++ b/code/utils/x11_identify_auth_proto.c @@ -0,0 +1,16 @@ +/* + * Utility function to convert a textual representation of an X11 + * auth protocol name into our integer protocol ids. + */ + +#include "putty.h" + +int x11_identify_auth_proto(ptrlen protoname) +{ + int protocol; + + for (protocol = 1; protocol < lenof(x11_authnames); protocol++) + if (ptrlen_eq_string(protoname, x11_authnames[protocol])) + return protocol; + return -1; +} diff --git a/code/utils/x11_make_greeting.c b/code/utils/x11_make_greeting.c new file mode 100644 index 0000000..4efd8e8 --- /dev/null +++ b/code/utils/x11_make_greeting.c @@ -0,0 +1,67 @@ +/* + * Construct an X11 greeting packet, including making up the right + * authorisation data. + */ + +#include "putty.h" +#include "ssh.h" + +void *x11_make_greeting(int endian, int protomajor, int protominor, + int auth_proto, const void *auth_data, int auth_len, + const char *peer_addr, int peer_port, + int *outlen) +{ + unsigned char *greeting; + unsigned char realauthdata[64]; + const char *authname; + const unsigned char *authdata; + int authnamelen, authnamelen_pad; + int authdatalen, authdatalen_pad; + int greeting_len; + + authname = x11_authnames[auth_proto]; + authnamelen = strlen(authname); + authnamelen_pad = (authnamelen + 3) & ~3; + + if (auth_proto == X11_MIT) { + authdata = auth_data; + authdatalen = auth_len; + } else if (auth_proto == X11_XDM && auth_len == 16) { + time_t t; + unsigned long peer_ip = 0; + + x11_parse_ip(peer_addr, &peer_ip); + + authdata = realauthdata; + authdatalen = 24; + memset(realauthdata, 0, authdatalen); + memcpy(realauthdata, auth_data, 8); + PUT_32BIT_MSB_FIRST(realauthdata+8, peer_ip); + PUT_16BIT_MSB_FIRST(realauthdata+12, peer_port); + t = time(NULL); + PUT_32BIT_MSB_FIRST(realauthdata+14, t); + + des_encrypt_xdmauth((char *)auth_data + 9, realauthdata, authdatalen); + } else { + authdata = realauthdata; + authdatalen = 0; + } + + authdatalen_pad = (authdatalen + 3) & ~3; + greeting_len = 12 + authnamelen_pad + authdatalen_pad; + + greeting = snewn(greeting_len, unsigned char); + memset(greeting, 0, greeting_len); + greeting[0] = endian; + PUT_16BIT_X11(endian, greeting+2, protomajor); + PUT_16BIT_X11(endian, greeting+4, protominor); + PUT_16BIT_X11(endian, greeting+6, authnamelen); + PUT_16BIT_X11(endian, greeting+8, authdatalen); + memcpy(greeting+12, authname, authnamelen); + memcpy(greeting+12+authnamelen_pad, authdata, authdatalen); + + smemclr(realauthdata, sizeof(realauthdata)); + + *outlen = greeting_len; + return greeting; +} diff --git a/code/utils/x11_parse_ip.c b/code/utils/x11_parse_ip.c new file mode 100644 index 0000000..12649b4 --- /dev/null +++ b/code/utils/x11_parse_ip.c @@ -0,0 +1,20 @@ +/* + * Try to make sense of a string as an IPv4 address, for + * XDM-AUTHORIZATION-1 purposes. + */ + +#include + +#include "putty.h" + +bool x11_parse_ip(const char *addr_string, unsigned long *ip) +{ + int i[4]; + if (addr_string && + 4 == sscanf(addr_string, "%d.%d.%d.%d", i+0, i+1, i+2, i+3)) { + *ip = (i[0] << 24) | (i[1] << 16) | (i[2] << 8) | i[3]; + return true; + } else { + return false; + } +} diff --git a/code/utils/x11authfile.c b/code/utils/x11authfile.c new file mode 100644 index 0000000..4fc84ab --- /dev/null +++ b/code/utils/x11authfile.c @@ -0,0 +1,244 @@ +/* + * Functions to handle .Xauthority files. + */ + +#include +#include +#include + +#include "putty.h" +#include "ssh.h" + +ptrlen BinarySource_get_string_xauth(BinarySource *src) +{ + size_t len = get_uint16(src); + return get_data(src, len); +} +#define get_string_xauth(src) \ + BinarySource_get_string_xauth(BinarySource_UPCAST(src)) + +void BinarySink_put_stringpl_xauth(BinarySink *bs, ptrlen pl) +{ + assert((pl.len >> 16) == 0); + put_uint16(bs, pl.len); + put_datapl(bs, pl); +} +#define put_stringpl_xauth(bs, ptrlen) \ + BinarySink_put_stringpl_xauth(BinarySink_UPCAST(bs),ptrlen) + +void x11_get_auth_from_authfile(struct X11Display *disp, + const char *authfilename) +{ + FILE *authfp; + char *buf; + int size; + BinarySource src[1]; + int family, protocol; + ptrlen addr, protoname, data; + char *displaynum_string; + int displaynum; + bool ideal_match = false; + char *ourhostname; + + /* A maximally sized (wildly implausible) .Xauthority record + * consists of a 16-bit integer to start with, then four strings, + * each of which has a 16-bit length field followed by that many + * bytes of data (i.e. up to 0xFFFF bytes). */ + const size_t MAX_RECORD_SIZE = 2 + 4 * (2+0xFFFF); + + /* We'll want a buffer of twice that size (see below). */ + const size_t BUF_SIZE = 2 * MAX_RECORD_SIZE; + + /* + * Normally we should look for precisely the details specified in + * `disp'. However, there's an oddity when the display is local: + * displays like "localhost:0" usually have their details stored + * in a Unix-domain-socket record (even if there isn't actually a + * real Unix-domain socket available, as with OpenSSH's proxy X11 + * server). + * + * This is apparently a fudge to get round the meaninglessness of + * "localhost" in a shared-home-directory context -- xauth entries + * for Unix-domain sockets already disambiguate this by storing + * the *local* hostname in the conveniently-blank hostname field, + * but IP "localhost" records couldn't do this. So, typically, an + * IP "localhost" entry in the auth database isn't present and if + * it were it would be ignored. + * + * However, we don't entirely trust that (say) Windows X servers + * won't rely on a straight "localhost" entry, bad idea though + * that is; so if we can't find a Unix-domain-socket entry we'll + * fall back to an IP-based entry if we can find one. + */ + bool localhost = !disp->unixdomain && sk_address_is_local(disp->addr); + + authfp = fopen(authfilename, "rb"); + if (!authfp) + return; + + ourhostname = get_hostname(); + + /* + * Allocate enough space to hold two maximally sized records, so + * that a full record can start anywhere in the first half. That + * way we avoid the accidentally-quadratic algorithm that would + * arise if we moved everything to the front of the buffer after + * consuming each record; instead, we only move everything to the + * front after our current position gets past the half-way mark. + * Before then, there's no need to move anyway; so this guarantees + * linear time, in that every byte written into this buffer moves + * at most once (because every move is from the second half of the + * buffer to the first half). + */ + buf = snewn(BUF_SIZE, char); + size = fread(buf, 1, BUF_SIZE, authfp); + BinarySource_BARE_INIT(src, buf, size); + + while (!ideal_match) { + bool match = false; + + if (src->pos >= MAX_RECORD_SIZE) { + size -= src->pos; + memcpy(buf, buf + src->pos, size); + size += fread(buf + size, 1, BUF_SIZE - size, authfp); + BinarySource_BARE_INIT(src, buf, size); + } + + family = get_uint16(src); + addr = get_string_xauth(src); + displaynum_string = mkstr(get_string_xauth(src)); + displaynum = displaynum_string[0] ? atoi(displaynum_string) : -1; + sfree(displaynum_string); + protoname = get_string_xauth(src); + data = get_string_xauth(src); + if (get_err(src)) + break; + + /* + * Now we have a full X authority record in memory. See + * whether it matches the display we're trying to + * authenticate to. + * + * The details we've just read should be interpreted as + * follows: + * + * - 'family' is the network address family used to + * connect to the display. 0 means IPv4; 6 means IPv6; + * 256 means Unix-domain sockets. + * + * - 'addr' is the network address itself. For IPv4 and + * IPv6, this is a string of binary data of the + * appropriate length (respectively 4 and 16 bytes) + * representing the address in big-endian format, e.g. + * 7F 00 00 01 means IPv4 localhost. For Unix-domain + * sockets, this is the host name of the machine on + * which the Unix-domain display resides (so that an + * .Xauthority file on a shared file system can contain + * authority entries for Unix-domain displays on + * several machines without them clashing). + * + * - 'displaynum' is the display number. An empty display + * number is a wildcard for any display number. + * + * - 'protoname' is the authorisation protocol, encoded as + * its canonical string name (i.e. "MIT-MAGIC-COOKIE-1", + * "XDM-AUTHORIZATION-1" or something we don't recognise). + * + * - 'data' is the actual authorisation data, stored in + * binary form. + */ + + if (disp->displaynum < 0 || + (displaynum >= 0 && disp->displaynum != displaynum)) + continue; /* not the one */ + + for (protocol = 1; protocol < lenof(x11_authnames); protocol++) + if (ptrlen_eq_string(protoname, x11_authnames[protocol])) + break; + if (protocol == lenof(x11_authnames)) + continue; /* don't recognise this protocol, look for another */ + + switch (family) { + case 0: /* IPv4 */ + if (!disp->unixdomain && + sk_addrtype(disp->addr) == ADDRTYPE_IPV4) { + char buf[4]; + sk_addrcopy(disp->addr, buf); + if (addr.len == 4 && !memcmp(addr.ptr, buf, 4)) { + match = true; + /* If this is a "localhost" entry, note it down + * but carry on looking for a Unix-domain entry. */ + ideal_match = !localhost; + } + } + break; + case 6: /* IPv6 */ + if (!disp->unixdomain && + sk_addrtype(disp->addr) == ADDRTYPE_IPV6) { + char buf[16]; + sk_addrcopy(disp->addr, buf); + if (addr.len == 16 && !memcmp(addr.ptr, buf, 16)) { + match = true; + ideal_match = !localhost; + } + } + break; + case 256: /* Unix-domain / localhost */ + if ((disp->unixdomain || localhost) + && ourhostname && ptrlen_eq_string(addr, ourhostname)) { + /* A matching Unix-domain socket is always the best + * match. */ + match = true; + ideal_match = true; + } + break; + } + + if (match) { + /* Current best guess -- may be overridden if !ideal_match */ + disp->localauthproto = protocol; + sfree(disp->localauthdata); /* free previous guess, if any */ + disp->localauthdata = snewn(data.len, unsigned char); + memcpy(disp->localauthdata, data.ptr, data.len); + disp->localauthdatalen = data.len; + } + } + + fclose(authfp); + smemclr(buf, 2 * MAX_RECORD_SIZE); + sfree(buf); + sfree(ourhostname); +} + +void x11_format_auth_for_authfile( + BinarySink *bs, SockAddr *addr, int display_no, + ptrlen authproto, ptrlen authdata) +{ + if (sk_address_is_special_local(addr)) { + char *ourhostname = get_hostname(); + put_uint16(bs, 256); /* indicates Unix-domain socket */ + put_stringpl_xauth(bs, ptrlen_from_asciz(ourhostname)); + sfree(ourhostname); + } else if (sk_addrtype(addr) == ADDRTYPE_IPV4) { + char ipv4buf[4]; + sk_addrcopy(addr, ipv4buf); + put_uint16(bs, 0); /* indicates IPv4 */ + put_stringpl_xauth(bs, make_ptrlen(ipv4buf, 4)); + } else if (sk_addrtype(addr) == ADDRTYPE_IPV6) { + char ipv6buf[16]; + sk_addrcopy(addr, ipv6buf); + put_uint16(bs, 6); /* indicates IPv6 */ + put_stringpl_xauth(bs, make_ptrlen(ipv6buf, 16)); + } else { + unreachable("Bad address type in x11_format_auth_for_authfile"); + } + + { + char *numberbuf = dupprintf("%d", display_no); + put_stringpl_xauth(bs, ptrlen_from_asciz(numberbuf)); + sfree(numberbuf); + } + + put_stringpl_xauth(bs, authproto); + put_stringpl_xauth(bs, authdata); +} diff --git a/code/utils/x11authnames.c b/code/utils/x11authnames.c new file mode 100644 index 0000000..ef3c267 --- /dev/null +++ b/code/utils/x11authnames.c @@ -0,0 +1,9 @@ +/* + * Definition of the array of X11 authorisation method names. + */ + +#include "putty.h" + +const char *const x11_authnames[X11_NAUTHS] = { + "", "MIT-MAGIC-COOKIE-1", "XDM-AUTHORIZATION-1" +}; diff --git a/code/uxconfig.in b/code/uxconfig.in deleted file mode 100644 index 4c2da60..0000000 --- a/code/uxconfig.in +++ /dev/null @@ -1,183 +0,0 @@ -/* uxconfig.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_HWCAP_H - -/* Define if clock_gettime() is available */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the declaration of `CLOCK_MONOTONIC', and to 0 if - you don't. */ -#undef HAVE_DECL_CLOCK_MONOTONIC - -/* Define to 1 if you have the `dirfd' function. */ -#undef HAVE_DIRFD - -/* Define to 1 if you have the `elf_aux_info' function. */ -#undef HAVE_ELF_AUX_INFO - -/* Define to 1 if you have the `endpwent' function. */ -#undef HAVE_ENDPWENT - -/* Define to 1 if you have the `fstatat' function. */ -#undef HAVE_FSTATAT - -/* Define to 1 if you have the `futimes' function. */ -#undef HAVE_FUTIMES - -/* Define to 1 if you have the `getaddrinfo' function. */ -#undef HAVE_GETADDRINFO - -/* Define to 1 if you have the `getauxval' function. */ -#undef HAVE_GETAUXVAL - -/* Define to 1 if you have the header file. */ -#undef HAVE_GLOB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_GSSAPI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define if libX11.a is available */ -#undef HAVE_LIBX11 - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `pango_font_family_is_monospace' function. */ -#undef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE - -/* Define to 1 if you have the `pango_font_map_list_families' function. */ -#undef HAVE_PANGO_FONT_MAP_LIST_FAMILIES - -/* Define to 1 if you have the `posix_openpt' function. */ -#undef HAVE_POSIX_OPENPT - -/* Define to 1 if you have the `ptsname' function. */ -#undef HAVE_PTSNAME - -/* Define to 1 if you have the `setpwent' function. */ -#undef HAVE_SETPWENT - -/* Define to 1 if you have the `setresuid' function. */ -#undef HAVE_SETRESUID - -/* Define if SO_PEERCRED works in the Linux fashion. */ -#undef HAVE_SO_PEERCRED - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strsignal' function. */ -#undef HAVE_STRSIGNAL - -/* Define to 1 if you have the `sysctlbyname' function. */ -#undef HAVE_SYSCTLBYNAME - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_AUXV_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `updwtmpx' function. */ -#undef HAVE_UPDWTMPX - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTMPX_H - -/* Define if we could not find a gssapi library */ -#undef NO_GSSAPI_LIB - -/* Define if we could not find libdl. */ -#undef NO_LIBDL - -/* Define if building with GTK for MacOS. */ -#undef OSX_GTK - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define if building with GSSAPI support. */ -#undef WITH_GSSAPI - - -/* Convert autoconf definitions to ones that PuTTY wants. */ - -#ifndef HAVE_GETADDRINFO -# define NO_IPV6 -#endif -#ifndef HAVE_SETRESUID -# define HAVE_NO_SETRESUID -#endif -#ifndef HAVE_STRSIGNAL -# define HAVE_NO_STRSIGNAL -#endif -#if !defined(HAVE_UTMPX_H) || !defined(HAVE_UPDWTMPX) -# define OMIT_UTMP -#endif -#ifndef HAVE_PTSNAME -# define BSD_PTYS -#endif -#ifndef HAVE_SYS_SELECT_H -# define HAVE_NO_SYS_SELECT_H -#endif -#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE -# define PANGO_PRE_1POINT4 -#endif -#ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES -# define PANGO_PRE_1POINT6 -#endif -#if !defined(WITH_GSSAPI) -# define NO_GSSAPI -#endif -#if !defined(NO_GSSAPI) && defined(NO_LIBDL) -# if !defined(HAVE_GSSAPI_GSSAPI_H) || defined(NO_GSSAPI_LIB) -# define NO_GSSAPI -# endif -#endif - diff --git a/code/version.h b/code/version.h index 1fa640e..5f095ca 100644 --- a/code/version.h +++ b/code/version.h @@ -1,6 +1,6 @@ /* Generated by automated build script */ -#define RELEASE 0.76 -#define TEXTVER "Release 0.76-4" -#define SSHVER "-Release-0.76-4" -#define BINARY_VERSION 0,76,0,4 +#define RELEASE 0.77 +#define TEXTVER "Release 0.77" +#define SSHVER "-Release-0.77" +#define BINARY_VERSION 0,77,0,0 #define SOURCE_COMMIT "See https://github.com/NoMoreFood/putty-cac" diff --git a/code/windows/CMakeLists.txt b/code/windows/CMakeLists.txt new file mode 100644 index 0000000..01213bf --- /dev/null +++ b/code/windows/CMakeLists.txt @@ -0,0 +1,209 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +add_sources_from_current_dir(utils + utils/agent_mutex_name.c + utils/agent_named_pipe_name.c + utils/arm_arch_queries.c + utils/aux_match_opt.c + utils/cryptoapi.c + utils/defaults.c + utils/dll_hijacking_protection.c + utils/dputs.c + utils/escape_registry_key.c + utils/filename.c + utils/fontspec.c + utils/getdlgitemtext_alloc.c + utils/get_system_dir.c + utils/get_username.c + utils/interprocess_mutex.c + utils/is_console_handle.c + utils/load_system32_dll.c + utils/ltime.c + utils/makedlgitemborderless.c + utils/make_spr_sw_abort_winerror.c + utils/message_box.c + utils/minefield.c + utils/open_for_write_would_lose_data.c + utils/pgp_fingerprints_msgbox.c + utils/platform_get_x_display.c + utils/registry_get_string.c + utils/request_file.c + utils/screenshot.c + utils/security.c + utils/split_into_argv.c + utils/version.c + utils/win_strerror.c + unicode.c) +if(NOT HAVE_STRTOUMAX) + add_sources_from_current_dir(utils utils/strtoumax.c) +endif() +add_sources_from_current_dir(eventloop + cliloop.c handle-wait.c) +add_sources_from_current_dir(console + select-cli.c nohelp.c console.c) +add_sources_from_current_dir(settings + storage.c) +add_sources_from_current_dir(network + network.c handle-socket.c named-pipe-client.c named-pipe-server.c local-proxy.c x11.c) +add_sources_from_current_dir(sshcommon + noise.c) +add_sources_from_current_dir(sshclient + agent-client.c gss.c sharing.c) +add_sources_from_current_dir(sftpclient + sftp.c) +add_sources_from_current_dir(otherbackends + serial.c) +add_sources_from_current_dir(agent + agent-client.c) +add_sources_from_current_dir(guiterminal + dialog.c controls.c config.c printing.c jump-list.c sizetip.c) +add_dependencies(guiterminal generated_licence_h) # dialog.c uses licence.h + +# This object awkwardly needs to live in the network library as well +# as the eventloop library, in case it didn't get pulled in from the +# latter before handle-socket.c needed it. +add_library(handle-io OBJECT + handle-io.c) +target_sources(eventloop PRIVATE $) +target_sources(network PRIVATE $) + +add_library(guimisc STATIC + select-gui.c) + +add_executable(pageant + pageant.c + help.c + pageant.rc) +add_dependencies(pageant generated_licence_h) +target_link_libraries(pageant + guimisc eventloop agent network crypto utils + ${platform_libraries}) +set_target_properties(pageant PROPERTIES + WIN32_EXECUTABLE ON + LINK_FLAGS "${LFLAG_MANIFEST_NO}") +installed_program(pageant) + +add_sources_from_current_dir(plink no-jump-list.c nohelp.c plink.rc) +add_dependencies(plink generated_licence_h) + +add_sources_from_current_dir(pscp no-jump-list.c nohelp.c pscp.rc) +add_dependencies(pscp generated_licence_h) + +add_sources_from_current_dir(psftp no-jump-list.c nohelp.c psftp.rc) +add_dependencies(psftp generated_licence_h) + +add_sources_from_current_dir(psocks nohelp.c) + +add_executable(putty + window.c + putty.c + help.c + putty.rc) +be_list(putty PuTTY SSH SERIAL OTHERBACKENDS) +add_dependencies(putty generated_licence_h) +target_link_libraries(putty + guiterminal guimisc eventloop sshclient otherbackends settings network crypto + utils + ${platform_libraries}) +set_target_properties(putty PROPERTIES + WIN32_EXECUTABLE ON + LINK_FLAGS "${LFLAG_MANIFEST_NO}") +installed_program(putty) + +add_executable(puttytel + window.c + putty.c + help.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + ${CMAKE_SOURCE_DIR}/stubs/norand.c + ${CMAKE_SOURCE_DIR}/proxy/nocproxy.c + ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c + puttytel.rc) +be_list(puttytel PuTTYtel SERIAL OTHERBACKENDS) +add_dependencies(puttytel generated_licence_h) +target_link_libraries(puttytel + guiterminal guimisc eventloop otherbackends settings network utils + ${platform_libraries}) +set_target_properties(puttytel PROPERTIES + WIN32_EXECUTABLE ON + LINK_FLAGS "${LFLAG_MANIFEST_NO}") +installed_program(puttytel) + +add_executable(puttygen + puttygen.c + ${CMAKE_SOURCE_DIR}/stubs/notiming.c + noise.c + no-jump-list.c + storage.c + help.c + ${CMAKE_SOURCE_DIR}/sshpubk.c + ${CMAKE_SOURCE_DIR}/sshrand.c + controls.c + puttygen.rc) +add_dependencies(puttygen generated_licence_h) +target_link_libraries(puttygen + keygen guimisc crypto utils + ${platform_libraries}) +set_target_properties(puttygen PROPERTIES + WIN32_EXECUTABLE ON + LINK_FLAGS "${LFLAG_MANIFEST_NO}") +installed_program(puttygen) + +if(HAVE_CONPTY) + add_executable(pterm + window.c + pterm.c + help.c + conpty.c + ${CMAKE_SOURCE_DIR}/stubs/nogss.c + ${CMAKE_SOURCE_DIR}/stubs/norand.c + ${CMAKE_SOURCE_DIR}/proxy/nosshproxy.c + pterm.rc) + be_list(pterm pterm) + add_dependencies(pterm generated_licence_h) + target_link_libraries(pterm + guiterminal guimisc eventloop settings network utils + ${platform_libraries}) + set_target_properties(pterm PROPERTIES + WIN32_EXECUTABLE ON + LINK_FLAGS "${LFLAG_MANIFEST_NO}") + installed_program(pterm) +else() + message("ConPTY not available; cannot build Windows pterm") +endif() + +add_executable(test_split_into_argv + utils/split_into_argv.c) +target_compile_definitions(test_split_into_argv PRIVATE TEST) +target_link_libraries(test_split_into_argv utils ${platform_libraries}) + +if(PUTTY_CAC) +target_link_libraries(puttytel crypto utils network sshclient) +target_link_libraries(pterm crypto utils network sshclient) +target_include_directories(crypto PUBLIC ../contrib) +target_include_directories(crypto PUBLIC ../crypto) +target_include_directories(crypto PUBLIC ../cert) +target_include_directories(sshcommon PUBLIC ../cert) +target_include_directories(settings PUBLIC ../cert) +target_include_directories(agent PUBLIC ../cert) +target_include_directories(guiterminal PUBLIC ../cert) +target_include_directories(sshclient PUBLIC ../cert) +target_include_directories(testcrypt PUBLIC ../cert) +target_include_directories(puttygen PUBLIC ../cert) +add_sources_from_current_dir(crypto +../cert/cert_common.c +../cert/cert_pkcs.c +../cert/cert_capi.c +../cert/cert_fido.c) + +add_executable(puttyimp + puttyimp.c puttyimp.rc) +target_link_directories(puttyimp PUBLIC + ../contrib/libfido2/lib/${CMAKE_GENERATOR_PLATFORM}, + contrib/libfido2/lib/${CMAKE_GENERATOR_PLATFORM}) +target_include_directories(puttyimp PUBLIC ../contrib/libfido2/include) +set_target_properties(puttyimp PROPERTIES + WIN32_EXECUTABLE OFF + LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"") +installed_program(puttyimp) +endif() diff --git a/code/windows/DEVCPP/pageant/pageant.dev b/code/windows/DEVCPP/pageant/pageant.dev deleted file mode 100644 index 8bd7ed1..0000000 --- a/code/windows/DEVCPP/pageant/pageant.dev +++ /dev/null @@ -1,831 +0,0 @@ -# DEV-C++ 5 Project File - pageant.dev -# ** DO NOT EDIT ** - -[Project] -FileName=pageant.dev -Name=pageant -Ver=1 -IsCpp=1 -Type=0 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=78 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=pageant_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=pageant.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\aqsync.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\be_misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\callback.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\errsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\pageant.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\windows\wincapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\windows\winhandl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\windows\winhelp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\windows\winhsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\windows\winnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\windows\winnpc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\windows\winnps.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\windows\winpgnt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\windows\winpgntc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\windows\winselgui.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\windows\winutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\pageant.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\proxy.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\sshcr.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\windows\pageant-rc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\windows\win_res.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\windows\wincapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\windows\pageant.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\windows\pageant.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\windows\pageants.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=pageant.exe -ProductName=pageant -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/plink/plink.dev b/code/windows/DEVCPP/plink/plink.dev deleted file mode 100644 index 8ddbb05..0000000 --- a/code/windows/DEVCPP/plink/plink.dev +++ /dev/null @@ -1,1611 +0,0 @@ -# DEV-C++ 5 Project File - plink.dev -# ** DO NOT EDIT ** - -[Project] -FileName=plink.dev -Name=plink -Ver=1 -IsCpp=1 -Type=1 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=156 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=plink_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=plink.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\agentf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\aqsync.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\be_all_s.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\be_misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\callback.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\clicons.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\cmdline.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\console.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\cproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\errsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\ldisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\logging.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\mainchan.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\miscucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\noshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\noterm.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\nullplug.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\pgssapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\pinger.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\portfwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\proxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\raw.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\rlogin.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\sessprep.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\settings.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\ssh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\ssh1bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\ssh1censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\ssh1connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\ssh1connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\ssh1login.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\ssh2bpp-bare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\ssh2bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\ssh2censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\ssh2connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\ssh2connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\ssh2kex-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\ssh2transhk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\ssh2transport.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\ssh2userauth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\ssharcf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\sshblowf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\sshccp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\sshcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\sshcrc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\sshcrcda.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\sshdh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\sshgssc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\sshmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\sshprng.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\sshrand.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\sshshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\sshutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\sshverstring.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\sshzlib.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\supdup.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit79] -FileName=..\..\..\telnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit80] -FileName=..\..\..\timing.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit81] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit82] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit83] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit84] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit85] -FileName=..\..\..\wildcard.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit86] -FileName=..\..\..\windows\wincapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit87] -FileName=..\..\..\windows\wincliloop.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit88] -FileName=..\..\..\windows\wincons.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit89] -FileName=..\..\..\windows\windefs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit90] -FileName=..\..\..\windows\wingss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit91] -FileName=..\..\..\windows\winhandl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit92] -FileName=..\..\..\windows\winhsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit93] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit94] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit95] -FileName=..\..\..\windows\winnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit96] -FileName=..\..\..\windows\winnohlp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit97] -FileName=..\..\..\windows\winnoise.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit98] -FileName=..\..\..\windows\winnojmp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit99] -FileName=..\..\..\windows\winnpc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit100] -FileName=..\..\..\windows\winnps.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit101] -FileName=..\..\..\windows\winpgntc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit102] -FileName=..\..\..\windows\winplink.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit103] -FileName=..\..\..\windows\winproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit104] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit105] -FileName=..\..\..\windows\winselcli.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit106] -FileName=..\..\..\windows\winser.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit107] -FileName=..\..\..\windows\winshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit108] -FileName=..\..\..\windows\winstore.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit109] -FileName=..\..\..\windows\wintime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit110] -FileName=..\..\..\windows\winucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit111] -FileName=..\..\..\windows\winx11.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit112] -FileName=..\..\..\x11fwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit113] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit114] -FileName=..\..\..\console.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit115] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit116] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit117] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit118] -FileName=..\..\..\ldisc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit119] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit120] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit121] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit122] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit123] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit124] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit125] -FileName=..\..\..\pageant.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit126] -FileName=..\..\..\pgssapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit127] -FileName=..\..\..\proxy.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit128] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit129] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit130] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit131] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit132] -FileName=..\..\..\ssh1connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit133] -FileName=..\..\..\ssh2connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit134] -FileName=..\..\..\ssh2transport.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit135] -FileName=..\..\..\sshblowf.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit136] -FileName=..\..\..\sshbpp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit137] -FileName=..\..\..\sshchan.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit138] -FileName=..\..\..\sshcr.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit139] -FileName=..\..\..\sshgss.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit140] -FileName=..\..\..\sshgssc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit141] -FileName=..\..\..\sshppl.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit142] -FileName=..\..\..\sshserver.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit143] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit144] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit145] -FileName=..\..\..\storage.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit146] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit147] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit148] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit149] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit150] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit151] -FileName=..\..\..\windows\wincapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit152] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit153] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit154] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit155] -FileName=..\..\..\windows\plink.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit156] -FileName=..\..\..\windows\putty.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=plink.exe -ProductName=plink -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/pscp/pscp.dev b/code/windows/DEVCPP/pscp/pscp.dev deleted file mode 100644 index 0afbc8a..0000000 --- a/code/windows/DEVCPP/pscp/pscp.dev +++ /dev/null @@ -1,1571 +0,0 @@ -# DEV-C++ 5 Project File - pscp.dev -# ** DO NOT EDIT ** - -[Project] -FileName=pscp.dev -Name=pscp -Ver=1 -IsCpp=1 -Type=1 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=152 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=pscp_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=pscp.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\agentf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\aqsync.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\be_misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\be_ssh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\callback.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\clicons.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\cmdline.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\console.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\cproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\errsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\logging.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\mainchan.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\miscucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\noshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\nullplug.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\pgssapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\pinger.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\portfwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\proxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\pscp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\psftpcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\settings.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\sftp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\sftpcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\ssh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\ssh1bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\ssh1censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\ssh1connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\ssh1connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\ssh1login.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\ssh2bpp-bare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\ssh2bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\ssh2censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\ssh2connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\ssh2connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\ssh2kex-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\ssh2transhk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\ssh2transport.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\ssh2userauth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\ssharcf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\sshblowf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\sshccp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\sshcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\sshcrc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\sshcrcda.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\sshdh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\sshgssc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\sshmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\sshprng.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\sshrand.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\sshshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\sshutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\sshverstring.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\sshzlib.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\timing.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit79] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit80] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit81] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit82] -FileName=..\..\..\wildcard.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit83] -FileName=..\..\..\windows\wincapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit84] -FileName=..\..\..\windows\wincliloop.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit85] -FileName=..\..\..\windows\wincons.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit86] -FileName=..\..\..\windows\windefs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit87] -FileName=..\..\..\windows\wingss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit88] -FileName=..\..\..\windows\winhandl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit89] -FileName=..\..\..\windows\winhsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit90] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit91] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit92] -FileName=..\..\..\windows\winnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit93] -FileName=..\..\..\windows\winnohlp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit94] -FileName=..\..\..\windows\winnoise.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit95] -FileName=..\..\..\windows\winnojmp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit96] -FileName=..\..\..\windows\winnpc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit97] -FileName=..\..\..\windows\winnps.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit98] -FileName=..\..\..\windows\winpgntc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit99] -FileName=..\..\..\windows\winproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit100] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit101] -FileName=..\..\..\windows\winselcli.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit102] -FileName=..\..\..\windows\winsftp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit103] -FileName=..\..\..\windows\winshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit104] -FileName=..\..\..\windows\winstore.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit105] -FileName=..\..\..\windows\wintime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit106] -FileName=..\..\..\windows\winucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit107] -FileName=..\..\..\x11fwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit108] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit109] -FileName=..\..\..\console.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit110] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit111] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit112] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit113] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit114] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit115] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit116] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit117] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit118] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit119] -FileName=..\..\..\pageant.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit120] -FileName=..\..\..\pgssapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit121] -FileName=..\..\..\proxy.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit122] -FileName=..\..\..\psftp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit123] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit124] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit125] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit126] -FileName=..\..\..\sftp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit127] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit128] -FileName=..\..\..\ssh1connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit129] -FileName=..\..\..\ssh2connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit130] -FileName=..\..\..\ssh2transport.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit131] -FileName=..\..\..\sshblowf.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit132] -FileName=..\..\..\sshbpp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit133] -FileName=..\..\..\sshchan.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit134] -FileName=..\..\..\sshcr.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit135] -FileName=..\..\..\sshgss.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit136] -FileName=..\..\..\sshgssc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit137] -FileName=..\..\..\sshppl.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit138] -FileName=..\..\..\sshserver.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit139] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit140] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit141] -FileName=..\..\..\storage.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit142] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit143] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit144] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit145] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit146] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit147] -FileName=..\..\..\windows\wincapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit148] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit149] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit150] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit151] -FileName=..\..\..\windows\pscp.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit152] -FileName=..\..\..\windows\pscp.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=pscp.exe -ProductName=pscp -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/psftp/psftp.dev b/code/windows/DEVCPP/psftp/psftp.dev deleted file mode 100644 index ca80126..0000000 --- a/code/windows/DEVCPP/psftp/psftp.dev +++ /dev/null @@ -1,1571 +0,0 @@ -# DEV-C++ 5 Project File - psftp.dev -# ** DO NOT EDIT ** - -[Project] -FileName=psftp.dev -Name=psftp -Ver=1 -IsCpp=1 -Type=1 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=152 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=psftp_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=psftp.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\agentf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\aqsync.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\be_misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\be_ssh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\callback.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\clicons.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\cmdline.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\console.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\cproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\errsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\logging.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\mainchan.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\miscucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\noshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\nullplug.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\pgssapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\pinger.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\portfwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\proxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\psftp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\psftpcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\settings.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\sftp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\sftpcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\ssh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\ssh1bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\ssh1censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\ssh1connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\ssh1connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\ssh1login.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\ssh2bpp-bare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\ssh2bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\ssh2censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\ssh2connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\ssh2connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\ssh2kex-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\ssh2transhk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\ssh2transport.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\ssh2userauth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\ssharcf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\sshblowf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\sshccp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\sshcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\sshcrc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\sshcrcda.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\sshdh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\sshgssc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\sshmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\sshprng.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\sshrand.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\sshshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\sshutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\sshverstring.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\sshzlib.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\timing.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit79] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit80] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit81] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit82] -FileName=..\..\..\wildcard.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit83] -FileName=..\..\..\windows\wincapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit84] -FileName=..\..\..\windows\wincliloop.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit85] -FileName=..\..\..\windows\wincons.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit86] -FileName=..\..\..\windows\windefs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit87] -FileName=..\..\..\windows\wingss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit88] -FileName=..\..\..\windows\winhandl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit89] -FileName=..\..\..\windows\winhsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit90] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit91] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit92] -FileName=..\..\..\windows\winnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit93] -FileName=..\..\..\windows\winnohlp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit94] -FileName=..\..\..\windows\winnoise.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit95] -FileName=..\..\..\windows\winnojmp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit96] -FileName=..\..\..\windows\winnpc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit97] -FileName=..\..\..\windows\winnps.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit98] -FileName=..\..\..\windows\winpgntc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit99] -FileName=..\..\..\windows\winproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit100] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit101] -FileName=..\..\..\windows\winselcli.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit102] -FileName=..\..\..\windows\winsftp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit103] -FileName=..\..\..\windows\winshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit104] -FileName=..\..\..\windows\winstore.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit105] -FileName=..\..\..\windows\wintime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit106] -FileName=..\..\..\windows\winucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit107] -FileName=..\..\..\x11fwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit108] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit109] -FileName=..\..\..\console.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit110] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit111] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit112] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit113] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit114] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit115] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit116] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit117] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit118] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit119] -FileName=..\..\..\pageant.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit120] -FileName=..\..\..\pgssapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit121] -FileName=..\..\..\proxy.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit122] -FileName=..\..\..\psftp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit123] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit124] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit125] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit126] -FileName=..\..\..\sftp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit127] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit128] -FileName=..\..\..\ssh1connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit129] -FileName=..\..\..\ssh2connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit130] -FileName=..\..\..\ssh2transport.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit131] -FileName=..\..\..\sshblowf.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit132] -FileName=..\..\..\sshbpp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit133] -FileName=..\..\..\sshchan.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit134] -FileName=..\..\..\sshcr.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit135] -FileName=..\..\..\sshgss.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit136] -FileName=..\..\..\sshgssc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit137] -FileName=..\..\..\sshppl.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit138] -FileName=..\..\..\sshserver.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit139] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit140] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit141] -FileName=..\..\..\storage.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit142] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit143] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit144] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit145] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit146] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit147] -FileName=..\..\..\windows\wincapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit148] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit149] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit150] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit151] -FileName=..\..\..\windows\pscp.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit152] -FileName=..\..\..\windows\psftp.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=psftp.exe -ProductName=psftp -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/putty/putty.dev b/code/windows/DEVCPP/putty/putty.dev deleted file mode 100644 index 63dab10..0000000 --- a/code/windows/DEVCPP/putty/putty.dev +++ /dev/null @@ -1,1691 +0,0 @@ -# DEV-C++ 5 Project File - putty.dev -# ** DO NOT EDIT ** - -[Project] -FileName=putty.dev -Name=putty -Ver=1 -IsCpp=1 -Type=0 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=164 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=putty_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=putty.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\agentf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\aqsync.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\be_all_s.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\be_misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\callback.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\cmdline.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\config.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\cproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\dialog.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\errsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\ldisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\logging.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\mainchan.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\minibidi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\miscucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\noshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\nullplug.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\pgssapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\pinger.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\portfwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\proxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\raw.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\rlogin.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\sessprep.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\settings.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\ssh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\ssh1bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\ssh1censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\ssh1connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\ssh1connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\ssh1login.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\ssh2bpp-bare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\ssh2bpp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\ssh2censor.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\ssh2connection-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\ssh2connection.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\ssh2kex-client.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\ssh2transhk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\ssh2transport.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\ssh2userauth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\ssharcf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\sshblowf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\sshccp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\sshcommon.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\sshcrc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\sshcrcda.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\sshdh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\sshgssc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\sshmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\sshprng.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\sshrand.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\sshshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\sshutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\sshverstring.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\sshzlib.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\supdup.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit79] -FileName=..\..\..\telnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit80] -FileName=..\..\..\terminal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit81] -FileName=..\..\..\timing.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit82] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit83] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit84] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit85] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit86] -FileName=..\..\..\wildcard.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit87] -FileName=..\..\..\windows\sizetip.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit88] -FileName=..\..\..\windows\wincapi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit89] -FileName=..\..\..\windows\wincfg.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit90] -FileName=..\..\..\windows\winctrls.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit91] -FileName=..\..\..\windows\windefs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit92] -FileName=..\..\..\windows\windlg.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit93] -FileName=..\..\..\windows\window.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit94] -FileName=..\..\..\windows\wingss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit95] -FileName=..\..\..\windows\winhandl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit96] -FileName=..\..\..\windows\winhelp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit97] -FileName=..\..\..\windows\winhsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit98] -FileName=..\..\..\windows\winjump.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit99] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit100] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit101] -FileName=..\..\..\windows\winnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit102] -FileName=..\..\..\windows\winnoise.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit103] -FileName=..\..\..\windows\winnpc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit104] -FileName=..\..\..\windows\winnps.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit105] -FileName=..\..\..\windows\winpgntc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit106] -FileName=..\..\..\windows\winprint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit107] -FileName=..\..\..\windows\winproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit108] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit109] -FileName=..\..\..\windows\winselgui.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit110] -FileName=..\..\..\windows\winser.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit111] -FileName=..\..\..\windows\winshare.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit112] -FileName=..\..\..\windows\winstore.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit113] -FileName=..\..\..\windows\wintime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit114] -FileName=..\..\..\windows\winucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit115] -FileName=..\..\..\windows\winutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit116] -FileName=..\..\..\windows\winx11.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit117] -FileName=..\..\..\x11fwd.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit118] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit119] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit120] -FileName=..\..\..\dialog.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit121] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit122] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit123] -FileName=..\..\..\ldisc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit124] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit125] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit126] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit127] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit128] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit129] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit130] -FileName=..\..\..\pageant.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit131] -FileName=..\..\..\pgssapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit132] -FileName=..\..\..\proxy.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit133] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit134] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit135] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit136] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit137] -FileName=..\..\..\ssh1connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit138] -FileName=..\..\..\ssh2connection.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit139] -FileName=..\..\..\ssh2transport.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit140] -FileName=..\..\..\sshblowf.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit141] -FileName=..\..\..\sshbpp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit142] -FileName=..\..\..\sshchan.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit143] -FileName=..\..\..\sshcr.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit144] -FileName=..\..\..\sshgss.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit145] -FileName=..\..\..\sshgssc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit146] -FileName=..\..\..\sshppl.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit147] -FileName=..\..\..\sshserver.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit148] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit149] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit150] -FileName=..\..\..\storage.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit151] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit152] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit153] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit154] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit155] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit156] -FileName=..\..\..\windows\win_res.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit157] -FileName=..\..\..\windows\wincapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit158] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit159] -FileName=..\..\..\windows\winseat.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit160] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit161] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit162] -FileName=..\..\..\windows\putty.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit163] -FileName=..\..\..\windows\putty.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit164] -FileName=..\..\..\windows\puttycfg.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=putty.exe -ProductName=putty -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/puttygen/puttygen.dev b/code/windows/DEVCPP/puttygen/puttygen.dev deleted file mode 100644 index 9070fc0..0000000 --- a/code/windows/DEVCPP/puttygen/puttygen.dev +++ /dev/null @@ -1,901 +0,0 @@ -# DEV-C++ 5 Project File - puttygen.dev -# ** DO NOT EDIT ** - -[Project] -FileName=puttygen.dev -Name=puttygen -Ver=1 -IsCpp=1 -Type=0 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=85 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=puttygen_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=puttygen.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\import.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\millerrabin.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\mpunsafe.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\notiming.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\pockle.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\primecandidate.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\smallprimes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\sshbcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\sshblowf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\sshdssg.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\sshecdsag.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\sshprime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\sshprng.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\sshrand.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\sshrsag.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\windows\winctrls.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\windows\winhelp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\windows\winnoise.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\windows\winnojmp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\windows\winpgen.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\windows\winstore.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\windows\wintime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\windows\winutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\dialog.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\mpunsafe.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\sshblowf.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\sshkeygen.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\storage.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\windows\puttygen-rc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit79] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit80] -FileName=..\..\..\windows\win_res.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit81] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit82] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit83] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit84] -FileName=..\..\..\windows\puttygen.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit85] -FileName=..\..\..\windows\puttygen.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=puttygen.exe -ProductName=puttygen -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/puttytel/puttytel.dev b/code/windows/DEVCPP/puttytel/puttytel.dev deleted file mode 100644 index fc2c94b..0000000 --- a/code/windows/DEVCPP/puttytel/puttytel.dev +++ /dev/null @@ -1,931 +0,0 @@ -# DEV-C++ 5 Project File - puttytel.dev -# ** DO NOT EDIT ** - -[Project] -FileName=puttytel.dev -Name=puttytel -Ver=1 -IsCpp=1 -Type=0 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=88 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=puttytel_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=puttytel.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\be_misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\be_nos_s.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\callback.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\cmdline.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\conf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\config.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\dialog.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\errsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\ldisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\logging.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\minibidi.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\misc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\miscucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\nocproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\nogss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\norand.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\pinger.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\proxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\raw.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\rlogin.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\sessprep.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\settings.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\stripctrl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\supdup.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\telnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\terminal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\timing.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\version.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\wcwidth.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\windows\sizetip.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\windows\wincfg.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\windows\winctrls.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\windows\windefs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\windows\windlg.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\windows\window.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\windows\winhandl.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\windows\winhelp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\windows\winhsock.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\windows\winjump.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\windows\winmisc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\windows\winnet.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\windows\winprint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\windows\winproxy.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\windows\winsecur.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\windows\winselgui.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\windows\winser.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\windows\winstore.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\windows\wintime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\windows\winucs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\windows\winutils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\dialog.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\empty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\ldisc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\licence.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=..\..\..\pgssapi.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=..\..\..\proxy.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=..\..\..\sshgss.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=..\..\..\sshgssc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit75] -FileName=..\..\..\storage.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit76] -FileName=..\..\..\terminal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit77] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit78] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit79] -FileName=..\..\..\version.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit80] -FileName=..\..\..\windows\rcstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit81] -FileName=..\..\..\windows\win_res.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit82] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit83] -FileName=..\..\..\windows\winseat.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit84] -FileName=..\..\..\windows\winsecur.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit85] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit86] -FileName=..\..\..\windows\putty.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit87] -FileName=..\..\..\windows\puttycfg.ico -Folder=Resource Files -Compile=0 -CompileCpp=0 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit88] -FileName=..\..\..\windows\puttytel.rc -Folder=Resource Files -Compile=1 -CompileCpp=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=puttytel.exe -ProductName=puttytel -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/DEVCPP/testcrypt/testcrypt.dev b/code/windows/DEVCPP/testcrypt/testcrypt.dev deleted file mode 100644 index 4f6e0d2..0000000 --- a/code/windows/DEVCPP/testcrypt/testcrypt.dev +++ /dev/null @@ -1,661 +0,0 @@ -# DEV-C++ 5 Project File - testcrypt.dev -# ** DO NOT EDIT ** - -[Project] -FileName=testcrypt.dev -Name=testcrypt -Ver=1 -IsCpp=1 -Type=1 -Compiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -CppCompiler=-W -D__GNUWIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNO_MULTIMON -D_MBCS_@@_ -Includes=..\..\..\.;..\..\..\charset;..\..\..\windows;..\..\..\unix -Linker=-ladvapi32 -lcomctl32 -lcomdlg32 -lgdi32 -limm32 -lshell32 -luser32 -lwinmm -lwinspool_@@_ -Libs= -UnitCount=61 -Folders="Header Files","Resource Files","Source Files" -ObjFiles= -PrivateResource=testcrypt_private.rc -ResourceIncludes=..\..\..\WINDOWS -MakeIncludes= -Icon= -ExeOutput= -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=testcrypt.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=..\..\..\ecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=..\..\..\marshal.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=..\..\..\memory.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=..\..\..\millerrabin.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=..\..\..\mpint.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=..\..\..\mpunsafe.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=..\..\..\pockle.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=..\..\..\primecandidate.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=..\..\..\smallprimes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=..\..\..\sshaes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=..\..\..\ssharcf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=..\..\..\sshargon2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=..\..\..\sshauxcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=..\..\..\sshblake2.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=..\..\..\sshblowf.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=..\..\..\sshccp.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=..\..\..\sshcrc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=..\..\..\sshcrcda.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=..\..\..\sshdes.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=..\..\..\sshdh.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=..\..\..\sshdss.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=..\..\..\sshdssg.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=..\..\..\sshecc.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=..\..\..\sshecdsag.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=..\..\..\sshhmac.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=..\..\..\sshmd5.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=..\..\..\sshprime.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=..\..\..\sshprng.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=..\..\..\sshpubk.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=..\..\..\sshrsa.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=..\..\..\sshrsag.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=..\..\..\sshsh256.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=..\..\..\sshsh512.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit34] -FileName=..\..\..\sshsha.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=..\..\..\sshsha3.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=..\..\..\testcrypt.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=..\..\..\tree234.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=..\..\..\utils.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=..\..\..\windows\winmiscs.c -Folder=Source Files -Compile=1 -CompileCpp=0 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=..\..\..\charset\charset.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=..\..\..\defs.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=..\..\..\ecc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=..\..\..\marshal.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=..\..\..\misc.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=..\..\..\mpint.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=..\..\..\mpint_i.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=..\..\..\mpunsafe.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=..\..\..\network.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=..\..\..\putty.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=..\..\..\puttymem.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=..\..\..\puttyps.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=..\..\..\ssh.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=..\..\..\sshblowf.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=..\..\..\sshkeygen.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=..\..\..\sshsignals.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=..\..\..\sshttymodes.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=..\..\..\testcrypt.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=..\..\..\tree234.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=..\..\..\unix\unix.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=..\..\..\windows\winhelp.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=..\..\..\windows\winstuff.h -Folder=Header Files -Compile=1 -CompileCpp=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=0 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion=0.1 -FileDescription= -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename=testcrypt.exe -ProductName=testcrypt -ProductVersion=0.1 -AutoIncBuildNr=0 diff --git a/code/windows/MSVC/pageant/pageant.dsp b/code/windows/MSVC/pageant/pageant.dsp deleted file mode 100644 index f00e73c..0000000 --- a/code/windows/MSVC/pageant/pageant.dsp +++ /dev/null @@ -1,417 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pageant" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=pageant - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pageant.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pageant.mak" CFG="pageant - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pageant - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "pageant - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pageant - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "pageant - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "pageant - Win32 Release" -# Name "pageant - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\aqsync.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\callback.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\errsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pageant.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhandl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnps.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgnt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgntc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winselgui.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winutils.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pageant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcr.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\pageant-rc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\win_res.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\pageant.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\pageant.rc -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\pageants.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/plink/plink.dsp b/code/windows/MSVC/plink/plink.dsp deleted file mode 100644 index 389ac1c..0000000 --- a/code/windows/MSVC/plink/plink.dsp +++ /dev/null @@ -1,738 +0,0 @@ -# Microsoft Developer Studio Project File - Name="plink" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=plink - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "plink.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "plink.mak" CFG="plink - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "plink - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "plink - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "plink - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:console /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "plink - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "plink - Win32 Release" -# Name "plink - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\agentf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\aqsync.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_all_s.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\callback.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\clicons.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cmdline.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\console.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\errsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ldisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\logging.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mainchan.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\miscucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\noshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\noterm.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\nullplug.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pinger.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\portfwd.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\raw.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\rlogin.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sessprep.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\settings.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.c - -!IF "$(CFG)" == "plink - Win32 Release" - -!ELSEIF "$(CFG)" == "plink - Win32 Debug" - -# ADD CPP /Zi - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1login.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp-bare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2kex-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transhk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2userauth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssharcf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshccp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrcda.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdh.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprng.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrand.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshutils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshverstring.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshzlib.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\supdup.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\telnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\timing.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wildcard.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincliloop.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincons.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windefs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wingss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhandl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnohlp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnoise.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnojmp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnps.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgntc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winplink.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winselcli.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winser.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstore.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wintime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winx11.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\x11fwd.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\console.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ldisc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pageant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshbpp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshchan.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcr.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgss.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshppl.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshserver.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\storage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\plink.rc -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\putty.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/pscp/pscp.dsp b/code/windows/MSVC/pscp/pscp.dsp deleted file mode 100644 index 5d47264..0000000 --- a/code/windows/MSVC/pscp/pscp.dsp +++ /dev/null @@ -1,731 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pscp" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=pscp - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pscp.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pscp.mak" CFG="pscp - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pscp - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "pscp - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pscp - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:console /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "pscp - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "pscp - Win32 Release" -# Name "pscp - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\agentf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\aqsync.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_ssh.c - -!IF "$(CFG)" == "pscp - Win32 Release" - -!ELSEIF "$(CFG)" == "pscp - Win32 Debug" - -# ADD CPP /Zi - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\callback.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\clicons.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cmdline.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\console.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\errsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\logging.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mainchan.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\miscucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\noshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\nullplug.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pinger.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\portfwd.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pscp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\psftpcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\settings.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sftp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sftpcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.c - -!IF "$(CFG)" == "pscp - Win32 Release" - -!ELSEIF "$(CFG)" == "pscp - Win32 Debug" - -# ADD CPP /Zi - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1login.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp-bare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2kex-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transhk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2userauth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssharcf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshccp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrcda.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdh.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprng.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrand.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshutils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshverstring.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshzlib.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\timing.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wildcard.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincliloop.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincons.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windefs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wingss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhandl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnohlp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnoise.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnojmp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnps.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgntc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winselcli.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsftp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstore.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wintime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\x11fwd.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\console.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pageant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\psftp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sftp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshbpp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshchan.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcr.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgss.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshppl.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshserver.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\storage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\pscp.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\pscp.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/psftp/psftp.dsp b/code/windows/MSVC/psftp/psftp.dsp deleted file mode 100644 index 527c69f..0000000 --- a/code/windows/MSVC/psftp/psftp.dsp +++ /dev/null @@ -1,731 +0,0 @@ -# Microsoft Developer Studio Project File - Name="psftp" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=psftp - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "psftp.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "psftp.mak" CFG="psftp - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "psftp - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "psftp - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "psftp - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:console /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "psftp - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "psftp - Win32 Release" -# Name "psftp - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\agentf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\aqsync.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_ssh.c - -!IF "$(CFG)" == "psftp - Win32 Release" - -!ELSEIF "$(CFG)" == "psftp - Win32 Debug" - -# ADD CPP /Zi - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\callback.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\clicons.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cmdline.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\console.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\errsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\logging.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mainchan.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\miscucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\noshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\nullplug.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pinger.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\portfwd.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\psftp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\psftpcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\settings.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sftp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sftpcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.c - -!IF "$(CFG)" == "psftp - Win32 Release" - -!ELSEIF "$(CFG)" == "psftp - Win32 Debug" - -# ADD CPP /Zi - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1login.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp-bare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2kex-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transhk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2userauth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssharcf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshccp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrcda.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdh.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprng.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrand.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshutils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshverstring.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshzlib.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\timing.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wildcard.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincliloop.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincons.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windefs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wingss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhandl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnohlp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnoise.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnojmp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnps.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgntc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winselcli.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsftp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstore.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wintime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\x11fwd.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\console.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pageant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\psftp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sftp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshbpp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshchan.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcr.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgss.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshppl.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshserver.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\storage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\pscp.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\psftp.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/putty.dsw b/code/windows/MSVC/putty.dsw deleted file mode 100644 index 26c59c9..0000000 --- a/code/windows/MSVC/putty.dsw +++ /dev/null @@ -1,37 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "pageant"=".\pageant\pageant.dsp" - Package Owner=<4> -Project: "plink"=".\plink\plink.dsp" - Package Owner=<4> -Project: "pscp"=".\pscp\pscp.dsp" - Package Owner=<4> -Project: "psftp"=".\psftp\psftp.dsp" - Package Owner=<4> -Project: "psocks"=".\psocks\psocks.dsp" - Package Owner=<4> -Project: "putty"=".\putty\putty.dsp" - Package Owner=<4> -Project: "puttygen"=".\puttygen\puttygen.dsp" - Package Owner=<4> -Project: "puttytel"=".\puttytel\puttytel.dsp" - Package Owner=<4> -Project: "testcrypt"=".\testcrypt\testcrypt.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/code/windows/MSVC/putty/putty.dsp b/code/windows/MSVC/putty/putty.dsp deleted file mode 100644 index 51a0ad3..0000000 --- a/code/windows/MSVC/putty/putty.dsp +++ /dev/null @@ -1,770 +0,0 @@ -# Microsoft Developer Studio Project File - Name="putty" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=putty - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "putty.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "putty.mak" CFG="putty - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "putty - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "putty - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "putty - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "putty - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "putty - Win32 Release" -# Name "putty - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\agentf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\aqsync.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_all_s.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\callback.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cmdline.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\config.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\dialog.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\errsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ldisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\logging.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mainchan.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\minibidi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\miscucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\noshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\nullplug.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pinger.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\portfwd.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\raw.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\rlogin.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sessprep.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\settings.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.c - -!IF "$(CFG)" == "putty - Win32 Release" - -!ELSEIF "$(CFG)" == "putty - Win32 Debug" - -# ADD CPP /Zi - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1login.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp-bare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2bpp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2censor.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2kex-client.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transhk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2userauth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssharcf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshccp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcommon.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrcda.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdh.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprng.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrand.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshutils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshverstring.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshzlib.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\supdup.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\telnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\timing.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wildcard.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\sizetip.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincfg.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winctrls.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windefs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windlg.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\window.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wingss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhandl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winjump.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnoise.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnpc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnps.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgntc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winprint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winselgui.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winser.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winshare.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstore.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wintime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winutils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winx11.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\x11fwd.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\dialog.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ldisc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pageant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh1connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh2transport.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshbpp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshchan.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcr.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgss.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshppl.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshserver.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\storage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\win_res.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winseat.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\putty.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\putty.rc -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\puttycfg.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/puttygen/puttygen.dsp b/code/windows/MSVC/puttygen/puttygen.dsp deleted file mode 100644 index 9682a28..0000000 --- a/code/windows/MSVC/puttygen/puttygen.dsp +++ /dev/null @@ -1,445 +0,0 @@ -# Microsoft Developer Studio Project File - Name="puttygen" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=puttygen - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "puttygen.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "puttygen.mak" CFG="puttygen - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "puttygen - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "puttygen - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "puttygen - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "puttygen - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "puttygen - Win32 Release" -# Name "puttygen - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\import.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\millerrabin.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpunsafe.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\notiming.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pockle.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\primecandidate.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\smallprimes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshbcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdssg.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecdsag.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprng.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrand.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsag.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winctrls.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnoise.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnojmp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winpgen.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstore.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wintime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winutils.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\dialog.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpunsafe.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshkeygen.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\storage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\puttygen-rc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\win_res.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\puttygen.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\puttygen.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/puttytel/puttytel.dsp b/code/windows/MSVC/puttytel/puttytel.dsp deleted file mode 100644 index 22c223c..0000000 --- a/code/windows/MSVC/puttytel/puttytel.dsp +++ /dev/null @@ -1,457 +0,0 @@ -# Microsoft Developer Studio Project File - Name="puttytel" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=puttytel - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "puttytel.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "puttytel.mak" CFG="puttytel - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "puttytel - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "puttytel - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "puttytel - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "puttytel - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 advapi32.lib comdlg32.lib gdi32.lib imm32.lib ole32.lib shell32.lib user32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "puttytel - Win32 Release" -# Name "puttytel - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\be_misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\be_nos_s.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\callback.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\cmdline.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\conf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\config.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\dialog.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\errsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ldisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\logging.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\minibidi.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\miscucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\nocproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\nogss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\norand.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pinger.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\raw.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\rlogin.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sessprep.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\settings.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\stripctrl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\supdup.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\telnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\timing.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\wcwidth.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\sizetip.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wincfg.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winctrls.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windefs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\windlg.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\window.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhandl.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhsock.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winjump.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmisc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winnet.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winprint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winproxy.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winselgui.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winser.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstore.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\wintime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winucs.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winutils.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\dialog.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\empty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ldisc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\licence.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\pgssapi.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\proxy.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgss.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshgssc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\storage.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\terminal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\version.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\rcstuff.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\win_res.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winseat.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winsecur.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\..\windows\putty.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\puttycfg.ico -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\puttytel.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/code/windows/MSVC/testcrypt/testcrypt.dsp b/code/windows/MSVC/testcrypt/testcrypt.dsp deleted file mode 100644 index ae99caa..0000000 --- a/code/windows/MSVC/testcrypt/testcrypt.dsp +++ /dev/null @@ -1,349 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testcrypt" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testcrypt - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testcrypt.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testcrypt.mak" CFG="testcrypt - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testcrypt - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testcrypt - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testcrypt - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /machine:I386 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "testcrypt - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\..\./" /I "..\..\..\charset/" /I "..\..\..\windows/" /I "..\..\..\unix/" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "testcrypt - Win32 Release" -# Name "testcrypt - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\ecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\memory.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\millerrabin.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpunsafe.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\pockle.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\primecandidate.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\smallprimes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshaes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssharcf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshargon2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshauxcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblake2.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshccp.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshcrcda.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdes.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdh.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdss.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshdssg.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecc.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshecdsag.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshhmac.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshmd5.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprime.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshprng.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshpubk.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsa.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshrsag.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh256.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsh512.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsha3.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\testcrypt.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winmiscs.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\charset\charset.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\defs.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ecc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\marshal.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\misc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpint_i.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\mpunsafe.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\network.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\putty.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttymem.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\puttyps.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\ssh.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshblowf.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshkeygen.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshsignals.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\sshttymodes.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\testcrypt.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\tree234.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\unix\unix.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winhelp.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\windows\winstuff.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/code/windows/Makefile.clangcl b/code/windows/Makefile.clangcl deleted file mode 100644 index c97f373..0000000 --- a/code/windows/Makefile.clangcl +++ /dev/null @@ -1,2390 +0,0 @@ -# Makefile for cross-compiling putty using clang-cl, lld-link, -# and llvm-rc, using GNU make on Linux. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. -# -# Extra options you can set: -# -# - COMPAT=/DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=/DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=/DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=/DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=/DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=/DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=/DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=/DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=/DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=/DMSVC4 (Windows only) -# - RCFL=/DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need /DNO_SECURITY and /DNO_MULTIMON. -# -# - COMPAT=/DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=/DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=/DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=/DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=/DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. - -CCCMD = clang-cl -RCCMD = llvm-rc -ifeq ($(Platform),x64) -CCTARGET = x86_64-pc-windows-msvc18.0.0 -PLATFORMCFLAGS = -else ifeq ($(Platform),arm) -CCTARGET = arm-pc-windows-msvc18.0.0 -PLATFORMCFLAGS = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /GS- -else ifeq ($(Platform),arm64) -CCTARGET = arm64-pc-windows-msvc18.0.0 -PLATFORMCFLAGS = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE /GS- -else -CCTARGET = i386-pc-windows-msvc18.0.0 -PLATFORMCFLAGS = -endif -CC = $(CCCMD) -RC = $(RCCMD) /c 1252 -RCPREPROC = $(CCCMD) /P /TC -LD = lld-link - -# C compilation flags -CFLAGS = --target=$(CCTARGET) /nologo /W3 /O1 -Wvla -I.././ -I../charset/ \ - -I../windows/ -I../unix/ /D_WINDOWS /D_WIN32_WINDOWS=0x500 \ - /DWINVER=0x500 /D_CRT_SECURE_NO_WARNINGS \ - /D_WINSOCK_DEPRECATED_NO_WARNINGS $(PLATFORMCFLAGS) -LFLAGS = /incremental:no /dynamicbase /nxcompat -RCPPFLAGS = -I.././ -I../charset/ -I../windows/ -I../unix/ -DWIN32 -D_WIN32 \ - -DWINVER=0x0400 $(RCFL) - -CFLAGS += /DHAS_GSSAPI - - -all: $(BUILDDIR)pageant.exe $(BUILDDIR)plink.exe $(BUILDDIR)pscp.exe \ - $(BUILDDIR)psftp.exe $(BUILDDIR)psocks.exe \ - $(BUILDDIR)putty.exe $(BUILDDIR)puttygen.exe \ - $(BUILDDIR)puttytel.exe $(BUILDDIR)testcrypt.exe - -$(BUILDDIR)pageant.exe: $(BUILDDIR)aqsync.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)conf.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)mpint.obj \ - $(BUILDDIR)pageant.obj $(BUILDDIR)pageant.res \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)sshargon2.obj \ - $(BUILDDIR)sshauxcrypt.obj $(BUILDDIR)sshblake2.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdss.obj \ - $(BUILDDIR)sshecc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmd5.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrsa.obj $(BUILDDIR)sshsh256.obj \ - $(BUILDDIR)sshsh512.obj $(BUILDDIR)sshsha.obj \ - $(BUILDDIR)sshsha3.obj $(BUILDDIR)stripctrl.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wincapi.obj $(BUILDDIR)winhandl.obj \ - $(BUILDDIR)winhelp.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnpc.obj \ - $(BUILDDIR)winnps.obj $(BUILDDIR)winpgnt.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselgui.obj $(BUILDDIR)winutils.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)pageant.exe \ - /lldmap:$(BUILDDIR)pageant.map \ - /subsystem:windows$(SUBSYSVER) $(EXTRA_windows) advapi32.lib \ - $(BUILDDIR)aqsync.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)callback.obj comdlg32.lib $(BUILDDIR)conf.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj gdi32.lib \ - imm32.lib $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)mpint.obj ole32.lib \ - $(BUILDDIR)pageant.obj $(BUILDDIR)pageant.res shell32.lib \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)sshargon2.obj \ - $(BUILDDIR)sshauxcrypt.obj $(BUILDDIR)sshblake2.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdss.obj \ - $(BUILDDIR)sshecc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmd5.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrsa.obj $(BUILDDIR)sshsh256.obj \ - $(BUILDDIR)sshsh512.obj $(BUILDDIR)sshsha.obj \ - $(BUILDDIR)sshsha3.obj $(BUILDDIR)stripctrl.obj \ - $(BUILDDIR)tree234.obj user32.lib $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wincapi.obj $(BUILDDIR)winhandl.obj \ - $(BUILDDIR)winhelp.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnpc.obj \ - $(BUILDDIR)winnps.obj $(BUILDDIR)winpgnt.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselgui.obj $(BUILDDIR)winutils.obj \ - $(EXTRA_libs) - -$(BUILDDIR)plink.exe: $(BUILDDIR)agentf.obj $(BUILDDIR)aqsync.obj \ - $(BUILDDIR)be_all_s.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)clicons.obj \ - $(BUILDDIR)cmdline.obj $(BUILDDIR)conf.obj \ - $(BUILDDIR)console.obj $(BUILDDIR)cproxy.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)ldisc.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)mainchan.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)misc.obj \ - $(BUILDDIR)miscucs.obj $(BUILDDIR)mpint.obj \ - $(BUILDDIR)noterm.obj $(BUILDDIR)nullplug.obj \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)plink.res $(BUILDDIR)portfwd.obj \ - $(BUILDDIR)proxy.obj $(BUILDDIR)raw.obj \ - $(BUILDDIR)rlogin.obj $(BUILDDIR)sessprep.obj \ - $(BUILDDIR)settings.obj $(BUILDDIR)ssh.obj \ - $(BUILDDIR)ssh1bpp.obj $(BUILDDIR)ssh1censor.obj \ - $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)supdup.obj \ - $(BUILDDIR)telnet.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wildcard.obj $(BUILDDIR)wincapi.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)windefs.obj $(BUILDDIR)wingss.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winnpc.obj $(BUILDDIR)winnps.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winplink.obj \ - $(BUILDDIR)winproxy.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselcli.obj $(BUILDDIR)winser.obj \ - $(BUILDDIR)winshare.obj $(BUILDDIR)winstore.obj \ - $(BUILDDIR)wintime.obj $(BUILDDIR)winucs.obj \ - $(BUILDDIR)winx11.obj $(BUILDDIR)x11fwd.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)plink.exe \ - /lldmap:$(BUILDDIR)plink.map /subsystem:console$(SUBSYSVER) \ - $(EXTRA_console) advapi32.lib $(BUILDDIR)agentf.obj \ - $(BUILDDIR)aqsync.obj $(BUILDDIR)be_all_s.obj \ - $(BUILDDIR)be_misc.obj $(BUILDDIR)callback.obj \ - $(BUILDDIR)clicons.obj $(BUILDDIR)cmdline.obj comdlg32.lib \ - $(BUILDDIR)conf.obj $(BUILDDIR)console.obj \ - $(BUILDDIR)cproxy.obj $(BUILDDIR)ecc.obj \ - $(BUILDDIR)errsock.obj gdi32.lib imm32.lib \ - $(BUILDDIR)ldisc.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)mainchan.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)misc.obj \ - $(BUILDDIR)miscucs.obj $(BUILDDIR)mpint.obj \ - $(BUILDDIR)noterm.obj $(BUILDDIR)nullplug.obj ole32.lib \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)plink.res $(BUILDDIR)portfwd.obj \ - $(BUILDDIR)proxy.obj $(BUILDDIR)raw.obj \ - $(BUILDDIR)rlogin.obj $(BUILDDIR)sessprep.obj \ - $(BUILDDIR)settings.obj shell32.lib $(BUILDDIR)ssh.obj \ - $(BUILDDIR)ssh1bpp.obj $(BUILDDIR)ssh1censor.obj \ - $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)supdup.obj \ - $(BUILDDIR)telnet.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj user32.lib $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wildcard.obj $(BUILDDIR)wincapi.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)windefs.obj $(BUILDDIR)wingss.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winnpc.obj $(BUILDDIR)winnps.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winplink.obj \ - $(BUILDDIR)winproxy.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselcli.obj $(BUILDDIR)winser.obj \ - $(BUILDDIR)winshare.obj $(BUILDDIR)winstore.obj \ - $(BUILDDIR)wintime.obj $(BUILDDIR)winucs.obj \ - $(BUILDDIR)winx11.obj $(BUILDDIR)x11fwd.obj $(EXTRA_libs) - -$(BUILDDIR)pscp.exe: $(BUILDDIR)agentf.obj $(BUILDDIR)aqsync.obj \ - $(BUILDDIR)be_misc.obj $(BUILDDIR)be_ssh.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)clicons.obj \ - $(BUILDDIR)cmdline.obj $(BUILDDIR)conf.obj \ - $(BUILDDIR)console.obj $(BUILDDIR)cproxy.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)logging.obj $(BUILDDIR)mainchan.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)miscucs.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)nullplug.obj \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)pscp.obj $(BUILDDIR)pscp.res \ - $(BUILDDIR)psftpcommon.obj $(BUILDDIR)settings.obj \ - $(BUILDDIR)sftp.obj $(BUILDDIR)sftpcommon.obj \ - $(BUILDDIR)ssh.obj $(BUILDDIR)ssh1bpp.obj \ - $(BUILDDIR)ssh1censor.obj $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wildcard.obj $(BUILDDIR)wincapi.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)windefs.obj $(BUILDDIR)wingss.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winnpc.obj $(BUILDDIR)winnps.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winselcli.obj \ - $(BUILDDIR)winsftp.obj $(BUILDDIR)winshare.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)x11fwd.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)pscp.exe \ - /lldmap:$(BUILDDIR)pscp.map /subsystem:console$(SUBSYSVER) \ - $(EXTRA_console) advapi32.lib $(BUILDDIR)agentf.obj \ - $(BUILDDIR)aqsync.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)be_ssh.obj $(BUILDDIR)callback.obj \ - $(BUILDDIR)clicons.obj $(BUILDDIR)cmdline.obj comdlg32.lib \ - $(BUILDDIR)conf.obj $(BUILDDIR)console.obj \ - $(BUILDDIR)cproxy.obj $(BUILDDIR)ecc.obj \ - $(BUILDDIR)errsock.obj gdi32.lib imm32.lib \ - $(BUILDDIR)logging.obj $(BUILDDIR)mainchan.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)miscucs.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)nullplug.obj ole32.lib \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)pscp.obj $(BUILDDIR)pscp.res \ - $(BUILDDIR)psftpcommon.obj $(BUILDDIR)settings.obj \ - $(BUILDDIR)sftp.obj $(BUILDDIR)sftpcommon.obj shell32.lib \ - $(BUILDDIR)ssh.obj $(BUILDDIR)ssh1bpp.obj \ - $(BUILDDIR)ssh1censor.obj $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj user32.lib $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wildcard.obj $(BUILDDIR)wincapi.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)windefs.obj $(BUILDDIR)wingss.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winnpc.obj $(BUILDDIR)winnps.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winselcli.obj \ - $(BUILDDIR)winsftp.obj $(BUILDDIR)winshare.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)x11fwd.obj $(EXTRA_libs) - -$(BUILDDIR)psftp.exe: $(BUILDDIR)agentf.obj $(BUILDDIR)aqsync.obj \ - $(BUILDDIR)be_misc.obj $(BUILDDIR)be_ssh.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)clicons.obj \ - $(BUILDDIR)cmdline.obj $(BUILDDIR)conf.obj \ - $(BUILDDIR)console.obj $(BUILDDIR)cproxy.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)logging.obj $(BUILDDIR)mainchan.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)miscucs.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)nullplug.obj \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)psftp.obj $(BUILDDIR)psftp.res \ - $(BUILDDIR)psftpcommon.obj $(BUILDDIR)settings.obj \ - $(BUILDDIR)sftp.obj $(BUILDDIR)sftpcommon.obj \ - $(BUILDDIR)ssh.obj $(BUILDDIR)ssh1bpp.obj \ - $(BUILDDIR)ssh1censor.obj $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wildcard.obj $(BUILDDIR)wincapi.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)windefs.obj $(BUILDDIR)wingss.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winnpc.obj $(BUILDDIR)winnps.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winselcli.obj \ - $(BUILDDIR)winsftp.obj $(BUILDDIR)winshare.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)x11fwd.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)psftp.exe \ - /lldmap:$(BUILDDIR)psftp.map /subsystem:console$(SUBSYSVER) \ - $(EXTRA_console) advapi32.lib $(BUILDDIR)agentf.obj \ - $(BUILDDIR)aqsync.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)be_ssh.obj $(BUILDDIR)callback.obj \ - $(BUILDDIR)clicons.obj $(BUILDDIR)cmdline.obj comdlg32.lib \ - $(BUILDDIR)conf.obj $(BUILDDIR)console.obj \ - $(BUILDDIR)cproxy.obj $(BUILDDIR)ecc.obj \ - $(BUILDDIR)errsock.obj gdi32.lib imm32.lib \ - $(BUILDDIR)logging.obj $(BUILDDIR)mainchan.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)miscucs.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)nullplug.obj ole32.lib \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)psftp.obj $(BUILDDIR)psftp.res \ - $(BUILDDIR)psftpcommon.obj $(BUILDDIR)settings.obj \ - $(BUILDDIR)sftp.obj $(BUILDDIR)sftpcommon.obj shell32.lib \ - $(BUILDDIR)ssh.obj $(BUILDDIR)ssh1bpp.obj \ - $(BUILDDIR)ssh1censor.obj $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj user32.lib $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wildcard.obj $(BUILDDIR)wincapi.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)windefs.obj $(BUILDDIR)wingss.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winnpc.obj $(BUILDDIR)winnps.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winselcli.obj \ - $(BUILDDIR)winsftp.obj $(BUILDDIR)winshare.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)x11fwd.obj $(EXTRA_libs) - -$(BUILDDIR)psocks.exe: $(BUILDDIR)be_misc.obj $(BUILDDIR)callback.obj \ - $(BUILDDIR)conf.obj $(BUILDDIR)console.obj \ - $(BUILDDIR)errsock.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)nocproxy.obj \ - $(BUILDDIR)norand.obj $(BUILDDIR)portfwd.obj \ - $(BUILDDIR)proxy.obj $(BUILDDIR)psocks.obj \ - $(BUILDDIR)sshutils.obj $(BUILDDIR)stripctrl.obj \ - $(BUILDDIR)time.obj $(BUILDDIR)timing.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wincliloop.obj $(BUILDDIR)wincons.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnohlp.obj \ - $(BUILDDIR)winproxy.obj $(BUILDDIR)winselcli.obj \ - $(BUILDDIR)winsocks.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)psocks.exe \ - /lldmap:$(BUILDDIR)psocks.map /subsystem:console$(SUBSYSVER) \ - $(EXTRA_console) advapi32.lib $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)callback.obj comdlg32.lib $(BUILDDIR)conf.obj \ - $(BUILDDIR)console.obj $(BUILDDIR)errsock.obj gdi32.lib \ - imm32.lib $(BUILDDIR)logging.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)misc.obj \ - $(BUILDDIR)nocproxy.obj $(BUILDDIR)norand.obj ole32.lib \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)psocks.obj shell32.lib $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)time.obj \ - $(BUILDDIR)timing.obj $(BUILDDIR)tree234.obj user32.lib \ - $(BUILDDIR)utils.obj $(BUILDDIR)version.obj \ - $(BUILDDIR)wcwidth.obj $(BUILDDIR)wincliloop.obj \ - $(BUILDDIR)wincons.obj $(BUILDDIR)winhandl.obj \ - $(BUILDDIR)winhsock.obj $(BUILDDIR)winmisc.obj \ - $(BUILDDIR)winmiscs.obj $(BUILDDIR)winnet.obj \ - $(BUILDDIR)winnohlp.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winselcli.obj $(BUILDDIR)winsocks.obj \ - $(EXTRA_libs) - -$(BUILDDIR)putty.exe: $(BUILDDIR)agentf.obj $(BUILDDIR)aqsync.obj \ - $(BUILDDIR)be_all_s.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)cmdline.obj \ - $(BUILDDIR)conf.obj $(BUILDDIR)config.obj \ - $(BUILDDIR)cproxy.obj $(BUILDDIR)dialog.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)ldisc.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)mainchan.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)minibidi.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)miscucs.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)nullplug.obj \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)putty.res $(BUILDDIR)raw.obj \ - $(BUILDDIR)rlogin.obj $(BUILDDIR)sessprep.obj \ - $(BUILDDIR)settings.obj $(BUILDDIR)sizetip.obj \ - $(BUILDDIR)ssh.obj $(BUILDDIR)ssh1bpp.obj \ - $(BUILDDIR)ssh1censor.obj $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)supdup.obj \ - $(BUILDDIR)telnet.obj $(BUILDDIR)terminal.obj \ - $(BUILDDIR)timing.obj $(BUILDDIR)tree234.obj \ - $(BUILDDIR)utils.obj $(BUILDDIR)version.obj \ - $(BUILDDIR)wcwidth.obj $(BUILDDIR)wildcard.obj \ - $(BUILDDIR)wincapi.obj $(BUILDDIR)wincfg.obj \ - $(BUILDDIR)winctrls.obj $(BUILDDIR)windefs.obj \ - $(BUILDDIR)windlg.obj $(BUILDDIR)window.obj \ - $(BUILDDIR)wingss.obj $(BUILDDIR)winhandl.obj \ - $(BUILDDIR)winhelp.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winjump.obj $(BUILDDIR)winmisc.obj \ - $(BUILDDIR)winmiscs.obj $(BUILDDIR)winnet.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnpc.obj \ - $(BUILDDIR)winnps.obj $(BUILDDIR)winpgntc.obj \ - $(BUILDDIR)winprint.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winselgui.obj \ - $(BUILDDIR)winser.obj $(BUILDDIR)winshare.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)winutils.obj \ - $(BUILDDIR)winx11.obj $(BUILDDIR)x11fwd.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)putty.exe \ - /lldmap:$(BUILDDIR)putty.map /subsystem:windows$(SUBSYSVER) \ - $(EXTRA_windows) advapi32.lib $(BUILDDIR)agentf.obj \ - $(BUILDDIR)aqsync.obj $(BUILDDIR)be_all_s.obj \ - $(BUILDDIR)be_misc.obj $(BUILDDIR)callback.obj \ - $(BUILDDIR)cmdline.obj comdlg32.lib $(BUILDDIR)conf.obj \ - $(BUILDDIR)config.obj $(BUILDDIR)cproxy.obj \ - $(BUILDDIR)dialog.obj $(BUILDDIR)ecc.obj \ - $(BUILDDIR)errsock.obj gdi32.lib imm32.lib \ - $(BUILDDIR)ldisc.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)mainchan.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)minibidi.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)miscucs.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)nullplug.obj ole32.lib \ - $(BUILDDIR)pgssapi.obj $(BUILDDIR)pinger.obj \ - $(BUILDDIR)portfwd.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)putty.res $(BUILDDIR)raw.obj \ - $(BUILDDIR)rlogin.obj $(BUILDDIR)sessprep.obj \ - $(BUILDDIR)settings.obj shell32.lib $(BUILDDIR)sizetip.obj \ - $(BUILDDIR)ssh.obj $(BUILDDIR)ssh1bpp.obj \ - $(BUILDDIR)ssh1censor.obj $(BUILDDIR)ssh1connection.obj \ - $(BUILDDIR)ssh1connection-client.obj \ - $(BUILDDIR)ssh1login.obj $(BUILDDIR)ssh2bpp.obj \ - $(BUILDDIR)ssh2bpp-bare.obj $(BUILDDIR)ssh2censor.obj \ - $(BUILDDIR)ssh2connection.obj \ - $(BUILDDIR)ssh2connection-client.obj \ - $(BUILDDIR)ssh2kex-client.obj $(BUILDDIR)ssh2transhk.obj \ - $(BUILDDIR)ssh2transport.obj $(BUILDDIR)ssh2userauth.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)ssharcf.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshccp.obj $(BUILDDIR)sshcommon.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshgssc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)sshshare.obj $(BUILDDIR)sshutils.obj \ - $(BUILDDIR)sshverstring.obj $(BUILDDIR)sshzlib.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)supdup.obj \ - $(BUILDDIR)telnet.obj $(BUILDDIR)terminal.obj \ - $(BUILDDIR)timing.obj $(BUILDDIR)tree234.obj user32.lib \ - $(BUILDDIR)utils.obj $(BUILDDIR)version.obj \ - $(BUILDDIR)wcwidth.obj $(BUILDDIR)wildcard.obj \ - $(BUILDDIR)wincapi.obj $(BUILDDIR)wincfg.obj \ - $(BUILDDIR)winctrls.obj $(BUILDDIR)windefs.obj \ - $(BUILDDIR)windlg.obj $(BUILDDIR)window.obj \ - $(BUILDDIR)wingss.obj $(BUILDDIR)winhandl.obj \ - $(BUILDDIR)winhelp.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winjump.obj $(BUILDDIR)winmisc.obj \ - $(BUILDDIR)winmiscs.obj $(BUILDDIR)winnet.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnpc.obj \ - $(BUILDDIR)winnps.obj $(BUILDDIR)winpgntc.obj \ - $(BUILDDIR)winprint.obj $(BUILDDIR)winproxy.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winselgui.obj \ - $(BUILDDIR)winser.obj $(BUILDDIR)winshare.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)winutils.obj \ - $(BUILDDIR)winx11.obj $(BUILDDIR)x11fwd.obj $(EXTRA_libs) - -$(BUILDDIR)puttygen.exe: $(BUILDDIR)conf.obj $(BUILDDIR)ecc.obj \ - $(BUILDDIR)import.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)millerrabin.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)mpint.obj \ - $(BUILDDIR)mpunsafe.obj $(BUILDDIR)notiming.obj \ - $(BUILDDIR)pockle.obj $(BUILDDIR)primecandidate.obj \ - $(BUILDDIR)puttygen.res $(BUILDDIR)smallprimes.obj \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)sshargon2.obj \ - $(BUILDDIR)sshauxcrypt.obj $(BUILDDIR)sshbcrypt.obj \ - $(BUILDDIR)sshblake2.obj $(BUILDDIR)sshblowf.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdss.obj \ - $(BUILDDIR)sshdssg.obj $(BUILDDIR)sshecc.obj \ - $(BUILDDIR)sshecdsag.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmd5.obj $(BUILDDIR)sshprime.obj \ - $(BUILDDIR)sshprng.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrand.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshrsag.obj $(BUILDDIR)sshsh256.obj \ - $(BUILDDIR)sshsh512.obj $(BUILDDIR)sshsha.obj \ - $(BUILDDIR)sshsha3.obj $(BUILDDIR)stripctrl.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)winctrls.obj $(BUILDDIR)winhelp.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnoise.obj $(BUILDDIR)winnojmp.obj \ - $(BUILDDIR)winpgen.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winutils.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)puttygen.exe \ - /lldmap:$(BUILDDIR)puttygen.map \ - /subsystem:windows$(SUBSYSVER) $(EXTRA_windows) advapi32.lib \ - comdlg32.lib $(BUILDDIR)conf.obj $(BUILDDIR)ecc.obj \ - gdi32.lib imm32.lib $(BUILDDIR)import.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)millerrabin.obj $(BUILDDIR)misc.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)mpunsafe.obj \ - $(BUILDDIR)notiming.obj ole32.lib $(BUILDDIR)pockle.obj \ - $(BUILDDIR)primecandidate.obj $(BUILDDIR)puttygen.res \ - shell32.lib $(BUILDDIR)smallprimes.obj $(BUILDDIR)sshaes.obj \ - $(BUILDDIR)sshargon2.obj $(BUILDDIR)sshauxcrypt.obj \ - $(BUILDDIR)sshbcrypt.obj $(BUILDDIR)sshblake2.obj \ - $(BUILDDIR)sshblowf.obj $(BUILDDIR)sshdes.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshdssg.obj \ - $(BUILDDIR)sshecc.obj $(BUILDDIR)sshecdsag.obj \ - $(BUILDDIR)sshhmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprime.obj $(BUILDDIR)sshprng.obj \ - $(BUILDDIR)sshpubk.obj $(BUILDDIR)sshrand.obj \ - $(BUILDDIR)sshrsa.obj $(BUILDDIR)sshrsag.obj \ - $(BUILDDIR)sshsh256.obj $(BUILDDIR)sshsh512.obj \ - $(BUILDDIR)sshsha.obj $(BUILDDIR)sshsha3.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)tree234.obj user32.lib \ - $(BUILDDIR)utils.obj $(BUILDDIR)version.obj \ - $(BUILDDIR)wcwidth.obj $(BUILDDIR)winctrls.obj \ - $(BUILDDIR)winhelp.obj $(BUILDDIR)winmisc.obj \ - $(BUILDDIR)winmiscs.obj $(BUILDDIR)winnoise.obj \ - $(BUILDDIR)winnojmp.obj $(BUILDDIR)winpgen.obj \ - $(BUILDDIR)winsecur.obj $(BUILDDIR)winstore.obj \ - $(BUILDDIR)wintime.obj $(BUILDDIR)winutils.obj $(EXTRA_libs) - -$(BUILDDIR)puttytel.exe: $(BUILDDIR)be_misc.obj $(BUILDDIR)be_nos_s.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)cmdline.obj \ - $(BUILDDIR)conf.obj $(BUILDDIR)config.obj \ - $(BUILDDIR)dialog.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)ldisc.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)minibidi.obj $(BUILDDIR)misc.obj \ - $(BUILDDIR)miscucs.obj $(BUILDDIR)nocproxy.obj \ - $(BUILDDIR)nogss.obj $(BUILDDIR)norand.obj \ - $(BUILDDIR)pinger.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)puttytel.res $(BUILDDIR)raw.obj \ - $(BUILDDIR)rlogin.obj $(BUILDDIR)sessprep.obj \ - $(BUILDDIR)settings.obj $(BUILDDIR)sizetip.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)supdup.obj \ - $(BUILDDIR)telnet.obj $(BUILDDIR)terminal.obj \ - $(BUILDDIR)timing.obj $(BUILDDIR)tree234.obj \ - $(BUILDDIR)utils.obj $(BUILDDIR)version.obj \ - $(BUILDDIR)wcwidth.obj $(BUILDDIR)wincfg.obj \ - $(BUILDDIR)winctrls.obj $(BUILDDIR)windefs.obj \ - $(BUILDDIR)windlg.obj $(BUILDDIR)window.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhelp.obj \ - $(BUILDDIR)winhsock.obj $(BUILDDIR)winjump.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winprint.obj \ - $(BUILDDIR)winproxy.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselgui.obj $(BUILDDIR)winser.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)winutils.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)puttytel.exe \ - /lldmap:$(BUILDDIR)puttytel.map \ - /subsystem:windows$(SUBSYSVER) $(EXTRA_windows) advapi32.lib \ - $(BUILDDIR)be_misc.obj $(BUILDDIR)be_nos_s.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)cmdline.obj comdlg32.lib \ - $(BUILDDIR)conf.obj $(BUILDDIR)config.obj \ - $(BUILDDIR)dialog.obj $(BUILDDIR)errsock.obj gdi32.lib \ - imm32.lib $(BUILDDIR)ldisc.obj $(BUILDDIR)logging.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)minibidi.obj $(BUILDDIR)misc.obj \ - $(BUILDDIR)miscucs.obj $(BUILDDIR)nocproxy.obj \ - $(BUILDDIR)nogss.obj $(BUILDDIR)norand.obj ole32.lib \ - $(BUILDDIR)pinger.obj $(BUILDDIR)proxy.obj \ - $(BUILDDIR)puttytel.res $(BUILDDIR)raw.obj \ - $(BUILDDIR)rlogin.obj $(BUILDDIR)sessprep.obj \ - $(BUILDDIR)settings.obj shell32.lib $(BUILDDIR)sizetip.obj \ - $(BUILDDIR)stripctrl.obj $(BUILDDIR)supdup.obj \ - $(BUILDDIR)telnet.obj $(BUILDDIR)terminal.obj \ - $(BUILDDIR)timing.obj $(BUILDDIR)tree234.obj user32.lib \ - $(BUILDDIR)utils.obj $(BUILDDIR)version.obj \ - $(BUILDDIR)wcwidth.obj $(BUILDDIR)wincfg.obj \ - $(BUILDDIR)winctrls.obj $(BUILDDIR)windefs.obj \ - $(BUILDDIR)windlg.obj $(BUILDDIR)window.obj \ - $(BUILDDIR)winhandl.obj $(BUILDDIR)winhelp.obj \ - $(BUILDDIR)winhsock.obj $(BUILDDIR)winjump.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winprint.obj \ - $(BUILDDIR)winproxy.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselgui.obj $(BUILDDIR)winser.obj \ - $(BUILDDIR)winstore.obj $(BUILDDIR)wintime.obj \ - $(BUILDDIR)winucs.obj $(BUILDDIR)winutils.obj $(EXTRA_libs) - -$(BUILDDIR)testcrypt.exe: $(BUILDDIR)ecc.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)millerrabin.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)mpunsafe.obj \ - $(BUILDDIR)pockle.obj $(BUILDDIR)primecandidate.obj \ - $(BUILDDIR)smallprimes.obj $(BUILDDIR)sshaes.obj \ - $(BUILDDIR)ssharcf.obj $(BUILDDIR)sshargon2.obj \ - $(BUILDDIR)sshauxcrypt.obj $(BUILDDIR)sshblake2.obj \ - $(BUILDDIR)sshblowf.obj $(BUILDDIR)sshccp.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshdssg.obj \ - $(BUILDDIR)sshecc.obj $(BUILDDIR)sshecdsag.obj \ - $(BUILDDIR)sshhmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprime.obj $(BUILDDIR)sshprng.obj \ - $(BUILDDIR)sshpubk.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshrsag.obj $(BUILDDIR)sshsh256.obj \ - $(BUILDDIR)sshsh512.obj $(BUILDDIR)sshsha.obj \ - $(BUILDDIR)sshsha3.obj $(BUILDDIR)testcrypt.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)winmiscs.obj - $(LD) $(LFLAGS) $(XLFLAGS) /out:$(BUILDDIR)testcrypt.exe \ - /lldmap:$(BUILDDIR)testcrypt.map \ - /subsystem:console$(SUBSYSVER) $(EXTRA_console) \ - $(BUILDDIR)ecc.obj $(BUILDDIR)marshal.obj \ - $(BUILDDIR)memory.obj $(BUILDDIR)millerrabin.obj \ - $(BUILDDIR)mpint.obj $(BUILDDIR)mpunsafe.obj \ - $(BUILDDIR)pockle.obj $(BUILDDIR)primecandidate.obj \ - $(BUILDDIR)smallprimes.obj $(BUILDDIR)sshaes.obj \ - $(BUILDDIR)ssharcf.obj $(BUILDDIR)sshargon2.obj \ - $(BUILDDIR)sshauxcrypt.obj $(BUILDDIR)sshblake2.obj \ - $(BUILDDIR)sshblowf.obj $(BUILDDIR)sshccp.obj \ - $(BUILDDIR)sshcrc.obj $(BUILDDIR)sshcrcda.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdh.obj \ - $(BUILDDIR)sshdss.obj $(BUILDDIR)sshdssg.obj \ - $(BUILDDIR)sshecc.obj $(BUILDDIR)sshecdsag.obj \ - $(BUILDDIR)sshhmac.obj $(BUILDDIR)sshmd5.obj \ - $(BUILDDIR)sshprime.obj $(BUILDDIR)sshprng.obj \ - $(BUILDDIR)sshpubk.obj $(BUILDDIR)sshrsa.obj \ - $(BUILDDIR)sshrsag.obj $(BUILDDIR)sshsh256.obj \ - $(BUILDDIR)sshsh512.obj $(BUILDDIR)sshsha.obj \ - $(BUILDDIR)sshsha3.obj $(BUILDDIR)testcrypt.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)winmiscs.obj $(EXTRA_libs) - -$(BUILDDIR)agentf.obj: ../agentf.c ../putty.h ../ssh.h ../pageant.h \ - ../sshchan.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)aqsync.obj: ../aqsync.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)be_all_s.obj: ../be_all_s.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)be_misc.obj: ../be_misc.c ../putty.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)be_none.obj: ../be_none.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)be_nos_s.obj: ../be_nos_s.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)be_ssh.obj: ../be_ssh.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)callback.obj: ../callback.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)cgtest.obj: ../cgtest.c ../cmdgen.c ../putty.h ../ssh.h \ - ../sshkeygen.h ../mpint.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)clicons.obj: ../clicons.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)cmdgen.obj: ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)cmdline.obj: ../cmdline.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)conf.obj: ../conf.c ../tree234.h ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)config.obj: ../config.c ../putty.h ../dialog.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)console.obj: ../console.c ../putty.h ../misc.h ../console.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)cproxy.obj: ../cproxy.c ../putty.h ../ssh.h ../network.h \ - ../proxy.h ../marshal.h ../defs.h ../puttyps.h ../misc.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)dialog.obj: ../dialog.c ../putty.h ../dialog.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ecc.obj: ../ecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)errsock.obj: ../errsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)fromucs.obj: ../charset/fromucs.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)fuzzterm.obj: ../fuzzterm.c ../putty.h ../dialog.h ../terminal.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkapp.obj: ../unix/gtkapp.c ../putty.h ../unix/gtkmisc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkask.obj: ../unix/gtkask.c ../defs.h ../unix/gtkfont.h \ - ../unix/gtkcompat.h ../unix/gtkmisc.h ../putty.h ../ssh.h \ - ../misc.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkcfg.obj: ../unix/gtkcfg.c ../putty.h ../dialog.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkcols.obj: ../unix/gtkcols.c ../defs.h ../unix/gtkcompat.h \ - ../unix/gtkcols.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkcomm.obj: ../unix/gtkcomm.c ../putty.h ../terminal.h \ - ../unix/gtkcompat.h ../unix/gtkfont.h ../unix/gtkmisc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkdlg.obj: ../unix/gtkdlg.c ../putty.h ../unix/gtkcompat.h \ - ../unix/gtkcols.h ../unix/gtkfont.h ../unix/gtkmisc.h \ - ../unix/x11misc.h ../storage.h ../dialog.h ../tree234.h \ - ../licence.h ../ssh.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkfont.obj: ../unix/gtkfont.c ../putty.h ../unix/gtkfont.h \ - ../unix/gtkcompat.h ../unix/gtkmisc.h ../tree234.h \ - ../unix/x11misc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkmain.obj: ../unix/gtkmain.c ../putty.h ../terminal.h \ - ../unix/gtkcompat.h ../unix/gtkfont.h ../unix/gtkmisc.h \ - ../unix/x11misc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../tree234.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkmisc.obj: ../unix/gtkmisc.c ../putty.h ../unix/gtkcompat.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)gtkwin.obj: ../unix/gtkwin.c ../putty.h ../terminal.h \ - ../unix/gtkcompat.h ../unix/gtkfont.h ../unix/gtkmisc.h \ - ../unix/x11misc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../tree234.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)import.obj: ../import.c ../putty.h ../ssh.h ../mpint.h ../misc.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ldisc.obj: ../ldisc.c ../putty.h ../terminal.h ../ldisc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)localenc.obj: ../charset/localenc.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)logging.obj: ../logging.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)macenc.obj: ../charset/macenc.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)mainchan.obj: ../mainchan.c ../putty.h ../ssh.h ../sshppl.h \ - ../sshchan.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)marshal.obj: ../marshal.c ../marshal.h ../misc.h ../defs.h \ - ../puttymem.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)memory.obj: ../memory.c ../defs.h ../puttymem.h ../misc.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)millerrabin.obj: ../millerrabin.c ../ssh.h ../sshkeygen.h \ - ../mpint.h ../mpunsafe.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)mimeenc.obj: ../charset/mimeenc.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)minibidi.obj: ../minibidi.c ../putty.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)misc.obj: ../misc.c ../defs.h ../putty.h ../misc.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)miscucs.obj: ../miscucs.c ../putty.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)mpint.obj: ../mpint.c ../defs.h ../misc.h ../puttymem.h \ - ../mpint.h ../mpint_i.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)mpunsafe.obj: ../mpunsafe.c ../defs.h ../misc.h ../puttymem.h \ - ../mpint.h ../mpint_i.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)nocmdline.obj: ../nocmdline.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)nocproxy.obj: ../nocproxy.c ../putty.h ../network.h ../proxy.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)nogss.obj: ../nogss.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)norand.obj: ../norand.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)noterm.obj: ../noterm.c ../putty.h ../terminal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)notiming.obj: ../notiming.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)nullplug.obj: ../nullplug.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)osxlaunch.obj: ../unix/osxlaunch.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)pageant.obj: ../pageant.c ../putty.h ../mpint.h ../ssh.h \ - ../sshcr.h ../pageant.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)pageant.res: $(BUILDDIR)pageant.rcpp ../windows/rcstuff.h \ - ../windows/pageant-rc.h ../windows/pageant.ico \ - ../windows/pageants.ico ../windows/pageant.mft \ - ../windows/win_res.h ../version.h ../licence.h - $(RC) $(BUILDDIR)pageant.rcpp /FO $(BUILDDIR)pageant.res - -$(BUILDDIR)pgssapi.obj: ../pgssapi.c ../putty.h ../pgssapi.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)pinger.obj: ../pinger.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)plink.res: $(BUILDDIR)plink.rcpp ../windows/rcstuff.h \ - ../windows/putty.ico ../version.h ../licence.h - $(RC) $(BUILDDIR)plink.rcpp /FO $(BUILDDIR)plink.res - -$(BUILDDIR)pockle.obj: ../pockle.c ../ssh.h ../sshkeygen.h ../mpint.h \ - ../mpunsafe.h ../tree234.h ../puttymem.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)portfwd.obj: ../portfwd.c ../putty.h ../ssh.h ../sshchan.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)primecandidate.obj: ../primecandidate.c ../ssh.h ../mpint.h \ - ../mpunsafe.h ../sshkeygen.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)procnet.obj: ../unix/procnet.c ../misc.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)proxy.obj: ../proxy.c ../putty.h ../network.h ../proxy.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)pscp.obj: ../pscp.c ../putty.h ../psftp.h ../ssh.h ../sftp.h \ - ../storage.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)pscp.res: $(BUILDDIR)pscp.rcpp ../windows/rcstuff.h \ - ../windows/pscp.ico ../version.h ../licence.h - $(RC) $(BUILDDIR)pscp.rcpp /FO $(BUILDDIR)pscp.res - -$(BUILDDIR)psftp.obj: ../psftp.c ../putty.h ../psftp.h ../storage.h ../ssh.h \ - ../sftp.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)psftp.res: $(BUILDDIR)psftp.rcpp ../windows/rcstuff.h \ - ../windows/pscp.ico ../version.h ../licence.h - $(RC) $(BUILDDIR)psftp.rcpp /FO $(BUILDDIR)psftp.res - -$(BUILDDIR)psftpcommon.obj: ../psftpcommon.c ../putty.h ../sftp.h ../psftp.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)psocks.obj: ../psocks.c ../putty.h ../misc.h ../ssh.h \ - ../sshchan.h ../psocks.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)putty.res: $(BUILDDIR)putty.rcpp ../windows/rcstuff.h \ - ../windows/putty.mft ../windows/win_res.h \ - ../windows/putty.ico ../windows/puttycfg.ico ../version.h \ - ../licence.h - $(RC) $(BUILDDIR)putty.rcpp /FO $(BUILDDIR)putty.res - -$(BUILDDIR)puttygen.res: $(BUILDDIR)puttygen.rcpp ../windows/rcstuff.h \ - ../windows/puttygen-rc.h ../windows/puttygen.ico \ - ../windows/puttygen.mft ../windows/win_res.h ../version.h \ - ../licence.h - $(RC) $(BUILDDIR)puttygen.rcpp /FO $(BUILDDIR)puttygen.res - -$(BUILDDIR)puttytel.res: $(BUILDDIR)puttytel.rcpp ../windows/rcstuff.h \ - ../windows/puttytel.mft ../windows/win_res.h \ - ../windows/putty.ico ../windows/puttycfg.ico ../version.h \ - ../licence.h - $(RC) $(BUILDDIR)puttytel.rcpp /FO $(BUILDDIR)puttytel.res - -$(BUILDDIR)raw.obj: ../raw.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)rlogin.obj: ../rlogin.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sbcs.obj: ../charset/sbcs.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sbcsdat.obj: ../charset/sbcsdat.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)scpserver.obj: ../scpserver.c ../putty.h ../ssh.h ../sshcr.h \ - ../sshchan.h ../sftp.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sesschan.obj: ../sesschan.c ../putty.h ../ssh.h ../sshchan.h \ - ../sshserver.h ../sftp.h ../sshsignals.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sessprep.obj: ../sessprep.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)settings.obj: ../settings.c ../putty.h ../storage.h ../sshgssc.h \ - ../sshgss.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../pgssapi.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sftp.obj: ../sftp.c ../misc.h ../tree234.h ../sftp.h ../defs.h \ - ../puttymem.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sftpcommon.obj: ../sftpcommon.c ../misc.h ../sftp.h ../defs.h \ - ../puttymem.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sftpserver.obj: ../sftpserver.c ../putty.h ../ssh.h ../sftp.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sizetip.obj: ../windows/sizetip.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)slookup.obj: ../charset/slookup.c ../charset/charset.h \ - ../charset/internal.h ../charset/enum.c ../charset/sbcsdat.c \ - ../charset/utf8.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)smallprimes.obj: ../smallprimes.c ../ssh.h ../sshkeygen.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh.obj: ../ssh.c ../putty.h ../pageant.h ../tree234.h \ - ../storage.h ../marshal.h ../ssh.h ../sshcr.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshgssc.h ../sshgss.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../pgssapi.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1bpp.obj: ../ssh1bpp.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshcr.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1censor.obj: ../ssh1censor.c ../putty.h ../ssh.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1connection.obj: ../ssh1connection.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1connection-client.obj: ../ssh1connection-client.c ../putty.h \ - ../ssh.h ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1connection-server.obj: ../ssh1connection-server.c ../putty.h \ - ../ssh.h ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1login.obj: ../ssh1login.c ../putty.h ../ssh.h ../mpint.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh1login-server.obj: ../ssh1login-server.c ../putty.h ../mpint.h \ - ../ssh.h ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshkeygen.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2bpp.obj: ../ssh2bpp.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshcr.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2bpp-bare.obj: ../ssh2bpp-bare.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshcr.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2censor.obj: ../ssh2censor.c ../putty.h ../ssh.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2connection.obj: ../ssh2connection.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2connection-client.obj: ../ssh2connection-client.c ../putty.h \ - ../ssh.h ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2connection-server.obj: ../ssh2connection-server.c ../putty.h \ - ../ssh.h ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2kex-client.obj: ../ssh2kex-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../storage.h \ - ../ssh2transport.h ../mpint.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h ../sshgssc.h \ - ../sshgss.h ../windows/winstuff.h ../unix/unix.h \ - ../pgssapi.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2kex-server.obj: ../ssh2kex-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshkeygen.h ../storage.h ../ssh2transport.h ../mpint.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../sshgssc.h ../sshgss.h ../windows/winstuff.h \ - ../unix/unix.h ../pgssapi.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2transhk.obj: ../ssh2transhk.c ../putty.h ../ssh.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2transport.obj: ../ssh2transport.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../storage.h ../ssh2transport.h ../mpint.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../sshgssc.h ../sshgss.h ../windows/winstuff.h \ - ../unix/unix.h ../pgssapi.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2userauth.obj: ../ssh2userauth.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssh2userauth-server.obj: ../ssh2userauth-server.c ../putty.h \ - ../ssh.h ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../pgssapi.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshaes.obj: ../sshaes.c ../ssh.h ../mpint_i.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ssharcf.obj: ../ssharcf.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshargon2.obj: ../sshargon2.c ../putty.h ../ssh.h ../marshal.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshauxcrypt.obj: ../sshauxcrypt.c ../ssh.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshbcrypt.obj: ../sshbcrypt.c ../ssh.h ../sshblowf.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshblake2.obj: ../sshblake2.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshblowf.obj: ../sshblowf.c ../ssh.h ../sshblowf.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshccp.obj: ../sshccp.c ../ssh.h ../mpint_i.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshcommon.obj: ../sshcommon.c ../putty.h ../mpint.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshttymodes.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshcrc.obj: ../sshcrc.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshcrcda.obj: ../sshcrcda.c ../misc.h ../ssh.h ../defs.h \ - ../puttymem.h ../marshal.h ../tree234.h ../network.h \ - ../sshttymodes.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshdes.obj: ../sshdes.c ../ssh.h ../mpint_i.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshdh.obj: ../sshdh.c ../ssh.h ../misc.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshdss.obj: ../sshdss.c ../ssh.h ../mpint.h ../misc.h \ - ../puttymem.h ../tree234.h ../network.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshdssg.obj: ../sshdssg.c ../misc.h ../ssh.h ../sshkeygen.h \ - ../mpint.h ../defs.h ../puttymem.h ../marshal.h ../tree234.h \ - ../network.h ../sshttymodes.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshecc.obj: ../sshecc.c ../ssh.h ../mpint.h ../ecc.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshecdsag.obj: ../sshecdsag.c ../ssh.h ../sshkeygen.h ../mpint.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshgssc.obj: ../sshgssc.c ../putty.h ../sshgssc.h ../misc.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../pgssapi.h ../sshgss.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshhmac.obj: ../sshhmac.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshmac.obj: ../sshmac.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshmd5.obj: ../sshmd5.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshprime.obj: ../sshprime.c ../ssh.h ../mpint.h ../mpunsafe.h \ - ../sshkeygen.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshprng.obj: ../sshprng.c ../putty.h ../ssh.h ../mpint_i.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshpubk.obj: ../sshpubk.c ../putty.h ../mpint.h ../ssh.h \ - ../misc.h ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshrand.obj: ../sshrand.c ../putty.h ../ssh.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshrsa.obj: ../sshrsa.c ../ssh.h ../mpint.h ../misc.h \ - ../puttymem.h ../tree234.h ../network.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshrsag.obj: ../sshrsag.c ../ssh.h ../sshkeygen.h ../mpint.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshserver.obj: ../sshserver.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshserver.h ../sshgssc.h \ - ../sshgss.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshsh256.obj: ../sshsh256.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshsh512.obj: ../sshsh512.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshsha.obj: ../sshsha.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshsha3.obj: ../sshsha3.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshshare.obj: ../sshshare.c ../putty.h ../tree234.h ../ssh.h \ - ../sshcr.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshutils.obj: ../sshutils.c ../putty.h ../ssh.h ../sshchan.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshverstring.obj: ../sshverstring.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshcr.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)sshzlib.obj: ../sshzlib.c ../defs.h ../ssh.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)stripctrl.obj: ../stripctrl.c ../putty.h ../terminal.h ../misc.h \ - ../marshal.h ../defs.h ../puttyps.h ../network.h \ - ../sshsignals.h ../tree234.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)supdup.obj: ../supdup.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)telnet.obj: ../telnet.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)terminal.obj: ../terminal.c ../putty.h ../terminal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)testcrypt.obj: ../testcrypt.c ../defs.h ../ssh.h ../sshkeygen.h \ - ../misc.h ../mpint.h ../ecc.h ../testcrypt.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)testsc.obj: ../testsc.c ../defs.h ../putty.h ../ssh.h ../misc.h \ - ../mpint.h ../ecc.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)testzlib.obj: ../testzlib.c ../defs.h ../ssh.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)time.obj: ../time.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)timing.obj: ../timing.c ../putty.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)toucs.obj: ../charset/toucs.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)tree234.obj: ../tree234.c ../defs.h ../tree234.h ../puttymem.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)utf8.obj: ../charset/utf8.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)utils.obj: ../utils.c ../defs.h ../misc.h ../ssh.h ../puttymem.h \ - ../marshal.h ../tree234.h ../network.h ../sshttymodes.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)ux_x11.obj: ../unix/ux_x11.c ../putty.h ../ssh.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxagentc.obj: ../unix/uxagentc.c ../putty.h ../misc.h \ - ../tree234.h ../puttymem.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxagentsock.obj: ../unix/uxagentsock.c ../putty.h ../ssh.h \ - ../misc.h ../pageant.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxcfg.obj: ../unix/uxcfg.c ../putty.h ../dialog.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxcliloop.obj: ../unix/uxcliloop.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxcons.obj: ../unix/uxcons.c ../putty.h ../storage.h ../ssh.h \ - ../console.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxfdsock.obj: ../unix/uxfdsock.c ../tree234.h ../putty.h \ - ../network.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxgen.obj: ../unix/uxgen.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxgss.obj: ../unix/uxgss.c ../putty.h ../pgssapi.h ../sshgss.h \ - ../sshgssc.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxmisc.obj: ../unix/uxmisc.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxnet.obj: ../unix/uxnet.c ../putty.h ../network.h ../tree234.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxnogtk.obj: ../unix/uxnogtk.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxnoise.obj: ../unix/uxnoise.c ../putty.h ../ssh.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxpeer.obj: ../unix/uxpeer.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxpgnt.obj: ../unix/uxpgnt.c ../putty.h ../ssh.h ../misc.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxplink.obj: ../unix/uxplink.c ../putty.h ../ssh.h ../storage.h \ - ../tree234.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxpoll.obj: ../unix/uxpoll.c ../putty.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxprint.obj: ../unix/uxprint.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxproxy.obj: ../unix/uxproxy.c ../tree234.h ../putty.h \ - ../network.h ../proxy.h ../defs.h ../puttyps.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxpsusan.obj: ../unix/uxpsusan.c ../putty.h ../mpint.h ../ssh.h \ - ../sshserver.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxpterm.obj: ../unix/uxpterm.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxpty.obj: ../unix/uxpty.c ../putty.h ../ssh.h ../sshserver.h \ - ../tree234.h ../sshttymodes.h ../sshsignals.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxputty.obj: ../unix/uxputty.c ../putty.h ../ssh.h ../storage.h \ - ../unix/gtkcompat.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxsel.obj: ../unix/uxsel.c ../putty.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxser.obj: ../unix/uxser.c ../putty.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxserver.obj: ../unix/uxserver.c ../putty.h ../mpint.h ../ssh.h \ - ../sshserver.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxsftp.obj: ../unix/uxsftp.c ../putty.h ../ssh.h ../psftp.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxsftpserver.obj: ../unix/uxsftpserver.c ../putty.h ../ssh.h \ - ../sshserver.h ../sftp.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxshare.obj: ../unix/uxshare.c ../tree234.h ../putty.h \ - ../network.h ../proxy.h ../ssh.h ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxsignal.obj: ../unix/uxsignal.c ../defs.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxsocks.obj: ../unix/uxsocks.c ../putty.h ../ssh.h ../psocks.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxstore.obj: ../unix/uxstore.c ../putty.h ../storage.h \ - ../tree234.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxucs.obj: ../unix/uxucs.c ../putty.h ../charset/charset.h \ - ../terminal.h ../misc.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../tree234.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)uxutils.obj: ../unix/uxutils.c ../putty.h ../ssh.h \ - ../unix/uxutils.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)version.obj: ../version.c ../putty.h ../ssh.h ../empty.h \ - ../version.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wcwidth.obj: ../wcwidth.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wildcard.obj: ../wildcard.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wincapi.obj: ../windows/wincapi.c ../putty.h ../ssh.h \ - ../windows/wincapi.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wincfg.obj: ../windows/wincfg.c ../putty.h ../dialog.h \ - ../storage.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wincliloop.obj: ../windows/wincliloop.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wincons.obj: ../windows/wincons.c ../putty.h ../storage.h \ - ../ssh.h ../console.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winctrls.obj: ../windows/winctrls.c ../putty.h ../misc.h \ - ../dialog.h ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)windefs.obj: ../windows/windefs.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)windlg.obj: ../windows/windlg.c ../putty.h ../ssh.h \ - ../windows/win_res.h ../windows/winseat.h ../storage.h \ - ../dialog.h ../licence.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)window.obj: ../windows/window.c ../putty.h ../terminal.h \ - ../storage.h ../windows/win_res.h ../windows/winsecur.h \ - ../windows/winseat.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wingss.obj: ../windows/wingss.c ../putty.h ../pgssapi.h \ - ../sshgss.h ../sshgssc.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winhandl.obj: ../windows/winhandl.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winhelp.obj: ../windows/winhelp.c ../putty.h ../windows/win_res.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winhsock.obj: ../windows/winhsock.c ../tree234.h ../putty.h \ - ../network.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winjump.obj: ../windows/winjump.c ../putty.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winmisc.obj: ../windows/winmisc.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winmiscs.obj: ../windows/winmiscs.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winnet.obj: ../windows/winnet.c ../putty.h ../network.h \ - ../tree234.h ../ssh.h ../defs.h ../puttyps.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winnohlp.obj: ../windows/winnohlp.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winnoise.obj: ../windows/winnoise.c ../putty.h ../ssh.h \ - ../storage.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winnojmp.obj: ../windows/winnojmp.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winnpc.obj: ../windows/winnpc.c ../tree234.h ../putty.h \ - ../network.h ../proxy.h ../ssh.h ../windows/winsecur.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winnps.obj: ../windows/winnps.c ../tree234.h ../putty.h \ - ../network.h ../proxy.h ../ssh.h ../windows/winsecur.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winpgen.obj: ../windows/winpgen.c ../putty.h ../ssh.h \ - ../sshkeygen.h ../licence.h ../windows/winsecur.h \ - ../windows/puttygen-rc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winpgnt.obj: ../windows/winpgnt.c ../putty.h ../ssh.h ../misc.h \ - ../tree234.h ../windows/winsecur.h ../windows/wincapi.h \ - ../pageant.h ../licence.h ../windows/pageant-rc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winpgntc.obj: ../windows/winpgntc.c ../putty.h ../pageant.h \ - ../windows/winsecur.h ../windows/wincapi.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winplink.obj: ../windows/winplink.c ../putty.h ../storage.h \ - ../tree234.h ../windows/winsecur.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winprint.obj: ../windows/winprint.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winproxy.obj: ../windows/winproxy.c ../tree234.h ../putty.h \ - ../network.h ../proxy.h ../defs.h ../puttyps.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winsecur.obj: ../windows/winsecur.c ../putty.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winselcli.obj: ../windows/winselcli.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winselgui.obj: ../windows/winselgui.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winser.obj: ../windows/winser.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winsftp.obj: ../windows/winsftp.c ../putty.h ../psftp.h ../ssh.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winshare.obj: ../windows/winshare.c ../tree234.h ../putty.h \ - ../network.h ../proxy.h ../ssh.h ../windows/wincapi.h \ - ../windows/winsecur.h ../noshare.c ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winsocks.obj: ../windows/winsocks.c ../putty.h ../ssh.h \ - ../psocks.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winstore.obj: ../windows/winstore.c ../putty.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)wintime.obj: ../windows/wintime.c ../putty.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winucs.obj: ../windows/winucs.c ../putty.h ../terminal.h \ - ../misc.h ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winutils.obj: ../windows/winutils.c ../putty.h ../misc.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)winx11.obj: ../windows/winx11.c ../putty.h ../ssh.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)x11fwd.obj: ../x11fwd.c ../putty.h ../ssh.h ../sshchan.h \ - ../tree234.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)x11misc.obj: ../unix/x11misc.c ../putty.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)xenc.obj: ../charset/xenc.c ../charset/charset.h \ - ../charset/internal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)xkeysym.obj: ../unix/xkeysym.c ../misc.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)xpmptcfg.obj: ../unix/xpmptcfg.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)xpmpterm.obj: ../unix/xpmpterm.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)xpmpucfg.obj: ../unix/xpmpucfg.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - -$(BUILDDIR)xpmputty.obj: ../unix/xpmputty.c - $(CC) /Fo$(BUILDDIR) $(COMPAT) $(CFLAGS) $(XFLAGS) /c $< - - -$(BUILDDIR)pageant.rcpp: ../windows/pageant.rc ../windows/winhelp.rc2 \ - ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -$(BUILDDIR)plink.rcpp: ../windows/plink.rc ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -$(BUILDDIR)pscp.rcpp: ../windows/pscp.rc ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -$(BUILDDIR)psftp.rcpp: ../windows/psftp.rc ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -$(BUILDDIR)putty.rcpp: ../windows/putty.rc ../windows/winhelp.rc2 \ - ../windows/win_res.rc2 ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -$(BUILDDIR)puttygen.rcpp: ../windows/puttygen.rc ../windows/winhelp.rc2 \ - ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -$(BUILDDIR)puttytel.rcpp: ../windows/puttytel.rc ../windows/winhelp.rc2 \ - ../windows/win_res.rc2 ../windows/version.rc2 - $(RCPREPROC) $(RCPPFLAGS) /Fi$@ $< - -cleantestprogs: - -rm -f $(BUILDDIR)testcrypt.exe $(BUILDDIR)psocks.exe - -clean: - rm -f $(BUILDDIR)*.obj $(BUILDDIR)*.exe $(BUILDDIR)*.rcpp $(BUILDDIR)*.res \ - $(BUILDDIR)*.map $(BUILDDIR)*.exe.manifest diff --git a/code/windows/Makefile.lcc b/code/windows/Makefile.lcc deleted file mode 100644 index 0d24da2..0000000 --- a/code/windows/Makefile.lcc +++ /dev/null @@ -1,1658 +0,0 @@ -# Makefile for putty under lcc. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. -# -# Extra options you can set: -# -# - COMPAT=-DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=-DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=-DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=-DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=-DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=-DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=-DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=-DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=-DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=-DMSVC4 (Windows only) -# - RCFL=-DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need -DNO_SECURITY and -DNO_MULTIMON. -# -# - COMPAT=-DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=-DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=-DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=-DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=-DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. - -# If you rename this file to `Makefile', you should change this line, -# so that the .rsp files still depend on the correct makefile. -MAKEFILE = Makefile.lcc - -# C compilation flags -CFLAGS = -D_WINDOWS -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ -# Resource compilation flags -RCFLAGS = -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ - -# Get include directory for resource compiler - - -all: pageant.exe plink.exe pscp.exe psftp.exe psocks.exe putty.exe \ - puttygen.exe puttytel.exe testcrypt.exe - -pageant.exe: aqsync.obj be_misc.obj callback.obj conf.obj ecc.obj \ - errsock.obj marshal.obj memory.obj misc.obj mpint.obj \ - pageant.obj pageant.res sshaes.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshdes.obj sshdss.obj \ - sshecc.obj sshhmac.obj sshmd5.obj sshpubk.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - stripctrl.obj tree234.obj utils.obj version.obj wcwidth.obj \ - wincapi.obj winhandl.obj winhelp.obj winhsock.obj \ - winmisc.obj winmiscs.obj winnet.obj winnpc.obj winnps.obj \ - winpgnt.obj winpgntc.obj winsecur.obj winselgui.obj \ - winutils.obj - lcclnk -subsystem windows -o pageant.exe aqsync.obj be_misc.obj \ - callback.obj conf.obj ecc.obj errsock.obj marshal.obj \ - memory.obj misc.obj mpint.obj pageant.obj pageant.res \ - sshaes.obj sshargon2.obj sshauxcrypt.obj sshblake2.obj \ - sshdes.obj sshdss.obj sshecc.obj sshhmac.obj sshmd5.obj \ - sshpubk.obj sshrsa.obj sshsh256.obj sshsh512.obj sshsha.obj \ - sshsha3.obj stripctrl.obj tree234.obj utils.obj version.obj \ - wcwidth.obj wincapi.obj winhandl.obj winhelp.obj \ - winhsock.obj winmisc.obj winmiscs.obj winnet.obj winnpc.obj \ - winnps.obj winpgnt.obj winpgntc.obj winsecur.obj \ - winselgui.obj winutils.obj shell32.lib wsock32.lib \ - ws2_32.lib winspool.lib winmm.lib imm32.lib - -plink.exe: agentf.obj aqsync.obj be_all_s.obj be_misc.obj callback.obj \ - clicons.obj cmdline.obj conf.obj console.obj cproxy.obj \ - ecc.obj errsock.obj ldisc.obj logging.obj mainchan.obj \ - marshal.obj memory.obj misc.obj miscucs.obj mpint.obj \ - noterm.obj nullplug.obj pgssapi.obj pinger.obj plink.res \ - portfwd.obj proxy.obj raw.obj rlogin.obj sessprep.obj \ - settings.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj supdup.obj telnet.obj timing.obj tree234.obj \ - utils.obj version.obj wcwidth.obj wildcard.obj wincapi.obj \ - wincliloop.obj wincons.obj windefs.obj wingss.obj \ - winhandl.obj winhsock.obj winmisc.obj winmiscs.obj \ - winnet.obj winnohlp.obj winnoise.obj winnojmp.obj winnpc.obj \ - winnps.obj winpgntc.obj winplink.obj winproxy.obj \ - winsecur.obj winselcli.obj winser.obj winshare.obj \ - winstore.obj wintime.obj winucs.obj winx11.obj x11fwd.obj - lcclnk -o plink.exe agentf.obj aqsync.obj be_all_s.obj be_misc.obj \ - callback.obj clicons.obj cmdline.obj conf.obj console.obj \ - cproxy.obj ecc.obj errsock.obj ldisc.obj logging.obj \ - mainchan.obj marshal.obj memory.obj misc.obj miscucs.obj \ - mpint.obj noterm.obj nullplug.obj pgssapi.obj pinger.obj \ - plink.res portfwd.obj proxy.obj raw.obj rlogin.obj \ - sessprep.obj settings.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj supdup.obj telnet.obj timing.obj tree234.obj \ - utils.obj version.obj wcwidth.obj wildcard.obj wincapi.obj \ - wincliloop.obj wincons.obj windefs.obj wingss.obj \ - winhandl.obj winhsock.obj winmisc.obj winmiscs.obj \ - winnet.obj winnohlp.obj winnoise.obj winnojmp.obj winnpc.obj \ - winnps.obj winpgntc.obj winplink.obj winproxy.obj \ - winsecur.obj winselcli.obj winser.obj winshare.obj \ - winstore.obj wintime.obj winucs.obj winx11.obj x11fwd.obj \ - shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib \ - imm32.lib - -pscp.exe: agentf.obj aqsync.obj be_misc.obj be_ssh.obj callback.obj \ - clicons.obj cmdline.obj conf.obj console.obj cproxy.obj \ - ecc.obj errsock.obj logging.obj mainchan.obj marshal.obj \ - memory.obj misc.obj miscucs.obj mpint.obj nullplug.obj \ - pgssapi.obj pinger.obj portfwd.obj proxy.obj pscp.obj \ - pscp.res psftpcommon.obj settings.obj sftp.obj \ - sftpcommon.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj timing.obj tree234.obj utils.obj version.obj \ - wcwidth.obj wildcard.obj wincapi.obj wincliloop.obj \ - wincons.obj windefs.obj wingss.obj winhandl.obj winhsock.obj \ - winmisc.obj winmiscs.obj winnet.obj winnohlp.obj \ - winnoise.obj winnojmp.obj winnpc.obj winnps.obj winpgntc.obj \ - winproxy.obj winsecur.obj winselcli.obj winsftp.obj \ - winshare.obj winstore.obj wintime.obj winucs.obj x11fwd.obj - lcclnk -o pscp.exe agentf.obj aqsync.obj be_misc.obj be_ssh.obj \ - callback.obj clicons.obj cmdline.obj conf.obj console.obj \ - cproxy.obj ecc.obj errsock.obj logging.obj mainchan.obj \ - marshal.obj memory.obj misc.obj miscucs.obj mpint.obj \ - nullplug.obj pgssapi.obj pinger.obj portfwd.obj proxy.obj \ - pscp.obj pscp.res psftpcommon.obj settings.obj sftp.obj \ - sftpcommon.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj timing.obj tree234.obj utils.obj version.obj \ - wcwidth.obj wildcard.obj wincapi.obj wincliloop.obj \ - wincons.obj windefs.obj wingss.obj winhandl.obj winhsock.obj \ - winmisc.obj winmiscs.obj winnet.obj winnohlp.obj \ - winnoise.obj winnojmp.obj winnpc.obj winnps.obj winpgntc.obj \ - winproxy.obj winsecur.obj winselcli.obj winsftp.obj \ - winshare.obj winstore.obj wintime.obj winucs.obj x11fwd.obj \ - shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib \ - imm32.lib - -psftp.exe: agentf.obj aqsync.obj be_misc.obj be_ssh.obj callback.obj \ - clicons.obj cmdline.obj conf.obj console.obj cproxy.obj \ - ecc.obj errsock.obj logging.obj mainchan.obj marshal.obj \ - memory.obj misc.obj miscucs.obj mpint.obj nullplug.obj \ - pgssapi.obj pinger.obj portfwd.obj proxy.obj psftp.obj \ - psftp.res psftpcommon.obj settings.obj sftp.obj \ - sftpcommon.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj timing.obj tree234.obj utils.obj version.obj \ - wcwidth.obj wildcard.obj wincapi.obj wincliloop.obj \ - wincons.obj windefs.obj wingss.obj winhandl.obj winhsock.obj \ - winmisc.obj winmiscs.obj winnet.obj winnohlp.obj \ - winnoise.obj winnojmp.obj winnpc.obj winnps.obj winpgntc.obj \ - winproxy.obj winsecur.obj winselcli.obj winsftp.obj \ - winshare.obj winstore.obj wintime.obj winucs.obj x11fwd.obj - lcclnk -o psftp.exe agentf.obj aqsync.obj be_misc.obj be_ssh.obj \ - callback.obj clicons.obj cmdline.obj conf.obj console.obj \ - cproxy.obj ecc.obj errsock.obj logging.obj mainchan.obj \ - marshal.obj memory.obj misc.obj miscucs.obj mpint.obj \ - nullplug.obj pgssapi.obj pinger.obj portfwd.obj proxy.obj \ - psftp.obj psftp.res psftpcommon.obj settings.obj sftp.obj \ - sftpcommon.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj timing.obj tree234.obj utils.obj version.obj \ - wcwidth.obj wildcard.obj wincapi.obj wincliloop.obj \ - wincons.obj windefs.obj wingss.obj winhandl.obj winhsock.obj \ - winmisc.obj winmiscs.obj winnet.obj winnohlp.obj \ - winnoise.obj winnojmp.obj winnpc.obj winnps.obj winpgntc.obj \ - winproxy.obj winsecur.obj winselcli.obj winsftp.obj \ - winshare.obj winstore.obj wintime.obj winucs.obj x11fwd.obj \ - shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib \ - imm32.lib - -psocks.exe: be_misc.obj callback.obj conf.obj console.obj errsock.obj \ - logging.obj marshal.obj memory.obj misc.obj nocproxy.obj \ - norand.obj portfwd.obj proxy.obj psocks.obj sshutils.obj \ - stripctrl.obj time.obj timing.obj tree234.obj utils.obj \ - version.obj wcwidth.obj wincliloop.obj wincons.obj \ - winhandl.obj winhsock.obj winmisc.obj winmiscs.obj \ - winnet.obj winnohlp.obj winproxy.obj winselcli.obj \ - winsocks.obj - lcclnk -o psocks.exe be_misc.obj callback.obj conf.obj console.obj \ - errsock.obj logging.obj marshal.obj memory.obj misc.obj \ - nocproxy.obj norand.obj portfwd.obj proxy.obj psocks.obj \ - sshutils.obj stripctrl.obj time.obj timing.obj tree234.obj \ - utils.obj version.obj wcwidth.obj wincliloop.obj wincons.obj \ - winhandl.obj winhsock.obj winmisc.obj winmiscs.obj \ - winnet.obj winnohlp.obj winproxy.obj winselcli.obj \ - winsocks.obj shell32.lib wsock32.lib ws2_32.lib winspool.lib \ - winmm.lib imm32.lib - -putty.exe: agentf.obj aqsync.obj be_all_s.obj be_misc.obj callback.obj \ - cmdline.obj conf.obj config.obj cproxy.obj dialog.obj \ - ecc.obj errsock.obj ldisc.obj logging.obj mainchan.obj \ - marshal.obj memory.obj minibidi.obj misc.obj miscucs.obj \ - mpint.obj nullplug.obj pgssapi.obj pinger.obj portfwd.obj \ - proxy.obj putty.res raw.obj rlogin.obj sessprep.obj \ - settings.obj sizetip.obj ssh.obj ssh1bpp.obj ssh1censor.obj \ - ssh1connection.obj ssh1connection-client.obj ssh1login.obj \ - ssh2bpp.obj ssh2bpp-bare.obj ssh2censor.obj \ - ssh2connection.obj ssh2connection-client.obj \ - ssh2kex-client.obj ssh2transhk.obj ssh2transport.obj \ - ssh2userauth.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj \ - sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj sshmac.obj \ - sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj supdup.obj telnet.obj terminal.obj timing.obj \ - tree234.obj utils.obj version.obj wcwidth.obj wildcard.obj \ - wincapi.obj wincfg.obj winctrls.obj windefs.obj windlg.obj \ - window.obj wingss.obj winhandl.obj winhelp.obj winhsock.obj \ - winjump.obj winmisc.obj winmiscs.obj winnet.obj winnoise.obj \ - winnpc.obj winnps.obj winpgntc.obj winprint.obj winproxy.obj \ - winsecur.obj winselgui.obj winser.obj winshare.obj \ - winstore.obj wintime.obj winucs.obj winutils.obj winx11.obj \ - x11fwd.obj - lcclnk -subsystem windows -o putty.exe agentf.obj aqsync.obj be_all_s.obj \ - be_misc.obj callback.obj cmdline.obj conf.obj config.obj \ - cproxy.obj dialog.obj ecc.obj errsock.obj ldisc.obj \ - logging.obj mainchan.obj marshal.obj memory.obj minibidi.obj \ - misc.obj miscucs.obj mpint.obj nullplug.obj pgssapi.obj \ - pinger.obj portfwd.obj proxy.obj putty.res raw.obj \ - rlogin.obj sessprep.obj settings.obj sizetip.obj ssh.obj \ - ssh1bpp.obj ssh1censor.obj ssh1connection.obj \ - ssh1connection-client.obj ssh1login.obj ssh2bpp.obj \ - ssh2bpp-bare.obj ssh2censor.obj ssh2connection.obj \ - ssh2connection-client.obj ssh2kex-client.obj ssh2transhk.obj \ - ssh2transport.obj ssh2userauth.obj sshaes.obj ssharcf.obj \ - sshargon2.obj sshauxcrypt.obj sshblake2.obj sshblowf.obj \ - sshccp.obj sshcommon.obj sshcrc.obj sshcrcda.obj sshdes.obj \ - sshdh.obj sshdss.obj sshecc.obj sshgssc.obj sshhmac.obj \ - sshmac.obj sshmd5.obj sshprng.obj sshpubk.obj sshrand.obj \ - sshrsa.obj sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - sshshare.obj sshutils.obj sshverstring.obj sshzlib.obj \ - stripctrl.obj supdup.obj telnet.obj terminal.obj timing.obj \ - tree234.obj utils.obj version.obj wcwidth.obj wildcard.obj \ - wincapi.obj wincfg.obj winctrls.obj windefs.obj windlg.obj \ - window.obj wingss.obj winhandl.obj winhelp.obj winhsock.obj \ - winjump.obj winmisc.obj winmiscs.obj winnet.obj winnoise.obj \ - winnpc.obj winnps.obj winpgntc.obj winprint.obj winproxy.obj \ - winsecur.obj winselgui.obj winser.obj winshare.obj \ - winstore.obj wintime.obj winucs.obj winutils.obj winx11.obj \ - x11fwd.obj shell32.lib wsock32.lib ws2_32.lib winspool.lib \ - winmm.lib imm32.lib - -puttygen.exe: conf.obj ecc.obj import.obj marshal.obj memory.obj \ - millerrabin.obj misc.obj mpint.obj mpunsafe.obj notiming.obj \ - pockle.obj primecandidate.obj puttygen.res smallprimes.obj \ - sshaes.obj sshargon2.obj sshauxcrypt.obj sshbcrypt.obj \ - sshblake2.obj sshblowf.obj sshdes.obj sshdss.obj sshdssg.obj \ - sshecc.obj sshecdsag.obj sshhmac.obj sshmd5.obj sshprime.obj \ - sshprng.obj sshpubk.obj sshrand.obj sshrsa.obj sshrsag.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - stripctrl.obj tree234.obj utils.obj version.obj wcwidth.obj \ - winctrls.obj winhelp.obj winmisc.obj winmiscs.obj \ - winnoise.obj winnojmp.obj winpgen.obj winsecur.obj \ - winstore.obj wintime.obj winutils.obj - lcclnk -subsystem windows -o puttygen.exe conf.obj ecc.obj import.obj \ - marshal.obj memory.obj millerrabin.obj misc.obj mpint.obj \ - mpunsafe.obj notiming.obj pockle.obj primecandidate.obj \ - puttygen.res smallprimes.obj sshaes.obj sshargon2.obj \ - sshauxcrypt.obj sshbcrypt.obj sshblake2.obj sshblowf.obj \ - sshdes.obj sshdss.obj sshdssg.obj sshecc.obj sshecdsag.obj \ - sshhmac.obj sshmd5.obj sshprime.obj sshprng.obj sshpubk.obj \ - sshrand.obj sshrsa.obj sshrsag.obj sshsh256.obj sshsh512.obj \ - sshsha.obj sshsha3.obj stripctrl.obj tree234.obj utils.obj \ - version.obj wcwidth.obj winctrls.obj winhelp.obj winmisc.obj \ - winmiscs.obj winnoise.obj winnojmp.obj winpgen.obj \ - winsecur.obj winstore.obj wintime.obj winutils.obj \ - shell32.lib wsock32.lib ws2_32.lib winspool.lib winmm.lib \ - imm32.lib - -puttytel.exe: be_misc.obj be_nos_s.obj callback.obj cmdline.obj conf.obj \ - config.obj dialog.obj errsock.obj ldisc.obj logging.obj \ - marshal.obj memory.obj minibidi.obj misc.obj miscucs.obj \ - nocproxy.obj nogss.obj norand.obj pinger.obj proxy.obj \ - puttytel.res raw.obj rlogin.obj sessprep.obj settings.obj \ - sizetip.obj stripctrl.obj supdup.obj telnet.obj terminal.obj \ - timing.obj tree234.obj utils.obj version.obj wcwidth.obj \ - wincfg.obj winctrls.obj windefs.obj windlg.obj window.obj \ - winhandl.obj winhelp.obj winhsock.obj winjump.obj \ - winmisc.obj winmiscs.obj winnet.obj winprint.obj \ - winproxy.obj winsecur.obj winselgui.obj winser.obj \ - winstore.obj wintime.obj winucs.obj winutils.obj - lcclnk -subsystem windows -o puttytel.exe be_misc.obj be_nos_s.obj \ - callback.obj cmdline.obj conf.obj config.obj dialog.obj \ - errsock.obj ldisc.obj logging.obj marshal.obj memory.obj \ - minibidi.obj misc.obj miscucs.obj nocproxy.obj nogss.obj \ - norand.obj pinger.obj proxy.obj puttytel.res raw.obj \ - rlogin.obj sessprep.obj settings.obj sizetip.obj \ - stripctrl.obj supdup.obj telnet.obj terminal.obj timing.obj \ - tree234.obj utils.obj version.obj wcwidth.obj wincfg.obj \ - winctrls.obj windefs.obj windlg.obj window.obj winhandl.obj \ - winhelp.obj winhsock.obj winjump.obj winmisc.obj \ - winmiscs.obj winnet.obj winprint.obj winproxy.obj \ - winsecur.obj winselgui.obj winser.obj winstore.obj \ - wintime.obj winucs.obj winutils.obj shell32.lib wsock32.lib \ - ws2_32.lib winspool.lib winmm.lib imm32.lib - -testcrypt.exe: ecc.obj marshal.obj memory.obj millerrabin.obj mpint.obj \ - mpunsafe.obj pockle.obj primecandidate.obj smallprimes.obj \ - sshaes.obj ssharcf.obj sshargon2.obj sshauxcrypt.obj \ - sshblake2.obj sshblowf.obj sshccp.obj sshcrc.obj \ - sshcrcda.obj sshdes.obj sshdh.obj sshdss.obj sshdssg.obj \ - sshecc.obj sshecdsag.obj sshhmac.obj sshmd5.obj sshprime.obj \ - sshprng.obj sshpubk.obj sshrsa.obj sshrsag.obj sshsh256.obj \ - sshsh512.obj sshsha.obj sshsha3.obj testcrypt.obj \ - tree234.obj utils.obj winmiscs.obj - lcclnk -o testcrypt.exe ecc.obj marshal.obj memory.obj millerrabin.obj \ - mpint.obj mpunsafe.obj pockle.obj primecandidate.obj \ - smallprimes.obj sshaes.obj ssharcf.obj sshargon2.obj \ - sshauxcrypt.obj sshblake2.obj sshblowf.obj sshccp.obj \ - sshcrc.obj sshcrcda.obj sshdes.obj sshdh.obj sshdss.obj \ - sshdssg.obj sshecc.obj sshecdsag.obj sshhmac.obj sshmd5.obj \ - sshprime.obj sshprng.obj sshpubk.obj sshrsa.obj sshrsag.obj \ - sshsh256.obj sshsh512.obj sshsha.obj sshsha3.obj \ - testcrypt.obj tree234.obj utils.obj winmiscs.obj shell32.lib \ - wsock32.lib ws2_32.lib winspool.lib winmm.lib imm32.lib - -agentf.obj: ..\agentf.c ..\putty.h ..\ssh.h ..\pageant.h ..\sshchan.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\agentf.c -aqsync.obj: ..\aqsync.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\aqsync.c -be_all_s.obj: ..\be_all_s.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\be_all_s.c -be_misc.obj: ..\be_misc.c ..\putty.h ..\network.h ..\defs.h ..\puttyps.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\be_misc.c -be_none.obj: ..\be_none.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\be_none.c -be_nos_s.obj: ..\be_nos_s.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\be_nos_s.c -be_ssh.obj: ..\be_ssh.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\be_ssh.c -callback.obj: ..\callback.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\callback.c -cgtest.obj: ..\cgtest.c ..\cmdgen.c ..\putty.h ..\ssh.h ..\sshkeygen.h \ - ..\mpint.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\cgtest.c -clicons.obj: ..\clicons.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\clicons.c -cmdgen.obj: ..\cmdgen.c ..\putty.h ..\ssh.h ..\sshkeygen.h ..\mpint.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\cmdgen.c -cmdline.obj: ..\cmdline.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\cmdline.c -conf.obj: ..\conf.c ..\tree234.h ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\conf.c -config.obj: ..\config.c ..\putty.h ..\dialog.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\config.c -console.obj: ..\console.c ..\putty.h ..\misc.h ..\console.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\console.c -cproxy.obj: ..\cproxy.c ..\putty.h ..\ssh.h ..\network.h ..\proxy.h \ - ..\marshal.h ..\defs.h ..\puttyps.h ..\misc.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\cproxy.c -dialog.obj: ..\dialog.c ..\putty.h ..\dialog.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\dialog.c -ecc.obj: ..\ecc.c ..\ssh.h ..\mpint.h ..\ecc.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ecc.c -errsock.obj: ..\errsock.c ..\tree234.h ..\putty.h ..\network.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\errsock.c -fromucs.obj: ..\charset\fromucs.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\fromucs.c -fuzzterm.obj: ..\fuzzterm.c ..\putty.h ..\dialog.h ..\terminal.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\tree234.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\fuzzterm.c -gtkapp.obj: ..\unix\gtkapp.c ..\putty.h ..\unix\gtkmisc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkapp.c -gtkask.obj: ..\unix\gtkask.c ..\defs.h ..\unix\gtkfont.h ..\unix\gtkcompat.h \ - ..\unix\gtkmisc.h ..\putty.h ..\ssh.h ..\misc.h ..\puttyps.h \ - ..\network.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkask.c -gtkcfg.obj: ..\unix\gtkcfg.c ..\putty.h ..\dialog.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkcfg.c -gtkcols.obj: ..\unix\gtkcols.c ..\defs.h ..\unix\gtkcompat.h \ - ..\unix\gtkcols.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkcols.c -gtkcomm.obj: ..\unix\gtkcomm.c ..\putty.h ..\terminal.h ..\unix\gtkcompat.h \ - ..\unix\gtkfont.h ..\unix\gtkmisc.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\tree234.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkcomm.c -gtkdlg.obj: ..\unix\gtkdlg.c ..\putty.h ..\unix\gtkcompat.h \ - ..\unix\gtkcols.h ..\unix\gtkfont.h ..\unix\gtkmisc.h \ - ..\unix\x11misc.h ..\storage.h ..\dialog.h ..\tree234.h \ - ..\licence.h ..\ssh.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkdlg.c -gtkfont.obj: ..\unix\gtkfont.c ..\putty.h ..\unix\gtkfont.h \ - ..\unix\gtkcompat.h ..\unix\gtkmisc.h ..\tree234.h \ - ..\unix\x11misc.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkfont.c -gtkmain.obj: ..\unix\gtkmain.c ..\putty.h ..\terminal.h ..\unix\gtkcompat.h \ - ..\unix\gtkfont.h ..\unix\gtkmisc.h ..\unix\x11misc.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\tree234.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkmain.c -gtkmisc.obj: ..\unix\gtkmisc.c ..\putty.h ..\unix\gtkcompat.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkmisc.c -gtkwin.obj: ..\unix\gtkwin.c ..\putty.h ..\terminal.h ..\unix\gtkcompat.h \ - ..\unix\gtkfont.h ..\unix\gtkmisc.h ..\unix\x11misc.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\tree234.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\gtkwin.c -import.obj: ..\import.c ..\putty.h ..\ssh.h ..\mpint.h ..\misc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\import.c -ldisc.obj: ..\ldisc.c ..\putty.h ..\terminal.h ..\ldisc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\tree234.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ldisc.c -localenc.obj: ..\charset\localenc.c ..\charset\charset.h \ - ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\localenc.c -logging.obj: ..\logging.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\logging.c -macenc.obj: ..\charset\macenc.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\macenc.c -mainchan.obj: ..\mainchan.c ..\putty.h ..\ssh.h ..\sshppl.h ..\sshchan.h \ - ..\sshsignals.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\mainchan.c -marshal.obj: ..\marshal.c ..\marshal.h ..\misc.h ..\defs.h ..\puttymem.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\marshal.c -memory.obj: ..\memory.c ..\defs.h ..\puttymem.h ..\misc.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\memory.c -millerrabin.obj: ..\millerrabin.c ..\ssh.h ..\sshkeygen.h ..\mpint.h \ - ..\mpunsafe.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\millerrabin.c -mimeenc.obj: ..\charset\mimeenc.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\mimeenc.c -minibidi.obj: ..\minibidi.c ..\putty.h ..\misc.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\minibidi.c -misc.obj: ..\misc.c ..\defs.h ..\putty.h ..\misc.h ..\puttyps.h ..\network.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\misc.c -miscucs.obj: ..\miscucs.c ..\putty.h ..\misc.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\miscucs.c -mpint.obj: ..\mpint.c ..\defs.h ..\misc.h ..\puttymem.h ..\mpint.h \ - ..\mpint_i.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\mpint.c -mpunsafe.obj: ..\mpunsafe.c ..\defs.h ..\misc.h ..\puttymem.h ..\mpint.h \ - ..\mpint_i.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\mpunsafe.c -nocmdline.obj: ..\nocmdline.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\nocmdline.c -nocproxy.obj: ..\nocproxy.c ..\putty.h ..\network.h ..\proxy.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\nocproxy.c -nogss.obj: ..\nogss.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\nogss.c -norand.obj: ..\norand.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\norand.c -noterm.obj: ..\noterm.c ..\putty.h ..\terminal.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\tree234.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\noterm.c -notiming.obj: ..\notiming.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\notiming.c -nullplug.obj: ..\nullplug.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\nullplug.c -osxlaunch.obj: ..\unix\osxlaunch.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\osxlaunch.c -pageant.obj: ..\pageant.c ..\putty.h ..\mpint.h ..\ssh.h ..\sshcr.h \ - ..\pageant.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\pageant.c -pageant.res: ..\windows\pageant.rc ..\windows\rcstuff.h \ - ..\windows\pageant-rc.h ..\windows\winhelp.rc2 \ - ..\windows\pageant.ico ..\windows\pageants.ico \ - ..\windows\version.rc2 ..\windows\pageant.mft \ - ..\windows\win_res.h ..\version.h ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\pageant.rc -pgssapi.obj: ..\pgssapi.c ..\putty.h ..\pgssapi.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\pgssapi.c -pinger.obj: ..\pinger.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\pinger.c -plink.res: ..\windows\plink.rc ..\windows\rcstuff.h ..\windows\putty.ico \ - ..\windows\version.rc2 ..\version.h ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\plink.rc -pockle.obj: ..\pockle.c ..\ssh.h ..\sshkeygen.h ..\mpint.h ..\mpunsafe.h \ - ..\tree234.h ..\puttymem.h ..\network.h ..\misc.h \ - ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\pockle.c -portfwd.obj: ..\portfwd.c ..\putty.h ..\ssh.h ..\sshchan.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\portfwd.c -primecandidate.obj: ..\primecandidate.c ..\ssh.h ..\mpint.h ..\mpunsafe.h \ - ..\sshkeygen.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\primecandidate.c -procnet.obj: ..\unix\procnet.c ..\misc.h ..\defs.h ..\puttymem.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\procnet.c -proxy.obj: ..\proxy.c ..\putty.h ..\network.h ..\proxy.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\proxy.c -pscp.obj: ..\pscp.c ..\putty.h ..\psftp.h ..\ssh.h ..\sftp.h ..\storage.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\pscp.c -pscp.res: ..\windows\pscp.rc ..\windows\rcstuff.h ..\windows\pscp.ico \ - ..\windows\version.rc2 ..\version.h ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\pscp.rc -psftp.obj: ..\psftp.c ..\putty.h ..\psftp.h ..\storage.h ..\ssh.h ..\sftp.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\psftp.c -psftp.res: ..\windows\psftp.rc ..\windows\rcstuff.h ..\windows\pscp.ico \ - ..\windows\version.rc2 ..\version.h ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\psftp.rc -psftpcommon.obj: ..\psftpcommon.c ..\putty.h ..\sftp.h ..\psftp.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\psftpcommon.c -psocks.obj: ..\psocks.c ..\putty.h ..\misc.h ..\ssh.h ..\sshchan.h \ - ..\psocks.h ..\defs.h ..\puttyps.h ..\network.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\psocks.c -putty.res: ..\windows\putty.rc ..\windows\rcstuff.h ..\windows\winhelp.rc2 \ - ..\windows\win_res.rc2 ..\windows\putty.mft \ - ..\windows\win_res.h ..\windows\putty.ico \ - ..\windows\puttycfg.ico ..\windows\version.rc2 ..\version.h \ - ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\putty.rc -puttygen.res: ..\windows\puttygen.rc ..\windows\rcstuff.h \ - ..\windows\winhelp.rc2 ..\windows\puttygen-rc.h \ - ..\windows\puttygen.ico ..\windows\version.rc2 \ - ..\windows\puttygen.mft ..\windows\win_res.h ..\version.h \ - ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\puttygen.rc -puttytel.res: ..\windows\puttytel.rc ..\windows\rcstuff.h \ - ..\windows\winhelp.rc2 ..\windows\win_res.rc2 \ - ..\windows\puttytel.mft ..\windows\win_res.h \ - ..\windows\putty.ico ..\windows\puttycfg.ico \ - ..\windows\version.rc2 ..\version.h ..\licence.h - lrc $(RCFL) -r $(RCFLAGS) ..\windows\puttytel.rc -raw.obj: ..\raw.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\raw.c -rlogin.obj: ..\rlogin.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\rlogin.c -sbcs.obj: ..\charset\sbcs.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\sbcs.c -sbcsdat.obj: ..\charset\sbcsdat.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\sbcsdat.c -scpserver.obj: ..\scpserver.c ..\putty.h ..\ssh.h ..\sshcr.h ..\sshchan.h \ - ..\sftp.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\scpserver.c -sesschan.obj: ..\sesschan.c ..\putty.h ..\ssh.h ..\sshchan.h ..\sshserver.h \ - ..\sftp.h ..\sshsignals.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sesschan.c -sessprep.obj: ..\sessprep.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sessprep.c -settings.obj: ..\settings.c ..\putty.h ..\storage.h ..\sshgssc.h ..\sshgss.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\pgssapi.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\settings.c -sftp.obj: ..\sftp.c ..\misc.h ..\tree234.h ..\sftp.h ..\defs.h ..\puttymem.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sftp.c -sftpcommon.obj: ..\sftpcommon.c ..\misc.h ..\sftp.h ..\defs.h ..\puttymem.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sftpcommon.c -sftpserver.obj: ..\sftpserver.c ..\putty.h ..\ssh.h ..\sftp.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sftpserver.c -sizetip.obj: ..\windows\sizetip.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\sizetip.c -slookup.obj: ..\charset\slookup.c ..\charset\charset.h ..\charset\internal.h \ - ..\charset\enum.c ..\charset\sbcsdat.c ..\charset\utf8.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\slookup.c -smallprimes.obj: ..\smallprimes.c ..\ssh.h ..\sshkeygen.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\misc.h ..\sshttymodes.h \ - ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\smallprimes.c -ssh.obj: ..\ssh.c ..\putty.h ..\pageant.h ..\tree234.h ..\storage.h \ - ..\marshal.h ..\ssh.h ..\sshcr.h ..\sshbpp.h ..\sshppl.h \ - ..\sshchan.h ..\sshgssc.h ..\sshgss.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\sshsignals.h ..\puttymem.h \ - ..\sshttymodes.h ..\pgssapi.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh.c -ssh1bpp.obj: ..\ssh1bpp.c ..\putty.h ..\ssh.h ..\sshbpp.h ..\sshcr.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1bpp.c -ssh1censor.obj: ..\ssh1censor.c ..\putty.h ..\ssh.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1censor.c -ssh1connection.obj: ..\ssh1connection.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshchan.h ..\sshcr.h ..\ssh1connection.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1connection.c -ssh1connection-client.obj: ..\ssh1connection-client.c ..\putty.h ..\ssh.h \ - ..\sshbpp.h ..\sshppl.h ..\sshchan.h ..\sshcr.h \ - ..\ssh1connection.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1connection-client.c -ssh1connection-server.obj: ..\ssh1connection-server.c ..\putty.h ..\ssh.h \ - ..\sshbpp.h ..\sshppl.h ..\sshchan.h ..\sshcr.h \ - ..\ssh1connection.h ..\sshserver.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1connection-server.c -ssh1login.obj: ..\ssh1login.c ..\putty.h ..\ssh.h ..\mpint.h ..\sshbpp.h \ - ..\sshppl.h ..\sshcr.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1login.c -ssh1login-server.obj: ..\ssh1login-server.c ..\putty.h ..\mpint.h ..\ssh.h \ - ..\sshbpp.h ..\sshppl.h ..\sshcr.h ..\sshserver.h \ - ..\sshkeygen.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh1login-server.c -ssh2bpp.obj: ..\ssh2bpp.c ..\putty.h ..\ssh.h ..\sshbpp.h ..\sshcr.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2bpp.c -ssh2bpp-bare.obj: ..\ssh2bpp-bare.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshcr.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2bpp-bare.c -ssh2censor.obj: ..\ssh2censor.c ..\putty.h ..\ssh.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2censor.c -ssh2connection.obj: ..\ssh2connection.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshchan.h ..\sshcr.h ..\ssh2connection.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2connection.c -ssh2connection-client.obj: ..\ssh2connection-client.c ..\putty.h ..\ssh.h \ - ..\sshbpp.h ..\sshppl.h ..\sshchan.h ..\sshcr.h \ - ..\ssh2connection.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2connection-client.c -ssh2connection-server.obj: ..\ssh2connection-server.c ..\putty.h ..\ssh.h \ - ..\sshbpp.h ..\sshppl.h ..\sshchan.h ..\sshcr.h \ - ..\ssh2connection.h ..\sshserver.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2connection-server.c -ssh2kex-client.obj: ..\ssh2kex-client.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshcr.h ..\storage.h ..\ssh2transport.h \ - ..\mpint.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\sshgssc.h ..\sshgss.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\pgssapi.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2kex-client.c -ssh2kex-server.obj: ..\ssh2kex-server.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshcr.h ..\sshserver.h ..\sshkeygen.h \ - ..\storage.h ..\ssh2transport.h ..\mpint.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\sshgssc.h ..\sshgss.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\pgssapi.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2kex-server.c -ssh2transhk.obj: ..\ssh2transhk.c ..\putty.h ..\ssh.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2transhk.c -ssh2transport.obj: ..\ssh2transport.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshcr.h ..\sshserver.h ..\storage.h \ - ..\ssh2transport.h ..\mpint.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h ..\sshgssc.h \ - ..\sshgss.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\pgssapi.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2transport.c -ssh2userauth.obj: ..\ssh2userauth.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshcr.h ..\sshgssc.h ..\sshgss.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\pgssapi.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2userauth.c -ssh2userauth-server.obj: ..\ssh2userauth-server.c ..\putty.h ..\ssh.h \ - ..\sshbpp.h ..\sshppl.h ..\sshcr.h ..\sshserver.h \ - ..\sshgssc.h ..\sshgss.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\pgssapi.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssh2userauth-server.c -sshaes.obj: ..\sshaes.c ..\ssh.h ..\mpint_i.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshaes.c -ssharcf.obj: ..\ssharcf.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\ssharcf.c -sshargon2.obj: ..\sshargon2.c ..\putty.h ..\ssh.h ..\marshal.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshargon2.c -sshauxcrypt.obj: ..\sshauxcrypt.c ..\ssh.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshauxcrypt.c -sshbcrypt.obj: ..\sshbcrypt.c ..\ssh.h ..\sshblowf.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\misc.h ..\sshttymodes.h \ - ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshbcrypt.c -sshblake2.obj: ..\sshblake2.c ..\ssh.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshblake2.c -sshblowf.obj: ..\sshblowf.c ..\ssh.h ..\sshblowf.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\misc.h ..\sshttymodes.h \ - ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshblowf.c -sshccp.obj: ..\sshccp.c ..\ssh.h ..\mpint_i.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshccp.c -sshcommon.obj: ..\sshcommon.c ..\putty.h ..\mpint.h ..\ssh.h ..\sshbpp.h \ - ..\sshppl.h ..\sshchan.h ..\sshttymodes.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshcommon.c -sshcrc.obj: ..\sshcrc.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshcrc.c -sshcrcda.obj: ..\sshcrcda.c ..\misc.h ..\ssh.h ..\defs.h ..\puttymem.h \ - ..\marshal.h ..\tree234.h ..\network.h ..\sshttymodes.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshcrcda.c -sshdes.obj: ..\sshdes.c ..\ssh.h ..\mpint_i.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshdes.c -sshdh.obj: ..\sshdh.c ..\ssh.h ..\misc.h ..\mpint.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshdh.c -sshdss.obj: ..\sshdss.c ..\ssh.h ..\mpint.h ..\misc.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshdss.c -sshdssg.obj: ..\sshdssg.c ..\misc.h ..\ssh.h ..\sshkeygen.h ..\mpint.h \ - ..\defs.h ..\puttymem.h ..\marshal.h ..\tree234.h \ - ..\network.h ..\sshttymodes.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshdssg.c -sshecc.obj: ..\sshecc.c ..\ssh.h ..\mpint.h ..\ecc.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\misc.h ..\sshttymodes.h \ - ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshecc.c -sshecdsag.obj: ..\sshecdsag.c ..\ssh.h ..\sshkeygen.h ..\mpint.h \ - ..\puttymem.h ..\tree234.h ..\network.h ..\misc.h \ - ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshecdsag.c -sshgssc.obj: ..\sshgssc.c ..\putty.h ..\sshgssc.h ..\misc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\marshal.h ..\sshsignals.h \ - ..\pgssapi.h ..\sshgss.h ..\puttymem.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshgssc.c -sshhmac.obj: ..\sshhmac.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshhmac.c -sshmac.obj: ..\sshmac.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshmac.c -sshmd5.obj: ..\sshmd5.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshmd5.c -sshprime.obj: ..\sshprime.c ..\ssh.h ..\mpint.h ..\mpunsafe.h ..\sshkeygen.h \ - ..\puttymem.h ..\tree234.h ..\network.h ..\misc.h \ - ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshprime.c -sshprng.obj: ..\sshprng.c ..\putty.h ..\ssh.h ..\mpint_i.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshprng.c -sshpubk.obj: ..\sshpubk.c ..\putty.h ..\mpint.h ..\ssh.h ..\misc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshpubk.c -sshrand.obj: ..\sshrand.c ..\putty.h ..\ssh.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshrand.c -sshrsa.obj: ..\sshrsa.c ..\ssh.h ..\mpint.h ..\misc.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\sshttymodes.h ..\defs.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshrsa.c -sshrsag.obj: ..\sshrsag.c ..\ssh.h ..\sshkeygen.h ..\mpint.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\misc.h ..\sshttymodes.h \ - ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshrsag.c -sshserver.obj: ..\sshserver.c ..\putty.h ..\ssh.h ..\sshbpp.h ..\sshppl.h \ - ..\sshchan.h ..\sshserver.h ..\sshgssc.h ..\sshgss.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\pgssapi.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshserver.c -sshsh256.obj: ..\sshsh256.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshsh256.c -sshsh512.obj: ..\sshsh512.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshsh512.c -sshsha.obj: ..\sshsha.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshsha.c -sshsha3.obj: ..\sshsha3.c ..\ssh.h ..\puttymem.h ..\tree234.h ..\network.h \ - ..\misc.h ..\sshttymodes.h ..\defs.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshsha3.c -sshshare.obj: ..\sshshare.c ..\putty.h ..\tree234.h ..\ssh.h ..\sshcr.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshshare.c -sshutils.obj: ..\sshutils.c ..\putty.h ..\ssh.h ..\sshchan.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshutils.c -sshverstring.obj: ..\sshverstring.c ..\putty.h ..\ssh.h ..\sshbpp.h \ - ..\sshcr.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshverstring.c -sshzlib.obj: ..\sshzlib.c ..\defs.h ..\ssh.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\sshzlib.c -stripctrl.obj: ..\stripctrl.c ..\putty.h ..\terminal.h ..\misc.h \ - ..\marshal.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\sshsignals.h ..\tree234.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\stripctrl.c -supdup.obj: ..\supdup.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\supdup.c -telnet.obj: ..\telnet.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\telnet.c -terminal.obj: ..\terminal.c ..\putty.h ..\terminal.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\tree234.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\terminal.c -testcrypt.obj: ..\testcrypt.c ..\defs.h ..\ssh.h ..\sshkeygen.h ..\misc.h \ - ..\mpint.h ..\ecc.h ..\testcrypt.h ..\puttymem.h \ - ..\tree234.h ..\network.h ..\sshttymodes.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\testcrypt.c -testsc.obj: ..\testsc.c ..\defs.h ..\putty.h ..\ssh.h ..\misc.h ..\mpint.h \ - ..\ecc.h ..\puttyps.h ..\network.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\testsc.c -testzlib.obj: ..\testzlib.c ..\defs.h ..\ssh.h ..\puttymem.h ..\tree234.h \ - ..\network.h ..\misc.h ..\sshttymodes.h ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\testzlib.c -time.obj: ..\time.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\time.c -timing.obj: ..\timing.c ..\putty.h ..\tree234.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\timing.c -toucs.obj: ..\charset\toucs.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\toucs.c -tree234.obj: ..\tree234.c ..\defs.h ..\tree234.h ..\puttymem.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\tree234.c -utf8.obj: ..\charset\utf8.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\utf8.c -utils.obj: ..\utils.c ..\defs.h ..\misc.h ..\ssh.h ..\puttymem.h \ - ..\marshal.h ..\tree234.h ..\network.h ..\sshttymodes.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\utils.c -ux_x11.obj: ..\unix\ux_x11.c ..\putty.h ..\ssh.h ..\network.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\ux_x11.c -uxagentc.obj: ..\unix\uxagentc.c ..\putty.h ..\misc.h ..\tree234.h \ - ..\puttymem.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxagentc.c -uxagentsock.obj: ..\unix\uxagentsock.c ..\putty.h ..\ssh.h ..\misc.h \ - ..\pageant.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxagentsock.c -uxcfg.obj: ..\unix\uxcfg.c ..\putty.h ..\dialog.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxcfg.c -uxcliloop.obj: ..\unix\uxcliloop.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxcliloop.c -uxcons.obj: ..\unix\uxcons.c ..\putty.h ..\storage.h ..\ssh.h ..\console.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxcons.c -uxfdsock.obj: ..\unix\uxfdsock.c ..\tree234.h ..\putty.h ..\network.h \ - ..\defs.h ..\puttyps.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxfdsock.c -uxgen.obj: ..\unix\uxgen.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxgen.c -uxgss.obj: ..\unix\uxgss.c ..\putty.h ..\pgssapi.h ..\sshgss.h ..\sshgssc.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxgss.c -uxmisc.obj: ..\unix\uxmisc.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxmisc.c -uxnet.obj: ..\unix\uxnet.c ..\putty.h ..\network.h ..\tree234.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxnet.c -uxnogtk.obj: ..\unix\uxnogtk.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxnogtk.c -uxnoise.obj: ..\unix\uxnoise.c ..\putty.h ..\ssh.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxnoise.c -uxpeer.obj: ..\unix\uxpeer.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxpeer.c -uxpgnt.obj: ..\unix\uxpgnt.c ..\putty.h ..\ssh.h ..\misc.h ..\pageant.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxpgnt.c -uxplink.obj: ..\unix\uxplink.c ..\putty.h ..\ssh.h ..\storage.h ..\tree234.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxplink.c -uxpoll.obj: ..\unix\uxpoll.c ..\putty.h ..\tree234.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxpoll.c -uxprint.obj: ..\unix\uxprint.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxprint.c -uxproxy.obj: ..\unix\uxproxy.c ..\tree234.h ..\putty.h ..\network.h \ - ..\proxy.h ..\defs.h ..\puttyps.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxproxy.c -uxpsusan.obj: ..\unix\uxpsusan.c ..\putty.h ..\mpint.h ..\ssh.h \ - ..\sshserver.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxpsusan.c -uxpterm.obj: ..\unix\uxpterm.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxpterm.c -uxpty.obj: ..\unix\uxpty.c ..\putty.h ..\ssh.h ..\sshserver.h ..\tree234.h \ - ..\sshttymodes.h ..\sshsignals.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxpty.c -uxputty.obj: ..\unix\uxputty.c ..\putty.h ..\ssh.h ..\storage.h \ - ..\unix\gtkcompat.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxputty.c -uxsel.obj: ..\unix\uxsel.c ..\putty.h ..\tree234.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxsel.c -uxser.obj: ..\unix\uxser.c ..\putty.h ..\tree234.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxser.c -uxserver.obj: ..\unix\uxserver.c ..\putty.h ..\mpint.h ..\ssh.h \ - ..\sshserver.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxserver.c -uxsftp.obj: ..\unix\uxsftp.c ..\putty.h ..\ssh.h ..\psftp.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxsftp.c -uxsftpserver.obj: ..\unix\uxsftpserver.c ..\putty.h ..\ssh.h ..\sshserver.h \ - ..\sftp.h ..\tree234.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxsftpserver.c -uxshare.obj: ..\unix\uxshare.c ..\tree234.h ..\putty.h ..\network.h \ - ..\proxy.h ..\ssh.h ..\defs.h ..\puttyps.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxshare.c -uxsignal.obj: ..\unix\uxsignal.c ..\defs.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxsignal.c -uxsocks.obj: ..\unix\uxsocks.c ..\putty.h ..\ssh.h ..\psocks.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxsocks.c -uxstore.obj: ..\unix\uxstore.c ..\putty.h ..\storage.h ..\tree234.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxstore.c -uxucs.obj: ..\unix\uxucs.c ..\putty.h ..\charset\charset.h ..\terminal.h \ - ..\misc.h ..\defs.h ..\puttyps.h ..\network.h ..\marshal.h \ - ..\sshsignals.h ..\tree234.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxucs.c -uxutils.obj: ..\unix\uxutils.c ..\putty.h ..\ssh.h ..\unix\uxutils.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\uxutils.c -version.obj: ..\version.c ..\putty.h ..\ssh.h ..\empty.h ..\version.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\version.c -wcwidth.obj: ..\wcwidth.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\wcwidth.c -wildcard.obj: ..\wildcard.c ..\putty.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\wildcard.c -wincapi.obj: ..\windows\wincapi.c ..\putty.h ..\ssh.h ..\windows\wincapi.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\wincapi.c -wincfg.obj: ..\windows\wincfg.c ..\putty.h ..\dialog.h ..\storage.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\wincfg.c -wincliloop.obj: ..\windows\wincliloop.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\wincliloop.c -wincons.obj: ..\windows\wincons.c ..\putty.h ..\storage.h ..\ssh.h \ - ..\console.h ..\defs.h ..\puttyps.h ..\network.h ..\misc.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h ..\tree234.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\wincons.c -winctrls.obj: ..\windows\winctrls.c ..\putty.h ..\misc.h ..\dialog.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winctrls.c -windefs.obj: ..\windows\windefs.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\windefs.c -windlg.obj: ..\windows\windlg.c ..\putty.h ..\ssh.h ..\windows\win_res.h \ - ..\windows\winseat.h ..\storage.h ..\dialog.h ..\licence.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\windlg.c -window.obj: ..\windows\window.c ..\putty.h ..\terminal.h ..\storage.h \ - ..\windows\win_res.h ..\windows\winsecur.h \ - ..\windows\winseat.h ..\tree234.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\window.c -wingss.obj: ..\windows\wingss.c ..\putty.h ..\pgssapi.h ..\sshgss.h \ - ..\sshgssc.h ..\misc.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\tree234.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\wingss.c -winhandl.obj: ..\windows\winhandl.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winhandl.c -winhelp.obj: ..\windows\winhelp.c ..\putty.h ..\windows\win_res.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winhelp.c -winhsock.obj: ..\windows\winhsock.c ..\tree234.h ..\putty.h ..\network.h \ - ..\defs.h ..\puttyps.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winhsock.c -winjump.obj: ..\windows\winjump.c ..\putty.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winjump.c -winmisc.obj: ..\windows\winmisc.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winmisc.c -winmiscs.obj: ..\windows\winmiscs.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winmiscs.c -winnet.obj: ..\windows\winnet.c ..\putty.h ..\network.h ..\tree234.h \ - ..\ssh.h ..\defs.h ..\puttyps.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winnet.c -winnohlp.obj: ..\windows\winnohlp.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winnohlp.c -winnoise.obj: ..\windows\winnoise.c ..\putty.h ..\ssh.h ..\storage.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winnoise.c -winnojmp.obj: ..\windows\winnojmp.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winnojmp.c -winnpc.obj: ..\windows\winnpc.c ..\tree234.h ..\putty.h ..\network.h \ - ..\proxy.h ..\ssh.h ..\windows\winsecur.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winnpc.c -winnps.obj: ..\windows\winnps.c ..\tree234.h ..\putty.h ..\network.h \ - ..\proxy.h ..\ssh.h ..\windows\winsecur.h ..\defs.h \ - ..\puttyps.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winnps.c -winpgen.obj: ..\windows\winpgen.c ..\putty.h ..\ssh.h ..\sshkeygen.h \ - ..\licence.h ..\windows\winsecur.h ..\windows\puttygen-rc.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winpgen.c -winpgnt.obj: ..\windows\winpgnt.c ..\putty.h ..\ssh.h ..\misc.h ..\tree234.h \ - ..\windows\winsecur.h ..\windows\wincapi.h ..\pageant.h \ - ..\licence.h ..\windows\pageant-rc.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winpgnt.c -winpgntc.obj: ..\windows\winpgntc.c ..\putty.h ..\pageant.h \ - ..\windows\winsecur.h ..\windows\wincapi.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winpgntc.c -winplink.obj: ..\windows\winplink.c ..\putty.h ..\storage.h ..\tree234.h \ - ..\windows\winsecur.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\puttymem.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winplink.c -winprint.obj: ..\windows\winprint.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winprint.c -winproxy.obj: ..\windows\winproxy.c ..\tree234.h ..\putty.h ..\network.h \ - ..\proxy.h ..\defs.h ..\puttyps.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winproxy.c -winsecur.obj: ..\windows\winsecur.c ..\putty.h ..\windows\winsecur.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winsecur.c -winselcli.obj: ..\windows\winselcli.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winselcli.c -winselgui.obj: ..\windows\winselgui.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winselgui.c -winser.obj: ..\windows\winser.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winser.c -winsftp.obj: ..\windows\winsftp.c ..\putty.h ..\psftp.h ..\ssh.h \ - ..\windows\winsecur.h ..\defs.h ..\puttyps.h ..\network.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\tree234.h ..\sshttymodes.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winsftp.c -winshare.obj: ..\windows\winshare.c ..\tree234.h ..\putty.h ..\network.h \ - ..\proxy.h ..\ssh.h ..\windows\wincapi.h \ - ..\windows\winsecur.h ..\noshare.c ..\defs.h ..\puttyps.h \ - ..\misc.h ..\marshal.h ..\sshsignals.h ..\puttymem.h \ - ..\sshttymodes.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winshare.c -winsocks.obj: ..\windows\winsocks.c ..\putty.h ..\ssh.h ..\psocks.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winsocks.c -winstore.obj: ..\windows\winstore.c ..\putty.h ..\storage.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winstore.c -wintime.obj: ..\windows\wintime.c ..\putty.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\puttymem.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\wintime.c -winucs.obj: ..\windows\winucs.c ..\putty.h ..\terminal.h ..\misc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\marshal.h ..\sshsignals.h \ - ..\tree234.h ..\puttymem.h ..\windows\winstuff.h \ - ..\unix\unix.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winucs.c -winutils.obj: ..\windows\winutils.c ..\putty.h ..\misc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\tree234.h ..\windows\winhelp.h ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winutils.c -winx11.obj: ..\windows\winx11.c ..\putty.h ..\ssh.h ..\defs.h ..\puttyps.h \ - ..\network.h ..\misc.h ..\marshal.h ..\sshsignals.h \ - ..\puttymem.h ..\tree234.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\windows\winx11.c -x11fwd.obj: ..\x11fwd.c ..\putty.h ..\ssh.h ..\sshchan.h ..\tree234.h \ - ..\defs.h ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\puttymem.h ..\sshttymodes.h \ - ..\windows\winstuff.h ..\unix\unix.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\x11fwd.c -x11misc.obj: ..\unix\x11misc.c ..\putty.h ..\unix\x11misc.h ..\defs.h \ - ..\puttyps.h ..\network.h ..\misc.h ..\marshal.h \ - ..\sshsignals.h ..\windows\winstuff.h ..\unix\unix.h \ - ..\puttymem.h ..\tree234.h ..\windows\winhelp.h \ - ..\charset\charset.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\x11misc.c -xenc.obj: ..\charset\xenc.c ..\charset\charset.h ..\charset\internal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\charset\xenc.c -xkeysym.obj: ..\unix\xkeysym.c ..\misc.h ..\defs.h ..\puttymem.h \ - ..\marshal.h - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\xkeysym.c -xpmptcfg.obj: ..\unix\xpmptcfg.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\xpmptcfg.c -xpmpterm.obj: ..\unix\xpmpterm.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\xpmpterm.c -xpmpucfg.obj: ..\unix\xpmpucfg.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\xpmpucfg.c -xpmputty.obj: ..\unix\xpmputty.c - lcc -O -p6 $(COMPAT) $(CFLAGS) $(XFLAGS) ..\unix\xpmputty.c - - -clean: - -del *.obj - -del *.exe - -del *.res - -FORCE: diff --git a/code/windows/Makefile.mgw b/code/windows/Makefile.mgw deleted file mode 100644 index 2ab9b6f..0000000 --- a/code/windows/Makefile.mgw +++ /dev/null @@ -1,1850 +0,0 @@ -# Makefile for putty under MinGW, Cygwin, or Winelib. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. -# -# Extra options you can set: -# -# - COMPAT=-DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=-DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=-DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=-DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=-DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=-DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=-DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=-DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=-DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=-DMSVC4 (Windows only) -# - RCFL=-DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need -DNO_SECURITY and -DNO_MULTIMON. -# -# - COMPAT=-DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=-DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=-DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=-DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=-DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. - -# You can define this path to point at your tools if you need to -# TOOLPATH = c:\cygwin\bin\ # or similar, if you're running Windows -# TOOLPATH = /pkg/mingw32msvc/i386-mingw32msvc/bin/ -# TOOLPATH = i686-w64-mingw32- -CC = $(TOOLPATH)gcc -RC = $(TOOLPATH)windres -# Uncomment the following two lines to compile under Winelib -# CC = winegcc -# RC = wrc -# You may also need to tell windres where to find include files: -# RCINC = --include-dir c:\cygwin\include\ - -CFLAGS = -Wall -O2 -std=gnu99 -Wvla -D_WINDOWS -DWIN32S_COMPAT \ - -D_NO_OLDNAMES -D__USE_MINGW_ANSI_STDIO=1 -I.././ \ - -I../charset/ -I../windows/ -I../unix/ -LDFLAGS = -s -RCFLAGS = $(RCINC) --define WIN32=1 --define _WIN32=1 --define WINVER=0x0400 \ - -I.././ -I../charset/ -I../windows/ -I../unix/ - -# _WIN32_IE is required to expose identifiers that only make sense on -# systems with IE5+ installed, such as some arguments to SHGetFolderPath(). -# WINVER etc perform a similar function for FlashWindowEx(). -CFLAGS += -D_WIN32_IE=0x0500 -CFLAGS += -DWINVER=0x0500 -D_WIN32_WINDOWS=0x0410 -D_WIN32_WINNT=0x0500 - -.SUFFIXES: - -all: pageant.exe plink.exe pscp.exe psftp.exe psocks.exe putty.exe \ - puttygen.exe puttytel.exe testcrypt.exe - -pageant.exe: aqsync.o be_misc.o callback.o conf.o ecc.o errsock.o marshal.o \ - memory.o misc.o mpint.o pageant.o pageant.res.o sshaes.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshdes.o sshdss.o \ - sshecc.o sshhmac.o sshmd5.o sshpubk.o sshrsa.o sshsh256.o \ - sshsh512.o sshsha.o sshsha3.o stripctrl.o tree234.o utils.o \ - version.o wcwidth.o wincapi.o winhandl.o winhelp.o \ - winhsock.o winmisc.o winmiscs.o winnet.o winnpc.o winnps.o \ - winpgnt.o winpgntc.o winsecur.o winselgui.o winutils.o - $(CC) -mwindows $(LDFLAGS) -o $@ -Wl,-Map,pageant.map aqsync.o \ - be_misc.o callback.o conf.o ecc.o errsock.o marshal.o \ - memory.o misc.o mpint.o pageant.o pageant.res.o sshaes.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshdes.o sshdss.o \ - sshecc.o sshhmac.o sshmd5.o sshpubk.o sshrsa.o sshsh256.o \ - sshsh512.o sshsha.o sshsha3.o stripctrl.o tree234.o utils.o \ - version.o wcwidth.o wincapi.o winhandl.o winhelp.o \ - winhsock.o winmisc.o winmiscs.o winnet.o winnpc.o winnps.o \ - winpgnt.o winpgntc.o winsecur.o winselgui.o winutils.o \ - -ladvapi32 -lcomdlg32 -lgdi32 -limm32 -lole32 -lshell32 \ - -luser32 - -plink.exe: agentf.o aqsync.o be_all_s.o be_misc.o callback.o clicons.o \ - cmdline.o conf.o console.o cproxy.o ecc.o errsock.o ldisc.o \ - logging.o mainchan.o marshal.o memory.o misc.o miscucs.o \ - mpint.o noterm.o nullplug.o pgssapi.o pinger.o plink.res.o \ - portfwd.o proxy.o raw.o rlogin.o sessprep.o settings.o ssh.o \ - ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o supdup.o \ - telnet.o timing.o tree234.o utils.o version.o wcwidth.o \ - wildcard.o wincapi.o wincliloop.o wincons.o windefs.o \ - wingss.o winhandl.o winhsock.o winmisc.o winmiscs.o winnet.o \ - winnohlp.o winnoise.o winnojmp.o winnpc.o winnps.o \ - winpgntc.o winplink.o winproxy.o winsecur.o winselcli.o \ - winser.o winshare.o winstore.o wintime.o winucs.o winx11.o \ - x11fwd.o - $(CC) $(LDFLAGS) -o $@ -Wl,-Map,plink.map agentf.o aqsync.o \ - be_all_s.o be_misc.o callback.o clicons.o cmdline.o conf.o \ - console.o cproxy.o ecc.o errsock.o ldisc.o logging.o \ - mainchan.o marshal.o memory.o misc.o miscucs.o mpint.o \ - noterm.o nullplug.o pgssapi.o pinger.o plink.res.o portfwd.o \ - proxy.o raw.o rlogin.o sessprep.o settings.o ssh.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-client.o \ - ssh1login.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-client.o ssh2kex-client.o \ - ssh2transhk.o ssh2transport.o ssh2userauth.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprng.o sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o \ - sshsha.o sshsha3.o sshshare.o sshutils.o sshverstring.o \ - sshzlib.o stripctrl.o supdup.o telnet.o timing.o tree234.o \ - utils.o version.o wcwidth.o wildcard.o wincapi.o \ - wincliloop.o wincons.o windefs.o wingss.o winhandl.o \ - winhsock.o winmisc.o winmiscs.o winnet.o winnohlp.o \ - winnoise.o winnojmp.o winnpc.o winnps.o winpgntc.o \ - winplink.o winproxy.o winsecur.o winselcli.o winser.o \ - winshare.o winstore.o wintime.o winucs.o winx11.o x11fwd.o \ - -ladvapi32 -lcomdlg32 -lgdi32 -limm32 -lole32 -lshell32 \ - -luser32 - -pscp.exe: agentf.o aqsync.o be_misc.o be_ssh.o callback.o clicons.o \ - cmdline.o conf.o console.o cproxy.o ecc.o errsock.o \ - logging.o mainchan.o marshal.o memory.o misc.o miscucs.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - pscp.o pscp.res.o psftpcommon.o settings.o sftp.o \ - sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o timing.o \ - tree234.o utils.o version.o wcwidth.o wildcard.o wincapi.o \ - wincliloop.o wincons.o windefs.o wingss.o winhandl.o \ - winhsock.o winmisc.o winmiscs.o winnet.o winnohlp.o \ - winnoise.o winnojmp.o winnpc.o winnps.o winpgntc.o \ - winproxy.o winsecur.o winselcli.o winsftp.o winshare.o \ - winstore.o wintime.o winucs.o x11fwd.o - $(CC) $(LDFLAGS) -o $@ -Wl,-Map,pscp.map agentf.o aqsync.o be_misc.o \ - be_ssh.o callback.o clicons.o cmdline.o conf.o console.o \ - cproxy.o ecc.o errsock.o logging.o mainchan.o marshal.o \ - memory.o misc.o miscucs.o mpint.o nullplug.o pgssapi.o \ - pinger.o portfwd.o proxy.o pscp.o pscp.res.o psftpcommon.o \ - settings.o sftp.o sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o \ - ssh1connection.o ssh1connection-client.o ssh1login.o \ - ssh2bpp.o ssh2bpp-bare.o ssh2censor.o ssh2connection.o \ - ssh2connection-client.o ssh2kex-client.o ssh2transhk.o \ - ssh2transport.o ssh2userauth.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \ - sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o sshprng.o \ - sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o sshshare.o sshutils.o sshverstring.o sshzlib.o \ - stripctrl.o timing.o tree234.o utils.o version.o wcwidth.o \ - wildcard.o wincapi.o wincliloop.o wincons.o windefs.o \ - wingss.o winhandl.o winhsock.o winmisc.o winmiscs.o winnet.o \ - winnohlp.o winnoise.o winnojmp.o winnpc.o winnps.o \ - winpgntc.o winproxy.o winsecur.o winselcli.o winsftp.o \ - winshare.o winstore.o wintime.o winucs.o x11fwd.o -ladvapi32 \ - -lcomdlg32 -lgdi32 -limm32 -lole32 -lshell32 -luser32 - -psftp.exe: agentf.o aqsync.o be_misc.o be_ssh.o callback.o clicons.o \ - cmdline.o conf.o console.o cproxy.o ecc.o errsock.o \ - logging.o mainchan.o marshal.o memory.o misc.o miscucs.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - psftp.o psftp.res.o psftpcommon.o settings.o sftp.o \ - sftpcommon.o ssh.o ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o timing.o \ - tree234.o utils.o version.o wcwidth.o wildcard.o wincapi.o \ - wincliloop.o wincons.o windefs.o wingss.o winhandl.o \ - winhsock.o winmisc.o winmiscs.o winnet.o winnohlp.o \ - winnoise.o winnojmp.o winnpc.o winnps.o winpgntc.o \ - winproxy.o winsecur.o winselcli.o winsftp.o winshare.o \ - winstore.o wintime.o winucs.o x11fwd.o - $(CC) $(LDFLAGS) -o $@ -Wl,-Map,psftp.map agentf.o aqsync.o \ - be_misc.o be_ssh.o callback.o clicons.o cmdline.o conf.o \ - console.o cproxy.o ecc.o errsock.o logging.o mainchan.o \ - marshal.o memory.o misc.o miscucs.o mpint.o nullplug.o \ - pgssapi.o pinger.o portfwd.o proxy.o psftp.o psftp.res.o \ - psftpcommon.o settings.o sftp.o sftpcommon.o ssh.o ssh1bpp.o \ - ssh1censor.o ssh1connection.o ssh1connection-client.o \ - ssh1login.o ssh2bpp.o ssh2bpp-bare.o ssh2censor.o \ - ssh2connection.o ssh2connection-client.o ssh2kex-client.o \ - ssh2transhk.o ssh2transport.o ssh2userauth.o sshaes.o \ - ssharcf.o sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o \ - sshccp.o sshcommon.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \ - sshdss.o sshecc.o sshgssc.o sshhmac.o sshmac.o sshmd5.o \ - sshprng.o sshpubk.o sshrand.o sshrsa.o sshsh256.o sshsh512.o \ - sshsha.o sshsha3.o sshshare.o sshutils.o sshverstring.o \ - sshzlib.o stripctrl.o timing.o tree234.o utils.o version.o \ - wcwidth.o wildcard.o wincapi.o wincliloop.o wincons.o \ - windefs.o wingss.o winhandl.o winhsock.o winmisc.o \ - winmiscs.o winnet.o winnohlp.o winnoise.o winnojmp.o \ - winnpc.o winnps.o winpgntc.o winproxy.o winsecur.o \ - winselcli.o winsftp.o winshare.o winstore.o wintime.o \ - winucs.o x11fwd.o -ladvapi32 -lcomdlg32 -lgdi32 -limm32 \ - -lole32 -lshell32 -luser32 - -psocks.exe: be_misc.o callback.o conf.o console.o errsock.o logging.o \ - marshal.o memory.o misc.o nocproxy.o norand.o portfwd.o \ - proxy.o psocks.o sshutils.o stripctrl.o time.o timing.o \ - tree234.o utils.o version.o wcwidth.o wincliloop.o wincons.o \ - winhandl.o winhsock.o winmisc.o winmiscs.o winnet.o \ - winnohlp.o winproxy.o winselcli.o winsocks.o - $(CC) $(LDFLAGS) -o $@ -Wl,-Map,psocks.map be_misc.o callback.o \ - conf.o console.o errsock.o logging.o marshal.o memory.o \ - misc.o nocproxy.o norand.o portfwd.o proxy.o psocks.o \ - sshutils.o stripctrl.o time.o timing.o tree234.o utils.o \ - version.o wcwidth.o wincliloop.o wincons.o winhandl.o \ - winhsock.o winmisc.o winmiscs.o winnet.o winnohlp.o \ - winproxy.o winselcli.o winsocks.o -ladvapi32 -lcomdlg32 \ - -lgdi32 -limm32 -lole32 -lshell32 -luser32 - -putty.exe: agentf.o aqsync.o be_all_s.o be_misc.o callback.o cmdline.o \ - conf.o config.o cproxy.o dialog.o ecc.o errsock.o ldisc.o \ - logging.o mainchan.o marshal.o memory.o minibidi.o misc.o \ - miscucs.o mpint.o nullplug.o pgssapi.o pinger.o portfwd.o \ - proxy.o putty.res.o raw.o rlogin.o sessprep.o settings.o \ - sizetip.o ssh.o ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o supdup.o \ - telnet.o terminal.o timing.o tree234.o utils.o version.o \ - wcwidth.o wildcard.o wincapi.o wincfg.o winctrls.o windefs.o \ - windlg.o window.o wingss.o winhandl.o winhelp.o winhsock.o \ - winjump.o winmisc.o winmiscs.o winnet.o winnoise.o winnpc.o \ - winnps.o winpgntc.o winprint.o winproxy.o winsecur.o \ - winselgui.o winser.o winshare.o winstore.o wintime.o \ - winucs.o winutils.o winx11.o x11fwd.o - $(CC) -mwindows $(LDFLAGS) -o $@ -Wl,-Map,putty.map agentf.o \ - aqsync.o be_all_s.o be_misc.o callback.o cmdline.o conf.o \ - config.o cproxy.o dialog.o ecc.o errsock.o ldisc.o logging.o \ - mainchan.o marshal.o memory.o minibidi.o misc.o miscucs.o \ - mpint.o nullplug.o pgssapi.o pinger.o portfwd.o proxy.o \ - putty.res.o raw.o rlogin.o sessprep.o settings.o sizetip.o \ - ssh.o ssh1bpp.o ssh1censor.o ssh1connection.o \ - ssh1connection-client.o ssh1login.o ssh2bpp.o ssh2bpp-bare.o \ - ssh2censor.o ssh2connection.o ssh2connection-client.o \ - ssh2kex-client.o ssh2transhk.o ssh2transport.o \ - ssh2userauth.o sshaes.o ssharcf.o sshargon2.o sshauxcrypt.o \ - sshblake2.o sshblowf.o sshccp.o sshcommon.o sshcrc.o \ - sshcrcda.o sshdes.o sshdh.o sshdss.o sshecc.o sshgssc.o \ - sshhmac.o sshmac.o sshmd5.o sshprng.o sshpubk.o sshrand.o \ - sshrsa.o sshsh256.o sshsh512.o sshsha.o sshsha3.o sshshare.o \ - sshutils.o sshverstring.o sshzlib.o stripctrl.o supdup.o \ - telnet.o terminal.o timing.o tree234.o utils.o version.o \ - wcwidth.o wildcard.o wincapi.o wincfg.o winctrls.o windefs.o \ - windlg.o window.o wingss.o winhandl.o winhelp.o winhsock.o \ - winjump.o winmisc.o winmiscs.o winnet.o winnoise.o winnpc.o \ - winnps.o winpgntc.o winprint.o winproxy.o winsecur.o \ - winselgui.o winser.o winshare.o winstore.o wintime.o \ - winucs.o winutils.o winx11.o x11fwd.o -ladvapi32 -lcomdlg32 \ - -lgdi32 -limm32 -lole32 -lshell32 -luser32 - -puttygen.exe: conf.o ecc.o import.o marshal.o memory.o millerrabin.o misc.o \ - mpint.o mpunsafe.o notiming.o pockle.o primecandidate.o \ - puttygen.res.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o \ - tree234.o utils.o version.o wcwidth.o winctrls.o winhelp.o \ - winmisc.o winmiscs.o winnoise.o winnojmp.o winpgen.o \ - winsecur.o winstore.o wintime.o winutils.o - $(CC) -mwindows $(LDFLAGS) -o $@ -Wl,-Map,puttygen.map conf.o ecc.o \ - import.o marshal.o memory.o millerrabin.o misc.o mpint.o \ - mpunsafe.o notiming.o pockle.o primecandidate.o \ - puttygen.res.o smallprimes.o sshaes.o sshargon2.o \ - sshauxcrypt.o sshbcrypt.o sshblake2.o sshblowf.o sshdes.o \ - sshdss.o sshdssg.o sshecc.o sshecdsag.o sshhmac.o sshmd5.o \ - sshprime.o sshprng.o sshpubk.o sshrand.o sshrsa.o sshrsag.o \ - sshsh256.o sshsh512.o sshsha.o sshsha3.o stripctrl.o \ - tree234.o utils.o version.o wcwidth.o winctrls.o winhelp.o \ - winmisc.o winmiscs.o winnoise.o winnojmp.o winpgen.o \ - winsecur.o winstore.o wintime.o winutils.o -ladvapi32 \ - -lcomdlg32 -lgdi32 -limm32 -lole32 -lshell32 -luser32 - -puttytel.exe: be_misc.o be_nos_s.o callback.o cmdline.o conf.o config.o \ - dialog.o errsock.o ldisc.o logging.o marshal.o memory.o \ - minibidi.o misc.o miscucs.o nocproxy.o nogss.o norand.o \ - pinger.o proxy.o puttytel.res.o raw.o rlogin.o sessprep.o \ - settings.o sizetip.o stripctrl.o supdup.o telnet.o \ - terminal.o timing.o tree234.o utils.o version.o wcwidth.o \ - wincfg.o winctrls.o windefs.o windlg.o window.o winhandl.o \ - winhelp.o winhsock.o winjump.o winmisc.o winmiscs.o winnet.o \ - winprint.o winproxy.o winsecur.o winselgui.o winser.o \ - winstore.o wintime.o winucs.o winutils.o - $(CC) -mwindows $(LDFLAGS) -o $@ -Wl,-Map,puttytel.map be_misc.o \ - be_nos_s.o callback.o cmdline.o conf.o config.o dialog.o \ - errsock.o ldisc.o logging.o marshal.o memory.o minibidi.o \ - misc.o miscucs.o nocproxy.o nogss.o norand.o pinger.o \ - proxy.o puttytel.res.o raw.o rlogin.o sessprep.o settings.o \ - sizetip.o stripctrl.o supdup.o telnet.o terminal.o timing.o \ - tree234.o utils.o version.o wcwidth.o wincfg.o winctrls.o \ - windefs.o windlg.o window.o winhandl.o winhelp.o winhsock.o \ - winjump.o winmisc.o winmiscs.o winnet.o winprint.o \ - winproxy.o winsecur.o winselgui.o winser.o winstore.o \ - wintime.o winucs.o winutils.o -ladvapi32 -lcomdlg32 -lgdi32 \ - -limm32 -lole32 -lshell32 -luser32 - -testcrypt.exe: ecc.o marshal.o memory.o millerrabin.o mpint.o mpunsafe.o \ - pockle.o primecandidate.o smallprimes.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o sshdssg.o \ - sshecc.o sshecdsag.o sshhmac.o sshmd5.o sshprime.o sshprng.o \ - sshpubk.o sshrsa.o sshrsag.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o testcrypt.o tree234.o utils.o winmiscs.o - $(CC) $(LDFLAGS) -o $@ -Wl,-Map,testcrypt.map ecc.o marshal.o \ - memory.o millerrabin.o mpint.o mpunsafe.o pockle.o \ - primecandidate.o smallprimes.o sshaes.o ssharcf.o \ - sshargon2.o sshauxcrypt.o sshblake2.o sshblowf.o sshccp.o \ - sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o sshdssg.o \ - sshecc.o sshecdsag.o sshhmac.o sshmd5.o sshprime.o sshprng.o \ - sshpubk.o sshrsa.o sshrsag.o sshsh256.o sshsh512.o sshsha.o \ - sshsha3.o testcrypt.o tree234.o utils.o winmiscs.o - -agentf.o: ../agentf.c ../putty.h ../ssh.h ../pageant.h ../sshchan.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../agentf.c - -aqsync.o: ../aqsync.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../aqsync.c - -be_all_s.o: ../be_all_s.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_all_s.c - -be_misc.o: ../be_misc.c ../putty.h ../network.h ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_misc.c - -be_none.o: ../be_none.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_none.c - -be_nos_s.o: ../be_nos_s.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_nos_s.c - -be_ssh.o: ../be_ssh.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_ssh.c - -callback.o: ../callback.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../callback.c - -cgtest.o: ../cgtest.c ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cgtest.c - -clicons.o: ../clicons.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../clicons.c - -cmdgen.o: ../cmdgen.c ../putty.h ../ssh.h ../sshkeygen.h ../mpint.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cmdgen.c - -cmdline.o: ../cmdline.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cmdline.c - -conf.o: ../conf.c ../tree234.h ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../conf.c - -config.o: ../config.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../config.c - -console.o: ../console.c ../putty.h ../misc.h ../console.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../console.c - -cproxy.o: ../cproxy.c ../putty.h ../ssh.h ../network.h ../proxy.h \ - ../marshal.h ../defs.h ../puttyps.h ../misc.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../cproxy.c - -dialog.o: ../dialog.c ../putty.h ../dialog.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../dialog.c - -ecc.o: ../ecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ecc.c - -errsock.o: ../errsock.c ../tree234.h ../putty.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../errsock.c - -fromucs.o: ../charset/fromucs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/fromucs.c - -fuzzterm.o: ../fuzzterm.c ../putty.h ../dialog.h ../terminal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../fuzzterm.c - -gtkapp.o: ../unix/gtkapp.c ../putty.h ../unix/gtkmisc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkapp.c - -gtkask.o: ../unix/gtkask.c ../defs.h ../unix/gtkfont.h ../unix/gtkcompat.h \ - ../unix/gtkmisc.h ../putty.h ../ssh.h ../misc.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkask.c - -gtkcfg.o: ../unix/gtkcfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcfg.c - -gtkcols.o: ../unix/gtkcols.c ../defs.h ../unix/gtkcompat.h ../unix/gtkcols.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcols.c - -gtkcomm.o: ../unix/gtkcomm.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkcomm.c - -gtkdlg.o: ../unix/gtkdlg.c ../putty.h ../unix/gtkcompat.h ../unix/gtkcols.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../storage.h ../dialog.h ../tree234.h ../licence.h ../ssh.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkdlg.c - -gtkfont.o: ../unix/gtkfont.c ../putty.h ../unix/gtkfont.h \ - ../unix/gtkcompat.h ../unix/gtkmisc.h ../tree234.h \ - ../unix/x11misc.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkfont.c - -gtkmain.o: ../unix/gtkmain.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkmain.c - -gtkmisc.o: ../unix/gtkmisc.c ../putty.h ../unix/gtkcompat.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkmisc.c - -gtkwin.o: ../unix/gtkwin.c ../putty.h ../terminal.h ../unix/gtkcompat.h \ - ../unix/gtkfont.h ../unix/gtkmisc.h ../unix/x11misc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/gtkwin.c - -import.o: ../import.c ../putty.h ../ssh.h ../mpint.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../import.c - -ldisc.o: ../ldisc.c ../putty.h ../terminal.h ../ldisc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ldisc.c - -localenc.o: ../charset/localenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/localenc.c - -logging.o: ../logging.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../logging.c - -macenc.o: ../charset/macenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/macenc.c - -mainchan.o: ../mainchan.c ../putty.h ../ssh.h ../sshppl.h ../sshchan.h \ - ../sshsignals.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mainchan.c - -marshal.o: ../marshal.c ../marshal.h ../misc.h ../defs.h ../puttymem.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../marshal.c - -memory.o: ../memory.c ../defs.h ../puttymem.h ../misc.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../memory.c - -millerrabin.o: ../millerrabin.c ../ssh.h ../sshkeygen.h ../mpint.h \ - ../mpunsafe.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../millerrabin.c - -mimeenc.o: ../charset/mimeenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/mimeenc.c - -minibidi.o: ../minibidi.c ../putty.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../minibidi.c - -misc.o: ../misc.c ../defs.h ../putty.h ../misc.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../misc.c - -miscucs.o: ../miscucs.c ../putty.h ../misc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../miscucs.c - -mpint.o: ../mpint.c ../defs.h ../misc.h ../puttymem.h ../mpint.h \ - ../mpint_i.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mpint.c - -mpunsafe.o: ../mpunsafe.c ../defs.h ../misc.h ../puttymem.h ../mpint.h \ - ../mpint_i.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../mpunsafe.c - -nocmdline.o: ../nocmdline.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nocmdline.c - -nocproxy.o: ../nocproxy.c ../putty.h ../network.h ../proxy.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nocproxy.c - -nogss.o: ../nogss.c ../putty.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nogss.c - -norand.o: ../norand.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../norand.c - -noterm.o: ../noterm.c ../putty.h ../terminal.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../noterm.c - -notiming.o: ../notiming.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../notiming.c - -nullplug.o: ../nullplug.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../nullplug.c - -osxlaunch.o: ../unix/osxlaunch.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/osxlaunch.c - -pageant.o: ../pageant.c ../putty.h ../mpint.h ../ssh.h ../sshcr.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pageant.c - -pageant.res.o: ../windows/pageant.rc ../windows/rcstuff.h \ - ../windows/pageant-rc.h ../windows/winhelp.rc2 \ - ../windows/pageant.ico ../windows/pageants.ico \ - ../windows/version.rc2 ../windows/pageant.mft \ - ../windows/win_res.h ../version.h ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/pageant.rc -o pageant.res.o - -pgssapi.o: ../pgssapi.c ../putty.h ../pgssapi.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pgssapi.c - -pinger.o: ../pinger.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pinger.c - -plink.res.o: ../windows/plink.rc ../windows/rcstuff.h ../windows/putty.ico \ - ../windows/version.rc2 ../version.h ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/plink.rc -o plink.res.o - -pockle.o: ../pockle.c ../ssh.h ../sshkeygen.h ../mpint.h ../mpunsafe.h \ - ../tree234.h ../puttymem.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pockle.c - -portfwd.o: ../portfwd.c ../putty.h ../ssh.h ../sshchan.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../portfwd.c - -primecandidate.o: ../primecandidate.c ../ssh.h ../mpint.h ../mpunsafe.h \ - ../sshkeygen.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../primecandidate.c - -procnet.o: ../unix/procnet.c ../misc.h ../defs.h ../puttymem.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/procnet.c - -proxy.o: ../proxy.c ../putty.h ../network.h ../proxy.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../proxy.c - -pscp.o: ../pscp.c ../putty.h ../psftp.h ../ssh.h ../sftp.h ../storage.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../pscp.c - -pscp.res.o: ../windows/pscp.rc ../windows/rcstuff.h ../windows/pscp.ico \ - ../windows/version.rc2 ../version.h ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/pscp.rc -o pscp.res.o - -psftp.o: ../psftp.c ../putty.h ../psftp.h ../storage.h ../ssh.h ../sftp.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psftp.c - -psftp.res.o: ../windows/psftp.rc ../windows/rcstuff.h ../windows/pscp.ico \ - ../windows/version.rc2 ../version.h ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/psftp.rc -o psftp.res.o - -psftpcommon.o: ../psftpcommon.c ../putty.h ../sftp.h ../psftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psftpcommon.c - -psocks.o: ../psocks.c ../putty.h ../misc.h ../ssh.h ../sshchan.h ../psocks.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../psocks.c - -putty.res.o: ../windows/putty.rc ../windows/rcstuff.h ../windows/winhelp.rc2 \ - ../windows/win_res.rc2 ../windows/putty.mft \ - ../windows/win_res.h ../windows/putty.ico \ - ../windows/puttycfg.ico ../windows/version.rc2 ../version.h \ - ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/putty.rc -o putty.res.o - -puttygen.res.o: ../windows/puttygen.rc ../windows/rcstuff.h \ - ../windows/winhelp.rc2 ../windows/puttygen-rc.h \ - ../windows/puttygen.ico ../windows/version.rc2 \ - ../windows/puttygen.mft ../windows/win_res.h ../version.h \ - ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/puttygen.rc -o puttygen.res.o - -puttytel.res.o: ../windows/puttytel.rc ../windows/rcstuff.h \ - ../windows/winhelp.rc2 ../windows/win_res.rc2 \ - ../windows/puttytel.mft ../windows/win_res.h \ - ../windows/putty.ico ../windows/puttycfg.ico \ - ../windows/version.rc2 ../version.h ../licence.h - $(RC) $(RCFL) $(RCFLAGS) ../windows/puttytel.rc -o puttytel.res.o - -raw.o: ../raw.c ../putty.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../raw.c - -rlogin.o: ../rlogin.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../rlogin.c - -sbcs.o: ../charset/sbcs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/sbcs.c - -sbcsdat.o: ../charset/sbcsdat.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/sbcsdat.c - -scpserver.o: ../scpserver.c ../putty.h ../ssh.h ../sshcr.h ../sshchan.h \ - ../sftp.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../scpserver.c - -sesschan.o: ../sesschan.c ../putty.h ../ssh.h ../sshchan.h ../sshserver.h \ - ../sftp.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sesschan.c - -sessprep.o: ../sessprep.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sessprep.c - -settings.o: ../settings.c ../putty.h ../storage.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../settings.c - -sftp.o: ../sftp.c ../misc.h ../tree234.h ../sftp.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftp.c - -sftpcommon.o: ../sftpcommon.c ../misc.h ../sftp.h ../defs.h ../puttymem.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftpcommon.c - -sftpserver.o: ../sftpserver.c ../putty.h ../ssh.h ../sftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sftpserver.c - -sizetip.o: ../windows/sizetip.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/sizetip.c - -slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \ - ../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/slookup.c - -smallprimes.o: ../smallprimes.c ../ssh.h ../sshkeygen.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../smallprimes.c - -ssh.o: ../ssh.c ../putty.h ../pageant.h ../tree234.h ../storage.h \ - ../marshal.h ../ssh.h ../sshcr.h ../sshbpp.h ../sshppl.h \ - ../sshchan.h ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../pgssapi.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh.c - -ssh1bpp.o: ../ssh1bpp.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1bpp.c - -ssh1censor.o: ../ssh1censor.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1censor.c - -ssh1connection.o: ../ssh1connection.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshcr.h ../ssh1connection.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection.c - -ssh1connection-client.o: ../ssh1connection-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection-client.c - -ssh1connection-server.o: ../ssh1connection-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh1connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1connection-server.c - -ssh1login.o: ../ssh1login.c ../putty.h ../ssh.h ../mpint.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1login.c - -ssh1login-server.o: ../ssh1login-server.c ../putty.h ../mpint.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshkeygen.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh1login-server.c - -ssh2bpp.o: ../ssh2bpp.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2bpp.c - -ssh2bpp-bare.o: ../ssh2bpp-bare.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2bpp-bare.c - -ssh2censor.o: ../ssh2censor.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2censor.c - -ssh2connection.o: ../ssh2connection.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshcr.h ../ssh2connection.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection.c - -ssh2connection-client.o: ../ssh2connection-client.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection-client.c - -ssh2connection-server.o: ../ssh2connection-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshchan.h ../sshcr.h \ - ../ssh2connection.h ../sshserver.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2connection-server.c - -ssh2kex-client.o: ../ssh2kex-client.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../storage.h ../ssh2transport.h \ - ../mpint.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../sshgssc.h ../sshgss.h \ - ../windows/winstuff.h ../unix/unix.h ../pgssapi.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2kex-client.c - -ssh2kex-server.o: ../ssh2kex-server.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshserver.h ../sshkeygen.h \ - ../storage.h ../ssh2transport.h ../mpint.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../sshgssc.h ../sshgss.h ../windows/winstuff.h \ - ../unix/unix.h ../pgssapi.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2kex-server.c - -ssh2transhk.o: ../ssh2transhk.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2transhk.c - -ssh2transport.o: ../ssh2transport.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshserver.h ../storage.h \ - ../ssh2transport.h ../mpint.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h ../sshgssc.h \ - ../sshgss.h ../windows/winstuff.h ../unix/unix.h \ - ../pgssapi.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2transport.c - -ssh2userauth.o: ../ssh2userauth.c ../putty.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshcr.h ../sshgssc.h ../sshgss.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2userauth.c - -ssh2userauth-server.o: ../ssh2userauth-server.c ../putty.h ../ssh.h \ - ../sshbpp.h ../sshppl.h ../sshcr.h ../sshserver.h \ - ../sshgssc.h ../sshgss.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../pgssapi.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssh2userauth-server.c - -sshaes.o: ../sshaes.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshaes.c - -ssharcf.o: ../ssharcf.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../ssharcf.c - -sshargon2.o: ../sshargon2.c ../putty.h ../ssh.h ../marshal.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshargon2.c - -sshauxcrypt.o: ../sshauxcrypt.c ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshauxcrypt.c - -sshbcrypt.o: ../sshbcrypt.c ../ssh.h ../sshblowf.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshbcrypt.c - -sshblake2.o: ../sshblake2.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshblake2.c - -sshblowf.o: ../sshblowf.c ../ssh.h ../sshblowf.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshblowf.c - -sshccp.o: ../sshccp.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshccp.c - -sshcommon.o: ../sshcommon.c ../putty.h ../mpint.h ../ssh.h ../sshbpp.h \ - ../sshppl.h ../sshchan.h ../sshttymodes.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcommon.c - -sshcrc.o: ../sshcrc.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcrc.c - -sshcrcda.o: ../sshcrcda.c ../misc.h ../ssh.h ../defs.h ../puttymem.h \ - ../marshal.h ../tree234.h ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshcrcda.c - -sshdes.o: ../sshdes.c ../ssh.h ../mpint_i.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdes.c - -sshdh.o: ../sshdh.c ../ssh.h ../misc.h ../mpint.h ../puttymem.h ../tree234.h \ - ../network.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdh.c - -sshdss.o: ../sshdss.c ../ssh.h ../mpint.h ../misc.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdss.c - -sshdssg.o: ../sshdssg.c ../misc.h ../ssh.h ../sshkeygen.h ../mpint.h \ - ../defs.h ../puttymem.h ../marshal.h ../tree234.h \ - ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshdssg.c - -sshecc.o: ../sshecc.c ../ssh.h ../mpint.h ../ecc.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshecc.c - -sshecdsag.o: ../sshecdsag.c ../ssh.h ../sshkeygen.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshecdsag.c - -sshgssc.o: ../sshgssc.c ../putty.h ../sshgssc.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../pgssapi.h ../sshgss.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshgssc.c - -sshhmac.o: ../sshhmac.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshhmac.c - -sshmac.o: ../sshmac.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshmac.c - -sshmd5.o: ../sshmd5.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshmd5.c - -sshprime.o: ../sshprime.c ../ssh.h ../mpint.h ../mpunsafe.h ../sshkeygen.h \ - ../puttymem.h ../tree234.h ../network.h ../misc.h \ - ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshprime.c - -sshprng.o: ../sshprng.c ../putty.h ../ssh.h ../mpint_i.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshprng.c - -sshpubk.o: ../sshpubk.c ../putty.h ../mpint.h ../ssh.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshpubk.c - -sshrand.o: ../sshrand.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrand.c - -sshrsa.o: ../sshrsa.c ../ssh.h ../mpint.h ../misc.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../defs.h \ - ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrsa.c - -sshrsag.o: ../sshrsag.c ../ssh.h ../sshkeygen.h ../mpint.h ../puttymem.h \ - ../tree234.h ../network.h ../misc.h ../sshttymodes.h \ - ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshrsag.c - -sshserver.o: ../sshserver.c ../putty.h ../ssh.h ../sshbpp.h ../sshppl.h \ - ../sshchan.h ../sshserver.h ../sshgssc.h ../sshgss.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../pgssapi.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshserver.c - -sshsh256.o: ../sshsh256.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsh256.c - -sshsh512.o: ../sshsh512.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsh512.c - -sshsha.o: ../sshsha.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsha.c - -sshsha3.o: ../sshsha3.c ../ssh.h ../puttymem.h ../tree234.h ../network.h \ - ../misc.h ../sshttymodes.h ../defs.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshsha3.c - -sshshare.o: ../sshshare.c ../putty.h ../tree234.h ../ssh.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshshare.c - -sshutils.o: ../sshutils.c ../putty.h ../ssh.h ../sshchan.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshutils.c - -sshverstring.o: ../sshverstring.c ../putty.h ../ssh.h ../sshbpp.h ../sshcr.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshverstring.c - -sshzlib.o: ../sshzlib.c ../defs.h ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../sshzlib.c - -stripctrl.o: ../stripctrl.c ../putty.h ../terminal.h ../misc.h ../marshal.h \ - ../defs.h ../puttyps.h ../network.h ../sshsignals.h \ - ../tree234.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../stripctrl.c - -supdup.o: ../supdup.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../supdup.c - -telnet.o: ../telnet.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../telnet.c - -terminal.o: ../terminal.c ../putty.h ../terminal.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../terminal.c - -testcrypt.o: ../testcrypt.c ../defs.h ../ssh.h ../sshkeygen.h ../misc.h \ - ../mpint.h ../ecc.h ../testcrypt.h ../puttymem.h \ - ../tree234.h ../network.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testcrypt.c - -testsc.o: ../testsc.c ../defs.h ../putty.h ../ssh.h ../misc.h ../mpint.h \ - ../ecc.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testsc.c - -testzlib.o: ../testzlib.c ../defs.h ../ssh.h ../puttymem.h ../tree234.h \ - ../network.h ../misc.h ../sshttymodes.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../testzlib.c - -time.o: ../time.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../time.c - -timing.o: ../timing.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../timing.c - -toucs.o: ../charset/toucs.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/toucs.c - -tree234.o: ../tree234.c ../defs.h ../tree234.h ../puttymem.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../tree234.c - -utf8.o: ../charset/utf8.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/utf8.c - -utils.o: ../utils.c ../defs.h ../misc.h ../ssh.h ../puttymem.h ../marshal.h \ - ../tree234.h ../network.h ../sshttymodes.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../utils.c - -ux_x11.o: ../unix/ux_x11.c ../putty.h ../ssh.h ../network.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/ux_x11.c - -uxagentc.o: ../unix/uxagentc.c ../putty.h ../misc.h ../tree234.h \ - ../puttymem.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxagentc.c - -uxagentsock.o: ../unix/uxagentsock.c ../putty.h ../ssh.h ../misc.h \ - ../pageant.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxagentsock.c - -uxcfg.o: ../unix/uxcfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcfg.c - -uxcliloop.o: ../unix/uxcliloop.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcliloop.c - -uxcons.o: ../unix/uxcons.c ../putty.h ../storage.h ../ssh.h ../console.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxcons.c - -uxfdsock.o: ../unix/uxfdsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxfdsock.c - -uxgen.o: ../unix/uxgen.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxgen.c - -uxgss.o: ../unix/uxgss.c ../putty.h ../pgssapi.h ../sshgss.h ../sshgssc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxgss.c - -uxmisc.o: ../unix/uxmisc.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxmisc.c - -uxnet.o: ../unix/uxnet.c ../putty.h ../network.h ../tree234.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnet.c - -uxnogtk.o: ../unix/uxnogtk.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnogtk.c - -uxnoise.o: ../unix/uxnoise.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxnoise.c - -uxpeer.o: ../unix/uxpeer.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpeer.c - -uxpgnt.o: ../unix/uxpgnt.c ../putty.h ../ssh.h ../misc.h ../pageant.h \ - ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpgnt.c - -uxplink.o: ../unix/uxplink.c ../putty.h ../ssh.h ../storage.h ../tree234.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxplink.c - -uxpoll.o: ../unix/uxpoll.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpoll.c - -uxprint.o: ../unix/uxprint.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxprint.c - -uxproxy.o: ../unix/uxproxy.c ../tree234.h ../putty.h ../network.h ../proxy.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxproxy.c - -uxpsusan.o: ../unix/uxpsusan.c ../putty.h ../mpint.h ../ssh.h ../sshserver.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpsusan.c - -uxpterm.o: ../unix/uxpterm.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpterm.c - -uxpty.o: ../unix/uxpty.c ../putty.h ../ssh.h ../sshserver.h ../tree234.h \ - ../sshttymodes.h ../sshsignals.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxpty.c - -uxputty.o: ../unix/uxputty.c ../putty.h ../ssh.h ../storage.h \ - ../unix/gtkcompat.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxputty.c - -uxsel.o: ../unix/uxsel.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsel.c - -uxser.o: ../unix/uxser.c ../putty.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxser.c - -uxserver.o: ../unix/uxserver.c ../putty.h ../mpint.h ../ssh.h ../sshserver.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxserver.c - -uxsftp.o: ../unix/uxsftp.c ../putty.h ../ssh.h ../psftp.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsftp.c - -uxsftpserver.o: ../unix/uxsftpserver.c ../putty.h ../ssh.h ../sshserver.h \ - ../sftp.h ../tree234.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsftpserver.c - -uxshare.o: ../unix/uxshare.c ../tree234.h ../putty.h ../network.h ../proxy.h \ - ../ssh.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxshare.c - -uxsignal.o: ../unix/uxsignal.c ../defs.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsignal.c - -uxsocks.o: ../unix/uxsocks.c ../putty.h ../ssh.h ../psocks.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxsocks.c - -uxstore.o: ../unix/uxstore.c ../putty.h ../storage.h ../tree234.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxstore.c - -uxucs.o: ../unix/uxucs.c ../putty.h ../charset/charset.h ../terminal.h \ - ../misc.h ../defs.h ../puttyps.h ../network.h ../marshal.h \ - ../sshsignals.h ../tree234.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxucs.c - -uxutils.o: ../unix/uxutils.c ../putty.h ../ssh.h ../unix/uxutils.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/uxutils.c - -version.o: ../version.c ../putty.h ../ssh.h ../empty.h ../version.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../version.c - -wcwidth.o: ../wcwidth.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../wcwidth.c - -wildcard.o: ../wildcard.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../wildcard.c - -wincapi.o: ../windows/wincapi.c ../putty.h ../ssh.h ../windows/wincapi.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincapi.c - -wincfg.o: ../windows/wincfg.c ../putty.h ../dialog.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincfg.c - -wincliloop.o: ../windows/wincliloop.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincliloop.c - -wincons.o: ../windows/wincons.c ../putty.h ../storage.h ../ssh.h \ - ../console.h ../defs.h ../puttyps.h ../network.h ../misc.h \ - ../marshal.h ../sshsignals.h ../puttymem.h ../tree234.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wincons.c - -winctrls.o: ../windows/winctrls.c ../putty.h ../misc.h ../dialog.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winctrls.c - -windefs.o: ../windows/windefs.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/windefs.c - -windlg.o: ../windows/windlg.c ../putty.h ../ssh.h ../windows/win_res.h \ - ../windows/winseat.h ../storage.h ../dialog.h ../licence.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/windlg.c - -window.o: ../windows/window.c ../putty.h ../terminal.h ../storage.h \ - ../windows/win_res.h ../windows/winsecur.h \ - ../windows/winseat.h ../tree234.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/window.c - -wingss.o: ../windows/wingss.c ../putty.h ../pgssapi.h ../sshgss.h \ - ../sshgssc.h ../misc.h ../defs.h ../puttyps.h ../network.h \ - ../marshal.h ../sshsignals.h ../puttymem.h \ - ../windows/winstuff.h ../unix/unix.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wingss.c - -winhandl.o: ../windows/winhandl.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhandl.c - -winhelp.o: ../windows/winhelp.c ../putty.h ../windows/win_res.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhelp.c - -winhsock.o: ../windows/winhsock.c ../tree234.h ../putty.h ../network.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winhsock.c - -winjump.o: ../windows/winjump.c ../putty.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winjump.c - -winmisc.o: ../windows/winmisc.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winmisc.c - -winmiscs.o: ../windows/winmiscs.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winmiscs.c - -winnet.o: ../windows/winnet.c ../putty.h ../network.h ../tree234.h ../ssh.h \ - ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnet.c - -winnohlp.o: ../windows/winnohlp.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnohlp.c - -winnoise.o: ../windows/winnoise.c ../putty.h ../ssh.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnoise.c - -winnojmp.o: ../windows/winnojmp.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnojmp.c - -winnpc.o: ../windows/winnpc.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnpc.c - -winnps.o: ../windows/winnps.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winnps.c - -winpgen.o: ../windows/winpgen.c ../putty.h ../ssh.h ../sshkeygen.h \ - ../licence.h ../windows/winsecur.h ../windows/puttygen-rc.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgen.c - -winpgnt.o: ../windows/winpgnt.c ../putty.h ../ssh.h ../misc.h ../tree234.h \ - ../windows/winsecur.h ../windows/wincapi.h ../pageant.h \ - ../licence.h ../windows/pageant-rc.h ../defs.h ../puttyps.h \ - ../network.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgnt.c - -winpgntc.o: ../windows/winpgntc.c ../putty.h ../pageant.h \ - ../windows/winsecur.h ../windows/wincapi.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winpgntc.c - -winplink.o: ../windows/winplink.c ../putty.h ../storage.h ../tree234.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winplink.c - -winprint.o: ../windows/winprint.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winprint.c - -winproxy.o: ../windows/winproxy.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../defs.h ../puttyps.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winproxy.c - -winsecur.o: ../windows/winsecur.c ../putty.h ../windows/winsecur.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsecur.c - -winselcli.o: ../windows/winselcli.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winselcli.c - -winselgui.o: ../windows/winselgui.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winselgui.c - -winser.o: ../windows/winser.c ../putty.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../windows/winstuff.h \ - ../unix/unix.h ../puttymem.h ../tree234.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winser.c - -winsftp.o: ../windows/winsftp.c ../putty.h ../psftp.h ../ssh.h \ - ../windows/winsecur.h ../defs.h ../puttyps.h ../network.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../tree234.h ../sshttymodes.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsftp.c - -winshare.o: ../windows/winshare.c ../tree234.h ../putty.h ../network.h \ - ../proxy.h ../ssh.h ../windows/wincapi.h \ - ../windows/winsecur.h ../noshare.c ../defs.h ../puttyps.h \ - ../misc.h ../marshal.h ../sshsignals.h ../puttymem.h \ - ../sshttymodes.h ../windows/winstuff.h ../unix/unix.h \ - ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winshare.c - -winsocks.o: ../windows/winsocks.c ../putty.h ../ssh.h ../psocks.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winsocks.c - -winstore.o: ../windows/winstore.c ../putty.h ../storage.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winstore.c - -wintime.o: ../windows/wintime.c ../putty.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../windows/winstuff.h ../unix/unix.h ../puttymem.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/wintime.c - -winucs.o: ../windows/winucs.c ../putty.h ../terminal.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../tree234.h ../puttymem.h ../windows/winstuff.h \ - ../unix/unix.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winucs.c - -winutils.o: ../windows/winutils.c ../putty.h ../misc.h ../defs.h \ - ../puttyps.h ../network.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../windows/winstuff.h ../unix/unix.h \ - ../tree234.h ../windows/winhelp.h ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winutils.c - -winx11.o: ../windows/winx11.c ../putty.h ../ssh.h ../defs.h ../puttyps.h \ - ../network.h ../misc.h ../marshal.h ../sshsignals.h \ - ../puttymem.h ../tree234.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../windows/winx11.c - -x11fwd.o: ../x11fwd.c ../putty.h ../ssh.h ../sshchan.h ../tree234.h \ - ../defs.h ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../puttymem.h ../sshttymodes.h \ - ../windows/winstuff.h ../unix/unix.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../x11fwd.c - -x11misc.o: ../unix/x11misc.c ../putty.h ../unix/x11misc.h ../defs.h \ - ../puttyps.h ../network.h ../misc.h ../marshal.h \ - ../sshsignals.h ../windows/winstuff.h ../unix/unix.h \ - ../puttymem.h ../tree234.h ../windows/winhelp.h \ - ../charset/charset.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/x11misc.c - -xenc.o: ../charset/xenc.c ../charset/charset.h ../charset/internal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../charset/xenc.c - -xkeysym.o: ../unix/xkeysym.c ../misc.h ../defs.h ../puttymem.h ../marshal.h - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xkeysym.c - -xpmptcfg.o: ../unix/xpmptcfg.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmptcfg.c - -xpmpterm.o: ../unix/xpmpterm.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmpterm.c - -xpmpucfg.o: ../unix/xpmpucfg.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmpucfg.c - -xpmputty.o: ../unix/xpmputty.c - $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmputty.c - - - -clean: - rm -f *.o *.exe *.res.o *.so *.map - -FORCE: diff --git a/code/windows/Makefile.vc b/code/windows/Makefile.vc deleted file mode 100644 index aca3a7e..0000000 --- a/code/windows/Makefile.vc +++ /dev/null @@ -1,1831 +0,0 @@ -# Makefile for putty under Visual C. -# -# This file was created by `mkfiles.pl' from the `Recipe' file. -# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead. -# -# Extra options you can set: -# -# - COMPAT=/DAUTO_WINSOCK (Windows only) -# Causes PuTTY to assume that includes its own WinSock -# header file, so that it won't try to include . -# -# - COMPAT=/DWINSOCK_TWO (Windows only) -# Causes the PuTTY utilities to include instead of -# , except Plink which _needs_ WinSock 2 so it already -# does this. -# -# - COMPAT=/DNO_SECURITY (Windows only) -# Disables use of , which is not available with some -# development environments (such as very old versions of the -# mingw/Cygwin GNU toolchain). This has the following effects: -# - Pageant won't care about the local user ID of processes -# accessing it; a version of Pageant built with this option -# will therefore refuse to run under NT-series OSes on -# security grounds (although it will run fine on Win95-series -# OSes where there is no access control anyway). -# - SSH connection sharing is disabled. -# - There is no support for restriction of the process ACLs. -# -# - COMPAT=/DNO_MULTIMON (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. This means that PuTTY's -# full-screen mode (configurable to work on Alt-Enter) will -# not behave usefully in a multi-monitor environment. -# -# - COMPAT=/DNO_HTMLHELP (Windows only) -# Disables PuTTY's use of , which is not available -# with some development environments. -# -# If you don't have this header, you may be able to use the copy -# supplied with HTML Help Workshop. -# -# - RCFL=/DNO_MANIFESTS (Windows only) -# Disables inclusion of XML application manifests in the PuTTY -# binaries. This may be necessary to build for 64-bit Windows; -# the manifests are only included to use the XP GUI style on -# Windows XP, and the architecture tags are a lie on 64-bit. -# -# - COMPAT=/DNO_IPV6 -# Disables PuTTY's ability to make IPv6 connections, enabling -# it to compile under development environments which do not -# support IPv6 in their header files. -# -# - COMPAT=/DNO_GSSAPI -# Disables PuTTY's ability to use GSSAPI functions for -# authentication and key exchange. -# -# - COMPAT=/DSTATIC_GSSAPI -# Causes PuTTY to try to link statically against the GSSAPI -# library instead of the default of doing it at run time. -# -# - COMPAT=/DMSVC4 (Windows only) -# - RCFL=/DMSVC4 -# Makes a couple of minor changes so that PuTTY compiles using -# MSVC 4. You will also need /DNO_SECURITY and /DNO_MULTIMON. -# -# - COMPAT=/DNO_SECUREZEROMEMORY (Windows only) -# Disables PuTTY's use of SecureZeroMemory(), which is missing -# from some environments' header files. -# -# - XFLAGS=/DDEBUG -# Causes PuTTY to enable internal debugging. -# -# - XFLAGS=/DMALLOC_LOG -# Causes PuTTY to emit a file called putty_mem.log, logging every -# memory allocation and free, so you can track memory leaks. -# -# - XFLAGS=/DMINEFIELD (Windows only) -# Causes PuTTY to use a custom memory allocator, similar in -# concept to Electric Fence, in place of regular malloc(). Wastes -# huge amounts of RAM, but should cause heap-corruption bugs to -# show up as GPFs at the point of failure rather than appearing -# later on as second-level damage. -# -# - XFLAGS=/DFUZZING -# Builds a version of PuTTY with some tweaks to make fuzz testing -# easier: the SSH random number generator is replaced by one that -# always returns the same thing. Note that this makes SSH -# completely insecure -- a FUZZING build should never be used to -# connect to a real server. - -# If you rename this file to `Makefile', you should change this line, -# so that the .rsp files still depend on the correct makefile. -MAKEFILE = Makefile.vc - -# C compilation flags -CFLAGS = /nologo /W3 /O1 -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 /D_CRT_SECURE_NO_WARNINGS /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -LFLAGS = /incremental:no /dynamicbase /nxcompat -RCFLAGS = -I..\./ -I..\charset/ -I..\windows/ -I..\unix/ -DWIN32 -D_WIN32 -DWINVER=0x0400 - -CFLAGS = $(CFLAGS) /DHAS_GSSAPI - - -all: $(BUILDDIR)pageant.exe $(BUILDDIR)plink.exe $(BUILDDIR)pscp.exe \ - $(BUILDDIR)psftp.exe $(BUILDDIR)psocks.exe \ - $(BUILDDIR)putty.exe $(BUILDDIR)puttygen.exe \ - $(BUILDDIR)puttytel.exe $(BUILDDIR)testcrypt.exe - -$(BUILDDIR)pageant.exe: $(BUILDDIR)aqsync.obj $(BUILDDIR)be_misc.obj \ - $(BUILDDIR)callback.obj $(BUILDDIR)conf.obj \ - $(BUILDDIR)ecc.obj $(BUILDDIR)errsock.obj \ - $(BUILDDIR)marshal.obj $(BUILDDIR)memory.obj \ - $(BUILDDIR)misc.obj $(BUILDDIR)mpint.obj \ - $(BUILDDIR)pageant.obj $(BUILDDIR)pageant.res \ - $(BUILDDIR)sshaes.obj $(BUILDDIR)sshargon2.obj \ - $(BUILDDIR)sshauxcrypt.obj $(BUILDDIR)sshblake2.obj \ - $(BUILDDIR)sshdes.obj $(BUILDDIR)sshdss.obj \ - $(BUILDDIR)sshecc.obj $(BUILDDIR)sshhmac.obj \ - $(BUILDDIR)sshmd5.obj $(BUILDDIR)sshpubk.obj \ - $(BUILDDIR)sshrsa.obj $(BUILDDIR)sshsh256.obj \ - $(BUILDDIR)sshsh512.obj $(BUILDDIR)sshsha.obj \ - $(BUILDDIR)sshsha3.obj $(BUILDDIR)stripctrl.obj \ - $(BUILDDIR)tree234.obj $(BUILDDIR)utils.obj \ - $(BUILDDIR)version.obj $(BUILDDIR)wcwidth.obj \ - $(BUILDDIR)wincapi.obj $(BUILDDIR)winhandl.obj \ - $(BUILDDIR)winhelp.obj $(BUILDDIR)winhsock.obj \ - $(BUILDDIR)winmisc.obj $(BUILDDIR)winmiscs.obj \ - $(BUILDDIR)winnet.obj $(BUILDDIR)winnpc.obj \ - $(BUILDDIR)winnps.obj $(BUILDDIR)winpgnt.obj \ - $(BUILDDIR)winpgntc.obj $(BUILDDIR)winsecur.obj \ - $(BUILDDIR)winselgui.obj $(BUILDDIR)winutils.obj - type < - - - - Debug - Win32 - - - Release - Win32 - - - - - - {27e8f930-2567-4fdc-82c1-0662af3cdf6d} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\pageant.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pageant.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\pageant.bsc - - - true - Windows - .\Release\pageant.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\pageant.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pageant.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\pageant.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/pageant/pageant.vcxproj.filters b/code/windows/VS2010/pageant/pageant.vcxproj.filters deleted file mode 100644 index b4c90c0..0000000 --- a/code/windows/VS2010/pageant/pageant.vcxproj.filters +++ /dev/null @@ -1,181 +0,0 @@ - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {700cfdc0-1885-4a48-9760-6fd8f3f62b09} - - - {25d39962-0c67-4b83-a85f-ca32bded1354} - - - {f84c3ab7-54fe-48c4-be65-5115ae325892} - - - \ No newline at end of file diff --git a/code/windows/VS2010/plink/plink.vcxproj b/code/windows/VS2010/plink/plink.vcxproj deleted file mode 100644 index 333d7dd..0000000 --- a/code/windows/VS2010/plink/plink.vcxproj +++ /dev/null @@ -1,298 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {4478087b-1dc8-4c3e-b624-13661de1947e} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\plink.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\plink.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\plink.bsc - - - true - Console - .\Release\plink.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\plink.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\plink.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\plink.bsc - - - true - true - Console - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/plink/plink.vcxproj.filters b/code/windows/VS2010/plink/plink.vcxproj.filters deleted file mode 100644 index 6fb770c..0000000 --- a/code/windows/VS2010/plink/plink.vcxproj.filters +++ /dev/null @@ -1,336 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {cabf3930-a192-46fa-9d0b-c12a3c48fb64} - - - {211b9eeb-2f7b-4f17-ba17-7fa34bd6d53f} - - - {7398cce3-d4c6-47d7-8876-968d1b521c8d} - - - \ No newline at end of file diff --git a/code/windows/VS2010/pscp/pscp.vcxproj b/code/windows/VS2010/pscp/pscp.vcxproj deleted file mode 100644 index c8bc0e1..0000000 --- a/code/windows/VS2010/pscp/pscp.vcxproj +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {26d200f3-250a-494f-aaa4-c992ec4345aa} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\pscp.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pscp.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\pscp.bsc - - - true - Console - .\Release\pscp.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\pscp.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pscp.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\pscp.bsc - - - true - true - Console - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/pscp/pscp.vcxproj.filters b/code/windows/VS2010/pscp/pscp.vcxproj.filters deleted file mode 100644 index c14db17..0000000 --- a/code/windows/VS2010/pscp/pscp.vcxproj.filters +++ /dev/null @@ -1,328 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {22ad16c0-10f2-4c9e-88ce-19909db06db1} - - - {1939563c-d990-4021-aabb-fe01df059ed9} - - - {a470e852-120c-47b4-8b4b-2caf18dec71c} - - - \ No newline at end of file diff --git a/code/windows/VS2010/psftp/psftp.vcxproj b/code/windows/VS2010/psftp/psftp.vcxproj deleted file mode 100644 index 75bc871..0000000 --- a/code/windows/VS2010/psftp/psftp.vcxproj +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {3caa8123-13fe-450d-bfe7-fcda524d6830} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\psftp.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\psftp.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\psftp.bsc - - - true - Console - .\Release\psftp.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\psftp.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\psftp.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\psftp.bsc - - - true - true - Console - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/psftp/psftp.vcxproj.filters b/code/windows/VS2010/psftp/psftp.vcxproj.filters deleted file mode 100644 index 0de5965..0000000 --- a/code/windows/VS2010/psftp/psftp.vcxproj.filters +++ /dev/null @@ -1,328 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {156ce40f-dc1b-4721-b08f-6336b9f4d290} - - - {198936a4-3dd8-46c7-8266-b3a081e1e0fc} - - - {a85261db-1733-4f46-b1b9-cf01dd3da697} - - - \ No newline at end of file diff --git a/code/windows/VS2010/putty.sln b/code/windows/VS2010/putty.sln deleted file mode 100644 index bff24d1..0000000 --- a/code/windows/VS2010/putty.sln +++ /dev/null @@ -1,67 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pageant", "pageant\pageant.vcxproj", "{27e8f930-2567-4fdc-82c1-0662af3cdf6d}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plink", "plink\plink.vcxproj", "{4478087b-1dc8-4c3e-b624-13661de1947e}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pscp", "pscp\pscp.vcxproj", "{26d200f3-250a-494f-aaa4-c992ec4345aa}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psftp", "psftp\psftp.vcxproj", "{3caa8123-13fe-450d-bfe7-fcda524d6830}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psocks", "psocks\psocks.vcxproj", "{0ce7217e-7277-408e-add3-4e2f6072486e}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "putty", "putty\putty.vcxproj", "{8f44624a-d188-4188-b9aa-5f99f20723e1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "puttygen", "puttygen\puttygen.vcxproj", "{617b1bef-aa10-42b4-8f69-4c183bc1ec0f}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "puttytel", "puttytel\puttytel.vcxproj", "{b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcrypt", "testcrypt\testcrypt.vcxproj", "{232ff6d5-a626-4562-977c-2ab72baa29fd}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0ce7217e-7277-408e-add3-4e2f6072486e}.Debug|Win32.ActiveCfg = Debug|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Debug|Win32.Build.0 = Debug|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Release|Win32.ActiveCfg = Release|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Release|Win32.Build.0 = Release|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Debug|Win32.ActiveCfg = Debug|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Debug|Win32.Build.0 = Debug|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Release|Win32.ActiveCfg = Release|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Release|Win32.Build.0 = Release|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Debug|Win32.ActiveCfg = Debug|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Debug|Win32.Build.0 = Debug|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Release|Win32.ActiveCfg = Release|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Release|Win32.Build.0 = Release|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Debug|Win32.ActiveCfg = Debug|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Debug|Win32.Build.0 = Debug|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Release|Win32.ActiveCfg = Release|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Release|Win32.Build.0 = Release|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Debug|Win32.ActiveCfg = Debug|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Debug|Win32.Build.0 = Debug|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Release|Win32.ActiveCfg = Release|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Release|Win32.Build.0 = Release|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Debug|Win32.ActiveCfg = Debug|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Debug|Win32.Build.0 = Debug|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Release|Win32.ActiveCfg = Release|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Release|Win32.Build.0 = Release|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Debug|Win32.ActiveCfg = Debug|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Debug|Win32.Build.0 = Debug|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Release|Win32.ActiveCfg = Release|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Release|Win32.Build.0 = Release|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Debug|Win32.ActiveCfg = Debug|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Debug|Win32.Build.0 = Debug|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Release|Win32.ActiveCfg = Release|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Release|Win32.Build.0 = Release|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Debug|Win32.ActiveCfg = Debug|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Debug|Win32.Build.0 = Debug|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Release|Win32.ActiveCfg = Release|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/code/windows/VS2010/putty/putty.vcxproj b/code/windows/VS2010/putty/putty.vcxproj deleted file mode 100644 index b7e7502..0000000 --- a/code/windows/VS2010/putty/putty.vcxproj +++ /dev/null @@ -1,306 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {8f44624a-d188-4188-b9aa-5f99f20723e1} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\putty.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\putty.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\putty.bsc - - - true - Windows - .\Release\putty.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\putty.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\putty.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\putty.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/putty/putty.vcxproj.filters b/code/windows/VS2010/putty/putty.vcxproj.filters deleted file mode 100644 index 1bda6c9..0000000 --- a/code/windows/VS2010/putty/putty.vcxproj.filters +++ /dev/null @@ -1,353 +0,0 @@ - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {382c3c77-0fea-4132-a5ae-2550d8a5f395} - - - {8c940eae-8579-4a10-b1a1-bd19ff6e8c9c} - - - {e34b5d5d-ec5e-422e-9244-e7dd2783eead} - - - \ No newline at end of file diff --git a/code/windows/VS2010/puttygen/puttygen.vcxproj b/code/windows/VS2010/puttygen/puttygen.vcxproj deleted file mode 100644 index 2ed3102..0000000 --- a/code/windows/VS2010/puttygen/puttygen.vcxproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\puttygen.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttygen.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\puttygen.bsc - - - true - Windows - .\Release\puttygen.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\puttygen.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttygen.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\puttygen.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/puttygen/puttygen.vcxproj.filters b/code/windows/VS2010/puttygen/puttygen.vcxproj.filters deleted file mode 100644 index 5b6d168..0000000 --- a/code/windows/VS2010/puttygen/puttygen.vcxproj.filters +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {c7e8416f-274c-464e-9d2e-049a34f7e1ef} - - - {ea7fa817-a012-4ecd-8900-9d9896b44c96} - - - {1f675268-5bec-451b-b9c9-30ca628ac7d7} - - - \ No newline at end of file diff --git a/code/windows/VS2010/puttytel/puttytel.vcxproj b/code/windows/VS2010/puttytel/puttytel.vcxproj deleted file mode 100644 index 11ea9c8..0000000 --- a/code/windows/VS2010/puttytel/puttytel.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\puttytel.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttytel.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\puttytel.bsc - - - true - Windows - .\Release\puttytel.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\puttytel.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttytel.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\puttytel.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/puttytel/puttytel.vcxproj.filters b/code/windows/VS2010/puttytel/puttytel.vcxproj.filters deleted file mode 100644 index 7c0d2c5..0000000 --- a/code/windows/VS2010/puttytel/puttytel.vcxproj.filters +++ /dev/null @@ -1,201 +0,0 @@ - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {f8a8578e-e0a7-4047-85b7-4063a874d8f1} - - - {8e1311d1-7c8d-4ba8-bf25-a7d452a53090} - - - {02db3bf1-02b5-4667-b7f8-455e6493b006} - - - \ No newline at end of file diff --git a/code/windows/VS2010/testcrypt/testcrypt.vcxproj b/code/windows/VS2010/testcrypt/testcrypt.vcxproj deleted file mode 100644 index a21926a..0000000 --- a/code/windows/VS2010/testcrypt/testcrypt.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {232ff6d5-a626-4562-977c-2ab72baa29fd} - - - - Application - false - MultiByte - v100 - - - Application - false - MultiByte - v100 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\testcrypt.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\testcrypt.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\testcrypt.bsc - - - true - Console - .\Release\testcrypt.exe - ;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\testcrypt.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\testcrypt.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\testcrypt.bsc - - - true - true - Console - $(TargetPath) - ;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2010/testcrypt/testcrypt.vcxproj.filters b/code/windows/VS2010/testcrypt/testcrypt.vcxproj.filters deleted file mode 100644 index 937a8bc..0000000 --- a/code/windows/VS2010/testcrypt/testcrypt.vcxproj.filters +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {da1388df-79d3-4aa3-bb29-c40cd08b764d} - - - {b1161d2a-d615-4e3c-b4a4-790cdcd86977} - - - {d873d947-5884-4fb8-a70a-6a227fee257d} - - - \ No newline at end of file diff --git a/code/windows/VS2012/pageant/pageant.vcxproj b/code/windows/VS2012/pageant/pageant.vcxproj deleted file mode 100644 index e8db712..0000000 --- a/code/windows/VS2012/pageant/pageant.vcxproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {27e8f930-2567-4fdc-82c1-0662af3cdf6d} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\pageant.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pageant.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\pageant.bsc - - - true - Windows - .\Release\pageant.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\pageant.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pageant.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\pageant.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/pageant/pageant.vcxproj.filters b/code/windows/VS2012/pageant/pageant.vcxproj.filters deleted file mode 100644 index b4c90c0..0000000 --- a/code/windows/VS2012/pageant/pageant.vcxproj.filters +++ /dev/null @@ -1,181 +0,0 @@ - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {700cfdc0-1885-4a48-9760-6fd8f3f62b09} - - - {25d39962-0c67-4b83-a85f-ca32bded1354} - - - {f84c3ab7-54fe-48c4-be65-5115ae325892} - - - \ No newline at end of file diff --git a/code/windows/VS2012/plink/plink.vcxproj b/code/windows/VS2012/plink/plink.vcxproj deleted file mode 100644 index 462e4c6..0000000 --- a/code/windows/VS2012/plink/plink.vcxproj +++ /dev/null @@ -1,298 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {4478087b-1dc8-4c3e-b624-13661de1947e} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\plink.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\plink.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\plink.bsc - - - true - Console - .\Release\plink.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\plink.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\plink.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\plink.bsc - - - true - true - Console - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/plink/plink.vcxproj.filters b/code/windows/VS2012/plink/plink.vcxproj.filters deleted file mode 100644 index 6fb770c..0000000 --- a/code/windows/VS2012/plink/plink.vcxproj.filters +++ /dev/null @@ -1,336 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {cabf3930-a192-46fa-9d0b-c12a3c48fb64} - - - {211b9eeb-2f7b-4f17-ba17-7fa34bd6d53f} - - - {7398cce3-d4c6-47d7-8876-968d1b521c8d} - - - \ No newline at end of file diff --git a/code/windows/VS2012/pscp/pscp.vcxproj b/code/windows/VS2012/pscp/pscp.vcxproj deleted file mode 100644 index f3ecc86..0000000 --- a/code/windows/VS2012/pscp/pscp.vcxproj +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {26d200f3-250a-494f-aaa4-c992ec4345aa} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\pscp.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pscp.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\pscp.bsc - - - true - Console - .\Release\pscp.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\pscp.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pscp.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\pscp.bsc - - - true - true - Console - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/pscp/pscp.vcxproj.filters b/code/windows/VS2012/pscp/pscp.vcxproj.filters deleted file mode 100644 index c14db17..0000000 --- a/code/windows/VS2012/pscp/pscp.vcxproj.filters +++ /dev/null @@ -1,328 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {22ad16c0-10f2-4c9e-88ce-19909db06db1} - - - {1939563c-d990-4021-aabb-fe01df059ed9} - - - {a470e852-120c-47b4-8b4b-2caf18dec71c} - - - \ No newline at end of file diff --git a/code/windows/VS2012/psftp/psftp.vcxproj b/code/windows/VS2012/psftp/psftp.vcxproj deleted file mode 100644 index 6217b33..0000000 --- a/code/windows/VS2012/psftp/psftp.vcxproj +++ /dev/null @@ -1,294 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {3caa8123-13fe-450d-bfe7-fcda524d6830} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\psftp.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\psftp.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\psftp.bsc - - - true - Console - .\Release\psftp.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\psftp.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\psftp.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\psftp.bsc - - - true - true - Console - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/psftp/psftp.vcxproj.filters b/code/windows/VS2012/psftp/psftp.vcxproj.filters deleted file mode 100644 index 0de5965..0000000 --- a/code/windows/VS2012/psftp/psftp.vcxproj.filters +++ /dev/null @@ -1,328 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {156ce40f-dc1b-4721-b08f-6336b9f4d290} - - - {198936a4-3dd8-46c7-8266-b3a081e1e0fc} - - - {a85261db-1733-4f46-b1b9-cf01dd3da697} - - - \ No newline at end of file diff --git a/code/windows/VS2012/putty.sln b/code/windows/VS2012/putty.sln deleted file mode 100644 index aafd7a9..0000000 --- a/code/windows/VS2012/putty.sln +++ /dev/null @@ -1,67 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pageant", "pageant\pageant.vcxproj", "{27e8f930-2567-4fdc-82c1-0662af3cdf6d}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plink", "plink\plink.vcxproj", "{4478087b-1dc8-4c3e-b624-13661de1947e}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pscp", "pscp\pscp.vcxproj", "{26d200f3-250a-494f-aaa4-c992ec4345aa}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psftp", "psftp\psftp.vcxproj", "{3caa8123-13fe-450d-bfe7-fcda524d6830}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psocks", "psocks\psocks.vcxproj", "{0ce7217e-7277-408e-add3-4e2f6072486e}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "putty", "putty\putty.vcxproj", "{8f44624a-d188-4188-b9aa-5f99f20723e1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "puttygen", "puttygen\puttygen.vcxproj", "{617b1bef-aa10-42b4-8f69-4c183bc1ec0f}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "puttytel", "puttytel\puttytel.vcxproj", "{b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcrypt", "testcrypt\testcrypt.vcxproj", "{232ff6d5-a626-4562-977c-2ab72baa29fd}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Debug|Win32.ActiveCfg = Debug|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Debug|Win32.Build.0 = Debug|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Release|Win32.ActiveCfg = Release|Win32 - {26d200f3-250a-494f-aaa4-c992ec4345aa}.Release|Win32.Build.0 = Release|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Debug|Win32.ActiveCfg = Debug|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Debug|Win32.Build.0 = Debug|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Release|Win32.ActiveCfg = Release|Win32 - {3caa8123-13fe-450d-bfe7-fcda524d6830}.Release|Win32.Build.0 = Release|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Debug|Win32.ActiveCfg = Debug|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Debug|Win32.Build.0 = Debug|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Release|Win32.ActiveCfg = Release|Win32 - {0ce7217e-7277-408e-add3-4e2f6072486e}.Release|Win32.Build.0 = Release|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Debug|Win32.ActiveCfg = Debug|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Debug|Win32.Build.0 = Debug|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Release|Win32.ActiveCfg = Release|Win32 - {4478087b-1dc8-4c3e-b624-13661de1947e}.Release|Win32.Build.0 = Release|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Debug|Win32.ActiveCfg = Debug|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Debug|Win32.Build.0 = Debug|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Release|Win32.ActiveCfg = Release|Win32 - {232ff6d5-a626-4562-977c-2ab72baa29fd}.Release|Win32.Build.0 = Release|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Debug|Win32.ActiveCfg = Debug|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Debug|Win32.Build.0 = Debug|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Release|Win32.ActiveCfg = Release|Win32 - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f}.Release|Win32.Build.0 = Release|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Debug|Win32.ActiveCfg = Debug|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Debug|Win32.Build.0 = Debug|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Release|Win32.ActiveCfg = Release|Win32 - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130}.Release|Win32.Build.0 = Release|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Debug|Win32.ActiveCfg = Debug|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Debug|Win32.Build.0 = Debug|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Release|Win32.ActiveCfg = Release|Win32 - {27e8f930-2567-4fdc-82c1-0662af3cdf6d}.Release|Win32.Build.0 = Release|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Debug|Win32.ActiveCfg = Debug|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Debug|Win32.Build.0 = Debug|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Release|Win32.ActiveCfg = Release|Win32 - {8f44624a-d188-4188-b9aa-5f99f20723e1}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/code/windows/VS2012/putty/putty.vcxproj b/code/windows/VS2012/putty/putty.vcxproj deleted file mode 100644 index 3fe1255..0000000 --- a/code/windows/VS2012/putty/putty.vcxproj +++ /dev/null @@ -1,306 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {8f44624a-d188-4188-b9aa-5f99f20723e1} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\putty.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\putty.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\putty.bsc - - - true - Windows - .\Release\putty.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\putty.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\putty.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\putty.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/putty/putty.vcxproj.filters b/code/windows/VS2012/putty/putty.vcxproj.filters deleted file mode 100644 index 1bda6c9..0000000 --- a/code/windows/VS2012/putty/putty.vcxproj.filters +++ /dev/null @@ -1,353 +0,0 @@ - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {382c3c77-0fea-4132-a5ae-2550d8a5f395} - - - {8c940eae-8579-4a10-b1a1-bd19ff6e8c9c} - - - {e34b5d5d-ec5e-422e-9244-e7dd2783eead} - - - \ No newline at end of file diff --git a/code/windows/VS2012/puttygen/puttygen.vcxproj b/code/windows/VS2012/puttygen/puttygen.vcxproj deleted file mode 100644 index ac37a7d..0000000 --- a/code/windows/VS2012/puttygen/puttygen.vcxproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\puttygen.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttygen.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\puttygen.bsc - - - true - Windows - .\Release\puttygen.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\puttygen.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttygen.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\puttygen.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/puttygen/puttygen.vcxproj.filters b/code/windows/VS2012/puttygen/puttygen.vcxproj.filters deleted file mode 100644 index 5b6d168..0000000 --- a/code/windows/VS2012/puttygen/puttygen.vcxproj.filters +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {c7e8416f-274c-464e-9d2e-049a34f7e1ef} - - - {ea7fa817-a012-4ecd-8900-9d9896b44c96} - - - {1f675268-5bec-451b-b9c9-30ca628ac7d7} - - - \ No newline at end of file diff --git a/code/windows/VS2012/puttytel/puttytel.vcxproj b/code/windows/VS2012/puttytel/puttytel.vcxproj deleted file mode 100644 index c8d1c1a..0000000 --- a/code/windows/VS2012/puttytel/puttytel.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\puttytel.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttytel.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\puttytel.bsc - - - true - Windows - .\Release\puttytel.exe - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\puttytel.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttytel.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\puttytel.bsc - - - true - true - Windows - $(TargetPath) - advapi32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;%(AdditionalDependencies) - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/puttytel/puttytel.vcxproj.filters b/code/windows/VS2012/puttytel/puttytel.vcxproj.filters deleted file mode 100644 index 7c0d2c5..0000000 --- a/code/windows/VS2012/puttytel/puttytel.vcxproj.filters +++ /dev/null @@ -1,201 +0,0 @@ - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {f8a8578e-e0a7-4047-85b7-4063a874d8f1} - - - {8e1311d1-7c8d-4ba8-bf25-a7d452a53090} - - - {02db3bf1-02b5-4667-b7f8-455e6493b006} - - - \ No newline at end of file diff --git a/code/windows/VS2012/testcrypt/testcrypt.vcxproj b/code/windows/VS2012/testcrypt/testcrypt.vcxproj deleted file mode 100644 index 3979ac3..0000000 --- a/code/windows/VS2012/testcrypt/testcrypt.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {232ff6d5-a626-4562-977c-2ab72baa29fd} - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Release\ - .\Release\testcrypt.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\testcrypt.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\testcrypt.bsc - - - true - Console - .\Release\testcrypt.exe - ;%(AdditionalDependencies) - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - ProgramDatabase - ..\..\..\./;..\..\..\charset/;..\..\..\windows/;..\..\..\unix/;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\testcrypt.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\testcrypt.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\testcrypt.bsc - - - true - true - Console - $(TargetPath) - ;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2012/testcrypt/testcrypt.vcxproj.filters b/code/windows/VS2012/testcrypt/testcrypt.vcxproj.filters deleted file mode 100644 index 937a8bc..0000000 --- a/code/windows/VS2012/testcrypt/testcrypt.vcxproj.filters +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - Source Files - - - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - Header Files - - - - {da1388df-79d3-4aa3-bb29-c40cd08b764d} - - - {b1161d2a-d615-4e3c-b4a4-790cdcd86977} - - - {d873d947-5884-4fb8-a70a-6a227fee257d} - - - \ No newline at end of file diff --git a/code/windows/VS2022/pageant/pageant.vcxproj b/code/windows/VS2022/pageant/pageant.vcxproj deleted file mode 100644 index cae374c..0000000 --- a/code/windows/VS2022/pageant/pageant.vcxproj +++ /dev/null @@ -1,386 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {27e8f930-2567-4fdc-82c1-0662af3cdf6d} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pageant.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\pageant.bsc - - - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pageant.tlb - true - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\pageant.bsc - - - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pageant.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\pageant.bsc - - - true - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - $(TargetPath).manifest - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pageant.tlb - true - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\pageant.bsc - - - true - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/pageant/pageant.vcxproj.filters b/code/windows/VS2022/pageant/pageant.vcxproj.filters deleted file mode 100644 index 50de5f9..0000000 --- a/code/windows/VS2022/pageant/pageant.vcxproj.filters +++ /dev/null @@ -1,270 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - {68b7558d-92a2-4f07-b316-371934abfe53} - - - {7294135e-32c0-421e-a87d-f913ca051ca1} - - - {7131b624-6a00-4e0f-90e5-1b02cec1e8ac} - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/VS2022/plink/plink.vcxproj b/code/windows/VS2022/plink/plink.vcxproj deleted file mode 100644 index a7b42b8..0000000 --- a/code/windows/VS2022/plink/plink.vcxproj +++ /dev/null @@ -1,470 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {4478087b-1dc8-4c3e-b624-13661de1947e} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - true - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - true - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - true - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\plink.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\plink.bsc - - - true - Console - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\plink.tlb - true - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\plink.bsc - - - true - Console - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\plink.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\plink.bsc - - - true - true - Console - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\plink.tlb - true - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\plink.bsc - - - true - true - Console - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/plink/plink.vcxproj.filters b/code/windows/VS2022/plink/plink.vcxproj.filters deleted file mode 100644 index 585bda9..0000000 --- a/code/windows/VS2022/plink/plink.vcxproj.filters +++ /dev/null @@ -1,504 +0,0 @@ - - - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - - - {32728788-2863-4a6a-bfb1-a2dc08bc12f8} - - - - - {03e9ed14-510e-460b-b063-f91f0eb5a5e9} - - - {a36580fb-787b-4dfa-b2d9-c2196d41e9e6} - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/VS2022/pscp/pscp.vcxproj b/code/windows/VS2022/pscp/pscp.vcxproj deleted file mode 100644 index eb47d1d..0000000 --- a/code/windows/VS2022/pscp/pscp.vcxproj +++ /dev/null @@ -1,466 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {26d200f3-250a-494f-aaa4-c992ec4345aa} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - true - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - true - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - true - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pscp.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\pscp.bsc - - - true - Console - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\pscp.tlb - true - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\pscp.bsc - - - true - Console - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pscp.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\pscp.bsc - - - true - true - Console - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\pscp.tlb - true - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\pscp.bsc - - - true - true - Console - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/pscp/pscp.vcxproj.filters b/code/windows/VS2022/pscp/pscp.vcxproj.filters deleted file mode 100644 index d64eaec..0000000 --- a/code/windows/VS2022/pscp/pscp.vcxproj.filters +++ /dev/null @@ -1,492 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - {a8a48795-3e00-4707-b3cc-bc073153bcfb} - - - {cdb04f0f-b6eb-40f2-899a-f3272cc8d956} - - - {3a9a8e23-3b07-4424-9abb-ba61610a9e3b} - - - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/VS2022/psftp/psftp.vcxproj b/code/windows/VS2022/psftp/psftp.vcxproj deleted file mode 100644 index 8c1d0d3..0000000 --- a/code/windows/VS2022/psftp/psftp.vcxproj +++ /dev/null @@ -1,466 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {3caa8123-13fe-450d-bfe7-fcda524d6830} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - true - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - true - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - true - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - true - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\psftp.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\psftp.bsc - - - true - Console - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\psftp.tlb - true - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\psftp.bsc - - - true - Console - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\psftp.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\psftp.bsc - - - true - true - Console - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\psftp.tlb - true - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\psftp.bsc - - - true - true - Console - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/psftp/psftp.vcxproj.filters b/code/windows/VS2022/psftp/psftp.vcxproj.filters deleted file mode 100644 index 907694e..0000000 --- a/code/windows/VS2022/psftp/psftp.vcxproj.filters +++ /dev/null @@ -1,494 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Include Files - - - Include Files - - - Include Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Include Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - Include Files - - - - - {2c0280b4-e3ca-4982-bdb9-034f2f4c99b7} - - - - - {51973aaa-d654-4761-9e8f-c8efafe27d1d} - - - {7368b424-592b-4f28-927a-734464a01782} - - - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/VS2022/putty.sln b/code/windows/VS2022/putty.sln deleted file mode 100644 index 6836eda..0000000 --- a/code/windows/VS2022/putty.sln +++ /dev/null @@ -1,93 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.4 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pageant", "pageant\pageant.vcxproj", "{27E8F930-2567-4FDC-82C1-0662AF3CDF6D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plink", "plink\plink.vcxproj", "{4478087B-1DC8-4C3E-B624-13661DE1947E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pscp", "pscp\pscp.vcxproj", "{26D200F3-250A-494F-AAA4-C992EC4345AA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psftp", "psftp\psftp.vcxproj", "{3CAA8123-13FE-450D-BFE7-FCDA524D6830}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "putty", "putty\putty.vcxproj", "{8F44624A-D188-4188-B9AA-5F99F20723E1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "puttygen", "puttygen\puttygen.vcxproj", "{617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "puttytel", "puttytel\puttytel.vcxproj", "{B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Debug|x64.ActiveCfg = Debug|x64 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Debug|x64.Build.0 = Debug|x64 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Debug|x86.ActiveCfg = Debug|Win32 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Debug|x86.Build.0 = Debug|Win32 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Release|x64.ActiveCfg = Release|x64 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Release|x64.Build.0 = Release|x64 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Release|x86.ActiveCfg = Release|Win32 - {27E8F930-2567-4FDC-82C1-0662AF3CDF6D}.Release|x86.Build.0 = Release|Win32 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Debug|x64.ActiveCfg = Debug|x64 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Debug|x64.Build.0 = Debug|x64 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Debug|x86.ActiveCfg = Debug|Win32 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Debug|x86.Build.0 = Debug|Win32 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Release|x64.ActiveCfg = Release|x64 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Release|x64.Build.0 = Release|x64 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Release|x86.ActiveCfg = Release|Win32 - {4478087B-1DC8-4C3E-B624-13661DE1947E}.Release|x86.Build.0 = Release|Win32 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Debug|x64.ActiveCfg = Debug|x64 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Debug|x64.Build.0 = Debug|x64 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Debug|x86.ActiveCfg = Debug|Win32 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Debug|x86.Build.0 = Debug|Win32 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Release|x64.ActiveCfg = Release|x64 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Release|x64.Build.0 = Release|x64 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Release|x86.ActiveCfg = Release|Win32 - {26D200F3-250A-494F-AAA4-C992EC4345AA}.Release|x86.Build.0 = Release|Win32 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Debug|x64.ActiveCfg = Debug|x64 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Debug|x64.Build.0 = Debug|x64 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Debug|x86.ActiveCfg = Debug|Win32 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Debug|x86.Build.0 = Debug|Win32 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Release|x64.ActiveCfg = Release|x64 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Release|x64.Build.0 = Release|x64 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Release|x86.ActiveCfg = Release|Win32 - {3CAA8123-13FE-450D-BFE7-FCDA524D6830}.Release|x86.Build.0 = Release|Win32 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Debug|x64.ActiveCfg = Debug|x64 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Debug|x64.Build.0 = Debug|x64 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Debug|x86.ActiveCfg = Debug|Win32 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Debug|x86.Build.0 = Debug|Win32 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Release|x64.ActiveCfg = Release|x64 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Release|x64.Build.0 = Release|x64 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Release|x86.ActiveCfg = Release|Win32 - {8F44624A-D188-4188-B9AA-5F99F20723E1}.Release|x86.Build.0 = Release|Win32 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Debug|x64.ActiveCfg = Debug|x64 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Debug|x64.Build.0 = Debug|x64 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Debug|x86.ActiveCfg = Debug|Win32 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Debug|x86.Build.0 = Debug|Win32 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Release|x64.ActiveCfg = Release|x64 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Release|x64.Build.0 = Release|x64 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Release|x86.ActiveCfg = Release|Win32 - {617B1BEF-AA10-42B4-8F69-4C183BC1EC0F}.Release|x86.Build.0 = Release|Win32 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Debug|x64.ActiveCfg = Debug|x64 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Debug|x64.Build.0 = Debug|x64 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Debug|x86.ActiveCfg = Debug|Win32 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Debug|x86.Build.0 = Debug|Win32 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Release|x64.ActiveCfg = Release|x64 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Release|x64.Build.0 = Release|x64 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Release|x86.ActiveCfg = Release|Win32 - {B7DD98FF-B336-4D23-9C07-E5FA7A9F3130}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AB4548F5-BD74-4E9C-995C-83E24D06CD19} - EndGlobalSection - GlobalSection(Performance) = preSolution - HasPerformanceSessions = true - EndGlobalSection -EndGlobal diff --git a/code/windows/VS2022/putty/putty.vcxproj b/code/windows/VS2022/putty/putty.vcxproj deleted file mode 100644 index 18b883c..0000000 --- a/code/windows/VS2022/putty/putty.vcxproj +++ /dev/null @@ -1,472 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {8f44624a-d188-4188-b9aa-5f99f20723e1} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\putty.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\putty.bsc - - - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - true - None - false - true - PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - $(IntDir)\%(Filename)%(Extension).obj - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\putty.tlb - true - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\putty.bsc - - - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\putty.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\putty.bsc - - - true - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - $(TargetPath).manifest - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - $(IntDir)\%(Filename)%(Extension).obj - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\putty.tlb - true - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\putty.bsc - - - true - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - - - $(TargetPath).manifest - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/putty/putty.vcxproj.filters b/code/windows/VS2022/putty/putty.vcxproj.filters deleted file mode 100644 index 49af99e..0000000 --- a/code/windows/VS2022/putty/putty.vcxproj.filters +++ /dev/null @@ -1,530 +0,0 @@ - - - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - {65403b0a-d3ba-4e30-935a-b7c45ff1008d} - - - - - {cd045bf3-042f-48a4-8dac-edb149ee97c4} - - - - - {46d4bba4-f57a-4d94-bd23-e669bf09ec69} - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/VS2022/puttygen/puttygen.vcxproj b/code/windows/VS2022/puttygen/puttygen.vcxproj deleted file mode 100644 index eda6e8f..0000000 --- a/code/windows/VS2022/puttygen/puttygen.vcxproj +++ /dev/null @@ -1,388 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {617b1bef-aa10-42b4-8f69-4c183bc1ec0f} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttygen.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\puttygen.bsc - - - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - PUTTY_CAC;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttygen.tlb - true - - - 0x0409 - PUTTY_CAC;NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\puttygen.bsc - - - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttygen.tlb - true - Win32 - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\puttygen.bsc - - - true - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - $(TargetPath).manifest - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - PUTTY_CAC;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttygen.tlb - true - - - 0x0409 - PUTTY_CAC;_DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\puttygen.bsc - - - true - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - $(TargetPath).manifest - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/puttygen/puttygen.vcxproj.filters b/code/windows/VS2022/puttygen/puttygen.vcxproj.filters deleted file mode 100644 index c75899c..0000000 --- a/code/windows/VS2022/puttygen/puttygen.vcxproj.filters +++ /dev/null @@ -1,280 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - {53ccdbdd-0759-43f9-aa36-75c9a5dc3c6f} - - - {1e935ee6-ae52-4987-9ad0-3ef25e76029b} - - - {9cb2e0ad-78b1-447a-87cd-8b3d8db452e5} - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/VS2022/puttytel/puttytel.vcxproj b/code/windows/VS2022/puttytel/puttytel.vcxproj deleted file mode 100644 index f2d7401..0000000 --- a/code/windows/VS2022/puttytel/puttytel.vcxproj +++ /dev/null @@ -1,395 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - {b7dd98ff-b336-4d23-9c07-e5fa7a9f3130} - 10.0 - - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - - - Application - false - MultiByte - v143 - true - - - - - Application - false - MultiByte - v143 - true - - - - - - - - - - - - - - - - - - - - - ..\..\..\..\binaries\x86\ - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - ..\..\..\..\binaries\x86\ - true - $(ProjectDir)\Temp\$(Configuration)\x86\ - false - - - false - ..\..\..\..\binaries\x64\ - $(ProjectDir)\Temp\$(Configuration)\x64\ - false - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttytel.tlb - true - Win32 - - - 0x0409 - NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\puttytel.bsc - - - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - $(TargetPath).manifest - - - - - MultiThreaded - OnlyExplicitInline - true - true - MaxSpeed - true - Level3 - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - $(IntDir)\%(Filename)%(Extension).obj - true - None - false - true - NDEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - 4018;4267;4244;4201;4204;4221;4098 - - true - CompileAsC - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\puttytel.tlb - true - - - 0x0409 - NDEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Release\puttytel.bsc - - - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - gdi32.lib;comctl32.lib;imm32.lib;winmm.lib;%(AdditionalDependencies) - false - - - true - true - UseLinkTimeCodeGeneration - - - $(TargetPath).manifest - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttytel.tlb - true - Win32 - - - 0x0409 - _DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\puttytel.bsc - - - true - true - Windows - ..\..\..\..\binaries\x86\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - $(TargetPath).manifest - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ..\..\..\;..\..\..\charset;..\..\..\windows;..\..\..\unix;..\..\..\cert;%(AdditionalIncludeDirectories) - _DEBUG;_WIN32_WINNT=_WIN32_WINNT_WIN6;WINVER=_WIN32_WINNT_WIN6;_WINDOWS;POSIX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - - - $(IntDir)\%(Filename)%(Extension).obj - EnableFastChecks - 4018;4267;4244;4201;4204;4221;4098 - CompileAsC - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\puttytel.tlb - true - - - 0x0409 - _DEBUG;%(PreprocessorDefinitions) - ..\..\..;..\..;..;..\..\..\cert - - - true - .\Debug\puttytel.bsc - - - true - true - Windows - ..\..\..\..\binaries\x64\$(TargetFileName) - advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;imm32.lib;ole32.lib;shell32.lib;user32.lib;winmm.lib;winspool.lib;%(AdditionalDependencies) - true - - - $(TargetPath).manifest - - - - - - - - - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - ..\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/windows/VS2022/puttytel/puttytel.vcxproj.filters b/code/windows/VS2022/puttytel/puttytel.vcxproj.filters deleted file mode 100644 index 5d3d719..0000000 --- a/code/windows/VS2022/puttytel/puttytel.vcxproj.filters +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - {2b0e1235-acbb-406b-9aab-7f499289a5bd} - - - {8aeda100-23b4-4cdc-800d-68234824fd36} - - - {99cc2e22-a125-4aa1-aac6-73fbbe2b975f} - - - - - Resource Files - - - \ No newline at end of file diff --git a/code/windows/winpgntc.c b/code/windows/agent-client.c similarity index 85% rename from code/windows/winpgntc.c rename to code/windows/agent-client.c index 15895d8..1183bff 100644 --- a/code/windows/winpgntc.c +++ b/code/windows/agent-client.c @@ -9,12 +9,8 @@ #include "putty.h" #include "pageant.h" /* for AGENT_MAX_MSGLEN */ -#ifndef NO_SECURITY -#include "winsecur.h" -#include "wincapi.h" -#endif - -#define AGENT_COPYDATA_ID 0x804e50ba /* random goop */ +#include "security-api.h" +#include "cryptoapi.h" static bool wm_copydata_agent_exists(void) { @@ -50,7 +46,6 @@ static void wm_copydata_agent_query(strbuf *query, void **out, int *outlen) mapname = dupprintf("PageantRequest%08x", (unsigned)GetCurrentThreadId()); psa = NULL; -#ifndef NO_SECURITY if (got_advapi()) { /* * Make the file mapping we create for communication with @@ -81,7 +76,6 @@ static void wm_copydata_agent_query(strbuf *query, void **out, int *outlen) } } } -#endif /* NO_SECURITY */ filemap = CreateFileMapping(INVALID_HANDLE_VALUE, psa, PAGE_READWRITE, 0, AGENT_MAX_MSGLEN, mapname); @@ -101,15 +95,7 @@ static void wm_copydata_agent_query(strbuf *query, void **out, int *outlen) * query is required to be synchronous) or CreateThread failed. * Either way, we need a synchronous request. */ -#ifdef PUTTY_CAC - HWND hCallingWindow = GetFocus(); - SetFocus(hwnd); - BringWindowToTop(hwnd); -#endif // PUTTY_CAC id = SendMessage(hwnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds); -#ifdef PUTTY_CAC - SetFocus(hCallingWindow); -#endif // PUTTY_CAC if (id > 0) { uint32_t length_field = GET_32BIT_MSB_FIRST(p); if (length_field > 0 && length_field <= AGENT_MAX_MSGLEN - 4) { @@ -137,19 +123,6 @@ static void wm_copydata_agent_query(strbuf *query, void **out, int *outlen) LocalFree(psd); } -#ifndef NO_SECURITY - -char *agent_named_pipe_name(void) -{ - char *username, *suffix, *pipename; - username = get_username(); - suffix = capi_obfuscate_string("Pageant"); - pipename = dupprintf("\\\\.\\pipe\\pageant.%s.%s", username, suffix); - sfree(username); - sfree(suffix); - return pipename; -} - Socket *agent_connect(Plug *plug) { char *pipename = agent_named_pipe_name(); @@ -318,39 +291,3 @@ agent_pending_query *agent_query( wm_copydata_agent_query(query, out, outlen); return NULL; } - -#else /* NO_SECURITY */ - -Socket *agent_connect(void *vctx, Plug *plug) -{ - unreachable("no agent_connect_ctx can be constructed on this platform"); -} - -agent_connect_ctx *agent_get_connect_ctx(void) -{ - return NULL; -} - -void agent_free_connect_ctx(agent_connect_ctx *ctx) -{ -} - -bool agent_exists(void) -{ - return wm_copydata_agent_exists(); -} - -agent_pending_query *agent_query( - strbuf *query, void **out, int *outlen, - void (*callback)(void *, void *, int), void *callback_ctx) -{ - wm_copydata_agent_query(query, out, outlen); - return NULL; -} - -void agent_cancel_query(agent_pending_query *q) -{ - unreachable("Windows agent queries are never asynchronous!"); -} - -#endif /* NO_SECURITY */ diff --git a/code/windows/wincliloop.c b/code/windows/cliloop.c similarity index 87% rename from code/windows/wincliloop.c rename to code/windows/cliloop.c index 26a4d3a..eced54c 100644 --- a/code/windows/wincliloop.c +++ b/code/windows/cliloop.c @@ -8,8 +8,6 @@ void cli_main_loop(cliloop_pre_t pre, cliloop_post_t post, void *ctx) now = GETTICKCOUNT(); while (true) { - int nhandles; - HANDLE *handles; DWORD n; DWORD ticks; @@ -34,25 +32,25 @@ void cli_main_loop(cliloop_pre_t pre, cliloop_post_t post, void *ctx) * get WAIT_TIMEOUT */ } - handles = handle_get_events(&nhandles); + HandleWaitList *hwl = get_handle_wait_list(); size_t winselcli_index = -(size_t)1; - size_t extra_base = nhandles; + size_t extra_base = hwl->nhandles; if (winselcli_event != INVALID_HANDLE_VALUE) { + assert(extra_base < MAXIMUM_WAIT_OBJECTS); winselcli_index = extra_base++; - handles = sresize(handles, extra_base, HANDLE); - handles[winselcli_index] = winselcli_event; + hwl->handles[winselcli_index] = winselcli_event; } size_t total_handles = extra_base + n_extra_handles; - handles = sresize(handles, total_handles, HANDLE); + assert(total_handles < MAXIMUM_WAIT_OBJECTS); for (size_t i = 0; i < n_extra_handles; i++) - handles[extra_base + i] = extra_handles[i]; + hwl->handles[extra_base + i] = extra_handles[i]; - n = WaitForMultipleObjects(total_handles, handles, false, ticks); + n = WaitForMultipleObjects(total_handles, hwl->handles, false, ticks); size_t extra_handle_index = n_extra_handles; - if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) { - handle_got_event(handles[n - WAIT_OBJECT_0]); + if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)hwl->nhandles) { + handle_wait_activate(hwl, n - WAIT_OBJECT_0); } else if (winselcli_event != INVALID_HANDLE_VALUE && n == WAIT_OBJECT_0 + winselcli_index) { WSANETWORKEVENTS things; @@ -122,7 +120,7 @@ void cli_main_loop(cliloop_pre_t pre, cliloop_post_t post, void *ctx) now = GETTICKCOUNT(); } - sfree(handles); + handle_wait_list_free(hwl); if (!post(ctx, extra_handle_index)) break; diff --git a/code/windows/wincfg.c b/code/windows/config.c similarity index 99% rename from code/windows/wincfg.c rename to code/windows/config.c index fab3240..9c107ed 100644 --- a/code/windows/wincfg.c +++ b/code/windows/config.c @@ -1,5 +1,5 @@ /* - * wincfg.c - the Windows-specific parts of the PuTTY configuration + * config.c - the Windows-specific parts of the PuTTY configuration * box. */ @@ -374,6 +374,8 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, bool has_help, c->radio.buttondata = sresize(c->radio.buttondata, c->radio.nbuttons, intorptr); c->radio.buttondata[c->radio.nbuttons-1] = I(PROXY_CMD); + if (c->radio.ncolumns < 4) + c->radio.ncolumns = 4; break; } } diff --git a/code/windows/conpty.c b/code/windows/conpty.c new file mode 100644 index 0000000..c23c81e --- /dev/null +++ b/code/windows/conpty.c @@ -0,0 +1,433 @@ +/* + * Backend to run a Windows console session using ConPTY. + */ + +#include +#include +#include + +#include "putty.h" + +#include +#include + +typedef struct ConPTY ConPTY; +struct ConPTY { + HPCON pseudoconsole; + HANDLE outpipe, inpipe, hprocess; + struct handle *out, *in; + HandleWait *subprocess; + bool exited; + DWORD exitstatus; + Seat *seat; + LogContext *logctx; + int bufsize; + Backend backend; +}; + +DECL_WINDOWS_FUNCTION(static, HRESULT, CreatePseudoConsole, + (COORD, HANDLE, HANDLE, DWORD, HPCON *)); +DECL_WINDOWS_FUNCTION(static, void, ClosePseudoConsole, (HPCON)); +DECL_WINDOWS_FUNCTION(static, HRESULT, ResizePseudoConsole, (HPCON, COORD)); + +static bool init_conpty_api(void) +{ + static bool tried = false; + if (!tried) { + tried = true; + HMODULE kernel32_module = load_system32_dll("kernel32.dll"); + GET_WINDOWS_FUNCTION(kernel32_module, CreatePseudoConsole); + GET_WINDOWS_FUNCTION(kernel32_module, ClosePseudoConsole); + GET_WINDOWS_FUNCTION(kernel32_module, ResizePseudoConsole); + } + + return (p_CreatePseudoConsole != NULL && + p_ClosePseudoConsole != NULL && + p_ResizePseudoConsole != NULL); +} + +static void conpty_terminate(ConPTY *conpty) +{ + if (conpty->out) { + handle_free(conpty->out); + conpty->out = NULL; + } + if (conpty->outpipe != INVALID_HANDLE_VALUE) { + CloseHandle(conpty->outpipe); + conpty->outpipe = INVALID_HANDLE_VALUE; + } + if (conpty->in) { + handle_free(conpty->in); + conpty->in = NULL; + } + if (conpty->inpipe != INVALID_HANDLE_VALUE) { + CloseHandle(conpty->inpipe); + conpty->inpipe = INVALID_HANDLE_VALUE; + } + if (conpty->subprocess) { + delete_handle_wait(conpty->subprocess); + conpty->subprocess = NULL; + conpty->hprocess = INVALID_HANDLE_VALUE; + } + if (conpty->pseudoconsole != INVALID_HANDLE_VALUE) { + p_ClosePseudoConsole(conpty->pseudoconsole); + conpty->pseudoconsole = INVALID_HANDLE_VALUE; + } +} + +static void conpty_process_wait_callback(void *vctx) +{ + ConPTY *conpty = (ConPTY *)vctx; + + if (!GetExitCodeProcess(conpty->hprocess, &conpty->exitstatus)) + return; + conpty->exited = true; + + /* + * We can stop waiting for the process now. + */ + if (conpty->subprocess) { + delete_handle_wait(conpty->subprocess); + conpty->subprocess = NULL; + conpty->hprocess = INVALID_HANDLE_VALUE; + } + + /* + * Once the contained process exits, close the pseudo-console as + * well. But don't close the pipes yet, since apparently + * ClosePseudoConsole can trigger a final bout of terminal output + * as things clean themselves up. + */ + if (conpty->pseudoconsole != INVALID_HANDLE_VALUE) { + p_ClosePseudoConsole(conpty->pseudoconsole); + conpty->pseudoconsole = INVALID_HANDLE_VALUE; + } +} + +static size_t conpty_gotdata( + struct handle *h, const void *data, size_t len, int err) +{ + ConPTY *conpty = (ConPTY *)handle_get_privdata(h); + if (err || len == 0) { + char *error_msg; + + conpty_terminate(conpty); + + seat_notify_remote_exit(conpty->seat); + + if (!err && conpty->exited) { + /* + * The clean-exit case: our subprocess terminated, we + * deleted the PseudoConsole ourself, and now we got the + * expected EOF on the pipe. + */ + return 0; + } + + if (err) + error_msg = dupprintf("Error reading from console pty: %s", + win_strerror(err)); + else + error_msg = dupprintf( + "Unexpected end of file reading from console pty"); + + logevent(conpty->logctx, error_msg); + seat_connection_fatal(conpty->seat, "%s", error_msg); + sfree(error_msg); + + return 0; + } else { + return seat_stdout(conpty->seat, data, len); + } +} + +static void conpty_sentdata(struct handle *h, size_t new_backlog, int err, + bool close) +{ + ConPTY *conpty = (ConPTY *)handle_get_privdata(h); + if (err) { + const char *error_msg = "Error writing to conpty device"; + + conpty_terminate(conpty); + + seat_notify_remote_exit(conpty->seat); + + logevent(conpty->logctx, error_msg); + + seat_connection_fatal(conpty->seat, "%s", error_msg); + } else { + conpty->bufsize = new_backlog; + } +} + +static char *conpty_init(const BackendVtable *vt, Seat *seat, + Backend **backend_handle, LogContext *logctx, + Conf *conf, const char *host, int port, + char **realhost, bool nodelay, bool keepalive) +{ + ConPTY *conpty; + char *err = NULL; + + HANDLE in_r = INVALID_HANDLE_VALUE; + HANDLE in_w = INVALID_HANDLE_VALUE; + HANDLE out_r = INVALID_HANDLE_VALUE; + HANDLE out_w = INVALID_HANDLE_VALUE; + + HPCON pcon; + bool pcon_needs_cleanup = false; + + STARTUPINFOEX si; + memset(&si, 0, sizeof(si)); + + if (!init_conpty_api()) { + err = dupprintf("Pseudo-console API is not available on this " + "Windows system"); + goto out; + } + + if (!CreatePipe(&in_r, &in_w, NULL, 0)) { + err = dupprintf("CreatePipe: %s", win_strerror(GetLastError())); + goto out; + } + if (!CreatePipe(&out_r, &out_w, NULL, 0)) { + err = dupprintf("CreatePipe: %s", win_strerror(GetLastError())); + goto out; + } + + COORD size; + size.X = conf_get_int(conf, CONF_width); + size.Y = conf_get_int(conf, CONF_height); + + HRESULT result = p_CreatePseudoConsole(size, in_r, out_w, 0, &pcon); + if (FAILED(result)) { + if (HRESULT_FACILITY(result) == FACILITY_WIN32) + err = dupprintf("CreatePseudoConsole: %s", + win_strerror(HRESULT_CODE(result))); + else + err = dupprintf("CreatePseudoConsole failed: HRESULT=0x%08x", + (unsigned)result); + goto out; + } + pcon_needs_cleanup = true; + + CloseHandle(in_r); + in_r = INVALID_HANDLE_VALUE; + CloseHandle(out_w); + out_w = INVALID_HANDLE_VALUE; + + si.StartupInfo.cb = sizeof(si); + + SIZE_T attrsize = 0; + InitializeProcThreadAttributeList(NULL, 1, 0, &attrsize); + si.lpAttributeList = smalloc(attrsize); + if (!InitializeProcThreadAttributeList( + si.lpAttributeList, 1, 0, &attrsize)) { + err = dupprintf("InitializeProcThreadAttributeList: %s", + win_strerror(GetLastError())); + goto out; + } + if (!UpdateProcThreadAttribute( + si.lpAttributeList, + 0, PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, + pcon, sizeof(pcon), NULL, NULL)) { + err = dupprintf("UpdateProcThreadAttribute: %s", + win_strerror(GetLastError())); + goto out; + } + + PROCESS_INFORMATION pi; + memset(&pi, 0, sizeof(pi)); + + char *command; + const char *conf_cmd = conf_get_str(conf, CONF_remote_cmd); + if (*conf_cmd) { + command = dupstr(conf_cmd); + } else { + command = dupcat(get_system_dir(), "\\cmd.exe"); + } + bool created_ok = CreateProcess(NULL, command, NULL, NULL, + false, EXTENDED_STARTUPINFO_PRESENT, + NULL, NULL, &si.StartupInfo, &pi); + sfree(command); + if (!created_ok) { + err = dupprintf("CreateProcess: %s", + win_strerror(GetLastError())); + goto out; + } + + /* No local authentication phase in this protocol */ + seat_set_trust_status(seat, false); + + conpty = snew(ConPTY); + memset(conpty, 0, sizeof(ConPTY)); + conpty->pseudoconsole = pcon; + pcon_needs_cleanup = false; + conpty->outpipe = in_w; + conpty->out = handle_output_new(in_w, conpty_sentdata, conpty, 0); + in_w = INVALID_HANDLE_VALUE; + conpty->inpipe = out_r; + conpty->in = handle_input_new(out_r, conpty_gotdata, conpty, 0); + out_r = INVALID_HANDLE_VALUE; + conpty->subprocess = add_handle_wait( + pi.hProcess, conpty_process_wait_callback, conpty); + conpty->hprocess = pi.hProcess; + CloseHandle(pi.hThread); + conpty->exited = false; + conpty->exitstatus = 0; + conpty->bufsize = 0; + conpty->backend.vt = vt; + *backend_handle = &conpty->backend; + + conpty->seat = seat; + conpty->logctx = logctx; + + *realhost = dupstr(""); + + /* + * Specials are always available. + */ + seat_update_specials_menu(conpty->seat); + + out: + if (in_r != INVALID_HANDLE_VALUE) + CloseHandle(in_r); + if (in_w != INVALID_HANDLE_VALUE) + CloseHandle(in_w); + if (out_r != INVALID_HANDLE_VALUE) + CloseHandle(out_r); + if (out_w != INVALID_HANDLE_VALUE) + CloseHandle(out_w); + if (pcon_needs_cleanup) + p_ClosePseudoConsole(pcon); + sfree(si.lpAttributeList); + return err; +} + +static void conpty_free(Backend *be) +{ + ConPTY *conpty = container_of(be, ConPTY, backend); + + conpty_terminate(conpty); + expire_timer_context(conpty); + sfree(conpty); +} + +static void conpty_reconfig(Backend *be, Conf *conf) +{ +} + +static void conpty_send(Backend *be, const char *buf, size_t len) +{ + ConPTY *conpty = container_of(be, ConPTY, backend); + + if (conpty->out == NULL) + return; + + conpty->bufsize = handle_write(conpty->out, buf, len); +} + +static size_t conpty_sendbuffer(Backend *be) +{ + ConPTY *conpty = container_of(be, ConPTY, backend); + return conpty->bufsize; +} + +static void conpty_size(Backend *be, int width, int height) +{ + ConPTY *conpty = container_of(be, ConPTY, backend); + COORD size; + size.X = width; + size.Y = height; + p_ResizePseudoConsole(conpty->pseudoconsole, size); +} + +static void conpty_special(Backend *be, SessionSpecialCode code, int arg) +{ +} + +static const SessionSpecial *conpty_get_specials(Backend *be) +{ + static const SessionSpecial specials[] = { + {NULL, SS_EXITMENU} + }; + return specials; +} + +static bool conpty_connected(Backend *be) +{ + return true; /* always connected */ +} + +static bool conpty_sendok(Backend *be) +{ + return true; +} + +static void conpty_unthrottle(Backend *be, size_t backlog) +{ + ConPTY *conpty = container_of(be, ConPTY, backend); + if (conpty->in) + handle_unthrottle(conpty->in, backlog); +} + +static bool conpty_ldisc(Backend *be, int option) +{ + return false; +} + +static void conpty_provide_ldisc(Backend *be, Ldisc *ldisc) +{ +} + +static int conpty_exitcode(Backend *be) +{ + ConPTY *conpty = container_of(be, ConPTY, backend); + + if (conpty->exited) { + /* + * PuTTY's representation of exit statuses expects them to be + * non-negative 'int' values. But Windows exit statuses can + * include all those exception codes like 0xC000001D which + * convert to negative 32-bit ints. + * + * I don't think there's a great deal of use for returning + * those in full detail, right now. (Though if we ever + * connected this system up to a Windows version of psusan or + * Uppity, perhaps there might be?) + * + * So we clip them at INT_MAX-1, since INT_MAX is reserved for + * 'exit so unclean as to inhibit Close On Clean Exit'. + */ + return (0 <= conpty->exitstatus && conpty->exitstatus < INT_MAX) ? + conpty->exitstatus : INT_MAX-1; + } else { + return -1; + } +} + +static int conpty_cfg_info(Backend *be) +{ + return 0; +} + +const BackendVtable conpty_backend = { + .init = conpty_init, + .free = conpty_free, + .reconfig = conpty_reconfig, + .send = conpty_send, + .sendbuffer = conpty_sendbuffer, + .size = conpty_size, + .special = conpty_special, + .get_specials = conpty_get_specials, + .connected = conpty_connected, + .exitcode = conpty_exitcode, + .sendok = conpty_sendok, + .ldisc_option_state = conpty_ldisc, + .provide_ldisc = conpty_provide_ldisc, + .unthrottle = conpty_unthrottle, + .cfg_info = conpty_cfg_info, + .id = "conpty", + .displayname_tc = "ConPTY", + .displayname_lc = "ConPTY", /* proper name, so capitalise it anyway */ + .protocol = -1, +}; diff --git a/code/windows/wincons.c b/code/windows/console.c similarity index 80% rename from code/windows/wincons.c rename to code/windows/console.c index 414167b..81ab7d0 100644 --- a/code/windows/wincons.c +++ b/code/windows/console.c @@ -1,5 +1,5 @@ /* - * wincons.c - various interactive-prompt routines shared between + * console.c - various interactive-prompt routines shared between * the Windows console PuTTY tools */ @@ -32,43 +32,39 @@ void console_print_error_msg(const char *prefix, const char *msg) fflush(stderr); } -int console_verify_ssh_host_key( +SeatPromptResult console_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **fingerprints, - void (*callback)(void *ctx, int result), void *ctx) + char *keystr, const char *keydisp, char **fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { - int ret; HANDLE hin; DWORD savemode, i; - const char *common_fmt, *intro, *prompt; + char *common; + const char *intro, *prompt; char line[32]; - /* - * Verify the key against the registry. - */ - ret = verify_host_key(host, port, keytype, keystr); - - if (ret == 0) /* success - key matched OK */ - return 1; + FingerprintType fptype_default = + ssh2_pick_default_fingerprint(fingerprints); - if (ret == 2) { /* key was different */ - common_fmt = hk_wrongmsg_common_fmt; + if (mismatch) { /* key was different */ + common = hk_wrongmsg_common(host, port, keytype, + fingerprints[fptype_default]); intro = hk_wrongmsg_interactive_intro; prompt = hk_wrongmsg_interactive_prompt; } else { /* key was absent */ - common_fmt = hk_absentmsg_common_fmt; + common = hk_absentmsg_common(host, port, keytype, + fingerprints[fptype_default]); intro = hk_absentmsg_interactive_intro; prompt = hk_absentmsg_interactive_prompt; } - FingerprintType fptype_default = - ssh2_pick_default_fingerprint(fingerprints); + fputs(common, stderr); + sfree(common); - fprintf(stderr, common_fmt, keytype, fingerprints[fptype_default]); if (console_batch_mode) { fputs(console_abandoned_msg, stderr); - return 0; + return SPR_SW_ABORT("Cannot confirm a host key in batch mode"); } fputs(intro, stderr); @@ -106,16 +102,16 @@ int console_verify_ssh_host_key( line[0] != 'q' && line[0] != 'Q') { if (line[0] == 'y' || line[0] == 'Y') store_host_key(host, port, keytype, keystr); - return 1; + return SPR_OK; } else { fputs(console_abandoned_msg, stderr); - return 0; + return SPR_USER_ABORT; } } -int console_confirm_weak_crypto_primitive( +SeatPromptResult console_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { HANDLE hin; DWORD savemode, i; @@ -126,7 +122,8 @@ int console_confirm_weak_crypto_primitive( if (console_batch_mode) { fputs(console_abandoned_msg, stderr); - return 0; + return SPR_SW_ABORT("Cannot confirm a weak crypto primitive " + "in batch mode"); } fputs(console_continue_prompt, stderr); @@ -140,16 +137,16 @@ int console_confirm_weak_crypto_primitive( SetConsoleMode(hin, savemode); if (line[0] == 'y' || line[0] == 'Y') { - return 1; + return SPR_OK; } else { fputs(console_abandoned_msg, stderr); - return 0; + return SPR_USER_ABORT; } } -int console_confirm_weak_cached_hostkey( +SeatPromptResult console_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { HANDLE hin; DWORD savemode, i; @@ -160,7 +157,8 @@ int console_confirm_weak_cached_hostkey( if (console_batch_mode) { fputs(console_abandoned_msg, stderr); - return 0; + return SPR_SW_ABORT("Cannot confirm a weak cached host key " + "in batch mode"); } fputs(console_continue_prompt, stderr); @@ -174,10 +172,10 @@ int console_confirm_weak_cached_hostkey( SetConsoleMode(hin, savemode); if (line[0] == 'y' || line[0] == 'Y') { - return 1; + return SPR_OK; } else { fputs(console_abandoned_msg, stderr); - return 0; + return SPR_USER_ABORT; } } @@ -187,21 +185,22 @@ bool is_interactive(void) } bool console_antispoof_prompt = true; -bool console_set_trust_status(Seat *seat, bool trusted) + +void console_set_trust_status(Seat *seat, bool trusted) { - if (console_batch_mode || !is_interactive() || !console_antispoof_prompt) { + /* Do nothing in response to a change of trust status, because + * there's nothing we can do in a console environment. However, + * the query function below will make a fiddly decision about + * whether to tell the backend to enable fallback handling. */ +} + +bool console_can_set_trust_status(Seat *seat) +{ + if (console_batch_mode) { /* * In batch mode, we don't need to worry about the server * mimicking our interactive authentication, because the user * already knows not to expect any. - * - * If standard input isn't connected to a terminal, likewise, - * because even if the server did send a spoof authentication - * prompt, the user couldn't respond to it via the terminal - * anyway. - * - * We also vacuously return success if the user has purposely - * disabled the antispoof prompt. */ return true; } @@ -209,6 +208,23 @@ bool console_set_trust_status(Seat *seat, bool trusted) return false; } +bool console_has_mixed_input_stream(Seat *seat) +{ + if (!is_interactive() || !console_antispoof_prompt) { + /* + * If standard input isn't connected to a terminal, then even + * if the server did send a spoof authentication prompt, the + * user couldn't respond to it via the terminal anyway. + * + * We also pretend this is true if the user has purposely + * disabled the antispoof prompt. + */ + return false; + } + + return true; +} + /* * Ask whether to wipe a session log file before writing to it. * Returns 2 for wipe, 1 for append, 0 for cancel (don't log). @@ -329,7 +345,7 @@ static void console_write(HANDLE hout, ptrlen data) WriteFile(hout, data.ptr, data.len, &dummy, NULL); } -int console_get_userpass_input(prompts_t *p) +SeatPromptResult console_get_userpass_input(prompts_t *p) { HANDLE hin = INVALID_HANDLE_VALUE, hout = INVALID_HANDLE_VALUE; size_t curr_prompt; @@ -351,7 +367,8 @@ int console_get_userpass_input(prompts_t *p) */ if (p->n_prompts) { if (console_batch_mode) - return 0; + return SPR_SW_ABORT("Cannot answer interactive prompts " + "in batch mode"); hin = GetStdHandle(STD_INPUT_HANDLE); if (hin == INVALID_HANDLE_VALUE) { fprintf(stderr, "Cannot get standard input handle\n"); @@ -404,6 +421,7 @@ int console_get_userpass_input(prompts_t *p) console_write(hout, ptrlen_from_asciz(pr->prompt)); bool failed = false; + SeatPromptResult spr; while (1) { /* * Amount of data to try to read from the console in one @@ -426,8 +444,17 @@ int console_get_userpass_input(prompts_t *p) void *ptr = strbuf_append(pr->result, toread); DWORD ret = 0; - if (!ReadFile(hin, ptr, toread, &ret, NULL) || ret == 0) { + if (!ReadFile(hin, ptr, toread, &ret, NULL)) { + /* An OS error when reading from the console is treated as an + * unexpected error and reported to the user. */ + failed = true; + spr = make_spr_sw_abort_winerror( + "Error reading from console", GetLastError()); + break; + } else if (ret == 0) { + /* Regard EOF on the terminal as a deliberate user-abort */ failed = true; + spr = SPR_USER_ABORT; break; } @@ -443,10 +470,9 @@ int console_get_userpass_input(prompts_t *p) if (!pr->echo) console_write(hout, PTRLEN_LITERAL("\r\n")); - if (failed) { - return 0; /* failure due to read error */ - } + if (failed) + return spr; } - return 1; /* success */ + return SPR_OK; } diff --git a/code/windows/winctrls.c b/code/windows/controls.c similarity index 99% rename from code/windows/winctrls.c rename to code/windows/controls.c index 59129ea..3c7896a 100644 --- a/code/windows/winctrls.c +++ b/code/windows/controls.c @@ -1,5 +1,5 @@ /* - * winctrls.c: routines to self-manage the controls in a dialog + * controls.c: routines to self-manage the controls in a dialog * box. */ diff --git a/code/windows/wincapi.h b/code/windows/cryptoapi.h similarity index 90% rename from code/windows/wincapi.h rename to code/windows/cryptoapi.h index 732412e..4ea7fe4 100644 --- a/code/windows/wincapi.h +++ b/code/windows/cryptoapi.h @@ -1,12 +1,10 @@ /* - * wincapi.h: Windows Crypto API functions defined in wincapi.c that + * cryptoapi.h: Windows Crypto API functions defined in PuTTY that * use the crypt32 library. Also centralises the machinery for * dynamically loading that library, and our own functions using that * in turn. */ -#if !defined NO_SECURITY - DECL_WINDOWS_FUNCTION(extern, BOOL, CryptProtectMemory, (LPVOID,DWORD,DWORD)); bool got_crypt(void); @@ -27,5 +25,3 @@ bool got_crypt(void); * The returned string is dynamically allocated. */ char *capi_obfuscate_string(const char *realname); - -#endif diff --git a/code/windows/windlg.c b/code/windows/dialog.c similarity index 92% rename from code/windows/windlg.c rename to code/windows/dialog.c index 9c5fdb7..38af0f9 100644 --- a/code/windows/windlg.c +++ b/code/windows/dialog.c @@ -1,5 +1,5 @@ /* - * windlg.c - dialogs for PuTTY(tel), including the configuration dialog. + * dialog.c - dialogs for PuTTY(tel), including the configuration dialog. */ #include @@ -11,8 +11,8 @@ #include "putty.h" #include "ssh.h" -#include "win_res.h" -#include "winseat.h" +#include "putty-rc.h" +#include "win-gui-seat.h" #include "storage.h" #include "dialog.h" #include "licence.h" @@ -388,6 +388,8 @@ static void create_controls(HWND hwnd, char *path) } } +const char *dialog_box_demo_screenshot_filename = NULL; + /* * This function is the configuration box. * (Being a dialog procedure, in general it returns 0 if the default @@ -396,6 +398,7 @@ static void create_controls(HWND hwnd, char *path) static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + const int DEMO_SCREENSHOT_TIMER_ID = 1230; HWND hw, treeview; struct treeview_faff tvfaff; int ret; @@ -565,6 +568,21 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, * spurious firing during the above setup procedure. */ SetWindowLongPtr(hwnd, GWLP_USERDATA, 1); + + if (dialog_box_demo_screenshot_filename) + SetTimer(hwnd, DEMO_SCREENSHOT_TIMER_ID, TICKSPERSEC, NULL); + return 0; + case WM_TIMER: + if (dialog_box_demo_screenshot_filename && + (UINT_PTR)wParam == DEMO_SCREENSHOT_TIMER_ID) { + KillTimer(hwnd, DEMO_SCREENSHOT_TIMER_ID); + const char *err = save_screenshot( + hwnd, dialog_box_demo_screenshot_filename); + if (err) + MessageBox(hwnd, err, "Demo screenshot failure", + MB_OK | MB_ICONERROR); + SaneEndDialog(hwnd, 0); + } return 0; case WM_LBUTTONUP: /* @@ -825,6 +843,8 @@ void showabout(HWND hwnd) struct hostkey_dialog_ctx { const char *const *keywords; const char *const *values; + const char *host; + int port; FingerprintType fptype_default; char **fingerprints; const char *keydisp; @@ -887,7 +907,7 @@ static INT_PTR CALLBACK HostKeyDialogProc(HWND hwnd, UINT msg, for (size_t i = 0; ctx->keywords[i]; i++) { if (strstartswith(p, ctx->keywords[i])) { p += strlen(ctx->keywords[i]); - put_datapl(sb, ptrlen_from_asciz(ctx->values[i])); + put_dataz(sb, ctx->values[i]); goto matched; } } @@ -901,6 +921,11 @@ static INT_PTR CALLBACK HostKeyDialogProc(HWND hwnd, UINT msg, } strbuf_free(sb); + char *hostport = dupprintf("%s (port %d)", ctx->host, ctx->port); + SetDlgItemText(hwnd, IDC_HK_HOST, hostport); + sfree(hostport); + MakeDlgItemBorderless(hwnd, IDC_HK_HOST); + SetDlgItemText(hwnd, IDC_HK_FINGERPRINT, ctx->fingerprints[ctx->fptype_default]); MakeDlgItemBorderless(hwnd, IDC_HK_FINGERPRINT); @@ -969,60 +994,53 @@ static INT_PTR CALLBACK HostKeyDialogProc(HWND hwnd, UINT msg, return 0; } -int win_seat_verify_ssh_host_key( +SeatPromptResult win_seat_confirm_ssh_host_key( Seat *seat, const char *host, int port, const char *keytype, - char *keystr, const char *keydisp, char **fingerprints, - void (*callback)(void *ctx, int result), void *ctx) + char *keystr, const char *keydisp, char **fingerprints, bool mismatch, + void (*callback)(void *ctx, SeatPromptResult result), void *vctx) { - int ret; - WinGuiSeat *wgs = container_of(seat, WinGuiSeat, seat); - /* - * Verify the key against the registry. - */ - ret = verify_host_key(host, port, keytype, keystr); - - if (ret == 0) /* success - key matched OK */ - return 1; - else { - static const char *const keywords[] = - { "{KEYTYPE}", "{APPNAME}", NULL }; - - const char *values[2]; - values[0] = keytype; - values[1] = appname; - - struct hostkey_dialog_ctx ctx[1]; - ctx->keywords = keywords; - ctx->values = values; - ctx->fingerprints = fingerprints; - ctx->fptype_default = ssh2_pick_default_fingerprint(fingerprints); - ctx->keydisp = keydisp; - ctx->iconid = (ret == 2 ? IDI_WARNING : IDI_QUESTION); - ctx->helpctx = (ret == 2 ? WINHELP_CTX_errors_hostkey_changed : - WINHELP_CTX_errors_hostkey_absent); - int dlgid = (ret == 2 ? IDD_HK_WRONG : IDD_HK_ABSENT); - int mbret = DialogBoxParam( - hinst, MAKEINTRESOURCE(dlgid), wgs->term_hwnd, - HostKeyDialogProc, (LPARAM)ctx); - assert(mbret==IDC_HK_ACCEPT || mbret==IDC_HK_ONCE || mbret==IDCANCEL); - if (mbret == IDC_HK_ACCEPT) { - store_host_key(host, port, keytype, keystr); - return 1; - } else if (mbret == IDC_HK_ONCE) - return 1; + static const char *const keywords[] = + { "{KEYTYPE}", "{APPNAME}", NULL }; + + const char *values[2]; + values[0] = keytype; + values[1] = appname; + + struct hostkey_dialog_ctx ctx[1]; + ctx->keywords = keywords; + ctx->values = values; + ctx->fingerprints = fingerprints; + ctx->fptype_default = ssh2_pick_default_fingerprint(fingerprints); + ctx->keydisp = keydisp; + ctx->iconid = (mismatch ? IDI_WARNING : IDI_QUESTION); + ctx->helpctx = (mismatch ? WINHELP_CTX_errors_hostkey_changed : + WINHELP_CTX_errors_hostkey_absent); + ctx->host = host; + ctx->port = port; + int dlgid = (mismatch ? IDD_HK_WRONG : IDD_HK_ABSENT); + int mbret = DialogBoxParam( + hinst, MAKEINTRESOURCE(dlgid), wgs->term_hwnd, + HostKeyDialogProc, (LPARAM)ctx); + assert(mbret==IDC_HK_ACCEPT || mbret==IDC_HK_ONCE || mbret==IDCANCEL); + if (mbret == IDC_HK_ACCEPT) { + store_host_key(host, port, keytype, keystr); + return SPR_OK; + } else if (mbret == IDC_HK_ONCE) { + return SPR_OK; } - return 0; /* abandon the connection */ + + return SPR_USER_ABORT; } /* * Ask whether the selected algorithm is acceptable (since it was * below the configured 'warn' threshold). */ -int win_seat_confirm_weak_crypto_primitive( +SeatPromptResult win_seat_confirm_weak_crypto_primitive( Seat *seat, const char *algtype, const char *algname, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { static const char mbtitle[] = "%s Security Alert"; static const char msg[] = @@ -1041,14 +1059,14 @@ int win_seat_confirm_weak_crypto_primitive( sfree(message); sfree(title); if (mbret == IDYES) - return 1; + return SPR_OK; else - return 0; + return SPR_USER_ABORT; } -int win_seat_confirm_weak_cached_hostkey( +SeatPromptResult win_seat_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, - void (*callback)(void *ctx, int result), void *ctx) + void (*callback)(void *ctx, SeatPromptResult result), void *ctx) { static const char mbtitle[] = "%s Security Alert"; static const char msg[] = @@ -1069,9 +1087,9 @@ int win_seat_confirm_weak_cached_hostkey( sfree(message); sfree(title); if (mbret == IDYES) - return 1; + return SPR_OK; else - return 0; + return SPR_USER_ABORT; } /* diff --git a/code/windows/wingss.c b/code/windows/gss.c similarity index 99% rename from code/windows/wingss.c rename to code/windows/gss.c index 79c4921..cadb1d5 100644 --- a/code/windows/wingss.c +++ b/code/windows/gss.c @@ -6,9 +6,9 @@ #define SECURITY_WIN32 #include -#include "pgssapi.h" -#include "sshgss.h" -#include "sshgssc.h" +#include "ssh/pgssapi.h" +#include "ssh/gss.h" +#include "ssh/gssc.h" #include "misc.h" @@ -127,7 +127,7 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf) if (!kernel32_module) { kernel32_module = load_system32_dll("kernel32.dll"); } -#if defined _MSC_VER && _MSC_VER < 1900 +#if !HAVE_ADDDLLDIRECTORY /* Omit the type-check because older MSVCs don't have this function */ GET_WINDOWS_FUNCTION_NO_TYPECHECK(kernel32_module, AddDllDirectory); #else @@ -465,7 +465,7 @@ static Ssh_gss_stat ssh_sspi_init_sec_context(struct ssh_gss_library *lib, SecBufferDesc input_desc ={SECBUFFER_VERSION,1,&wrecv_tok}; unsigned long flags=ISC_REQ_MUTUAL_AUTH|ISC_REQ_REPLAY_DETECT| ISC_REQ_CONFIDENTIALITY|ISC_REQ_ALLOCATE_MEMORY; - unsigned long ret_flags=0; + ULONG ret_flags=0; TimeStamp localexp; /* check if we have to delegate ... */ diff --git a/code/windows/winhandl.c b/code/windows/handle-io.c similarity index 78% rename from code/windows/winhandl.c rename to code/windows/handle-io.c index 82d2ade..0f5b7e9 100644 --- a/code/windows/winhandl.c +++ b/code/windows/handle-io.c @@ -1,5 +1,5 @@ /* - * winhandl.c: Module to give Windows front ends the general + * handle-io.c: Module to give Windows front ends the general * ability to deal with consoles, pipes, serial ports, or any other * type of data stream accessed through a Windows API HANDLE rather * than a WinSock SOCKET. @@ -37,6 +37,12 @@ * Generic definitions. */ +typedef struct handle_list_node handle_list_node; +struct handle_list_node { + handle_list_node *next, *prev; +}; +static void add_to_ready_list(handle_list_node *node); + /* * Maximum amount of backlog we will allow to build up on an input * handle before we stop reading from it. @@ -56,7 +62,7 @@ struct handle_generic { * thread. */ HANDLE h; /* the handle itself */ - HANDLE ev_to_main; /* event used to signal main thread */ + handle_list_node ready_node; /* for linking on to the ready list */ HANDLE ev_from_main; /* event used to signal back to us */ bool moribund; /* are we going to kill this soon? */ bool done; /* request subthread to terminate */ @@ -65,7 +71,7 @@ struct handle_generic { void *privdata; /* for client to remember who they are */ }; -typedef enum { HT_INPUT, HT_OUTPUT, HT_FOREIGN } HandleType; +typedef enum { HT_INPUT, HT_OUTPUT } HandleType; /* ---------------------------------------------------------------------- * Input threads. @@ -79,7 +85,7 @@ struct handle_input { * Copy of the handle_generic structure. */ HANDLE h; /* the handle itself */ - HANDLE ev_to_main; /* event used to signal main thread */ + handle_list_node ready_node; /* for linking on to the ready list */ HANDLE ev_from_main; /* event used to signal back to us */ bool moribund; /* are we going to kill this soon? */ bool done; /* request subthread to terminate */ @@ -93,7 +99,7 @@ struct handle_input { int flags; /* - * Data set by the input thread before signalling ev_to_main, + * Data set by the input thread before marking the handle ready, * and read by the main thread after receiving that signal. */ char buffer[4096]; /* the data read from the handle */ @@ -176,7 +182,7 @@ static DWORD WINAPI handle_input_threadfunc(void *param) */ finished = (ctx->len == 0); - SetEvent(ctx->ev_to_main); + add_to_ready_list(&ctx->ready_node); if (finished) break; @@ -189,7 +195,7 @@ static DWORD WINAPI handle_input_threadfunc(void *param) * not touch ctx at all, because the main thread might * have freed it. */ - SetEvent(ctx->ev_to_main); + add_to_ready_list(&ctx->ready_node); break; } } @@ -240,7 +246,7 @@ struct handle_output { * Copy of the handle_generic structure. */ HANDLE h; /* the handle itself */ - HANDLE ev_to_main; /* event used to signal main thread */ + handle_list_node ready_node; /* for linking on to the ready list */ HANDLE ev_from_main; /* event used to signal back to us */ bool moribund; /* are we going to kill this soon? */ bool done; /* request subthread to terminate */ @@ -261,8 +267,8 @@ struct handle_output { DWORD len; /* how much data there is */ /* - * Data set by the input thread before signalling ev_to_main, - * and read by the main thread after receiving that signal. + * Data set by the input thread before marking this handle as + * ready, and read by the main thread after receiving that signal. */ DWORD lenwritten; /* how much data we actually wrote */ int writeerr; /* return value from WriteFile */ @@ -278,6 +284,7 @@ struct handle_output { * drops. */ handle_outputfn_t sentdata; + struct handle *sentdata_param; }; static DWORD WINAPI handle_output_threadfunc(void *param) @@ -303,7 +310,7 @@ static DWORD WINAPI handle_output_threadfunc(void *param) * not touch ctx at all, because the main thread might * have freed it. */ - SetEvent(ctx->ev_to_main); + add_to_ready_list(&ctx->ready_node); break; } if (povl) { @@ -326,7 +333,7 @@ static DWORD WINAPI handle_output_threadfunc(void *param) ctx->writeerr = 0; } - SetEvent(ctx->ev_to_main); + add_to_ready_list(&ctx->ready_node); if (!writeret) { /* * The write operation has suffered an error. Telling that @@ -355,39 +362,12 @@ static void handle_try_output(struct handle_output *ctx) ctx->busy = true; } else if (!ctx->busy && bufchain_size(&ctx->queued_data) == 0 && ctx->outgoingeof == EOF_PENDING) { - CloseHandle(ctx->h); + ctx->sentdata(ctx->sentdata_param, 0, 0, true); ctx->h = INVALID_HANDLE_VALUE; ctx->outgoingeof = EOF_SENT; } } -/* ---------------------------------------------------------------------- - * 'Foreign events'. These are handle structures which just contain a - * single event object passed to us by another module such as - * winnps.c, so that they can make use of our handle_get_events / - * handle_got_event mechanism for communicating with application main - * loops. - */ -struct handle_foreign { - /* - * Copy of the handle_generic structure. - */ - HANDLE h; /* the handle itself */ - HANDLE ev_to_main; /* event used to signal main thread */ - HANDLE ev_from_main; /* event used to signal back to us */ - bool moribund; /* are we going to kill this soon? */ - bool done; /* request subthread to terminate */ - bool defunct; /* has the subthread already gone? */ - bool busy; /* operation currently in progress? */ - void *privdata; /* for client to remember who they are */ - - /* - * Our own data, just consisting of knowledge of who to call back. - */ - void (*callback)(void *); - void *ctx; -}; - /* ---------------------------------------------------------------------- * Unified code handling both input and output threads. */ @@ -398,36 +378,91 @@ struct handle { struct handle_generic g; struct handle_input i; struct handle_output o; - struct handle_foreign f; } u; }; -static tree234 *handles_by_evtomain; +/* + * Linked list storing the current list of handles ready to have + * something done to them by the main thread. + */ +static handle_list_node ready_head[1]; +static CRITICAL_SECTION ready_critsec[1]; -static int handle_cmp_evtomain(void *av, void *bv) +/* + * Event object used by all subthreads to signal that they've just put + * something on the ready list, i.e. that the ready list is non-empty. + */ +static HANDLE ready_event = INVALID_HANDLE_VALUE; + +static void add_to_ready_list(handle_list_node *node) { - struct handle *a = (struct handle *)av; - struct handle *b = (struct handle *)bv; + /* + * Called from subthreads, when their handle has done something + * that they need the main thread to respond to. We append the + * given list node to the end of the ready list, and set + * ready_event to signal to the main thread that the ready list is + * now non-empty. + */ + EnterCriticalSection(ready_critsec); + node->next = ready_head; + node->prev = ready_head->prev; + node->next->prev = node->prev->next = node; + SetEvent(ready_event); + LeaveCriticalSection(ready_critsec); +} - if ((uintptr_t)a->u.g.ev_to_main < (uintptr_t)b->u.g.ev_to_main) - return -1; - else if ((uintptr_t)a->u.g.ev_to_main > (uintptr_t)b->u.g.ev_to_main) - return +1; - else - return 0; +static void remove_from_ready_list(handle_list_node *node) +{ + /* + * Called from the main thread, just before destroying a 'struct + * handle' completely: as a precaution, we make absolutely sure + * it's not linked on the ready list, just in case somehow it + * still was. + */ + EnterCriticalSection(ready_critsec); + node->next->prev = node->prev; + node->prev->next = node->next; + node->next = node->prev = node; + LeaveCriticalSection(ready_critsec); } -static int handle_find_evtomain(void *av, void *bv) +static void handle_ready(struct handle *h); /* process one handle (below) */ + +static void handle_ready_callback(void *vctx) { - HANDLE *a = (HANDLE *)av; - struct handle *b = (struct handle *)bv; + /* + * Called when the main thread detects ready_event, indicating + * that at least one handle is on the ready list. We empty the + * whole list and process the handles one by one. + * + * It's possible that other handles may be destroyed, and hence + * taken _off_ the ready list, during this processing. That + * shouldn't cause a deadlock, because according to the API docs, + * it's safe to call EnterCriticalSection twice in the same thread + * - the second call will return immediately because that thread + * already owns the critsec. (And then it takes two calls to + * LeaveCriticalSection to release it again, which is just what we + * want here.) + */ + EnterCriticalSection(ready_critsec); + while (ready_head->next != ready_head) { + handle_list_node *node = ready_head->next; + node->prev->next = node->next; + node->next->prev = node->prev; + node->next = node->prev = node; + handle_ready(container_of(node, struct handle, u.g.ready_node)); + } + LeaveCriticalSection(ready_critsec); +} - if ((uintptr_t)*a < (uintptr_t)b->u.g.ev_to_main) - return -1; - else if ((uintptr_t)*a > (uintptr_t)b->u.g.ev_to_main) - return +1; - else - return 0; +static inline void ensure_ready_event_setup(void) +{ + if (ready_event == INVALID_HANDLE_VALUE) { + ready_head->prev = ready_head->next = ready_head; + InitializeCriticalSection(ready_critsec); + ready_event = CreateEvent(NULL, false, false, NULL); + add_handle_wait(ready_event, handle_ready_callback, NULL); + } } struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata, @@ -438,7 +473,6 @@ struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata, h->type = HT_INPUT; h->u.i.h = handle; - h->u.i.ev_to_main = CreateEvent(NULL, false, false, NULL); h->u.i.ev_from_main = CreateEvent(NULL, false, false, NULL); h->u.i.gotdata = gotdata; h->u.i.defunct = false; @@ -447,10 +481,7 @@ struct handle *handle_input_new(HANDLE handle, handle_inputfn_t gotdata, h->u.i.privdata = privdata; h->u.i.flags = flags; - if (!handles_by_evtomain) - handles_by_evtomain = newtree234(handle_cmp_evtomain); - add234(handles_by_evtomain, h); - + ensure_ready_event_setup(); HANDLE hThread = CreateThread(NULL, 0, handle_input_threadfunc, &h->u.i, 0, &in_threadid); if (hThread) @@ -468,7 +499,6 @@ struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata, h->type = HT_OUTPUT; h->u.o.h = handle; - h->u.o.ev_to_main = CreateEvent(NULL, false, false, NULL); h->u.o.ev_from_main = CreateEvent(NULL, false, false, NULL); h->u.o.busy = false; h->u.o.defunct = false; @@ -478,12 +508,10 @@ struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata, bufchain_init(&h->u.o.queued_data); h->u.o.outgoingeof = EOF_NO; h->u.o.sentdata = sentdata; + h->u.o.sentdata_param = h; h->u.o.flags = flags; - if (!handles_by_evtomain) - handles_by_evtomain = newtree234(handle_cmp_evtomain); - add234(handles_by_evtomain, h); - + ensure_ready_event_setup(); HANDLE hThread = CreateThread(NULL, 0, handle_output_threadfunc, &h->u.o, 0, &out_threadid); if (hThread) @@ -492,30 +520,6 @@ struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata, return h; } -struct handle *handle_add_foreign_event(HANDLE event, - void (*callback)(void *), void *ctx) -{ - struct handle *h = snew(struct handle); - - h->type = HT_FOREIGN; - h->u.f.h = INVALID_HANDLE_VALUE; - h->u.f.ev_to_main = event; - h->u.f.ev_from_main = INVALID_HANDLE_VALUE; - h->u.f.defunct = true; /* we have no thread in the first place */ - h->u.f.moribund = false; - h->u.f.done = false; - h->u.f.privdata = NULL; - h->u.f.callback = callback; - h->u.f.ctx = ctx; - h->u.f.busy = true; - - if (!handles_by_evtomain) - handles_by_evtomain = newtree234(handle_cmp_evtomain); - add234(handles_by_evtomain, h); - - return h; -} - size_t handle_write(struct handle *h, const void *data, size_t len) { assert(h->type == HT_OUTPUT); @@ -541,46 +545,19 @@ void handle_write_eof(struct handle *h) } } -HANDLE *handle_get_events(int *nevents) -{ - HANDLE *ret; - struct handle *h; - int i; - size_t n, size; - - /* - * Go through our tree counting the handle objects currently - * engaged in useful activity. - */ - ret = NULL; - n = size = 0; - if (handles_by_evtomain) { - for (i = 0; (h = index234(handles_by_evtomain, i)) != NULL; i++) { - if (h->u.g.busy) { - sgrowarray(ret, size, n); - ret[n++] = h->u.g.ev_to_main; - } - } - } - - *nevents = n; - return ret; -} - static void handle_destroy(struct handle *h) { if (h->type == HT_OUTPUT) bufchain_clear(&h->u.o.queued_data); CloseHandle(h->u.g.ev_from_main); - CloseHandle(h->u.g.ev_to_main); - del234(handles_by_evtomain, h); + remove_from_ready_list(&h->u.g.ready_node); sfree(h); } void handle_free(struct handle *h) { assert(h && !h->u.g.moribund); - if (h->u.g.busy && h->type != HT_FOREIGN) { + if (h->u.g.busy) { /* * If the handle is currently busy, we cannot immediately free * it, because its subthread is in the middle of something. @@ -612,24 +589,8 @@ void handle_free(struct handle *h) } } -void handle_got_event(HANDLE event) +static void handle_ready(struct handle *h) { - struct handle *h; - - assert(handles_by_evtomain); - h = find234(handles_by_evtomain, &event, handle_find_evtomain); - if (!h) { - /* - * This isn't an error condition. If two or more event - * objects were signalled during the same select operation, - * and processing of the first caused the second handle to - * be closed, then it will sometimes happen that we receive - * an event notification here for a handle which is already - * deceased. In that situation we simply do nothing. - */ - return; - } - if (h->u.g.moribund) { /* * A moribund handle is one which we have either already @@ -685,19 +646,14 @@ void handle_got_event(HANDLE event) * thread is terminating by now). */ h->u.o.defunct = true; - h->u.o.sentdata(h, 0, h->u.o.writeerr); + h->u.o.sentdata(h, 0, h->u.o.writeerr, false); } else { bufchain_consume(&h->u.o.queued_data, h->u.o.lenwritten); noise_ultralight(NOISE_SOURCE_IOLEN, h->u.o.lenwritten); - h->u.o.sentdata(h, bufchain_size(&h->u.o.queued_data), 0); + h->u.o.sentdata(h, bufchain_size(&h->u.o.queued_data), 0, false); handle_try_output(&h->u.o); } break; - - case HT_FOREIGN: - /* Just call the callback. */ - h->u.f.callback(h->u.f.ctx); - break; } } diff --git a/code/windows/winhsock.c b/code/windows/handle-socket.c similarity index 57% rename from code/windows/winhsock.c rename to code/windows/handle-socket.c index 543b77b..0b0e60a 100644 --- a/code/windows/winhsock.c +++ b/code/windows/handle-socket.c @@ -11,35 +11,56 @@ #include "putty.h" #include "network.h" +/* + * Freezing one of these sockets is a slightly fiddly business, + * because the reads from the handle are happening in a separate + * thread as blocking system calls and so once one is in progress it + * can't sensibly be interrupted. Hence, after the user tries to + * freeze one of these sockets, it's unavoidable that we may receive + * one more load of data before we manage to get handle-io.c to stop + * reading. + */ +typedef enum HandleSocketFreezeState { + UNFROZEN, /* reading as normal */ + FREEZING, /* have been set to frozen but winhandl is still reading */ + FROZEN, /* really frozen - winhandl has been throttled */ + THAWING /* we're gradually releasing our remaining data */ +} HandleSocketFreezeState; + typedef struct HandleSocket { - HANDLE send_H, recv_H, stderr_H; - struct handle *send_h, *recv_h, *stderr_h; + union { + struct { + HANDLE send_H, recv_H, stderr_H; + struct handle *send_h, *recv_h, *stderr_h; - /* - * Freezing one of these sockets is a slightly fiddly business, - * because the reads from the handle are happening in a separate - * thread as blocking system calls and so once one is in progress - * it can't sensibly be interrupted. Hence, after the user tries - * to freeze one of these sockets, it's unavoidable that we may - * receive one more load of data before we manage to get - * winhandl.c to stop reading. - */ - enum { - UNFROZEN, /* reading as normal */ - FREEZING, /* have been set to frozen but winhandl is still reading */ - FROZEN, /* really frozen - winhandl has been throttled */ - THAWING /* we're gradually releasing our remaining data */ - } frozen; - /* We buffer data here if we receive it from winhandl while frozen. */ - bufchain inputdata; + HandleSocketFreezeState frozen; + /* We buffer data here if we receive it from winhandl + * while frozen. */ + bufchain inputdata; - /* Handle logging proxy error messages from stderr_H, if we have one. */ - ProxyStderrBuf psb; + /* Handle logging proxy error messages from stderr_H, if + * we have one */ + ProxyStderrBuf psb; - bool defer_close, deferred_close; /* in case of re-entrance */ + bool defer_close, deferred_close; /* in case of re-entrance */ + }; + struct { + DeferredSocketOpener *opener; + + /* We buffer data here if we receive it via sk_write + * before the socket is opened. */ + bufchain outputdata; + + bool output_eof_pending; + + bool start_frozen; + }; + }; char *error; + SockAddr *addr; + int port; Plug *plug; Socket sock; @@ -51,17 +72,17 @@ static size_t handle_gotdata( HandleSocket *hs = (HandleSocket *)handle_get_privdata(h); if (err) { - plug_closing(hs->plug, "Read error from handle", 0, 0); + plug_closing_error(hs->plug, "Read error from handle"); return 0; } else if (len == 0) { - plug_closing(hs->plug, NULL, 0, 0); + plug_closing_normal(hs->plug); return 0; } else { assert(hs->frozen != FROZEN && hs->frozen != THAWING); if (hs->frozen == FREEZING) { /* * If we've received data while this socket is supposed to - * be frozen (because the read winhandl.c started before + * be frozen (because the read handle-io.c started before * sk_set_frozen was called has now returned) then buffer * the data for when we unfreeze. */ @@ -91,12 +112,21 @@ static size_t handle_stderr( return 0; } -static void handle_sentdata(struct handle *h, size_t new_backlog, int err) +static void handle_sentdata(struct handle *h, size_t new_backlog, int err, + bool close) { HandleSocket *hs = (HandleSocket *)handle_get_privdata(h); + if (close) { + if (hs->send_H != INVALID_HANDLE_VALUE) + CloseHandle(hs->send_H); + if (hs->recv_H != INVALID_HANDLE_VALUE && hs->recv_H != hs->send_H) + CloseHandle(hs->recv_H); + hs->send_H = hs->recv_H = INVALID_HANDLE_VALUE; + } + if (err) { - plug_closing(hs->plug, win_strerror(err), err, 0); + plug_closing_system_error(hs->plug, err); return; } @@ -123,11 +153,15 @@ static void sk_handle_close(Socket *s) handle_free(hs->send_h); handle_free(hs->recv_h); - CloseHandle(hs->send_H); - if (hs->recv_H != hs->send_H) + if (hs->send_H != INVALID_HANDLE_VALUE) + CloseHandle(hs->send_H); + if (hs->recv_H != INVALID_HANDLE_VALUE && hs->recv_H != hs->send_H) CloseHandle(hs->recv_H); bufchain_clear(&hs->inputdata); + if (hs->addr) + sk_addr_free(hs->addr); + delete_callbacks_for_context(hs); sfree(hs); @@ -214,7 +248,7 @@ static void sk_handle_set_frozen(Socket *s, bool is_frozen) case THAWING: /* * We were in the middle of emptying our bufchain, and got - * frozen again. In that case, winhandl.c is already + * frozen again. In that case, handle-io.c is already * throttled, so just return to FROZEN state. The toplevel * callback will notice and disable itself. */ @@ -272,7 +306,7 @@ static SocketPeerInfo *sk_handle_peer_info(Socket *s) if (!kernel32_module) { kernel32_module = load_system32_dll("kernel32.dll"); -#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__ +#if !HAVE_GETNAMEDPIPECLIENTPROCESSID /* For older Visual Studio, and MinGW too (at least as of * Ubuntu 16.04), this function isn't available in the header * files to type-check. Ditto the toolchain I use for @@ -314,16 +348,26 @@ static const SocketVtable HandleSocket_sockvt = { .peer_info = sk_handle_peer_info, }; +static void sk_handle_connect_success_callback(void *ctx) +{ + HandleSocket *hs = (HandleSocket *)ctx; + plug_log(hs->plug, PLUGLOG_CONNECT_SUCCESS, hs->addr, hs->port, NULL, 0); +} + Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H, - Plug *plug, bool overlapped) + SockAddr *addr, int port, Plug *plug, + bool overlapped) { HandleSocket *hs; int flags = (overlapped ? HANDLE_FLAG_OVERLAPPED : 0); hs = snew(HandleSocket); hs->sock.vt = &HandleSocket_sockvt; + hs->addr = addr; + hs->port = port; hs->plug = plug; hs->error = NULL; + hs->frozen = UNFROZEN; bufchain_init(&hs->inputdata); psb_init(&hs->psb); @@ -339,5 +383,123 @@ Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H, hs->defer_close = hs->deferred_close = false; + queue_toplevel_callback(sk_handle_connect_success_callback, hs); + + return &hs->sock; +} + +static void sk_handle_deferred_close(Socket *s) +{ + HandleSocket *hs = container_of(s, HandleSocket, sock); + + deferred_socket_opener_free(hs->opener); + bufchain_clear(&hs->outputdata); + + if (hs->addr) + sk_addr_free(hs->addr); + + delete_callbacks_for_context(hs); + + sfree(hs); +} + +static size_t sk_handle_deferred_write(Socket *s, const void *data, size_t len) +{ + HandleSocket *hs = container_of(s, HandleSocket, sock); + assert(!hs->output_eof_pending); + bufchain_add(&hs->outputdata, data, len); + return bufchain_size(&hs->outputdata); +} + +static void sk_handle_deferred_write_eof(Socket *s) +{ + HandleSocket *hs = container_of(s, HandleSocket, sock); + assert(!hs->output_eof_pending); + hs->output_eof_pending = true; +} + +static void sk_handle_deferred_set_frozen(Socket *s, bool is_frozen) +{ + HandleSocket *hs = container_of(s, HandleSocket, sock); + hs->frozen = is_frozen; +} + +static SocketPeerInfo *sk_handle_deferred_peer_info(Socket *s) +{ + return NULL; +} + +static const SocketVtable HandleSocket_deferred_sockvt = { + .plug = sk_handle_plug, + .close = sk_handle_deferred_close, + .write = sk_handle_deferred_write, + .write_oob = sk_handle_deferred_write, + .write_eof = sk_handle_deferred_write_eof, + .set_frozen = sk_handle_deferred_set_frozen, + .socket_error = sk_handle_socket_error, + .peer_info = sk_handle_deferred_peer_info, +}; + +Socket *make_deferred_handle_socket(DeferredSocketOpener *opener, + SockAddr *addr, int port, Plug *plug) +{ + HandleSocket *hs = snew(HandleSocket); + hs->sock.vt = &HandleSocket_deferred_sockvt; + hs->addr = addr; + hs->port = port; + hs->plug = plug; + hs->error = NULL; + + hs->opener = opener; + bufchain_init(&hs->outputdata); + hs->output_eof_pending = false; + hs->start_frozen = false; + return &hs->sock; } + +void setup_handle_socket(Socket *s, HANDLE send_H, HANDLE recv_H, + HANDLE stderr_H, bool overlapped) +{ + HandleSocket *hs = container_of(s, HandleSocket, sock); + assert(hs->sock.vt == &HandleSocket_deferred_sockvt); + + int flags = (overlapped ? HANDLE_FLAG_OVERLAPPED : 0); + + struct handle *recv_h = handle_input_new( + recv_H, handle_gotdata, hs, flags); + struct handle *send_h = handle_output_new( + send_H, handle_sentdata, hs, flags); + struct handle *stderr_h = !stderr_H ? NULL : handle_input_new( + stderr_H, handle_stderr, hs, flags); + + while (bufchain_size(&hs->outputdata)) { + ptrlen data = bufchain_prefix(&hs->outputdata); + handle_write(send_h, data.ptr, data.len); + bufchain_consume(&hs->outputdata, data.len); + } + + if (hs->output_eof_pending) + handle_write_eof(send_h); + + bool start_frozen = hs->start_frozen; + + deferred_socket_opener_free(hs->opener); + bufchain_clear(&hs->outputdata); + + hs->sock.vt = &HandleSocket_sockvt; + hs->frozen = start_frozen ? FREEZING : UNFROZEN; + bufchain_init(&hs->inputdata); + psb_init(&hs->psb); + + hs->recv_H = recv_H; + hs->recv_h = recv_h; + hs->send_H = send_H; + hs->send_h = send_h; + hs->stderr_H = stderr_H; + hs->stderr_h = stderr_h; + + hs->defer_close = hs->deferred_close = false; + + queue_toplevel_callback(sk_handle_connect_success_callback, hs); +} diff --git a/code/windows/handle-wait.c b/code/windows/handle-wait.c new file mode 100644 index 0000000..9e4e522 --- /dev/null +++ b/code/windows/handle-wait.c @@ -0,0 +1,143 @@ +/* + * handle-wait.c: Manage a collection of HANDLEs to wait for (in a + * WaitFor{Single,Multiple}Objects sense), each with a callback to be + * called when it's activated. Tracks the list, and provides an API to + * event loops that let them get a list of things to wait for and a + * way to call back to here when one of them does something. + */ + +/* + * TODO: currently this system can't cope with more than + * MAXIMUM_WAIT_OBJECTS (= 64) handles at a time. It enforces that by + * assertion, so we'll at least find out if that assumption is ever + * violated. + * + * It should be OK for the moment. As of 2021-05-24, the only uses of + * this system are by the ConPTY backend (just once, to watch for its + * subprocess terminating); by Pageant (for the event that the + * WM_COPYDATA subthread uses to signal the main thread); and by + * named-pipe-server.c (once per named-pipe server, of which there is + * one in Pageant and one in connection-sharing upstreams). So the + * total number of handles has a pretty small upper bound. + * + * But sooner or later, I'm sure we'll find a reason why we really + * need to watch a squillion handles at once. When that happens, I + * can't see any alternative to setting up some kind of tree of + * subthreads in this module, each one condensing 64 of our handles + * into one, by doing its own WaitForMultipleObjects and setting an + * event object to indicate that one of them did something. It'll be + * horribly ugly. + */ + +#include "putty.h" + +struct HandleWait { + HANDLE handle; + handle_wait_callback_fn_t callback; + void *callback_ctx; + + int index; /* sort key for tree234 */ +}; + +struct HandleWaitListInner { + HandleWait *hws[MAXIMUM_WAIT_OBJECTS]; + HANDLE handles[MAXIMUM_WAIT_OBJECTS]; + + struct HandleWaitList hwl; +}; + +static int handlewait_cmp(void *av, void *bv) +{ + HandleWait *a = (HandleWait *)av, *b = (HandleWait *)bv; + if (a->index < b->index) + return -1; + if (a->index > b->index) + return +1; + return 0; +} + +static tree234 *handlewaits_tree_real; + +static inline tree234 *ensure_handlewaits_tree_exists(void) +{ + if (!handlewaits_tree_real) + handlewaits_tree_real = newtree234(handlewait_cmp); + return handlewaits_tree_real; +} + +static int allocate_index(void) +{ + tree234 *t = ensure_handlewaits_tree_exists(); + search234_state st[1]; + + search234_start(st, t); + while (st->element) { + HandleWait *hw = (HandleWait *)st->element; + if (st->index < hw->index) { + /* There are unused index slots to the left of this element */ + search234_step(st, -1); + } else { + assert(st->index == hw->index); + search234_step(st, +1); + } + } + + return st->index; +} + +HandleWait *add_handle_wait(HANDLE h, handle_wait_callback_fn_t callback, + void *callback_ctx) +{ + HandleWait *hw = snew(HandleWait); + hw->handle = h; + hw->callback = callback; + hw->callback_ctx = callback_ctx; + + tree234 *t = ensure_handlewaits_tree_exists(); + hw->index = allocate_index(); + HandleWait *added = add234(t, hw); + assert(added == hw); + + return hw; +} + +void delete_handle_wait(HandleWait *hw) +{ + tree234 *t = ensure_handlewaits_tree_exists(); + HandleWait *deleted = del234(t, hw); + assert(deleted == hw); + sfree(hw); +} + +HandleWaitList *get_handle_wait_list(void) +{ + tree234 *t = ensure_handlewaits_tree_exists(); + struct HandleWaitListInner *hwli = snew(struct HandleWaitListInner); + size_t n = 0; + HandleWait *hw; + for (int i = 0; (hw = index234(t, i)) != NULL; i++) { + assert(n < MAXIMUM_WAIT_OBJECTS); + hwli->hws[n] = hw; + hwli->hwl.handles[n] = hw->handle; + n++; + } + hwli->hwl.nhandles = n; + return &hwli->hwl; +} + +void handle_wait_activate(HandleWaitList *hwl, int index) +{ + struct HandleWaitListInner *hwli = + container_of(hwl, struct HandleWaitListInner, hwl); + assert(0 <= index); + assert(index < hwli->hwl.nhandles); + HandleWait *hw = hwli->hws[index]; + hw->callback(hw->callback_ctx); +} + +void handle_wait_list_free(HandleWaitList *hwl) +{ + struct HandleWaitListInner *hwli = + container_of(hwl, struct HandleWaitListInner, hwl); + sfree(hwli); +} diff --git a/code/windows/winhelp.c b/code/windows/help.c similarity index 98% rename from code/windows/winhelp.c rename to code/windows/help.c index df6ac37..bff2ee5 100644 --- a/code/windows/winhelp.c +++ b/code/windows/help.c @@ -1,5 +1,5 @@ /* - * winhelp.c: centralised functions to launch Windows HTML Help files. + * help.c: centralised functions to launch Windows HTML Help files. */ #include @@ -8,7 +8,7 @@ #include #include "putty.h" -#include "win_res.h" +#include "putty-rc.h" #ifdef NO_HTMLHELP diff --git a/code/windows/winhelp.h b/code/windows/help.h similarity index 98% rename from code/windows/winhelp.h rename to code/windows/help.h index 9011df4..0ab0e05 100644 --- a/code/windows/winhelp.h +++ b/code/windows/help.h @@ -1,5 +1,5 @@ /* - * winhelp.h - define Windows Help context names. + * help.h - define Windows Help context names. * Each definition is simply a string which matches up with the * section names in the Halibut source, and is used for HTML Help. */ @@ -26,6 +26,7 @@ #define WINHELP_CTX_keyboard_backspace "config-backspace" #define WINHELP_CTX_keyboard_homeend "config-homeend" #define WINHELP_CTX_keyboard_funkeys "config-funkeys" +#define WINHELP_CTX_keyboard_sharrow "config-sharrow" #define WINHELP_CTX_keyboard_appkeypad "config-appkeypad" #define WINHELP_CTX_keyboard_appcursor "config-appcursor" #define WINHELP_CTX_keyboard_nethack "config-nethack" @@ -162,6 +163,7 @@ #define WINHELP_CTX_ssh_bugs_winadj "config-ssh-bug-winadj" #define WINHELP_CTX_ssh_bugs_chanreq "config-ssh-bug-chanreq" #define WINHELP_CTX_ssh_bugs_oldgex2 "config-ssh-bug-oldgex2" +#define WINHELP_CTX_ssh_bugs_dropstart "config-ssh-bug-dropstart" #define WINHELP_CTX_serial_line "config-serial-line" #define WINHELP_CTX_serial_speed "config-serial-speed" #define WINHELP_CTX_serial_databits "config-serial-databits" diff --git a/code/windows/help.rc2 b/code/windows/help.rc2 new file mode 100644 index 0000000..16bb41f --- /dev/null +++ b/code/windows/help.rc2 @@ -0,0 +1,8 @@ +#include "putty-rc.h" + +#ifdef EMBEDDED_CHM_FILE +ID_CUSTOM_CHMFILE TYPE_CUSTOM_CHMFILE EMBEDDED_CHM_FILE +#define HELPVER " (with embedded help)" +#else +#define HELPVER " (without embedded help)" +#endif diff --git a/code/windows/installer.wxs b/code/windows/installer.wxs index b221320..bfcc06d 100644 --- a/code/windows/installer.wxs +++ b/code/windows/installer.wxs @@ -91,8 +91,16 @@ + + + + + + + +